@hadoku/jobplatform 3.42.63 → 3.42.64

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.
@@ -0,0 +1,110 @@
1
+ import { jsxs as t, jsx as a, Fragment as d } from "react/jsx-runtime";
2
+ import { useState as i, useEffect as _ } from "react";
3
+ import { g as y, J as b, D as v } from "./entry-CFBqMGn5.js";
4
+ import { g, p as E, a as P } from "./packets-BfqJIYHB.js";
5
+ function L({ auth: f, jobId: m, slug: n, onClose: s }) {
6
+ const [e, h] = i(null), [o, k] = i(null), [r, j] = i(null), [p, u] = i(null);
7
+ _(() => {
8
+ const l = (c) => {
9
+ c.key === "Escape" && s();
10
+ };
11
+ return window.addEventListener("keydown", l), () => window.removeEventListener("keydown", l);
12
+ }, [s]), _(() => {
13
+ let l = !1;
14
+ return h(null), k(null), y(m, void 0).then((c) => {
15
+ l || h(c);
16
+ }).catch((c) => {
17
+ l || k(c instanceof b ? c.message : "Failed to load the posting");
18
+ }), () => {
19
+ l = !0;
20
+ };
21
+ }, [f, m]), _(() => {
22
+ let l = !1;
23
+ return j(null), u(null), g(n).then((c) => {
24
+ l || j(c);
25
+ }).catch((c) => {
26
+ l || u(c instanceof Error ? c.message : "Failed to load the packet");
27
+ }), () => {
28
+ l = !0;
29
+ };
30
+ }, [n]);
31
+ const w = e?.title ?? r?.job_title ?? "Packet", N = e?.company ?? r?.company ?? null;
32
+ return /* @__PURE__ */ t("section", { className: "jp-packet-detail", children: [
33
+ /* @__PURE__ */ t("header", { className: "jp-packet-detail__header", children: [
34
+ /* @__PURE__ */ a("button", { type: "button", className: "jp-packet-detail__back", onClick: s, children: "← Packets" }),
35
+ /* @__PURE__ */ t("div", { className: "jp-packet-detail__heading", children: [
36
+ /* @__PURE__ */ a("h2", { className: "jp-packet-detail__title", children: w }),
37
+ N && /* @__PURE__ */ a("p", { className: "jp-packet-detail__company", children: N })
38
+ ] }),
39
+ /* @__PURE__ */ t("div", { className: "jp-packet-detail__links", children: [
40
+ /* @__PURE__ */ a(
41
+ "a",
42
+ {
43
+ className: "jp-drawer__cta",
44
+ href: E(n),
45
+ target: "_blank",
46
+ rel: "noopener noreferrer",
47
+ children: "Tailored resume"
48
+ }
49
+ ),
50
+ /* @__PURE__ */ a(
51
+ "a",
52
+ {
53
+ className: "jp-drawer__cta jp-drawer__cta--primary",
54
+ href: P(n),
55
+ target: "_blank",
56
+ rel: "noopener noreferrer",
57
+ children: "PDF"
58
+ }
59
+ )
60
+ ] })
61
+ ] }),
62
+ /* @__PURE__ */ t("div", { className: "jp-packet-detail__columns", children: [
63
+ /* @__PURE__ */ t("article", { className: "jp-packet-detail__col", "aria-label": "Job posting", children: [
64
+ /* @__PURE__ */ a("h3", { className: "jp-packet-detail__col-title", children: "Posting" }),
65
+ o && /* @__PURE__ */ a("p", { className: "jp-error", children: o }),
66
+ !e && !o && /* @__PURE__ */ a("p", { className: "jp-muted", children: "Loading posting…" }),
67
+ e && /* @__PURE__ */ t(d, { children: [
68
+ /* @__PURE__ */ t("p", { className: "jp-packet-detail__job-line", children: [
69
+ e.company,
70
+ " · ",
71
+ e.location || "location unknown",
72
+ e.workplace_type && e.workplace_type !== "unknown" && ` · ${e.workplace_type}`
73
+ ] }),
74
+ /* @__PURE__ */ t("div", { className: "jp-drawer__facts", children: [
75
+ /* @__PURE__ */ a("span", { children: e.source_site }),
76
+ e.job_type && e.job_type !== "unknown" && /* @__PURE__ */ a("span", { children: e.job_type }),
77
+ (e.salary_min || e.salary_max) && /* @__PURE__ */ t("span", { children: [
78
+ "$",
79
+ e.salary_min ?? "?",
80
+ " – $",
81
+ e.salary_max ?? "?"
82
+ ] }),
83
+ e.posted_date && /* @__PURE__ */ t("span", { children: [
84
+ "Posted ",
85
+ e.posted_date
86
+ ] }),
87
+ e.state && e.state !== "new" && /* @__PURE__ */ a("span", { className: `jp-drawer__facts-state jp-drawer__facts-state--${e.state}`, children: e.state })
88
+ ] }),
89
+ /* @__PURE__ */ a(v, { text: e.description })
90
+ ] })
91
+ ] }),
92
+ /* @__PURE__ */ t("article", { className: "jp-packet-detail__col", "aria-label": "Application packet", children: [
93
+ /* @__PURE__ */ a("h3", { className: "jp-packet-detail__col-title", children: "Packet" }),
94
+ p && /* @__PURE__ */ a("p", { className: "jp-error", children: p }),
95
+ !r && !p && /* @__PURE__ */ a("p", { className: "jp-muted", children: "Loading packet…" }),
96
+ r && /* @__PURE__ */ t(d, { children: [
97
+ !r.variant && /* @__PURE__ */ a("p", { className: "jp-muted", children: "This packet link has expired — showing the canonical résumé it now serves." }),
98
+ /* @__PURE__ */ a("div", { className: "jp-packet-detail__doc", children: r.content }),
99
+ r.cover_letter && /* @__PURE__ */ t(d, { children: [
100
+ /* @__PURE__ */ a("h4", { className: "jp-packet-detail__doc-title", children: "Cover letter" }),
101
+ /* @__PURE__ */ a("div", { className: "jp-packet-detail__doc", children: r.cover_letter })
102
+ ] })
103
+ ] })
104
+ ] })
105
+ ] })
106
+ ] });
107
+ }
108
+ export {
109
+ L as PacketDetail
110
+ };
@@ -0,0 +1,49 @@
1
+ import { jsx as e, jsxs as n } from "react/jsx-runtime";
2
+ import { u, e as k, J as p } from "./entry-CFBqMGn5.js";
3
+ import { p as j } from "./packets-BfqJIYHB.js";
4
+ function h(c) {
5
+ const t = new Date(c);
6
+ return Number.isNaN(t.getTime()) ? c : t.toLocaleDateString();
7
+ }
8
+ function g({ auth: c, onSelect: t }) {
9
+ const { data: d, loading: m, error: s } = u("packets", () => k()), i = d ?? [], o = s instanceof p && s.status === 403, l = s && !o ? s instanceof p ? s.message : "Failed to load packets" : null;
10
+ return m ? /* @__PURE__ */ e("p", { className: "jp-muted", children: "Loading packets…" }) : o ? /* @__PURE__ */ e("p", { className: "jp-muted", children: "Packets are per-account — sign in to see yours." }) : l ? /* @__PURE__ */ e("p", { className: "jp-error", children: l }) : i.length === 0 ? /* @__PURE__ */ e("p", { className: "jp-muted", children: "No packets yet. Prepare an application from a job’s drawer and create its link — it will show up here." }) : /* @__PURE__ */ e("ul", { className: "jp-packets", children: i.map((a) => /* @__PURE__ */ e("li", { children: /* @__PURE__ */ n(
11
+ "div",
12
+ {
13
+ role: "button",
14
+ tabIndex: 0,
15
+ className: "jp-packet",
16
+ onClick: () => t(a),
17
+ onKeyDown: (r) => {
18
+ r.target === r.currentTarget && (r.key === "Enter" || r.key === " ") && (r.preventDefault(), t(a));
19
+ },
20
+ children: [
21
+ /* @__PURE__ */ n("div", { className: "jp-packet__main", children: [
22
+ /* @__PURE__ */ n("span", { className: "jp-packet__job", children: [
23
+ /* @__PURE__ */ e("span", { className: "jp-packet__company", children: a.company }),
24
+ /* @__PURE__ */ e("span", { className: "jp-jobcard__sep", children: " — " }),
25
+ a.title
26
+ ] }),
27
+ /* @__PURE__ */ n("span", { className: "jp-packet__meta", children: [
28
+ "Prepared ",
29
+ h(a.updated_at)
30
+ ] })
31
+ ] }),
32
+ /* @__PURE__ */ e("span", { className: `jp-jobcard__state jp-jobcard__state--${a.state}`, children: a.state }),
33
+ /* @__PURE__ */ e("div", { className: "jp-packet__links", children: /* @__PURE__ */ e(
34
+ "a",
35
+ {
36
+ href: j(a.variant_slug),
37
+ target: "_blank",
38
+ rel: "noreferrer",
39
+ onClick: (r) => r.stopPropagation(),
40
+ children: "Tailored resume"
41
+ }
42
+ ) })
43
+ ]
44
+ }
45
+ ) }, `${a.job_id}:${a.variant_slug}`)) });
46
+ }
47
+ export {
48
+ g as PacketsList
49
+ };
@@ -0,0 +1,208 @@
1
+ import { jsx as n, jsxs as l, Fragment as R } from "react/jsx-runtime";
2
+ import { useState as f, useEffect as x, useMemo as q } from "react";
3
+ import { u as U, i as m, J as w, h as J } from "./entry-CFBqMGn5.js";
4
+ import { g as B } from "./pipeline-C2hWQq1c.js";
5
+ const F = [
6
+ { state: "interested", label: "Interested" },
7
+ { state: "saved", label: "Saved" },
8
+ { state: "applied", label: "Applied" },
9
+ { state: "interviewing", label: "Interviewing" },
10
+ { state: "offered", label: "Offered" },
11
+ { state: "rejected", label: "Rejected" }
12
+ ], Y = { 1: "High", 3: "Low" };
13
+ function H() {
14
+ const e = /* @__PURE__ */ new Date(), i = (s) => String(s).padStart(2, "0");
15
+ return `${e.getFullYear()}-${i(e.getMonth() + 1)}-${i(e.getDate())}`;
16
+ }
17
+ function j(e) {
18
+ const i = /^\d{4}-\d{2}-\d{2}$/.test(e) ? /* @__PURE__ */ new Date(`${e}T00:00:00`) : new Date(e);
19
+ return Number.isNaN(i.getTime()) ? e : i.toLocaleDateString(void 0, { month: "short", day: "numeric" });
20
+ }
21
+ function I(e, i) {
22
+ const s = e.tracking.priority ?? 2, d = i.tracking.priority ?? 2;
23
+ if (s !== d) return s - d;
24
+ const u = e.tracking.follow_up_at ?? "9999", o = i.tracking.follow_up_at ?? "9999";
25
+ return u !== o ? u < o ? -1 : 1 : e.updated_at < i.updated_at ? 1 : -1;
26
+ }
27
+ function O({ date: e, today: i }) {
28
+ const s = e < i ? "overdue" : e === i ? "today" : "upcoming", d = s === "overdue" ? `Follow up — was ${j(e)}` : s === "today" ? "Follow up today" : `Follow up ${j(e)}`;
29
+ return /* @__PURE__ */ n("span", { className: `jp-pipe-chip jp-pipe-chip--${s}`, "data-testid": "pipe-follow-up", children: d });
30
+ }
31
+ function Q({
32
+ item: e,
33
+ today: i,
34
+ onSelect: s,
35
+ onMove: d,
36
+ moving: u
37
+ }) {
38
+ const o = e.tracking.priority, h = o === 1 || o === 3 ? Y[o] : null;
39
+ return /* @__PURE__ */ l(
40
+ "li",
41
+ {
42
+ className: `jp-pipe-card${u ? " jp-pipe-card--moving" : ""}`,
43
+ draggable: !u,
44
+ onDragStart: (r) => {
45
+ r.dataTransfer.setData("text/plain", e.job_id), r.dataTransfer.effectAllowed = "move";
46
+ },
47
+ "data-testid": "pipe-card",
48
+ "data-job-id": e.job_id,
49
+ children: [
50
+ /* @__PURE__ */ l(
51
+ "div",
52
+ {
53
+ role: "button",
54
+ tabIndex: 0,
55
+ className: "jp-pipe-card__open",
56
+ onClick: () => s(e.job_id),
57
+ onKeyDown: (r) => {
58
+ r.target === r.currentTarget && (r.key === "Enter" || r.key === " ") && (r.preventDefault(), s(e.job_id));
59
+ },
60
+ children: [
61
+ /* @__PURE__ */ l("div", { className: "jp-pipe-card__head", children: [
62
+ /* @__PURE__ */ n("span", { className: "jp-pipe-card__company", children: e.company }),
63
+ h && /* @__PURE__ */ n("span", { className: `jp-pipe-chip jp-pipe-chip--priority-${o}`, children: h })
64
+ ] }),
65
+ /* @__PURE__ */ n("span", { className: "jp-pipe-card__title", children: e.title }),
66
+ /* @__PURE__ */ l("span", { className: "jp-pipe-card__meta", children: [
67
+ e.applied_at ? `Applied ${j(e.applied_at)}` : `Updated ${j(e.updated_at)}`,
68
+ e.location && ` · ${e.location}`
69
+ ] }),
70
+ (e.tracking.follow_up_at ?? e.application_status ?? e.tracking.contact_name) && /* @__PURE__ */ l("div", { className: "jp-pipe-card__chips", children: [
71
+ e.tracking.follow_up_at && /* @__PURE__ */ n(O, { date: e.tracking.follow_up_at, today: i }),
72
+ e.application_status && /* @__PURE__ */ l("span", { className: "jp-pipe-chip jp-pipe-chip--neutral", title: "Apply queue status", children: [
73
+ "Runner: ",
74
+ e.application_status.replace("_", " ")
75
+ ] }),
76
+ e.tracking.contact_name && /* @__PURE__ */ n("span", { className: "jp-pipe-chip jp-pipe-chip--neutral", children: e.tracking.contact_name })
77
+ ] })
78
+ ]
79
+ }
80
+ ),
81
+ /* @__PURE__ */ l(
82
+ "select",
83
+ {
84
+ className: "jp-pipe-card__move",
85
+ "aria-label": `Move ${e.company} — ${e.title}`,
86
+ value: e.state,
87
+ disabled: u,
88
+ onChange: (r) => d(e.job_id, r.target.value),
89
+ children: [
90
+ F.map((r) => /* @__PURE__ */ n("option", { value: r.state, children: r.label }, r.state)),
91
+ /* @__PURE__ */ n("option", { value: "dismissed", children: "Dismiss" })
92
+ ]
93
+ }
94
+ )
95
+ ]
96
+ }
97
+ );
98
+ }
99
+ function W({ auth: e, onSelect: i, reloadKey: s }) {
100
+ const {
101
+ data: d,
102
+ loading: u,
103
+ error: o,
104
+ reload: h
105
+ } = U("pipeline", () => B(e)), [r, v] = f({}), [$, k] = f(/* @__PURE__ */ new Set()), [D, T] = f(null), [y, M] = f(""), [L, b] = f(null), C = H();
106
+ x(() => {
107
+ s !== 0 && (m("pipeline"), h());
108
+ }, [s]), x(() => v({}), [d]);
109
+ const g = q(() => {
110
+ const a = y.trim().toLowerCase();
111
+ return (d ?? []).map((t) => r[t.job_id] ? { ...t, state: r[t.job_id] } : t).filter((t) => t.state !== "dismissed").filter((t) => !a || t.company.toLowerCase().includes(a) || t.title.toLowerCase().includes(a));
112
+ }, [d, r, y]), N = g.filter((a) => a.tracking.follow_up_at && a.tracking.follow_up_at <= C), E = async (a, t) => {
113
+ const p = g.find((c) => c.job_id === a);
114
+ if (!(!p || p.state === t || $.has(a))) {
115
+ T(null), v((c) => ({ ...c, [a]: t })), k((c) => new Set(c).add(a));
116
+ try {
117
+ await J(a, t, e), m(`job:${a}:`), m("jobs:"), m("pipeline"), h();
118
+ } catch (c) {
119
+ v((_) => {
120
+ const S = { ..._ };
121
+ return delete S[a], S;
122
+ }), T(
123
+ `Could not move ${p.company}: ${c instanceof w ? c.message : "request failed"}`
124
+ );
125
+ } finally {
126
+ k((c) => {
127
+ const _ = new Set(c);
128
+ return _.delete(a), _;
129
+ });
130
+ }
131
+ }
132
+ }, A = (a) => (t) => {
133
+ t.preventDefault(), b(null);
134
+ const p = t.dataTransfer.getData("text/plain");
135
+ p && E(p, a);
136
+ }, P = o instanceof w && o.status === 403;
137
+ return u ? /* @__PURE__ */ n("p", { className: "jp-muted", children: "Loading your pipeline…" }) : P ? /* @__PURE__ */ n("p", { className: "jp-muted", children: "The pipeline is per-account — sign in to see yours." }) : o ? /* @__PURE__ */ n("p", { className: "jp-error", children: o instanceof w ? o.message : "Failed to load the pipeline" }) : (d ?? []).length === 0 ? /* @__PURE__ */ n("p", { className: "jp-muted", children: "Nothing in your pipeline yet. Mark a posting interested, save it or apply from the feed, and it lands here." }) : /* @__PURE__ */ l("div", { className: "jp-pipe", children: [
138
+ /* @__PURE__ */ l("div", { className: "jp-pipe__toolbar", children: [
139
+ /* @__PURE__ */ n(
140
+ "input",
141
+ {
142
+ type: "search",
143
+ className: "jp-jobs__search",
144
+ placeholder: "Filter by company or title",
145
+ value: y,
146
+ onChange: (a) => M(a.target.value),
147
+ "aria-label": "Filter the pipeline"
148
+ }
149
+ ),
150
+ /* @__PURE__ */ l("span", { className: "jp-pipe__summary", "data-testid": "pipe-summary", children: [
151
+ g.length,
152
+ " in play",
153
+ N.length > 0 && /* @__PURE__ */ l(R, { children: [
154
+ " · ",
155
+ /* @__PURE__ */ l("strong", { children: [
156
+ N.length,
157
+ " follow-up",
158
+ N.length === 1 ? "" : "s",
159
+ " due"
160
+ ] })
161
+ ] })
162
+ ] })
163
+ ] }),
164
+ D && /* @__PURE__ */ n("p", { className: "jp-error", children: D }),
165
+ /* @__PURE__ */ n("div", { className: "jp-pipe__board", children: F.map((a) => {
166
+ const t = g.filter((p) => p.state === a.state).sort(I);
167
+ return /* @__PURE__ */ l(
168
+ "section",
169
+ {
170
+ className: `jp-pipe__col jp-pipe__col--${a.state}${L === a.state ? " jp-pipe__col--drop" : ""}`,
171
+ "aria-label": a.label,
172
+ "data-testid": `pipe-col-${a.state}`,
173
+ onDragOver: (p) => {
174
+ p.preventDefault(), p.dataTransfer.dropEffect = "move", L !== a.state && b(a.state);
175
+ },
176
+ onDragLeave: (p) => {
177
+ p.currentTarget.contains(p.relatedTarget) || b(null);
178
+ },
179
+ onDrop: A(a.state),
180
+ children: [
181
+ /* @__PURE__ */ l("h3", { className: "jp-pipe__col-head", children: [
182
+ /* @__PURE__ */ n("span", { className: `jp-jobcard__state jp-jobcard__state--${a.state}`, children: a.label }),
183
+ /* @__PURE__ */ n("span", { className: "jp-pipe__count", children: t.length })
184
+ ] }),
185
+ /* @__PURE__ */ n("ul", { className: "jp-pipe__cards", children: t.map((p) => /* @__PURE__ */ n(
186
+ Q,
187
+ {
188
+ item: p,
189
+ today: C,
190
+ onSelect: i,
191
+ onMove: (c, _) => {
192
+ E(c, _);
193
+ },
194
+ moving: $.has(p.job_id)
195
+ },
196
+ p.job_id
197
+ )) })
198
+ ]
199
+ },
200
+ a.state
201
+ );
202
+ }) })
203
+ ] });
204
+ }
205
+ export {
206
+ F as PIPELINE_COLUMNS,
207
+ W as PipelineBoard
208
+ };
@@ -1 +1 @@
1
- {"version":3,"file":"JobDrawer.d.ts","sourceRoot":"","sources":["../../src/components/JobDrawer.tsx"],"names":[],"mappings":"AACA,OAAO,EASL,KAAK,YAAY,EAGjB,KAAK,cAAc,EACnB,KAAK,SAAS,EACf,MAAM,aAAa,CAAA;AACpB,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,aAAa,CAAA;AAOvC,UAAU,KAAK;IACb,IAAI,EAAE,IAAI,CAAA;IACV,KAAK,EAAE,MAAM,CAAA;IACb,SAAS,EAAE,MAAM,GAAG,IAAI,CAAA;IAGxB,WAAW,CAAC,EAAE,SAAS,GAAG,IAAI,CAAA;IAC9B,OAAO,EAAE,MAAM,IAAI,CAAA;IACnB,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,YAAY,KAAK,IAAI,CAAA;IAC/D,YAAY,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,GAAG,IAAI,EAAE,OAAO,EAAE,cAAc,EAAE,KAAK,IAAI,CAAA;IACzF,sEAAsE;IACtE,gBAAgB,CAAC,EAAE,MAAM,IAAI,CAAA;CAC9B;AAkCD,wBAAgB,WAAW,CAAC,EAAE,IAAI,EAAE,EAAE;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,2CAarD;AAgFD,wBAAgB,SAAS,CAAC,EACxB,IAAI,EACJ,KAAK,EACL,SAAS,EACT,WAAW,EACX,OAAO,EACP,aAAa,EACb,YAAY,EACZ,gBAAgB,EACjB,EAAE,KAAK,2CA8eP"}
1
+ {"version":3,"file":"JobDrawer.d.ts","sourceRoot":"","sources":["../../src/components/JobDrawer.tsx"],"names":[],"mappings":"AACA,OAAO,EASL,KAAK,YAAY,EAGjB,KAAK,cAAc,EACnB,KAAK,SAAS,EACf,MAAM,aAAa,CAAA;AACpB,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,aAAa,CAAA;AAYvC,UAAU,KAAK;IACb,IAAI,EAAE,IAAI,CAAA;IACV,KAAK,EAAE,MAAM,CAAA;IACb,SAAS,EAAE,MAAM,GAAG,IAAI,CAAA;IAGxB,WAAW,CAAC,EAAE,SAAS,GAAG,IAAI,CAAA;IAC9B,OAAO,EAAE,MAAM,IAAI,CAAA;IACnB,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,YAAY,KAAK,IAAI,CAAA;IAC/D,YAAY,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,GAAG,IAAI,EAAE,OAAO,EAAE,cAAc,EAAE,KAAK,IAAI,CAAA;IACzF,sEAAsE;IACtE,gBAAgB,CAAC,EAAE,MAAM,IAAI,CAAA;CAC9B;AAkCD,wBAAgB,WAAW,CAAC,EAAE,IAAI,EAAE,EAAE;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,2CAarD;AAgFD,wBAAgB,SAAS,CAAC,EACxB,IAAI,EACJ,KAAK,EACL,SAAS,EACT,WAAW,EACX,OAAO,EACP,aAAa,EACb,YAAY,EACZ,gBAAgB,EACjB,EAAE,KAAK,2CAgfP"}