@solhun/feedback-kit-web 0.2.2 → 0.3.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.cjs +76 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +7 -2
- package/dist/index.d.ts +7 -2
- package/dist/index.js +76 -4
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -17,6 +17,44 @@ import {
|
|
|
17
17
|
} from "@solhun/feedback-kit-core";
|
|
18
18
|
|
|
19
19
|
// src/react-tree.ts
|
|
20
|
+
var FRAMEWORK_INTERNALS = /* @__PURE__ */ new Set([
|
|
21
|
+
// Next.js App Router
|
|
22
|
+
"AppRouter",
|
|
23
|
+
"InnerLayoutRouter",
|
|
24
|
+
"OuterLayoutRouter",
|
|
25
|
+
"LayoutRouterContext",
|
|
26
|
+
"RenderFromTemplateContext",
|
|
27
|
+
"TemplateContext",
|
|
28
|
+
"SegmentStateProvider",
|
|
29
|
+
"SegmentViewNode",
|
|
30
|
+
"ScrollAndMaybeFocusHandler",
|
|
31
|
+
"InnerScrollAndFocusHandler",
|
|
32
|
+
"InnerScrollAndFocusHandlerOld",
|
|
33
|
+
"RedirectBoundary",
|
|
34
|
+
"RedirectErrorBoundary",
|
|
35
|
+
"NotFoundBoundary",
|
|
36
|
+
"NotFoundErrorBoundary",
|
|
37
|
+
"HTTPAccessFallbackBoundary",
|
|
38
|
+
"HTTPAccessFallbackErrorBoundary",
|
|
39
|
+
"DevRootHTTPAccessFallbackBoundary",
|
|
40
|
+
"LoadingBoundary",
|
|
41
|
+
"ErrorBoundaryHandler",
|
|
42
|
+
"MetadataBoundary",
|
|
43
|
+
"ViewportBoundary",
|
|
44
|
+
"OutletBoundary",
|
|
45
|
+
// 개발 전용 오버레이 — 프로덕션엔 없지만 dev 제보에는 항상 낀다
|
|
46
|
+
"HotReload",
|
|
47
|
+
"AppDevOverlay",
|
|
48
|
+
"AppDevOverlayErrorBoundary",
|
|
49
|
+
"ReactDevOverlay",
|
|
50
|
+
"DevOverlay",
|
|
51
|
+
"Router",
|
|
52
|
+
"ServerRoot",
|
|
53
|
+
"RSCComponent"
|
|
54
|
+
]);
|
|
55
|
+
function isFrameworkName(name) {
|
|
56
|
+
return FRAMEWORK_INTERNALS.has(name) || name.startsWith("__next");
|
|
57
|
+
}
|
|
20
58
|
function componentName(type) {
|
|
21
59
|
if (typeof type === "function") {
|
|
22
60
|
const fn = type;
|
|
@@ -39,13 +77,15 @@ function fiberOf(node) {
|
|
|
39
77
|
}
|
|
40
78
|
return null;
|
|
41
79
|
}
|
|
42
|
-
function reactComponentPath(node, limit =
|
|
80
|
+
function reactComponentPath(node, limit = 5) {
|
|
43
81
|
try {
|
|
44
82
|
let fiber = fiberOf(node);
|
|
45
83
|
const names = [];
|
|
46
|
-
|
|
84
|
+
let depth = 0;
|
|
85
|
+
while (fiber && names.length < limit && depth < 200) {
|
|
86
|
+
depth += 1;
|
|
47
87
|
const name = componentName(fiber.elementType ?? fiber.type);
|
|
48
|
-
if (name && names[0] !== name) names.unshift(name);
|
|
88
|
+
if (name && !isFrameworkName(name) && names[0] !== name) names.unshift(name);
|
|
49
89
|
fiber = fiber.return ?? null;
|
|
50
90
|
}
|
|
51
91
|
return names;
|
|
@@ -692,6 +732,11 @@ import {
|
|
|
692
732
|
useRef,
|
|
693
733
|
useState
|
|
694
734
|
} from "react";
|
|
735
|
+
|
|
736
|
+
// src/version.ts
|
|
737
|
+
var VERSION = true ? "0.3.0" : "dev";
|
|
738
|
+
|
|
739
|
+
// src/feedback-kit.tsx
|
|
695
740
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
696
741
|
var TOKENS = {
|
|
697
742
|
ink: "#17202a",
|
|
@@ -1045,7 +1090,34 @@ function FeedbackKit(props) {
|
|
|
1045
1090
|
},
|
|
1046
1091
|
children: [
|
|
1047
1092
|
/* @__PURE__ */ jsxs("form", { onSubmit: submitReport, children: [
|
|
1048
|
-
/* @__PURE__ */
|
|
1093
|
+
/* @__PURE__ */ jsxs(
|
|
1094
|
+
"h2",
|
|
1095
|
+
{
|
|
1096
|
+
id: "feedback-kit-dialog-title",
|
|
1097
|
+
style: {
|
|
1098
|
+
margin: "0 0 4px",
|
|
1099
|
+
fontSize: 20,
|
|
1100
|
+
display: "flex",
|
|
1101
|
+
alignItems: "baseline",
|
|
1102
|
+
gap: 8
|
|
1103
|
+
},
|
|
1104
|
+
children: [
|
|
1105
|
+
"\uD53C\uB4DC\uBC31 \uBCF4\uB0B4\uAE30",
|
|
1106
|
+
/* @__PURE__ */ jsxs(
|
|
1107
|
+
"span",
|
|
1108
|
+
{
|
|
1109
|
+
"data-feedback-kit-version": VERSION,
|
|
1110
|
+
title: "feedback-kit \uBC84\uC804",
|
|
1111
|
+
style: { fontSize: 11, fontWeight: 400, color: TOKENS.muted },
|
|
1112
|
+
children: [
|
|
1113
|
+
"v",
|
|
1114
|
+
VERSION
|
|
1115
|
+
]
|
|
1116
|
+
}
|
|
1117
|
+
)
|
|
1118
|
+
]
|
|
1119
|
+
}
|
|
1120
|
+
),
|
|
1049
1121
|
/* @__PURE__ */ jsx("p", { style: { margin: "0 0 18px", color: TOKENS.muted }, children: "\uD604\uC7AC \uD654\uBA74\uC758 \uBB38\uC81C\uB098 \uC758\uACAC\uC744 \uB0A8\uACA8\uC8FC\uC138\uC694." }),
|
|
1050
1122
|
/* @__PURE__ */ jsxs("section", { "aria-labelledby": "feedback-kit-screenshot-label", style: { marginBottom: 16 }, children: [
|
|
1051
1123
|
/* @__PURE__ */ jsx("strong", { id: "feedback-kit-screenshot-label", children: "\uC2A4\uD06C\uB9B0\uC0F7" }),
|