@capytale/activity.js 3.1.10 → 3.1.11

Sign up to get free protection for your applications and to get access to all the features.
@@ -15,11 +15,18 @@ export type ActivityType = {
15
15
  description: string;
16
16
  tags?: string;
17
17
  bundle: string;
18
+ /** Si ce type d'activité est disponible pour l'utilisateur courant. */
18
19
  available: boolean;
20
+ /** Indique que ce type d'activité est remplacé. */
19
21
  replacedBy?: string | null;
22
+ /** Ce type d'activité devrait être filtré en même temps que celui indiqué. */
20
23
  filterWith?: string | null;
24
+ /** Si ce type d'activité produit des évaluations détaillées. */
21
25
  detailedEvaluation: boolean;
26
+ /** Si ce type d'activité est exportable. */
22
27
  exportable: boolean;
28
+ /** Si ce type d'activité est compatible lti. */
29
+ lti: boolean;
23
30
  };
24
31
  export type ActivityGroup = {
25
32
  title: string;
@@ -1 +1 @@
1
- {"version":3,"file":"activityType.js","sourceRoot":"","sources":["../../src/activity/activityType/activityType.ts"],"names":[],"mappings":"","sourcesContent":["export type ActivityType = {\n id: string;\n name: string;\n status?: { beta?: boolean };\n icon: {\n path: string;\n style?: { [s: string]: string };\n };\n helpUrl: string;\n summary: string;\n description: string;\n tags?: string;\n bundle: string;\n available: boolean;\n replacedBy?: string | null;\n filterWith?: string | null;\n detailedEvaluation: boolean;\n exportable: boolean;\n}\n\nexport type ActivityGroup = {\n title: string;\n tooltip?: string;\n activities: string[];\n};\n\nexport type ActivityGroups = {\n [key: string]: ActivityGroup;\n};\n\nexport type ActivityWeights = {\n all: { [key: string]: number };\n niveaux: {\n [key: string]: {\n title: string;\n activities: { [key: string]: number }\n }\n };\n groups: ActivityGroups;\n};\n"]}
1
+ {"version":3,"file":"activityType.js","sourceRoot":"","sources":["../../src/activity/activityType/activityType.ts"],"names":[],"mappings":"","sourcesContent":["export type ActivityType = {\n id: string;\n name: string;\n status?: { beta?: boolean };\n icon: {\n path: string;\n style?: { [s: string]: string };\n };\n helpUrl: string;\n summary: string;\n description: string;\n tags?: string;\n bundle: string;\n /** Si ce type d'activité est disponible pour l'utilisateur courant. */\n available: boolean;\n /** Indique que ce type d'activité est remplacé. */\n replacedBy?: string | null;\n /** Ce type d'activité devrait être filtré en même temps que celui indiqué. */\n filterWith?: string | null;\n /** Si ce type d'activité produit des évaluations détaillées. */\n detailedEvaluation: boolean;\n /** Si ce type d'activité est exportable. */\n exportable: boolean;\n /** Si ce type d'activité est compatible lti. */\n lti: boolean;\n}\n\nexport type ActivityGroup = {\n title: string;\n tooltip?: string;\n activities: string[];\n};\n\nexport type ActivityGroups = {\n [key: string]: ActivityGroup;\n};\n\nexport type ActivityWeights = {\n all: { [key: string]: number };\n niveaux: {\n [key: string]: {\n title: string;\n activities: { [key: string]: number }\n }\n };\n groups: ActivityGroups;\n};\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@capytale/activity.js",
3
- "version": "3.1.10",
3
+ "version": "3.1.11",
4
4
  "bin": {
5
5
  "cactjs": "./bin/cactjs.js"
6
6
  },
@@ -0,0 +1,4 @@
1
+ export default function createSignal(): [
2
+ trigger: () => void,
3
+ watch: (callback: () => void, imediate?: boolean) => () => void
4
+ ];
package/util/signal.js ADDED
@@ -0,0 +1,26 @@
1
+ function safeInvoque(callback) {
2
+ try {
3
+ callback();
4
+ }
5
+ catch (error) {
6
+ console.error(error);
7
+ }
8
+ }
9
+ export default function createSignal() {
10
+ let watchers = [];
11
+ return [
12
+ () => {
13
+ for (const watcher of watchers)
14
+ safeInvoque(watcher);
15
+ },
16
+ (callback, imediate = false) => {
17
+ watchers.push(callback);
18
+ if (imediate)
19
+ safeInvoque(callback);
20
+ return () => {
21
+ watchers = watchers.filter((watcher) => watcher !== callback);
22
+ };
23
+ }
24
+ ];
25
+ }
26
+ //# sourceMappingURL=signal.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"signal.js","sourceRoot":"","sources":["../src/util/signal.ts"],"names":[],"mappings":"AAAA,SAAS,WAAW,CAAC,QAAoB;IACrC,IAAI,CAAC;QACD,QAAQ,EAAE,CAAC;IACf,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACb,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IACzB,CAAC;AACL,CAAC;AAED,MAAM,CAAC,OAAO,UAAU,YAAY;IAIhC,IAAI,QAAQ,GAAmB,EAAE,CAAC;IAClC,OAAO;QACH,GAAG,EAAE;YACD,KAAK,MAAM,OAAO,IAAI,QAAQ;gBAAE,WAAW,CAAC,OAAO,CAAC,CAAC;QACzD,CAAC;QACD,CAAC,QAAQ,EAAE,QAAQ,GAAG,KAAK,EAAE,EAAE;YAC3B,QAAQ,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;YACxB,IAAI,QAAQ;gBAAE,WAAW,CAAC,QAAQ,CAAC,CAAC;YACpC,OAAO,GAAG,EAAE;gBACR,QAAQ,GAAG,QAAQ,CAAC,MAAM,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,KAAK,QAAQ,CAAC,CAAC;YAClE,CAAC,CAAC;QACN,CAAC;KACJ,CAAC;AACN,CAAC","sourcesContent":["function safeInvoque(callback: () => void) {\n try {\n callback();\n } catch (error) {\n console.error(error);\n }\n}\n\nexport default function createSignal(): [\n trigger: () => void,\n watch: (callback: () => void, imediate?: boolean) => () => void\n] {\n let watchers: (() => void)[] = [];\n return [\n () => {\n for (const watcher of watchers) safeInvoque(watcher);\n },\n (callback, imediate = false) => {\n watchers.push(callback);\n if (imediate) safeInvoque(callback);\n return () => {\n watchers = watchers.filter((watcher) => watcher !== callback);\n };\n }\n ];\n}"]}