jsonresume-theme-diagonal-accent-bar 1.1.12 → 1.1.14

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/CHANGELOG.md CHANGED
@@ -1,5 +1,18 @@
1
1
  # jsonresume-theme-diagonal-accent-bar
2
2
 
3
+ ## 1.1.14
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [601e883]
8
+ - @jsonresume/core@0.4.1
9
+
10
+ ## 1.1.13
11
+
12
+ ### Patch Changes
13
+
14
+ - 2b3af11: Render inline Markdown (bold, emphasis, code, links) in summaries, descriptions and highlights with the shared renderer from @jsonresume/core (#600).
15
+
3
16
  ## 1.1.12
4
17
 
5
18
  ### Patch Changes
package/dist/index.js CHANGED
@@ -1455,6 +1455,50 @@ function SectionTitle({
1455
1455
  }
1456
1456
  );
1457
1457
  }
1458
+ const ESCAPES = {
1459
+ "&": "&",
1460
+ "<": "&lt;",
1461
+ ">": "&gt;",
1462
+ '"': "&quot;",
1463
+ "'": "&#39;"
1464
+ };
1465
+ const escapeHtml = (text) => text.replace(/[&<>"']/g, (c) => ESCAPES[c]);
1466
+ const ESCAPABLE = /\\([\\`*_[\]()!#])/g;
1467
+ const CODE = /`([^`]+)`/g;
1468
+ const LINK = /\[([^\]]+)\]\(([^)\s]+)\)/g;
1469
+ const STRONG = /\*\*(?=\S)([^*]*?\S)\*\*|__(?=\S)([^_]*?\S)__/g;
1470
+ const EMPHASIS = /\*(?=\S)([^*]*?\S)\*|(^|[^\p{L}\p{N}_])_(?=\S)([^_]*?\S)_(?![\p{L}\p{N}_])/gu;
1471
+ const safeHref = (url) => /^(https?:\/\/|mailto:)/i.test(url) ? url : void 0;
1472
+ const emphasis = (text, strong, em) => text.replace(STRONG, (_2, a, b2) => strong(a ?? b2)).replace(
1473
+ EMPHASIS,
1474
+ (_2, a, before, b2) => a !== void 0 ? em(a) : `${before}${em(b2)}`
1475
+ );
1476
+ const inline = (text, out) => {
1477
+ const kept = [];
1478
+ const keep = (value) => `${kept.push(value) - 1}`;
1479
+ const marks = (t) => emphasis(t, out.strong, out.em);
1480
+ const rest = text.replace(/\uE000/g, "").replace(ESCAPABLE, (_2, c) => keep(out.text(c))).replace(CODE, (_2, body) => keep(out.code(body))).replace(
1481
+ LINK,
1482
+ (_2, label, url) => keep(out.link(marks(out.text(label)), url))
1483
+ );
1484
+ return marks(out.text(rest)).replace(
1485
+ /\uE000(\d+)\uE000/g,
1486
+ (_2, i) => kept[Number(i)]
1487
+ );
1488
+ };
1489
+ function renderInlineMarkdown(text) {
1490
+ if (typeof text !== "string") return "";
1491
+ return inline(text, {
1492
+ text: escapeHtml,
1493
+ code: (body) => `<code>${escapeHtml(body)}</code>`,
1494
+ link: (label, url) => {
1495
+ const href = safeHref(url);
1496
+ return href ? `<a href="${escapeHtml(href)}">${label}</a>` : label;
1497
+ },
1498
+ strong: (t) => `<strong>${t}</strong>`,
1499
+ em: (t) => `<em>${t}</em>`
1500
+ });
1501
+ }
1458
1502
  dt.div`
1459
1503
  margin-bottom: ${(props) => props.theme?.spacing?.item || "var(--resume-space-item, 1rem)"};
1460
1504
 
@@ -1783,6 +1827,15 @@ dt.span`
1783
1827
  }
1784
1828
  }
1785
1829
  `;
1830
+ function InlineMarkdown({ text, as: Tag = "span", ...rest }) {
1831
+ return /* @__PURE__ */ jsx(
1832
+ Tag,
1833
+ {
1834
+ ...rest,
1835
+ dangerouslySetInnerHTML: { __html: renderInlineMarkdown(text) }
1836
+ }
1837
+ );
1838
+ }
1786
1839
  dt.hr`
1787
1840
  border: none;
1788
1841
  border-top: 0.5pt solid
@@ -6349,7 +6402,7 @@ function Resume({ resume }) {
6349
6402
  /* @__PURE__ */ jsx(Name, { children: basics.name }),
6350
6403
  basics.label && /* @__PURE__ */ jsx(Label, { children: basics.label }),
6351
6404
  /* @__PURE__ */ jsx(StyledContactInfo, { basics }),
6352
- basics.summary && /* @__PURE__ */ jsx(Summary, { children: basics.summary })
6405
+ basics.summary && /* @__PURE__ */ jsx(InlineMarkdown, { as: Summary, text: basics.summary })
6353
6406
  ] }),
