Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/JS-3019: Search #713

Merged
merged 52 commits into from
May 24, 2024
Merged
Show file tree
Hide file tree
Changes from 16 commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
1e8fbcb
stash
mhlv Apr 30, 2024
d26eb8e
Merge branch 'main' of github.com:anyproto/anytype-ts into feature/se…
mhlv May 6, 2024
d0c7166
JS-3019: markup update and backlinks logic
mhlv May 6, 2024
72c2c84
JS-3019: search with meta command
mhlv May 7, 2024
e3e8dfa
JS-3019: cleanup
mhlv May 7, 2024
bc8cdcf
JS-3019: search command
mhlv May 7, 2024
55a2738
JS-3019: icon background
mhlv May 7, 2024
083f5a6
JS-3019: mapper
mhlv May 7, 2024
ae6b541
JS-3019: highlight
mhlv May 7, 2024
e51f4be
JS-3019: styles wip
mhlv May 7, 2024
8656235
JS-3019: styles
mhlv May 8, 2024
a29daac
JS-3019: scroll to block
mhlv May 8, 2024
a8beaec
JS-3019: relation details, styles
mhlv May 14, 2024
055edbb
JS-3019: context
mhlv May 16, 2024
1755c72
JS-3019: backlinks arrow navigation
mhlv May 16, 2024
3a105b4
JS-3019: backlinks arrow navigation
mhlv May 16, 2024
07e3f2b
code review
ra3orblade May 16, 2024
9fb8226
JS-3019: section name style
mhlv May 16, 2024
380c833
Merge branch 'feature/search' of github.com:anyproto/anytype-ts into …
mhlv May 16, 2024
0f61ec7
update search size
ra3orblade May 16, 2024
42a804d
Merge branch 'feature/search' of github.com:anyproto/anytype-ts into …
ra3orblade May 16, 2024
1aeae63
fix resize
ra3orblade May 16, 2024
64f1a5b
JS-3019: context
mhlv May 16, 2024
70fc774
fix resize
ra3orblade May 16, 2024
3200508
JS-3019: relation keys
mhlv May 17, 2024
843b8e9
Merge branch 'feature/search' of github.com:anyproto/anytype-ts into …
mhlv May 17, 2024
a246530
JS-3019: context
mhlv May 17, 2024
c0dc705
merge
ra3orblade May 21, 2024
e43b97e
JS-4604: code review
ra3orblade May 21, 2024
9fbbf0b
JS-4618, JS-4616: fix
ra3orblade May 21, 2024
1152b1d
JS-4612: change hightlight to markup
ra3orblade May 21, 2024
97c019f
Merge branch 'main' of github.com:anyproto/anytype-ts into feature/se…
ra3orblade May 21, 2024
a2d9da6
Merge branch 'main' of github.com:anyproto/anytype-ts into feature/se…
ra3orblade May 21, 2024
4ec1d21
fix links and backlinks
ra3orblade May 21, 2024
fe83eab
fix links and backlinks
ra3orblade May 21, 2024
3d03172
fix links and backlinks
ra3orblade May 21, 2024
dc674c6
fix links and backlinks
ra3orblade May 21, 2024
6072608
fix tooltip caption
ra3orblade May 21, 2024
7ebf034
refactoring
ra3orblade May 21, 2024
0de8c97
refactoring
ra3orblade May 21, 2024
0003ae0
add lastModifiedDate to sorts
ra3orblade May 22, 2024
d96f523
fix icons font size
ra3orblade May 22, 2024
80d931e
Merge branch 'main' of github.com:anyproto/anytype-ts into feature/se…
ra3orblade May 22, 2024
1c93e74
Merge branch 'main' of github.com:anyproto/anytype-ts into feature/se…
ra3orblade May 22, 2024
eef6f63
JS-4624: add analytics event
ra3orblade May 22, 2024
f45dd54
rework input logic
ra3orblade May 22, 2024
e482a8e
small fix
ra3orblade May 22, 2024
c3873b6
Merge branch 'main' of github.com:anyproto/anytype-ts into feature/se…
ra3orblade May 22, 2024
a68e45b
search shortcuts fixes
ra3orblade May 22, 2024
2758e92
Update popup preventClose logic
ra3orblade May 23, 2024
1dd1e09
merge
ra3orblade May 23, 2024
283f8d8
fix recursion
ra3orblade May 23, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/img/arrow/forward.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 2 additions & 1 deletion src/json/constant.json
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,8 @@
"restrictions",
"defaultTemplateId",
"identityProfileLink",
"createdDate"
"createdDate",
"backlinks"
],

