@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 CHANGED
@@ -74,6 +74,44 @@ var import_feedback_kit_core5 = require("@solhun/feedback-kit-core");
74
74
  var import_feedback_kit_core6 = require("@solhun/feedback-kit-core");
75
75
 
76
76
  // src/react-tree.ts
77
+ var FRAMEWORK_INTERNALS = /* @__PURE__ */ new Set([
78
+ // Next.js App Router
79
+ "AppRouter",
80
+ "InnerLayoutRouter",
81
+ "OuterLayoutRouter",
82
+ "LayoutRouterContext",
83
+ "RenderFromTemplateContext",
84
+ "TemplateContext",
85
+ "SegmentStateProvider",
86
+ "SegmentViewNode",
87
+ "ScrollAndMaybeFocusHandler",
88
+ "InnerScrollAndFocusHandler",
89
+ "InnerScrollAndFocusHandlerOld",
90
+ "RedirectBoundary",
91
+ "RedirectErrorBoundary",
92
+ "NotFoundBoundary",
93
+ "NotFoundErrorBoundary",
94
+ "HTTPAccessFallbackBoundary",
95
+ "HTTPAccessFallbackErrorBoundary",
96
+ "DevRootHTTPAccessFallbackBoundary",
97
+ "LoadingBoundary",
98
+ "ErrorBoundaryHandler",
99
+ "MetadataBoundary",
100
+ "ViewportBoundary",
101
+ "OutletBoundary",
102
+ // 개발 전용 오버레이 — 프로덕션엔 없지만 dev 제보에는 항상 낀다
103
+ "HotReload",
104
+ "AppDevOverlay",
105
+ "AppDevOverlayErrorBoundary",
106
+ "ReactDevOverlay",
107
+ "DevOverlay",
108
+ "Router",
109
+ "ServerRoot",
110
+ "RSCComponent"
111
+ ]);
112
+ function isFrameworkName(name) {
113
+ return FRAMEWORK_INTERNALS.has(name) || name.startsWith("__next");
114
+ }
77
115
  function componentName(type) {
78
116
  if (typeof type === "function") {
79
117
  const fn = type;
@@ -96,13 +134,15 @@ function fiberOf(node) {
96
134
  }
97
135
  return null;
98
136
  }
99
- function reactComponentPath(node, limit = 20) {
137
+ function reactComponentPath(node, limit = 5) {
100
138
  try {
101
139
  let fiber = fiberOf(node);
102
140
  const names = [];
103
- while (fiber && names.length < limit) {
141
+ let depth = 0;
142
+ while (fiber && names.length < limit && depth < 200) {
143
+ depth += 1;
104
144
  const name = componentName(fiber.elementType ?? fiber.type);
105
- if (name && names[0] !== name) names.unshift(name);
145
+ if (name && !isFrameworkName(name) && names[0] !== name) names.unshift(name);
106
146
  fiber = fiber.return ?? null;
107
147
  }
108
148
  return names;
@@ -733,6 +773,11 @@ function createWebWidget(opts) {
733
773
  // src/feedback-kit.tsx
734
774
  var import_feedback_kit_core3 = require("@solhun/feedback-kit-core");
735
775
  var import_react = require("react");
776
+
777
+ // src/version.ts
778
+ var VERSION = true ? "0.3.0" : "dev";
779
+
780
+ // src/feedback-kit.tsx
736
781
  var import_jsx_runtime = require("react/jsx-runtime");
737
782
  var TOKENS = {
738
783
  ink: "#17202a",
@@ -1086,7 +1131,34 @@ function FeedbackKit(props) {
1086
1131
  },
1087
1132
  children: [
1088
1133
  /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("form", { onSubmit: submitReport, children: [
1089
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("h2", { id: "feedback-kit-dialog-title", style: { margin: "0 0 4px", fontSize: 20 }, children: "\uD53C\uB4DC\uBC31 \uBCF4\uB0B4\uAE30" }),
1134
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
1135
+ "h2",
1136
+ {
1137
+ id: "feedback-kit-dialog-title",
1138
+ style: {
1139
+ margin: "0 0 4px",
1140
+ fontSize: 20,
1141
+ display: "flex",
1142
+ alignItems: "baseline",
1143
+ gap: 8
1144
+ },
1145
+ children: [
1146
+ "\uD53C\uB4DC\uBC31 \uBCF4\uB0B4\uAE30",
1147
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
1148
+ "span",
1149
+ {
1150
+ "data-feedback-kit-version": VERSION,
1151
+ title: "feedback-kit \uBC84\uC804",
1152
+ style: { fontSize: 11, fontWeight: 400, color: TOKENS.muted },
1153
+ children: [
1154
+ "v",
1155
+ VERSION
1156
+ ]
1157
+ }
1158
+ )
1159
+ ]
1160
+ }
1161
+ ),
1090
1162
  /* @__PURE__ */ (0, import_jsx_runtime.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." }),
1091
1163
  /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("section", { "aria-labelledby": "feedback-kit-screenshot-label", style: { marginBottom: 16 }, children: [
1092
1164
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)("strong", { id: "feedback-kit-screenshot-label", children: "\uC2A4\uD06C\uB9B0\uC0F7" }),