Skip to content

Commit f1c08df

Browse files
authored
Merge pull request #37 from betterRunner/dev
Dev
2 parents 57ee4a8 + 6dda347 commit f1c08df

File tree

6 files changed

+76
-40
lines changed

6 files changed

+76
-40
lines changed

CHANGELOG.md

+29
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,32 @@
1+
## [1.3.6](https://github.com/betterRunner/context-note/compare/v1.2.2...v1.3.6) (2021-12-25)
2+
3+
4+
### Bug Fixes
5+
6+
* put the notes with the current location href to the head. ([81360db](https://github.com/betterRunner/context-note/commit/81360db9c0fcf46e5c98dcec9daf89372775b2fe))
7+
* clear search text when tag-searcher close ([56b0f2b](https://github.com/betterRunner/context-note/commit/56b0f2b2e78984a6691f5c8003b8779cd2b539be))
8+
* close button ([a2f46fd](https://github.com/betterRunner/context-note/commit/a2f46fd45ab62df661c3ee1335a4855e4e23caed))
9+
* close icon ([e9803dc](https://github.com/betterRunner/context-note/commit/e9803dcb2ca44f1a4f813695efaea018daebbdec))
10+
* css on windows ([4e6f22c](https://github.com/betterRunner/context-note/commit/4e6f22ca5cfd43f25500bf63c78d064e3bbe778e))
11+
* el-overlay z-index ([7e7b62d](https://github.com/betterRunner/context-note/commit/7e7b62df0dec2d7f0e821426252e92e8a419bba1))
12+
* handleClickOutsideEditor trigger bug ([045c6c8](https://github.com/betterRunner/context-note/commit/045c6c8c8f352928a0156f861560d2acd10f9624))
13+
* hightlight rects not occupying click event ([f0d4e07](https://github.com/betterRunner/context-note/commit/f0d4e07b3b7af6346cb4c59728b78b757a41a730))
14+
* more button top ([4032321](https://github.com/betterRunner/context-note/commit/40323213559fca34ea12d4fac55f8fc72f2a8c8c))
15+
* padding & scrollbar ([ecedbb7](https://github.com/betterRunner/context-note/commit/ecedbb76d29d0b098bf7bd5995e5b3c41ed7621e))
16+
* popup is hided in small screen ([0950940](https://github.com/betterRunner/context-note/commit/0950940d7d1d668a22d1289989e03c976ff57710))
17+
* scrollbar of page disappers ([3f5dc31](https://github.com/betterRunner/context-note/commit/3f5dc319dc0149dbf18863ec2d66ca92ad124752))
18+
* storage write not working ([bf5827b](https://github.com/betterRunner/context-note/commit/bf5827b56b1f5cc02ac53d37554d85b44d9500ed))
19+
* tag & more css ([b88539f](https://github.com/betterRunner/context-note/commit/b88539fc2a1790ab1c59c3b946a1c8ec0c64b732))
20+
* wait to run storage oper until prev one finished ([64e3806](https://github.com/betterRunner/context-note/commit/64e38062388e533048507ac34bbeb0ba50e9c5f5))
21+
22+
23+
### Features
24+
25+
* copy note to clipboard ([403f7f7](https://github.com/betterRunner/context-note/commit/403f7f7460f1ce9ad086ae9477cc7f2a0acb7007))
26+
* import notes ([74857b1](https://github.com/betterRunner/context-note/commit/74857b12d45ba41cd0bb1a6db4823134a419f884))
27+
28+
29+
130
## [1.3.5](https://github.com/betterRunner/context-note/compare/v1.3.2...v1.3.5) (2021-11-16)
231

332

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "context-note",
3-
"version": "1.3.5",
3+
"version": "1.3.6",
44
"scripts": {
55
"dev": "vite build --mode developmemnt",
66
"build": "vite build",

src/content-scripts/main.css

+5-5
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@ will be invisible, so set left to 0. */
1212
left: 0 !important;
1313
}
1414

15-
/* ::-webkit-scrollbar {
15+
.popup-wrapper::-webkit-scrollbar {
1616
width: 5px !important;
1717
}
18-
::-webkit-scrollbar-track {
19-
-webkit-box-shadow: inset006pxrgba(0, 0, 0, 0.3) !important;
18+
.popup-wrapper::-webkit-scrollbar-track {
19+
-webkit-box-shadow: rgba(0, 0, 0, 0.3) !important;
2020
border-radius: 5px !important;
2121
}
22-
::-webkit-scrollbar-thumb:window-inactive {
22+
.popup-wrapper::-webkit-scrollbar-thumb:window-inactive {
2323
background: #aaa !important;
24-
} */
24+
}

src/content-scripts/renderer/popup/index.vue

+1
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ export default defineComponent({
103103
right: 5px;
104104
top: 5px;
105105
cursor: pointer;
106+
color: white;
106107
}
107108
}
108109
</style>

src/content-scripts/renderer/popup/note-book/note-list.vue

+38-32
Original file line numberDiff line numberDiff line change
@@ -42,39 +42,45 @@ export default defineComponent({
4242
/// search note
4343
const searchText = ref("");
4444
const searchedNotes = computed((): TNote[] => {
45-
const notes = storage.notes;
45+
let notes = storage.notes;
4646
47-
if (!searchText.value) return notes;
48-
49-
const plainNotes = notes.map((n) => ({
50-
id: n.id,
51-
plainText: (n.note as Delta)?.ops
52-
?.map((o: { insert: any }) => o?.insert || "")
53-
.join(""),
54-
}));
55-
const filteredPlainNoteIds = filterArrBySearchText(
56-
plainNotes,
57-
"plainText",
58-
searchText.value
59-
).map((n) => n.id);
60-
// fitler by `searchText` in the following order
61-
let ids = [
62-
// 1. filter by content
63-
...filterArrBySearchText(notes, "content", searchText.value).map((n) => n.id),
64-
// 2. filter by plain note
65-
...filteredPlainNoteIds,
66-
// 3. filter by tags
67-
...notes
68-
.filter((n) => !!filterArrBySearchText(n.tags, "", searchText.value).length)
69-
.map((n) => n.id),
70-
// 4. filter by link
71-
...notes.filter((n) => n.link.includes(searchText.value)).map((n) => n.id),
47+
if (searchText.value) {
48+
const plainNotes = notes.map((n) => ({
49+
id: n.id,
50+
plainText: (n.note as Delta)?.ops
51+
?.map((o: { insert: any }) => o?.insert || "")
52+
.join(""),
53+
}));
54+
const filteredPlainNoteIds = filterArrBySearchText(
55+
plainNotes,
56+
"plainText",
57+
searchText.value
58+
).map((n) => n.id);
59+
// fitler by `searchText` in the following order
60+
let ids = [
61+
// 1. filter by content
62+
...filterArrBySearchText(notes, "content", searchText.value).map((n) => n.id),
63+
// 2. filter by plain note
64+
...filteredPlainNoteIds,
65+
// 3. filter by tags
66+
...notes
67+
.filter((n) => !!filterArrBySearchText(n.tags, "", searchText.value).length)
68+
.map((n) => n.id),
69+
// 4. filter by link
70+
...notes.filter((n) => n.link.includes(searchText.value)).map((n) => n.id),
71+
];
72+
// remove the duplicated ids
73+
ids = Array.from(new Set(ids));
74+
notes = ids
75+
.map((id) => notes.find((n) => n.id === id))
76+
.filter((n) => !!n) as TNote[];
77+
}
78+
// put the ones with the current location href to the head.
79+
const href = removeUrlPostfix(window.location.href);
80+
return [
81+
...notes.filter(n => n.link === href),
82+
...notes.filter(n => n.link !== href)
7283
];
73-
// remove the duplicated ids
74-
ids = Array.from(new Set(ids));
75-
return ids
76-
.map((id) => notes.find((n) => n.id === id))
77-
.filter((n) => !!n) as TNote[];
7884
});
7985
8086
/// create note
@@ -273,7 +279,7 @@ export default defineComponent({
273279
274280
.note-list-search {
275281
margin-bottom: 10px;
276-
background: #fff !important;
282+
background: unset !important;
277283
max-width: 500px;
278284
}
279285

src/content-scripts/renderer/popup/note-book/note.vue

+2-2
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ export default {
260260

261261
<style lang="less" scoped>
262262
.note-wrapper {
263-
padding: 16px;
263+
padding: 10px 16px;
264264
background: white;
265265
box-shadow: 1px 2px 2px 0 rgba(0, 0, 0, 0.1);
266266
margin-bottom: 20px;
@@ -353,7 +353,7 @@ export default {
353353
}
354354
.note-more-opers {
355355
position: absolute;
356-
top: 5px;
356+
top: 0px;
357357
right: 10px;
358358
cursor: pointer;
359359
padding: 5px;

0 commit comments

Comments
 (0)