@sparkle-learning/core 0.0.53 → 0.0.54
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/cjs/{PrivateRoute-074c584e.js → PrivateRoute-e2047db2.js} +18 -30
- package/dist/cjs/{feed.service-b4f09441.js → appdata.service-d28cf2d6.js} +4 -56
- package/dist/cjs/{assets.service-0c759d51.js → assets.service-bfa75092.js} +1 -1
- package/dist/cjs/{environment-config.service-0e02b049.js → environment-config.service-c8ff1f3d.js} +0 -1
- package/dist/cjs/{facilitator.service-9e990274.js → facilitator.service-0b9f6ac7.js} +1 -1
- package/dist/cjs/feed.service-6df9382f.js +57 -0
- package/dist/cjs/header-mobile-collapse_61.cjs.entry.js +76 -87
- package/dist/cjs/{httpService-7211d93b.js → httpService-d8a5b474.js} +13 -11
- package/dist/cjs/index.cjs.js +5 -4
- package/dist/cjs/ion-select_3.cjs.entry.js +77 -68
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/media.service-2bc73d37.js +40 -0
- package/dist/cjs/{signalR.service-5672eebc.js → signalR.service-0d5da1d3.js} +18 -20
- package/dist/cjs/sparkle-animation-player.cjs.entry.js +1 -1
- package/dist/cjs/sparkle-assignment.cjs.entry.js +25 -0
- package/dist/cjs/sparkle-character-intro.cjs.entry.js +2 -2
- package/dist/cjs/sparkle-core.cjs.js +1 -1
- package/dist/cjs/sparkle-discussion-questions_2.cjs.entry.js +20 -11
- package/dist/cjs/sparkle-discussion.cjs.entry.js +6 -4
- package/dist/cjs/sparkle-facilitator-notes-form.cjs.entry.js +5 -3
- package/dist/cjs/sparkle-feedback.cjs.entry.js +5 -3
- package/dist/cjs/sparkle-goal-form.cjs.entry.js +11 -8
- package/dist/cjs/sparkle-quiz-container.cjs.entry.js +1 -1
- package/dist/cjs/sparkle-quiz-old.cjs.entry.js +120 -0
- package/dist/cjs/sparkle-quiz.cjs.entry.js +31 -48
- package/dist/cjs/{student.service-2e58f237.js → student.service-d8ec2551.js} +1 -1
- package/dist/cjs/token.service-bfb0089b.js +86 -0
- package/dist/cjs/{util-d383acb8.js → util-47e320b2.js} +2 -2
- package/dist/collection/PrivateRoute.js +2 -2
- package/dist/collection/collection-manifest.json +3 -2
- package/dist/collection/components/layout/facilitator/facilitator-page.js +2 -3
- package/dist/collection/components/layout/page/page.css +4 -0
- package/dist/collection/components/layout/page/page.js +39 -26
- package/dist/collection/components/sparkle-assignment/sparkle-assignment.css +3 -0
- package/dist/collection/components/sparkle-assignment/sparkle-assignment.js +25 -0
- package/dist/collection/components/sparkle-character-intro/sparkle-character-intro.css +8 -1
- package/dist/collection/components/sparkle-character-intro/sparkle-character-intro.js +10 -6
- package/dist/collection/components/sparkle-course-root/sparkle-course-root.js +13 -2
- package/dist/collection/components/sparkle-discussion/sparkle-discussion-questions/sparkle-discussion-questions.js +4 -2
- package/dist/collection/components/sparkle-discussion/sparkle-discussion-results/sparkle-discussion-results.js +15 -9
- package/dist/collection/components/sparkle-discussion/sparkle-discussion.css +5 -0
- package/dist/collection/components/sparkle-discussion/sparkle-discussion.js +5 -3
- package/dist/collection/components/sparkle-feed-post/sparkle-feed-post.js +54 -67
- package/dist/collection/components/sparkle-login/sparkle-login.js +2 -1
- package/dist/collection/components/sparkle-quiz/{sparkle-quiz/sparkle-quiz.css → sparkle-quiz-old/sparkle-quiz-old.css} +1 -1
- package/dist/collection/components/sparkle-quiz/{sparkle-quiz/sparkle-quiz.js → sparkle-quiz-old/sparkle-quiz-old.js} +4 -4
- package/dist/collection/components/sparkle-quiz/{sparkle-quiz-v1.js → sparkle-quiz.js} +23 -25
- package/dist/collection/components/sparkle-quiz-container/sparkle-quiz-container.js +1 -1
- package/dist/collection/components/sparkle-root/sparkle-root.js +12 -10
- package/dist/collection/services/assignment.service.js +14 -0
- package/dist/collection/services/auth/auth.service.js +15 -14
- package/dist/collection/services/environment/environment-config.js +1 -1
- package/dist/collection/services/environment/environment-config.service.js +0 -1
- package/dist/collection/services/httpService.js +12 -10
- package/dist/collection/services/signalR.service.js +17 -19
- package/dist/collection/services/token.service.js +68 -0
- package/dist/collection/util.js +5 -2
- package/dist/esm/{PrivateRoute-c5441f35.js → PrivateRoute-c6e80d5d.js} +17 -29
- package/dist/esm/{feed.service-8fbe4ce3.js → appdata.service-d1058e00.js} +5 -55
- package/dist/esm/{assets.service-66e848b8.js → assets.service-def1d63c.js} +1 -1
- package/dist/esm/{environment-config.service-2b5d692b.js → environment-config.service-b191f276.js} +0 -1
- package/dist/esm/{facilitator.service-b0292f7f.js → facilitator.service-53e05a01.js} +1 -1
- package/dist/esm/feed.service-8385ad7a.js +54 -0
- package/dist/esm/header-mobile-collapse_61.entry.js +70 -81
- package/dist/esm/{httpService-7b75b095.js → httpService-db476835.js} +13 -11
- package/dist/esm/index.js +5 -4
- package/dist/esm/ion-select_3.entry.js +77 -68
- package/dist/esm/loader.js +1 -1
- package/dist/esm/media.service-b68cbfff.js +37 -0
- package/dist/esm/{signalR.service-9d5b9f36.js → signalR.service-4a2d5a92.js} +18 -20
- package/dist/esm/sparkle-animation-player.entry.js +1 -1
- package/dist/esm/sparkle-assignment.entry.js +21 -0
- package/dist/esm/sparkle-character-intro.entry.js +3 -3
- package/dist/esm/sparkle-core.js +1 -1
- package/dist/esm/sparkle-discussion-questions_2.entry.js +20 -11
- package/dist/esm/sparkle-discussion.entry.js +6 -4
- package/dist/esm/sparkle-facilitator-notes-form.entry.js +5 -3
- package/dist/esm/sparkle-feedback.entry.js +5 -3
- package/dist/esm/sparkle-goal-form.entry.js +8 -5
- package/dist/esm/sparkle-quiz-container.entry.js +1 -1
- package/dist/esm/sparkle-quiz-old.entry.js +116 -0
- package/dist/esm/sparkle-quiz.entry.js +31 -48
- package/dist/esm/{student.service-0746418b.js → student.service-6457aaa0.js} +1 -1
- package/dist/esm/token.service-20f1a256.js +83 -0
- package/dist/esm/{util-6ef753e9.js → util-57cc8006.js} +2 -2
- package/dist/sparkle-core/index.esm.js +1 -1
- package/dist/sparkle-core/p-11ac00b0.js +1 -0
- package/dist/sparkle-core/p-13ec39db.entry.js +1 -0
- package/dist/sparkle-core/{p-5efc6566.js → p-17b6b07e.js} +1 -1
- package/dist/sparkle-core/p-33a7151d.entry.js +1 -0
- package/dist/sparkle-core/{p-fbccd30c.js → p-38f707fb.js} +1 -1
- package/dist/sparkle-core/p-38fa5987.js +1 -0
- package/dist/sparkle-core/{p-9a443f51.js → p-408176ba.js} +1 -1
- package/dist/sparkle-core/p-630a4fa0.js +1 -0
- package/dist/sparkle-core/{p-0a5d7c4f.entry.js → p-6a1fc0af.entry.js} +26 -26
- package/dist/sparkle-core/p-6fab3a4b.js +1 -0
- package/dist/sparkle-core/p-71720d6e.entry.js +1 -0
- package/dist/sparkle-core/{p-162bff1a.entry.js → p-72053ae0.entry.js} +1 -1
- package/dist/sparkle-core/{p-18cdd458.entry.js → p-85d4cd5c.entry.js} +1 -1
- package/dist/sparkle-core/p-967a2ed7.js +1 -0
- package/dist/sparkle-core/{p-ff0e0d4e.entry.js → p-98daeddb.entry.js} +1 -1
- package/dist/sparkle-core/p-98f7780c.entry.js +1 -0
- package/dist/sparkle-core/p-bd90903e.js +1 -0
- package/dist/sparkle-core/{p-a49ab4e8.entry.js → p-c64a34cd.entry.js} +1 -1
- package/dist/sparkle-core/{p-44334ef3.entry.js → p-ca907214.entry.js} +2 -2
- package/dist/sparkle-core/p-d51f30ca.js +1 -0
- package/dist/sparkle-core/p-dcff298d.entry.js +1 -0
- package/dist/sparkle-core/p-e50c8b04.entry.js +1 -0
- package/dist/sparkle-core/p-ed9de327.js +1 -0
- package/dist/sparkle-core/p-f891c79a.entry.js +1 -0
- package/dist/sparkle-core/sparkle-core.esm.js +1 -1
- package/dist/types/components/layout/page/page.d.ts +2 -0
- package/dist/types/components/sparkle-assignment/sparkle-assignment.d.ts +6 -0
- package/dist/types/components/sparkle-course-root/sparkle-course-root.d.ts +1 -0
- package/dist/types/components/sparkle-feed-post/sparkle-feed-post.d.ts +3 -2
- package/dist/types/components/sparkle-quiz/{sparkle-quiz/sparkle-quiz.d.ts → sparkle-quiz-old/sparkle-quiz-old.d.ts} +1 -1
- package/dist/types/components/sparkle-quiz/{sparkle-quiz-v1.d.ts → sparkle-quiz.d.ts} +1 -1
- package/dist/types/components.d.ts +49 -36
- package/dist/types/models/class.model.d.ts +4 -0
- package/dist/types/services/assignment.service.d.ts +8 -0
- package/dist/types/services/auth/auth.service.d.ts +1 -1
- package/dist/types/services/environment/environment-config.d.ts +3 -0
- package/dist/types/services/token.service.d.ts +12 -0
- package/dist/types/util.d.ts +1 -0
- package/package.json +1 -1
- package/dist/cjs/sparkle-quiz-v1.cjs.entry.js +0 -105
- package/dist/esm/sparkle-quiz-v1.entry.js +0 -101
- package/dist/sparkle-core/p-1d4c7c11.js +0 -1
- package/dist/sparkle-core/p-30767c1c.entry.js +0 -1
- package/dist/sparkle-core/p-3265ed87.entry.js +0 -1
- package/dist/sparkle-core/p-370609ba.entry.js +0 -1
- package/dist/sparkle-core/p-462bffba.js +0 -1
- package/dist/sparkle-core/p-4c9f994f.js +0 -1
- package/dist/sparkle-core/p-58e4bbe5.entry.js +0 -1
- package/dist/sparkle-core/p-600cf6a3.js +0 -1
- package/dist/sparkle-core/p-80d6b0e6.entry.js +0 -1
- package/dist/sparkle-core/p-af3cc111.entry.js +0 -1
- package/dist/sparkle-core/p-b226f54d.js +0 -1
- /package/dist/collection/components/sparkle-quiz/{sparkle-quiz-v1.css → sparkle-quiz.css} +0 -0
- /package/dist/sparkle-core/{p-935e7cfc.js → p-8b56f734.js} +0 -0
@@ -2,7 +2,8 @@
|
|
2
2
|
|
3
3
|
const index = require('./index-51e8292e.js');
|
4
4
|
const localstorage_service = require('./localstorage.service-6346a41d.js');
|
5
|
-
const httpService = require('./httpService-
|
5
|
+
const httpService = require('./httpService-d8a5b474.js');
|
6
|
+
const token_service = require('./token.service-bfb0089b.js');
|
6
7
|
const auth_store = require('./auth.store-1e630a7d.js');
|
7
8
|
|
8
9
|
//import * as abpTypings from '../lib/abp';
|
@@ -121,19 +122,6 @@ async function initSetupConfig(config) {
|
|
121
122
|
await setupConfig(config);
|
122
123
|
}
|
123
124
|
|
124
|
-
const AppConsts = {
|
125
|
-
AUTH_USER_LOCALSTORAGE: "CurrentUser",
|
126
|
-
userManagement: {
|
127
|
-
defaultAdminUserName: 'admin',
|
128
|
-
},
|
129
|
-
localization: {
|
130
|
-
defaultLocalizationSourceName: 'Test',
|
131
|
-
},
|
132
|
-
authorization: {
|
133
|
-
encrptedAuthTokenName: 'enc_auth_token',
|
134
|
-
}
|
135
|
-
};
|
136
|
-
|
137
125
|
class AuthService {
|
138
126
|
constructor() { }
|
139
127
|
static getInstance() {
|
@@ -150,7 +138,7 @@ class AuthService {
|
|
150
138
|
let result;
|
151
139
|
try {
|
152
140
|
result = await httpService.HttpService.http.post('api/Account/Authenticate', authenticationInput, {
|
153
|
-
headers: headers
|
141
|
+
headers: headers,
|
154
142
|
});
|
155
143
|
if (result) {
|
156
144
|
const authData = result.Data;
|
@@ -164,15 +152,17 @@ class AuthService {
|
|
164
152
|
IssuedOn: authData.IssuedOn,
|
165
153
|
ExpiresOn: authData.ExpiresOn,
|
166
154
|
RefreshToken: authData.RefreshToken,
|
167
|
-
PhotoUrl:
|
168
|
-
IsFacilitator: authData.Roles.indexOf(
|
155
|
+
PhotoUrl: '',
|
156
|
+
IsFacilitator: authData.Roles.indexOf('Facilitator') > 0,
|
169
157
|
};
|
170
|
-
const expireDate = authenticationInput.RememberClient ? new Date(authUser.ExpiresOn) : undefined;
|
171
|
-
|
172
|
-
//
|
173
|
-
|
174
|
-
|
175
|
-
|
158
|
+
//const expireDate = authenticationInput.RememberClient ? new Date(authUser.ExpiresOn) : undefined;
|
159
|
+
// let authObj: EnvironmentAuthConfig = {
|
160
|
+
// token: authUser.JWToken,
|
161
|
+
// expiryDate: expireDate,
|
162
|
+
// };
|
163
|
+
// EnvironmentConfigService.getInstance().setupAuth(authObj);
|
164
|
+
//sparkle.utils.setCookieValue(AppConsts.authorization.encrptedAuthTokenName, authUser.JWToken, expireDate, sparkle.appPath);
|
165
|
+
await token_service.TokenService.getInstance().saveAuthUser(authUser);
|
176
166
|
auth_store.AuthStore.state.loading = false;
|
177
167
|
return authUser;
|
178
168
|
}
|
@@ -183,14 +173,12 @@ class AuthService {
|
|
183
173
|
}
|
184
174
|
}
|
185
175
|
async signOut() {
|
186
|
-
await localstorage_service.remove(AppConsts.AUTH_USER_LOCALSTORAGE);
|
176
|
+
await localstorage_service.remove(token_service.AppConsts.AUTH_USER_LOCALSTORAGE);
|
177
|
+
await token_service.TokenService.getInstance().removeAuthUser();
|
187
178
|
sessionStorage.clear();
|
188
|
-
sparkle.auth.clearToken();
|
189
|
-
auth_store.AuthStore.state.authUser = null;
|
190
|
-
auth_store.AuthStore.state.isAuthenticated = false;
|
191
179
|
}
|
192
180
|
async getLocalAuthUser() {
|
193
|
-
return localstorage_service.get(AppConsts.AUTH_USER_LOCALSTORAGE);
|
181
|
+
return localstorage_service.get(token_service.AppConsts.AUTH_USER_LOCALSTORAGE);
|
194
182
|
}
|
195
183
|
}
|
196
184
|
|
@@ -214,9 +202,9 @@ const Route = (_a) => {
|
|
214
202
|
const Component = component;
|
215
203
|
return (index.h("stencil-route", Object.assign({}, props, { routeRender: (props) => {
|
216
204
|
if (!auth_store.AuthStore.state.isAuthenticated)
|
217
|
-
return
|
205
|
+
return index.h("stencil-router-redirect", { url: "/login" });
|
218
206
|
if (permission && !isGranted(permission)) {
|
219
|
-
return
|
207
|
+
return index.h("stencil-router-redirect", { url: "/unauthorized" });
|
220
208
|
}
|
221
209
|
return Component ? index.h(Component, Object.assign({}, props, props.componentProps)) : render(props);
|
222
210
|
} })));
|
@@ -1,15 +1,15 @@
|
|
1
1
|
'use strict';
|
2
2
|
|
3
|
-
const httpService = require('./httpService-
|
3
|
+
const httpService = require('./httpService-d8a5b474.js');
|
4
4
|
const auth_store = require('./auth.store-1e630a7d.js');
|
5
|
-
const util = require('./util-
|
5
|
+
const util = require('./util-47e320b2.js');
|
6
6
|
|
7
|
-
const { state
|
7
|
+
const { state, onChange } = auth_store.createStore({
|
8
8
|
goals: [],
|
9
9
|
goalsLoading: false,
|
10
10
|
goalLoading: false
|
11
11
|
});
|
12
|
-
const goalStore = { state
|
12
|
+
const goalStore = { state, onChange };
|
13
13
|
|
14
14
|
class AppDataService {
|
15
15
|
constructor() { }
|
@@ -69,57 +69,5 @@ class AppDataService {
|
|
69
69
|
}
|
70
70
|
}
|
71
71
|
|
72
|
-
const { state, reset } = auth_store.createStore({
|
73
|
-
posts: [],
|
74
|
-
postsLoading: false,
|
75
|
-
createPostLoading: false,
|
76
|
-
postIdLoading: null
|
77
|
-
});
|
78
|
-
const feedStore = { state, reset };
|
79
|
-
|
80
|
-
class FeedService {
|
81
|
-
constructor() { }
|
82
|
-
static getInstance() {
|
83
|
-
if (!FeedService.instance) {
|
84
|
-
FeedService.instance = new FeedService();
|
85
|
-
}
|
86
|
-
return FeedService.instance;
|
87
|
-
}
|
88
|
-
async getAllPosts() {
|
89
|
-
feedStore.state.postsLoading = true;
|
90
|
-
let result = await httpService.HttpService.http.get(`api/v1/Feed/GetAll`);
|
91
|
-
if (result) {
|
92
|
-
feedStore.state.posts = result.Data;
|
93
|
-
feedStore.state.postsLoading = false;
|
94
|
-
}
|
95
|
-
return result;
|
96
|
-
}
|
97
|
-
async createPost(payload) {
|
98
|
-
feedStore.state.createPostLoading = true;
|
99
|
-
let result = await httpService.HttpService.http.post(`api/v1/Feed/PostFeed`, payload);
|
100
|
-
if (result) {
|
101
|
-
feedStore.state.posts = [result.Data, ...feedStore.state.posts];
|
102
|
-
feedStore.state.createPostLoading = false;
|
103
|
-
}
|
104
|
-
return result;
|
105
|
-
}
|
106
|
-
async createPostComment(payload) {
|
107
|
-
feedStore.state.postIdLoading = payload.PostId;
|
108
|
-
let result = await httpService.HttpService.http.post(`api/v1/Feed/Comment`, payload);
|
109
|
-
if (result) {
|
110
|
-
feedStore.state.posts = feedStore.state.posts.map((item) => {
|
111
|
-
if (item.Id == result.Data.ClassFeedPostId) {
|
112
|
-
return Object.assign(Object.assign({}, item), { Comments: [...item.Comments, result.Data] });
|
113
|
-
}
|
114
|
-
return item;
|
115
|
-
});
|
116
|
-
feedStore.state.postIdLoading = null;
|
117
|
-
}
|
118
|
-
return result;
|
119
|
-
}
|
120
|
-
}
|
121
|
-
|
122
72
|
exports.AppDataService = AppDataService;
|
123
|
-
exports.FeedService = FeedService;
|
124
|
-
exports.feedStore = feedStore;
|
125
73
|
exports.goalStore = goalStore;
|
@@ -0,0 +1,57 @@
|
|
1
|
+
'use strict';
|
2
|
+
|
3
|
+
const httpService = require('./httpService-d8a5b474.js');
|
4
|
+
const auth_store = require('./auth.store-1e630a7d.js');
|
5
|
+
|
6
|
+
const { state, reset } = auth_store.createStore({
|
7
|
+
posts: [],
|
8
|
+
postsLoading: false,
|
9
|
+
createPostLoading: false,
|
10
|
+
postIdLoading: null
|
11
|
+
});
|
12
|
+
const feedStore = { state, reset };
|
13
|
+
|
14
|
+
class FeedService {
|
15
|
+
constructor() { }
|
16
|
+
static getInstance() {
|
17
|
+
if (!FeedService.instance) {
|
18
|
+
FeedService.instance = new FeedService();
|
19
|
+
}
|
20
|
+
return FeedService.instance;
|
21
|
+
}
|
22
|
+
async getAllPosts() {
|
23
|
+
feedStore.state.postsLoading = true;
|
24
|
+
let result = await httpService.HttpService.http.get(`api/v1/Feed/GetAll`);
|
25
|
+
if (result) {
|
26
|
+
feedStore.state.posts = result.Data;
|
27
|
+
feedStore.state.postsLoading = false;
|
28
|
+
}
|
29
|
+
return result;
|
30
|
+
}
|
31
|
+
async createPost(payload) {
|
32
|
+
feedStore.state.createPostLoading = true;
|
33
|
+
let result = await httpService.HttpService.http.post(`api/v1/Feed/PostFeed`, payload);
|
34
|
+
if (result) {
|
35
|
+
feedStore.state.posts = [result.Data, ...feedStore.state.posts];
|
36
|
+
feedStore.state.createPostLoading = false;
|
37
|
+
}
|
38
|
+
return result;
|
39
|
+
}
|
40
|
+
async createPostComment(payload) {
|
41
|
+
feedStore.state.postIdLoading = payload.PostId;
|
42
|
+
let result = await httpService.HttpService.http.post(`api/v1/Feed/Comment`, payload);
|
43
|
+
if (result) {
|
44
|
+
feedStore.state.posts = feedStore.state.posts.map((item) => {
|
45
|
+
if (item.Id == result.Data.ClassFeedPostId) {
|
46
|
+
return Object.assign(Object.assign({}, item), { Comments: [...item.Comments, result.Data] });
|
47
|
+
}
|
48
|
+
return item;
|
49
|
+
});
|
50
|
+
feedStore.state.postIdLoading = null;
|
51
|
+
}
|
52
|
+
return result;
|
53
|
+
}
|
54
|
+
}
|
55
|
+
|
56
|
+
exports.FeedService = FeedService;
|
57
|
+
exports.feedStore = feedStore;
|