@lv-x-software-house/x_view 1.2.5 → 1.2.6-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 +581 -529
- package/dist/index.mjs +553 -487
- package/package.json +12 -3
package/dist/index.mjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
// src/XViewScene.jsx
|
|
2
|
-
import
|
|
2
|
+
import React30, {
|
|
3
3
|
useCallback as useCallback4,
|
|
4
|
-
useEffect as
|
|
4
|
+
useEffect as useEffect24,
|
|
5
5
|
useRef as useRef19,
|
|
6
|
-
useState as
|
|
7
|
-
useMemo as
|
|
6
|
+
useState as useState28,
|
|
7
|
+
useMemo as useMemo13
|
|
8
8
|
} from "react";
|
|
9
9
|
import { useRouter, useSearchParams } from "next/navigation";
|
|
10
10
|
import { useSession } from "next-auth/react";
|
|
@@ -79,55 +79,7 @@ function defineAbilityFor(role) {
|
|
|
79
79
|
|
|
80
80
|
// src/logic/x_view_utils.js
|
|
81
81
|
import { useState, useCallback } from "react";
|
|
82
|
-
|
|
83
|
-
// node_modules/uuid/dist/esm-node/rng.js
|
|
84
|
-
import crypto from "crypto";
|
|
85
|
-
var rnds8Pool = new Uint8Array(256);
|
|
86
|
-
var poolPtr = rnds8Pool.length;
|
|
87
|
-
function rng() {
|
|
88
|
-
if (poolPtr > rnds8Pool.length - 16) {
|
|
89
|
-
crypto.randomFillSync(rnds8Pool);
|
|
90
|
-
poolPtr = 0;
|
|
91
|
-
}
|
|
92
|
-
return rnds8Pool.slice(poolPtr, poolPtr += 16);
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
// node_modules/uuid/dist/esm-node/stringify.js
|
|
96
|
-
var byteToHex = [];
|
|
97
|
-
for (let i = 0; i < 256; ++i) {
|
|
98
|
-
byteToHex.push((i + 256).toString(16).slice(1));
|
|
99
|
-
}
|
|
100
|
-
function unsafeStringify(arr, offset = 0) {
|
|
101
|
-
return byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + "-" + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + "-" + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + "-" + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + "-" + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]];
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
// node_modules/uuid/dist/esm-node/native.js
|
|
105
|
-
import crypto2 from "crypto";
|
|
106
|
-
var native_default = {
|
|
107
|
-
randomUUID: crypto2.randomUUID
|
|
108
|
-
};
|
|
109
|
-
|
|
110
|
-
// node_modules/uuid/dist/esm-node/v4.js
|
|
111
|
-
function v4(options, buf, offset) {
|
|
112
|
-
if (native_default.randomUUID && !buf && !options) {
|
|
113
|
-
return native_default.randomUUID();
|
|
114
|
-
}
|
|
115
|
-
options = options || {};
|
|
116
|
-
const rnds = options.random || (options.rng || rng)();
|
|
117
|
-
rnds[6] = rnds[6] & 15 | 64;
|
|
118
|
-
rnds[8] = rnds[8] & 63 | 128;
|
|
119
|
-
if (buf) {
|
|
120
|
-
offset = offset || 0;
|
|
121
|
-
for (let i = 0; i < 16; ++i) {
|
|
122
|
-
buf[offset + i] = rnds[i];
|
|
123
|
-
}
|
|
124
|
-
return buf;
|
|
125
|
-
}
|
|
126
|
-
return unsafeStringify(rnds);
|
|
127
|
-
}
|
|
128
|
-
var v4_default = v4;
|
|
129
|
-
|
|
130
|
-
// src/logic/x_view_utils.js
|
|
82
|
+
import { v4 as uuidv4 } from "uuid";
|
|
131
83
|
import * as THREE2 from "three";
|
|
132
84
|
|
|
133
85
|
// src/logic/x_view_config.js
|
|
@@ -2318,6 +2270,8 @@ var userActionHandlers = {
|
|
|
2318
2270
|
milestones: sceneDataRef.current.milestones || [],
|
|
2319
2271
|
quest_counter: sceneDataRef.current.quest_counter || 1
|
|
2320
2272
|
};
|
|
2273
|
+
sceneDataRef.current.quest_nodes = specificParentData.nodes;
|
|
2274
|
+
sceneDataRef.current.quest_links = specificParentData.links;
|
|
2321
2275
|
await context.actions.save_view_data(
|
|
2322
2276
|
context.sceneSaveUrl,
|
|
2323
2277
|
viewFilePayload
|
|
@@ -2478,15 +2432,15 @@ function createNewCustomProperty(existingProps = []) {
|
|
|
2478
2432
|
switch (nextType) {
|
|
2479
2433
|
case "links":
|
|
2480
2434
|
nextKey = "Links";
|
|
2481
|
-
nextValue = [{ id:
|
|
2435
|
+
nextValue = [{ id: uuidv4(), name: "", value: "" }];
|
|
2482
2436
|
break;
|
|
2483
2437
|
case "images":
|
|
2484
2438
|
nextKey = "Images";
|
|
2485
|
-
nextValue = [{ id:
|
|
2439
|
+
nextValue = [{ id: uuidv4(), name: "1", value: "" }];
|
|
2486
2440
|
break;
|
|
2487
2441
|
case "documents":
|
|
2488
2442
|
nextKey = "Documents";
|
|
2489
|
-
nextValue = [{ id:
|
|
2443
|
+
nextValue = [{ id: uuidv4(), name: "1", value: "" }];
|
|
2490
2444
|
break;
|
|
2491
2445
|
case "date":
|
|
2492
2446
|
nextKey = "Date";
|
|
@@ -2496,14 +2450,14 @@ function createNewCustomProperty(existingProps = []) {
|
|
|
2496
2450
|
nextValue = 0;
|
|
2497
2451
|
break;
|
|
2498
2452
|
case "list":
|
|
2499
|
-
nextValue = [{ id:
|
|
2453
|
+
nextValue = [{ id: uuidv4(), name: "", value: "" }];
|
|
2500
2454
|
break;
|
|
2501
2455
|
default:
|
|
2502
2456
|
nextValue = "";
|
|
2503
2457
|
break;
|
|
2504
2458
|
}
|
|
2505
2459
|
return {
|
|
2506
|
-
id:
|
|
2460
|
+
id: uuidv4(),
|
|
2507
2461
|
key: nextKey,
|
|
2508
2462
|
type: nextType,
|
|
2509
2463
|
value: nextValue,
|
|
@@ -2748,7 +2702,7 @@ function extractCustomPropsFromNode(node) {
|
|
|
2748
2702
|
if (val && typeof val === "object") {
|
|
2749
2703
|
if ("date_interval" in val) {
|
|
2750
2704
|
return {
|
|
2751
|
-
id:
|
|
2705
|
+
id: uuidv4(),
|
|
2752
2706
|
key,
|
|
2753
2707
|
type: "date",
|
|
2754
2708
|
value: {
|
|
@@ -2760,7 +2714,7 @@ function extractCustomPropsFromNode(node) {
|
|
|
2760
2714
|
}
|
|
2761
2715
|
if ("year" in val) {
|
|
2762
2716
|
return {
|
|
2763
|
-
id:
|
|
2717
|
+
id: uuidv4(),
|
|
2764
2718
|
key,
|
|
2765
2719
|
type: "date",
|
|
2766
2720
|
value: { type: "Ano", value: val.year || "" }
|
|
@@ -2768,7 +2722,7 @@ function extractCustomPropsFromNode(node) {
|
|
|
2768
2722
|
}
|
|
2769
2723
|
if ("date" in val) {
|
|
2770
2724
|
return {
|
|
2771
|
-
id:
|
|
2725
|
+
id: uuidv4(),
|
|
2772
2726
|
key,
|
|
2773
2727
|
type: "date",
|
|
2774
2728
|
value: { type: "Data", value: val.date || "" }
|
|
@@ -2776,7 +2730,7 @@ function extractCustomPropsFromNode(node) {
|
|
|
2776
2730
|
}
|
|
2777
2731
|
}
|
|
2778
2732
|
return {
|
|
2779
|
-
id:
|
|
2733
|
+
id: uuidv4(),
|
|
2780
2734
|
key,
|
|
2781
2735
|
type: "date",
|
|
2782
2736
|
value: { type: "Data", value: "" }
|
|
@@ -2784,14 +2738,14 @@ function extractCustomPropsFromNode(node) {
|
|
|
2784
2738
|
}
|
|
2785
2739
|
if (t === "list" || t === "links" || t === "images" || t === "documents") {
|
|
2786
2740
|
const safeList = (val || []).map((item) => ({
|
|
2787
|
-
id: item.id ||
|
|
2741
|
+
id: item.id || uuidv4(),
|
|
2788
2742
|
name: item.name ?? "",
|
|
2789
2743
|
value: item.value ?? ""
|
|
2790
2744
|
}));
|
|
2791
|
-
return { id:
|
|
2745
|
+
return { id: uuidv4(), key, type: t, value: safeList };
|
|
2792
2746
|
}
|
|
2793
2747
|
return {
|
|
2794
|
-
id:
|
|
2748
|
+
id: uuidv4(),
|
|
2795
2749
|
key,
|
|
2796
2750
|
type: t,
|
|
2797
2751
|
value: t === "number" ? Number(val) || 0 : String(val ?? "")
|
|
@@ -3064,16 +3018,16 @@ var processDescriptionForSave = (text, existingSections = []) => {
|
|
|
3064
3018
|
if (existingMatch) {
|
|
3065
3019
|
finalUuid = existingMatch.id;
|
|
3066
3020
|
} else {
|
|
3067
|
-
finalUuid =
|
|
3021
|
+
finalUuid = uuidv4();
|
|
3068
3022
|
}
|
|
3069
3023
|
} else {
|
|
3070
3024
|
finalUuid = numericMap.get(numStr);
|
|
3071
3025
|
if (!finalUuid) {
|
|
3072
|
-
finalUuid =
|
|
3026
|
+
finalUuid = uuidv4();
|
|
3073
3027
|
}
|
|
3074
3028
|
}
|
|
3075
3029
|
if (usedIds.has(finalUuid)) {
|
|
3076
|
-
finalUuid =
|
|
3030
|
+
finalUuid = uuidv4();
|
|
3077
3031
|
}
|
|
3078
3032
|
usedIds.add(finalUuid);
|
|
3079
3033
|
processedSections.push({
|
|
@@ -3184,18 +3138,18 @@ function useResizablePanel({ initialWidth, minWidth, maxWidth }) {
|
|
|
3184
3138
|
function createTimelineEntry(actorId, description, type = "comment", extras = {}) {
|
|
3185
3139
|
const { links = [], images = [], metadata = {} } = extras;
|
|
3186
3140
|
return {
|
|
3187
|
-
id:
|
|
3141
|
+
id: uuidv4(),
|
|
3188
3142
|
type,
|
|
3189
3143
|
timestamp: Date.now(),
|
|
3190
3144
|
actorId,
|
|
3191
3145
|
description,
|
|
3192
3146
|
links: links.map((l) => ({
|
|
3193
|
-
id: l.id ||
|
|
3147
|
+
id: l.id || uuidv4(),
|
|
3194
3148
|
name: l.name || "",
|
|
3195
3149
|
value: l.value || ""
|
|
3196
3150
|
})),
|
|
3197
3151
|
images: images.map((img) => ({
|
|
3198
|
-
id: img.id ||
|
|
3152
|
+
id: img.id || uuidv4(),
|
|
3199
3153
|
name: img.name || "",
|
|
3200
3154
|
value: img.value || ""
|
|
3201
3155
|
}))
|
|
@@ -4422,6 +4376,7 @@ function XViewSidebar({
|
|
|
4422
4376
|
|
|
4423
4377
|
// src/components/AncestryRelationshipPanel.jsx
|
|
4424
4378
|
import React8, { useState as useState9, useEffect as useEffect8, useRef as useRef7 } from "react";
|
|
4379
|
+
import { v4 as uuidv43 } from "uuid";
|
|
4425
4380
|
|
|
4426
4381
|
// src/components/CustomPropertyDisplay.jsx
|
|
4427
4382
|
import React3, { useState as useState4, useRef as useRef3, useEffect as useEffect3 } from "react";
|
|
@@ -5181,6 +5136,7 @@ function SectionImportModal({ isOpen, onClose, onSelect, availableNodes = [], av
|
|
|
5181
5136
|
}
|
|
5182
5137
|
|
|
5183
5138
|
// src/components/DescriptionEditModal.jsx
|
|
5139
|
+
import { v4 as uuidv42 } from "uuid";
|
|
5184
5140
|
var getNextSectionNumber = (currentText) => {
|
|
5185
5141
|
const regex = /\*\/\s*(\d+)(?::[a-zA-Z0-9-]+)?\s*\//g;
|
|
5186
5142
|
let max = 0;
|
|
@@ -5312,7 +5268,7 @@ function DescriptionEditModal({
|
|
|
5312
5268
|
const el = textareaRef.current;
|
|
5313
5269
|
if (!el) return;
|
|
5314
5270
|
const nextNum = getNextSectionNumber(text);
|
|
5315
|
-
const uniqueSuffix =
|
|
5271
|
+
const uniqueSuffix = uuidv42().slice(0, 4);
|
|
5316
5272
|
insertAtCursor(`*/${nextNum}:${uniqueSuffix}/ `);
|
|
5317
5273
|
};
|
|
5318
5274
|
const handleImportSelect = (tags) => {
|
|
@@ -5323,7 +5279,7 @@ function DescriptionEditModal({
|
|
|
5323
5279
|
let currentNum = getNextSectionNumber(currentText);
|
|
5324
5280
|
let blockToInsert = "";
|
|
5325
5281
|
tagsArray.forEach((tag) => {
|
|
5326
|
-
const uniqueSuffix =
|
|
5282
|
+
const uniqueSuffix = uuidv42().slice(0, 4);
|
|
5327
5283
|
blockToInsert += `
|
|
5328
5284
|
*/${currentNum}:${uniqueSuffix}/ ${tag}
|
|
5329
5285
|
`;
|
|
@@ -6683,6 +6639,7 @@ import {
|
|
|
6683
6639
|
FiLink as FiLink4,
|
|
6684
6640
|
FiTrash2 as FiTrash22
|
|
6685
6641
|
} from "react-icons/fi";
|
|
6642
|
+
import { v4 as uuidv44 } from "uuid";
|
|
6686
6643
|
|
|
6687
6644
|
// src/components/AncestryPickerModal.jsx
|
|
6688
6645
|
import React9, { useState as useState10, useMemo as useMemo7, useEffect as useEffect9 } from "react";
|
|
@@ -7719,7 +7676,7 @@ function CreateAncestryPanel({
|
|
|
7719
7676
|
const nodeData = availableNodes.find((n) => String(n.id) === String(nodeId));
|
|
7720
7677
|
const dirSuffix = direction === "left" ? "(Esq)" : "(Dir)";
|
|
7721
7678
|
branch = {
|
|
7722
|
-
id:
|
|
7679
|
+
id: uuidv44(),
|
|
7723
7680
|
name: `Ramifica\xE7\xE3o ${dirSuffix} de ${(nodeData == null ? void 0 : nodeData.name) || "Node"}`,
|
|
7724
7681
|
description: "",
|
|
7725
7682
|
description_sections: [],
|
|
@@ -8498,6 +8455,7 @@ function ImageViewer({ data, onClose }) {
|
|
|
8498
8455
|
|
|
8499
8456
|
// src/components/InSceneCreationForm.jsx
|
|
8500
8457
|
import React13, { useState as useState14, useEffect as useEffect13, useRef as useRef10 } from "react";
|
|
8458
|
+
import { v4 as uuidv45 } from "uuid";
|
|
8501
8459
|
|
|
8502
8460
|
// src/components/ColorPicker.jsx
|
|
8503
8461
|
import React12, { useState as useState13, useEffect as useEffect12, useRef as useRef9 } from "react";
|
|
@@ -9082,6 +9040,7 @@ function InSceneCreationForm({
|
|
|
9082
9040
|
|
|
9083
9041
|
// src/components/InSceneVersionForm.jsx
|
|
9084
9042
|
import React14, { useState as useState15, useEffect as useEffect14, useRef as useRef11 } from "react";
|
|
9043
|
+
import { v4 as uuidv46 } from "uuid";
|
|
9085
9044
|
import { FiPlus as FiPlus4, FiMaximize2 as FiMaximize22, FiCheck as FiCheck8, FiEdit2 as FiEdit25 } from "react-icons/fi";
|
|
9086
9045
|
function InSceneVersionForm({
|
|
9087
9046
|
onSave,
|
|
@@ -9104,7 +9063,7 @@ function InSceneVersionForm({
|
|
|
9104
9063
|
const [description, setDescription] = useState15("");
|
|
9105
9064
|
const [customProps, setCustomProps] = useState15([
|
|
9106
9065
|
{
|
|
9107
|
-
id:
|
|
9066
|
+
id: uuidv46(),
|
|
9108
9067
|
key: "Date",
|
|
9109
9068
|
type: "date",
|
|
9110
9069
|
value: { type: "Data", value: "" },
|
|
@@ -9397,6 +9356,7 @@ function InSceneVersionForm({
|
|
|
9397
9356
|
|
|
9398
9357
|
// src/components/InSceneQuestForm.jsx
|
|
9399
9358
|
import React16, { useState as useState17, useRef as useRef12 } from "react";
|
|
9359
|
+
import { v4 as uuidv47 } from "uuid";
|
|
9400
9360
|
import {
|
|
9401
9361
|
FiPlus as FiPlus6,
|
|
9402
9362
|
FiCheck as FiCheck9,
|
|
@@ -10321,6 +10281,7 @@ function InSceneQuestForm({
|
|
|
10321
10281
|
|
|
10322
10282
|
// src/components/NodeDetailsPanel.jsx
|
|
10323
10283
|
import React17, { useState as useState18, useEffect as useEffect15, useRef as useRef13 } from "react";
|
|
10284
|
+
import { v4 as uuidv48 } from "uuid";
|
|
10324
10285
|
import { FiPlus as FiPlus7, FiMaximize2 as FiMaximize23, FiX as FiX6, FiCheck as FiCheck10, FiImage as FiImage3, FiEdit2 as FiEdit27, FiLoader as FiLoader2, FiBookOpen as FiBookOpen3, FiSun as FiSun2, FiLink as FiLink5, FiDatabase } from "react-icons/fi";
|
|
10325
10286
|
function NodeDetailsPanel({
|
|
10326
10287
|
node,
|
|
@@ -10835,6 +10796,7 @@ function NodeDetailsPanel({
|
|
|
10835
10796
|
|
|
10836
10797
|
// src/components/QuestDetailsPanel.jsx
|
|
10837
10798
|
import React19, { useState as useState19, useEffect as useEffect16, useRef as useRef14 } from "react";
|
|
10799
|
+
import { v4 as uuidv49 } from "uuid";
|
|
10838
10800
|
import { FiPlus as FiPlus8, FiX as FiX7, FiCheck as FiCheck11, FiEdit2 as FiEdit28, FiLoader as FiLoader3, FiBookOpen as FiBookOpen4, FiLink as FiLink7, FiTarget as FiTarget3, FiChevronDown as FiChevronDown7, FiUser as FiUser3, FiSearch as FiSearch7, FiRepeat as FiRepeat2, FiCalendar as FiCalendar2, FiImage as FiImage4 } from "react-icons/fi";
|
|
10839
10801
|
|
|
10840
10802
|
// src/components/QuestTimeline.jsx
|
|
@@ -11285,7 +11247,7 @@ ${noteText}` : noteText : entry.notes,
|
|
|
11285
11247
|
}, 100);
|
|
11286
11248
|
};
|
|
11287
11249
|
const addLinkToNote = () => {
|
|
11288
|
-
setNoteLinks([...noteLinks, { id:
|
|
11250
|
+
setNoteLinks([...noteLinks, { id: uuidv49(), name: "", value: "" }]);
|
|
11289
11251
|
};
|
|
11290
11252
|
const removeLinkFromNote = (id) => {
|
|
11291
11253
|
setNoteLinks(noteLinks.filter((l) => l.id !== id));
|
|
@@ -11294,7 +11256,7 @@ ${noteText}` : noteText : entry.notes,
|
|
|
11294
11256
|
setNoteLinks(noteLinks.map((l) => l.id === id ? { ...l, [field]: val } : l));
|
|
11295
11257
|
};
|
|
11296
11258
|
const addImageToNote = () => {
|
|
11297
|
-
setNoteImages([...noteImages, { id:
|
|
11259
|
+
setNoteImages([...noteImages, { id: uuidv49(), name: "Image", value: "" }]);
|
|
11298
11260
|
};
|
|
11299
11261
|
const removeImageFromNote = (id) => {
|
|
11300
11262
|
setNoteImages(noteImages.filter((img) => img.id !== id));
|
|
@@ -12171,6 +12133,7 @@ function MultiNodeContextMenu({
|
|
|
12171
12133
|
|
|
12172
12134
|
// src/components/RelationshipDetailsPanel.jsx
|
|
12173
12135
|
import React21, { useState as useState21, useEffect as useEffect18, useRef as useRef16, useMemo as useMemo9 } from "react";
|
|
12136
|
+
import { v4 as uuidv410 } from "uuid";
|
|
12174
12137
|
import { FiPlus as FiPlus9, FiEdit2 as FiEdit29, FiLoader as FiLoader4, FiBookOpen as FiBookOpen5 } from "react-icons/fi";
|
|
12175
12138
|
function RelationshipDetailsPanel({
|
|
12176
12139
|
link,
|
|
@@ -12980,10 +12943,10 @@ function AncestryLinkDetailsPanel({ data, onClose, onOpenImageViewer, onOpenRefe
|
|
|
12980
12943
|
}
|
|
12981
12944
|
|
|
12982
12945
|
// src/components/AncestryBoard.jsx
|
|
12983
|
-
import
|
|
12946
|
+
import React28, { useState as useState26, useMemo as useMemo12, useEffect as useEffect23, useRef as useRef18 } from "react";
|
|
12984
12947
|
import {
|
|
12985
|
-
FiSearch as
|
|
12986
|
-
FiLayers as
|
|
12948
|
+
FiSearch as FiSearch9,
|
|
12949
|
+
FiLayers as FiLayers7,
|
|
12987
12950
|
FiCornerUpRight as FiCornerUpRight4,
|
|
12988
12951
|
FiPlay,
|
|
12989
12952
|
FiPlus as FiPlus10,
|
|
@@ -12993,131 +12956,323 @@ import {
|
|
|
12993
12956
|
FiCheckCircle,
|
|
12994
12957
|
FiLoader as FiLoader5,
|
|
12995
12958
|
FiX as FiX8,
|
|
12996
|
-
FiAlertTriangle
|
|
12959
|
+
FiAlertTriangle,
|
|
12960
|
+
FiCheckSquare as FiCheckSquare4,
|
|
12961
|
+
FiBox as FiBox2,
|
|
12962
|
+
FiGitBranch as FiGitBranch4
|
|
12997
12963
|
} from "react-icons/fi";
|
|
12964
|
+
import { v4 as uuidv411 } from "uuid";
|
|
12965
|
+
|
|
12966
|
+
// src/components/MentionEditor.jsx
|
|
12967
|
+
import React27, { useMemo as useMemo11, useEffect as useEffect22 } from "react";
|
|
12968
|
+
import { useEditor, EditorContent, ReactRenderer } from "@tiptap/react";
|
|
12969
|
+
import StarterKit from "@tiptap/starter-kit";
|
|
12970
|
+
import Mention from "@tiptap/extension-mention";
|
|
12971
|
+
import tippy from "tippy.js";
|
|
12972
|
+
|
|
12973
|
+
// src/components/MentionList.jsx
|
|
12974
|
+
import React26, {
|
|
12975
|
+
forwardRef,
|
|
12976
|
+
useEffect as useEffect21,
|
|
12977
|
+
useImperativeHandle,
|
|
12978
|
+
useState as useState25
|
|
12979
|
+
} from "react";
|
|
12980
|
+
import {
|
|
12981
|
+
FiLayers as FiLayers6,
|
|
12982
|
+
FiCheckSquare as FiCheckSquare3,
|
|
12983
|
+
FiBox,
|
|
12984
|
+
FiGitBranch as FiGitBranch3,
|
|
12985
|
+
FiSearch as FiSearch8
|
|
12986
|
+
} from "react-icons/fi";
|
|
12987
|
+
var MentionList = forwardRef((props, ref) => {
|
|
12988
|
+
const [selectedIndex, setSelectedIndex] = useState25(0);
|
|
12989
|
+
const selectItem = (index) => {
|
|
12990
|
+
const item = props.items[index];
|
|
12991
|
+
if (item) {
|
|
12992
|
+
props.command({ id: item.id, label: item.name, type: item.type });
|
|
12993
|
+
}
|
|
12994
|
+
};
|
|
12995
|
+
const upHandler = () => {
|
|
12996
|
+
setSelectedIndex(
|
|
12997
|
+
(selectedIndex + props.items.length - 1) % props.items.length
|
|
12998
|
+
);
|
|
12999
|
+
};
|
|
13000
|
+
const downHandler = () => {
|
|
13001
|
+
setSelectedIndex((selectedIndex + 1) % props.items.length);
|
|
13002
|
+
};
|
|
13003
|
+
const enterHandler = () => {
|
|
13004
|
+
selectItem(selectedIndex);
|
|
13005
|
+
};
|
|
13006
|
+
useEffect21(() => setSelectedIndex(0), [props.items]);
|
|
13007
|
+
useImperativeHandle(ref, () => ({
|
|
13008
|
+
onKeyDown: ({ event }) => {
|
|
13009
|
+
if (event.key === "ArrowUp") {
|
|
13010
|
+
upHandler();
|
|
13011
|
+
return true;
|
|
13012
|
+
}
|
|
13013
|
+
if (event.key === "ArrowDown") {
|
|
13014
|
+
downHandler();
|
|
13015
|
+
return true;
|
|
13016
|
+
}
|
|
13017
|
+
if (event.key === "Enter") {
|
|
13018
|
+
enterHandler();
|
|
13019
|
+
return true;
|
|
13020
|
+
}
|
|
13021
|
+
return false;
|
|
13022
|
+
}
|
|
13023
|
+
}));
|
|
13024
|
+
return /* @__PURE__ */ React26.createElement("div", { className: "z-[3000] bg-slate-900 border border-white/10 rounded-lg shadow-2xl overflow-hidden min-w-[280px] max-w-[400px] animate-in fade-in zoom-in-95 duration-200" }, /* @__PURE__ */ React26.createElement("div", { className: "p-2 border-b border-white/5 bg-slate-950/50 flex items-center gap-2" }, /* @__PURE__ */ React26.createElement(FiSearch8, { className: "text-indigo-400", size: 14 }), /* @__PURE__ */ React26.createElement("span", { className: "text-[10px] uppercase tracking-wider font-bold text-slate-500" }, "Mencionar Recurso")), /* @__PURE__ */ React26.createElement("div", { className: "p-1 max-h-[300px] overflow-y-auto custom-scrollbar" }, props.items.length ? props.items.map((item, index) => {
|
|
13025
|
+
const isQuest = item.type === "quest";
|
|
13026
|
+
const isVersion = item.type === "version";
|
|
13027
|
+
const isNode = item.type === "node";
|
|
13028
|
+
let Icon = FiLayers6;
|
|
13029
|
+
let colorClass = "text-indigo-400";
|
|
13030
|
+
let badgeText = "Ancestralidade";
|
|
13031
|
+
if (isQuest) {
|
|
13032
|
+
Icon = FiCheckSquare3;
|
|
13033
|
+
colorClass = "text-amber-400";
|
|
13034
|
+
badgeText = "Quest";
|
|
13035
|
+
} else if (isVersion) {
|
|
13036
|
+
Icon = FiGitBranch3;
|
|
13037
|
+
colorClass = "text-purple-400";
|
|
13038
|
+
badgeText = "Vers\xE3o";
|
|
13039
|
+
} else if (isNode) {
|
|
13040
|
+
Icon = FiBox;
|
|
13041
|
+
colorClass = "text-emerald-400";
|
|
13042
|
+
badgeText = "Node";
|
|
13043
|
+
}
|
|
13044
|
+
return /* @__PURE__ */ React26.createElement(
|
|
13045
|
+
"button",
|
|
13046
|
+
{
|
|
13047
|
+
className: `
|
|
13048
|
+
w-full flex items-center gap-3 px-3 py-2 text-left rounded-md transition-all
|
|
13049
|
+
${index === selectedIndex ? "bg-indigo-500/20 border border-indigo-500/30 text-white" : "text-slate-400 hover:bg-white/5 border border-transparent"}
|
|
13050
|
+
`,
|
|
13051
|
+
key: item.id,
|
|
13052
|
+
onClick: () => selectItem(index)
|
|
13053
|
+
},
|
|
13054
|
+
/* @__PURE__ */ React26.createElement("div", { className: `shrink-0 w-8 h-8 rounded border border-white/5 flex items-center justify-center bg-slate-800/50 ${colorClass}` }, /* @__PURE__ */ React26.createElement(Icon, { size: 14 })),
|
|
13055
|
+
/* @__PURE__ */ React26.createElement("div", { className: "flex-1 min-w-0" }, /* @__PURE__ */ React26.createElement("div", { className: "flex items-center justify-between gap-2" }, /* @__PURE__ */ React26.createElement("span", { className: "text-sm font-medium truncate" }, item.name), /* @__PURE__ */ React26.createElement("span", { className: `text-[9px] px-1 py-0.5 rounded border border-current opacity-60 ${colorClass}` }, badgeText)))
|
|
13056
|
+
);
|
|
13057
|
+
}) : /* @__PURE__ */ React26.createElement("div", { className: "p-4 text-center text-slate-500 text-sm italic" }, "Nenhum resultado encontrado...")));
|
|
13058
|
+
});
|
|
13059
|
+
MentionList.displayName = "MentionList";
|
|
13060
|
+
var MentionList_default = MentionList;
|
|
13061
|
+
|
|
13062
|
+
// src/components/MentionEditor.jsx
|
|
13063
|
+
var CustomMention = Mention.extend({
|
|
13064
|
+
addAttributes() {
|
|
13065
|
+
var _a;
|
|
13066
|
+
return {
|
|
13067
|
+
...(_a = this.parent) == null ? void 0 : _a.call(this),
|
|
13068
|
+
type: {
|
|
13069
|
+
default: null,
|
|
13070
|
+
parseHTML: (element) => element.getAttribute("data-mention-type"),
|
|
13071
|
+
renderHTML: (attributes) => {
|
|
13072
|
+
if (!attributes.type) {
|
|
13073
|
+
return {};
|
|
13074
|
+
}
|
|
13075
|
+
return {
|
|
13076
|
+
"data-mention-type": attributes.type
|
|
13077
|
+
};
|
|
13078
|
+
}
|
|
13079
|
+
}
|
|
13080
|
+
};
|
|
13081
|
+
}
|
|
13082
|
+
});
|
|
13083
|
+
var MentionEditor = ({
|
|
13084
|
+
initialValue = "",
|
|
13085
|
+
onChange,
|
|
13086
|
+
onPlay,
|
|
13087
|
+
// Mantido para futura expansão se quisermos badges clicáveis reais no editor
|
|
13088
|
+
availableItems = [],
|
|
13089
|
+
canEdit = true,
|
|
13090
|
+
placeholder = "Escreva algo... use @ para mencionar"
|
|
13091
|
+
}) => {
|
|
13092
|
+
const parseInitialContent = (text) => {
|
|
13093
|
+
if (!text) return "<p></p>";
|
|
13094
|
+
const parts = text.split(/(\[\[MENTION:[^\]]+\]\])/g);
|
|
13095
|
+
return parts.map((part) => {
|
|
13096
|
+
const match = part.match(/\[\[MENTION:([^:]+):([^:]+):([^\]]+)\]\]/);
|
|
13097
|
+
if (match) {
|
|
13098
|
+
const [, type, id, label] = match;
|
|
13099
|
+
return `<span data-type="mention" data-id="${id}" data-mention-type="${type}" data-label="${label}">@${label}</span>`;
|
|
13100
|
+
}
|
|
13101
|
+
return part;
|
|
13102
|
+
}).join("");
|
|
13103
|
+
};
|
|
13104
|
+
const content = useMemo11(() => parseInitialContent(initialValue), [initialValue]);
|
|
13105
|
+
const editor = useEditor({
|
|
13106
|
+
extensions: [
|
|
13107
|
+
StarterKit.configure({
|
|
13108
|
+
heading: false,
|
|
13109
|
+
bulletList: false,
|
|
13110
|
+
orderedList: false,
|
|
13111
|
+
codeBlock: false,
|
|
13112
|
+
blockquote: false
|
|
13113
|
+
}),
|
|
13114
|
+
CustomMention.configure({
|
|
13115
|
+
HTMLAttributes: {
|
|
13116
|
+
class: "mention"
|
|
13117
|
+
},
|
|
13118
|
+
suggestion: {
|
|
13119
|
+
items: ({ query }) => {
|
|
13120
|
+
return availableItems.filter(
|
|
13121
|
+
(item) => item.name.toLowerCase().includes(query.toLowerCase())
|
|
13122
|
+
).slice(0, 10);
|
|
13123
|
+
},
|
|
13124
|
+
render: () => {
|
|
13125
|
+
let component;
|
|
13126
|
+
let popup;
|
|
13127
|
+
return {
|
|
13128
|
+
onStart: (props) => {
|
|
13129
|
+
component = new ReactRenderer(MentionList_default, {
|
|
13130
|
+
props,
|
|
13131
|
+
editor: props.editor
|
|
13132
|
+
});
|
|
13133
|
+
if (!props.clientRect) {
|
|
13134
|
+
return;
|
|
13135
|
+
}
|
|
13136
|
+
popup = tippy("body", {
|
|
13137
|
+
getReferenceClientRect: props.clientRect,
|
|
13138
|
+
appendTo: () => document.body,
|
|
13139
|
+
content: component.element,
|
|
13140
|
+
showOnCreate: true,
|
|
13141
|
+
interactive: true,
|
|
13142
|
+
trigger: "manual",
|
|
13143
|
+
placement: "bottom-start"
|
|
13144
|
+
});
|
|
13145
|
+
},
|
|
13146
|
+
onUpdate(props) {
|
|
13147
|
+
component.updateProps(props);
|
|
13148
|
+
if (!props.clientRect) {
|
|
13149
|
+
return;
|
|
13150
|
+
}
|
|
13151
|
+
popup[0].setProps({
|
|
13152
|
+
getReferenceClientRect: props.clientRect
|
|
13153
|
+
});
|
|
13154
|
+
},
|
|
13155
|
+
onKeyDown(props) {
|
|
13156
|
+
var _a;
|
|
13157
|
+
if (props.event.key === "Escape") {
|
|
13158
|
+
popup[0].hide();
|
|
13159
|
+
return true;
|
|
13160
|
+
}
|
|
13161
|
+
return (_a = component == null ? void 0 : component.ref) == null ? void 0 : _a.onKeyDown(props);
|
|
13162
|
+
},
|
|
13163
|
+
onExit() {
|
|
13164
|
+
if (popup && popup[0]) popup[0].destroy();
|
|
13165
|
+
if (component) component.destroy();
|
|
13166
|
+
}
|
|
13167
|
+
};
|
|
13168
|
+
}
|
|
13169
|
+
}
|
|
13170
|
+
})
|
|
13171
|
+
],
|
|
13172
|
+
content,
|
|
13173
|
+
editable: canEdit,
|
|
13174
|
+
onUpdate: ({ editor: editor2 }) => {
|
|
13175
|
+
const serialize = (json) => {
|
|
13176
|
+
if (!json.content) return "";
|
|
13177
|
+
return json.content.map((block) => {
|
|
13178
|
+
if (block.type === "paragraph") {
|
|
13179
|
+
const inner = block.content ? block.content.map((node) => {
|
|
13180
|
+
if (node.type === "text") return node.text;
|
|
13181
|
+
if (node.type === "mention") {
|
|
13182
|
+
return `[[MENTION:${node.attrs.type}:${node.attrs.id}:${node.attrs.label}]]`;
|
|
13183
|
+
}
|
|
13184
|
+
return "";
|
|
13185
|
+
}).join("") : "";
|
|
13186
|
+
return inner;
|
|
13187
|
+
}
|
|
13188
|
+
return "";
|
|
13189
|
+
}).join("\n").trim();
|
|
13190
|
+
};
|
|
13191
|
+
const serialized = serialize(editor2.getJSON());
|
|
13192
|
+
onChange(serialized);
|
|
13193
|
+
}
|
|
13194
|
+
});
|
|
13195
|
+
if (!editor) {
|
|
13196
|
+
return null;
|
|
13197
|
+
}
|
|
13198
|
+
return /* @__PURE__ */ React27.createElement("div", { className: "relative group/editor min-h-[1.5rem] w-full" }, /* @__PURE__ */ React27.createElement(
|
|
13199
|
+
EditorContent,
|
|
13200
|
+
{
|
|
13201
|
+
editor,
|
|
13202
|
+
className: "text-sm text-slate-200 placeholder-slate-600 focus:outline-none"
|
|
13203
|
+
}
|
|
13204
|
+
), /* @__PURE__ */ React27.createElement("style", null, `
|
|
13205
|
+
.tiptap p {
|
|
13206
|
+
margin: 0;
|
|
13207
|
+
min-height: 1.2em;
|
|
13208
|
+
}
|
|
13209
|
+
.tiptap .mention {
|
|
13210
|
+
display: inline-flex;
|
|
13211
|
+
align-items: center;
|
|
13212
|
+
background-color: rgba(99, 102, 241, 0.15);
|
|
13213
|
+
border: 1px solid rgba(99, 102, 241, 0.3);
|
|
13214
|
+
border-radius: 4px;
|
|
13215
|
+
padding: 0 4px;
|
|
13216
|
+
color: #a5b4fc;
|
|
13217
|
+
font-weight: 500;
|
|
13218
|
+
cursor: pointer;
|
|
13219
|
+
margin: 0 2px;
|
|
13220
|
+
transition: all 0.2s;
|
|
13221
|
+
}
|
|
13222
|
+
.tiptap .mention:hover {
|
|
13223
|
+
background-color: rgba(99, 102, 241, 0.25);
|
|
13224
|
+
border-color: rgba(99, 102, 241, 0.5);
|
|
13225
|
+
color: white;
|
|
13226
|
+
}
|
|
13227
|
+
.tiptap:focus {
|
|
13228
|
+
outline: none;
|
|
13229
|
+
}
|
|
13230
|
+
`));
|
|
13231
|
+
};
|
|
13232
|
+
var MentionEditor_default = MentionEditor;
|
|
13233
|
+
|
|
13234
|
+
// src/components/AncestryBoard.jsx
|
|
12998
13235
|
var GroupItem = ({
|
|
12999
13236
|
group,
|
|
13000
13237
|
index,
|
|
13001
|
-
siblings,
|
|
13002
13238
|
onUpdate,
|
|
13003
13239
|
onDelete,
|
|
13004
13240
|
onAddSubgroup,
|
|
13005
13241
|
onIndent,
|
|
13006
13242
|
onOutdent,
|
|
13007
|
-
onRemoveAncestry,
|
|
13008
|
-
onRequestPickAncestry,
|
|
13009
|
-
pickingGroupId,
|
|
13010
13243
|
onPlayAncestry,
|
|
13011
|
-
|
|
13244
|
+
availableMentionItems,
|
|
13012
13245
|
canEdit
|
|
13013
13246
|
}) => {
|
|
13014
13247
|
const canIndent = index > 0;
|
|
13015
|
-
|
|
13016
|
-
const textareaRef = useRef18(null);
|
|
13017
|
-
const adjustHeight = () => {
|
|
13018
|
-
const textarea = textareaRef.current;
|
|
13019
|
-
if (textarea) {
|
|
13020
|
-
textarea.style.height = "auto";
|
|
13021
|
-
textarea.style.height = `${textarea.scrollHeight}px`;
|
|
13022
|
-
}
|
|
13023
|
-
};
|
|
13024
|
-
useEffect21(() => {
|
|
13025
|
-
adjustHeight();
|
|
13026
|
-
}, [group.text]);
|
|
13027
|
-
return /* @__PURE__ */ React26.createElement("div", { className: "flex flex-col gap-2 mb-3 pl-3 border-l border-white/10 relative group/item animate-in fade-in slide-in-from-left-2 duration-300" }, /* @__PURE__ */ React26.createElement("div", { className: "absolute -left-[1px] top-4 w-2 h-px bg-white/20" }), /* @__PURE__ */ React26.createElement(
|
|
13248
|
+
return /* @__PURE__ */ React28.createElement("div", { className: "flex flex-col gap-2 mb-3 pl-3 border-l border-white/10 relative group/item animate-in fade-in slide-in-from-left-2 duration-300" }, /* @__PURE__ */ React28.createElement("div", { className: "absolute -left-[1px] top-4 w-2 h-px bg-white/20" }), /* @__PURE__ */ React28.createElement(
|
|
13028
13249
|
"div",
|
|
13029
13250
|
{
|
|
13030
|
-
className:
|
|
13031
|
-
flex flex-col gap-2 py-2 px-3 transition-all duration-200
|
|
13032
|
-
${isPickingForThisGroup ? "bg-indigo-500/10 border-l-2 border-indigo-500" : "hover:bg-white/5 border-l-2 border-transparent hover:border-white/20"}
|
|
13033
|
-
`
|
|
13251
|
+
className: "flex flex-col gap-2 py-2 px-3 transition-all duration-200 hover:bg-white/5 border-l-2 border-transparent hover:border-white/20"
|
|
13034
13252
|
},
|
|
13035
|
-
/* @__PURE__ */
|
|
13036
|
-
|
|
13253
|
+
/* @__PURE__ */ React28.createElement(
|
|
13254
|
+
MentionEditor_default,
|
|
13037
13255
|
{
|
|
13038
|
-
|
|
13039
|
-
|
|
13040
|
-
|
|
13041
|
-
style: {
|
|
13042
|
-
minHeight: "1.5rem",
|
|
13043
|
-
maxHeight: "250px"
|
|
13256
|
+
initialValue: group.text,
|
|
13257
|
+
onChange: (newText) => {
|
|
13258
|
+
if (canEdit) onUpdate(group.id, { ...group, text: newText });
|
|
13044
13259
|
},
|
|
13045
|
-
|
|
13046
|
-
|
|
13047
|
-
|
|
13048
|
-
|
|
13049
|
-
if (canEdit) onUpdate(group.id, { ...group, text: e.target.value });
|
|
13050
|
-
}
|
|
13260
|
+
onPlay: onPlayAncestry,
|
|
13261
|
+
availableItems: availableMentionItems,
|
|
13262
|
+
canEdit,
|
|
13263
|
+
placeholder: "Escreva sobre este grupo... use @ para mencionar"
|
|
13051
13264
|
}
|
|
13052
13265
|
),
|
|
13053
|
-
|
|
13054
|
-
const isValid = availableIds.has(String(anc.ancestry_id));
|
|
13055
|
-
return /* @__PURE__ */ React26.createElement(
|
|
13056
|
-
"div",
|
|
13057
|
-
{
|
|
13058
|
-
key: anc.ancestry_id,
|
|
13059
|
-
className: `
|
|
13060
|
-
flex items-center gap-2 rounded-md px-3 py-1.5 text-xs transition-all group/card border
|
|
13061
|
-
${isValid ? "bg-slate-800/60 border-white/10 hover:border-indigo-500/30 text-slate-200" : "bg-red-900/10 border-red-500/30 text-red-300/70 hover:bg-red-900/20"}
|
|
13062
|
-
`,
|
|
13063
|
-
title: isValid ? "" : "Esta ancestralidade foi removida ou n\xE3o existe mais."
|
|
13064
|
-
},
|
|
13065
|
-
isValid ? (
|
|
13066
|
-
// [MANTIDO] Botão Play visível para todos
|
|
13067
|
-
/* @__PURE__ */ React26.createElement(
|
|
13068
|
-
"button",
|
|
13069
|
-
{
|
|
13070
|
-
onClick: () => onPlayAncestry(anc.ancestry_id),
|
|
13071
|
-
className: "text-indigo-400 hover:text-white hover:bg-indigo-500 p-1 rounded-full transition-colors",
|
|
13072
|
-
title: "Renderizar no cen\xE1rio"
|
|
13073
|
-
},
|
|
13074
|
-
/* @__PURE__ */ React26.createElement(FiPlay, { size: 10, className: "ml-0.5 fill-current" })
|
|
13075
|
-
)
|
|
13076
|
-
) : /* @__PURE__ */ React26.createElement("div", { className: "p-1 text-red-500 cursor-not-allowed" }, /* @__PURE__ */ React26.createElement(FiAlertTriangle, { size: 10 })),
|
|
13077
|
-
/* @__PURE__ */ React26.createElement(
|
|
13078
|
-
"span",
|
|
13079
|
-
{
|
|
13080
|
-
className: `font-medium truncate max-w-[150px] ${!isValid && "line-through decoration-red-500/50"}`
|
|
13081
|
-
},
|
|
13082
|
-
anc.name
|
|
13083
|
-
),
|
|
13084
|
-
canEdit && /* @__PURE__ */ React26.createElement(React26.Fragment, null, /* @__PURE__ */ React26.createElement(
|
|
13085
|
-
"div",
|
|
13086
|
-
{
|
|
13087
|
-
className: `w-px h-3 mx-0.5 ${isValid ? "bg-white/10" : "bg-red-500/20"}`
|
|
13088
|
-
}
|
|
13089
|
-
), /* @__PURE__ */ React26.createElement(
|
|
13090
|
-
"button",
|
|
13091
|
-
{
|
|
13092
|
-
onClick: () => onRemoveAncestry(group.id, anc.ancestry_id),
|
|
13093
|
-
className: `${isValid ? "text-slate-500 hover:text-red-400" : "text-red-400 hover:text-red-200"} p-0.5 rounded transition-colors`,
|
|
13094
|
-
title: "Remover men\xE7\xE3o"
|
|
13095
|
-
},
|
|
13096
|
-
/* @__PURE__ */ React26.createElement(FiX8, { size: 12 })
|
|
13097
|
-
))
|
|
13098
|
-
);
|
|
13099
|
-
})),
|
|
13100
|
-
canEdit && /* @__PURE__ */ React26.createElement("div", { className: "flex items-center justify-between pt-2 mt-1 border-t border-white/5 opacity-40 group-hover/item:opacity-100 transition-opacity" }, /* @__PURE__ */ React26.createElement("div", { className: "flex items-center gap-1" }, /* @__PURE__ */ React26.createElement(
|
|
13101
|
-
"button",
|
|
13102
|
-
{
|
|
13103
|
-
onClick: () => onRequestPickAncestry(group.id),
|
|
13104
|
-
className: `
|
|
13105
|
-
flex items-center gap-1.5 px-2 py-1 rounded text-xs font-medium transition-colors
|
|
13106
|
-
${isPickingForThisGroup ? "text-indigo-300 animate-pulse" : "text-slate-500 hover:text-indigo-300 hover:bg-indigo-500/10"}
|
|
13107
|
-
`,
|
|
13108
|
-
title: "Adicionar Ancestralidade a este grupo"
|
|
13109
|
-
},
|
|
13110
|
-
isPickingForThisGroup ? /* @__PURE__ */ React26.createElement(FiCheckCircle, { size: 12 }) : /* @__PURE__ */ React26.createElement(FiSearch8, { size: 12 }),
|
|
13111
|
-
isPickingForThisGroup ? "Selecionando..." : "Adicionar"
|
|
13112
|
-
), /* @__PURE__ */ React26.createElement(
|
|
13266
|
+
canEdit && /* @__PURE__ */ React28.createElement("div", { className: "flex items-center justify-between pt-2 mt-1 border-t border-white/5 opacity-0 group-hover/item:opacity-100 transition-opacity" }, /* @__PURE__ */ React28.createElement("div", { className: "flex items-center gap-1" }, /* @__PURE__ */ React28.createElement(
|
|
13113
13267
|
"button",
|
|
13114
13268
|
{
|
|
13115
13269
|
onClick: () => onAddSubgroup(group.id),
|
|
13116
|
-
className: "
|
|
13270
|
+
className: "flex items-center gap-1.5 px-3 py-1.5 text-xs text-slate-500 hover:text-white hover:bg-white/10 rounded-md transition-colors",
|
|
13117
13271
|
title: "Criar Subgrupo"
|
|
13118
13272
|
},
|
|
13119
|
-
/* @__PURE__ */
|
|
13120
|
-
|
|
13273
|
+
/* @__PURE__ */ React28.createElement(FiPlus10, { size: 14 }),
|
|
13274
|
+
/* @__PURE__ */ React28.createElement("span", null, "Adicionar Subgrupo")
|
|
13275
|
+
)), /* @__PURE__ */ React28.createElement("div", { className: "flex items-center gap-1" }, /* @__PURE__ */ React28.createElement(
|
|
13121
13276
|
"button",
|
|
13122
13277
|
{
|
|
13123
13278
|
onClick: () => onIndent(group.id),
|
|
@@ -13125,25 +13280,25 @@ var GroupItem = ({
|
|
|
13125
13280
|
className: `p-1.5 rounded transition-colors ${!canIndent ? "text-slate-800 cursor-not-allowed" : "text-slate-500 hover:text-white hover:bg-white/10"}`,
|
|
13126
13281
|
title: "Aninhar no grupo acima"
|
|
13127
13282
|
},
|
|
13128
|
-
/* @__PURE__ */
|
|
13129
|
-
), /* @__PURE__ */
|
|
13283
|
+
/* @__PURE__ */ React28.createElement(FiArrowRight2, { size: 14 })
|
|
13284
|
+
), /* @__PURE__ */ React28.createElement(
|
|
13130
13285
|
"button",
|
|
13131
13286
|
{
|
|
13132
13287
|
onClick: () => onOutdent(group.id),
|
|
13133
13288
|
className: "p-1.5 text-slate-500 hover:text-white hover:bg-white/10 rounded transition-colors",
|
|
13134
13289
|
title: "Desaninhar"
|
|
13135
13290
|
},
|
|
13136
|
-
/* @__PURE__ */
|
|
13137
|
-
), /* @__PURE__ */
|
|
13291
|
+
/* @__PURE__ */ React28.createElement(FiArrowLeft3, { size: 14 })
|
|
13292
|
+
), /* @__PURE__ */ React28.createElement("div", { className: "w-px h-3 bg-white/10 mx-1" }), /* @__PURE__ */ React28.createElement(
|
|
13138
13293
|
"button",
|
|
13139
13294
|
{
|
|
13140
13295
|
onClick: () => onDelete(group.id),
|
|
13141
13296
|
className: "p-1.5 text-slate-600 hover:text-red-400 hover:bg-red-500/10 rounded transition-colors",
|
|
13142
13297
|
title: "Remover Grupo"
|
|
13143
13298
|
},
|
|
13144
|
-
/* @__PURE__ */
|
|
13299
|
+
/* @__PURE__ */ React28.createElement(FiTrash23, { size: 14 })
|
|
13145
13300
|
)))
|
|
13146
|
-
), group.children && group.children.length > 0 && /* @__PURE__ */
|
|
13301
|
+
), group.children && group.children.length > 0 && /* @__PURE__ */ React28.createElement("div", { className: "ml-2" }, group.children.map((childGroup, idx) => /* @__PURE__ */ React28.createElement(
|
|
13147
13302
|
GroupItem,
|
|
13148
13303
|
{
|
|
13149
13304
|
key: childGroup.id,
|
|
@@ -13155,11 +13310,8 @@ var GroupItem = ({
|
|
|
13155
13310
|
onAddSubgroup,
|
|
13156
13311
|
onIndent,
|
|
13157
13312
|
onOutdent,
|
|
13158
|
-
onRemoveAncestry,
|
|
13159
|
-
onRequestPickAncestry,
|
|
13160
|
-
pickingGroupId,
|
|
13161
13313
|
onPlayAncestry,
|
|
13162
|
-
|
|
13314
|
+
availableMentionItems,
|
|
13163
13315
|
canEdit
|
|
13164
13316
|
}
|
|
13165
13317
|
))));
|
|
@@ -13173,23 +13325,20 @@ function AncestryBoard({
|
|
|
13173
13325
|
initialGroups = [],
|
|
13174
13326
|
onSave,
|
|
13175
13327
|
userRole
|
|
13176
|
-
// [NOVO] Recebe a role do usuário
|
|
13177
13328
|
}) {
|
|
13178
|
-
const [
|
|
13179
|
-
const [
|
|
13180
|
-
const [
|
|
13181
|
-
const
|
|
13182
|
-
const [saveStatus, setSaveStatus] = useState25("idle");
|
|
13183
|
-
const canEdit = useMemo11(() => {
|
|
13329
|
+
const [groups, setGroups] = useState26([]);
|
|
13330
|
+
const [isLoaded, setIsLoaded] = useState26(false);
|
|
13331
|
+
const [saveStatus, setSaveStatus] = useState26("idle");
|
|
13332
|
+
const canEdit = useMemo12(() => {
|
|
13184
13333
|
return userRole !== "viewer";
|
|
13185
13334
|
}, [userRole]);
|
|
13186
|
-
|
|
13335
|
+
useEffect23(() => {
|
|
13187
13336
|
if (initialGroups && !isLoaded) {
|
|
13188
13337
|
setGroups(initialGroups);
|
|
13189
13338
|
setIsLoaded(true);
|
|
13190
13339
|
}
|
|
13191
13340
|
}, [initialGroups, isLoaded]);
|
|
13192
|
-
const nodeNamesMap =
|
|
13341
|
+
const nodeNamesMap = useMemo12(() => {
|
|
13193
13342
|
const map = /* @__PURE__ */ new Map();
|
|
13194
13343
|
if (availableNodes && Array.isArray(availableNodes)) {
|
|
13195
13344
|
availableNodes.forEach((node) => {
|
|
@@ -13200,21 +13349,41 @@ function AncestryBoard({
|
|
|
13200
13349
|
}
|
|
13201
13350
|
return map;
|
|
13202
13351
|
}, [availableNodes]);
|
|
13203
|
-
const availableIds =
|
|
13352
|
+
const availableIds = useMemo12(() => {
|
|
13204
13353
|
return new Set(availableAncestries.map((a) => String(a.ancestry_id)));
|
|
13205
13354
|
}, [availableAncestries]);
|
|
13355
|
+
const availableMentionItems = useMemo12(() => {
|
|
13356
|
+
const ancestries = availableAncestries.map((a) => ({
|
|
13357
|
+
id: String(a.ancestry_id),
|
|
13358
|
+
ancestry_id: a.ancestry_id,
|
|
13359
|
+
name: a.name,
|
|
13360
|
+
description: a.description,
|
|
13361
|
+
type: "ancestry",
|
|
13362
|
+
ancestral_node: a.ancestral_node,
|
|
13363
|
+
is_private: a.is_private
|
|
13364
|
+
}));
|
|
13365
|
+
const nodes = availableNodes.map((n) => {
|
|
13366
|
+
let type = "node";
|
|
13367
|
+
if (n.is_quest) type = "quest";
|
|
13368
|
+
else if (n.is_version) type = "version";
|
|
13369
|
+
return {
|
|
13370
|
+
id: String(n.id),
|
|
13371
|
+
name: n.name,
|
|
13372
|
+
description: n.description,
|
|
13373
|
+
type,
|
|
13374
|
+
raw_node: n
|
|
13375
|
+
};
|
|
13376
|
+
});
|
|
13377
|
+
return [...ancestries, ...nodes];
|
|
13378
|
+
}, [availableAncestries, availableNodes]);
|
|
13206
13379
|
const sanitizeGroups = (groupList) => {
|
|
13207
13380
|
return groupList.map((g) => ({
|
|
13208
13381
|
id: g.id,
|
|
13209
13382
|
text: g.text || "",
|
|
13210
|
-
ancestries: (g.ancestries || []).map((a) => ({
|
|
13211
|
-
ancestry_id: a.ancestry_id,
|
|
13212
|
-
name: a.name
|
|
13213
|
-
})),
|
|
13214
13383
|
children: sanitizeGroups(g.children || [])
|
|
13215
13384
|
}));
|
|
13216
13385
|
};
|
|
13217
|
-
|
|
13386
|
+
useEffect23(() => {
|
|
13218
13387
|
if (!isLoaded || !onSave) return;
|
|
13219
13388
|
const timeoutId = setTimeout(async () => {
|
|
13220
13389
|
setSaveStatus("saving");
|
|
@@ -13232,47 +13401,30 @@ function AncestryBoard({
|
|
|
13232
13401
|
}, 3e3);
|
|
13233
13402
|
return () => clearTimeout(timeoutId);
|
|
13234
13403
|
}, [groups, isLoaded, onSave]);
|
|
13235
|
-
|
|
13404
|
+
useEffect23(() => {
|
|
13236
13405
|
if (!isOpen) return;
|
|
13237
13406
|
const handleKeyDown = (e) => {
|
|
13238
13407
|
if (e.key === "Escape") {
|
|
13239
|
-
|
|
13240
|
-
setPickingGroupId(null);
|
|
13241
|
-
} else {
|
|
13242
|
-
onClose();
|
|
13243
|
-
}
|
|
13408
|
+
onClose();
|
|
13244
13409
|
e.preventDefault();
|
|
13245
13410
|
e.stopPropagation();
|
|
13246
13411
|
}
|
|
13247
13412
|
};
|
|
13248
13413
|
window.addEventListener("keydown", handleKeyDown);
|
|
13249
13414
|
return () => window.removeEventListener("keydown", handleKeyDown);
|
|
13250
|
-
}, [isOpen, onClose
|
|
13251
|
-
const filtered = useMemo11(() => {
|
|
13252
|
-
const term = searchTerm.toLowerCase().trim();
|
|
13253
|
-
return availableAncestries.filter((a) => {
|
|
13254
|
-
if (!term) return true;
|
|
13255
|
-
const nameMatch = a.name && a.name.toLowerCase().includes(term);
|
|
13256
|
-
const descMatch = a.description && a.description.toLowerCase().includes(term);
|
|
13257
|
-
const parentName = nodeNamesMap.get(String(a.ancestral_node)) || "";
|
|
13258
|
-
const parentMatch = parentName.toLowerCase().includes(term);
|
|
13259
|
-
return nameMatch || descMatch || parentMatch;
|
|
13260
|
-
});
|
|
13261
|
-
}, [availableAncestries, searchTerm, nodeNamesMap]);
|
|
13415
|
+
}, [isOpen, onClose]);
|
|
13262
13416
|
const handleAddRootGroup = () => {
|
|
13263
13417
|
const newGroup = {
|
|
13264
|
-
id:
|
|
13418
|
+
id: uuidv411(),
|
|
13265
13419
|
text: "",
|
|
13266
|
-
ancestries: [],
|
|
13267
13420
|
children: []
|
|
13268
13421
|
};
|
|
13269
13422
|
setGroups((prev) => [newGroup, ...prev]);
|
|
13270
13423
|
};
|
|
13271
13424
|
const handleAddSubgroup = (parentId) => {
|
|
13272
13425
|
const newGroup = {
|
|
13273
|
-
id:
|
|
13426
|
+
id: uuidv411(),
|
|
13274
13427
|
text: "",
|
|
13275
|
-
ancestries: [],
|
|
13276
13428
|
children: []
|
|
13277
13429
|
};
|
|
13278
13430
|
const addRecursive = (list) => {
|
|
@@ -13343,88 +13495,49 @@ function AncestryBoard({
|
|
|
13343
13495
|
return newList;
|
|
13344
13496
|
});
|
|
13345
13497
|
};
|
|
13346
|
-
const
|
|
13347
|
-
|
|
13348
|
-
|
|
13349
|
-
|
|
13350
|
-
|
|
13351
|
-
|
|
13352
|
-
const addRecursive = (list) => {
|
|
13353
|
-
return list.map((g) => {
|
|
13354
|
-
if (g.id === pickingGroupId) {
|
|
13355
|
-
const exists = g.ancestries.some(
|
|
13356
|
-
(a) => a.ancestry_id === ancestry.ancestry_id
|
|
13357
|
-
);
|
|
13358
|
-
if (exists) return g;
|
|
13359
|
-
return { ...g, ancestries: [...g.ancestries, ancestry] };
|
|
13360
|
-
}
|
|
13361
|
-
return { ...g, children: addRecursive(g.children) };
|
|
13362
|
-
});
|
|
13363
|
-
};
|
|
13364
|
-
return addRecursive(prev);
|
|
13365
|
-
});
|
|
13366
|
-
setPickingGroupId(null);
|
|
13498
|
+
const handlePlayFromGroup = (item) => {
|
|
13499
|
+
let fullItem = item;
|
|
13500
|
+
if (item.type === "ancestry" || !item.type) {
|
|
13501
|
+
fullItem = availableAncestries.find(
|
|
13502
|
+
(a) => String(a.ancestry_id) === String(item.id || item.ancestry_id)
|
|
13503
|
+
) || item;
|
|
13367
13504
|
} else {
|
|
13368
|
-
|
|
13369
|
-
(
|
|
13370
|
-
) ||
|
|
13371
|
-
onSelect(fullAncestry);
|
|
13505
|
+
fullItem = availableNodes.find(
|
|
13506
|
+
(n) => String(n.id) === String(item.id)
|
|
13507
|
+
) || item;
|
|
13372
13508
|
}
|
|
13373
|
-
|
|
13374
|
-
|
|
13375
|
-
const fullAncestry = availableAncestries.find(
|
|
13376
|
-
(a) => a.ancestry_id === ancestryId
|
|
13377
|
-
);
|
|
13378
|
-
if (fullAncestry && onSelect) {
|
|
13379
|
-
onSelect(fullAncestry);
|
|
13509
|
+
if (fullItem && onSelect) {
|
|
13510
|
+
onSelect(fullItem);
|
|
13380
13511
|
}
|
|
13381
13512
|
};
|
|
13382
|
-
const handleRemoveAncestryFromGroup = (groupId, ancestryId) => {
|
|
13383
|
-
setGroups((prev) => {
|
|
13384
|
-
const removeRecursive = (list) => {
|
|
13385
|
-
return list.map((g) => {
|
|
13386
|
-
if (g.id === groupId) {
|
|
13387
|
-
return {
|
|
13388
|
-
...g,
|
|
13389
|
-
ancestries: g.ancestries.filter(
|
|
13390
|
-
(a) => a.ancestry_id !== ancestryId
|
|
13391
|
-
)
|
|
13392
|
-
};
|
|
13393
|
-
}
|
|
13394
|
-
return { ...g, children: removeRecursive(g.children) };
|
|
13395
|
-
});
|
|
13396
|
-
};
|
|
13397
|
-
return removeRecursive(prev);
|
|
13398
|
-
});
|
|
13399
|
-
};
|
|
13400
13513
|
if (!isOpen) return null;
|
|
13401
|
-
return /* @__PURE__ */
|
|
13514
|
+
return /* @__PURE__ */ React28.createElement(
|
|
13402
13515
|
"div",
|
|
13403
13516
|
{
|
|
13404
13517
|
className: "fixed inset-0 z-[2200] bg-black/80 backdrop-blur-sm flex items-center justify-center p-2",
|
|
13405
13518
|
onClick: onClose
|
|
13406
13519
|
},
|
|
13407
|
-
/* @__PURE__ */
|
|
13520
|
+
/* @__PURE__ */ React28.createElement(
|
|
13408
13521
|
"div",
|
|
13409
13522
|
{
|
|
13410
|
-
className: "bg-slate-950 border border-white/10 rounded-xl w-[
|
|
13523
|
+
className: "bg-slate-950 border border-white/10 rounded-xl w-[90vw] max-w-[1200px] h-[90vh] flex flex-col shadow-2xl overflow-hidden animate-in fade-in zoom-in-95 duration-200",
|
|
13411
13524
|
onClick: (e) => e.stopPropagation()
|
|
13412
13525
|
},
|
|
13413
|
-
/* @__PURE__ */
|
|
13526
|
+
/* @__PURE__ */ React28.createElement("div", { className: "h-14 px-6 border-b border-white/10 bg-slate-900/90 flex items-center justify-between shrink-0" }, /* @__PURE__ */ React28.createElement("div", { className: "flex items-center gap-4" }, /* @__PURE__ */ React28.createElement("h3", { className: "text-base font-semibold text-white flex items-center gap-2 whitespace-nowrap" }, /* @__PURE__ */ React28.createElement(FiLayers7, { className: "text-indigo-400" }), "Ancestry Board"), saveStatus !== "idle" && /* @__PURE__ */ React28.createElement("div", { className: "flex items-center gap-2 animate-in fade-in slide-in-from-left-2 duration-300" }, /* @__PURE__ */ React28.createElement("div", { className: "w-px h-4 bg-white/10 mx-1" }), /* @__PURE__ */ React28.createElement("div", { className: "flex items-center gap-1.5 px-2 py-0.5 rounded-full bg-slate-900/50 border border-white/5" }, saveStatus === "saving" && /* @__PURE__ */ React28.createElement(React28.Fragment, null, /* @__PURE__ */ React28.createElement(
|
|
13414
13527
|
FiLoader5,
|
|
13415
13528
|
{
|
|
13416
13529
|
className: "animate-spin text-indigo-400",
|
|
13417
13530
|
size: 12
|
|
13418
13531
|
}
|
|
13419
|
-
), /* @__PURE__ */
|
|
13532
|
+
), /* @__PURE__ */ React28.createElement("span", { className: "text-[10px] uppercase tracking-wide font-medium text-indigo-300" }, "Salvando")), saveStatus === "saved" && /* @__PURE__ */ React28.createElement(React28.Fragment, null, /* @__PURE__ */ React28.createElement(FiCheckCircle, { className: "text-emerald-400", size: 12 }), /* @__PURE__ */ React28.createElement("span", { className: "text-[10px] uppercase tracking-wide font-medium text-slate-400" }, "Salvo")), saveStatus === "error" && /* @__PURE__ */ React28.createElement(React28.Fragment, null, /* @__PURE__ */ React28.createElement("span", { className: "w-2 h-2 rounded-full bg-red-500" }), /* @__PURE__ */ React28.createElement("span", { className: "text-[10px] uppercase tracking-wide font-medium text-red-400" }, "Erro"))))), /* @__PURE__ */ React28.createElement("div", { className: "flex items-center gap-3" }, canEdit && /* @__PURE__ */ React28.createElement(
|
|
13420
13533
|
"button",
|
|
13421
13534
|
{
|
|
13422
13535
|
onClick: handleAddRootGroup,
|
|
13423
13536
|
className: "\n flex items-center gap-2 px-3 py-1.5 \n bg-white/5 hover:bg-white/10 \n border border-white/10 hover:border-white/20\n backdrop-blur-sm\n text-slate-200 hover:text-white\n rounded-md transition-all duration-200\n text-xs font-medium shadow-sm\n "
|
|
13424
13537
|
},
|
|
13425
|
-
/* @__PURE__ */
|
|
13426
|
-
/* @__PURE__ */
|
|
13427
|
-
), /* @__PURE__ */
|
|
13538
|
+
/* @__PURE__ */ React28.createElement(FiPlus10, { size: 14, className: "text-indigo-400" }),
|
|
13539
|
+
/* @__PURE__ */ React28.createElement("span", { className: "hidden sm:inline" }, "Novo Grupo")
|
|
13540
|
+
), /* @__PURE__ */ React28.createElement(
|
|
13428
13541
|
"button",
|
|
13429
13542
|
{
|
|
13430
13543
|
onClick: onClose,
|
|
@@ -13432,101 +13545,36 @@ function AncestryBoard({
|
|
|
13432
13545
|
},
|
|
13433
13546
|
"\xD7"
|
|
13434
13547
|
))),
|
|
13435
|
-
/* @__PURE__ */
|
|
13436
|
-
"
|
|
13548
|
+
/* @__PURE__ */ React28.createElement("div", { className: "flex flex-1 overflow-hidden bg-slate-900/20" }, /* @__PURE__ */ React28.createElement("div", { className: "flex flex-col flex-1" }, /* @__PURE__ */ React28.createElement("div", { className: "flex-1 overflow-y-auto custom-scrollbar p-8 max-w-[900px] mx-auto w-full space-y-6" }, groups.length === 0 ? /* @__PURE__ */ React28.createElement("div", { className: "flex flex-col items-center justify-center h-full text-slate-500 gap-4 border-2 border-dashed border-white/5 rounded-2xl bg-slate-900/40 p-12" }, /* @__PURE__ */ React28.createElement(FiLayers7, { size: 40, className: "opacity-10 text-indigo-400" }), /* @__PURE__ */ React28.createElement("div", { className: "text-center space-y-1" }, /* @__PURE__ */ React28.createElement("p", { className: "text-sm font-medium text-slate-300" }, "Nenhum grupo criado"), /* @__PURE__ */ React28.createElement("p", { className: "text-xs text-slate-500 max-w-[200px]" }, canEdit ? "Comece organizando sua narrativa criando o primeiro grupo." : "Este board ainda n\xE3o possui conte\xFAdo.")), canEdit && /* @__PURE__ */ React28.createElement(
|
|
13549
|
+
"button",
|
|
13437
13550
|
{
|
|
13438
|
-
|
|
13439
|
-
|
|
13440
|
-
${pickingGroupId ? "w-[25%] border-indigo-500/30" : "w-[20%]"}
|
|
13441
|
-
min-w-[280px] max-w-[500px] bg-slate-900
|
|
13442
|
-
`
|
|
13551
|
+
onClick: handleAddRootGroup,
|
|
13552
|
+
className: "mt-2 px-4 py-2 bg-indigo-500/10 hover:bg-indigo-500/20 text-indigo-400 rounded-lg border border-indigo-500/20 transition-all text-xs font-bold uppercase tracking-wider"
|
|
13443
13553
|
},
|
|
13444
|
-
|
|
13445
|
-
|
|
13446
|
-
{
|
|
13447
|
-
className: `absolute left-3 top-1/2 -translate-y-1/2 transition-colors ${pickingGroupId ? "text-indigo-400" : "text-slate-500 group-focus-within:text-indigo-400"}`
|
|
13448
|
-
}
|
|
13449
|
-
), /* @__PURE__ */ React26.createElement(
|
|
13450
|
-
"input",
|
|
13451
|
-
{
|
|
13452
|
-
type: "text",
|
|
13453
|
-
placeholder: pickingGroupId ? "Pesquise para adicionar..." : "Pesquisar ancestralidade...",
|
|
13454
|
-
className: `
|
|
13455
|
-
w-full rounded-md pl-9 pr-4 py-2 text-sm transition-all focus:outline-none focus:ring-1 focus:ring-indigo-500 border
|
|
13456
|
-
${pickingGroupId ? "bg-indigo-950/30 border-indigo-500/30 text-white placeholder-indigo-300/50" : "bg-slate-950 border-white/10 text-slate-200 placeholder-slate-600"}
|
|
13457
|
-
`,
|
|
13458
|
-
value: searchTerm,
|
|
13459
|
-
onChange: (e) => setSearchTerm(e.target.value),
|
|
13460
|
-
autoFocus: !pickingGroupId
|
|
13461
|
-
}
|
|
13462
|
-
))),
|
|
13463
|
-
/* @__PURE__ */ React26.createElement("div", { className: "flex-1 overflow-y-auto custom-scrollbar p-3 space-y-2" }, filtered.map((anc) => {
|
|
13464
|
-
const parentNodeName = nodeNamesMap.get(String(anc.ancestral_node)) || "Node Desconhecido";
|
|
13465
|
-
const isPicking = !!pickingGroupId;
|
|
13466
|
-
return /* @__PURE__ */ React26.createElement(
|
|
13467
|
-
"div",
|
|
13468
|
-
{
|
|
13469
|
-
key: anc.ancestry_id,
|
|
13470
|
-
onClick: () => {
|
|
13471
|
-
if (isPicking) handleSelectAncestry(anc);
|
|
13472
|
-
},
|
|
13473
|
-
className: `
|
|
13474
|
-
group relative flex items-start gap-3 p-3 text-left rounded-lg border transition-all duration-200
|
|
13475
|
-
${isPicking ? "border-indigo-500/30 bg-indigo-500/5 hover:bg-indigo-500/20 hover:border-indigo-400 cursor-pointer" : "border-white/5 bg-slate-800/40 hover:bg-indigo-600/10 hover:border-indigo-500/30 cursor-default"}
|
|
13476
|
-
`
|
|
13477
|
-
},
|
|
13478
|
-
/* @__PURE__ */ React26.createElement(
|
|
13479
|
-
"div",
|
|
13480
|
-
{
|
|
13481
|
-
className: `
|
|
13482
|
-
mt-0.5 w-8 h-8 rounded-md grid place-content-center shrink-0 border transition-all shadow-lg
|
|
13483
|
-
${isPicking ? "bg-indigo-500 text-white border-indigo-400" : "bg-slate-800 text-indigo-400 border-white/5 group-hover:bg-indigo-500 group-hover:text-white"}
|
|
13484
|
-
`
|
|
13485
|
-
},
|
|
13486
|
-
isPicking ? /* @__PURE__ */ React26.createElement(FiPlus10, { size: 16 }) : /* @__PURE__ */ React26.createElement(FiLayers6, { size: 14 })
|
|
13487
|
-
),
|
|
13488
|
-
/* @__PURE__ */ React26.createElement("div", { className: "flex-1 min-w-0 pb-2" }, /* @__PURE__ */ React26.createElement("div", { className: "flex items-center justify-between gap-2" }, /* @__PURE__ */ React26.createElement("h4", { className: "text-sm font-medium text-slate-200 group-hover:text-white truncate transition-colors" }, anc.name || "Sem Nome"), anc.is_private && /* @__PURE__ */ React26.createElement("span", { className: "text-[9px] px-1 py-0.5 rounded bg-amber-500/10 text-amber-300 border border-amber-500/20" }, "Priv")), /* @__PURE__ */ React26.createElement("div", { className: "flex items-center gap-1.5 mt-0.5 text-[11px] text-slate-500 group-hover:text-indigo-200/70 transition-colors" }, /* @__PURE__ */ React26.createElement(FiCornerUpRight4, { size: 10 }), /* @__PURE__ */ React26.createElement("span", { className: "truncate max-w-[120px]" }, parentNodeName)), anc.description && /* @__PURE__ */ React26.createElement("p", { className: "mt-1.5 text-[11px] text-slate-400 line-clamp-2 leading-relaxed opacity-80" }, anc.description)),
|
|
13489
|
-
!isPicking && /* @__PURE__ */ React26.createElement(
|
|
13490
|
-
"button",
|
|
13491
|
-
{
|
|
13492
|
-
onClick: (e) => {
|
|
13493
|
-
e.stopPropagation();
|
|
13494
|
-
handleSelectAncestry(anc);
|
|
13495
|
-
},
|
|
13496
|
-
className: "absolute right-2 bottom-2 opacity-0 group-hover:opacity-100 transition-all duration-300 transform translate-y-2 group-hover:translate-y-0 z-10",
|
|
13497
|
-
title: "Renderizar Ancestralidade"
|
|
13498
|
-
},
|
|
13499
|
-
/* @__PURE__ */ React26.createElement("div", { className: "bg-indigo-500 text-white p-2 rounded-full shadow-lg hover:bg-indigo-400 hover:scale-110 transition-all" }, /* @__PURE__ */ React26.createElement(FiPlay, { size: 14, className: "ml-0.5" }))
|
|
13500
|
-
)
|
|
13501
|
-
);
|
|
13502
|
-
}))
|
|
13503
|
-
), /* @__PURE__ */ React26.createElement("div", { className: "flex flex-col flex-1 bg-slate-950/30" }, /* @__PURE__ */ React26.createElement("div", { className: "flex-1 overflow-y-auto custom-scrollbar p-6 space-y-4" }, groups.length === 0 ? /* @__PURE__ */ React26.createElement("div", { className: "flex flex-col items-center justify-center h-full text-slate-500 gap-3 border-2 border-dashed border-white/5 rounded-xl m-4 bg-slate-900/20" }, /* @__PURE__ */ React26.createElement(FiLayers6, { size: 24, className: "opacity-20" }), /* @__PURE__ */ React26.createElement("p", { className: "text-xs text-center px-4" }, canEdit ? /* @__PURE__ */ React26.createElement(React26.Fragment, null, "Nenhum grupo criado.", /* @__PURE__ */ React26.createElement("br", null), 'Use o bot\xE3o "Novo Grupo" acima.') : /* @__PURE__ */ React26.createElement(React26.Fragment, null, "Nenhum grupo dispon\xEDvel para visualiza\xE7\xE3o."))) : groups.map((group, index) => /* @__PURE__ */ React26.createElement(
|
|
13554
|
+
"Criar Primeiro Grupo"
|
|
13555
|
+
)) : groups.map((group, index) => /* @__PURE__ */ React28.createElement(
|
|
13504
13556
|
GroupItem,
|
|
13505
13557
|
{
|
|
13506
13558
|
key: group.id,
|
|
13507
13559
|
index,
|
|
13508
13560
|
group,
|
|
13509
|
-
siblings: groups,
|
|
13510
13561
|
onUpdate: handleUpdateGroup,
|
|
13511
13562
|
onDelete: handleDeleteGroup,
|
|
13512
13563
|
onAddSubgroup: handleAddSubgroup,
|
|
13513
13564
|
onIndent: handleIndent,
|
|
13514
13565
|
onOutdent: handleOutdent,
|
|
13515
|
-
onRemoveAncestry: handleRemoveAncestryFromGroup,
|
|
13516
|
-
onRequestPickAncestry: handleRequestPick,
|
|
13517
|
-
pickingGroupId,
|
|
13518
13566
|
onPlayAncestry: handlePlayFromGroup,
|
|
13519
|
-
|
|
13567
|
+
availableMentionItems,
|
|
13520
13568
|
canEdit
|
|
13521
13569
|
}
|
|
13522
13570
|
))))),
|
|
13523
|
-
/* @__PURE__ */
|
|
13571
|
+
/* @__PURE__ */ React28.createElement("div", { className: "px-6 py-3 border-t border-white/10 bg-slate-950/50 text-[10px] uppercase tracking-widest font-bold text-slate-600 flex justify-between items-center flex-shrink-0" }, /* @__PURE__ */ React28.createElement("div", { className: "flex items-center gap-4" }, /* @__PURE__ */ React28.createElement("span", { className: "flex items-center gap-1.5" }, /* @__PURE__ */ React28.createElement("div", { className: "w-1.5 h-1.5 rounded-full bg-indigo-500" }), " ", availableMentionItems.length, " RECURSOS DISPON\xCDVEIS"), /* @__PURE__ */ React28.createElement("span", { className: "flex items-center gap-1.5" }, /* @__PURE__ */ React28.createElement("div", { className: "w-1.5 h-1.5 rounded-full bg-emerald-500" }), " ", groups.length, " GRUPOS PRINCIPAIS")), /* @__PURE__ */ React28.createElement("span", { className: "text-slate-700" }, "X.VIEW :: ANCESTRY BOARD ENGINE"))
|
|
13524
13572
|
)
|
|
13525
13573
|
);
|
|
13526
13574
|
}
|
|
13527
13575
|
|
|
13528
13576
|
// src/components/MilestoneManager.jsx
|
|
13529
|
-
import
|
|
13577
|
+
import React29, { useState as useState27 } from "react";
|
|
13530
13578
|
import { FiTarget as FiTarget4, FiPlus as FiPlus11, FiTrash2 as FiTrash24, FiX as FiX9, FiCheck as FiCheck12, FiPauseCircle, FiPlayCircle } from "react-icons/fi";
|
|
13531
13579
|
function MilestoneManager({
|
|
13532
13580
|
isOpen,
|
|
@@ -13535,7 +13583,7 @@ function MilestoneManager({
|
|
|
13535
13583
|
onUpdateMilestones = () => {
|
|
13536
13584
|
}
|
|
13537
13585
|
}) {
|
|
13538
|
-
const [newMilestoneName, setNewMilestoneName] =
|
|
13586
|
+
const [newMilestoneName, setNewMilestoneName] = useState27("");
|
|
13539
13587
|
const handleAddMilestone = () => {
|
|
13540
13588
|
if (!newMilestoneName.trim()) return;
|
|
13541
13589
|
const newMilestone = {
|
|
@@ -13560,27 +13608,27 @@ function MilestoneManager({
|
|
|
13560
13608
|
};
|
|
13561
13609
|
if (!isOpen) return null;
|
|
13562
13610
|
const swallow = (e) => e.stopPropagation();
|
|
13563
|
-
return /* @__PURE__ */
|
|
13611
|
+
return /* @__PURE__ */ React29.createElement(
|
|
13564
13612
|
"div",
|
|
13565
13613
|
{
|
|
13566
13614
|
className: "fixed inset-0 z-50 flex items-center justify-center p-4 bg-slate-950/40 backdrop-blur-sm animate-in fade-in duration-300",
|
|
13567
13615
|
onClick: onClose
|
|
13568
13616
|
},
|
|
13569
|
-
/* @__PURE__ */
|
|
13617
|
+
/* @__PURE__ */ React29.createElement(
|
|
13570
13618
|
"div",
|
|
13571
13619
|
{
|
|
13572
13620
|
className: "w-full max-w-lg bg-slate-900/90 backdrop-blur-xl border border-white/10 rounded-2xl shadow-2xl flex flex-col max-h-[85vh] animate-in zoom-in-95 duration-300",
|
|
13573
13621
|
onClick: swallow
|
|
13574
13622
|
},
|
|
13575
|
-
/* @__PURE__ */
|
|
13623
|
+
/* @__PURE__ */ React29.createElement("div", { className: "px-6 py-4 border-b border-white/10 flex items-center justify-between" }, /* @__PURE__ */ React29.createElement("div", { className: "flex items-center gap-3" }, /* @__PURE__ */ React29.createElement("div", { className: "p-2 rounded-lg bg-indigo-500/20 text-indigo-400" }, /* @__PURE__ */ React29.createElement(FiTarget4, { size: 20 })), /* @__PURE__ */ React29.createElement("div", null, /* @__PURE__ */ React29.createElement("h2", { className: "text-lg font-semibold text-slate-100" }, "Milestones"), /* @__PURE__ */ React29.createElement("p", { className: "text-xs text-slate-400" }, "Gerencie os marcos do seu cen\xE1rio"))), /* @__PURE__ */ React29.createElement(
|
|
13576
13624
|
"button",
|
|
13577
13625
|
{
|
|
13578
13626
|
onClick: onClose,
|
|
13579
13627
|
className: "p-2 rounded-full hover:bg-white/10 text-slate-400 hover:text-white transition-colors"
|
|
13580
13628
|
},
|
|
13581
|
-
/* @__PURE__ */
|
|
13629
|
+
/* @__PURE__ */ React29.createElement(FiX9, { size: 20 })
|
|
13582
13630
|
)),
|
|
13583
|
-
/* @__PURE__ */
|
|
13631
|
+
/* @__PURE__ */ React29.createElement("div", { className: "px-6 py-5 bg-white/5 border-b border-white/5" }, /* @__PURE__ */ React29.createElement("div", { className: "flex gap-2" }, /* @__PURE__ */ React29.createElement(
|
|
13584
13632
|
"input",
|
|
13585
13633
|
{
|
|
13586
13634
|
type: "text",
|
|
@@ -13590,47 +13638,47 @@ function MilestoneManager({
|
|
|
13590
13638
|
placeholder: "Adicionar novo milestone...",
|
|
13591
13639
|
className: "flex-1 bg-slate-800/50 border border-white/10 rounded-xl px-4 py-2.5 text-sm text-slate-100 placeholder:text-slate-500 focus:outline-none focus:ring-2 focus:ring-indigo-500/40 focus:border-indigo-500/50 transition-all shadow-inner"
|
|
13592
13640
|
}
|
|
13593
|
-
), /* @__PURE__ */
|
|
13641
|
+
), /* @__PURE__ */ React29.createElement(
|
|
13594
13642
|
"button",
|
|
13595
13643
|
{
|
|
13596
13644
|
onClick: handleAddMilestone,
|
|
13597
13645
|
disabled: !newMilestoneName.trim(),
|
|
13598
13646
|
className: "px-4 py-2.5 rounded-xl bg-indigo-600 hover:bg-indigo-500 disabled:opacity-30 disabled:cursor-not-allowed text-white text-sm font-medium transition-all flex items-center gap-2 shadow-lg shadow-indigo-500/20 active:scale-95"
|
|
13599
13647
|
},
|
|
13600
|
-
/* @__PURE__ */
|
|
13648
|
+
/* @__PURE__ */ React29.createElement(FiPlus11, { size: 18 }),
|
|
13601
13649
|
"Adicionar"
|
|
13602
13650
|
))),
|
|
13603
|
-
/* @__PURE__ */
|
|
13651
|
+
/* @__PURE__ */ React29.createElement("div", { className: "flex-1 overflow-y-auto px-6 py-4 custom-scrollbar" }, milestones.length > 0 ? /* @__PURE__ */ React29.createElement("div", { className: "space-y-3" }, milestones.map((ms) => /* @__PURE__ */ React29.createElement(
|
|
13604
13652
|
"div",
|
|
13605
13653
|
{
|
|
13606
13654
|
key: ms.id,
|
|
13607
13655
|
className: `group flex items-center justify-between p-4 rounded-xl border transition-all duration-200 ${ms.status === "active" ? "bg-slate-800/40 border-indigo-500/20 hover:border-indigo-500/40" : "bg-slate-900/40 border-white/5 opacity-60 grayscale-[0.3]"}`
|
|
13608
13656
|
},
|
|
13609
|
-
/* @__PURE__ */
|
|
13657
|
+
/* @__PURE__ */ React29.createElement("div", { className: "flex items-center gap-3 min-w-0" }, /* @__PURE__ */ React29.createElement(
|
|
13610
13658
|
"div",
|
|
13611
13659
|
{
|
|
13612
13660
|
className: `w-2 h-2 rounded-full shrink-0 ${ms.status === "active" ? "bg-indigo-400 shadow-[0_0_8px_rgba(129,140,248,0.6)]" : "bg-slate-600"}`
|
|
13613
13661
|
}
|
|
13614
|
-
), /* @__PURE__ */
|
|
13615
|
-
/* @__PURE__ */
|
|
13662
|
+
), /* @__PURE__ */ React29.createElement("div", { className: "flex flex-col min-w-0" }, /* @__PURE__ */ React29.createElement("span", { className: `text-sm font-medium truncate ${ms.status === "active" ? "text-slate-100" : "text-slate-400 line-through"}` }, ms.name), /* @__PURE__ */ React29.createElement("span", { className: "text-[10px] text-slate-500 uppercase tracking-wider" }, ms.status === "active" ? "Ativo" : "Inativo"))),
|
|
13663
|
+
/* @__PURE__ */ React29.createElement("div", { className: "flex items-center gap-2" }, /* @__PURE__ */ React29.createElement(
|
|
13616
13664
|
"button",
|
|
13617
13665
|
{
|
|
13618
13666
|
onClick: () => handleToggleMilestoneStatus(ms.id),
|
|
13619
13667
|
className: `p-2 rounded-lg transition-all ${ms.status === "active" ? "hover:bg-slate-700 text-slate-400" : "hover:bg-indigo-500/20 text-indigo-400"}`,
|
|
13620
13668
|
title: ms.status === "active" ? "Inativar" : "Ativar"
|
|
13621
13669
|
},
|
|
13622
|
-
ms.status === "active" ? /* @__PURE__ */
|
|
13623
|
-
), /* @__PURE__ */
|
|
13670
|
+
ms.status === "active" ? /* @__PURE__ */ React29.createElement(FiPauseCircle, { size: 18 }) : /* @__PURE__ */ React29.createElement(FiPlayCircle, { size: 18 })
|
|
13671
|
+
), /* @__PURE__ */ React29.createElement(
|
|
13624
13672
|
"button",
|
|
13625
13673
|
{
|
|
13626
13674
|
onClick: () => handleRemoveMilestone(ms.id),
|
|
13627
13675
|
className: "p-2 rounded-lg hover:bg-red-500/20 text-slate-500 hover:text-red-400 transition-all",
|
|
13628
13676
|
title: "Remover"
|
|
13629
13677
|
},
|
|
13630
|
-
/* @__PURE__ */
|
|
13678
|
+
/* @__PURE__ */ React29.createElement(FiTrash24, { size: 18 })
|
|
13631
13679
|
))
|
|
13632
|
-
))) : /* @__PURE__ */
|
|
13633
|
-
/* @__PURE__ */
|
|
13680
|
+
))) : /* @__PURE__ */ React29.createElement("div", { className: "flex flex-col items-center justify-center py-12 text-center" }, /* @__PURE__ */ React29.createElement("div", { className: "p-4 rounded-full bg-slate-800/30 text-slate-600 mb-4" }, /* @__PURE__ */ React29.createElement(FiTarget4, { size: 40 })), /* @__PURE__ */ React29.createElement("h3", { className: "text-slate-400 font-medium" }, "Nenhum milestone definido"), /* @__PURE__ */ React29.createElement("p", { className: "text-xs text-slate-600 max-w-[200px] mt-1 italic" }, "Defina marcos importantes para orientar o progresso do projeto."))),
|
|
13681
|
+
/* @__PURE__ */ React29.createElement("div", { className: "px-6 py-4 border-t border-white/5 bg-slate-900/50 flex items-center justify-between rounded-b-2xl" }, /* @__PURE__ */ React29.createElement("div", { className: "flex gap-4" }, /* @__PURE__ */ React29.createElement("div", { className: "flex items-center gap-1.5" }, /* @__PURE__ */ React29.createElement("span", { className: "text-[10px] text-slate-500 uppercase tracking-widest" }, "Total:"), /* @__PURE__ */ React29.createElement("span", { className: "text-xs font-bold text-slate-300" }, milestones.length)), /* @__PURE__ */ React29.createElement("div", { className: "flex items-center gap-1.5" }, /* @__PURE__ */ React29.createElement("span", { className: "text-[10px] text-slate-500 uppercase tracking-widest" }, "Ativos:"), /* @__PURE__ */ React29.createElement("span", { className: "text-xs font-bold text-indigo-400" }, milestones.filter((m) => m.status === "active").length))))
|
|
13634
13682
|
)
|
|
13635
13683
|
);
|
|
13636
13684
|
}
|
|
@@ -13716,13 +13764,13 @@ function XViewScene({
|
|
|
13716
13764
|
check_user_permission,
|
|
13717
13765
|
get_view_members
|
|
13718
13766
|
}) {
|
|
13719
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l;
|
|
13767
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m;
|
|
13720
13768
|
const { data: session, status } = useSession();
|
|
13721
13769
|
const router = useRouter();
|
|
13722
13770
|
const searchParams = useSearchParams();
|
|
13723
13771
|
const focusNodeId = searchParams == null ? void 0 : searchParams.get("focus");
|
|
13724
13772
|
const focusAncestryId = searchParams == null ? void 0 : searchParams.get("ancestry");
|
|
13725
|
-
const viewParams =
|
|
13773
|
+
const viewParams = useMemo13(() => {
|
|
13726
13774
|
if (encryptedConfig) {
|
|
13727
13775
|
const data = decryptData(encryptedConfig);
|
|
13728
13776
|
if (data) {
|
|
@@ -13731,7 +13779,7 @@ function XViewScene({
|
|
|
13731
13779
|
}
|
|
13732
13780
|
return null;
|
|
13733
13781
|
}, [encryptedConfig, session]);
|
|
13734
|
-
|
|
13782
|
+
useEffect24(() => {
|
|
13735
13783
|
async function verifyPermission() {
|
|
13736
13784
|
if (!viewParams || !session || !check_user_permission) return;
|
|
13737
13785
|
const { id, type, owner_id } = viewParams;
|
|
@@ -13768,21 +13816,21 @@ function XViewScene({
|
|
|
13768
13816
|
setIsLoading(false);
|
|
13769
13817
|
}
|
|
13770
13818
|
}, [viewParams, session, status, check_user_permission]);
|
|
13771
|
-
const sceneConfigId =
|
|
13772
|
-
const ownerId =
|
|
13773
|
-
const dbSaveUrl =
|
|
13819
|
+
const sceneConfigId = useMemo13(() => (viewParams == null ? void 0 : viewParams.id) || null, [viewParams]);
|
|
13820
|
+
const ownerId = useMemo13(() => (viewParams == null ? void 0 : viewParams.owner_id) || null, [viewParams]);
|
|
13821
|
+
const dbSaveUrl = useMemo13(() => {
|
|
13774
13822
|
if (ownerId && sceneConfigId) {
|
|
13775
13823
|
return `x_view_dbs/${ownerId}/${sceneConfigId}`;
|
|
13776
13824
|
}
|
|
13777
13825
|
return null;
|
|
13778
13826
|
}, [ownerId, sceneConfigId]);
|
|
13779
|
-
const sceneSaveUrl =
|
|
13827
|
+
const sceneSaveUrl = useMemo13(() => {
|
|
13780
13828
|
if (ownerId && sceneConfigId) {
|
|
13781
13829
|
return `x_view_scenes/${ownerId}/${sceneConfigId}`;
|
|
13782
13830
|
}
|
|
13783
13831
|
return null;
|
|
13784
13832
|
}, [ownerId, sceneConfigId]);
|
|
13785
|
-
const ancestry_save_url =
|
|
13833
|
+
const ancestry_save_url = useMemo13(() => {
|
|
13786
13834
|
if (ownerId && sceneConfigId) {
|
|
13787
13835
|
return `x_view_ancestry/${ownerId}/${sceneConfigId}`;
|
|
13788
13836
|
}
|
|
@@ -13791,42 +13839,42 @@ function XViewScene({
|
|
|
13791
13839
|
const sceneDataRef = useRef19(null);
|
|
13792
13840
|
const parentDataRef = useRef19(null);
|
|
13793
13841
|
const ancestryDataRef = useRef19(null);
|
|
13794
|
-
const [isLoading, setIsLoading] =
|
|
13795
|
-
const [permissionStatus, setPermissionStatus] =
|
|
13796
|
-
const [userPermissionRole, setUserPermissionRole] =
|
|
13797
|
-
const [viewMembers, setViewMembers] =
|
|
13798
|
-
const [isInitialized, setIsInitialized] =
|
|
13799
|
-
const [sceneVersion, setSceneVersion] =
|
|
13800
|
-
const [contextMenu, setContextMenu] =
|
|
13842
|
+
const [isLoading, setIsLoading] = useState28(true);
|
|
13843
|
+
const [permissionStatus, setPermissionStatus] = useState28("loading");
|
|
13844
|
+
const [userPermissionRole, setUserPermissionRole] = useState28(null);
|
|
13845
|
+
const [viewMembers, setViewMembers] = useState28([]);
|
|
13846
|
+
const [isInitialized, setIsInitialized] = useState28(false);
|
|
13847
|
+
const [sceneVersion, setSceneVersion] = useState28(0);
|
|
13848
|
+
const [contextMenu, setContextMenu] = useState28({
|
|
13801
13849
|
visible: false,
|
|
13802
13850
|
x: 0,
|
|
13803
13851
|
y: 0,
|
|
13804
13852
|
nodeData: null
|
|
13805
13853
|
});
|
|
13806
|
-
const [multiContextMenu, setMultiContextMenu] =
|
|
13854
|
+
const [multiContextMenu, setMultiContextMenu] = useState28({
|
|
13807
13855
|
visible: false,
|
|
13808
13856
|
x: 0,
|
|
13809
13857
|
y: 0,
|
|
13810
13858
|
nodeIds: null
|
|
13811
13859
|
});
|
|
13812
|
-
const [relationshipMenu, setRelationshipMenu] =
|
|
13860
|
+
const [relationshipMenu, setRelationshipMenu] = useState28({
|
|
13813
13861
|
visible: false,
|
|
13814
13862
|
x: 0,
|
|
13815
13863
|
y: 0,
|
|
13816
13864
|
linkObject: null
|
|
13817
13865
|
});
|
|
13818
|
-
const [creationMode, setCreationMode] =
|
|
13866
|
+
const [creationMode, setCreationMode] = useState28({
|
|
13819
13867
|
isActive: false,
|
|
13820
13868
|
sourceNodeData: null
|
|
13821
13869
|
});
|
|
13822
|
-
const [versionMode, setVersionMode] =
|
|
13870
|
+
const [versionMode, setVersionMode] = useState28({
|
|
13823
13871
|
isActive: false,
|
|
13824
13872
|
sourceNodeData: null
|
|
13825
13873
|
});
|
|
13826
|
-
const [questMode, setQuestMode] =
|
|
13827
|
-
const [hasFocusedInitial, setHasFocusedInitial] =
|
|
13828
|
-
const [hasOpenedInitialAncestry, setHasOpenedInitialAncestry] =
|
|
13829
|
-
const [ancestryMode, setAncestryMode] =
|
|
13874
|
+
const [questMode, setQuestMode] = useState28({ isActive: false });
|
|
13875
|
+
const [hasFocusedInitial, setHasFocusedInitial] = useState28(false);
|
|
13876
|
+
const [hasOpenedInitialAncestry, setHasOpenedInitialAncestry] = useState28(false);
|
|
13877
|
+
const [ancestryMode, setAncestryMode] = useState28({
|
|
13830
13878
|
isActive: false,
|
|
13831
13879
|
tree: null,
|
|
13832
13880
|
selectedParentId: null,
|
|
@@ -13837,38 +13885,38 @@ function XViewScene({
|
|
|
13837
13885
|
ancestryDescriptionSections: [],
|
|
13838
13886
|
isAddingNodes: false
|
|
13839
13887
|
});
|
|
13840
|
-
const [readingMode, setReadingMode] =
|
|
13888
|
+
const [readingMode, setReadingMode] = useState28({
|
|
13841
13889
|
isActive: false,
|
|
13842
13890
|
ancestry: null,
|
|
13843
13891
|
branchStack: [],
|
|
13844
13892
|
autoAbstraction: false
|
|
13845
13893
|
});
|
|
13846
|
-
const [formPosition, setFormPosition] =
|
|
13894
|
+
const [formPosition, setFormPosition] = useState28({
|
|
13847
13895
|
left: 16,
|
|
13848
13896
|
top: 16,
|
|
13849
13897
|
opacity: 0
|
|
13850
13898
|
});
|
|
13851
|
-
const [detailsNode, setDetailsNode] =
|
|
13852
|
-
const [detailsLink, setDetailsLink] =
|
|
13853
|
-
const [ancestryLinkDetails, setAncestryLinkDetails] =
|
|
13854
|
-
const [imageViewer, setImageViewer] =
|
|
13899
|
+
const [detailsNode, setDetailsNode] = useState28(null);
|
|
13900
|
+
const [detailsLink, setDetailsLink] = useState28(null);
|
|
13901
|
+
const [ancestryLinkDetails, setAncestryLinkDetails] = useState28(null);
|
|
13902
|
+
const [imageViewer, setImageViewer] = useState28({
|
|
13855
13903
|
visible: false,
|
|
13856
13904
|
images: [],
|
|
13857
13905
|
startIndex: 0
|
|
13858
13906
|
});
|
|
13859
|
-
const [editingAncestryRel, setEditingAncestryRel] =
|
|
13907
|
+
const [editingAncestryRel, setEditingAncestryRel] = useState28({
|
|
13860
13908
|
visible: false,
|
|
13861
13909
|
data: null,
|
|
13862
13910
|
path: null
|
|
13863
13911
|
});
|
|
13864
|
-
const [isImportModalOpen, setIsImportModalOpen] =
|
|
13865
|
-
const [importSuccessMessage, setImportSuccessMessage] =
|
|
13866
|
-
const [invalidTargetError, setInvalidTargetError] =
|
|
13867
|
-
const [highlightedNodeId, setHighlightedNodeId] =
|
|
13868
|
-
const [isAncestryBoardOpen, setIsAncestryBoardOpen] =
|
|
13869
|
-
const [ancestryBoardData, setAncestryBoardData] =
|
|
13870
|
-
const [isSidebarOpen, setIsSidebarOpen] =
|
|
13871
|
-
const [isMilestoneManagerOpen, setIsMilestoneManagerOpen] =
|
|
13912
|
+
const [isImportModalOpen, setIsImportModalOpen] = useState28(false);
|
|
13913
|
+
const [importSuccessMessage, setImportSuccessMessage] = useState28("");
|
|
13914
|
+
const [invalidTargetError, setInvalidTargetError] = useState28(null);
|
|
13915
|
+
const [highlightedNodeId, setHighlightedNodeId] = useState28(null);
|
|
13916
|
+
const [isAncestryBoardOpen, setIsAncestryBoardOpen] = useState28(false);
|
|
13917
|
+
const [ancestryBoardData, setAncestryBoardData] = useState28([]);
|
|
13918
|
+
const [isSidebarOpen, setIsSidebarOpen] = useState28(false);
|
|
13919
|
+
const [isMilestoneManagerOpen, setIsMilestoneManagerOpen] = useState28(false);
|
|
13872
13920
|
const mountRef = useRef19(null);
|
|
13873
13921
|
const tooltipRef = useRef19(null);
|
|
13874
13922
|
const formRef = useRef19(null);
|
|
@@ -13936,10 +13984,10 @@ function XViewScene({
|
|
|
13936
13984
|
minWidth: 320,
|
|
13937
13985
|
maxWidth: maxReadPanelW
|
|
13938
13986
|
});
|
|
13939
|
-
|
|
13987
|
+
useEffect24(() => {
|
|
13940
13988
|
stateRef.current.ancestry = ancestryMode;
|
|
13941
13989
|
}, [ancestryMode]);
|
|
13942
|
-
|
|
13990
|
+
useEffect24(() => {
|
|
13943
13991
|
var _a2;
|
|
13944
13992
|
if (!isInitialized) return;
|
|
13945
13993
|
const map = /* @__PURE__ */ new Map();
|
|
@@ -14501,7 +14549,7 @@ function XViewScene({
|
|
|
14501
14549
|
}
|
|
14502
14550
|
});
|
|
14503
14551
|
}, []);
|
|
14504
|
-
|
|
14552
|
+
useEffect24(() => {
|
|
14505
14553
|
async function fetchAllData(configPath, ownerId2) {
|
|
14506
14554
|
var _a2, _b2;
|
|
14507
14555
|
if (!get_scene_view_data) {
|
|
@@ -14866,7 +14914,7 @@ function XViewScene({
|
|
|
14866
14914
|
camTween.start();
|
|
14867
14915
|
}
|
|
14868
14916
|
}, [addOrUpdateNodeMesh]);
|
|
14869
|
-
|
|
14917
|
+
useEffect24(() => {
|
|
14870
14918
|
if (!isInitialized || !sceneDataRef.current) return;
|
|
14871
14919
|
const currentMount = mountRef.current;
|
|
14872
14920
|
if (!currentMount) return;
|
|
@@ -15870,7 +15918,7 @@ function XViewScene({
|
|
|
15870
15918
|
};
|
|
15871
15919
|
});
|
|
15872
15920
|
}, []);
|
|
15873
|
-
const actionHandlerContext =
|
|
15921
|
+
const actionHandlerContext = useMemo13(
|
|
15874
15922
|
() => {
|
|
15875
15923
|
var _a2;
|
|
15876
15924
|
return {
|
|
@@ -16099,6 +16147,8 @@ function XViewScene({
|
|
|
16099
16147
|
try {
|
|
16100
16148
|
await actions.save_view_data(sceneSaveUrl2, sceneFileData);
|
|
16101
16149
|
sceneDataRef2.current.quest_counter = currentCounter + 1;
|
|
16150
|
+
sceneDataRef2.current.quest_nodes = sceneFileData.quest_nodes;
|
|
16151
|
+
sceneDataRef2.current.quest_links = sceneFileData.quest_links;
|
|
16102
16152
|
stateRef2.current.nodeIdToParentFileMap.set(String(newNode.id), {
|
|
16103
16153
|
parentFileId: sceneConfigId2,
|
|
16104
16154
|
ownerId: ownerId2,
|
|
@@ -16977,7 +17027,7 @@ function XViewScene({
|
|
|
16977
17027
|
}
|
|
16978
17028
|
setHighlightedNodeId(nodeId);
|
|
16979
17029
|
}, []);
|
|
16980
|
-
const activeNodeBranches =
|
|
17030
|
+
const activeNodeBranches = useMemo13(() => {
|
|
16981
17031
|
if (!highlightedNodeId || !readingMode.ancestry || !readingMode.ancestry.tree)
|
|
16982
17032
|
return null;
|
|
16983
17033
|
const fullTree = buildFullAncestryTree(
|
|
@@ -17021,7 +17071,7 @@ function XViewScene({
|
|
|
17021
17071
|
readingMode.branchStack,
|
|
17022
17072
|
ancestryDataRef.current
|
|
17023
17073
|
]);
|
|
17024
|
-
const backNavigationInfo =
|
|
17074
|
+
const backNavigationInfo = useMemo13(() => {
|
|
17025
17075
|
const { branchStack } = readingMode;
|
|
17026
17076
|
if (!branchStack || branchStack.length === 0) return null;
|
|
17027
17077
|
const lastStep = branchStack[branchStack.length - 1];
|
|
@@ -17032,7 +17082,7 @@ function XViewScene({
|
|
|
17032
17082
|
name: "Voltar para anterior"
|
|
17033
17083
|
};
|
|
17034
17084
|
}, [readingMode.branchStack]);
|
|
17035
|
-
const getReadModeDisplayContext =
|
|
17085
|
+
const getReadModeDisplayContext = useMemo13(() => {
|
|
17036
17086
|
const { ancestry, branchStack } = readingMode;
|
|
17037
17087
|
if (!ancestry) return null;
|
|
17038
17088
|
if (branchStack.length === 0) {
|
|
@@ -17075,7 +17125,7 @@ function XViewScene({
|
|
|
17075
17125
|
customProperties: branchProps
|
|
17076
17126
|
};
|
|
17077
17127
|
}, [readingMode, buildFullAncestryTree, ancestryDataRef.current]);
|
|
17078
|
-
const readModeAbstractionTree =
|
|
17128
|
+
const readModeAbstractionTree = useMemo13(() => {
|
|
17079
17129
|
if (!readingMode.isActive || !readingMode.ancestry || !readingMode.ancestry.abstraction_tree) {
|
|
17080
17130
|
return null;
|
|
17081
17131
|
}
|
|
@@ -17689,12 +17739,22 @@ function XViewScene({
|
|
|
17689
17739
|
setIsAncestryBoardOpen(true);
|
|
17690
17740
|
}, []);
|
|
17691
17741
|
const handleSelectAncestryFromBoard = useCallback4(
|
|
17692
|
-
(
|
|
17742
|
+
(item) => {
|
|
17693
17743
|
setIsAncestryBoardOpen(false);
|
|
17694
17744
|
setIsSidebarOpen(false);
|
|
17695
|
-
|
|
17745
|
+
if (item.type === "ancestry" || !item.type) {
|
|
17746
|
+
handleStartReadingAncestry(item);
|
|
17747
|
+
} else {
|
|
17748
|
+
const nodeId = String(item.id);
|
|
17749
|
+
const sceneMesh = stateRef.current.nodeObjects[nodeId];
|
|
17750
|
+
if (sceneMesh) {
|
|
17751
|
+
tweenToTarget(sceneMesh);
|
|
17752
|
+
} else {
|
|
17753
|
+
console.warn("Objeto n\xE3o encontrado na cena para foco:", nodeId);
|
|
17754
|
+
}
|
|
17755
|
+
}
|
|
17696
17756
|
},
|
|
17697
|
-
[handleStartReadingAncestry]
|
|
17757
|
+
[handleStartReadingAncestry, tweenToTarget]
|
|
17698
17758
|
);
|
|
17699
17759
|
const handleSaveAncestryBoard = useCallback4(
|
|
17700
17760
|
async (groups) => {
|
|
@@ -17710,7 +17770,7 @@ function XViewScene({
|
|
|
17710
17770
|
},
|
|
17711
17771
|
[sceneConfigId, viewParams, session, save_ancestry_board_action, ownerId]
|
|
17712
17772
|
);
|
|
17713
|
-
const existingNodeTypes =
|
|
17773
|
+
const existingNodeTypes = useMemo13(() => {
|
|
17714
17774
|
if (!parentDataRef.current) {
|
|
17715
17775
|
return [];
|
|
17716
17776
|
}
|
|
@@ -17722,21 +17782,27 @@ function XViewScene({
|
|
|
17722
17782
|
).filter((t) => Boolean(t) && String(t).toLowerCase() !== "quest");
|
|
17723
17783
|
return [...new Set(allTypes)];
|
|
17724
17784
|
}, [parentDataRef.current, sceneVersion]);
|
|
17725
|
-
const searchableDbNodes =
|
|
17785
|
+
const searchableDbNodes = useMemo13(() => {
|
|
17786
|
+
var _a2;
|
|
17726
17787
|
if (!parentDataRef.current) {
|
|
17727
17788
|
return [];
|
|
17728
17789
|
}
|
|
17729
|
-
|
|
17790
|
+
const datasetsPool = Object.entries(parentDataRef.current).flatMap(([dbId, fileData]) => {
|
|
17730
17791
|
const datasetName = fileData.dataset_name || `Dataset #${dbId.substring(0, 6)}`;
|
|
17731
17792
|
return (fileData.nodes || []).map((node) => ({
|
|
17732
17793
|
...node,
|
|
17733
17794
|
dataset_name: datasetName
|
|
17734
17795
|
}));
|
|
17735
|
-
}).filter((node) => {
|
|
17736
|
-
var _a2;
|
|
17737
|
-
return !((_a2 = node.version_node) == null ? void 0 : _a2.is_version);
|
|
17738
17796
|
});
|
|
17739
|
-
|
|
17797
|
+
const questsPool = (((_a2 = sceneDataRef.current) == null ? void 0 : _a2.quest_nodes) || []).map((node) => ({
|
|
17798
|
+
...node,
|
|
17799
|
+
dataset_name: "Quests Internas (View)"
|
|
17800
|
+
}));
|
|
17801
|
+
return [...datasetsPool, ...questsPool].filter((node) => {
|
|
17802
|
+
var _a3;
|
|
17803
|
+
return !((_a3 = node.version_node) == null ? void 0 : _a3.is_version);
|
|
17804
|
+
});
|
|
17805
|
+
}, [parentDataRef.current, (_b = sceneDataRef.current) == null ? void 0 : _b.quest_nodes, sceneVersion]);
|
|
17740
17806
|
const handleAddExistingNode = useCallback4(
|
|
17741
17807
|
(nodeId) => {
|
|
17742
17808
|
return userActionHandlers.handleAddExistingNodeById(
|
|
@@ -17835,13 +17901,13 @@ function XViewScene({
|
|
|
17835
17901
|
console.error("Erro na chamada de save_view_data:", error);
|
|
17836
17902
|
}
|
|
17837
17903
|
}, [sceneSaveUrl, save_view_data, sceneConfigId, viewParams == null ? void 0 : viewParams.type]);
|
|
17838
|
-
const allAvailableNodes =
|
|
17904
|
+
const allAvailableNodes = useMemo13(() => {
|
|
17839
17905
|
if (!parentDataRef.current) return [];
|
|
17840
17906
|
return Object.values(parentDataRef.current).flatMap(
|
|
17841
17907
|
(fileData) => fileData.nodes || []
|
|
17842
17908
|
);
|
|
17843
17909
|
}, [sceneVersion, isInitialized]);
|
|
17844
|
-
const allAvailableAncestries =
|
|
17910
|
+
const allAvailableAncestries = useMemo13(() => {
|
|
17845
17911
|
return ancestryDataRef.current || [];
|
|
17846
17912
|
}, [sceneVersion, isInitialized]);
|
|
17847
17913
|
const handleOpenReference = useCallback4(
|
|
@@ -17905,7 +17971,7 @@ function XViewScene({
|
|
|
17905
17971
|
},
|
|
17906
17972
|
[tweenToTarget]
|
|
17907
17973
|
);
|
|
17908
|
-
const availableDatasets =
|
|
17974
|
+
const availableDatasets = useMemo13(() => {
|
|
17909
17975
|
if (!sceneDataRef.current || !parentDataRef.current) return [];
|
|
17910
17976
|
return sceneDataRef.current.parent_dbs.map((db) => {
|
|
17911
17977
|
var _a2;
|
|
@@ -17915,11 +17981,11 @@ function XViewScene({
|
|
|
17915
17981
|
};
|
|
17916
17982
|
});
|
|
17917
17983
|
}, [sceneVersion, isInitialized]);
|
|
17918
|
-
const sourceNodeDatasetId = creationMode.sourceNodeData ? (
|
|
17984
|
+
const sourceNodeDatasetId = creationMode.sourceNodeData ? (_c = stateRef.current.nodeIdToParentFileMap.get(
|
|
17919
17985
|
String(creationMode.sourceNodeData.id)
|
|
17920
|
-
)) == null ? void 0 :
|
|
17986
|
+
)) == null ? void 0 : _c.parentFileId : null;
|
|
17921
17987
|
const detailsNodeDatasetInfo = detailsNode ? stateRef.current.nodeIdToParentFileMap.get(String(detailsNode.id)) : null;
|
|
17922
|
-
|
|
17988
|
+
useEffect24(() => {
|
|
17923
17989
|
if (isInitialized && focusNodeId && !hasFocusedInitial) {
|
|
17924
17990
|
const nodeObjects = stateRef.current.nodeObjects || {};
|
|
17925
17991
|
const targetMesh = nodeObjects[String(focusNodeId)];
|
|
@@ -17942,7 +18008,7 @@ function XViewScene({
|
|
|
17942
18008
|
hasFocusedInitial,
|
|
17943
18009
|
tweenToTarget
|
|
17944
18010
|
]);
|
|
17945
|
-
|
|
18011
|
+
useEffect24(() => {
|
|
17946
18012
|
if (isInitialized && focusAncestryId && !hasOpenedInitialAncestry) {
|
|
17947
18013
|
const ancestries = ancestryDataRef.current || [];
|
|
17948
18014
|
const targetAncestry = ancestries.find(
|
|
@@ -17967,7 +18033,7 @@ function XViewScene({
|
|
|
17967
18033
|
hasOpenedInitialAncestry,
|
|
17968
18034
|
handleStartReadingAncestry
|
|
17969
18035
|
]);
|
|
17970
|
-
|
|
18036
|
+
useEffect24(() => {
|
|
17971
18037
|
function handleKeyDown(event) {
|
|
17972
18038
|
var _a2, _b2, _c2;
|
|
17973
18039
|
const context = actionHandlerContext;
|
|
@@ -18090,10 +18156,10 @@ function XViewScene({
|
|
|
18090
18156
|
// <-- handleCancelQuest adicionado aqui
|
|
18091
18157
|
]);
|
|
18092
18158
|
if (isLoading || status === "loading" || permissionStatus === "loading") {
|
|
18093
|
-
return /* @__PURE__ */
|
|
18159
|
+
return /* @__PURE__ */ React30.createElement(LoadingScreen, null);
|
|
18094
18160
|
}
|
|
18095
18161
|
if (permissionStatus === "denied") {
|
|
18096
|
-
return /* @__PURE__ */
|
|
18162
|
+
return /* @__PURE__ */ React30.createElement("div", { className: "flex flex-col items-center justify-center min-h-screen w-full bg-slate-950 text-white" }, /* @__PURE__ */ React30.createElement("div", { className: "bg-slate-900/50 p-8 rounded-2xl border border-slate-800 shadow-2xl text-center max-w-md" }, /* @__PURE__ */ React30.createElement("div", { className: "mb-4 text-red-500" }, /* @__PURE__ */ React30.createElement(
|
|
18097
18163
|
"svg",
|
|
18098
18164
|
{
|
|
18099
18165
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -18103,7 +18169,7 @@ function XViewScene({
|
|
|
18103
18169
|
stroke: "currentColor",
|
|
18104
18170
|
className: "w-16 h-16 mx-auto"
|
|
18105
18171
|
},
|
|
18106
|
-
/* @__PURE__ */
|
|
18172
|
+
/* @__PURE__ */ React30.createElement(
|
|
18107
18173
|
"path",
|
|
18108
18174
|
{
|
|
18109
18175
|
strokeLinecap: "round",
|
|
@@ -18111,13 +18177,13 @@ function XViewScene({
|
|
|
18111
18177
|
d: "M12 9v3.75m-9.303 3.376c-.866 1.5.217 3.374 1.948 3.374h14.71c1.73 0 2.813-1.874 1.948-3.374L13.949 3.378c-.866-1.5-3.032-1.5-3.898 0L2.697 16.126zM12 15.75h.007v.008H12v-.008z"
|
|
18112
18178
|
}
|
|
18113
18179
|
)
|
|
18114
|
-
)), /* @__PURE__ */
|
|
18180
|
+
)), /* @__PURE__ */ React30.createElement("h2", { className: "text-2xl font-bold mb-2" }, "Acesso Negado"), /* @__PURE__ */ React30.createElement("p", { className: "text-slate-400 mb-6" }, "Voc\xEA n\xE3o tem permiss\xE3o para acessar este conte\xFAdo. Solicite acesso ao propriet\xE1rio ou verifique se est\xE1 na conta correta."), /* @__PURE__ */ React30.createElement(
|
|
18115
18181
|
"button",
|
|
18116
18182
|
{
|
|
18117
18183
|
onClick: () => router.push("/dashboard/scenes"),
|
|
18118
18184
|
className: "flex items-center justify-center gap-2 w-full py-3 px-4 bg-blue-600 hover:bg-blue-700 text-white rounded-lg transition-colors font-medium"
|
|
18119
18185
|
},
|
|
18120
|
-
/* @__PURE__ */
|
|
18186
|
+
/* @__PURE__ */ React30.createElement(
|
|
18121
18187
|
"svg",
|
|
18122
18188
|
{
|
|
18123
18189
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -18127,7 +18193,7 @@ function XViewScene({
|
|
|
18127
18193
|
stroke: "currentColor",
|
|
18128
18194
|
className: "w-5 h-5"
|
|
18129
18195
|
},
|
|
18130
|
-
/* @__PURE__ */
|
|
18196
|
+
/* @__PURE__ */ React30.createElement(
|
|
18131
18197
|
"path",
|
|
18132
18198
|
{
|
|
18133
18199
|
strokeLinecap: "round",
|
|
@@ -18139,7 +18205,7 @@ function XViewScene({
|
|
|
18139
18205
|
"Voltar para Scenes"
|
|
18140
18206
|
)));
|
|
18141
18207
|
}
|
|
18142
|
-
return /* @__PURE__ */
|
|
18208
|
+
return /* @__PURE__ */ React30.createElement(
|
|
18143
18209
|
"div",
|
|
18144
18210
|
{
|
|
18145
18211
|
ref: mountRef,
|
|
@@ -18151,7 +18217,7 @@ function XViewScene({
|
|
|
18151
18217
|
cursor: stateRef.current.connection.isActive || stateRef.current.relink.isActive || ancestryMode.isActive ? "crosshair" : creationMode.isActive ? "default" : "grab"
|
|
18152
18218
|
}
|
|
18153
18219
|
},
|
|
18154
|
-
userPermissionRole !== "link_viewer" && /* @__PURE__ */
|
|
18220
|
+
userPermissionRole !== "link_viewer" && /* @__PURE__ */ React30.createElement(
|
|
18155
18221
|
XViewSidebar,
|
|
18156
18222
|
{
|
|
18157
18223
|
dbNodes: searchableDbNodes,
|
|
@@ -18171,11 +18237,11 @@ function XViewScene({
|
|
|
18171
18237
|
onToggle: setIsSidebarOpen,
|
|
18172
18238
|
userRole: userPermissionRole,
|
|
18173
18239
|
viewMembers,
|
|
18174
|
-
milestones: ((
|
|
18240
|
+
milestones: ((_d = sceneDataRef.current) == null ? void 0 : _d.milestones) || [],
|
|
18175
18241
|
onOpenMilestoneManager: () => setIsMilestoneManagerOpen(true)
|
|
18176
18242
|
}
|
|
18177
18243
|
),
|
|
18178
|
-
creationMode.isActive && /* @__PURE__ */
|
|
18244
|
+
creationMode.isActive && /* @__PURE__ */ React30.createElement(
|
|
18179
18245
|
InSceneCreationForm,
|
|
18180
18246
|
{
|
|
18181
18247
|
onSave: (data) => userActionHandlers.handleSaveNode(actionHandlerContext, data),
|
|
@@ -18196,8 +18262,8 @@ function XViewScene({
|
|
|
18196
18262
|
},
|
|
18197
18263
|
refEl: formRef,
|
|
18198
18264
|
existingTypes: existingNodeTypes,
|
|
18199
|
-
initialColor: (
|
|
18200
|
-
sourceTypes: (
|
|
18265
|
+
initialColor: (_e = creationMode.sourceNodeData) == null ? void 0 : _e.color,
|
|
18266
|
+
sourceTypes: (_f = creationMode.sourceNodeData) == null ? void 0 : _f.type,
|
|
18201
18267
|
onIntensityChange: handleGhostNodeIntensityChange,
|
|
18202
18268
|
onUploadFile: upload_file_action,
|
|
18203
18269
|
availableDatasets,
|
|
@@ -18207,7 +18273,7 @@ function XViewScene({
|
|
|
18207
18273
|
availableAncestries: allAvailableAncestries
|
|
18208
18274
|
}
|
|
18209
18275
|
),
|
|
18210
|
-
versionMode.isActive && /* @__PURE__ */
|
|
18276
|
+
versionMode.isActive && /* @__PURE__ */ React30.createElement(
|
|
18211
18277
|
InSceneVersionForm,
|
|
18212
18278
|
{
|
|
18213
18279
|
onSave: (data) => userActionHandlers.handleSaveVersionNode(actionHandlerContext, data),
|
|
@@ -18226,14 +18292,14 @@ function XViewScene({
|
|
|
18226
18292
|
transition: "opacity 200ms ease-out"
|
|
18227
18293
|
},
|
|
18228
18294
|
refEl: formRef,
|
|
18229
|
-
fixedType: (
|
|
18230
|
-
fixedColor: (
|
|
18295
|
+
fixedType: (_g = versionMode.sourceNodeData) == null ? void 0 : _g.type,
|
|
18296
|
+
fixedColor: (_h = versionMode.sourceNodeData) == null ? void 0 : _h.color,
|
|
18231
18297
|
onUploadFile: upload_file_action,
|
|
18232
18298
|
availableNodes: allAvailableNodes,
|
|
18233
18299
|
availableAncestries: allAvailableAncestries
|
|
18234
18300
|
}
|
|
18235
18301
|
),
|
|
18236
|
-
questMode.isActive && /* @__PURE__ */
|
|
18302
|
+
questMode.isActive && /* @__PURE__ */ React30.createElement(
|
|
18237
18303
|
InSceneQuestForm,
|
|
18238
18304
|
{
|
|
18239
18305
|
onSave: (data) => handleSaveQuestNode(actionHandlerContext, data),
|
|
@@ -18255,13 +18321,13 @@ function XViewScene({
|
|
|
18255
18321
|
availableNodes: allAvailableNodes,
|
|
18256
18322
|
availableAncestries: allAvailableAncestries,
|
|
18257
18323
|
viewName: viewParams == null ? void 0 : viewParams.name,
|
|
18258
|
-
questCounter: ((
|
|
18324
|
+
questCounter: ((_i = sceneDataRef.current) == null ? void 0 : _i.quest_counter) || 1,
|
|
18259
18325
|
viewMembers,
|
|
18260
|
-
milestones: ((
|
|
18326
|
+
milestones: ((_j = sceneDataRef.current) == null ? void 0 : _j.milestones) || [],
|
|
18261
18327
|
onUpdateMilestones: handleUpdateMilestones
|
|
18262
18328
|
}
|
|
18263
18329
|
),
|
|
18264
|
-
readingMode.isActive && readingMode.ancestry && /* @__PURE__ */
|
|
18330
|
+
readingMode.isActive && readingMode.ancestry && /* @__PURE__ */ React30.createElement(
|
|
18265
18331
|
"div",
|
|
18266
18332
|
{
|
|
18267
18333
|
className: `ui-overlay absolute group rounded-2xl border border-white/10 bg-slate-950/70 backdrop-blur-xl shadow-[0_20px_80px_rgba(0,0,0,0.6)] ring-1 ring-white/10 text-white overflow-hidden flex flex-col ${isReadModeResizing ? "transition-none" : "transition-all duration-300 ease-out"}`,
|
|
@@ -18274,7 +18340,7 @@ function XViewScene({
|
|
|
18274
18340
|
maxWidth: "92vw"
|
|
18275
18341
|
}
|
|
18276
18342
|
},
|
|
18277
|
-
/* @__PURE__ */
|
|
18343
|
+
/* @__PURE__ */ React30.createElement(
|
|
18278
18344
|
"div",
|
|
18279
18345
|
{
|
|
18280
18346
|
onPointerDown: (e) => {
|
|
@@ -18285,7 +18351,7 @@ function XViewScene({
|
|
|
18285
18351
|
title: "Arraste para redimensionar"
|
|
18286
18352
|
}
|
|
18287
18353
|
),
|
|
18288
|
-
/* @__PURE__ */
|
|
18354
|
+
/* @__PURE__ */ React30.createElement(
|
|
18289
18355
|
DescriptionReadModePanel,
|
|
18290
18356
|
{
|
|
18291
18357
|
key: readingMode.branchStack.length > 0 ? readingMode.branchStack[readingMode.branchStack.length - 1].branchId : readingMode.ancestry.ancestry_id,
|
|
@@ -18320,7 +18386,7 @@ function XViewScene({
|
|
|
18320
18386
|
}
|
|
18321
18387
|
)
|
|
18322
18388
|
),
|
|
18323
|
-
ancestryMode.isActive && ancestryMode.tree && /* @__PURE__ */
|
|
18389
|
+
ancestryMode.isActive && ancestryMode.tree && /* @__PURE__ */ React30.createElement(
|
|
18324
18390
|
CreateAncestryPanel,
|
|
18325
18391
|
{
|
|
18326
18392
|
ancestryMode,
|
|
@@ -18356,7 +18422,7 @@ function XViewScene({
|
|
|
18356
18422
|
onRenderAbstractionTree: (data, targetId) => handleRenderAbstractionTree(data, targetId)
|
|
18357
18423
|
}
|
|
18358
18424
|
),
|
|
18359
|
-
editingAncestryRel.visible && /* @__PURE__ */
|
|
18425
|
+
editingAncestryRel.visible && /* @__PURE__ */ React30.createElement(
|
|
18360
18426
|
AncestryRelationshipPanel,
|
|
18361
18427
|
{
|
|
18362
18428
|
data: editingAncestryRel.data,
|
|
@@ -18370,7 +18436,7 @@ function XViewScene({
|
|
|
18370
18436
|
onUploadFile: upload_file_action
|
|
18371
18437
|
}
|
|
18372
18438
|
),
|
|
18373
|
-
detailsNode && detailsNode.is_quest && /* @__PURE__ */
|
|
18439
|
+
detailsNode && detailsNode.is_quest && /* @__PURE__ */ React30.createElement(
|
|
18374
18440
|
QuestDetailsPanel,
|
|
18375
18441
|
{
|
|
18376
18442
|
node: detailsNode,
|
|
@@ -18392,11 +18458,11 @@ function XViewScene({
|
|
|
18392
18458
|
currentDatasetName: detailsNodeDatasetInfo == null ? void 0 : detailsNodeDatasetInfo.datasetName,
|
|
18393
18459
|
viewMembers,
|
|
18394
18460
|
currentUser: session == null ? void 0 : session.user,
|
|
18395
|
-
milestones: ((
|
|
18461
|
+
milestones: ((_k = sceneDataRef.current) == null ? void 0 : _k.milestones) || [],
|
|
18396
18462
|
onUpdateMilestones: handleUpdateMilestones
|
|
18397
18463
|
}
|
|
18398
18464
|
),
|
|
18399
|
-
detailsNode && !detailsNode.is_quest && /* @__PURE__ */
|
|
18465
|
+
detailsNode && !detailsNode.is_quest && /* @__PURE__ */ React30.createElement(
|
|
18400
18466
|
NodeDetailsPanel,
|
|
18401
18467
|
{
|
|
18402
18468
|
node: detailsNode,
|
|
@@ -18428,7 +18494,7 @@ function XViewScene({
|
|
|
18428
18494
|
currentDatasetName: detailsNodeDatasetInfo == null ? void 0 : detailsNodeDatasetInfo.datasetName
|
|
18429
18495
|
}
|
|
18430
18496
|
),
|
|
18431
|
-
detailsLink && /* @__PURE__ */
|
|
18497
|
+
detailsLink && /* @__PURE__ */ React30.createElement(
|
|
18432
18498
|
RelationshipDetailsPanel,
|
|
18433
18499
|
{
|
|
18434
18500
|
link: detailsLink,
|
|
@@ -18442,7 +18508,7 @@ function XViewScene({
|
|
|
18442
18508
|
userRole: userPermissionRole
|
|
18443
18509
|
}
|
|
18444
18510
|
),
|
|
18445
|
-
ancestryLinkDetails && /* @__PURE__ */
|
|
18511
|
+
ancestryLinkDetails && /* @__PURE__ */ React30.createElement(
|
|
18446
18512
|
AncestryLinkDetailsPanel,
|
|
18447
18513
|
{
|
|
18448
18514
|
data: ancestryLinkDetails,
|
|
@@ -18453,7 +18519,7 @@ function XViewScene({
|
|
|
18453
18519
|
onUploadFile: upload_file_action
|
|
18454
18520
|
}
|
|
18455
18521
|
),
|
|
18456
|
-
/* @__PURE__ */
|
|
18522
|
+
/* @__PURE__ */ React30.createElement(
|
|
18457
18523
|
"div",
|
|
18458
18524
|
{
|
|
18459
18525
|
ref: tooltipRef,
|
|
@@ -18480,7 +18546,7 @@ function XViewScene({
|
|
|
18480
18546
|
}
|
|
18481
18547
|
}
|
|
18482
18548
|
),
|
|
18483
|
-
/* @__PURE__ */
|
|
18549
|
+
/* @__PURE__ */ React30.createElement(
|
|
18484
18550
|
ContextMenu,
|
|
18485
18551
|
{
|
|
18486
18552
|
data: contextMenu,
|
|
@@ -18513,7 +18579,7 @@ function XViewScene({
|
|
|
18513
18579
|
onFinishQuest: handleFinishQuestQuick
|
|
18514
18580
|
}
|
|
18515
18581
|
),
|
|
18516
|
-
/* @__PURE__ */
|
|
18582
|
+
/* @__PURE__ */ React30.createElement(
|
|
18517
18583
|
MultiNodeContextMenu,
|
|
18518
18584
|
{
|
|
18519
18585
|
data: multiContextMenu,
|
|
@@ -18533,7 +18599,7 @@ function XViewScene({
|
|
|
18533
18599
|
)
|
|
18534
18600
|
}
|
|
18535
18601
|
),
|
|
18536
|
-
/* @__PURE__ */
|
|
18602
|
+
/* @__PURE__ */ React30.createElement(
|
|
18537
18603
|
RelationshipContextMenu,
|
|
18538
18604
|
{
|
|
18539
18605
|
data: relationshipMenu,
|
|
@@ -18551,14 +18617,14 @@ function XViewScene({
|
|
|
18551
18617
|
onDelete: (data) => userActionHandlers.handleDeleteLink(actionHandlerContext, data)
|
|
18552
18618
|
}
|
|
18553
18619
|
),
|
|
18554
|
-
/* @__PURE__ */
|
|
18620
|
+
/* @__PURE__ */ React30.createElement(
|
|
18555
18621
|
ImageViewer,
|
|
18556
18622
|
{
|
|
18557
18623
|
data: imageViewer,
|
|
18558
18624
|
onClose: () => setImageViewer({ ...imageViewer, visible: false })
|
|
18559
18625
|
}
|
|
18560
18626
|
),
|
|
18561
|
-
/* @__PURE__ */
|
|
18627
|
+
/* @__PURE__ */ React30.createElement(
|
|
18562
18628
|
AncestryBoard,
|
|
18563
18629
|
{
|
|
18564
18630
|
isOpen: isAncestryBoardOpen,
|
|
@@ -18571,29 +18637,29 @@ function XViewScene({
|
|
|
18571
18637
|
userRole: userPermissionRole
|
|
18572
18638
|
}
|
|
18573
18639
|
),
|
|
18574
|
-
/* @__PURE__ */
|
|
18640
|
+
/* @__PURE__ */ React30.createElement(
|
|
18575
18641
|
MilestoneManager,
|
|
18576
18642
|
{
|
|
18577
18643
|
isOpen: isMilestoneManagerOpen,
|
|
18578
18644
|
onClose: () => setIsMilestoneManagerOpen(false),
|
|
18579
|
-
milestones: ((
|
|
18645
|
+
milestones: ((_l = sceneDataRef.current) == null ? void 0 : _l.milestones) || [],
|
|
18580
18646
|
onUpdateMilestones: handleUpdateMilestones
|
|
18581
18647
|
}
|
|
18582
18648
|
),
|
|
18583
|
-
/* @__PURE__ */
|
|
18649
|
+
/* @__PURE__ */ React30.createElement(
|
|
18584
18650
|
ImportParentFileModal,
|
|
18585
18651
|
{
|
|
18586
18652
|
isOpen: isImportModalOpen,
|
|
18587
18653
|
onClose: () => setIsImportModalOpen(false),
|
|
18588
18654
|
onConfirm: handleConfirmImport,
|
|
18589
18655
|
session,
|
|
18590
|
-
parentDbs: ((
|
|
18656
|
+
parentDbs: ((_m = sceneDataRef.current) == null ? void 0 : _m.parent_dbs) || [],
|
|
18591
18657
|
onFetchAvailableFiles: import_parent_file_modal_get,
|
|
18592
18658
|
currentViewName: viewParams == null ? void 0 : viewParams.name,
|
|
18593
18659
|
currentAncestries: ancestryDataRef.current || []
|
|
18594
18660
|
}
|
|
18595
18661
|
),
|
|
18596
|
-
invalidTargetError && /* @__PURE__ */
|
|
18662
|
+
invalidTargetError && /* @__PURE__ */ React30.createElement(
|
|
18597
18663
|
"div",
|
|
18598
18664
|
{
|
|
18599
18665
|
className: "ui-overlay",
|
|
@@ -18618,13 +18684,13 @@ function XViewScene({
|
|
|
18618
18684
|
animation: "fadeInDown 0.5s cubic-bezier(0.16, 1, 0.3, 1)"
|
|
18619
18685
|
}
|
|
18620
18686
|
},
|
|
18621
|
-
/* @__PURE__ */
|
|
18687
|
+
/* @__PURE__ */ React30.createElement("style", null, `
|
|
18622
18688
|
@keyframes fadeInDown {
|
|
18623
18689
|
from { opacity: 0; transform: translate(-50%, -20px); }
|
|
18624
18690
|
to { opacity: 1; transform: translate(-50%, 0); }
|
|
18625
18691
|
}
|
|
18626
18692
|
`),
|
|
18627
|
-
/* @__PURE__ */
|
|
18693
|
+
/* @__PURE__ */ React30.createElement(
|
|
18628
18694
|
"svg",
|
|
18629
18695
|
{
|
|
18630
18696
|
width: "20",
|
|
@@ -18636,12 +18702,12 @@ function XViewScene({
|
|
|
18636
18702
|
strokeLinecap: "round",
|
|
18637
18703
|
strokeLinejoin: "round"
|
|
18638
18704
|
},
|
|
18639
|
-
/* @__PURE__ */
|
|
18640
|
-
/* @__PURE__ */
|
|
18641
|
-
/* @__PURE__ */
|
|
18705
|
+
/* @__PURE__ */ React30.createElement("circle", { cx: "12", cy: "12", r: "10" }),
|
|
18706
|
+
/* @__PURE__ */ React30.createElement("line", { x1: "12", y1: "8", x2: "12", y2: "12" }),
|
|
18707
|
+
/* @__PURE__ */ React30.createElement("line", { x1: "12", y1: "16", x2: "12.01", y2: "16" })
|
|
18642
18708
|
),
|
|
18643
|
-
/* @__PURE__ */
|
|
18644
|
-
/* @__PURE__ */
|
|
18709
|
+
/* @__PURE__ */ React30.createElement("span", { style: { fontSize: "14px", fontWeight: 500 } }, invalidTargetError),
|
|
18710
|
+
/* @__PURE__ */ React30.createElement(
|
|
18645
18711
|
"button",
|
|
18646
18712
|
{
|
|
18647
18713
|
onClick: () => setInvalidTargetError(null),
|