@ubox-tools/deploy-xperience 1.1.6 → 1.1.7

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.
Files changed (2) hide show
  1. package/deploy.js +19 -15
  2. package/package.json +1 -1
package/deploy.js CHANGED
@@ -816,21 +816,25 @@ async function installApp(page, appFullName) {
816
816
 
817
817
  await searchFor(page, appFullName);
818
818
 
819
- // Find the Install <a> element. After search only one card is visible.
820
- // The button has class "uboxBot" per the platform HTML; its textContent
821
- // includes a Font Awesome icon character before "Install" so we match by
822
- // class or by text ending with "Install" rather than exact equality.
823
- const installPos = await page.evaluate(() => {
824
- const el = document.querySelector('a.uboxBot') ||
825
- Array.from(document.querySelectorAll('a')).find(e => {
826
- const r = e.getBoundingClientRect();
827
- return r.width > 0 && r.height > 0 && e.textContent.trim().endsWith('Install');
828
- });
829
- if (!el) return null;
830
- el.scrollIntoView({ block: 'center' });
831
- const r = el.getBoundingClientRect();
832
- return { x: Math.round(r.x + r.width / 2), y: Math.round(r.y + r.height / 2) };
833
- });
819
+ // Find the Install <a> element inside the card that exactly matches the app name.
820
+ // Search may return multiple cards (e.g. "noXpace main" when searching "Xpace main"),
821
+ // so we must scope the Install button lookup to the exact-match card.
822
+ const installPos = await page.evaluate(name => {
823
+ for (const card of document.querySelectorAll('.card')) {
824
+ const title = card.querySelector('p.card-text');
825
+ if (!title || title.textContent.trim() !== name) continue;
826
+ const el = card.querySelector('a.uboxBot') ||
827
+ Array.from(card.querySelectorAll('a')).find(e => {
828
+ const r = e.getBoundingClientRect();
829
+ return r.width > 0 && r.height > 0 && e.textContent.trim().endsWith('Install');
830
+ });
831
+ if (!el) return null;
832
+ el.scrollIntoView({ block: 'center' });
833
+ const r = el.getBoundingClientRect();
834
+ return { x: Math.round(r.x + r.width / 2), y: Math.round(r.y + r.height / 2) };
835
+ }
836
+ return null;
837
+ }, appFullName);
834
838
 
835
839
  if (!installPos) throw new Error(`Install button for "${appFullName}" not found`);
836
840
  await page.mouse.click(installPos.x, installPos.y);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ubox-tools/deploy-xperience",
3
- "version": "1.1.6",
3
+ "version": "1.1.7",
4
4
  "description": "Deploy a Ubox experience to studio.ubox.world",
5
5
  "bin": { "deploy-xperience": "./deploy.js" },
6
6
  "dependencies": { "puppeteer": "*" },