rune-grab 0.1.3 → 0.1.5

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/react.cjs CHANGED
@@ -1123,7 +1123,7 @@ function getReactComponentInfo(el, customSkip) {
1123
1123
  const name = cur.type.displayName || cur.type.name;
1124
1124
  const src = isFirst && elementSrc ? elementSrc : getSourceFromFiber(cur);
1125
1125
  const filePath = src?.fileName ? cleanFilePath(src.fileName) : null;
1126
- if (name && isUsefulName(name, filePath, customSkip)) {
1126
+ if (name && filePath && isUsefulName(name, filePath, customSkip)) {
1127
1127
  const info = {
1128
1128
  name,
1129
1129
  filePath,
@@ -1141,7 +1141,7 @@ function getReactComponentInfo(el, customSkip) {
1141
1141
  const name = inner.displayName || inner.name;
1142
1142
  const src = isFirst && elementSrc ? elementSrc : getSourceFromFiber(cur);
1143
1143
  const filePath = src?.fileName ? cleanFilePath(src.fileName) : null;
1144
- if (name && isUsefulName(name, filePath, customSkip)) {
1144
+ if (name && filePath && isUsefulName(name, filePath, customSkip)) {
1145
1145
  const info = {
1146
1146
  name,
1147
1147
  filePath,
@@ -1180,7 +1180,7 @@ function getReactComponentStack(el, maxDepth = 6, customSkip) {
1180
1180
  }
1181
1181
  }
1182
1182
  let filePath = src?.fileName ? cleanFilePath(src.fileName) : null;
1183
- if (name && isUsefulName(name, filePath, customSkip) && !seen.has(name)) {
1183
+ if (name && filePath && isUsefulName(name, filePath, customSkip) && !seen.has(name)) {
1184
1184
  seen.add(name);
1185
1185
  const frame = { name, filePath, line: src?.lineNumber ?? null };
1186
1186
  if (src) storePendingResolution(frame, src);
@@ -1579,7 +1579,14 @@ function showPromptInput(onSubmit) {
1579
1579
  const input = document.createElement("input");
1580
1580
  input.type = "text";
1581
1581
  input.placeholder = "Comment (Enter \u21B5 send, Esc cancel)";
1582
+ input.className = "__rune-grab-prompt__";
1582
1583
  input.style.cssText = `background:transparent;border:none;outline:none;color:${M_FG};font-size:12px;font-family:${FONT};width:230px;padding:2px 0;caret-color:${M_FG};`;
1584
+ if (!document.getElementById("__rune-grab-placeholder-style__")) {
1585
+ const style = document.createElement("style");
1586
+ style.id = "__rune-grab-placeholder-style__";
1587
+ style.textContent = `.__rune-grab-prompt__::placeholder{color:${M_FG_DIM} !important;opacity:1 !important;}`;
1588
+ document.head.appendChild(style);
1589
+ }
1583
1590
  const sendBtn = document.createElement("button");
1584
1591
  sendBtn.innerHTML = ICON_SEND;
1585
1592
  sendBtn.style.cssText = `width:22px;height:22px;border:1px solid ${M_BORDER};background:${M_ACTIVE_BG};color:${M_ACTIVE_FG};border-radius:50%;cursor:pointer;display:flex;align-items:center;justify-content:center;flex-shrink:0;transition:all 0.15s;`;