@vestcards/shared 1.1.0 → 1.3.0
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/dist/chunk-BK-Lzi7j.cjs +1 -0
- package/dist/date-DS8JYZte.js +103 -0
- package/dist/date-DoLsSDIb.cjs +1 -0
- package/dist/date.cjs +1 -1
- package/dist/date.d.ts +1 -1
- package/dist/date.js +2 -71
- package/dist/fsrs-D2XsH28s.js +23 -0
- package/dist/fsrs-DO2rNRTM.cjs +1 -0
- package/dist/hooks.cjs +1 -1
- package/dist/hooks.js +14 -14
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +17 -1
- package/dist/index.js +220 -245
- package/dist/spaced-repetition.cjs +1 -1
- package/dist/spaced-repetition.d.ts +33 -0
- package/dist/spaced-repetition.js +1306 -1186
- package/dist/theme-Bt1AkSvq.cjs +1 -0
- package/dist/theme-DfRHdgzh.js +111 -0
- package/dist/theme.cjs +1 -1
- package/dist/theme.js +2 -19
- package/dist/utils.cjs +1 -1
- package/dist/utils.js +37 -32
- package/package.json +6 -6
- package/dist/colors-G1GHbBJq.js +0 -120
- package/dist/colors-c6Q-ORB_.cjs +0 -1
- package/dist/fsrs-DEA3eLGO.cjs +0 -1
- package/dist/fsrs-sJJWxUiC.js +0 -14
package/dist/index.js
CHANGED
|
@@ -1,247 +1,222 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
1
|
+
import { i as e, n as t, r as n, t as r } from "./fsrs-D2XsH28s.js";
|
|
2
|
+
import { i } from "./theme-DfRHdgzh.js";
|
|
3
|
+
//#region src/eden.ts
|
|
4
|
+
var a = 9999;
|
|
5
|
+
function o({ data: e, error: t }, n) {
|
|
6
|
+
if (t) {
|
|
7
|
+
let e = t.value, r = e && typeof e == "object" && e && "message" in e ? String(e.message) : n;
|
|
8
|
+
throw Error(r || n);
|
|
9
|
+
}
|
|
10
|
+
if (!e || typeof e == "object" && "error" in e) throw Error(n);
|
|
11
|
+
return e;
|
|
12
12
|
}
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
var
|
|
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
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
export {
|
|
221
|
-
T as ALL_PERMISSIONS,
|
|
222
|
-
R as BlogPostStatus,
|
|
223
|
-
c as DeckStatus,
|
|
224
|
-
l as ENTITLEMENT_PERMISSIONS,
|
|
225
|
-
D as Entitlement,
|
|
226
|
-
L as EntranceExamProgramStatus,
|
|
227
|
-
s as MembershipStatus,
|
|
228
|
-
_ as OrganizationRole,
|
|
229
|
-
E as PERMISSIONS,
|
|
230
|
-
p as Permission,
|
|
231
|
-
u as ROLE_PERMISSIONS,
|
|
232
|
-
W as ReviewRating,
|
|
233
|
-
y as ReviewState,
|
|
234
|
-
N as SUBJECTS,
|
|
235
|
-
A as SUBJECT_COLORS,
|
|
236
|
-
n as SUBJECT_ICONS,
|
|
237
|
-
m as UNPAGINATED_SIZE,
|
|
238
|
-
d as UserRole,
|
|
239
|
-
U as cardDemandStatus,
|
|
240
|
-
f as getSubjectCSSColor,
|
|
241
|
-
P as getSubjectColor,
|
|
242
|
-
w as getSubjectIcon,
|
|
243
|
-
O as hasPermission,
|
|
244
|
-
v as reviewRatings,
|
|
245
|
-
g as reviewStates,
|
|
246
|
-
S as unwrapApiResponse
|
|
13
|
+
//#endregion
|
|
14
|
+
//#region src/types/blog.ts
|
|
15
|
+
var s = /* @__PURE__ */ function(e) {
|
|
16
|
+
return e.Draft = "draft", e.Published = "published", e;
|
|
17
|
+
}({}), c = [
|
|
18
|
+
"not-reviewed",
|
|
19
|
+
"card-updated",
|
|
20
|
+
"demand-rejected",
|
|
21
|
+
"card-removed"
|
|
22
|
+
], l = /* @__PURE__ */ function(e) {
|
|
23
|
+
return e.Draft = "draft", e.Review = "to_review", e.Published = "published", e.Archived = "archived", e;
|
|
24
|
+
}({}), u = [
|
|
25
|
+
"matemática",
|
|
26
|
+
"geografia",
|
|
27
|
+
"física",
|
|
28
|
+
"biologia",
|
|
29
|
+
"história",
|
|
30
|
+
"literatura",
|
|
31
|
+
"gramática",
|
|
32
|
+
"sociologia",
|
|
33
|
+
"química",
|
|
34
|
+
"filosofia",
|
|
35
|
+
"redação",
|
|
36
|
+
"artes",
|
|
37
|
+
"inglês"
|
|
38
|
+
], d = /* @__PURE__ */ function(e) {
|
|
39
|
+
return e.Admin = "admin", e.Moderator = "moderator", e.User = "user", e;
|
|
40
|
+
}({}), f = /* @__PURE__ */ function(e) {
|
|
41
|
+
return e.Owner = "owner", e.Admin = "admin", e.Member = "member", e;
|
|
42
|
+
}({}), p = /* @__PURE__ */ function(e) {
|
|
43
|
+
return e.Premium = "premium", e;
|
|
44
|
+
}({}), m = /* @__PURE__ */ function(e) {
|
|
45
|
+
return e.Active = "active", e.Canceled = "canceled", e.Pending = "pending", e.Expired = "expired", e;
|
|
46
|
+
}({}), h = {
|
|
47
|
+
APP: { ACCESS: "app:access" },
|
|
48
|
+
DECK: {
|
|
49
|
+
CREATE_OWN: "deck:create:own",
|
|
50
|
+
CREATE_PUBLIC: "deck:create:public",
|
|
51
|
+
READ_OWN: "deck:read:own",
|
|
52
|
+
READ_OTHERS: "deck:read:others",
|
|
53
|
+
READ_UNPUBLISHED: "deck:read:unpublished",
|
|
54
|
+
READ_FREE: "deck:read:free",
|
|
55
|
+
READ_PREMIUM: "deck:read:premium",
|
|
56
|
+
READ_PRIVATE: "deck:read:private",
|
|
57
|
+
UPDATE_OWN: "deck:update:own",
|
|
58
|
+
UPDATE_PUBLIC: "deck:update:public",
|
|
59
|
+
DELETE_OWN: "deck:delete:own",
|
|
60
|
+
DELETE_PUBLIC: "deck:delete:public"
|
|
61
|
+
},
|
|
62
|
+
CARD_DEMAND: {
|
|
63
|
+
READ_ALL: "card-demand:read:*",
|
|
64
|
+
CREATE: "card-demand:create",
|
|
65
|
+
ACTION: "card-demand:action"
|
|
66
|
+
},
|
|
67
|
+
USER: {
|
|
68
|
+
UPDATE_OWN: "user:update:own",
|
|
69
|
+
UPDATE_ALL: "user:update:*",
|
|
70
|
+
DELETE_OWN: "user:delete:own",
|
|
71
|
+
DELETE_ALL: "user:delete:*",
|
|
72
|
+
READ_OWN: "user:read:own",
|
|
73
|
+
READ_ALL: "user:read:*"
|
|
74
|
+
},
|
|
75
|
+
STATS: { VIEW: "stats:view" },
|
|
76
|
+
MEMBERSHIP: { MANAGE: "membership:manage" },
|
|
77
|
+
PLAN: {
|
|
78
|
+
CREATE: "plan:create",
|
|
79
|
+
UPDATE: "plan:update",
|
|
80
|
+
DELETE: "plan:delete"
|
|
81
|
+
},
|
|
82
|
+
BLOGPOST: {
|
|
83
|
+
CREATE: "blogpost:create",
|
|
84
|
+
UPDATE: "blogpost:update",
|
|
85
|
+
DELETE: "blogpost:delete"
|
|
86
|
+
},
|
|
87
|
+
VESTY: { CHAT: "vesty:chat" },
|
|
88
|
+
STUDY: {
|
|
89
|
+
READ: "study:read",
|
|
90
|
+
WRITE: "study:write"
|
|
91
|
+
},
|
|
92
|
+
LIBRARY: {
|
|
93
|
+
READ: "library:read",
|
|
94
|
+
WRITE: "library:write",
|
|
95
|
+
WRITE_PREMIUM: "library:write:premium"
|
|
96
|
+
},
|
|
97
|
+
ADMIN_PANEL: { VIEW: "admin-panel:view" }
|
|
98
|
+
}, g = {
|
|
99
|
+
APP_ACCESS: h.APP.ACCESS,
|
|
100
|
+
DECK_CREATE_OWN: h.DECK.CREATE_OWN,
|
|
101
|
+
DECK_CREATE_PUBLIC: h.DECK.CREATE_PUBLIC,
|
|
102
|
+
DECK_READ_OWN: h.DECK.READ_OWN,
|
|
103
|
+
DECK_READ_OTHERS: h.DECK.READ_OTHERS,
|
|
104
|
+
DECK_READ_UNPUBLISHED: h.DECK.READ_UNPUBLISHED,
|
|
105
|
+
DECK_READ_FREE: h.DECK.READ_FREE,
|
|
106
|
+
DECK_READ_PREMIUM: h.DECK.READ_PREMIUM,
|
|
107
|
+
DECK_READ_PRIVATE: h.DECK.READ_PRIVATE,
|
|
108
|
+
DECK_UPDATE_OWN: h.DECK.UPDATE_OWN,
|
|
109
|
+
DECK_UPDATE_PUBLIC: h.DECK.UPDATE_PUBLIC,
|
|
110
|
+
DECK_DELETE_OWN: h.DECK.DELETE_OWN,
|
|
111
|
+
DECK_DELETE_PUBLIC: h.DECK.DELETE_PUBLIC,
|
|
112
|
+
CARD_DEMAND_READ_ALL: h.CARD_DEMAND.READ_ALL,
|
|
113
|
+
CARD_DEMAND_CREATE: h.CARD_DEMAND.CREATE,
|
|
114
|
+
CARD_DEMAND_ACTION: h.CARD_DEMAND.ACTION,
|
|
115
|
+
USER_UPDATE_OWN: h.USER.UPDATE_OWN,
|
|
116
|
+
USER_UPDATE_ALL: h.USER.UPDATE_ALL,
|
|
117
|
+
USER_DELETE_OWN: h.USER.DELETE_OWN,
|
|
118
|
+
USER_DELETE_ALL: h.USER.DELETE_ALL,
|
|
119
|
+
USER_READ_OWN: h.USER.READ_OWN,
|
|
120
|
+
USER_READ_ALL: h.USER.READ_ALL,
|
|
121
|
+
STATS_VIEW: h.STATS.VIEW,
|
|
122
|
+
MEMBERSHIP_MANAGE: h.MEMBERSHIP.MANAGE,
|
|
123
|
+
PLAN_CREATE: h.PLAN.CREATE,
|
|
124
|
+
PLAN_UPDATE: h.PLAN.UPDATE,
|
|
125
|
+
PLAN_DELETE: h.PLAN.DELETE,
|
|
126
|
+
BLOGPOST_CREATE: h.BLOGPOST.CREATE,
|
|
127
|
+
BLOGPOST_UPDATE: h.BLOGPOST.UPDATE,
|
|
128
|
+
BLOGPOST_DELETE: h.BLOGPOST.DELETE,
|
|
129
|
+
VESTY_CHAT: h.VESTY.CHAT,
|
|
130
|
+
STUDY_READ: h.STUDY.READ,
|
|
131
|
+
STUDY_WRITE: h.STUDY.WRITE,
|
|
132
|
+
LIBRARY_READ: h.LIBRARY.READ,
|
|
133
|
+
LIBRARY_WRITE: h.LIBRARY.WRITE,
|
|
134
|
+
LIBRARY_WRITE_PREMIUM: h.LIBRARY.WRITE_PREMIUM,
|
|
135
|
+
ADMIN_PANEL_VIEW: h.ADMIN_PANEL.VIEW
|
|
136
|
+
}, _ = Object.values(h).flatMap((e) => Object.values(e)), v = {
|
|
137
|
+
[d.User]: [
|
|
138
|
+
"deck:read:free",
|
|
139
|
+
"deck:read:own",
|
|
140
|
+
"deck:delete:own",
|
|
141
|
+
"study:read",
|
|
142
|
+
"study:write",
|
|
143
|
+
"library:read",
|
|
144
|
+
"library:write",
|
|
145
|
+
"card-demand:create",
|
|
146
|
+
"user:update:own",
|
|
147
|
+
"user:delete:own",
|
|
148
|
+
"user:read:own"
|
|
149
|
+
],
|
|
150
|
+
[d.Moderator]: [
|
|
151
|
+
"app:access",
|
|
152
|
+
"deck:read:free",
|
|
153
|
+
"deck:read:own",
|
|
154
|
+
"deck:read:premium",
|
|
155
|
+
"deck:read:private",
|
|
156
|
+
"deck:read:unpublished",
|
|
157
|
+
"deck:delete:own",
|
|
158
|
+
"card-demand:read:*",
|
|
159
|
+
"card-demand:create",
|
|
160
|
+
"card-demand:action",
|
|
161
|
+
"study:read",
|
|
162
|
+
"study:write",
|
|
163
|
+
"library:read",
|
|
164
|
+
"library:write",
|
|
165
|
+
"library:write:premium",
|
|
166
|
+
"user:update:own",
|
|
167
|
+
"user:delete:own",
|
|
168
|
+
"user:read:own",
|
|
169
|
+
"admin-panel:view"
|
|
170
|
+
],
|
|
171
|
+
[d.Admin]: _
|
|
172
|
+
}, y = { [p.Premium]: [
|
|
173
|
+
"app:access",
|
|
174
|
+
"deck:create:own",
|
|
175
|
+
"deck:update:own",
|
|
176
|
+
"deck:read:premium",
|
|
177
|
+
"stats:view",
|
|
178
|
+
"vesty:chat",
|
|
179
|
+
"library:write:premium"
|
|
180
|
+
] }, b = (e, t, n) => {
|
|
181
|
+
if (!t) return !1;
|
|
182
|
+
if (v[t].includes(e)) return !0;
|
|
183
|
+
for (let t of n ?? []) if ((y[t] ?? []).includes(e)) return !0;
|
|
184
|
+
return !1;
|
|
185
|
+
}, x = /* @__PURE__ */ function(e) {
|
|
186
|
+
return e.Published = "published", e.Draft = "draft", e.Archived = "archived", e;
|
|
187
|
+
}({}), S = {
|
|
188
|
+
história: "quaternary",
|
|
189
|
+
geografia: "tertiary",
|
|
190
|
+
matemática: "secondary",
|
|
191
|
+
biologia: "primary",
|
|
192
|
+
física: "quinary",
|
|
193
|
+
gramática: "tertiary",
|
|
194
|
+
literatura: "secondary",
|
|
195
|
+
química: "primary",
|
|
196
|
+
filosofia: "quaternary",
|
|
197
|
+
sociologia: "quinary",
|
|
198
|
+
redação: "secondary",
|
|
199
|
+
artes: "tertiary",
|
|
200
|
+
inglês: "quinary",
|
|
201
|
+
default: "default"
|
|
202
|
+
}, C = {
|
|
203
|
+
matemática: "radical",
|
|
204
|
+
gramática: "spell-check",
|
|
205
|
+
literatura: "book-open",
|
|
206
|
+
biologia: "dna",
|
|
207
|
+
química: "test-tube-diagonal",
|
|
208
|
+
física: "atom",
|
|
209
|
+
história: "scroll",
|
|
210
|
+
geografia: "earth",
|
|
211
|
+
filosofia: "brain",
|
|
212
|
+
sociologia: "users-round",
|
|
213
|
+
redação: "notebook-pen",
|
|
214
|
+
artes: "palette",
|
|
215
|
+
inglês: "languages",
|
|
216
|
+
default: "graduation-cap"
|
|
217
|
+
}, w = (e) => C[e] || C.default, T = (e) => S[e] || S.default, E = (e) => {
|
|
218
|
+
let t = T(e);
|
|
219
|
+
return i[t === "default" ? "gray" : t].DEFAULT;
|
|
247
220
|
};
|
|
221
|
+
//#endregion
|
|
222
|
+
export { _ as ALL_PERMISSIONS, s as BlogPostStatus, l as DeckStatus, y as ENTITLEMENT_PERMISSIONS, p as Entitlement, x as EntranceExamProgramStatus, m as MembershipStatus, f as OrganizationRole, h as PERMISSIONS, g as Permission, v as ROLE_PERMISSIONS, r as ReviewRating, t as ReviewState, u as SUBJECTS, S as SUBJECT_COLORS, C as SUBJECT_ICONS, a as UNPAGINATED_SIZE, d as UserRole, c as cardDemandStatus, E as getSubjectCSSColor, T as getSubjectColor, w as getSubjectIcon, b as hasPermission, n as reviewRatings, e as reviewStates, o as unwrapApiResponse };
|