6354
6407
  work?.length > 0 && /* @__PURE__ */ jsxs(Section, { children: [
6355
6408
  /* @__PURE__ */ jsx(StyledSectionTitle, { children: "Experience" }),
@@ -6361,8 +6414,8 @@ function Resume({ resume }) {
6361
6414
  ] }),
6362
6415
  /* @__PURE__ */ jsx(DateText, { children: /* @__PURE__ */ jsx(DateRange, { startDate: job.startDate, endDate: job.endDate }) })
6363
6416
  ] }),
6364
- job.summary && /* @__PURE__ */ jsx(WorkSummary, { children: job.summary }),
6365
- job.highlights?.length > 0 && /* @__PURE__ */ jsx(Highlights, { children: job.highlights.map((highlight, i) => /* @__PURE__ */ jsx("li", { children: highlight }, i)) })
6417
+ job.summary && /* @__PURE__ */ jsx(InlineMarkdown, { as: WorkSummary, text: job.summary }),
6418
+ job.highlights?.length > 0 && /* @__PURE__ */ jsx(Highlights, { children: job.highlights.map((highlight, i) => /* @__PURE__ */ jsx(InlineMarkdown, { as: "li", text: highlight }, i)) })
6366
6419
  ] }, index))
6367
6420
  ] }),
6368
6421
  skills?.length > 0 && /* @__PURE__ */ jsxs(Section, { children: [
@@ -6389,8 +6442,8 @@ function Resume({ resume }) {
6389
6442
  /* @__PURE__ */ jsx(StyledSectionTitle, { children: "Projects" }),
6390
6443
  projects.map((project, index) => /* @__PURE__ */ jsxs(WorkItem, { children: [
6391
6444
  /* @__PURE__ */ jsx(Position, { children: project.name }),
6392
- project.description && /* @__PURE__ */ jsx(WorkSummary, { children: project.description }),
6393
- project.highlights?.length > 0 && /* @__PURE__ */ jsx(Highlights, { children: project.highlights.map((highlight, i) => /* @__PURE__ */ jsx("li", { children: highlight }, i)) })
6445
+ project.description && /* @__PURE__ */ jsx(InlineMarkdown, { as: WorkSummary, text: project.description }),
6446
+ project.highlights?.length > 0 && /* @__PURE__ */ jsx(Highlights, { children: project.highlights.map((highlight, i) => /* @__PURE__ */ jsx(InlineMarkdown, { as: "li", text: highlight }, i)) })
6394
6447
  ] }, index))
6395
6448
  ] }),
6396
6449
  volunteer?.length > 0 && /* @__PURE__ */ jsxs(Section, { children: [
@@ -6409,8 +6462,8 @@ function Resume({ resume }) {
6409
6462
  }
6410
6463
  ) })
6411
6464
  ] }),
6412
- vol.summary && /* @__PURE__ */ jsx(WorkSummary, { children: vol.summary }),
6413
- vol.highlights?.length > 0 && /* @__PURE__ */ jsx(Highlights, { children: vol.highlights.map((highlight, i) => /* @__PURE__ */ jsx("li", { children: highlight }, i)) })
6465
+ vol.summary && /* @__PURE__ */ jsx(InlineMarkdown, { as: WorkSummary, text: vol.summary }),
6466
+ vol.highlights?.length > 0 && /* @__PURE__ */ jsx(Highlights, { children: vol.highlights.map((highlight, i) => /* @__PURE__ */ jsx(InlineMarkdown, { as: "li", text: highlight }, i)) })
6414
6467
  ] }, index))
6415
6468
  ] }),
6416
6469
  awards?.length > 0 && /* @__PURE__ */ jsxs(Section, { children: [
@@ -6422,7 +6475,7 @@ function Resume({ resume }) {
6422
6475
  award.awarder
6423
6476
  ] }),
6424
6477
  award.date && /* @__PURE__ */ jsx(EducationDate, { children: award.date }),
6425
- award.summary && /* @__PURE__ */ jsx(WorkSummary, { children: award.summary })
6478
+ award.summary && /* @__PURE__ */ jsx(InlineMarkdown, { as: WorkSummary, text: award.summary })
6426
6479
  ] }, index))
6427
6480
  ] }),
6428
6481
  publications?.length > 0 && /* @__PURE__ */ jsxs(Section, { children: [
@@ -6434,7 +6487,7 @@ function Resume({ resume }) {
6434
6487
  pub.publisher
6435
6488
  ] }),
6436
6489
  pub.releaseDate && /* @__PURE__ */ jsx(EducationDate, { children: pub.releaseDate }),
6437
- pub.summary && /* @__PURE__ */ jsx(WorkSummary, { children: pub.summary })
6490
+ pub.summary && /* @__PURE__ */ jsx(InlineMarkdown, { as: WorkSummary, text: pub.summary })
6438
6491
  ] }, index))
