ghostfill 0.1.1 → 0.1.3

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/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # GhostFill
2
2
 
3
- Dev tool that fills form fields with fake data. Select a block, click fill — done.
3
+ Dev tool that fills form fields with sample data. Select a block, click fill — done.
4
4
 
5
5
  Works with any framework (React, Vue, Angular, vanilla). Detects inputs, textareas, selects, checkboxes, radios, date pickers, and custom dropdowns (Headless UI, Radix).
6
6
 
@@ -50,7 +50,7 @@ await fill({ container: document.querySelector("form") });
50
50
  1. A ghost icon appears on the page (starts minimized)
51
51
  2. Click it to enter selection mode — hover and click a form area
52
52
  3. Click the sparkles button to fill all detected fields
53
- 4. By default, generates random fake data locally (no API needed)
53
+ 4. By default, generates random sample data locally (no API needed)
54
54
  5. Optionally enable AI mode in settings for context-aware data generation
55
55
 
56
56
  ## Settings
@@ -66,7 +66,7 @@ Click the gear icon to configure:
66
66
 
67
67
  ## Features
68
68
 
69
- - **Zero config** — works out of the box with random fake data
69
+ - **Zero config** — works out of the box with random sample data
70
70
  - **Shadow DOM** — styles don't leak into your app
71
71
  - **Framework-aware** — uses native value setters so React/Vue/Angular pick up changes
72
72
  - **Smart detection** — labels from `<label>`, `aria-label`, placeholder, preceding siblings
package/dist/index.js CHANGED
@@ -1012,6 +1012,13 @@ var CSS2 = `
1012
1012
  padding: 4px 8px; border-radius: 6px; background: rgba(255,255,255,0.04);
1013
1013
  }
1014
1014
  .gf-preset-item-name { font-size: 12px; color: rgba(255,255,255,0.7); }
1015
+ .gf-preset-actions { display: flex; align-items: center; gap: 2px; }
1016
+ .gf-preset-edit {
1017
+ background: none; border: none; color: rgba(255,255,255,0.25); cursor: pointer;
1018
+ font-size: 14px; padding: 0 2px; line-height: 1; transition: color 0.15s;
1019
+ display: flex; align-items: center;
1020
+ }
1021
+ .gf-preset-edit:hover { color: #6366f1; }
1015
1022
  .gf-preset-del {
1016
1023
  background: none; border: none; color: rgba(255,255,255,0.25); cursor: pointer;
1017
1024
  font-size: 14px; padding: 0 2px; line-height: 1; transition: color 0.15s;
@@ -1705,6 +1712,19 @@ function createOverlay2(options) {
1705
1712
  sPresetPrompt.value = p.prompt;
1706
1713
  sPresetName.focus();
1707
1714
  });
1715
+ const actions = document.createElement("div");
1716
+ actions.className = "gf-preset-actions";
1717
+ const edit = document.createElement("button");
1718
+ edit.className = "gf-preset-edit";
1719
+ edit.innerHTML = '<svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M17 3a2.85 2.85 0 114 4L7.5 20.5 2 22l1.5-5.5z"/></svg>';
1720
+ edit.title = "Edit preset";
1721
+ edit.addEventListener("click", () => {
1722
+ editingPresetId = p.id;
1723
+ sPresetForm.style.display = "flex";
1724
+ sPresetName.value = p.name;
1725
+ sPresetPrompt.value = p.prompt;
1726
+ sPresetName.focus();
1727
+ });
1708
1728
  const del = document.createElement("button");
1709
1729
  del.className = "gf-preset-del";
1710
1730
  del.innerHTML = "&times;";
@@ -1714,7 +1734,8 @@ function createOverlay2(options) {
1714
1734
  renderPresetList();
1715
1735
  updateFillPresetUI();
1716
1736
  });
1717
- item.append(name, del);
1737
+ actions.append(edit, del);
1738
+ item.append(name, actions);
1718
1739
  sPresetList.appendChild(item);
1719
1740
  });
1720
1741
  }