made-refine 0.1.12 → 0.2.0
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 +280 -13
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +280 -13
- package/dist/index.mjs.map +1 -1
- package/dist/utils.js +256 -3
- package/dist/utils.js.map +1 -1
- package/dist/utils.mjs +256 -3
- package/dist/utils.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1397,6 +1397,253 @@ function getFiberForElement(element) {
|
|
|
1397
1397
|
if (!fiberKey) return null;
|
|
1398
1398
|
return element[fiberKey] || null;
|
|
1399
1399
|
}
|
|
1400
|
+
var STACK_SOURCE_FILE_EXTENSION_REGEX = /\.(jsx|tsx|ts|js)$/;
|
|
1401
|
+
var STACK_BUNDLED_FILE_PATTERN_REGEX = /(\.min|bundle|chunk|vendor|vendors|runtime|polyfill|polyfills)\.(js|mjs|cjs)$|(chunk|bundle|vendor|vendors|runtime|polyfill|polyfills|framework|app|main|index)[-_.][A-Za-z0-9_-]{4,}\.(js|mjs|cjs)$|[\da-f]{8,}\.(js|mjs|cjs)$|[-_.][\da-f]{20,}\.(js|mjs|cjs)$|\/dist\/|\/build\/|\/.next\/|\/out\/|\/node_modules\/|\.webpack\.|\.vite\.|\.turbopack\./i;
|
|
1402
|
+
var FIREFOX_SAFARI_STACK_REGEXP = /(^|@)\S+:\d+/;
|
|
1403
|
+
var SAFARI_NATIVE_CODE_REGEXP = /^(eval@)?(\[native code\])?$/;
|
|
1404
|
+
var SERVER_FRAME_MARKER = "(at Server)";
|
|
1405
|
+
var STACK_INTERNAL_SCHEME_PREFIXES = [
|
|
1406
|
+
"rsc://",
|
|
1407
|
+
"about://React/",
|
|
1408
|
+
"React/Server/",
|
|
1409
|
+
"file:///",
|
|
1410
|
+
"webpack://",
|
|
1411
|
+
"webpack-internal://",
|
|
1412
|
+
"node:",
|
|
1413
|
+
"turbopack://",
|
|
1414
|
+
"/app-pages-browser/"
|
|
1415
|
+
];
|
|
1416
|
+
function formatOwnerDebugStack(stack) {
|
|
1417
|
+
if (!stack) return "";
|
|
1418
|
+
const lines = stack.split("\n");
|
|
1419
|
+
const filtered = [];
|
|
1420
|
+
for (const line of lines) {
|
|
1421
|
+
const trimmed = line.trim();
|
|
1422
|
+
if (!trimmed) continue;
|
|
1423
|
+
if (trimmed === "Error: react-stack-top-frame") continue;
|
|
1424
|
+
if (trimmed.includes("react_stack_bottom_frame") || trimmed.includes("react-stack-bottom-frame")) {
|
|
1425
|
+
continue;
|
|
1426
|
+
}
|
|
1427
|
+
filtered.push(line);
|
|
1428
|
+
}
|
|
1429
|
+
if (filtered.length > 0 && filtered[0].includes("fakeJSXCallSite")) {
|
|
1430
|
+
filtered.shift();
|
|
1431
|
+
}
|
|
1432
|
+
return filtered.join("\n");
|
|
1433
|
+
}
|
|
1434
|
+
function extractStackLocation(urlLike) {
|
|
1435
|
+
if (!urlLike.includes(":")) return [urlLike, void 0, void 0];
|
|
1436
|
+
const isWrappedLocation = urlLike.startsWith("(") && /:\d+\)$/.test(urlLike);
|
|
1437
|
+
const sanitizedResult = isWrappedLocation ? urlLike.slice(1, -1) : urlLike;
|
|
1438
|
+
const parts = /(.+?)(?::(\d+))?(?::(\d+))?$/.exec(sanitizedResult);
|
|
1439
|
+
if (!parts) return [sanitizedResult, void 0, void 0];
|
|
1440
|
+
return [
|
|
1441
|
+
parts[1],
|
|
1442
|
+
parts[2] !== void 0 ? Number(parts[2]) : void 0,
|
|
1443
|
+
parts[3] !== void 0 ? Number(parts[3]) : void 0
|
|
1444
|
+
];
|
|
1445
|
+
}
|
|
1446
|
+
function parseV8StackLine(line) {
|
|
1447
|
+
let currentLine = line;
|
|
1448
|
+
if (currentLine.includes("(eval ")) {
|
|
1449
|
+
currentLine = currentLine.replace(/eval code/g, "eval").replace(/(\(eval at [^()]*)|(,.*$)/g, "");
|
|
1450
|
+
}
|
|
1451
|
+
let sanitizedLine = currentLine.replace(/^\s+/, "").replace(/\(eval code/g, "(").replace(/^.*?\s+/, "");
|
|
1452
|
+
const locationMatch = sanitizedLine.match(/ (\(.+\)$)/);
|
|
1453
|
+
if (locationMatch) {
|
|
1454
|
+
sanitizedLine = sanitizedLine.replace(locationMatch[0], "");
|
|
1455
|
+
}
|
|
1456
|
+
const [fileName, lineNumber, columnNumber] = extractStackLocation(
|
|
1457
|
+
locationMatch ? locationMatch[1] : sanitizedLine
|
|
1458
|
+
);
|
|
1459
|
+
const functionName = locationMatch && sanitizedLine ? sanitizedLine : void 0;
|
|
1460
|
+
if (fileName === "eval" || fileName === "<anonymous>") {
|
|
1461
|
+
return {
|
|
1462
|
+
functionName
|
|
1463
|
+
};
|
|
1464
|
+
}
|
|
1465
|
+
return {
|
|
1466
|
+
functionName,
|
|
1467
|
+
fileName,
|
|
1468
|
+
lineNumber,
|
|
1469
|
+
columnNumber,
|
|
1470
|
+
source: currentLine,
|
|
1471
|
+
isServer: currentLine.includes(SERVER_FRAME_MARKER) || fileName.startsWith("rsc://")
|
|
1472
|
+
};
|
|
1473
|
+
}
|
|
1474
|
+
function parseFFOrSafariStackLine(line) {
|
|
1475
|
+
let currentLine = line;
|
|
1476
|
+
if (currentLine.includes(" > eval")) {
|
|
1477
|
+
currentLine = currentLine.replace(
|
|
1478
|
+
/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g,
|
|
1479
|
+
":$1"
|
|
1480
|
+
);
|
|
1481
|
+
}
|
|
1482
|
+
const trimmed = currentLine.trim();
|
|
1483
|
+
if (!trimmed || SAFARI_NATIVE_CODE_REGEXP.test(trimmed)) {
|
|
1484
|
+
return null;
|
|
1485
|
+
}
|
|
1486
|
+
if (!trimmed.includes("@") && !trimmed.includes(":")) {
|
|
1487
|
+
return {
|
|
1488
|
+
functionName: trimmed,
|
|
1489
|
+
source: currentLine,
|
|
1490
|
+
isServer: trimmed.includes(SERVER_FRAME_MARKER)
|
|
1491
|
+
};
|
|
1492
|
+
}
|
|
1493
|
+
const atIndex = trimmed.lastIndexOf("@");
|
|
1494
|
+
if (atIndex === -1) {
|
|
1495
|
+
return null;
|
|
1496
|
+
}
|
|
1497
|
+
const maybeFunctionName = trimmed.slice(0, atIndex);
|
|
1498
|
+
const location = trimmed.slice(atIndex + 1);
|
|
1499
|
+
const [fileName, lineNumber, columnNumber] = extractStackLocation(location);
|
|
1500
|
+
return {
|
|
1501
|
+
functionName: maybeFunctionName || void 0,
|
|
1502
|
+
fileName,
|
|
1503
|
+
lineNumber,
|
|
1504
|
+
columnNumber,
|
|
1505
|
+
source: currentLine,
|
|
1506
|
+
isServer: currentLine.includes(SERVER_FRAME_MARKER) || fileName.startsWith("rsc://")
|
|
1507
|
+
};
|
|
1508
|
+
}
|
|
1509
|
+
function parseInStackLine(line) {
|
|
1510
|
+
const functionName = line.replace(/^\s*in\s+/, "").replace(/\s*\(at .*\)$/, "").trim();
|
|
1511
|
+
if (!functionName) return null;
|
|
1512
|
+
return {
|
|
1513
|
+
functionName,
|
|
1514
|
+
source: line,
|
|
1515
|
+
isServer: line.includes(SERVER_FRAME_MARKER)
|
|
1516
|
+
};
|
|
1517
|
+
}
|
|
1518
|
+
function parseDebugStack(stack) {
|
|
1519
|
+
const frames = [];
|
|
1520
|
+
for (const rawLine of stack.split("\n")) {
|
|
1521
|
+
if (FIREFOX_SAFARI_STACK_REGEXP.test(rawLine)) {
|
|
1522
|
+
const parsed = parseFFOrSafariStackLine(rawLine);
|
|
1523
|
+
if (parsed) frames.push(parsed);
|
|
1524
|
+
continue;
|
|
1525
|
+
}
|
|
1526
|
+
if (/^\s*at\s+/.test(rawLine)) {
|
|
1527
|
+
const parsed = parseV8StackLine(rawLine);
|
|
1528
|
+
if (parsed) frames.push(parsed);
|
|
1529
|
+
continue;
|
|
1530
|
+
}
|
|
1531
|
+
if (/^\s*in\s+/.test(rawLine)) {
|
|
1532
|
+
const parsed = parseInStackLine(rawLine);
|
|
1533
|
+
if (parsed) frames.push(parsed);
|
|
1534
|
+
}
|
|
1535
|
+
}
|
|
1536
|
+
return frames;
|
|
1537
|
+
}
|
|
1538
|
+
function normalizeStackFileName(fileName) {
|
|
1539
|
+
if (!fileName) return "";
|
|
1540
|
+
let normalized = fileName;
|
|
1541
|
+
const isHttpUrl = normalized.startsWith("http://") || normalized.startsWith("https://");
|
|
1542
|
+
if (isHttpUrl) {
|
|
1543
|
+
try {
|
|
1544
|
+
normalized = new URL(normalized).pathname;
|
|
1545
|
+
} catch {
|
|
1546
|
+
}
|
|
1547
|
+
}
|
|
1548
|
+
let didStripPrefix = true;
|
|
1549
|
+
while (didStripPrefix) {
|
|
1550
|
+
didStripPrefix = false;
|
|
1551
|
+
for (const prefix of STACK_INTERNAL_SCHEME_PREFIXES) {
|
|
1552
|
+
if (normalized.startsWith(prefix)) {
|
|
1553
|
+
normalized = normalized.slice(prefix.length);
|
|
1554
|
+
if (prefix === "file:///") {
|
|
1555
|
+
normalized = `/${normalized.replace(/^\/+/, "")}`;
|
|
1556
|
+
}
|
|
1557
|
+
didStripPrefix = true;
|
|
1558
|
+
break;
|
|
1559
|
+
}
|
|
1560
|
+
}
|
|
1561
|
+
}
|
|
1562
|
+
normalized = normalized.replace(/^\/\(app-pages-browser\)\//, "/").replace(/^\/\.\//, "/").replace(/^\.\//, "");
|
|
1563
|
+
const queryIndex = normalized.indexOf("?");
|
|
1564
|
+
if (queryIndex !== -1) {
|
|
1565
|
+
normalized = normalized.slice(0, queryIndex);
|
|
1566
|
+
}
|
|
1567
|
+
return normalized;
|
|
1568
|
+
}
|
|
1569
|
+
function isSourceStackFile(fileName) {
|
|
1570
|
+
const normalizedFileName = normalizeStackFileName(fileName);
|
|
1571
|
+
if (!normalizedFileName) return false;
|
|
1572
|
+
if (!STACK_SOURCE_FILE_EXTENSION_REGEX.test(normalizedFileName)) return false;
|
|
1573
|
+
return !STACK_BUNDLED_FILE_PATTERN_REGEX.test(normalizedFileName);
|
|
1574
|
+
}
|
|
1575
|
+
function buildFunctionNameToRscFramesMap(fiber) {
|
|
1576
|
+
const functionNameToRscFrames = /* @__PURE__ */ new Map();
|
|
1577
|
+
const visited = /* @__PURE__ */ new Set();
|
|
1578
|
+
let current = fiber;
|
|
1579
|
+
while (current && !visited.has(current)) {
|
|
1580
|
+
visited.add(current);
|
|
1581
|
+
const rawStack = current?._debugStack?.stack;
|
|
1582
|
+
const stack = typeof rawStack === "string" ? formatOwnerDebugStack(rawStack) : "";
|
|
1583
|
+
if (stack) {
|
|
1584
|
+
const frames = parseDebugStack(stack);
|
|
1585
|
+
for (const frame of frames) {
|
|
1586
|
+
if (!frame.functionName || !frame.fileName) continue;
|
|
1587
|
+
if (!frame.fileName.startsWith("rsc://")) continue;
|
|
1588
|
+
const normalized = normalizeStackFileName(frame.fileName);
|
|
1589
|
+
if (!normalized) continue;
|
|
1590
|
+
const existing = functionNameToRscFrames.get(frame.functionName) ?? [];
|
|
1591
|
+
const duplicate = existing.some(
|
|
1592
|
+
(candidate) => candidate.fileName === normalized && candidate.lineNumber === frame.lineNumber && candidate.columnNumber === frame.columnNumber
|
|
1593
|
+
);
|
|
1594
|
+
if (!duplicate) {
|
|
1595
|
+
existing.push({
|
|
1596
|
+
fileName: normalized,
|
|
1597
|
+
lineNumber: frame.lineNumber,
|
|
1598
|
+
columnNumber: frame.columnNumber
|
|
1599
|
+
});
|
|
1600
|
+
functionNameToRscFrames.set(frame.functionName, existing);
|
|
1601
|
+
}
|
|
1602
|
+
}
|
|
1603
|
+
}
|
|
1604
|
+
current = current._debugOwner ?? current.return ?? null;
|
|
1605
|
+
}
|
|
1606
|
+
return functionNameToRscFrames;
|
|
1607
|
+
}
|
|
1608
|
+
function enrichServerFrame(frame, functionNameToRscFrames, functionNameToUsageIndex) {
|
|
1609
|
+
if (!frame.functionName) return frame;
|
|
1610
|
+
const available = functionNameToRscFrames.get(frame.functionName);
|
|
1611
|
+
if (!available) return frame;
|
|
1612
|
+
const usageIndex = functionNameToUsageIndex.get(frame.functionName) ?? 0;
|
|
1613
|
+
const resolved = available[usageIndex % available.length];
|
|
1614
|
+
functionNameToUsageIndex.set(frame.functionName, usageIndex + 1);
|
|
1615
|
+
return {
|
|
1616
|
+
...frame,
|
|
1617
|
+
fileName: resolved.fileName,
|
|
1618
|
+
lineNumber: resolved.lineNumber,
|
|
1619
|
+
columnNumber: resolved.columnNumber
|
|
1620
|
+
};
|
|
1621
|
+
}
|
|
1622
|
+
function getSourceFromDebugStack(fiber) {
|
|
1623
|
+
const rawStack = fiber?._debugStack?.stack;
|
|
1624
|
+
if (typeof rawStack !== "string" || rawStack.length === 0) {
|
|
1625
|
+
return null;
|
|
1626
|
+
}
|
|
1627
|
+
const formattedStack = formatOwnerDebugStack(rawStack);
|
|
1628
|
+
if (!formattedStack) return null;
|
|
1629
|
+
const stackFrames = parseDebugStack(formattedStack);
|
|
1630
|
+
const functionNameToRscFrames = buildFunctionNameToRscFramesMap(fiber);
|
|
1631
|
+
const functionNameToUsageIndex = /* @__PURE__ */ new Map();
|
|
1632
|
+
for (const frame of stackFrames) {
|
|
1633
|
+
const maybeEnriched = frame.isServer ? enrichServerFrame(frame, functionNameToRscFrames, functionNameToUsageIndex) : frame;
|
|
1634
|
+
if (!maybeEnriched.fileName) continue;
|
|
1635
|
+
const normalizedFileName = normalizeStackFileName(maybeEnriched.fileName);
|
|
1636
|
+
if (!normalizedFileName) continue;
|
|
1637
|
+
if (isSourceStackFile(normalizedFileName)) {
|
|
1638
|
+
return {
|
|
1639
|
+
fileName: normalizedFileName,
|
|
1640
|
+
lineNumber: maybeEnriched.lineNumber,
|
|
1641
|
+
columnNumber: maybeEnriched.columnNumber
|
|
1642
|
+
};
|
|
1643
|
+
}
|
|
1644
|
+
}
|
|
1645
|
+
return null;
|
|
1646
|
+
}
|
|
1400
1647
|
function getSourceFromFiber(fiber) {
|
|
1401
1648
|
const debugSource = fiber?._debugSource;
|
|
1402
1649
|
if (debugSource?.fileName) return debugSource;
|
|
@@ -1409,6 +1656,8 @@ function getSourceFromFiber(fiber) {
|
|
|
1409
1656
|
if (pending?.fileName) return pending;
|
|
1410
1657
|
const memo = fiber?.memoizedProps?.__source;
|
|
1411
1658
|
if (memo?.fileName) return memo;
|
|
1659
|
+
const fromDebugStack = getSourceFromDebugStack(fiber);
|
|
1660
|
+
if (fromDebugStack?.fileName) return fromDebugStack;
|
|
1412
1661
|
return null;
|
|
1413
1662
|
}
|
|
1414
1663
|
function buildFrame(fiber) {
|
|
@@ -1624,7 +1873,7 @@ function buildTargetHtml(element) {
|
|
|
1624
1873
|
return `<${tagName}${attrString}></${tagName}>`;
|
|
1625
1874
|
}
|
|
1626
1875
|
function formatSourcePath(file) {
|
|
1627
|
-
const normalized = file.replace(/\\/g, "/").replace(/^webpack:\/\/\//, "").replace(/^webpack:\/\//, "").replace(/^file:\/\//, "").replace(/^_N_E\//, "").replace(/^\.\/+/, "");
|
|
1876
|
+
const normalized = file.replace(/\\/g, "/").replace(/^webpack:\/\/\//, "").replace(/^webpack:\/\//, "").replace(/^webpack-internal:\/\//, "").replace(/^rsc:\/\/React\/Server\//, "").replace(/^about:\/\/React\//, "").replace(/^file:\/\//, "").replace(/^\/\(app-pages-browser\)\//, "/").replace(/^\/app-pages-browser\//, "/").replace(/^_N_E\//, "").replace(/^\.\/+/, "");
|
|
1628
1877
|
const packagesIndex = normalized.indexOf("/packages/");
|
|
1629
1878
|
if (packagesIndex !== -1) {
|
|
1630
1879
|
return `/[project]${normalized.slice(packagesIndex)}`;
|
|
@@ -1769,8 +2018,10 @@ function getElementLocator(element) {
|
|
|
1769
2018
|
const elementInfo = getElementInfo(element);
|
|
1770
2019
|
let domSource = parseDomSource(element);
|
|
1771
2020
|
if (!domSource) {
|
|
1772
|
-
const
|
|
1773
|
-
|
|
2021
|
+
const seenFibers = /* @__PURE__ */ new Set();
|
|
2022
|
+
let fiber = getFiberForElement(element);
|
|
2023
|
+
while (fiber && !seenFibers.has(fiber)) {
|
|
2024
|
+
seenFibers.add(fiber);
|
|
1774
2025
|
const fiberSource = getSourceFromFiber(fiber);
|
|
1775
2026
|
if (fiberSource?.fileName) {
|
|
1776
2027
|
domSource = {
|
|
@@ -1778,7 +2029,9 @@ function getElementLocator(element) {
|
|
|
1778
2029
|
line: fiberSource.lineNumber,
|
|
1779
2030
|
column: fiberSource.columnNumber
|
|
1780
2031
|
};
|
|
2032
|
+
break;
|
|
1781
2033
|
}
|
|
2034
|
+
fiber = fiber._debugOwner ?? fiber.return ?? null;
|
|
1782
2035
|
}
|
|
1783
2036
|
}
|
|
1784
2037
|
return {
|
|
@@ -3875,7 +4128,7 @@ function MeasurementOverlay({
|
|
|
3875
4128
|
children: [
|
|
3876
4129
|
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(ElementHighlight, { element: selectedElement, color: BLUE }),
|
|
3877
4130
|
hoveredElement && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(ElementHighlight, { element: hoveredElement, color: TOMATO, isDashed: true }),
|
|
3878
|
-
measurements.map((line
|
|
4131
|
+
measurements.map((line) => /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(MeasurementLineComponent, { line }, `${line.direction}-${line.x1}-${line.y1}-${line.x2}-${line.y2}`))
|
|
3879
4132
|
]
|
|
3880
4133
|
}
|
|
3881
4134
|
);
|
|
@@ -4446,7 +4699,7 @@ function SelectionOverlay({
|
|
|
4446
4699
|
onDoubleClick: handleDoubleClick,
|
|
4447
4700
|
onMouseMove: handleMouseMove,
|
|
4448
4701
|
onMouseLeave: handleMouseLeave,
|
|
4449
|
-
children: moveHandleRects.map((targetRect
|
|
4702
|
+
children: moveHandleRects.map((targetRect) => {
|
|
4450
4703
|
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
4451
4704
|
"button",
|
|
4452
4705
|
{
|
|
@@ -4473,7 +4726,7 @@ function SelectionOverlay({
|
|
|
4473
4726
|
},
|
|
4474
4727
|
onPointerDown: handleMoveHandlePointerDown(targetRect.target)
|
|
4475
4728
|
},
|
|
4476
|
-
`${
|
|
4729
|
+
`${targetRect.left}-${targetRect.top}-${targetRect.width}-${targetRect.height}`
|
|
4477
4730
|
);
|
|
4478
4731
|
})
|
|
4479
4732
|
}
|
|
@@ -4616,10 +4869,12 @@ function CommentPin({
|
|
|
4616
4869
|
}
|
|
4617
4870
|
),
|
|
4618
4871
|
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
4619
|
-
"
|
|
4872
|
+
"button",
|
|
4620
4873
|
{
|
|
4874
|
+
type: "button",
|
|
4621
4875
|
"data-direct-edit": "comment-pin",
|
|
4622
|
-
|
|
4876
|
+
"aria-label": `Comment ${index}`,
|
|
4877
|
+
className: "group/pin fixed z-[99998] flex size-3 cursor-pointer items-center justify-center rounded-full border-none bg-blue-500 p-0 shadow-md ring-2 ring-white transition-transform hover:scale-[1.67] hover:shadow-lg",
|
|
4623
4878
|
style: {
|
|
4624
4879
|
left: position.x - 6,
|
|
4625
4880
|
top: position.y - 6,
|
|
@@ -4699,6 +4954,7 @@ function NewCommentInput({
|
|
|
4699
4954
|
"div",
|
|
4700
4955
|
{
|
|
4701
4956
|
ref: cardRef,
|
|
4957
|
+
role: "presentation",
|
|
4702
4958
|
"data-direct-edit": "comment-card",
|
|
4703
4959
|
className: cn(
|
|
4704
4960
|
"fixed z-[99999] flex items-center gap-1.5 rounded-xl outline outline-1 outline-foreground/10 bg-background p-1.5 shadow-lg",
|
|
@@ -4816,6 +5072,7 @@ function CommentThread({
|
|
|
4816
5072
|
return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
|
|
4817
5073
|
"div",
|
|
4818
5074
|
{
|
|
5075
|
+
role: "presentation",
|
|
4819
5076
|
"data-direct-edit": "comment-card",
|
|
4820
5077
|
className: "fixed z-[99999] w-[280px] overflow-hidden rounded-xl outline outline-1 outline-foreground/10 bg-background shadow-lg",
|
|
4821
5078
|
style: {
|
|
@@ -4913,13 +5170,13 @@ function CommentThread({
|
|
|
4913
5170
|
] }),
|
|
4914
5171
|
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("p", { className: "text-xs leading-relaxed text-foreground", children: comment.text })
|
|
4915
5172
|
] }),
|
|
4916
|
-
comment.replies.map((reply
|
|
5173
|
+
comment.replies.map((reply) => /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "border-t border-border/30 px-3 py-2.5", children: [
|
|
4917
5174
|
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "mb-1 flex items-center gap-2", children: [
|
|
4918
5175
|
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "flex size-5 shrink-0 items-center justify-center rounded-full bg-blue-500 text-[10px] font-bold text-white", children: index }),
|
|
4919
5176
|
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "text-[10px] text-muted-foreground", children: formatRelativeTime(reply.createdAt) })
|
|
4920
5177
|
] }),
|
|
4921
5178
|
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("p", { className: "text-xs leading-relaxed text-foreground", children: reply.text })
|
|
4922
|
-
] },
|
|
5179
|
+
] }, reply.createdAt))
|
|
4923
5180
|
] }),
|
|
4924
5181
|
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "flex items-center gap-1.5 border-t border-border/50 px-2 py-1.5", children: [
|
|
4925
5182
|
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
@@ -7422,6 +7679,7 @@ function DirectEditPanelContent() {
|
|
|
7422
7679
|
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
7423
7680
|
"div",
|
|
7424
7681
|
{
|
|
7682
|
+
role: "presentation",
|
|
7425
7683
|
"data-direct-edit": "overlay",
|
|
7426
7684
|
className: cn("fixed inset-0 z-[99990] cursor-default"),
|
|
7427
7685
|
style: { pointerEvents: textEditingElement ? "none" : "auto" },
|
|
@@ -7503,7 +7761,7 @@ function DirectEditPanelContent() {
|
|
|
7503
7761
|
strokeWidth: 1,
|
|
7504
7762
|
strokeDasharray: "4 2"
|
|
7505
7763
|
},
|
|
7506
|
-
|
|
7764
|
+
`${r.left}-${r.top}-${r.width}-${r.height}`
|
|
7507
7765
|
);
|
|
7508
7766
|
})
|
|
7509
7767
|
]
|
|
@@ -8745,10 +9003,19 @@ ${text}`);
|
|
|
8745
9003
|
return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
|
|
8746
9004
|
"div",
|
|
8747
9005
|
{
|
|
9006
|
+
role: "button",
|
|
9007
|
+
tabIndex: 0,
|
|
8748
9008
|
className: "group flex cursor-pointer items-start justify-between rounded-md px-1.5 py-1.5 text-xs transition-colors hover:bg-muted/50",
|
|
8749
9009
|
onClick: () => {
|
|
8750
9010
|
void handleCopyItem(item);
|
|
8751
9011
|
},
|
|
9012
|
+
onKeyDown: (e) => {
|
|
9013
|
+
if (e.target !== e.currentTarget) return;
|
|
9014
|
+
if (e.key === "Enter" || e.key === " ") {
|
|
9015
|
+
e.preventDefault();
|
|
9016
|
+
void handleCopyItem(item);
|
|
9017
|
+
}
|
|
9018
|
+
},
|
|
8752
9019
|
children: [
|
|
8753
9020
|
/* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "min-w-0 flex flex-1 flex-col items-start gap-[4px]", children: [
|
|
8754
9021
|
/* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(Badge, { variant: "secondary", className: "h-6 shrink-0 px-1.5 text-xs", children: [
|
|
@@ -8780,7 +9047,7 @@ ${text}`);
|
|
|
8780
9047
|
)
|
|
8781
9048
|
]
|
|
8782
9049
|
},
|
|
8783
|
-
i
|
|
9050
|
+
item.type === "comment" ? item.comment.id : `edit-${i}`
|
|
8784
9051
|
);
|
|
8785
9052
|
}) })
|
|
8786
9053
|
]
|
|
@@ -8868,7 +9135,7 @@ ${text}`);
|
|
|
8868
9135
|
{ label: "Back / Exit", keys: ["Esc"] }
|
|
8869
9136
|
].map(({ label, keys }) => /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "flex h-8 w-full items-center justify-between rounded-md px-2 text-xs text-muted-foreground", children: [
|
|
8870
9137
|
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("span", { children: label }),
|
|
8871
|
-
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("span", { className: "flex items-center gap-0.5", children: keys.map((k, i) => /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("kbd", { className: popupKbdClass, children: k }, i)) })
|
|
9138
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("span", { className: "flex items-center gap-0.5", children: keys.map((k, i) => /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("kbd", { className: popupKbdClass, children: k }, typeof k === "string" ? k : i)) })
|
|
8872
9139
|
] }, label)) })
|
|
8873
9140
|
]
|
|
8874
9141
|
}
|