Commit b15c476
feat: Make it so PFE-Clipboard can copy arbitrary content (#1795)
* Added proof of concept for copying arbitrary content
Need docs update and tests still
* ported pfe-clipboard tests to web-test-runner
* removed old slotchange event
* removed arrow functions to allow individual tests to override timeouts.
* Adding disabled states for when copy target has issues
* Writing tests to for disabled state and fixing resulting bugs
* Cleaning up code a bit
* Removing checks for copying text content of HTML
Discussed with Kyle Buchanan, Michael Clayton, and other CPFED folks, guarding against the HTML element that will have it's text copied isn't really worth it. There isn't a good way to know that it _should_ be disabled and then _should_ be enabled later.
Better to leave it to the click event, and hopefully things were setup so it'll work when the user clicks on it
* Added docs and fixed some bugs
* Updated changelog
* On element copy, use innerText instead of innerHTML, think it's safer
* added correct icon colors
* ignore [disabled] on focus,hover states
* update docs
* Removing unnecessary event listener ... removal.
* update docs
* Revert "update docs"
This reverts commit 8de71ec.
* Providing better default UI for buttons not copying a URL
* Updating documentation for pfe-clipboard based on updates
* Updating default content for icon slot in tests
* chore: update docs
Co-authored-by: heyMP <[email protected]>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Zack Hawkins <[email protected]>1 parent f33ba4a commit b15c476
File tree
15 files changed
+591
-332
lines changed- elements/pfe-clipboard
- demo
- docs
- src
- test
15 files changed
+591
-332
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
1 | 2 | | |
2 | 3 | | |
3 | 4 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
12 | 39 | | |
13 | 40 | | |
14 | 41 | | |
| |||
66 | 93 | | |
67 | 94 | | |
68 | 95 | | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
69 | 100 | | |
70 | 101 | | |
71 | 102 | | |
| |||
87 | 118 | | |
88 | 119 | | |
89 | 120 | | |
90 | | - | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
91 | 124 | | |
92 | 125 | | |
93 | 126 | | |
| |||
99 | 132 | | |
100 | 133 | | |
101 | 134 | | |
102 | | - | |
| 135 | + | |
103 | 136 | | |
104 | | - | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
105 | 140 | | |
106 | | - | |
| 141 | + | |
107 | 142 | | |
108 | | - | |
109 | | - | |
| 143 | + | |
110 | 144 | | |
111 | | - | |
112 | | - | |
| 145 | + | |
113 | 146 | | |
114 | 147 | | |
115 | 148 | | |
| |||
121 | 154 | | |
122 | 155 | | |
123 | 156 | | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
124 | 170 | | |
125 | 171 | | |
126 | 172 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
63 | 63 | | |
64 | 64 | | |
65 | 65 | | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
66 | 100 | | |
67 | 101 | | |
68 | 102 | | |
| |||
73 | 107 | | |
74 | 108 | | |
75 | 109 | | |
76 | | - | |
| 110 | + | |
77 | 111 | | |
78 | 112 | | |
79 | 113 | | |
| |||
97 | 131 | | |
98 | 132 | | |
99 | 133 | | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
100 | 155 | | |
101 | 156 | | |
102 | 157 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | | - | |
| 20 | + | |
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| |||
55 | 55 | | |
56 | 56 | | |
57 | 57 | | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
58 | 90 | | |
59 | 91 | | |
60 | 92 | | |
| |||
126 | 158 | | |
127 | 159 | | |
128 | 160 | | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
129 | 168 | | |
130 | 169 | | |
131 | 170 | | |
| |||
135 | 174 | | |
136 | 175 | | |
137 | 176 | | |
138 | | - | |
139 | 177 | | |
140 | | - | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
141 | 185 | | |
142 | 186 | | |
143 | 187 | | |
144 | 188 | | |
145 | 189 | | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
146 | 204 | | |
147 | 205 | | |
148 | 206 | | |
149 | 207 | | |
150 | 208 | | |
151 | 209 | | |
| 210 | + | |
152 | 211 | | |
153 | 212 | | |
154 | 213 | | |
155 | 214 | | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
156 | 219 | | |
157 | 220 | | |
158 | 221 | | |
| |||
170 | 233 | | |
171 | 234 | | |
172 | 235 | | |
| 236 | + | |
| 237 | + | |
173 | 238 | | |
174 | 239 | | |
175 | 240 | | |
176 | 241 | | |
177 | 242 | | |
178 | 243 | | |
179 | | - | |
180 | | - | |
181 | | - | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
182 | 250 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
5 | | - | |
6 | | - | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
7 | 8 | | |
8 | 9 | | |
9 | 10 | | |
10 | | - | |
| 11 | + | |
11 | 12 | | |
12 | 13 | | |
13 | 14 | | |
14 | | - | |
| 15 | + | |
0 commit comments