6439
6492
  ] }),
6440
6493
  certificates?.length > 0 && /* @__PURE__ */ jsxs(Section, { children: [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jsonresume-theme-diagonal-accent-bar",
3
- "version": "1.1.12",
3
+ "version": "1.1.14",
4
4
  "description": "Dynamic architectural design with bold diagonal accent and kinetic energy",
5
5
  "main": "./dist/index.js",
6
6
  "type": "module",
@@ -21,7 +21,7 @@
21
21
  "react-dom": "^18.0.0 || ^19.0.0"
22
22
  },
23
23
  "dependencies": {
24
- "@jsonresume/core": "0.4.0",
24
+ "@jsonresume/core": "0.4.1",
25
25
  "styled-components": "6.1.19"
26
26
  },
27
27
  "exports": {
package/src/Resume.jsx CHANGED
@@ -5,6 +5,7 @@ import {
5
5
  SectionTitle,
6
6
  DateRange,
7
7
  ContactInfo,
8
+ InlineMarkdown,
8
9
  } from '@jsonresume/core';
9
10
 
10
11
  const Layout = styled.div`
@@ -286,7 +287,9 @@ function Resume({ resume }) {
286
287
  <Name>{basics.name}</Name>
287
288
  {basics.label && <Label>{basics.label}</Label>}
288
289
  <StyledContactInfo basics={basics} />
289
- {basics.summary && <Summary>{basics.summary}</Summary>}
290
+ {basics.summary && (
291
+ <InlineMarkdown as={Summary} text={basics.summary} />
292
+ )}
290
293
  </Header>
291
294
 
292
295
  {work?.length > 0 && (
@@ -303,11 +306,13 @@ function Resume({ resume }) {
303
306
  <DateRange startDate={job.startDate} endDate={job.endDate} />
304
307
  </DateText>
305
308
  </WorkHeader>
306
- {job.summary && <WorkSummary>{job.summary}</WorkSummary>}
309
+ {job.summary && (
310
+ <InlineMarkdown as={WorkSummary} text={job.summary} />
311
+ )}
307
312
  {job.highlights?.length > 0 && (
308
313
  <Highlights>
309
314
  {job.highlights.map((highlight, i) => (
310
- <li key={i}>{highlight}</li>
315
+ <InlineMarkdown as="li" key={i} text={highlight} />
311
316
  ))}
312
317
  </Highlights>
313
318
  )}
@@ -357,12 +362,12 @@ function Resume({ resume }) {
357
362
  <WorkItem key={index}>
358
363
  <Position>{project.name}</Position>
359
364
  {project.description && (
360
- <WorkSummary>{project.description}</WorkSummary>
365
+ <InlineMarkdown as={WorkSummary} text={project.description} />
361
366
  )}
362
367
  {project.highlights?.length > 0 && (
363
368
  <Highlights>
364
369
  {project.highlights.map((highlight, i) => (
365
- <li key={i}>{highlight}</li>
370
+ <InlineMarkdown as="li" key={i} text={highlight} />
366
371
  ))}
367
372
  </Highlights>
368
373
  )}
@@ -390,11 +395,13 @@ function Resume({ resume }) {
390
395
  </DateText>
391
396
  )}
392
397
  </WorkHeader>
393
- {vol.summary && <WorkSummary>{vol.summary}</WorkSummary>}
398
+ {vol.summary && (
399
+ <InlineMarkdown as={WorkSummary} text={vol.summary} />
400
+ )}
394
401
  {vol.highlights?.length > 0 && (
395
402
  <Highlights>
396
403
  {vol.highlights.map((highlight, i) => (
397
- <li key={i}>{highlight}</li>
404
+ <InlineMarkdown as="li" key={i} text={highlight} />
398
405
  ))}
399
406
  </Highlights>
400
407
  )}
@@ -411,7 +418,9 @@ function Resume({ resume }) {
411
418
  <Institution>{award.title}</Institution>
412
419
  {award.awarder && <Degree>Awarded by {award.awarder}</Degree>}
413
420
  {award.date && <EducationDate>{award.date}</EducationDate>}
414
- {award.summary && <WorkSummary>{award.summary}</WorkSummary>}
421
+ {award.summary && (
422
+ <InlineMarkdown as={WorkSummary} text={award.summary} />
423
+ )}
415
424
  </EducationItem>
416
425
  ))}
417
426
  </Section>
@@ -427,7 +436,9 @@ function Resume({ resume }) {
427
436
  {pub.releaseDate && (
428
437
  <EducationDate>{pub.releaseDate}</EducationDate>
429
438
  )}
430
- {pub.summary && <WorkSummary>{pub.summary}</WorkSummary>}
439
+ {pub.summary && (
440
+ <InlineMarkdown as={WorkSummary} text={pub.summary} />
441
+ )}
431
442
  </EducationItem>
432
443
  ))}
433
444
  </Section>