diff --git a/.github/workflows/eslint.yml b/.github/workflows/eslint.yml index 847176891..54839a8a1 100644 --- a/.github/workflows/eslint.yml +++ b/.github/workflows/eslint.yml @@ -32,8 +32,11 @@ jobs: ${{ runner.os }}-bun- # ESLint and Prettier must be in `package.json` + - name: Remove npm lockfile to prevent bun git-clone issues + run: rm -f package-lock.json + - name: Install dependencies - run: bun install --frozen-lockfile + run: bun install env: BUN_AUTH_TOKEN: ${{ secrets.GH_BOT_TOKEN }} @@ -42,7 +45,7 @@ jobs: for pkg in helpers icons components; do dir="node_modules/@kadence/${pkg}" if [ -f "$dir/package.json" ]; then - (cd "$dir" && npm install && npm run build) + (cd "$dir" && npm install --omit=prod && npm run build) fi done diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 0b9f47921..9cbad15e0 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -49,11 +49,23 @@ jobs: with: bun-version: latest - - run: bun install --frozen-lockfile + - name: Remove npm lockfile to prevent bun git-clone issues + run: rm -f package-lock.json + + - run: bun install env: BUN_AUTH_TOKEN: ${{ secrets.GH_BOT_TOKEN }} PUPPETEER_SKIP_DOWNLOAD: true + - name: Build Kadence workspace packages + run: | + for pkg in helpers icons components; do + dir="node_modules/@kadence/${pkg}" + if [ -f "$dir/package.json" ]; then + (cd "$dir" && npm install --omit=prod && npm run build) + fi + done + - name: Build packages run: bun run build diff --git a/includes/assets/js/kb-advanced-form-block.min.js b/includes/assets/js/kb-advanced-form-block.min.js index aa335eb19..dc6527d4d 100644 --- a/includes/assets/js/kb-advanced-form-block.min.js +++ b/includes/assets/js/kb-advanced-form-block.min.js @@ -1 +1 @@ -(function(){"use strict";window.kadenceAdvancedForm={error_item:1,clearForm(a){a.reset()},ensureLiveRegion(a){let b=a.querySelector(".kb-form-live-region");return b||(b=document.createElement("div"),b.className="kb-form-live-region",b.setAttribute("aria-live","polite"),b.setAttribute("aria-atomic","true"),b.setAttribute("role","status"),b.style.position="absolute",b.style.left="-10000px",b.style.width="1px",b.style.height="1px",b.style.overflow="hidden",a.appendChild(b)),b},announceMessage(a,b,c="polite"){const d=window.kadenceAdvancedForm.ensureLiveRegion(a);d.textContent="",d.setAttribute("aria-live",c),setTimeout(()=>{d.textContent=b},100)},insertAfter(a,b){b.parentNode.insertBefore(a,b.nextSibling)},markError(a,b,c,d=null,e=null){let f="";if(c.classList.contains("kb-adv-form-has-error")||c.classList.add("kb-adv-form-has-error"),a.classList.add("has-error"),b){switch(b){case"required":const c=a.getAttribute("data-kb-required-message");if(c&&""!==c){f=c;break}f=a.getAttribute("data-required-message"),f&&""!==f&&void 0!==f||(f=a.getAttribute("data-label"),(!f||""===f||void 0===f)&&(f=kb_adv_form_params.item),f=f+" "+kb_adv_form_params[b]);break;case"mismatch":f=a.getAttribute("data-mismatch-message"),f&&""!==f&&void 0!==f||(f=a.getAttribute("data-label"),(!f||""===f||void 0===f)&&(f=kb_adv_form_params.item),f=f+" "+kb_adv_form_params[b]);break;case"validation":f=a.getAttribute("data-validation-message"),f&&""!==f&&void 0!==f||(f=a.getAttribute("data-label"),(!f||""===f||void 0===f)&&(f=kb_adv_form_params.item),f=f+" "+kb_adv_form_params[b]);break;case"custom":const d=e?.message;f=d?d:a.getAttribute("data-label")+" has an issue"}const c=a.parentNode.querySelector(".kb-adv-form-error-msg");c&&c.remove();const g=a.getAttribute("name")+"-error";a.setAttribute("aria-describedby",g),a.setAttribute("aria-invalid","true");const h=document.createElement("div");h.id=g,h.classList.add("kb-adv-form-error-msg"),h.classList.add("kb-adv-form-message"),h.classList.add("kb-adv-form-warning"),h.innerHTML=window.kadenceAdvancedForm.strip_tags(f,"