auto-component 0.0.28 → 0.0.30

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "auto-component",
3
- "version": "0.0.28",
3
+ "version": "0.0.30",
4
4
  "main": "src/index.jsx",
5
5
  "peerDependencies": {
6
6
  "react": "^18.2.0",
@@ -5,6 +5,7 @@
5
5
  flex-direction: column;
6
6
  align-items: center;
7
7
  margin: 40px 0;
8
+ font-family: Arial, Helvetica, sans-serif
8
9
  }
9
10
  #content-creator div {
10
11
  width: 100%;
@@ -50,6 +51,7 @@
50
51
  }
51
52
  .tab {
52
53
  margin: 0 10%;
54
+ padding: 4px 0;
53
55
  background: #444;
54
56
  color: #aaa;
55
57
  border-radius: 5px 5px 0 0;
@@ -82,14 +84,14 @@
82
84
  }
83
85
  .copy-btn {
84
86
  position: absolute;
85
- top: 120px;
87
+ top: 130px;
86
88
  right: 7%;
87
- max-width: 40px;
89
+ max-width: 50px;
88
90
  max-height: 30px;
89
91
  cursor: pointer;
90
92
  background: rgba(0, 0, 0, 0.2);
91
93
  border-radius: 5px;
92
- padding: 10px;
94
+ padding: 10px 20px;
93
95
  color: #fff;
94
96
  }
95
97
 
package/src/index.jsx CHANGED
@@ -109,7 +109,7 @@ const AutoComponent = ({ exclusions }) => {
109
109
  });
110
110
 
111
111
  if (res.ok) {
112
- const jsonData = await res.json(); // Extract JSON data from the response body
112
+ const jsonData = await res.json();
113
113
  return jsonData;
114
114
  } else {
115
115
  throw new Error("Invalid request!");
@@ -172,7 +172,7 @@ const AutoComponent = ({ exclusions }) => {
172
172
  }
173
173
 
174
174
  const copyToClipboard = async () => {
175
- const text = activeTab === 'response' ? responseData : currentRequest
175
+ const text = activeTab === 'response' ? responseData : requestData
176
176
  await navigator.clipboard.writeText(text)
177
177
  }
178
178
 
@@ -218,7 +218,7 @@ User Request:\n `
218
218
  {activeTab === 'request' ? requestHTML : responseHtml}
219
219
  </pre>
220
220
  </div>
221
- <div className="copy-btn" onClick={copyToClipboard}>
221
+ <div className="copy-btn" onClick={copyToClipboard} style={activeTab !== 'response' ? { display: 'none' } : null}>
222
222
  copy
223
223
  </div>
224
224
  </div>