appium-desktop-driver 1.4.0 → 1.4.2

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/docs/script.js ADDED
@@ -0,0 +1,69 @@
1
+ /* ============================================================
2
+ Language tabs
3
+ ============================================================ */
4
+ document.querySelectorAll('.lang-tabs').forEach((tabBar) => {
5
+ const tabs = tabBar.querySelectorAll('.lang-tab');
6
+ const codeBlock = tabBar.nextElementSibling; // .tabbed-code
7
+
8
+ tabs.forEach((tab) => {
9
+ tab.addEventListener('click', () => {
10
+ const lang = tab.dataset.lang;
11
+
12
+ // Update active tab
13
+ tabs.forEach((t) => delete t.dataset.active);
14
+ tab.dataset.active = '';
15
+
16
+ // Show matching pre
17
+ codeBlock.querySelectorAll('pre').forEach((pre) => {
18
+ delete pre.dataset.active;
19
+ if (pre.dataset.lang === lang) {
20
+ pre.dataset.active = '';
21
+ }
22
+ });
23
+ });
24
+ });
25
+ });
26
+
27
+ /* ============================================================
28
+ Copy buttons
29
+ ============================================================ */
30
+ const ICON_COPY = `<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="9" y="9" width="13" height="13" rx="2"/><path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"/></svg>`;
31
+ const ICON_CHECK = `<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><polyline points="20 6 9 17 4 12"/></svg>`;
32
+
33
+ function makeCopyBtn() {
34
+ const btn = document.createElement('button');
35
+ btn.className = 'copy-btn';
36
+ btn.setAttribute('aria-label', 'Copy');
37
+ btn.innerHTML = ICON_COPY;
38
+ return btn;
39
+ }
40
+
41
+ function flashCopied(btn) {
42
+ btn.innerHTML = ICON_CHECK;
43
+ btn.classList.add('copied');
44
+ setTimeout(() => { btn.innerHTML = ICON_COPY; btn.classList.remove('copied'); }, 1800);
45
+ }
46
+
47
+ function addCopyButton(wrap) {
48
+ const btn = makeCopyBtn();
49
+ btn.addEventListener('click', async () => {
50
+ const code = wrap.querySelector('pre[data-active], pre') || wrap;
51
+ await navigator.clipboard.writeText(code.innerText.trim());
52
+ flashCopied(btn);
53
+ });
54
+ wrap.appendChild(btn);
55
+ }
56
+
57
+ document.querySelectorAll('.code-block-wrap').forEach(addCopyButton);
58
+
59
+ // Hero install block
60
+ const heroInstall = document.querySelector('.hero-install');
61
+ if (heroInstall) {
62
+ const btn = makeCopyBtn();
63
+ btn.classList.add('hero-install-copy');
64
+ btn.addEventListener('click', async () => {
65
+ await navigator.clipboard.writeText(heroInstall.querySelector('code').innerText.trim());
66
+ flashCopied(btn);
67
+ });
68
+ heroInstall.appendChild(btn);
69
+ }