@burdenoff/microfe-technospam 2026.1101.1 → 2026.1101.2
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/stories/journeys/Problems.stories.d.ts.map +1 -1
- package/dist/technospam/api/technospamApi.d.ts +15 -0
- package/dist/technospam/api/technospamApi.d.ts.map +1 -1
- package/dist/technospam/api/technospamApi.js +200 -151
- package/dist/technospam/api/technospamApi.js.map +1 -1
- package/dist/technospam/components/ProblemsTable.d.ts +19 -0
- package/dist/technospam/components/ProblemsTable.d.ts.map +1 -0
- package/dist/technospam/components/ProblemsTable.js +117 -0
- package/dist/technospam/components/ProblemsTable.js.map +1 -0
- package/dist/technospam/components/index.d.ts +1 -0
- package/dist/technospam/components/index.d.ts.map +1 -1
- package/dist/technospam/components/index.js +2 -1
- package/dist/technospam/pages/ApplicationsProblemDetailsPagePage.js +38 -38
- package/dist/technospam/pages/ApplicationsProblemDetailsPagePage.js.map +1 -1
- package/dist/technospam/pages/ApplicationsProblemsPagePage.d.ts.map +1 -1
- package/dist/technospam/pages/ApplicationsProblemsPagePage.js +197 -144
- package/dist/technospam/pages/ApplicationsProblemsPagePage.js.map +1 -1
- package/dist/technospam/pages/CoursesCourseDetailsPagePage.js +195 -195
- package/dist/technospam/pages/CoursesCourseDetailsPagePage.js.map +1 -1
- package/dist/technospam/pages/CoursesCoursesPagePage.js +26 -26
- package/dist/technospam/pages/CoursesLessonPlayerPagePage.js +36 -36
- package/dist/technospam/pages/CoursesLessonPlayerPagePage.js.map +1 -1
- package/dist/technospam/utils/problemCatalog.d.ts +27 -0
- package/dist/technospam/utils/problemCatalog.d.ts.map +1 -0
- package/dist/technospam/utils/problemCatalog.js +68 -0
- package/dist/technospam/utils/problemCatalog.js.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Display helpers for the practice problem catalog table (BOFF-4077).
|
|
3
|
+
*
|
|
4
|
+
* `TecProblem.languages` stores lowercase language slugs (see the svc's
|
|
5
|
+
* `normalizeLanguage`), several of which are aliases of one language
|
|
6
|
+
* (`javascript`/`node`, `python`/`python3`, `bash`/`sh`). The catalog's
|
|
7
|
+
* Languages column shows the short labels from the mock ("JS, Py, Java"),
|
|
8
|
+
* so aliases collapse to one label and the original order is preserved.
|
|
9
|
+
*/
|
|
10
|
+
/** Short display label for one language slug; unknown slugs are title-cased. */
|
|
11
|
+
export declare function languageLabel(slug: string): string;
|
|
12
|
+
/** Distinct short labels for a problem's languages, in their stored order. */
|
|
13
|
+
export declare function languageLabels(slugs: readonly string[]): string[];
|
|
14
|
+
/** The catalog's two layouts: the mock's data table, or the original card grid. */
|
|
15
|
+
export type ProblemCatalogView = 'table' | 'cards';
|
|
16
|
+
export declare const PROBLEM_CATALOG_VIEW_STORAGE_KEY = "technospam.problems.view";
|
|
17
|
+
/**
|
|
18
|
+
* Read the viewer's remembered catalog layout. Storage can be missing or throw
|
|
19
|
+
* (private windows, blocked site data), so anything unexpected falls back to
|
|
20
|
+
* the table, which is the mock's default layout.
|
|
21
|
+
*/
|
|
22
|
+
export declare function readProblemCatalogView(storage: Pick<Storage, 'getItem'> | null | undefined): ProblemCatalogView;
|
|
23
|
+
/** Remember the viewer's catalog layout; storage failures are ignored. */
|
|
24
|
+
export declare function writeProblemCatalogView(storage: Pick<Storage, 'setItem'> | null | undefined, view: ProblemCatalogView): void;
|
|
25
|
+
/** The browser's localStorage, or null where accessing it throws. */
|
|
26
|
+
export declare function safeLocalStorage(): Storage | null;
|
|
27
|
+
//# sourceMappingURL=problemCatalog.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"problemCatalog.d.ts","sourceRoot":"","sources":["../../../src/technospam/utils/problemCatalog.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAkCH,gFAAgF;AAChF,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAUlD;AAED,8EAA8E;AAC9E,wBAAgB,cAAc,CAAC,KAAK,EAAE,SAAS,MAAM,EAAE,GAAG,MAAM,EAAE,CAWjE;AAED,mFAAmF;AACnF,MAAM,MAAM,kBAAkB,GAAG,OAAO,GAAG,OAAO,CAAC;AAEnD,eAAO,MAAM,gCAAgC,6BAA6B,CAAC;AAE3E;;;;GAIG;AACH,wBAAgB,sBAAsB,CACpC,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,SAAS,CAAC,GAAG,IAAI,GAAG,SAAS,GACnD,kBAAkB,CAOpB;AAED,0EAA0E;AAC1E,wBAAgB,uBAAuB,CACrC,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,SAAS,CAAC,GAAG,IAAI,GAAG,SAAS,EACpD,IAAI,EAAE,kBAAkB,GACvB,IAAI,CAMN;AAED,qEAAqE;AACrE,wBAAgB,gBAAgB,IAAI,OAAO,GAAG,IAAI,CAMjD"}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
//#region src/technospam/utils/problemCatalog.ts
|
|
2
|
+
var e = Object.freeze({
|
|
3
|
+
javascript: "JS",
|
|
4
|
+
js: "JS",
|
|
5
|
+
node: "JS",
|
|
6
|
+
nodejs: "JS",
|
|
7
|
+
typescript: "TS",
|
|
8
|
+
ts: "TS",
|
|
9
|
+
python: "Py",
|
|
10
|
+
python3: "Py",
|
|
11
|
+
py: "Py",
|
|
12
|
+
java: "Java",
|
|
13
|
+
cpp: "C++",
|
|
14
|
+
"c++": "C++",
|
|
15
|
+
c: "C",
|
|
16
|
+
csharp: "C#",
|
|
17
|
+
"c#": "C#",
|
|
18
|
+
cs: "C#",
|
|
19
|
+
go: "Go",
|
|
20
|
+
golang: "Go",
|
|
21
|
+
rust: "Rust",
|
|
22
|
+
ruby: "Ruby",
|
|
23
|
+
rb: "Ruby",
|
|
24
|
+
kotlin: "Kotlin",
|
|
25
|
+
swift: "Swift",
|
|
26
|
+
php: "PHP",
|
|
27
|
+
scala: "Scala",
|
|
28
|
+
sql: "SQL",
|
|
29
|
+
bash: "Bash",
|
|
30
|
+
sh: "Bash",
|
|
31
|
+
shell: "Bash"
|
|
32
|
+
});
|
|
33
|
+
function t(t) {
|
|
34
|
+
let n = t.trim().toLowerCase();
|
|
35
|
+
return n ? e[n] || n.split(/[-_\s]+/).filter(Boolean).map((e) => e.charAt(0).toUpperCase() + e.slice(1)).join(" ") : "";
|
|
36
|
+
}
|
|
37
|
+
function n(e) {
|
|
38
|
+
let n = /* @__PURE__ */ new Set(), r = [];
|
|
39
|
+
for (let i of e) {
|
|
40
|
+
let e = t(i);
|
|
41
|
+
e && !n.has(e) && (n.add(e), r.push(e));
|
|
42
|
+
}
|
|
43
|
+
return r;
|
|
44
|
+
}
|
|
45
|
+
var r = "technospam.problems.view";
|
|
46
|
+
function i(e) {
|
|
47
|
+
try {
|
|
48
|
+
return e?.getItem("technospam.problems.view") === "cards" ? "cards" : "table";
|
|
49
|
+
} catch {
|
|
50
|
+
return "table";
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
function a(e, t) {
|
|
54
|
+
try {
|
|
55
|
+
e?.setItem(r, t);
|
|
56
|
+
} catch {}
|
|
57
|
+
}
|
|
58
|
+
function o() {
|
|
59
|
+
try {
|
|
60
|
+
return typeof window > "u" ? null : window.localStorage;
|
|
61
|
+
} catch {
|
|
62
|
+
return null;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
//#endregion
|
|
66
|
+
export { n as languageLabels, i as readProblemCatalogView, o as safeLocalStorage, a as writeProblemCatalogView };
|
|
67
|
+
|
|
68
|
+
//# sourceMappingURL=problemCatalog.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"problemCatalog.js","names":[],"sources":["../../../src/technospam/utils/problemCatalog.ts"],"sourcesContent":["/**\n * Display helpers for the practice problem catalog table (BOFF-4077).\n *\n * `TecProblem.languages` stores lowercase language slugs (see the svc's\n * `normalizeLanguage`), several of which are aliases of one language\n * (`javascript`/`node`, `python`/`python3`, `bash`/`sh`). The catalog's\n * Languages column shows the short labels from the mock (\"JS, Py, Java\"),\n * so aliases collapse to one label and the original order is preserved.\n */\n\nconst LANGUAGE_LABELS: Readonly<Record<string, string>> = Object.freeze({\n javascript: 'JS',\n js: 'JS',\n node: 'JS',\n nodejs: 'JS',\n typescript: 'TS',\n ts: 'TS',\n python: 'Py',\n python3: 'Py',\n py: 'Py',\n java: 'Java',\n cpp: 'C++',\n 'c++': 'C++',\n c: 'C',\n csharp: 'C#',\n 'c#': 'C#',\n cs: 'C#',\n go: 'Go',\n golang: 'Go',\n rust: 'Rust',\n ruby: 'Ruby',\n rb: 'Ruby',\n kotlin: 'Kotlin',\n swift: 'Swift',\n php: 'PHP',\n scala: 'Scala',\n sql: 'SQL',\n bash: 'Bash',\n sh: 'Bash',\n shell: 'Bash',\n});\n\n/** Short display label for one language slug; unknown slugs are title-cased. */\nexport function languageLabel(slug: string): string {\n const key = slug.trim().toLowerCase();\n if (!key) return '';\n const known = LANGUAGE_LABELS[key];\n if (known) return known;\n return key\n .split(/[-_\\s]+/)\n .filter(Boolean)\n .map((part) => part.charAt(0).toUpperCase() + part.slice(1))\n .join(' ');\n}\n\n/** Distinct short labels for a problem's languages, in their stored order. */\nexport function languageLabels(slugs: readonly string[]): string[] {\n const seen = new Set<string>();\n const labels: string[] = [];\n for (const slug of slugs) {\n const label = languageLabel(slug);\n if (label && !seen.has(label)) {\n seen.add(label);\n labels.push(label);\n }\n }\n return labels;\n}\n\n/** The catalog's two layouts: the mock's data table, or the original card grid. */\nexport type ProblemCatalogView = 'table' | 'cards';\n\nexport const PROBLEM_CATALOG_VIEW_STORAGE_KEY = 'technospam.problems.view';\n\n/**\n * Read the viewer's remembered catalog layout. Storage can be missing or throw\n * (private windows, blocked site data), so anything unexpected falls back to\n * the table, which is the mock's default layout.\n */\nexport function readProblemCatalogView(\n storage: Pick<Storage, 'getItem'> | null | undefined\n): ProblemCatalogView {\n try {\n const value = storage?.getItem(PROBLEM_CATALOG_VIEW_STORAGE_KEY);\n return value === 'cards' ? 'cards' : 'table';\n } catch {\n return 'table';\n }\n}\n\n/** Remember the viewer's catalog layout; storage failures are ignored. */\nexport function writeProblemCatalogView(\n storage: Pick<Storage, 'setItem'> | null | undefined,\n view: ProblemCatalogView\n): void {\n try {\n storage?.setItem(PROBLEM_CATALOG_VIEW_STORAGE_KEY, view);\n } catch {\n // A blocked or full storage only loses the preference; the page still works.\n }\n}\n\n/** The browser's localStorage, or null where accessing it throws. */\nexport function safeLocalStorage(): Storage | null {\n try {\n return typeof window === 'undefined' ? null : window.localStorage;\n } catch {\n return null;\n }\n}\n"],"mappings":";AAUA,IAAM,IAAoD,OAAO,OAAO;CACtE,YAAY;CACZ,IAAI;CACJ,MAAM;CACN,QAAQ;CACR,YAAY;CACZ,IAAI;CACJ,QAAQ;CACR,SAAS;CACT,IAAI;CACJ,MAAM;CACN,KAAK;CACL,OAAO;CACP,GAAG;CACH,QAAQ;CACR,MAAM;CACN,IAAI;CACJ,IAAI;CACJ,QAAQ;CACR,MAAM;CACN,MAAM;CACN,IAAI;CACJ,QAAQ;CACR,OAAO;CACP,KAAK;CACL,OAAO;CACP,KAAK;CACL,MAAM;CACN,IAAI;CACJ,OAAO;CACR,CAAC;AAGF,SAAgB,EAAc,GAAsB;CAClD,IAAM,IAAM,EAAK,MAAM,CAAC,aAAa;AAIrC,QAHK,IACS,EAAgB,MAEvB,EACJ,MAAM,UAAU,CAChB,OAAO,QAAQ,CACf,KAAK,MAAS,EAAK,OAAO,EAAE,CAAC,aAAa,GAAG,EAAK,MAAM,EAAE,CAAC,CAC3D,KAAK,IAAI,GAPK;;AAWnB,SAAgB,EAAe,GAAoC;CACjE,IAAM,oBAAO,IAAI,KAAa,EACxB,IAAmB,EAAE;AAC3B,MAAK,IAAM,KAAQ,GAAO;EACxB,IAAM,IAAQ,EAAc,EAAK;AACjC,EAAI,KAAS,CAAC,EAAK,IAAI,EAAM,KAC3B,EAAK,IAAI,EAAM,EACf,EAAO,KAAK,EAAM;;AAGtB,QAAO;;AAMT,IAAa,IAAmC;AAOhD,SAAgB,EACd,GACoB;AACpB,KAAI;AAEF,SADc,GAAS,QAAA,2BAAyC,KAC/C,UAAU,UAAU;SAC/B;AACN,SAAO;;;AAKX,SAAgB,EACd,GACA,GACM;AACN,KAAI;AACF,KAAS,QAAQ,GAAkC,EAAK;SAClD;;AAMV,SAAgB,IAAmC;AACjD,KAAI;AACF,SAAO,OAAO,SAAW,MAAc,OAAO,OAAO;SAC/C;AACN,SAAO"}
|