@forwardimpact/pathway 0.22.0 → 0.23.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/package.json +3 -2
- package/src/commands/agent.js +7 -3
- package/src/commands/behaviour.js +11 -1
- package/src/commands/build.js +11 -2
- package/src/commands/command-factory.js +4 -2
- package/src/commands/dev.js +9 -2
- package/src/commands/discipline.js +19 -2
- package/src/commands/driver.js +11 -1
- package/src/commands/job.js +25 -12
- package/src/commands/level.js +19 -3
- package/src/commands/skill.js +11 -1
- package/src/commands/stage.js +11 -1
- package/src/commands/tool.js +4 -3
- package/src/commands/track.js +11 -1
- package/src/components/card.js +8 -104
- package/src/components/comparison-radar.js +1 -1
- package/src/components/detail.js +16 -118
- package/src/components/error-page.js +8 -68
- package/src/components/grid.js +12 -106
- package/src/components/list.js +7 -116
- package/src/components/nav.js +7 -60
- package/src/css/bundles/app.css +25 -21
- package/src/css/bundles/handout.css +33 -33
- package/src/css/bundles/slides.css +25 -25
- package/src/formatters/interview/shared.js +3 -3
- package/src/formatters/job/description.js +2 -2
- package/src/formatters/progress/shared.js +3 -3
- package/src/formatters/skill/shared.js +1 -1
- package/src/formatters/track/shared.js +1 -1
- package/src/handout.html +32 -13
- package/src/index.html +32 -13
- package/src/lib/error-boundary.js +3 -66
- package/src/lib/errors.js +7 -45
- package/src/lib/job-cache.js +1 -1
- package/src/lib/markdown.js +2 -109
- package/src/lib/reactive.js +7 -73
- package/src/lib/render.js +49 -197
- package/src/lib/router-core.js +2 -156
- package/src/lib/router-pages.js +2 -11
- package/src/lib/router-slides.js +2 -197
- package/src/lib/state.js +14 -63
- package/src/lib/utils.js +3 -10
- package/src/lib/yaml-loader.js +13 -71
- package/src/pages/agent-builder.js +1 -1
- package/src/pages/assessment-results.js +1 -1
- package/src/pages/job-builder.js +1 -1
- package/src/pages/job.js +1 -1
- package/src/pages/skill.js +1 -1
- package/src/slide-main.js +1 -1
- package/src/slides/index.js +1 -1
- package/src/slides/job.js +1 -1
- package/src/slides/overview.js +1 -1
- package/src/slides.html +32 -13
- package/src/css/base.css +0 -56
- package/src/css/components/badges.css +0 -232
- package/src/css/components/buttons.css +0 -101
- package/src/css/components/forms.css +0 -191
- package/src/css/components/layout.css +0 -218
- package/src/css/components/nav.css +0 -206
- package/src/css/components/progress.css +0 -166
- package/src/css/components/states.css +0 -82
- package/src/css/components/surfaces.css +0 -347
- package/src/css/components/tables.css +0 -362
- package/src/css/components/top-bar.css +0 -180
- package/src/css/components/typography.css +0 -121
- package/src/css/components/utilities.css +0 -41
- package/src/css/pages/detail.css +0 -119
- package/src/css/reset.css +0 -50
- package/src/css/tokens.css +0 -162
- package/src/css/views/handout.css +0 -30
- package/src/css/views/print.css +0 -634
- package/src/css/views/slide-animations.css +0 -113
- package/src/css/views/slide-base.css +0 -331
- package/src/css/views/slide-sections.css +0 -597
- package/src/css/views/slide-tables.css +0 -275
|
@@ -8,36 +8,36 @@
|
|
|
8
8
|
/* Layer order declaration - must be first */
|
|
9
9
|
@layer tokens, reset, base, components, utilities, pages, slides, handout, print;
|
|
10
10
|
|
|
11
|
-
/* Foundation */
|
|
12
|
-
@import "
|
|
13
|
-
@import "
|
|
14
|
-
@import "
|
|
15
|
-
|
|
16
|
-
/* Components */
|
|
17
|
-
@import "
|
|
18
|
-
@import "
|
|
19
|
-
@import "
|
|
20
|
-
@import "
|
|
21
|
-
@import "
|
|
22
|
-
@import "
|
|
23
|
-
@import "
|
|
24
|
-
@import "
|
|
25
|
-
@import "
|
|
26
|
-
|
|
27
|
-
/* Utilities */
|
|
28
|
-
@import "
|
|
29
|
-
|
|
30
|
-
/* Pages (
|
|
31
|
-
@import "
|
|
32
|
-
|
|
33
|
-
/* Slide views */
|
|
34
|
-
@import "
|
|
35
|
-
@import "
|
|
36
|
-
@import "
|
|
37
|
-
@import "
|
|
38
|
-
|
|
39
|
-
/* Handout overrides */
|
|
40
|
-
@import "
|
|
41
|
-
|
|
42
|
-
/* Print */
|
|
43
|
-
@import "
|
|
11
|
+
/* Foundation (from libui) */
|
|
12
|
+
@import "/ui/css/tokens.css" layer(tokens);
|
|
13
|
+
@import "/ui/css/reset.css" layer(reset);
|
|
14
|
+
@import "/ui/css/base.css" layer(base);
|
|
15
|
+
|
|
16
|
+
/* Components (from libui) */
|
|
17
|
+
@import "/ui/css/components/layout.css" layer(components);
|
|
18
|
+
@import "/ui/css/components/surfaces.css" layer(components);
|
|
19
|
+
@import "/ui/css/components/typography.css" layer(components);
|
|
20
|
+
@import "/ui/css/components/badges.css" layer(components);
|
|
21
|
+
@import "/ui/css/components/buttons.css" layer(components);
|
|
22
|
+
@import "/ui/css/components/forms.css" layer(components);
|
|
23
|
+
@import "/ui/css/components/tables.css" layer(components);
|
|
24
|
+
@import "/ui/css/components/progress.css" layer(components);
|
|
25
|
+
@import "/ui/css/components/states.css" layer(components);
|
|
26
|
+
|
|
27
|
+
/* Utilities (from libui) */
|
|
28
|
+
@import "/ui/css/components/utilities.css" layer(utilities);
|
|
29
|
+
|
|
30
|
+
/* Pages (from libui) */
|
|
31
|
+
@import "/ui/css/pages/detail.css" layer(pages);
|
|
32
|
+
|
|
33
|
+
/* Slide views (from libui) */
|
|
34
|
+
@import "/ui/css/views/slide-animations.css" layer(slides);
|
|
35
|
+
@import "/ui/css/views/slide-base.css" layer(slides);
|
|
36
|
+
@import "/ui/css/views/slide-sections.css" layer(slides);
|
|
37
|
+
@import "/ui/css/views/slide-tables.css" layer(slides);
|
|
38
|
+
|
|
39
|
+
/* Handout overrides (from libui) */
|
|
40
|
+
@import "/ui/css/views/handout.css" layer(handout);
|
|
41
|
+
|
|
42
|
+
/* Print (from libui) */
|
|
43
|
+
@import "/ui/css/views/print.css" layer(print);
|
|
@@ -8,33 +8,33 @@
|
|
|
8
8
|
/* Layer order declaration - must be first */
|
|
9
9
|
@layer tokens, reset, base, components, utilities, pages, slides, print;
|
|
10
10
|
|
|
11
|
-
/* Foundation */
|
|
12
|
-
@import "
|
|
13
|
-
@import "
|
|
14
|
-
@import "
|
|
11
|
+
/* Foundation (from libui) */
|
|
12
|
+
@import "/ui/css/tokens.css" layer(tokens);
|
|
13
|
+
@import "/ui/css/reset.css" layer(reset);
|
|
14
|
+
@import "/ui/css/base.css" layer(base);
|
|
15
15
|
|
|
16
|
-
/* Components */
|
|
17
|
-
@import "
|
|
18
|
-
@import "
|
|
19
|
-
@import "
|
|
20
|
-
@import "
|
|
21
|
-
@import "
|
|
22
|
-
@import "
|
|
23
|
-
@import "
|
|
24
|
-
@import "
|
|
25
|
-
@import "
|
|
16
|
+
/* Components (from libui) */
|
|
17
|
+
@import "/ui/css/components/layout.css" layer(components);
|
|
18
|
+
@import "/ui/css/components/surfaces.css" layer(components);
|
|
19
|
+
@import "/ui/css/components/typography.css" layer(components);
|
|
20
|
+
@import "/ui/css/components/badges.css" layer(components);
|
|
21
|
+
@import "/ui/css/components/buttons.css" layer(components);
|
|
22
|
+
@import "/ui/css/components/forms.css" layer(components);
|
|
23
|
+
@import "/ui/css/components/tables.css" layer(components);
|
|
24
|
+
@import "/ui/css/components/progress.css" layer(components);
|
|
25
|
+
@import "/ui/css/components/states.css" layer(components);
|
|
26
26
|
|
|
27
|
-
/* Utilities */
|
|
28
|
-
@import "
|
|
27
|
+
/* Utilities (from libui) */
|
|
28
|
+
@import "/ui/css/components/utilities.css" layer(utilities);
|
|
29
29
|
|
|
30
|
-
/* Pages (
|
|
31
|
-
@import "
|
|
30
|
+
/* Pages (from libui) */
|
|
31
|
+
@import "/ui/css/pages/detail.css" layer(pages);
|
|
32
32
|
|
|
33
|
-
/* Slide views */
|
|
34
|
-
@import "
|
|
35
|
-
@import "
|
|
36
|
-
@import "
|
|
37
|
-
@import "
|
|
33
|
+
/* Slide views (from libui) */
|
|
34
|
+
@import "/ui/css/views/slide-animations.css" layer(slides);
|
|
35
|
+
@import "/ui/css/views/slide-base.css" layer(slides);
|
|
36
|
+
@import "/ui/css/views/slide-sections.css" layer(slides);
|
|
37
|
+
@import "/ui/css/views/slide-tables.css" layer(slides);
|
|
38
38
|
|
|
39
|
-
/* Print */
|
|
40
|
-
@import "
|
|
39
|
+
/* Print (from libui) */
|
|
40
|
+
@import "/ui/css/views/print.css" layer(print);
|
|
@@ -8,13 +8,13 @@ import {
|
|
|
8
8
|
isValidJobCombination,
|
|
9
9
|
generateJobTitle,
|
|
10
10
|
getDisciplineSkillIds,
|
|
11
|
-
} from "@forwardimpact/
|
|
11
|
+
} from "@forwardimpact/libskill/derivation";
|
|
12
12
|
import {
|
|
13
13
|
deriveMissionFitInterview,
|
|
14
14
|
deriveDecompositionInterview,
|
|
15
15
|
deriveStakeholderInterview,
|
|
16
|
-
} from "@forwardimpact/
|
|
17
|
-
import { getOrCreateJob } from "@forwardimpact/
|
|
16
|
+
} from "@forwardimpact/libskill/interview";
|
|
17
|
+
import { getOrCreateJob } from "@forwardimpact/libskill/job-cache";
|
|
18
18
|
|
|
19
19
|
/**
|
|
20
20
|
* Interview type configurations
|
|
@@ -85,7 +85,7 @@ function prepareJobDescriptionData({ job, discipline, level, track }) {
|
|
|
85
85
|
let capabilitySkills = [];
|
|
86
86
|
const derivedResponsibilities = job.derivedResponsibilities || [];
|
|
87
87
|
if (derivedResponsibilities.length > 0) {
|
|
88
|
-
// derivedResponsibilities is sorted: highest proficiency first, then by
|
|
88
|
+
// derivedResponsibilities is sorted: highest proficiency first, then by skill count
|
|
89
89
|
const highestProficiency = derivedResponsibilities[0].proficiency;
|
|
90
90
|
|
|
91
91
|
// Filter responsibilities to only the highest proficiency
|
|
@@ -103,7 +103,7 @@ function prepareJobDescriptionData({ job, discipline, level, track }) {
|
|
|
103
103
|
skillsByCapability[skill.capability].push(skill);
|
|
104
104
|
}
|
|
105
105
|
|
|
106
|
-
// Build capability sections in
|
|
106
|
+
// Build capability sections in skill count order
|
|
107
107
|
capabilitySkills = topResponsibilities
|
|
108
108
|
.filter((r) => skillsByCapability[r.capability]?.length > 0)
|
|
109
109
|
.map((r) => {
|
|
@@ -7,13 +7,13 @@
|
|
|
7
7
|
import {
|
|
8
8
|
isValidJobCombination,
|
|
9
9
|
generateJobTitle,
|
|
10
|
-
} from "@forwardimpact/
|
|
10
|
+
} from "@forwardimpact/libskill/derivation";
|
|
11
11
|
import {
|
|
12
12
|
analyzeProgression,
|
|
13
13
|
analyzeCustomProgression,
|
|
14
14
|
getNextLevel,
|
|
15
|
-
} from "@forwardimpact/
|
|
16
|
-
import { getOrCreateJob } from "@forwardimpact/
|
|
15
|
+
} from "@forwardimpact/libskill/progression";
|
|
16
|
+
import { getOrCreateJob } from "@forwardimpact/libskill/job-cache";
|
|
17
17
|
|
|
18
18
|
/**
|
|
19
19
|
* Get the next level for progression
|
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
groupSkillsByCapability,
|
|
9
9
|
getCapabilityEmoji,
|
|
10
10
|
} from "@forwardimpact/map/levels";
|
|
11
|
-
import { getSkillTypeForDiscipline } from "@forwardimpact/
|
|
11
|
+
import { getSkillTypeForDiscipline } from "@forwardimpact/libskill/derivation";
|
|
12
12
|
import { truncate } from "../shared.js";
|
|
13
13
|
|
|
14
14
|
/**
|
package/src/handout.html
CHANGED
|
@@ -13,19 +13,38 @@
|
|
|
13
13
|
"@forwardimpact/map/levels": "/map/lib/levels.js",
|
|
14
14
|
"@forwardimpact/map/loader": "/map/lib/loader.js",
|
|
15
15
|
"@forwardimpact/map/validation": "/map/lib/validation.js",
|
|
16
|
-
"@forwardimpact/
|
|
17
|
-
"@forwardimpact/
|
|
18
|
-
"@forwardimpact/
|
|
19
|
-
"@forwardimpact/
|
|
20
|
-
"@forwardimpact/
|
|
21
|
-
"@forwardimpact/
|
|
22
|
-
"@forwardimpact/
|
|
23
|
-
"@forwardimpact/
|
|
24
|
-
"@forwardimpact/
|
|
25
|
-
"@forwardimpact/
|
|
26
|
-
"@forwardimpact/
|
|
27
|
-
"@forwardimpact/
|
|
28
|
-
"@forwardimpact/
|
|
16
|
+
"@forwardimpact/libskill": "/model/lib/index.js",
|
|
17
|
+
"@forwardimpact/libskill/derivation": "/model/lib/derivation.js",
|
|
18
|
+
"@forwardimpact/libskill/modifiers": "/model/lib/modifiers.js",
|
|
19
|
+
"@forwardimpact/libskill/agent": "/model/lib/agent.js",
|
|
20
|
+
"@forwardimpact/libskill/interview": "/model/lib/interview.js",
|
|
21
|
+
"@forwardimpact/libskill/job": "/model/lib/job.js",
|
|
22
|
+
"@forwardimpact/libskill/job-cache": "/model/lib/job-cache.js",
|
|
23
|
+
"@forwardimpact/libskill/checklist": "/model/lib/checklist.js",
|
|
24
|
+
"@forwardimpact/libskill/matching": "/model/lib/matching.js",
|
|
25
|
+
"@forwardimpact/libskill/profile": "/model/lib/profile.js",
|
|
26
|
+
"@forwardimpact/libskill/progression": "/model/lib/progression.js",
|
|
27
|
+
"@forwardimpact/libskill/policies": "/model/lib/policies/index.js",
|
|
28
|
+
"@forwardimpact/libskill/toolkit": "/model/lib/toolkit.js",
|
|
29
|
+
"@forwardimpact/libui": "/ui/lib/index.js",
|
|
30
|
+
"@forwardimpact/libui/render": "/ui/lib/render.js",
|
|
31
|
+
"@forwardimpact/libui/reactive": "/ui/lib/reactive.js",
|
|
32
|
+
"@forwardimpact/libui/state": "/ui/lib/state.js",
|
|
33
|
+
"@forwardimpact/libui/errors": "/ui/lib/errors.js",
|
|
34
|
+
"@forwardimpact/libui/error-boundary": "/ui/lib/error-boundary.js",
|
|
35
|
+
"@forwardimpact/libui/router-core": "/ui/lib/router-core.js",
|
|
36
|
+
"@forwardimpact/libui/router-pages": "/ui/lib/router-pages.js",
|
|
37
|
+
"@forwardimpact/libui/router-slides": "/ui/lib/router-slides.js",
|
|
38
|
+
"@forwardimpact/libui/yaml-loader": "/ui/lib/yaml-loader.js",
|
|
39
|
+
"@forwardimpact/libui/markdown": "/ui/lib/markdown.js",
|
|
40
|
+
"@forwardimpact/libui/utils": "/ui/lib/utils.js",
|
|
41
|
+
"@forwardimpact/libui/components": "/ui/lib/components/index.js",
|
|
42
|
+
"@forwardimpact/libui/components/card": "/ui/lib/components/card.js",
|
|
43
|
+
"@forwardimpact/libui/components/grid": "/ui/lib/components/grid.js",
|
|
44
|
+
"@forwardimpact/libui/components/list": "/ui/lib/components/list.js",
|
|
45
|
+
"@forwardimpact/libui/components/detail": "/ui/lib/components/detail.js",
|
|
46
|
+
"@forwardimpact/libui/components/nav": "/ui/lib/components/nav.js",
|
|
47
|
+
"@forwardimpact/libui/components/error-page": "/ui/lib/components/error-page.js"
|
|
29
48
|
}
|
|
30
49
|
}
|
|
31
50
|
</script>
|
package/src/index.html
CHANGED
|
@@ -25,19 +25,38 @@
|
|
|
25
25
|
"@forwardimpact/map/levels": "/map/lib/levels.js",
|
|
26
26
|
"@forwardimpact/map/loader": "/map/lib/loader.js",
|
|
27
27
|
"@forwardimpact/map/validation": "/map/lib/validation.js",
|
|
28
|
-
"@forwardimpact/
|
|
29
|
-
"@forwardimpact/
|
|
30
|
-
"@forwardimpact/
|
|
31
|
-
"@forwardimpact/
|
|
32
|
-
"@forwardimpact/
|
|
33
|
-
"@forwardimpact/
|
|
34
|
-
"@forwardimpact/
|
|
35
|
-
"@forwardimpact/
|
|
36
|
-
"@forwardimpact/
|
|
37
|
-
"@forwardimpact/
|
|
38
|
-
"@forwardimpact/
|
|
39
|
-
"@forwardimpact/
|
|
40
|
-
"@forwardimpact/
|
|
28
|
+
"@forwardimpact/libskill": "/model/lib/index.js",
|
|
29
|
+
"@forwardimpact/libskill/derivation": "/model/lib/derivation.js",
|
|
30
|
+
"@forwardimpact/libskill/modifiers": "/model/lib/modifiers.js",
|
|
31
|
+
"@forwardimpact/libskill/agent": "/model/lib/agent.js",
|
|
32
|
+
"@forwardimpact/libskill/interview": "/model/lib/interview.js",
|
|
33
|
+
"@forwardimpact/libskill/job": "/model/lib/job.js",
|
|
34
|
+
"@forwardimpact/libskill/job-cache": "/model/lib/job-cache.js",
|
|
35
|
+
"@forwardimpact/libskill/checklist": "/model/lib/checklist.js",
|
|
36
|
+
"@forwardimpact/libskill/matching": "/model/lib/matching.js",
|
|
37
|
+
"@forwardimpact/libskill/profile": "/model/lib/profile.js",
|
|
38
|
+
"@forwardimpact/libskill/progression": "/model/lib/progression.js",
|
|
39
|
+
"@forwardimpact/libskill/policies": "/model/lib/policies/index.js",
|
|
40
|
+
"@forwardimpact/libskill/toolkit": "/model/lib/toolkit.js",
|
|
41
|
+
"@forwardimpact/libui": "/ui/lib/index.js",
|
|
42
|
+
"@forwardimpact/libui/render": "/ui/lib/render.js",
|
|
43
|
+
"@forwardimpact/libui/reactive": "/ui/lib/reactive.js",
|
|
44
|
+
"@forwardimpact/libui/state": "/ui/lib/state.js",
|
|
45
|
+
"@forwardimpact/libui/errors": "/ui/lib/errors.js",
|
|
46
|
+
"@forwardimpact/libui/error-boundary": "/ui/lib/error-boundary.js",
|
|
47
|
+
"@forwardimpact/libui/router-core": "/ui/lib/router-core.js",
|
|
48
|
+
"@forwardimpact/libui/router-pages": "/ui/lib/router-pages.js",
|
|
49
|
+
"@forwardimpact/libui/router-slides": "/ui/lib/router-slides.js",
|
|
50
|
+
"@forwardimpact/libui/yaml-loader": "/ui/lib/yaml-loader.js",
|
|
51
|
+
"@forwardimpact/libui/markdown": "/ui/lib/markdown.js",
|
|
52
|
+
"@forwardimpact/libui/utils": "/ui/lib/utils.js",
|
|
53
|
+
"@forwardimpact/libui/components": "/ui/lib/components/index.js",
|
|
54
|
+
"@forwardimpact/libui/components/card": "/ui/lib/components/card.js",
|
|
55
|
+
"@forwardimpact/libui/components/grid": "/ui/lib/components/grid.js",
|
|
56
|
+
"@forwardimpact/libui/components/list": "/ui/lib/components/list.js",
|
|
57
|
+
"@forwardimpact/libui/components/detail": "/ui/lib/components/detail.js",
|
|
58
|
+
"@forwardimpact/libui/components/nav": "/ui/lib/components/nav.js",
|
|
59
|
+
"@forwardimpact/libui/components/error-page": "/ui/lib/components/error-page.js"
|
|
41
60
|
}
|
|
42
61
|
}
|
|
43
62
|
</script>
|
|
@@ -1,70 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Error boundary wrapper for page rendering
|
|
3
|
+
*
|
|
4
|
+
* Re-exports from @forwardimpact/libui/error-boundary.
|
|
3
5
|
*/
|
|
4
6
|
|
|
5
|
-
|
|
6
|
-
import { NotFoundError, InvalidCombinationError } from "./errors.js";
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* @typedef {Object} ErrorBoundaryOptions
|
|
10
|
-
* @property {(error: Error) => void} [onError] - Error callback for logging
|
|
11
|
-
* @property {string} [backPath] - Default back path
|
|
12
|
-
* @property {string} [backText] - Default back text
|
|
13
|
-
* @property {(title: string, message: string) => void} [renderErrorFn] - Custom error renderer
|
|
14
|
-
*/
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* Wrap a render function with error handling
|
|
18
|
-
* @param {Function} renderFn - Page render function
|
|
19
|
-
* @param {ErrorBoundaryOptions} [options]
|
|
20
|
-
* @returns {Function}
|
|
21
|
-
*/
|
|
22
|
-
export function withErrorBoundary(renderFn, options = {}) {
|
|
23
|
-
const errorRenderer =
|
|
24
|
-
options.renderErrorFn ||
|
|
25
|
-
((title, message) => {
|
|
26
|
-
renderError({
|
|
27
|
-
title,
|
|
28
|
-
message,
|
|
29
|
-
backPath: options.backPath || "/",
|
|
30
|
-
backText: options.backText || "← Back to Home",
|
|
31
|
-
});
|
|
32
|
-
});
|
|
33
|
-
|
|
34
|
-
return (...args) => {
|
|
35
|
-
try {
|
|
36
|
-
return renderFn(...args);
|
|
37
|
-
} catch (error) {
|
|
38
|
-
console.error("Page render error:", error);
|
|
39
|
-
|
|
40
|
-
options.onError?.(error);
|
|
41
|
-
|
|
42
|
-
if (error instanceof NotFoundError) {
|
|
43
|
-
if (options.renderErrorFn) {
|
|
44
|
-
errorRenderer(
|
|
45
|
-
`${error.entityType} Not Found`,
|
|
46
|
-
`No ${error.entityType.toLowerCase()} found with ID: ${error.entityId}`,
|
|
47
|
-
);
|
|
48
|
-
} else {
|
|
49
|
-
renderNotFound({
|
|
50
|
-
entityType: error.entityType,
|
|
51
|
-
entityId: error.entityId,
|
|
52
|
-
backPath: error.backPath,
|
|
53
|
-
backText: `← Back to ${error.entityType}s`,
|
|
54
|
-
});
|
|
55
|
-
}
|
|
56
|
-
return;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
if (error instanceof InvalidCombinationError) {
|
|
60
|
-
errorRenderer("Invalid Combination", error.message);
|
|
61
|
-
return;
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
errorRenderer(
|
|
65
|
-
"Something Went Wrong",
|
|
66
|
-
error.message || "An unexpected error occurred.",
|
|
67
|
-
);
|
|
68
|
-
}
|
|
69
|
-
};
|
|
70
|
-
}
|
|
7
|
+
export { withErrorBoundary } from "@forwardimpact/libui/error-boundary";
|
package/src/lib/errors.js
CHANGED
|
@@ -1,49 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Custom error types for the application
|
|
3
|
+
*
|
|
4
|
+
* Re-exports from @forwardimpact/libui/errors.
|
|
3
5
|
*/
|
|
4
6
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
* @param {string} entityType - Type of entity (e.g., 'Skill', 'Behaviour')
|
|
11
|
-
* @param {string} entityId - ID that was not found
|
|
12
|
-
* @param {string} backPath - Path to navigate back to
|
|
13
|
-
*/
|
|
14
|
-
constructor(entityType, entityId, backPath) {
|
|
15
|
-
super(`${entityType} not found: ${entityId}`);
|
|
16
|
-
this.name = "NotFoundError";
|
|
17
|
-
this.entityType = entityType;
|
|
18
|
-
this.entityId = entityId;
|
|
19
|
-
this.backPath = backPath;
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
/**
|
|
24
|
-
* Invalid combination error (e.g., invalid job configuration)
|
|
25
|
-
*/
|
|
26
|
-
export class InvalidCombinationError extends Error {
|
|
27
|
-
/**
|
|
28
|
-
* @param {string} message - Error message
|
|
29
|
-
* @param {string} backPath - Path to navigate back to
|
|
30
|
-
*/
|
|
31
|
-
constructor(message, backPath) {
|
|
32
|
-
super(message);
|
|
33
|
-
this.name = "InvalidCombinationError";
|
|
34
|
-
this.backPath = backPath;
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
/**
|
|
39
|
-
* Data loading error
|
|
40
|
-
*/
|
|
41
|
-
export class DataLoadError extends Error {
|
|
42
|
-
/**
|
|
43
|
-
* @param {string} message - Error message
|
|
44
|
-
*/
|
|
45
|
-
constructor(message) {
|
|
46
|
-
super(message);
|
|
47
|
-
this.name = "DataLoadError";
|
|
48
|
-
}
|
|
49
|
-
}
|
|
7
|
+
export {
|
|
8
|
+
NotFoundError,
|
|
9
|
+
InvalidCombinationError,
|
|
10
|
+
DataLoadError,
|
|
11
|
+
} from "@forwardimpact/libui/errors";
|
package/src/lib/job-cache.js
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* Provides consistent key generation and get-or-create pattern.
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
import { deriveJob } from "@forwardimpact/
|
|
8
|
+
import { deriveJob } from "@forwardimpact/libskill/derivation";
|
|
9
9
|
|
|
10
10
|
/** @type {Map<string, Object>} */
|
|
11
11
|
const cache = new Map();
|
package/src/lib/markdown.js
CHANGED
|
@@ -1,114 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Simple Markdown to HTML converter
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
* with headings, lists, bold text, and paragraphs.
|
|
4
|
+
* Re-exports from @forwardimpact/libui/markdown.
|
|
6
5
|
*/
|
|
7
6
|
|
|
8
|
-
|
|
9
|
-
* Convert markdown text to HTML
|
|
10
|
-
* @param {string} markdown - The markdown text to convert
|
|
11
|
-
* @returns {string} HTML string
|
|
12
|
-
*/
|
|
13
|
-
export function markdownToHtml(markdown) {
|
|
14
|
-
const lines = markdown.split("\n");
|
|
15
|
-
const htmlLines = [];
|
|
16
|
-
let inList = false;
|
|
17
|
-
|
|
18
|
-
for (let i = 0; i < lines.length; i++) {
|
|
19
|
-
let line = lines[i];
|
|
20
|
-
|
|
21
|
-
// Skip empty lines but close list if open
|
|
22
|
-
if (line.trim() === "") {
|
|
23
|
-
if (inList) {
|
|
24
|
-
htmlLines.push("</ul>");
|
|
25
|
-
inList = false;
|
|
26
|
-
}
|
|
27
|
-
continue;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
// H1 heading
|
|
31
|
-
if (line.startsWith("# ")) {
|
|
32
|
-
if (inList) {
|
|
33
|
-
htmlLines.push("</ul>");
|
|
34
|
-
inList = false;
|
|
35
|
-
}
|
|
36
|
-
htmlLines.push(`<h1>${escapeHtml(line.slice(2))}</h1>`);
|
|
37
|
-
continue;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
// H2 heading
|
|
41
|
-
if (line.startsWith("## ")) {
|
|
42
|
-
if (inList) {
|
|
43
|
-
htmlLines.push("</ul>");
|
|
44
|
-
inList = false;
|
|
45
|
-
}
|
|
46
|
-
htmlLines.push(`<h2>${escapeHtml(line.slice(3))}</h2>`);
|
|
47
|
-
continue;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
// H3 heading
|
|
51
|
-
if (line.startsWith("### ")) {
|
|
52
|
-
if (inList) {
|
|
53
|
-
htmlLines.push("</ul>");
|
|
54
|
-
inList = false;
|
|
55
|
-
}
|
|
56
|
-
htmlLines.push(`<h3>${escapeHtml(line.slice(4))}</h3>`);
|
|
57
|
-
continue;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
// List item
|
|
61
|
-
if (line.startsWith("- ")) {
|
|
62
|
-
if (!inList) {
|
|
63
|
-
htmlLines.push("<ul>");
|
|
64
|
-
inList = true;
|
|
65
|
-
}
|
|
66
|
-
const content = formatInlineMarkdown(line.slice(2));
|
|
67
|
-
htmlLines.push(`<li>${content}</li>`);
|
|
68
|
-
continue;
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
// Regular paragraph
|
|
72
|
-
if (inList) {
|
|
73
|
-
htmlLines.push("</ul>");
|
|
74
|
-
inList = false;
|
|
75
|
-
}
|
|
76
|
-
htmlLines.push(`<p>${formatInlineMarkdown(line)}</p>`);
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
// Close any open list
|
|
80
|
-
if (inList) {
|
|
81
|
-
htmlLines.push("</ul>");
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
return htmlLines.join("\n");
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
/**
|
|
88
|
-
* Escape HTML special characters
|
|
89
|
-
* @param {string} text - Text to escape
|
|
90
|
-
* @returns {string} Escaped text
|
|
91
|
-
*/
|
|
92
|
-
function escapeHtml(text) {
|
|
93
|
-
return text
|
|
94
|
-
.replace(/&/g, "&")
|
|
95
|
-
.replace(/</g, "<")
|
|
96
|
-
.replace(/>/g, ">")
|
|
97
|
-
.replace(/"/g, """)
|
|
98
|
-
.replace(/'/g, "'");
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
/**
|
|
102
|
-
* Format inline markdown (bold text)
|
|
103
|
-
* @param {string} text - Text to format
|
|
104
|
-
* @returns {string} HTML formatted text
|
|
105
|
-
*/
|
|
106
|
-
function formatInlineMarkdown(text) {
|
|
107
|
-
// First escape HTML
|
|
108
|
-
let result = escapeHtml(text);
|
|
109
|
-
|
|
110
|
-
// Convert **bold** to <strong>bold</strong>
|
|
111
|
-
result = result.replace(/\*\*([^*]+)\*\*/g, "<strong>$1</strong>");
|
|
112
|
-
|
|
113
|
-
return result;
|
|
114
|
-
}
|
|
7
|
+
export { markdownToHtml } from "@forwardimpact/libui/markdown";
|
package/src/lib/reactive.js
CHANGED
|
@@ -1,77 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Reactive state utilities for local component state
|
|
3
|
+
*
|
|
4
|
+
* Re-exports from @forwardimpact/libui/reactive.
|
|
3
5
|
*/
|
|
4
6
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
* @property {(fn: (prev: T) => T) => void} update - Update value with function
|
|
11
|
-
* @property {(fn: (value: T) => void) => () => void} subscribe - Subscribe to changes
|
|
12
|
-
*/
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* Create a reactive state container
|
|
16
|
-
* @template T
|
|
17
|
-
* @param {T} initial - Initial value
|
|
18
|
-
* @returns {Reactive<T>}
|
|
19
|
-
*/
|
|
20
|
-
export function createReactive(initial) {
|
|
21
|
-
let state = initial;
|
|
22
|
-
const subscribers = new Set();
|
|
23
|
-
|
|
24
|
-
return {
|
|
25
|
-
get: () => state,
|
|
26
|
-
|
|
27
|
-
set: (next) => {
|
|
28
|
-
state = next;
|
|
29
|
-
subscribers.forEach((fn) => fn(state));
|
|
30
|
-
},
|
|
31
|
-
|
|
32
|
-
update: (fn) => {
|
|
33
|
-
state = fn(state);
|
|
34
|
-
subscribers.forEach((sub) => sub(state));
|
|
35
|
-
},
|
|
36
|
-
|
|
37
|
-
subscribe: (fn) => {
|
|
38
|
-
subscribers.add(fn);
|
|
39
|
-
return () => subscribers.delete(fn);
|
|
40
|
-
},
|
|
41
|
-
};
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
/**
|
|
45
|
-
* Create a computed value that updates when dependencies change
|
|
46
|
-
* @template T
|
|
47
|
-
* @param {() => T} compute - Computation function
|
|
48
|
-
* @param {Reactive<*>[]} deps - Dependencies
|
|
49
|
-
* @returns {Reactive<T>}
|
|
50
|
-
*/
|
|
51
|
-
export function createComputed(compute, deps) {
|
|
52
|
-
const computed = createReactive(compute());
|
|
53
|
-
|
|
54
|
-
deps.forEach((dep) => {
|
|
55
|
-
dep.subscribe(() => {
|
|
56
|
-
computed.set(compute());
|
|
57
|
-
});
|
|
58
|
-
});
|
|
59
|
-
|
|
60
|
-
return computed;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
/**
|
|
64
|
-
* Bind a reactive value to an element attribute
|
|
65
|
-
* @template T
|
|
66
|
-
* @param {Reactive<T>} reactive - Reactive state
|
|
67
|
-
* @param {HTMLElement} element - Element to bind
|
|
68
|
-
* @param {string} attribute - Attribute name
|
|
69
|
-
* @param {(value: T) => *} [transform] - Transform function
|
|
70
|
-
*/
|
|
71
|
-
export function bind(reactive, element, attribute, transform = (v) => v) {
|
|
72
|
-
const update = (value) => {
|
|
73
|
-
element[attribute] = transform(value);
|
|
74
|
-
};
|
|
75
|
-
update(reactive.get());
|
|
76
|
-
reactive.subscribe(update);
|
|
77
|
-
}
|
|
7
|
+
export {
|
|
8
|
+
createReactive,
|
|
9
|
+
createComputed,
|
|
10
|
+
bind,
|
|
11
|
+
} from "@forwardimpact/libui/reactive";
|