Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions test/core/workflow/workflow-acrobat/action-binder.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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', () => {
Expand Down
79 changes: 52 additions & 27 deletions unitylibs/core/widgets/prompt-upload/prompt-upload.css
Original file line number Diff line number Diff line change
Expand Up @@ -20,35 +20,43 @@
}

.pu-error-toast {
cursor: default;
background: #D31510;
max-width: 435px;
color: white;
position: absolute;
top: 90px;
top: 109px;
transform: translate(-50%, -50%);
left: 50%;
transform: translateX(-50%);
z-index: 100;
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;
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 {
Expand All @@ -57,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 {
Expand All @@ -69,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 */

Expand Down Expand Up @@ -102,7 +116,7 @@

.pu-dropdown-label {
font-size: 14px;
color: #6e6e6e;
color: #505050;
white-space: nowrap;
}

Expand Down Expand Up @@ -170,16 +184,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;
Expand Down Expand Up @@ -217,6 +235,7 @@
align-items: center;
gap: 16px;
width: 100%;
justify-content: space-between;
}

.pu-footer-left {
Expand All @@ -225,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;
Expand Down Expand Up @@ -291,6 +310,10 @@
}

@media (max-width: 700px) {

/* stylelint-disable-next-line selector-class-pattern */
.pu-error-toast .verb-errorText { min-width: 120px; }

.pu-header {
flex-direction: column;
align-items: flex-start;
Expand All @@ -301,16 +324,18 @@
flex-direction: column;
align-items: flex-start;
gap: 10px;
padding: 12px;
}

.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;
Expand Down
5 changes: 5 additions & 0 deletions unitylibs/core/widgets/prompt-upload/prompt-upload.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down Expand Up @@ -233,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;
}
}
4 changes: 3 additions & 1 deletion unitylibs/core/workflow/workflow-acrobat/action-binder.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
2 changes: 2 additions & 0 deletions unitylibs/core/workflow/workflow-acrobat/target-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"],
Expand Down
Loading
Loading