mirror of
https://github.com/docmost/docmost.git
synced 2026-05-16 14:14:06 +08:00
29388636bf
* feat: page find and replace * * Refactor search and replace directory * bugfix scroll * Fix search and replace functionality for macOS and improve UX - Fixed cmd+f shortcut to work on macOS (using 'Mod' key instead of 'Control') - Added search functionality to title editor - Fixed "Not found" message showing when search term is empty - Fixed tooltip error when clicking replace button - Changed replace button from icon to text for consistency - Reduced width of search input fields for better UI - Fixed result index after replace operation to prevent out-of-bounds error - Added missing translation strings for search and replace dialog - Updated tooltip to show platform-specific shortcuts (⌘F on Mac, Ctrl-F on others) * Hide replace functionality for users with view-only permissions - Added editable prop to SearchAndReplaceDialog component - Pass editable state from PageEditor to SearchAndReplaceDialog - Conditionally render replace button based on edit permissions - Hide replace input section for view-only users - Disable Alt+R shortcut when user lacks edit permissions * Fix search dialog not closing properly when navigating away - Clear all state (search text, replace text) when closing dialog - Reset replace button visibility state on close - Clear editor search term to remove highlights - Ensure dialog closes properly when route changes * fix: preserve text marks (comments, etc.) when replacing text in search and replace - Collect all marks that span the text being replaced using nodesBetween - Apply collected marks to the replacement text to maintain formatting - Fixes issue where comment marks were being removed during text replacement * ignore type error --------- Co-authored-by: Philipinho <16838612+Philipinho@users.noreply.github.com>
83 lines
1.9 KiB
CSS
83 lines
1.9 KiB
CSS
.ProseMirror {
|
|
[data-type="details"] {
|
|
display: flex;
|
|
padding: 0.5em;
|
|
border-radius: 4px;
|
|
border: 1px solid transparent;
|
|
transition: border 0.3s;
|
|
width: 100%;
|
|
|
|
&:hover {
|
|
border: 1px solid
|
|
light-dark(var(--mantine-color-gray-3), var(--mantine-color-gray-7));
|
|
|
|
[data-type="detailsSummary"] {}
|
|
}
|
|
|
|
[data-type="detailsButton"] {
|
|
display: flex;
|
|
cursor: pointer;
|
|
border: none;
|
|
padding: 0;
|
|
background: transparent;
|
|
|
|
.ProseMirror-icon {
|
|
width: 2em;
|
|
height: 2em;
|
|
transform: rotateZ(0deg);
|
|
transition: transform 0.3s;
|
|
}
|
|
|
|
> div {
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
border-radius: 4px;
|
|
|
|
&:hover,
|
|
&.active {
|
|
color: light-dark(
|
|
var(--mantine-color-gray-8),
|
|
var(--mantine-color-gray-0)
|
|
);
|
|
background: light-dark(
|
|
var(--mantine-color-gray-1),
|
|
var(--mantine-color-gray-8)
|
|
);
|
|
}
|
|
}
|
|
}
|
|
|
|
[data-type="detailsContainer"] {
|
|
flex: 1;
|
|
padding: 4px;
|
|
word-break: break-word;
|
|
overflow-wrap: break-word;
|
|
}
|
|
}
|
|
|
|
[data-type="details"] > [data-type="detailsContainer"] > [data-type="detailsContent"]{
|
|
display: none;
|
|
}
|
|
|
|
[data-type="details"][open] > [data-type="detailsContainer"] > [data-type="detailsContent"]{
|
|
display: block;
|
|
}
|
|
|
|
[data-type="details"][open] > [data-type="detailsButton"] {
|
|
align-items: start;
|
|
}
|
|
|
|
[data-type="details"][open] > [data-type="detailsButton"] .ProseMirror-icon{
|
|
transform: rotateZ(90deg);
|
|
}
|
|
|
|
[data-type="details"]:has(.search-result) > [data-type="detailsContainer"] > [data-type="detailsContent"]{
|
|
display: block;
|
|
}
|
|
|
|
[data-type="details"]:has(.search-result) > [data-type="detailsButton"] .ProseMirror-icon{
|
|
transform: rotateZ(90deg);
|
|
}
|
|
}
|