From 1fb62ab4a47bf0c22696757afac890f02a3f970f Mon Sep 17 00:00:00 2001 From: Arushi Gupta <65466846+arugupta1992@users.noreply.github.com> Date: Fri, 25 Sep 2026 10:07:33 +0530 Subject: [PATCH 1/4] Bug fixes for citation generator and quiz maker, flashmaker (#908) https://jira.corp.adobe.com/browse/MWPW-208299 https://jira.corp.adobe.com/browse/MWPW-207890 https://jira.corp.adobe.com/browse/MWPW-208300 https://jira.corp.adobe.com/browse/MWPW-208303 (Implemented only for Cite cta) **Test URLs:** - Before: https://main--da-dc--adobecom.aem.page/acrobat/online/citation-generator?unitylibs=qfbugfixes - After: https://main--da-dc--adobecom.aem.page/acrobat/online/citation-generator?unitylibs=qfbugfixes --------- Co-authored-by: Arushi Gupta Co-authored-by: Arushi Gupta --- .../widgets/prompt-upload/prompt-upload.css | 28 ++++++++-- .../widgets/prompt-upload/prompt-upload.js | 3 ++ .../workflow-prompt-upload/action-binder.js | 52 +++++++++++++------ .../workflow-prompt-upload/sprite.svg | 18 +++---- 4 files changed, 71 insertions(+), 30 deletions(-) diff --git a/unitylibs/core/widgets/prompt-upload/prompt-upload.css b/unitylibs/core/widgets/prompt-upload/prompt-upload.css index a4cc2f1f1..616081586 100644 --- a/unitylibs/core/widgets/prompt-upload/prompt-upload.css +++ b/unitylibs/core/widgets/prompt-upload/prompt-upload.css @@ -20,11 +20,11 @@ } .pu-error-toast { - position: absolute; + position: fixed; top: 90px; left: 50%; transform: translateX(-50%); - z-index: 100; + z-index: 1000; display: flex; align-items: center; gap: 12px; @@ -38,6 +38,7 @@ color: #fff; font-size: 15px; line-height: 20px; + outline: none; } .pu-error-toast.hide { display: none; } @@ -102,7 +103,7 @@ .pu-dropdown-label { font-size: 14px; - color: #6e6e6e; + color: #505050; white-space: nowrap; } @@ -170,16 +171,20 @@ .pu-input-helper { font-size: 12px; - color: #6e6e6e; + color: #505050; } .pu-search-field .inp-field { min-height: 24px; font-size: 16px; padding: 0; + color: #686868; } -.pu-search-field .inp-field::placeholder { color: #9a9a9a; } +.pu-search-field .inp-field::placeholder { + color: #686868; + opacity: 1; +} .pu-search-field.pu-pill { gap: 6px; @@ -291,6 +296,18 @@ } @media (max-width: 700px) { + .pu-error-toast { + top: 16px; + left: 16px; + right: 16px; + width: auto; + max-width: none; + transform: none; + } + + /* stylelint-disable-next-line selector-class-pattern */ + .pu-error-toast .verb-errorText { text-align: center; } + .pu-header { flex-direction: column; align-items: flex-start; @@ -301,6 +318,7 @@ flex-direction: column; align-items: flex-start; gap: 10px; + padding: 12px; } .pu-search-field.pu-pill .pu-input-wrap { width: 100%; } diff --git a/unitylibs/core/widgets/prompt-upload/prompt-upload.js b/unitylibs/core/widgets/prompt-upload/prompt-upload.js index 397f3f8ec..24a5b50c0 100644 --- a/unitylibs/core/widgets/prompt-upload/prompt-upload.js +++ b/unitylibs/core/widgets/prompt-upload/prompt-upload.js @@ -135,6 +135,9 @@ export default class PromptUploadWidget { dragText: placeholderText(this.el, 'icon-dropzone-drag-text'), showIcon: this.hasFlag('icon-upload-icon'), }); + const verb = this.workflowCfg?.enabledFeatures?.[0] || ''; + const verbLabel = verb.split('-')[0].replace(/^./, (c) => c.toUpperCase()); + refs.dropZone.setAttribute('daa-ll', verbLabel ? `add-sources--${verbLabel}` : 'add-sources'); const slot = createTag('div', { class: 'pu-upload-slot' }); slot.append(refs.wrap); const subtext = placeholderText(this.el, 'icon-dropzone-subtext'); diff --git a/unitylibs/core/workflow/workflow-prompt-upload/action-binder.js b/unitylibs/core/workflow/workflow-prompt-upload/action-binder.js index 8d9037c79..36e64553f 100644 --- a/unitylibs/core/workflow/workflow-prompt-upload/action-binder.js +++ b/unitylibs/core/workflow/workflow-prompt-upload/action-binder.js @@ -384,17 +384,30 @@ export default class ActionBinder { if (existing) return existing; const host = this.block || this.canvasArea; if (!host) return null; - const toast = createTag('div', { class: 'error verb-error pu-error-toast hide' }); + const toast = createTag('div', { class: 'error verb-error pu-error-toast hide', role: 'alert', tabindex: '-1' }); const icon = createTag('div', { class: 'verb-errorIcon' }); icon.innerHTML = ERROR_WARNING_ICON; const closeBtn = createTag('div', { class: 'verb-errorBtn', role: 'button', tabindex: '0', 'aria-label': 'Close error' }); closeBtn.innerHTML = ERROR_CLOSE_ICON; toast.append(icon, createTag('p', { class: 'verb-errorText' }), closeBtn); - if (getComputedStyle(host).position === 'static') host.style.position = 'relative'; host.append(toast); return toast; } + getStickyTopOffset() { + const selectors = ['header.global-navigation', '.feds-localnav', '.global-navigation']; + let bottom = 0; + selectors.forEach((sel) => { + const el = document.querySelector(sel); + if (!el) return; + const pos = getComputedStyle(el).position; + if (pos !== 'fixed' && pos !== 'sticky') return; + const rect = el.getBoundingClientRect(); + if (rect.top <= 1 && rect.bottom > bottom) bottom = rect.bottom; + }); + return bottom; + } + showErrorToastMessage(message) { const toast = this.findOrCreateErrorToast(); if (!toast) { @@ -402,9 +415,11 @@ export default class ActionBinder { return; } const textEl = toast.querySelector('.verb-errorText') || toast; - textEl.textContent = message; toast.classList.remove('hide'); toast.classList.add('verb-error'); + const stickyOffset = this.getStickyTopOffset(); + if (stickyOffset) toast.style.top = `${stickyOffset + 12}px`; + textEl.textContent = message; const closeBtn = toast.querySelector('.verb-errorBtn'); if (closeBtn && !closeBtn.dataset.puBound) { closeBtn.dataset.puBound = 'true'; @@ -414,6 +429,7 @@ export default class ActionBinder { if (e.key === 'Enter' || e.key === ' ') { e.preventDefault(); hide(); } }); } + toast.focus(); } isMixedFileTypes(files) { @@ -744,32 +760,33 @@ export default class ActionBinder { return searchRoot?.querySelector?.('.ex-unity-wrap') || searchRoot; } - bindWidgetDropTarget() { - const card = this.getWidgetWrap()?.querySelector('.interactive-area') || this.getWidgetWrap(); - if (!card || card.dataset.puDropBound) return; - card.dataset.puDropBound = 'true'; + bindMarqueeDropTarget() { + const dropTarget = this.block; + const highlightEl = this.getWidgetWrap()?.querySelector('.interactive-area') || this.getWidgetWrap(); + if (!dropTarget || dropTarget.dataset.puDropBound) return; + dropTarget.dataset.puDropBound = 'true'; let dragDepth = 0; const hasFilePayload = (e) => !!e?.dataTransfer?.types && [...e.dataTransfer.types].includes('Files'); - const setHighlight = (on) => card.classList.toggle('drag-over', !!on); - card.addEventListener('dragenter', (e) => { - if (!hasFilePayload(e)) return; + const setHighlight = (on) => highlightEl?.classList.toggle('drag-over', !!on); + dropTarget.addEventListener('dragenter', (e) => { e.preventDefault(); + if (!hasFilePayload(e)) return; dragDepth += 1; setHighlight(true); }); - card.addEventListener('dragover', (e) => { - if (!hasFilePayload(e)) return; + dropTarget.addEventListener('dragover', (e) => { e.preventDefault(); + if (!hasFilePayload(e)) return; if (e.dataTransfer) e.dataTransfer.dropEffect = 'copy'; setHighlight(true); }); - card.addEventListener('dragleave', (e) => { + dropTarget.addEventListener('dragleave', (e) => { if (!hasFilePayload(e)) return; e.preventDefault(); dragDepth = Math.max(0, dragDepth - 1); if (dragDepth === 0) setHighlight(false); }); - card.addEventListener('drop', async (e) => { + dropTarget.addEventListener('drop', async (e) => { if (!hasFilePayload(e)) return; e.preventDefault(); dragDepth = 0; @@ -924,6 +941,11 @@ export default class ActionBinder { el.addEventListener('click', async (e) => { if (value === 'interrupt') { e.preventDefault(); await this.cancelOperation(); } else if (value === 'generate') { e.preventDefault(); await this.handleGenerate(); } }); + if (el.nodeName === 'A') { + el.addEventListener('keydown', (e) => { + if (e.key === ' ' || e.key === 'Spacebar') { e.preventDefault(); el.click(); } + }); + } break; case 'DIV': el.addEventListener('dragover', (e) => { e.preventDefault(); el.classList.add('drag-over'); }); @@ -993,7 +1015,7 @@ export default class ActionBinder { searchRoot.addEventListener('pu:style-open', () => this.dispatchAnalyticsEvent('style-open')); } if (b === this.block) { - this.bindWidgetDropTarget(); + this.bindMarqueeDropTarget(); const preloadTransitionScreen = () => this.loadTransitionScreen(); if ('requestIdleCallback' in window) requestIdleCallback(preloadTransitionScreen, { timeout: 3000 }); else setTimeout(preloadTransitionScreen, 2000); diff --git a/unitylibs/core/workflow/workflow-prompt-upload/sprite.svg b/unitylibs/core/workflow/workflow-prompt-upload/sprite.svg index 766ddc1fc..cdf2e5310 100644 --- a/unitylibs/core/workflow/workflow-prompt-upload/sprite.svg +++ b/unitylibs/core/workflow/workflow-prompt-upload/sprite.svg @@ -30,16 +30,14 @@ - - - - - - - - - - + + + + + + + + From f4c117ac593125155b6b9e16d7cb46f50a40c090 Mon Sep 17 00:00:00 2001 From: Arushi Gupta <65466846+arugupta1992@users.noreply.github.com> Date: Mon, 28 Sep 2026 23:35:34 +0530 Subject: [PATCH 2/4] Bug fixes for quiz mker and flashcard maker (#915) https://jira.corp.adobe.com/browse/MWPW-208998 https://jira.corp.adobe.com/browse/MWPW-208997 **Test URLs:** - Before: https://stage--da-dc--adobecom.aem.page/acrobat/online/flashcard-maker?unitylibs=stage - After: https://stage--da-dc--adobecom.aem.page/acrobat/online/flashcard-maker?unitylibs=stufixes --------- Co-authored-by: Arushi Gupta --- .../widgets/prompt-upload/prompt-upload.css | 67 ++++++++++++------- .../workflow-prompt-upload/action-binder.js | 2 +- .../workflow-prompt-upload/target-config.json | 4 +- 3 files changed, 44 insertions(+), 29 deletions(-) diff --git a/unitylibs/core/widgets/prompt-upload/prompt-upload.css b/unitylibs/core/widgets/prompt-upload/prompt-upload.css index 616081586..ff6b1c64d 100644 --- a/unitylibs/core/widgets/prompt-upload/prompt-upload.css +++ b/unitylibs/core/widgets/prompt-upload/prompt-upload.css @@ -20,36 +20,43 @@ } .pu-error-toast { - position: fixed; - top: 90px; + cursor: default; + background: #D31510; + max-width: 435px; + color: white; + position: absolute; + top: 109px; + transform: translate(-50%, -50%); left: 50%; - transform: translateX(-50%); - z-index: 1000; + font-size: 14px; + font-weight: 400; display: flex; + justify-content: center; align-items: center; - gap: 12px; - width: max-content; - max-width: min(560px, 92%); - box-sizing: border-box; - padding: 14px 16px; - border-radius: 8px; - background: #d31510; - box-shadow: 0 3px 12px rgb(0 0 0 / 15%); - color: #fff; - font-size: 15px; - line-height: 20px; - outline: none; + padding: 8px; } .pu-error-toast.hide { display: none; } /* stylelint-disable selector-class-pattern -- verb-error* mirrors the acrobat error-toast markup */ -.pu-error-toast .verb-errorIcon, +.pu-error-toast .verb-errorIcon { + align-self: self-start; + width: 18px; + height: 18px; + margin-left: 8px; + margin-right: 4px; + margin-top: 7px; + +} .pu-error-toast .verb-errorBtn { display: inline-flex; - align-items: center; - flex-shrink: 0; - color: #fff; + align-self: self-start; + width: 32px; + height: 32px; + cursor: pointer; + background: none; + border: none; + outline: none; } .pu-error-toast .verb-errorIcon svg { @@ -58,8 +65,14 @@ } .pu-error-toast .verb-errorText { - flex: 1; + border-right: 1px solid rgb(255 255 255 / 20%); + padding: 0; margin: 0; + margin-right: 8px; + padding-right: 16px; + max-width: 324px; + margin-left: 8px; + min-width: 100px; } .pu-error-toast .verb-errorBtn { @@ -70,8 +83,8 @@ .pu-error-toast .verb-errorBtn:hover { opacity: 1; } .pu-error-toast .verb-errorBtn svg { - width: 18px; - height: 18px; + width: 32px; + height: 32px; } /* stylelint-enable selector-class-pattern */ @@ -222,6 +235,7 @@ align-items: center; gap: 16px; width: 100%; + justify-content: space-between; } .pu-footer-left { @@ -230,7 +244,7 @@ gap: 20px; } -.pu-footer-container .act-wrap { margin-inline-start: auto; } +/* .pu-footer-container .act-wrap { margin-inline-start: auto; } */ .pu-secondary-link { align-self: flex-start; @@ -324,11 +338,12 @@ .pu-search-field.pu-pill .pu-input-wrap { width: 100%; } .pu-footer-container { - flex-direction: column; align-items: flex-start; + justify-content: space-between; + flex-direction: column; } - .pu-footer-container .act-wrap, + .pu-secondary-link { margin-inline-start: 0; align-self: flex-start; diff --git a/unitylibs/core/workflow/workflow-prompt-upload/action-binder.js b/unitylibs/core/workflow/workflow-prompt-upload/action-binder.js index 36e64553f..a9c69925a 100644 --- a/unitylibs/core/workflow/workflow-prompt-upload/action-binder.js +++ b/unitylibs/core/workflow/workflow-prompt-upload/action-binder.js @@ -28,7 +28,7 @@ const ENDING_SPACE_PERIOD_REGEX = /[ .]+$/; const STARTING_SPACE_PERIOD_REGEX = /^[ .]+/; const ERROR_WARNING_ICON = ''; -const ERROR_CLOSE_ICON = ''; +const ERROR_CLOSE_ICON = ''; export default class ActionBinder { static SINGLE_FILE_ERROR_MESSAGES = { diff --git a/unitylibs/core/workflow/workflow-prompt-upload/target-config.json b/unitylibs/core/workflow/workflow-prompt-upload/target-config.json index 50c85bf30..a6ebd486b 100644 --- a/unitylibs/core/workflow/workflow-prompt-upload/target-config.json +++ b/unitylibs/core/workflow/workflow-prompt-upload/target-config.json @@ -18,8 +18,8 @@ "verbsWithoutMfuToSfuFallback": [], "awaitFinalizeVerbs": [], "nonpdfMfuFeedbackScreenTypeNonpdf": [], - "nonpdfSfuProductScreen": ["citation-generator"], - "mfuUploadAllowed": ["citation-generator"], + "nonpdfSfuProductScreen": ["citation-generator", "flashcard-maker", "quiz-maker"], + "mfuUploadAllowed": ["citation-generator", "flashcard-maker", "quiz-maker"], "mfuUploadOnlyPdfAllowed": [], "experimentationOn": [], "limits": { From 562414f9a904249933c2a5f61d2fc5e7251179e8 Mon Sep 17 00:00:00 2001 From: Arushi Gupta <65466846+arugupta1992@users.noreply.github.com> Date: Tue, 29 Sep 2026 20:36:55 +0530 Subject: [PATCH 3/4] [MWPW-209103] Logic to add prefix 'Create flashcards/quiz about' in the user query (#918) Resolves: [MWPW-209103](https://jira.corp.adobe.com/browse/MWPW-209103) [ADCS-83480](https://jira.corp.adobe.com/browse/ADCS-83480) **Test URLs:** - Before: https://main--da-dc--adobecom.aem.page/drafts/arugupta/flashmaker?unitylibs=stage - After: https://main--da-dc--adobecom.aem.page/drafts/arugupta/flashmaker?unitylibs=addprefix --------- Co-authored-by: Arushi Gupta --- .../widgets/prompt-upload/prompt-upload.css | 10 +--- .../widgets/prompt-upload/prompt-upload.js | 2 + .../workflow-prompt-upload/action-binder.js | 54 +++++++++++++++---- 3 files changed, 46 insertions(+), 20 deletions(-) diff --git a/unitylibs/core/widgets/prompt-upload/prompt-upload.css b/unitylibs/core/widgets/prompt-upload/prompt-upload.css index ff6b1c64d..fa7d4660c 100644 --- a/unitylibs/core/widgets/prompt-upload/prompt-upload.css +++ b/unitylibs/core/widgets/prompt-upload/prompt-upload.css @@ -310,17 +310,9 @@ } @media (max-width: 700px) { - .pu-error-toast { - top: 16px; - left: 16px; - right: 16px; - width: auto; - max-width: none; - transform: none; - } /* stylelint-disable-next-line selector-class-pattern */ - .pu-error-toast .verb-errorText { text-align: center; } + .pu-error-toast .verb-errorText { min-width: 120px; } .pu-header { flex-direction: column; diff --git a/unitylibs/core/widgets/prompt-upload/prompt-upload.js b/unitylibs/core/widgets/prompt-upload/prompt-upload.js index 24a5b50c0..412e3665a 100644 --- a/unitylibs/core/widgets/prompt-upload/prompt-upload.js +++ b/unitylibs/core/widgets/prompt-upload/prompt-upload.js @@ -236,6 +236,8 @@ export default class PromptUploadWidget { if (this.selectedOption) this.setSelectedOption(this.selectedOption); if (this.optionPayloadKey) this.widgetWrap?.setAttribute('data-selected-option-key', this.optionPayloadKey); if (this.ctaStaticLink) this.widgetWrap?.setAttribute('data-cta-static-link', this.ctaStaticLink); + const promptPrefix = placeholderText(this.el, 'icon-prompt-prefix') + if (promptPrefix) this.widgetWrap?.setAttribute('data-prompt-prefix', promptPrefix); return this.cfg.actionMap; } } diff --git a/unitylibs/core/workflow/workflow-prompt-upload/action-binder.js b/unitylibs/core/workflow/workflow-prompt-upload/action-binder.js index a9c69925a..55bfeec2f 100644 --- a/unitylibs/core/workflow/workflow-prompt-upload/action-binder.js +++ b/unitylibs/core/workflow/workflow-prompt-upload/action-binder.js @@ -149,6 +149,7 @@ export default class ActionBinder { this.pendingFiles = []; this.query = ''; this.optionValue = ''; + this.promptPrefix = ''; this.optionKey = ''; this.selectedStyleName = ''; this.analyticsModule = null; @@ -477,35 +478,61 @@ export default class ActionBinder { const errorMessages = files.length === 1 ? ActionBinder.SINGLE_FILE_ERROR_MESSAGES : ActionBinder.MULTI_FILE_ERROR_MESSAGES; + const validFiles = []; + const errorTypes = new Set(); let allFilesFailed = true; - + if (this.limits.maxNumFiles && files.length > this.limits.maxNumFiles) { - await this.dispatchErrorToast('validation_error_max_num_files', null, `Maximum ${this.limits.maxNumFiles} files allowed`, false, true, { - code: 'validation_error_validate_files', - subCode: 'validation_error_max_num_files', - }); + await this.dispatchErrorToast( + 'validation_error_max_num_files', + null, + `Maximum ${this.limits.maxNumFiles} files allowed`, + false, + true, + { + code: 'validation_error_validate_files', + subCode: 'validation_error_max_num_files', + }, + ); return { isValid: false, validFiles }; } - + for (const file of files) { let fail = false; + if (this.limits.allowedFileTypes && !this.limits.allowedFileTypes.includes(file.type)) { - await this.dispatchErrorToast(errorMessages.UNSUPPORTED_TYPE, null, `File type: ${file.type}`, false, true, { code: 'validation_error_validate_files', subCode: errorMessages.UNSUPPORTED_TYPE }); fail = true; + errorTypes.add(errorMessages.UNSUPPORTED_TYPE); } else if (!file.size) { - await this.dispatchErrorToast(errorMessages.EMPTY_FILE, null, null, false, true, { code: 'validation_error_validate_files', subCode: errorMessages.EMPTY_FILE }); fail = true; + errorTypes.add(errorMessages.EMPTY_FILE); } else if (this.limits.maxFileSize && file.size > this.limits.maxFileSize) { - await this.dispatchErrorToast(errorMessages.FILE_TOO_LARGE, null, `File too large: ${file.size}`, false, true, { code: 'validation_error_validate_files', subCode: errorMessages.FILE_TOO_LARGE }); fail = true; + errorTypes.add(errorMessages.FILE_TOO_LARGE); } + if (!fail) { allFilesFailed = false; validFiles.push(file); } } - return { isValid: !allFilesFailed, validFiles }; + if (allFilesFailed) { + const firstErrorType = Array.from(errorTypes)[0]; + await this.dispatchErrorToast( + firstErrorType, + null, + null, + false, + true, + { + code: 'validation_error_validate_files', + subCode: firstErrorType, + }, + ); + return { isValid: false, validFiles }; + } + return { isValid: true, validFiles }; } getComputedRedirectParams(queryString) { @@ -562,7 +589,11 @@ export default class ActionBinder { } async handleRedirect(cOpts, filesData) { - if (this.query) cOpts.query = this.query; + if (this.query) { + cOpts.query = this.promptPrefix + ? `${this.promptPrefix} ${this.query}` + : this.query; + } if (this.optionValue && this.optionKey) cOpts.payload[this.optionKey] = this.optionValue; [cOpts.payload.referrer] = this.workflowCfg.enabledFeatures; try { @@ -812,6 +843,7 @@ export default class ActionBinder { const input = searchRoot?.querySelector?.('#pbuPromptInput') || searchRoot?.querySelector?.('.inp-field'); this.query = input?.value?.trim() || ''; this.optionValue = wrap?.getAttribute('data-selected-option-value') || ''; + this.promptPrefix = wrap?.getAttribute('data-prompt-prefix') || ''; this.optionKey = wrap?.getAttribute('data-selected-option-key') || ''; this.selectedStyleName = wrap?.querySelector('.selected-model .model-name')?.textContent?.trim() || ''; this.ctaStaticLink = wrap?.getAttribute('data-cta-static-link') || ''; From 8b6264d3903c56182f225eb65a489a7d831a056a Mon Sep 17 00:00:00 2001 From: Ruchika Sinha <69535463+Ruchika4@users.noreply.github.com> Date: Tue, 29 Sep 2026 23:08:39 -0700 Subject: [PATCH 4/4] [MWPW-208397]Increase file size for batch 0 small file optimization (#905) * Increase small file size to 3MB for following verbs for small file optimization: "word-to-pdf", "ppt-to-pdf", "excel-to-pdf", "jpg-to-pdf", "png-to-pdf", "heic-to-pdf" Resolves: [MWPW-208397](https://jira.corp.adobe.com/browse/MWPW-208397) **Test URLs:** - Before: https://main--da-dc--adobecom.aem.live/acrobat/online/word-to-pdf?martech=off&unitylibs=stage - After: https://main--da-dc--adobecom.aem.live/acrobat/online/word-to-pdf?martech=off&unitylibs=smallfile-size Co-authored-by: Ruchika Sinha --- .../workflow-acrobat/action-binder.test.js | 17 +++++++++++++++++ .../workflow/workflow-acrobat/action-binder.js | 4 +++- .../workflow-acrobat/target-config.json | 2 ++ 3 files changed, 22 insertions(+), 1 deletion(-) diff --git a/test/core/workflow/workflow-acrobat/action-binder.test.js b/test/core/workflow/workflow-acrobat/action-binder.test.js index 534ca68f9..20b68ab56 100644 --- a/test/core/workflow/workflow-acrobat/action-binder.test.js +++ b/test/core/workflow/workflow-acrobat/action-binder.test.js @@ -1537,6 +1537,23 @@ describe('ActionBinder', () => { it('should return false for direct upload verbs without file size', () => { expect(actionBinder.isDirectUploadVerb()).to.be.false; }); + + it('should use the extended max size for verbs in the extended list', () => { + actionBinder.workflowCfg.enabledFeatures = ['word-to-pdf']; + actionBinder.workflowCfg.targetCfg.directUploadMaxSizeExtended = 3145728; + actionBinder.workflowCfg.targetCfg.directUploadMaxSizeExtendedVerbs = ['word-to-pdf']; + expect(actionBinder.isDirectUploadVerb(3145728)).to.be.true; + expect(actionBinder.isDirectUploadVerb(1048577)).to.be.true; + expect(actionBinder.isDirectUploadVerb(3145729)).to.be.false; + }); + + it('should fall back to the global max size for verbs not in the extended list', () => { + actionBinder.workflowCfg.enabledFeatures = ['compress-pdf']; + actionBinder.workflowCfg.targetCfg.directUploadMaxSizeExtended = 3145728; + actionBinder.workflowCfg.targetCfg.directUploadMaxSizeExtendedVerbs = ['word-to-pdf']; + expect(actionBinder.isDirectUploadVerb(1048576)).to.be.true; + expect(actionBinder.isDirectUploadVerb(1048577)).to.be.false; + }); }); describe('continueInApp', () => { diff --git a/unitylibs/core/workflow/workflow-acrobat/action-binder.js b/unitylibs/core/workflow/workflow-acrobat/action-binder.js index 71b4d9e57..e1375c2fb 100644 --- a/unitylibs/core/workflow/workflow-acrobat/action-binder.js +++ b/unitylibs/core/workflow/workflow-acrobat/action-binder.js @@ -777,7 +777,9 @@ export default class ActionBinder { } isDirectUploadVerb(fileSize) { - const directUploadMaxSize = this.workflowCfg.targetCfg.directUploadMaxSize || 0; + const { targetCfg, enabledFeatures } = this.workflowCfg; + const directUploadMaxSize = (targetCfg.directUploadMaxSizeExtendedVerbs?.includes(enabledFeatures?.[0]) + ? targetCfg.directUploadMaxSizeExtended : targetCfg.directUploadMaxSize) || 0; return fileSize != null && fileSize <= directUploadMaxSize; } diff --git a/unitylibs/core/workflow/workflow-acrobat/target-config.json b/unitylibs/core/workflow/workflow-acrobat/target-config.json index 795acec1e..53c49d6b4 100644 --- a/unitylibs/core/workflow/workflow-acrobat/target-config.json +++ b/unitylibs/core/workflow/workflow-acrobat/target-config.json @@ -16,6 +16,8 @@ "verbsWithoutMfuToSfuFallback": ["compress-pdf"], "awaitFinalizeVerbs": ["word-to-pdf", "ppt-to-pdf", "excel-to-pdf"], "directUploadMaxSize": 1048576, + "directUploadMaxSizeExtended": 3145728, + "directUploadMaxSizeExtendedVerbs": ["word-to-pdf", "ppt-to-pdf", "excel-to-pdf", "jpg-to-pdf", "png-to-pdf", "heic-to-pdf"], "nonpdfMfuFeedbackScreenTypeNonpdf": ["combine-pdf"], "nonpdfSfuProductScreen": ["word-to-pdf", "jpg-to-pdf", "ppt-to-pdf", "excel-to-pdf", "png-to-pdf", "createpdf", "chat-pdf", "chat-pdf-student", "summarize-pdf", "pdf-ai", "heic-to-pdf", "image-to-pdf", "bmp-to-pdf", "gif-to-pdf", "tiff-to-pdf", "indd-to-pdf", "psd-to-pdf", "ai-to-pdf", "quiz-maker", "flashcard-maker", "mindmap-maker", "resume-builder"], "mfuUploadAllowed": ["combine-pdf", "rotate-pages", "chat-pdf", "chat-pdf-student", "summarize-pdf", "pdf-ai", "quiz-maker", "flashcard-maker", "mindmap-maker", "heic-to-pdf"],