feeds-fun 1.16.6 → 1.17.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/public/news-filtering-example.png +0 -0
- package/src/components/DiscoveryForm.vue +3 -5
- package/src/components/EntriesList.vue +1 -11
- package/src/components/EntryForList.vue +54 -67
- package/src/components/FeedForList.vue +29 -64
- package/src/components/FeedInfo.vue +12 -14
- package/src/components/FeedsList.vue +2 -1
- package/src/components/OPMLUpload.vue +3 -3
- package/src/components/RuleConstructor.vue +12 -6
- package/src/components/RuleForList.vue +25 -24
- package/src/components/RulesList.vue +2 -1
- package/src/components/SimplePagination.vue +2 -2
- package/src/components/SupertokensLogin.vue +5 -6
- package/src/components/UserSetting.vue +7 -12
- package/src/components/UserSettingForNotification.vue +4 -3
- package/src/components/body_list/EntryBody.vue +43 -0
- package/src/components/body_list/FaviconColumn.vue +24 -0
- package/src/components/body_list/ReverseTimeColumn.vue +28 -0
- package/src/components/collections/Block.vue +1 -1
- package/src/components/collections/BlockItem.vue +4 -3
- package/src/components/collections/DetailedItem.vue +4 -10
- package/src/components/collections/FeedItem.vue +31 -24
- package/src/components/collections/Notification.vue +6 -8
- package/src/components/collections/SubscribingProgress.vue +14 -17
- package/src/components/collections/Warning.vue +36 -38
- package/src/components/main/Block.vue +5 -0
- package/src/components/main/Description.vue +51 -0
- package/src/components/main/HeaderLine.vue +7 -0
- package/src/components/main/Item.vue +27 -0
- package/src/components/main/NewsTitle.vue +26 -0
- package/src/components/notifications/ApiKey.vue +14 -5
- package/src/components/notifications/CreateRuleHelp.vue +10 -11
- package/src/components/page_header/ExternalLinks.vue +58 -0
- package/src/components/tags/Base.vue +28 -0
- package/src/components/tags/EntryTag.vue +73 -0
- package/src/components/{TagsList.vue → tags/EntryTagsList.vue} +8 -10
- package/src/components/tags/FakeTag.vue +35 -0
- package/src/components/{FfunTag.vue → tags/FilterTag.vue} +36 -52
- package/src/components/tags/RuleTag.vue +67 -0
- package/src/components/{TagsFilter.vue → tags/TagsFilter.vue} +12 -8
- package/src/css/base.css +38 -0
- package/src/css/inputs.css +49 -0
- package/src/css/page_header.css +34 -0
- package/src/css/panels.css +49 -0
- package/src/css/side_panel_layout.css +34 -0
- package/src/css/tags.css +44 -0
- package/src/layouts/SidePanelLayout.vue +35 -91
- package/src/layouts/WideLayout.vue +5 -17
- package/src/logic/events.ts +1 -1
- package/src/logic/types.ts +16 -7
- package/src/logic/utils.ts +29 -0
- package/src/main.ts +42 -10
- package/src/style.css +10 -100
- package/src/values/DateTime.vue +1 -1
- package/src/values/{URL.vue → ExternalUrl.vue} +7 -6
- package/src/views/CollectionsView.vue +3 -6
- package/src/views/DiscoveryView.vue +9 -11
- package/src/views/FeedsView.vue +3 -2
- package/src/views/MainView.vue +191 -44
- package/src/views/NewsView.vue +2 -1
- package/src/views/RulesView.vue +6 -3
- package/src/views/SettingsView.vue +92 -33
- package/src/inputs/Marker.vue +0 -54
package/src/views/FeedsView.vue
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<side-panel-layout>
|
|
3
3
|
<template #side-menu-item-1>
|
|
4
|
-
Show descriptions
|
|
4
|
+
Show descriptions
|
|
5
5
|
<config-flag
|
|
6
6
|
style="min-width: 2.5rem"
|
|
7
7
|
v-model:flag="globalSettings.showFeedsDescriptions"
|
|
@@ -30,6 +30,7 @@
|
|
|
30
30
|
class="ffun-form-button p-1 my-1 block w-full text-center"
|
|
31
31
|
href="/api/get-opml"
|
|
32
32
|
target="_blank"
|
|
33
|
+
title="Download OPML file with all your feeds"
|
|
33
34
|
>Download OPML</a
|
|
34
35
|
>
|
|
35
36
|
</template>
|
|
@@ -44,7 +45,7 @@
|
|
|
44
45
|
:create-rule-help="false"
|
|
45
46
|
:api-key="false"
|
|
46
47
|
:collections-notification_="sortedFeeds === null || sortedFeeds.length == 0"
|
|
47
|
-
:collections-warning_="
|
|
48
|
+
:collections-warning_="false" />
|
|
48
49
|
|
|
49
50
|
<feeds-list
|
|
50
51
|
v-if="sortedFeeds"
|
package/src/views/MainView.vue
CHANGED
|
@@ -1,57 +1,204 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<wide-layout>
|
|
3
|
-
<
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
3
|
+
<div class="ffun-page-header">
|
|
4
|
+
<div class="ffun-page-header-center-block">
|
|
5
|
+
<page-header-external-links :show-api="false" />
|
|
6
|
+
</div>
|
|
7
|
+
</div>
|
|
8
|
+
|
|
9
|
+
<hr />
|
|
10
|
+
|
|
11
|
+
<main-block>
|
|
12
|
+
<h1 class="m-0 text-5xl">Feeds Fun</h1>
|
|
13
|
+
<p class="mt-2 text-2xl">Transparent Personalized News</p>
|
|
14
|
+
</main-block>
|
|
15
|
+
|
|
16
|
+
<main-header-line>
|
|
17
|
+
<!-- TODO: uncomment this claim after we have some statistics on long-term users -->
|
|
18
|
+
<!-- Save over <strong class="text-green-700">80%</strong> of news-browsing time by focusing on what truly matters to you -->
|
|
19
|
+
Save news-browsing time by focusing on what truly matters
|
|
20
|
+
</main-header-line>
|
|
7
21
|
|
|
8
|
-
<
|
|
9
|
-
<div class="ffun-info-good">
|
|
22
|
+
<main-block>
|
|
23
|
+
<div class="max-w-xl md:mx-auto ffun-info-good text-center mx-2">
|
|
10
24
|
<supertokens-login />
|
|
11
25
|
</div>
|
|
26
|
+
</main-block>
|
|
12
27
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
<
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
<
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
28
|
+
<main-header-line> Smarter way to read news </main-header-line>
|
|
29
|
+
|
|
30
|
+
<main-block>
|
|
31
|
+
<main-description icon="ti-number-1">
|
|
32
|
+
<template #caption> Subscribe to sites </template>
|
|
33
|
+
|
|
34
|
+
<template #description>
|
|
35
|
+
<p class="text-lg font-medium">Give us the site URL and we do the rest.</p>
|
|
36
|
+
</template>
|
|
37
|
+
</main-description>
|
|
38
|
+
|
|
39
|
+
<main-description icon="ti-number-2">
|
|
40
|
+
<template #caption> Get automatic tagging </template>
|
|
41
|
+
|
|
42
|
+
<template #description>
|
|
43
|
+
<div>
|
|
44
|
+
<main-news-title
|
|
45
|
+
class=""
|
|
46
|
+
title="UFO crashes in Central Park"
|
|
47
|
+
:score="null" />
|
|
48
|
+
|
|
49
|
+
<fake-tag
|
|
50
|
+
uid="ufo"
|
|
51
|
+
name="ufo"
|
|
52
|
+
:link="null"
|
|
53
|
+
css-modifier="positive" />
|
|
54
|
+
|
|
55
|
+
<fake-tag
|
|
56
|
+
uid="news-dot-fake"
|
|
57
|
+
name="news.fake"
|
|
58
|
+
link="http://example.com"
|
|
59
|
+
css-modifier="negative" />
|
|
60
|
+
|
|
61
|
+
<fake-tag
|
|
62
|
+
uid="new-york"
|
|
63
|
+
name="new-york"
|
|
64
|
+
:link="null"
|
|
65
|
+
css-modifier="positive" />
|
|
66
|
+
|
|
67
|
+
<fake-tag
|
|
68
|
+
uid="space-exploration"
|
|
69
|
+
name="space-exploration"
|
|
70
|
+
:link="null"
|
|
71
|
+
css-modifier="positive" />
|
|
72
|
+
</div>
|
|
73
|
+
</template>
|
|
74
|
+
</main-description>
|
|
75
|
+
|
|
76
|
+
<main-description icon="ti-number-3">
|
|
77
|
+
<template #caption> Create scoring rules </template>
|
|
78
|
+
|
|
79
|
+
<template #description>
|
|
80
|
+
<div class="grid grid-cols-2 justify-items-start">
|
|
81
|
+
<div class="">
|
|
82
|
+
<fake-tag
|
|
83
|
+
uid="sci-fi"
|
|
84
|
+
name="sci-fi"
|
|
85
|
+
:link="null"
|
|
86
|
+
css-modifier="positive" />
|
|
87
|
+
|
|
88
|
+
<i class="ti ti-arrow-right"></i>
|
|
89
|
+
|
|
90
|
+
<span class="cursor-default text-purple-700 text-lg md:text-xl">+5</span>
|
|
91
|
+
</div>
|
|
92
|
+
|
|
93
|
+
<div class="">
|
|
94
|
+
<fake-tag
|
|
95
|
+
uid="news-dot-fake"
|
|
96
|
+
name="news.fake"
|
|
97
|
+
link="http://example.com"
|
|
98
|
+
css-modifier="negative" />
|
|
99
|
+
|
|
100
|
+
<i class="ti ti-arrow-right"></i>
|
|
47
101
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
102
|
+
<span class="cursor-default text-purple-700 text-lg md:text-xl">-55</span>
|
|
103
|
+
</div>
|
|
104
|
+
|
|
105
|
+
<div class="">
|
|
106
|
+
<fake-tag
|
|
107
|
+
uid="ufo"
|
|
108
|
+
name="ufo"
|
|
109
|
+
:link="null"
|
|
110
|
+
css-modifier="positive" />
|
|
111
|
+
|
|
112
|
+
<i class="ti ti-plus"></i>
|
|
113
|
+
|
|
114
|
+
<fake-tag
|
|
115
|
+
uid="new-york"
|
|
116
|
+
name="new-york"
|
|
117
|
+
:link="null"
|
|
118
|
+
css-modifier="positive" />
|
|
119
|
+
|
|
120
|
+
<i class="ti ti-arrow-right"></i>
|
|
121
|
+
|
|
122
|
+
<span class="cursor-default-purple-700 text-lg md:text-xl">+8</span>
|
|
123
|
+
</div>
|
|
124
|
+
|
|
125
|
+
<div class="">
|
|
126
|
+
<fake-tag
|
|
127
|
+
uid="space-exploration"
|
|
128
|
+
name="space-exploration"
|
|
129
|
+
:link="null"
|
|
130
|
+
css-modifier="positive" />
|
|
131
|
+
|
|
132
|
+
<i class="ti ti-arrow-right"></i>
|
|
133
|
+
|
|
134
|
+
<span class="cursor-default text-purple-700 text-lg md:text-xl">+21</span>
|
|
135
|
+
</div>
|
|
136
|
+
</div>
|
|
137
|
+
</template>
|
|
138
|
+
</main-description>
|
|
139
|
+
|
|
140
|
+
<main-description icon="ti-number-4">
|
|
141
|
+
<template #caption> Read what matters </template>
|
|
142
|
+
|
|
143
|
+
<template #description>
|
|
144
|
+
<div class="justify-items-start">
|
|
145
|
+
<main-news-title
|
|
146
|
+
title="New mission on Mars"
|
|
147
|
+
:score="21" />
|
|
148
|
+
|
|
149
|
+
<main-news-title
|
|
150
|
+
class="opacity-75"
|
|
151
|
+
title="Sci-fi novel about UFO in New Yourk"
|
|
152
|
+
:score="13" />
|
|
153
|
+
|
|
154
|
+
<i class="opacity-65 block ti ti-dots justify-self-center"></i>
|
|
155
|
+
|
|
156
|
+
<main-news-title
|
|
157
|
+
class="opacity-55"
|
|
158
|
+
title="UFO crashes in Central Park"
|
|
159
|
+
:score="-26" />
|
|
160
|
+
</div>
|
|
161
|
+
</template>
|
|
162
|
+
</main-description>
|
|
163
|
+
</main-block>
|
|
164
|
+
|
|
165
|
+
<main-header-line v-if="collections.collectionsOrder.length > 0">
|
|
166
|
+
Curated news collections <br class="md:hidden" />for easy start
|
|
167
|
+
</main-header-line>
|
|
168
|
+
|
|
169
|
+
<main-block>
|
|
170
|
+
<div class="grid grid-cols-1 md:grid-cols-2 gap-4">
|
|
171
|
+
<template
|
|
172
|
+
v-for="collectionId in collections.collectionsOrder"
|
|
173
|
+
:key="collectionId">
|
|
174
|
+
<main-item
|
|
175
|
+
v-if="collections.collections[collectionId].showOnMain"
|
|
176
|
+
icon="ti-arrow-narrow-right">
|
|
177
|
+
<template #caption>
|
|
178
|
+
{{ collections.collections[collectionId].name }}
|
|
179
|
+
</template>
|
|
180
|
+
|
|
181
|
+
<template #description>
|
|
182
|
+
{{ collections.collections[collectionId].description }}
|
|
183
|
+
</template>
|
|
184
|
+
</main-item>
|
|
185
|
+
</template>
|
|
186
|
+
</div>
|
|
187
|
+
</main-block>
|
|
188
|
+
|
|
189
|
+
<main-header-line> Here, take a peek </main-header-line>
|
|
190
|
+
<div class="text-center p-5">
|
|
191
|
+
<img
|
|
192
|
+
class="border-2 rounded border-slate-300 mx-auto"
|
|
193
|
+
src="/news-filtering-example.png"
|
|
194
|
+
alt="News filtering example" />
|
|
195
|
+
</div>
|
|
52
196
|
</wide-layout>
|
|
53
197
|
</template>
|
|
54
198
|
|
|
55
199
|
<script lang="ts" setup>
|
|
56
200
|
import * as settings from "@/logic/settings";
|
|
201
|
+
import {useCollectionsStore} from "@/stores/collections";
|
|
202
|
+
|
|
203
|
+
const collections = useCollectionsStore();
|
|
57
204
|
</script>
|
package/src/views/NewsView.vue
CHANGED
package/src/views/RulesView.vue
CHANGED
|
@@ -13,10 +13,13 @@
|
|
|
13
13
|
</template>
|
|
14
14
|
|
|
15
15
|
<template #side-footer>
|
|
16
|
-
<tags-filter
|
|
16
|
+
<tags-filter
|
|
17
|
+
:tags="tagsCount"
|
|
18
|
+
:show-create-rule="false"
|
|
19
|
+
change-source="rules_tags_filter" />
|
|
17
20
|
</template>
|
|
18
21
|
|
|
19
|
-
<div class="ffun-info-
|
|
22
|
+
<div class="ffun-info-common mb-2">
|
|
20
23
|
<p
|
|
21
24
|
>You can create new rules on the
|
|
22
25
|
<a
|
|
@@ -93,7 +96,7 @@
|
|
|
93
96
|
|
|
94
97
|
let sorted = rules.value.slice();
|
|
95
98
|
|
|
96
|
-
sorted = tagsStates.value.filterByTags(sorted, (rule) => rule.
|
|
99
|
+
sorted = tagsStates.value.filterByTags(sorted, (rule) => rule.allTags);
|
|
97
100
|
|
|
98
101
|
const orderProperties = e.RulesOrderProperties.get(globalSettings.rulesOrder);
|
|
99
102
|
|
|
@@ -2,35 +2,91 @@
|
|
|
2
2
|
<side-panel-layout :reload-button="false">
|
|
3
3
|
<template #main-header> Settings </template>
|
|
4
4
|
|
|
5
|
-
<
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
</
|
|
14
|
-
|
|
15
|
-
<
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
</
|
|
5
|
+
<h3>General</h3>
|
|
6
|
+
|
|
7
|
+
<label class="mr-1">User id</label>
|
|
8
|
+
<input
|
|
9
|
+
class="ffun-input w-72 cursor-pointer"
|
|
10
|
+
disabled
|
|
11
|
+
:value="userId" />
|
|
12
|
+
|
|
13
|
+
<h3>Messages</h3>
|
|
14
|
+
|
|
15
|
+
<user-setting
|
|
16
|
+
v-for="kind of messagesSettings"
|
|
17
|
+
key="kind"
|
|
18
|
+
:kind="kind" />
|
|
19
|
+
|
|
20
|
+
<h3>Tagging</h3>
|
|
21
|
+
|
|
22
|
+
<div class="ffun-info-common">
|
|
23
|
+
<p>
|
|
24
|
+
All feeds from
|
|
25
|
+
<a
|
|
26
|
+
href="#"
|
|
27
|
+
@click.prevent="goToCollections()"
|
|
28
|
+
>collections</a
|
|
29
|
+
>
|
|
30
|
+
are tagged for free.
|
|
31
|
+
</p>
|
|
32
|
+
|
|
33
|
+
<p>
|
|
34
|
+
If you want to tag your own feeds, we kindly ask you to provide an
|
|
35
|
+
<external-url
|
|
36
|
+
url="https://platform.openai.com/docs/api-reference/introduction"
|
|
37
|
+
text="OpenAI" />
|
|
38
|
+
or
|
|
39
|
+
<external-url
|
|
40
|
+
url="https://ai.google.dev/gemini-api/docs/api-key"
|
|
41
|
+
text="Gemini" />
|
|
42
|
+
API key.
|
|
43
|
+
</p>
|
|
44
|
+
|
|
45
|
+
<p><strong>Here is how we use your API key:</strong></p>
|
|
46
|
+
|
|
47
|
+
<ul>
|
|
48
|
+
<li>We use your key only for your feeds that are not part of predefined collections.</li>
|
|
49
|
+
<li>We stop using your key when its usage exceeds the monthly limit you set.</li>
|
|
50
|
+
<li
|
|
51
|
+
>If a feed has multiple subscribers with API keys, we'll use a key with the lowest usage in the current
|
|
52
|
+
month.</li
|
|
53
|
+
>
|
|
54
|
+
<li>We do not process old news until you tell us to.</li>
|
|
55
|
+
</ul>
|
|
56
|
+
|
|
57
|
+
<p><strong>The more users set up an API key, the cheaper Feeds Fun becomes for everyone.</strong></p>
|
|
58
|
+
|
|
59
|
+
<p>API key usage statistics are available on this page.</p>
|
|
60
|
+
</div>
|
|
61
|
+
|
|
62
|
+
<user-setting
|
|
63
|
+
kind="openai_api_key"
|
|
64
|
+
class="mt-4" />
|
|
65
|
+
<user-setting kind="gemini_api_key" />
|
|
66
|
+
<user-setting kind="max_tokens_cost_in_month" />
|
|
67
|
+
|
|
68
|
+
<user-setting kind="process_entries_not_older_than" />
|
|
69
|
+
|
|
70
|
+
<div class="ffun-info-common mb-4">
|
|
71
|
+
<p>
|
|
72
|
+
The age of a news item is calculated based on the time it was published (according to the data in the feed).
|
|
73
|
+
</p>
|
|
74
|
+
</div>
|
|
21
75
|
|
|
22
76
|
<h3>API usage</h3>
|
|
23
77
|
|
|
24
|
-
<
|
|
78
|
+
<div class="ffun-info-common mb-4">
|
|
79
|
+
<p>Estimated tokens cost for your API keys usage per month.</p>
|
|
25
80
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
81
|
+
<ul class="list-disc list-inside">
|
|
82
|
+
<li> <strong>Estimated Used USD</strong> — the estimated cost of tokens in processed requests. </li>
|
|
83
|
+
<li>
|
|
84
|
+
<strong>Estimated Reserved USD</strong> — the estimated cost of tokens reserved for requests that are
|
|
85
|
+
currently processing or were not processed correctly.
|
|
86
|
+
</li>
|
|
87
|
+
<li> <strong>Estimated Total USD</strong> — the estimated total cost of tokens used in the month. </li>
|
|
88
|
+
</ul>
|
|
89
|
+
</div>
|
|
34
90
|
|
|
35
91
|
<p v-if="tokensCostData == null">Loading...</p>
|
|
36
92
|
|
|
@@ -69,6 +125,7 @@
|
|
|
69
125
|
import * as api from "@/logic/api";
|
|
70
126
|
import * as t from "@/logic/types";
|
|
71
127
|
import * as e from "@/logic/enums";
|
|
128
|
+
import {useRouter} from "vue-router";
|
|
72
129
|
import {useGlobalSettingsStore} from "@/stores/globalSettings";
|
|
73
130
|
|
|
74
131
|
const globalSettings = useGlobalSettingsStore();
|
|
@@ -87,16 +144,18 @@
|
|
|
87
144
|
return globalSettings.info.userId;
|
|
88
145
|
});
|
|
89
146
|
|
|
90
|
-
|
|
91
|
-
const settingsOrder = [
|
|
92
|
-
"openai_api_key",
|
|
93
|
-
"gemini_api_key",
|
|
94
|
-
"max_tokens_cost_in_month",
|
|
95
|
-
"process_entries_not_older_than",
|
|
147
|
+
const messagesSettings = [
|
|
96
148
|
"hide_message_about_setting_up_key",
|
|
97
149
|
"hide_message_about_adding_collections",
|
|
98
150
|
"hide_message_check_your_feed_urls"
|
|
99
151
|
];
|
|
100
|
-
</script>
|
|
101
152
|
|
|
102
|
-
|
|
153
|
+
const router = useRouter();
|
|
154
|
+
|
|
155
|
+
function goToCollections() {
|
|
156
|
+
router.push({name: e.MainPanelMode.Collections, params: {}});
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
// TODO: check api keys on setup
|
|
160
|
+
// TODO: basic integer checks
|
|
161
|
+
</script>
|
package/src/inputs/Marker.vue
DELETED
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div>
|
|
3
|
-
<template v-if="hasMarker">
|
|
4
|
-
<a
|
|
5
|
-
href="#"
|
|
6
|
-
@click.prevent="unmark()">
|
|
7
|
-
<slot name="marked" />
|
|
8
|
-
</a>
|
|
9
|
-
</template>
|
|
10
|
-
|
|
11
|
-
<template v-else>
|
|
12
|
-
<a
|
|
13
|
-
href="#"
|
|
14
|
-
@click.prevent="mark()">
|
|
15
|
-
<slot name="unmarked" />
|
|
16
|
-
</a>
|
|
17
|
-
</template>
|
|
18
|
-
</div>
|
|
19
|
-
</template>
|
|
20
|
-
|
|
21
|
-
<script lang="ts" setup>
|
|
22
|
-
import {computed, ref} from "vue";
|
|
23
|
-
import * as api from "@/logic/api";
|
|
24
|
-
import * as e from "@/logic/enums";
|
|
25
|
-
import type * as t from "@/logic/types";
|
|
26
|
-
import {useEntriesStore} from "@/stores/entries";
|
|
27
|
-
|
|
28
|
-
const entriesStore = useEntriesStore();
|
|
29
|
-
|
|
30
|
-
const properties = defineProps<{
|
|
31
|
-
marker: e.Marker;
|
|
32
|
-
entryId: t.EntryId;
|
|
33
|
-
}>();
|
|
34
|
-
|
|
35
|
-
const hasMarker = computed(() => {
|
|
36
|
-
return entriesStore.entries[properties.entryId].hasMarker(properties.marker);
|
|
37
|
-
});
|
|
38
|
-
|
|
39
|
-
async function mark() {
|
|
40
|
-
await entriesStore.setMarker({
|
|
41
|
-
entryId: properties.entryId,
|
|
42
|
-
marker: properties.marker
|
|
43
|
-
});
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
async function unmark() {
|
|
47
|
-
await entriesStore.removeMarker({
|
|
48
|
-
entryId: properties.entryId,
|
|
49
|
-
marker: properties.marker
|
|
50
|
-
});
|
|
51
|
-
}
|
|
52
|
-
</script>
|
|
53
|
-
|
|
54
|
-
<style scoped></style>
|