"sidebarRelationKeys": [
Expand Down
5 changes: 3 additions & 2 deletions src/json/text.json
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@
"commonUpdate": "Update",
"commonOwner": "Owner",
"commonUpdateProgress": "Downloading update... %s/%s",
"commonActions": "Actions",

"commonLCCollection": "Collection",
"commonLCSet": "Set",
Expand Down Expand Up @@ -1036,6 +1037,8 @@
"popupSearchRecentObjects": "Recent Objects",
"popupSearchCreateObject": "Create Object",
"popupSearchAddRelation": "Add Relation",
"popupSearchTooltipSearchByBacklinks": "Search by backlinks ->",
mhlv marked this conversation as resolved.
Show resolved Hide resolved
"popupSearchBacklinksFrom": "Backlinks from: %s",

"popupAboutTitle": "Anytype",
"popupAboutDescription": "Next generation software that breaks down barriers between applications, gives back privacy and data ownership to users.",
Expand Down Expand Up @@ -1095,7 +1098,6 @@
"popupShortcutMainSelection4": "Expand your selection up or down",
"popupShortcutMainSelection5": "On block will select or de-select an entire block",
"popupShortcutMainSelection6": "Select block and all blocks in between",
"popupShortcutMainActions": "Actions",
"popupShortcutMainActions1": "Activate command menu",
"popupShortcutMainActions2": "Open action menu",
"popupShortcutMainActions3": "Deletes the words left to the cursor",
Expand Down Expand Up @@ -1245,7 +1247,6 @@
"menuBlockActionsSectionsListStyle": "List style",
"menuBlockActionsSectionsDividerStyle": "Divider style",
"menuBlockActionsSectionsFileStyle": "File style",
"menuBlockActionsSectionsActions": "Actions",
"menuBlockActionsSectionsBackground": "Background",
"menuBlockActionsSectionsColor": "Color",
"menuBlockActionsSectionsDataview": "Dataview",
Expand Down
57 changes: 40 additions & 17 deletions src/scss/popup/search.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

.popups {
.popup.popupSearch {
.ReactVirtualized__List { padding: 8px 0px; }
.ReactVirtualized__List { padding: 8px 0px 4px; }

.content { height: 432px; overflow: visible; transition: none; transform: translate3d(0px,0px,0px); }
.wrap { height: 100%; display: flex; flex-direction: column; }
Expand All @@ -23,7 +23,7 @@
.filter {
.inner { height: auto; }
.input {
padding: 0px; height: 54px; vertical-align: middle; width: calc(100% - 32px); vertical-align: top; @include text-paragraph; font-weight: 500;
padding: 0px; height: 54px; width: calc(100% - 32px); vertical-align: top; @include text-paragraph; font-weight: 500;
}
.placeholder { @include text-paragraph; font-weight: 500; }
.line { display: none; }
Expand All @@ -33,36 +33,59 @@
.items { height: 100%; flex-grow: 1; }
.items {
.pad { height: 12px; }
.row { padding: 0 4px; }

.sectionName { @include text-small; height: 26px; line-height: 18px; padding: 5px 20px; font-weight: 500; color: var(--color-text-secondary); }
.sectionName { @include text-small; display: flex; justify-content: space-between; height: 26px; line-height: 18px; padding: 5px 20px; font-weight: 500; color: var(--color-text-secondary); }

.item {
position: relative; height: 48px; line-height: 22px; padding: 13px 20px; white-space: nowrap; display: flex; gap: 0px 10px;
align-items: center;
.item { position: relative; line-height: 22px; padding: 8px 8px 8px 12px; white-space: nowrap; display: flex; gap: 0px 12px; border-radius: 8px; }
.item#item-add,
.item#item-relation { height: 48px; align-items: center; }
.item#item-add,
.item#item-relation {
.sides { align-items: center; }
}

.item {
.icon { width: 20px; height: 20px; flex-shrink: 0; }
.icon.plus { background-image: url('~img/icon/popup/search/plus.svg'); }
.icon.relation { background-image: url('~img/icon/menu/action/relation0.svg'); }
.icon.graph { background-image: url('~img/icon/menu/action/graph0.svg'); }
.icon.navigation { background-image: url('~img/icon/menu/action/navigation0.svg'); }
.icon.advanced { width: 28px; height: 28px; background: url('~img/arrow/forward.svg'); opacity: 0; }

.iconObject { transition: $transitionAllCommon; vertical-align: top; flex-shrink: 0; flex-grow: 0; }
.name {
@include text-overflow-nw; font-weight: 500; line-height: 18px; display: inline-block; vertical-align: top; flex-shrink: 0; flex-grow: 1;
width: calc(66% - 30px);
}
.caption { @include text-small; @include text-overflow-nw; color: var(--color-text-secondary); flex-shrink: 0; width: 33%; flex-grow: 0; text-align: right; }
.caption {
.label {
padding: 0px 2px; border-radius: 4px; background: var(--color-shape-highlight-medium); display: inline-block; vertical-align: middle; min-width: 18px;
text-align: center; margin-right: 4px;
.iconObject:not(.isHuman),
.iconObject:not(.isParticipant) { background: var(--color-shape-tertiary); border-radius: 8px; }
.iconObject.isTask { background: none; }

.sides { width: 100%; display: flex; justify-content: space-between; gap: 0px 12px; }
.sides {
.side.left { width: calc(100% - 40px); overflow: hidden; }
.side.right { min-width: 40px; flex-shrink: 0; display: flex; justify-content: right; }
.side.right {
.label {
padding: 0px 2px; border-radius: 4px; background: var(--color-shape-highlight-medium); display: inline-block; vertical-align: middle; min-width: 18px;
text-align: center; margin-right: 4px;
}
.label:last-child { margin: 0px; }
}
.label:last-child { margin: 0px; }
}
.name { @include text-overflow-nw; }
.context { @include text-small; padding: 2px 0px; white-space: normal; display: flex; gap: 0 4px; }

.context {
.key { text-transform: capitalize; }
.value { border-radius: 2px; }
.key + .value { padding: 0 3px; }
}

.caption { @include text-small; @include text-overflow-nw; color: var(--color-text-secondary); }
}

.item.active { background-color: var(--color-shape-highlight-medium); }
.item.active {
.icon.advanced { opacity: 1; }
}
}
}
}
}
2 changes: 1 addition & 1 deletion src/ts/component/menu/block/action.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ class MenuBlockAction extends React.Component<I.Menu, State> {
const turnPage = { id: 'turnPage', icon: '', name: translate('commonTurnIntoObject'), children: UtilMenu.getTurnPage() };
const turnDiv = { id: 'turnDiv', icon: '', name: translate('menuBlockActionsSectionsDividerStyle'), children: UtilMenu.getTurnDiv() };
const turnFile = { id: 'turnFile', icon: '', name: translate('menuBlockActionsSectionsFileStyle'), children: UtilMenu.getTurnFile() };
const action = { id: 'action', icon: '', name: translate('menuBlockActionsSectionsActions'), children: UtilMenu.getActions(actionParam) };
const action = { id: 'action', icon: '', name: translate('commonActions'), children: UtilMenu.getActions(actionParam) };
const align = { id: 'align', icon: '', name: translate('commonAlign'), children: UtilMenu.getHAlign(restrictedAlign) };
const bgColor = { id: 'bgColor', icon: '', name: translate('commonBackground'), children: UtilMenu.getBgColors() };
const color = { id: 'color', icon: 'color', name: translate('commonColor'), arrow: true, children: UtilMenu.getTextColors() };
Expand Down
2 changes: 1 addition & 1 deletion src/ts/component/menu/block/add.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ const MenuBlockAdd = observer(class MenuBlockAdd extends React.Component<I.Menu>
};

sections = sections.concat([
{ id: 'action', icon: 'action', name: translate('menuBlockActionsSectionsActions'), color: '', children: actions },
{ id: 'action', icon: 'action', name: translate('commonActions'), color: '', children: actions },
]);

if (block.canHaveAlign()) {
Expand Down