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
2 changes: 1 addition & 1 deletion CITATION.cff
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ cff-version: 1.2.0
message: "Si usas este software, por favor cítalo así. / If you use this software, please cite it as below."
title: "Vector editor: in-browser cloning simulator with REBASE enzymes"
type: software
version: 0.4.0
version: 0.4.1
authors:
- family-names: "Quintero López"
given-names: "Oscar Alexis"
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@oquinterol/vector-editor",
"version": "0.4.0",
"version": "0.4.1",
"description": "In-browser cloning simulator: choose commercial or custom restriction enzymes, digest and ligate, and get a live FASTA and plasmid map.",
"license": "MIT",
"author": "Oscar Alexis Quintero López (https://oquinterol.com)",
Expand Down
18 changes: 15 additions & 3 deletions src/ui/VectorEditor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,8 @@ function SequenceCard(props: {
<div
className='ve-card'
data-dragging={dragging}
// On phones an explicit edit opens as a full-screen sheet (see styles).
data-sheet={editing || undefined}
onDragOver={(event) => {
event.preventDefault()
setDragging(true)
Expand All @@ -104,6 +106,11 @@ function SequenceCard(props: {
<span className='ve-card-name' title={name}>
{length ? name : labels.empty}
</span>
{editing && (
<button type='button' className='ve-button ve-primary ve-sheet-done' onClick={() => setEditing(false)}>
{labels.done}
</button>
)}
<span className='ve-muted'>
{length.toLocaleString()} {labels.bp} · {circular ? labels.circular : labels.linear}
</span>
Expand Down Expand Up @@ -670,10 +677,15 @@ export function VectorEditor({
{labels.selection(c.range.start + 1, c.range.end || c.resultSeq.length, c.selectionLength)}
</span>
<button type='button' className='ve-link' onClick={() => copy('selection')}>
{copied === 'selection' ? labels.copied : labels.copySelection}
{copied === 'selection' ? labels.copied : compact ? labels.copy : labels.copySelection}
</button>
<button type='button' className='ve-link' onClick={() => c.select(null, 'legend')}>
{labels.clearSelection} <kbd>Esc</kbd>
<button
type='button'
className='ve-link'
aria-label={labels.clearSelection}
onClick={() => c.select(null, 'legend')}
>
{compact ? '✕' : labels.clearSelection} {!compact && <kbd>Esc</kbd>}
</button>
</>
) : (
Expand Down
78 changes: 76 additions & 2 deletions src/ui/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -948,9 +948,83 @@
.ve--embedded[data-compact] .ve-sidebar {
overflow: auto;
}
/* Status bar on phones: one swipeable row of chips, never a tiny scrolling box. */
.ve[data-compact] .ve-statusbar {
max-height: 7.5rem;
overflow: auto;
gap: 0.3rem;
padding: 0.5rem 0 0.5rem 0.75rem;
}
.ve[data-compact] .ve-legend {
flex-wrap: nowrap;
padding-right: 0.75rem;
overflow-x: auto;
overscroll-behavior-x: contain;
scroll-snap-type: x proximity;
scrollbar-width: none;
/* Fade at the edge hints that the row continues. */
mask-image: linear-gradient(to right, #000 calc(100% - 2rem), transparent);
}
.ve[data-compact] .ve-legend::-webkit-scrollbar {
display: none;
}
.ve[data-compact] .ve-legend li {
flex: none;
scroll-snap-align: start;
}
.ve[data-compact] .ve-selection {
flex-wrap: nowrap;
gap: 0 0.9rem;
padding-right: 0.75rem;
white-space: nowrap;
}
.ve[data-compact] .ve-selection > span {
overflow: hidden;
text-overflow: ellipsis;
}
.ve[data-compact] .ve-selection > .ve-muted {
display: none;
}
.ve[data-compact] .ve-selection:not(:has(button)) {
display: none;
}

/* Editing vector or insert on a phone: a full-screen sheet with a large field. */
.ve-sheet-done {
display: none;
}
.ve[data-compact] .ve-card[data-sheet] {
position: fixed;
inset: 0;
z-index: 50;
display: flex;
flex-direction: column;
gap: 0.6rem;
padding: calc(0.75rem + env(safe-area-inset-top)) calc(0.75rem + env(safe-area-inset-right))
calc(0.75rem + env(safe-area-inset-bottom)) calc(0.75rem + env(safe-area-inset-left));
border: 0;
border-radius: 0;
background: var(--ve-bg);
}
.ve[data-compact] .ve-card[data-sheet] .ve-card-head {
grid-template-columns: auto minmax(0, 1fr) auto;
align-items: center;
}
.ve[data-compact] .ve-card[data-sheet] .ve-card-head .ve-muted {
grid-column: 1 / -1;
}
.ve[data-compact] .ve-card[data-sheet] .ve-sheet-done {
display: inline-flex;
}
.ve[data-compact] .ve-card[data-sheet] textarea {
flex: 1;
min-height: 0;
resize: none;
}
.ve[data-compact] .ve-card[data-sheet] .ve-card-actions > button[aria-expanded] {
display: none;
}
/* The enzyme dropdown must fit above the on-screen keyboard. */
.ve[data-compact] .ve-listbox {
max-height: min(20rem, 40svh);
}

/* Short landscape (phone on its side): tabs become a left rail, chrome shrinks to one line. */
Expand Down
Loading