jsonresume-theme-sales-hunter 0.2.1 → 0.2.3

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,20 @@
1
1
  # jsonresume-theme-sales-hunter
2
2
 
3
+ ## 0.2.3
4
+
5
+ ### Patch Changes
6
+
7
+ - 8973d5a: use @jsonresume/core/ssr renderResumeDocument
8
+ - Updated dependencies [ff09f75]
9
+ - @jsonresume/core@0.3.1
10
+
11
+ ## 0.2.2
12
+
13
+ ### Patch Changes
14
+
15
+ - Updated dependencies [ff0f85b]
16
+ - @jsonresume/core@0.3.0
17
+
3
18
  ## 0.2.1
4
19
 
5
20
  ### Patch Changes
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { jsx, jsxs } from "react/jsx-runtime";
2
+ import { renderToStaticMarkup } from "react-dom/server";
2
3
  import o, { useRef, useContext, useState, useMemo, useEffect, useDebugValue, createElement, createContext } from "react";
3
- import { renderToString } from "react-dom/server";
4
4
  var __assign = function() {
5
5
  __assign = Object.assign || function __assign2(t) {
6
6
  for (var s, i = 1, n = arguments.length; i < n; i++) {
@@ -100,8 +100,8 @@ function replace(value, pattern, replacement) {
100
100
  function indexof(value, search, position2) {
101
101
  return value.indexOf(search, position2);
102
102
  }
103
- function charat(value, index) {
104
- return value.charCodeAt(index) | 0;
103
+ function charat(value, index2) {
104
+ return value.charCodeAt(index2) | 0;
105
105
  }
106
106
  function substr(value, begin, end) {
107
107
  return value.slice(begin, end);
@@ -219,11 +219,11 @@ function whitespace(type) {
219
219
  break;
220
220
  return token(type) > 2 || token(character) > 3 ? "" : " ";
221
221
  }
222
- function escaping(index, count) {
222
+ function escaping(index2, count) {
223
223
  while (--count && next())
224
224
  if (character < 48 || character > 102 || character > 57 && character < 65 || character > 70 && character < 97)
225
225
  break;
226
- return slice(index, caret() + (count < 6 && peek() == 32 && next() == 32));
226
+ return slice(index2, caret() + (count < 6 && peek() == 32 && next() == 32));
227
227
  }
228
228
  function delimiter(type) {
229
229
  while (next())
@@ -249,24 +249,24 @@ function delimiter(type) {
249
249
  }
250
250
  return position;
251
251
  }
252
- function commenter(type, index) {
252
+ function commenter(type, index2) {
253
253
  while (next())
254
254
  if (type + character === 47 + 10)
255
255
  break;
256
256
  else if (type + character === 42 + 42 && peek() === 47)
257
257
  break;
258
- return "/*" + slice(index, position - 1) + "*" + from(type === 47 ? type : next());
258
+ return "/*" + slice(index2, position - 1) + "*" + from(type === 47 ? type : next());
259
259
  }
260
- function identifier(index) {
260
+ function identifier(index2) {
261
261
  while (!token(peek()))
262
262
  next();
263
- return slice(index, position);
263
+ return slice(index2, position);
264
264
  }
265
265
  function compile(value) {
266
266
  return dealloc(parse("", null, null, null, [""], value = alloc(value), 0, [0], value));
267
267
  }
268
268
  function parse(value, root, parent, rule, rules, rulesets, pseudo, points, declarations) {
269
- var index = 0;
269
+ var index2 = 0;
270
270
  var offset = 0;
271
271
  var length2 = pseudo;
272
272
  var atrule = 0;
@@ -286,7 +286,7 @@ function parse(value, root, parent, rule, rules, rulesets, pseudo, points, decla
286
286
  // (
287
287
  case 40:
288
288
  if (previous != 108 && charat(characters2, length2 - 1) == 58) {
289
- if (indexof(characters2 += replace(delimit(character2), "&", "&\f"), "&\f", abs(index ? points[index - 1] : 0)) != -1)
289
+ if (indexof(characters2 += replace(delimit(character2), "&", "&\f"), "&\f", abs(index2 ? points[index2 - 1] : 0)) != -1)
290
290
  ampersand = -1;
291
291
  break;
292
292
  }
@@ -320,7 +320,7 @@ function parse(value, root, parent, rule, rules, rulesets, pseudo, points, decla
320
320
  break;
321
321
  // {
322
322
  case 123 * variable:
323
- points[index++] = strlen(characters2) * ampersand;
323
+ points[index2++] = strlen(characters2) * ampersand;
324
324
  // } ; \0
325
325
  case 125 * variable:
326
326
  case 59:
@@ -341,7 +341,7 @@ function parse(value, root, parent, rule, rules, rulesets, pseudo, points, decla
341
341
  characters2 += ";";
342
342
  // { rule/at-rule
343
343
  default:
344
- append(reference = ruleset(characters2, root, parent, index, offset, rules, points, type, props = [], children = [], length2, rulesets), rulesets);
344
+ append(reference = ruleset(characters2, root, parent, index2, offset, rules, points, type, props = [], children = [], length2, rulesets), rulesets);
345
345
  if (character2 === 123)
346
346
  if (offset === 0)
347
347
  parse(characters2, root, reference, reference, props, rulesets, length2, points, children);
@@ -358,7 +358,7 @@ function parse(value, root, parent, rule, rules, rulesets, pseudo, points, decla
358
358
  parse(characters2, reference, reference, reference, [""], children, 0, points, children);
359
359
  }
360
360
  }
361
- index = offset = property = 0, variable = ampersand = 1, type = characters2 = "", length2 = pseudo;
361
+ index2 = offset = property = 0, variable = ampersand = 1, type = characters2 = "", length2 = pseudo;
362
362
  break;
363
363
  // :
364
364
  case 58:
@@ -377,7 +377,7 @@ function parse(value, root, parent, rule, rules, rulesets, pseudo, points, decla
377
377
  break;
378
378
  // ,
379
379
  case 44:
380
- points[index++] = (strlen(characters2) - 1) * ampersand, ampersand = 1;
380
+ points[index2++] = (strlen(characters2) - 1) * ampersand, ampersand = 1;
381
381
  break;
382
382
  // @
383
383
  case 64:
@@ -393,11 +393,11 @@ function parse(value, root, parent, rule, rules, rulesets, pseudo, points, decla
393
393
  }
394
394
  return rulesets;
395
395
  }
396
- function ruleset(value, root, parent, index, offset, rules, points, type, props, children, length2, siblings) {
396
+ function ruleset(value, root, parent, index2, offset, rules, points, type, props, children, length2, siblings) {
397
397
  var post = offset - 1;
398
398
  var rule = offset === 0 ? rules : [""];
399
399
  var size = sizeof(rule);
400
- for (var i = 0, j2 = 0, k2 = 0; i < index; ++i)
400
+ for (var i = 0, j2 = 0, k2 = 0; i < index2; ++i)
401
401
  for (var x2 = 0, y2 = substr(value, post + 1, post = abs(j2 = points[i])), z2 = value; x2 < size; ++x2)
402
402
  if (z2 = trim(j2 > 0 ? rule[x2] + " " + y2 : replace(y2, /&\f/g, rule[x2])))
403
403
  props[k2++] = z2;
@@ -517,8 +517,8 @@ function prefix(value, length2, children) {
517
517
  // grid-(row|column)-start
518
518
  case 4384:
519
519
  case 3616:
520
- if (children && children.some(function(element, index) {
521
- return length2 = index, match(element.props, /grid-\w+-end/);
520
+ if (children && children.some(function(element, index2) {
521
+ return length2 = index2, match(element.props, /grid-\w+-end/);
522
522
  })) {
523
523
  return ~indexof(value + (children = children[length2].value), "span", 0) ? value : MS + replace(value, "-start", "") + value + MS + "grid-row-span:" + (~indexof(children, "span", 0) ? match(children, /\d+/) : +match(children, /\d+/) - +match(value, /\d+/)) + ";";
524
524
  }
@@ -600,7 +600,7 @@ function serialize(children, callback) {
600
600
  output += callback(children[i], i, children, callback) || "";
601
601
  return output;
602
602
  }
603
- function stringify(element, index, children, callback) {
603
+ function stringify(element, index2, children, callback) {
604
604
  switch (element.type) {
605
605
  case LAYER:
606
606
  if (element.children.length) break;
@@ -618,10 +618,10 @@ function stringify(element, index, children, callback) {
618
618
  }
619
619
  function middleware(collection) {
620
620
  var length2 = sizeof(collection);
621
- return function(element, index, children, callback) {
621
+ return function(element, index2, children, callback) {
622
622
  var output = "";
623
623
  for (var i = 0; i < length2; i++)
624
- output += collection[i](element, index, children, callback) || "";
624
+ output += collection[i](element, index2, children, callback) || "";
625
625
  return output;
626
626
  };
627
627
  }
@@ -633,7 +633,7 @@ function rulesheet(callback) {
633
633
  }
634
634
  };
635
635
  }
636
- function prefixer(element, index, children, callback) {
636
+ function prefixer(element, index2, children, callback) {
637
637
  if (element.length > -1) {
638
638
  if (!element.return)
639
639
  switch (element.type) {
@@ -1300,6 +1300,66 @@ var vt = /^\s*<\/[a-z]/i, gt = (function() {
1300
1300
  "production" !== process.env.NODE_ENV && "undefined" != typeof navigator && "ReactNative" === navigator.product && console.warn("It looks like you've imported 'styled-components' on React Native.\nPerhaps you're looking to import 'styled-components/native'?\nRead more about this at https://www.styled-components.com/docs/basics#react-native");
1301
1301
  var wt = "__sc-".concat(f, "__");
1302
1302
  "production" !== process.env.NODE_ENV && "test" !== process.env.NODE_ENV && "undefined" != typeof window && (window[wt] || (window[wt] = 0), 1 === window[wt] && console.warn("It looks like there are several instances of 'styled-components' initialized in this application. This may cause dynamic styles to not render properly, errors during the rehydration process, a missing theme prop, and makes your application bigger without good reason.\n\nSee https://s-c.sh/2BAXzed for more info."), window[wt] += 1);
1303
+ const CSS_RESET = "<style>*,*::before,*::after{box-sizing:border-box}html,body{margin:0;padding:0}body{-webkit-font-smoothing:antialiased}</style>";
1304
+ const TOKENS_CSS_HREF = "https://unpkg.com/@jsonresume/core/dist/tokens.css";
1305
+ const FONTS_PRECONNECT = '<link rel="preconnect" href="https://fonts.googleapis.com"><link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>';
1306
+ function isHref(value) {
1307
+ return /^(https?:)?\/\//.test(value) || value.trim().startsWith("<link");
1308
+ }
1309
+ function familyParam(family) {
1310
+ const [name, ...rest] = String(family).split(":");
1311
+ const encodedName = name.trim().replace(/\s+/g, "+");
1312
+ return rest.length ? `${encodedName}:${rest.join(":")}` : encodedName;
1313
+ }
1314
+ function googleFontsLinks(families) {
1315
+ if (!Array.isArray(families) || families.length === 0) return "";
1316
+ const passthrough = [];
1317
+ const names = [];
1318
+ for (const entry of families) {
1319
+ if (entry == null || entry === "") continue;
1320
+ if (isHref(entry)) passthrough.push(entry);
1321
+ else names.push(entry);
1322
+ }
1323
+ const links = passthrough.map(
1324
+ (href) => href.trim().startsWith("<link") ? href : `<link href="${href}" rel="stylesheet">`
1325
+ );
1326
+ if (names.length > 0) {
1327
+ const query = names.map(familyParam).join("&family=");
1328
+ links.unshift(
1329
+ `<link href="https://fonts.googleapis.com/css2?family=${query}&display=swap" rel="stylesheet">`
1330
+ );
1331
+ }
1332
+ if (links.length === 0) return "";
1333
+ return FONTS_PRECONNECT + links.join("");
1334
+ }
1335
+ function renderResumeDocument(element, options = {}) {
1336
+ const {
1337
+ fonts,
1338
+ title,
1339
+ lang = "en",
1340
+ dir = "ltr",
1341
+ reset = false,
1342
+ head = "",
1343
+ headAfterStyles = "",
1344
+ includeTokensCss = true,
1345
+ bodyClass
1346
+ } = options;
1347
+ const sheet = new gt();
1348
+ let html;
1349
+ let styleTags;
1350
+ try {
1351
+ html = renderToStaticMarkup(sheet.collectStyles(element));
1352
+ styleTags = sheet.getStyleTags();
1353
+ } finally {
1354
+ sheet.seal();
1355
+ }
1356
+ const fontLinks = googleFontsLinks(fonts);
1357
+ const tokensLink = includeTokensCss ? `<link rel="stylesheet" href="${TOKENS_CSS_HREF}">` : "";
1358
+ const resetTag = reset ? CSS_RESET : "";
1359
+ const titleTag = title ? `<title>${title}</title>` : "";
1360
+ const bodyAttr = bodyClass ? ` class="${bodyClass}"` : "";
1361
+ return `<!DOCTYPE html><html lang="${lang}" dir="${dir}"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1">` + fontLinks + tokensLink + resetTag + head + styleTags + headAfterStyles + titleTag + `</head><body${bodyAttr}>${html}</body></html>`;
1362
+ }
1303
1363
  createContext({
1304
1364
  theme: "professional",
1305
1365
  setTheme: () => {
@@ -1477,7 +1537,9 @@ function formatDateRange({
1477
1537
  return formatter.format(date);
1478
1538
  };
1479
1539
  const start = formatDate(startDate);
1480
- if (endDate === void 0) return start;
1540
+ if (endDate === void 0) {
1541
+ return start;
1542
+ }
1481
1543
  const end = formatDate(endDate);
1482
1544
  return `${start} - ${end}`;
1483
1545
  }
@@ -1562,7 +1624,6 @@ function safeUrl(url) {
1562
1624
  const trimmed = url.trim();
1563
1625
  const dangerousProtocols = /^(javascript|data|vbscript|file|about):/i;
1564
1626
  if (dangerousProtocols.test(trimmed)) {
1565
- console.warn(`[Security] Blocked dangerous URL: ${trimmed.slice(0, 50)}`);
1566
1627
  return null;
1567
1628
  }
1568
1629
  const safeProtocols = /^(https?|mailto|tel|sms|ftp):/i;
@@ -1578,7 +1639,6 @@ function safeUrl(url) {
1578
1639
  if (/^[a-z0-9][a-z0-9.-]+\.[a-z]{2,}$/i.test(trimmed)) {
1579
1640
  return `https://${trimmed}`;
1580
1641
  }
1581
- console.warn(`[Security] Uncertain URL safety: ${trimmed.slice(0, 50)}`);
1582
1642
  return trimmed;
1583
1643
  }
1584
1644
  const ContactContainer = dt.div`
@@ -1642,7 +1702,7 @@ function ContactInfo({ basics = {}, separator = "•", className }) {
1642
1702
  ) }, "url")
1643
1703
  );
1644
1704
  }
1645
- profiles.forEach((profile, index) => {
1705
+ profiles.forEach((profile, index2) => {
1646
1706
  if (profile.url) {
1647
1707
  items.push(
1648
1708
  /* @__PURE__ */ jsx(ContactItem, { children: /* @__PURE__ */ jsx(
@@ -1654,15 +1714,15 @@ function ContactInfo({ basics = {}, separator = "•", className }) {
1654
1714
  "aria-label": profile.network,
1655
1715
  children: profile.network || profile.username
1656
1716
  }
1657
- ) }, `profile-${index}`)
1717
+ ) }, `profile-${index2}`)
1658
1718
  );
1659
1719
  }
1660
1720
  });
1661
1721
  if (items.length === 0) return null;
1662
- return /* @__PURE__ */ jsx(ContactContainer, { className: `resume-contact ${className || ""}`.trim(), children: items.map((item, index) => /* @__PURE__ */ jsxs(o.Fragment, { children: [
1663
- index > 0 && /* @__PURE__ */ jsx(Separator, { "aria-hidden": "true", children: separator }),
1722
+ return /* @__PURE__ */ jsx(ContactContainer, { className: `resume-contact ${className || ""}`.trim(), children: items.map((item, index2) => /* @__PURE__ */ jsxs(o.Fragment, { children: [
1723
+ index2 > 0 && /* @__PURE__ */ jsx(Separator, { "aria-hidden": "true", children: separator }),
1664
1724
  item
1665
- ] }, index)) });
1725
+ ] }, index2)) });
1666
1726
  }
1667
1727
  dt.a`
1668
1728
  color: ${(props) => props.theme?.colors?.link || "var(--resume-color-link, #0066cc)"};
@@ -6232,7 +6292,7 @@ function Resume({ resume }) {
6232
6292
  ] }),
6233
6293
  work?.length > 0 && /* @__PURE__ */ jsxs(Section, { children: [
6234
6294
  /* @__PURE__ */ jsx(StyledSectionTitle, { children: "Experience" }),
6235
- work.map((job, index) => /* @__PURE__ */ jsxs(WorkItem, { children: [
6295
+ work.map((job, index2) => /* @__PURE__ */ jsxs(WorkItem, { children: [
6236
6296
  /* @__PURE__ */ jsxs(WorkHeader, { children: [
6237
6297
  /* @__PURE__ */ jsxs("div", { children: [
6238
6298
  /* @__PURE__ */ jsx(Position, { children: job.position }),
@@ -6250,18 +6310,18 @@ function Resume({ resume }) {
6250
6310
  },
6251
6311
  i
6252
6312
  )) })
6253
- ] }, index))
6313
+ ] }, index2))
6254
6314
  ] }),
6255
6315
  skills?.length > 0 && /* @__PURE__ */ jsxs(Section, { children: [
6256
6316
  /* @__PURE__ */ jsx(StyledSectionTitle, { children: "Skills" }),
6257
- /* @__PURE__ */ jsx(SkillsGrid, { children: skills.map((skill, index) => /* @__PURE__ */ jsxs(SkillCategory, { children: [
6317
+ /* @__PURE__ */ jsx(SkillsGrid, { children: skills.map((skill, index2) => /* @__PURE__ */ jsxs(SkillCategory, { children: [
6258
6318
  /* @__PURE__ */ jsx(SkillName, { children: skill.name }),
6259
6319
  skill.keywords?.length > 0 && /* @__PURE__ */ jsx(SkillTags, { children: skill.keywords.join(", ") })
6260
- ] }, index)) })
6320
+ ] }, index2)) })
6261
6321
  ] }),
6262
6322
  education?.length > 0 && /* @__PURE__ */ jsxs(Section, { children: [
6263
6323
  /* @__PURE__ */ jsx(StyledSectionTitle, { children: "Education" }),
6264
- education.map((edu, index) => /* @__PURE__ */ jsxs(EducationItem, { children: [
6324
+ education.map((edu, index2) => /* @__PURE__ */ jsxs(EducationItem, { children: [
6265
6325
  /* @__PURE__ */ jsx(Institution, { children: edu.institution }),
6266
6326
  /* @__PURE__ */ jsxs(Degree, { children: [
6267
6327
  edu.studyType,
@@ -6270,11 +6330,11 @@ function Resume({ resume }) {
6270
6330
  edu.score && ` • ${edu.score}`
6271
6331
  ] }),
6272
6332
  /* @__PURE__ */ jsx(EducationDate, { children: /* @__PURE__ */ jsx(DateRange, { startDate: edu.startDate, endDate: edu.endDate }) })
6273
- ] }, index))
6333
+ ] }, index2))
6274
6334
  ] }),
6275
6335
  projects?.length > 0 && /* @__PURE__ */ jsxs(Section, { children: [
6276
6336
  /* @__PURE__ */ jsx(StyledSectionTitle, { children: "Projects" }),
6277
- projects.map((project, index) => /* @__PURE__ */ jsxs(WorkItem, { children: [
6337
+ projects.map((project, index2) => /* @__PURE__ */ jsxs(WorkItem, { children: [
6278
6338
  /* @__PURE__ */ jsx(Position, { children: project.name }),
6279
6339
  project.description && /* @__PURE__ */ jsx(WorkSummary, { children: project.description }),
6280
6340
  project.highlights?.length > 0 && /* @__PURE__ */ jsx(Highlights, { children: project.highlights.map((highlight, i) => /* @__PURE__ */ jsx(
@@ -6286,11 +6346,11 @@ function Resume({ resume }) {
6286
6346
  },
6287
6347
  i
6288
6348
  )) })
6289
- ] }, index))
6349
+ ] }, index2))
6290
6350
  ] }),
6291
6351
  volunteer?.length > 0 && /* @__PURE__ */ jsxs(Section, { children: [
6292
6352
  /* @__PURE__ */ jsx(StyledSectionTitle, { children: "Volunteer" }),
6293
- volunteer.map((vol, index) => /* @__PURE__ */ jsxs(WorkItem, { children: [
6353
+ volunteer.map((vol, index2) => /* @__PURE__ */ jsxs(WorkItem, { children: [
6294
6354
  /* @__PURE__ */ jsxs(WorkHeader, { children: [
6295
6355
  /* @__PURE__ */ jsxs("div", { children: [
6296
6356
  /* @__PURE__ */ jsx(Position, { children: vol.position }),
@@ -6314,11 +6374,11 @@ function Resume({ resume }) {
6314
6374
  },
6315
6375
  i
6316
6376
  )) })
6317
- ] }, index))
6377
+ ] }, index2))
6318
6378
  ] }),
6319
6379
  awards?.length > 0 && /* @__PURE__ */ jsxs(Section, { children: [
6320
6380
  /* @__PURE__ */ jsx(StyledSectionTitle, { children: "Awards" }),
6321
- awards.map((award, index) => /* @__PURE__ */ jsxs(EducationItem, { children: [
6381
+ awards.map((award, index2) => /* @__PURE__ */ jsxs(EducationItem, { children: [
6322
6382
  /* @__PURE__ */ jsx(Institution, { children: award.title }),
6323
6383
  award.awarder && /* @__PURE__ */ jsxs(Degree, { children: [
6324
6384
  "Awarded by ",
@@ -6326,22 +6386,22 @@ function Resume({ resume }) {
6326
6386
  ] }),
6327
6387
  award.date && /* @__PURE__ */ jsx(EducationDate, { children: award.date }),
6328
6388
  award.summary && /* @__PURE__ */ jsx(WorkSummary, { children: award.summary })
6329
- ] }, index))
6389
+ ] }, index2))
6330
6390
  ] }),
6331
6391
  certificates?.length > 0 && /* @__PURE__ */ jsxs(Section, { children: [
6332
6392
  /* @__PURE__ */ jsx(StyledSectionTitle, { children: "Certificates" }),
6333
- certificates.map((cert, index) => /* @__PURE__ */ jsxs(EducationItem, { children: [
6393
+ certificates.map((cert, index2) => /* @__PURE__ */ jsxs(EducationItem, { children: [
6334
6394
  /* @__PURE__ */ jsx(Institution, { children: cert.name }),
6335
6395
  cert.issuer && /* @__PURE__ */ jsxs(Degree, { children: [
6336
6396
  "Issued by ",
6337
6397
  cert.issuer
6338
6398
  ] }),
6339
6399
  cert.date && /* @__PURE__ */ jsx(EducationDate, { children: cert.date })
6340
- ] }, index))
6400
+ ] }, index2))
6341
6401
  ] }),
6342
6402
  publications?.length > 0 && /* @__PURE__ */ jsxs(Section, { children: [
6343
6403
  /* @__PURE__ */ jsx(StyledSectionTitle, { children: "Publications" }),
6344
- publications.map((pub, index) => /* @__PURE__ */ jsxs(EducationItem, { children: [
6404
+ publications.map((pub, index2) => /* @__PURE__ */ jsxs(EducationItem, { children: [
6345
6405
  /* @__PURE__ */ jsx(Institution, { children: pub.name }),
6346
6406
  pub.publisher && /* @__PURE__ */ jsxs(Degree, { children: [
6347
6407
  "Published by ",
@@ -6349,49 +6409,39 @@ function Resume({ resume }) {
6349
6409
  ] }),
6350
6410
  pub.releaseDate && /* @__PURE__ */ jsx(EducationDate, { children: pub.releaseDate }),
6351
6411
  pub.summary && /* @__PURE__ */ jsx(WorkSummary, { children: pub.summary })
6352
- ] }, index))
6412
+ ] }, index2))
6353
6413
  ] }),
6354
6414
  languages?.length > 0 && /* @__PURE__ */ jsxs(Section, { children: [
6355
6415
  /* @__PURE__ */ jsx(StyledSectionTitle, { children: "Languages" }),
6356
- /* @__PURE__ */ jsx(SkillsGrid, { children: languages.map((lang, index) => /* @__PURE__ */ jsxs(SkillCategory, { children: [
6416
+ /* @__PURE__ */ jsx(SkillsGrid, { children: languages.map((lang, index2) => /* @__PURE__ */ jsxs(SkillCategory, { children: [
6357
6417
  /* @__PURE__ */ jsx(SkillName, { children: lang.language }),
6358
6418
  lang.fluency && /* @__PURE__ */ jsx(SkillTags, { children: lang.fluency })
6359
- ] }, index)) })
6419
+ ] }, index2)) })
6360
6420
  ] }),
6361
6421
  interests?.length > 0 && /* @__PURE__ */ jsxs(Section, { children: [
6362
6422
  /* @__PURE__ */ jsx(StyledSectionTitle, { children: "Interests" }),
6363
- /* @__PURE__ */ jsx(SkillsGrid, { children: interests.map((interest, index) => /* @__PURE__ */ jsxs(SkillCategory, { children: [
6423
+ /* @__PURE__ */ jsx(SkillsGrid, { children: interests.map((interest, index2) => /* @__PURE__ */ jsxs(SkillCategory, { children: [
6364
6424
  /* @__PURE__ */ jsx(SkillName, { children: interest.name }),
6365
6425
  interest.keywords?.length > 0 && /* @__PURE__ */ jsx(SkillTags, { children: interest.keywords.join(", ") })
6366
- ] }, index)) })
6426
+ ] }, index2)) })
6367
6427
  ] }),
6368
6428
  references?.length > 0 && /* @__PURE__ */ jsxs(Section, { children: [
6369
6429
  /* @__PURE__ */ jsx(StyledSectionTitle, { children: "References" }),
6370
- references.map((ref, index) => /* @__PURE__ */ jsxs(EducationItem, { children: [
6430
+ references.map((ref, index2) => /* @__PURE__ */ jsxs(EducationItem, { children: [
6371
6431
  /* @__PURE__ */ jsx(Institution, { children: ref.name }),
6372
6432
  ref.reference && /* @__PURE__ */ jsx(WorkSummary, { children: ref.reference })
6373
- ] }, index))
6433
+ ] }, index2))
6374
6434
  ] })
6375
6435
  ] });
6376
6436
  }
6377
6437
  function render(resume) {
6378
- const sheet = new gt();
6379
- try {
6380
- const html = renderToString(
6381
- sheet.collectStyles(/* @__PURE__ */ jsx(Resume, { resume }))
6382
- );
6383
- const styles = sheet.getStyleTags();
6384
- return `<!DOCTYPE html>
6385
- <html lang="en">
6386
- <head>
6387
- <meta charset="UTF-8">
6388
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
6389
- <title>${resume.basics?.name || "Resume"} - Resume</title>
6390
- <link rel="preconnect" href="https://fonts.googleapis.com">
6391
- <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
6392
- <link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700;800&display=swap" rel="stylesheet">
6393
- ${styles}
6394
- <style>
6438
+ return renderResumeDocument(/* @__PURE__ */ jsx(Resume, { resume }), {
6439
+ fonts: ["Inter:wght@400;600;700;800"],
6440
+ title: `${resume.basics?.name || "Resume"} - Resume`,
6441
+ lang: "en",
6442
+ dir: "ltr",
6443
+ includeTokensCss: false,
6444
+ headAfterStyles: `<style>
6395
6445
  * {
6396
6446
  box-sizing: border-box;
6397
6447
  margin: 0;
@@ -6410,16 +6460,11 @@ function render(resume) {
6410
6460
  margin: 0.5in;
6411
6461
  }
6412
6462
  }
6413
- </style>
6414
- </head>
6415
- <body>
6416
- ${html}
6417
- </body>
6418
- </html>`;
6419
- } finally {
6420
- sheet.seal();
6421
- }
6463
+ </style>`
6464
+ });
6422
6465
  }
6466
+ const index = { render };
6423
6467
  export {
6468
+ index as default,
6424
6469
  render
6425
6470
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jsonresume-theme-sales-hunter",
3
- "version": "0.2.1",
3
+ "version": "0.2.3",
4
4
  "description": "Sales professionals - numbers, quotas, performance metrics highly visible",
5
5
  "main": "./dist/index.js",
6
6
  "type": "module",
@@ -19,7 +19,7 @@
19
19
  },
20
20
  "dependencies": {
21
21
  "styled-components": "^6.1.19",
22
- "@jsonresume/core": "0.2.0"
22
+ "@jsonresume/core": "0.3.1"
23
23
  },
24
24
  "exports": {
25
25
  ".": {
package/src/index.jsx CHANGED
@@ -1,28 +1,14 @@
1
- import React from 'react';
2
- import { renderToString } from 'react-dom/server';
3
- import { ServerStyleSheet } from 'styled-components';
1
+ import { renderResumeDocument } from '@jsonresume/core/ssr';
4
2
  import Resume from './Resume.jsx';
5
3
 
6
4
  export function render(resume) {
7
- const sheet = new ServerStyleSheet();
8
-
9
- try {
10
- const html = renderToString(
11
- sheet.collectStyles(<Resume resume={resume} />)
12
- );
13
- const styles = sheet.getStyleTags();
14
-
15
- return `<!DOCTYPE html>
16
- <html lang="en">
17
- <head>
18
- <meta charset="UTF-8">
19
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
20
- <title>${resume.basics?.name || 'Resume'} - Resume</title>
21
- <link rel="preconnect" href="https://fonts.googleapis.com">
22
- <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
23
- <link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700;800&display=swap" rel="stylesheet">
24
- ${styles}
25
- <style>
5
+ return renderResumeDocument(<Resume resume={resume} />, {
6
+ fonts: ['Inter:wght@400;600;700;800'],
7
+ title: `${resume.basics?.name || 'Resume'} - Resume`,
8
+ lang: 'en',
9
+ dir: 'ltr',
10
+ includeTokensCss: false,
11
+ headAfterStyles: `<style>
26
12
  * {
27
13
  box-sizing: border-box;
28
14
  margin: 0;
@@ -41,13 +27,8 @@ export function render(resume) {
41
27
  margin: 0.5in;
42
28
  }
43
29
  }
44
- </style>
45
- </head>
46
- <body>
47
- ${html}
48
- </body>
49
- </html>`;
50
- } finally {
51
- sheet.seal();
52
- }
30
+ </style>`,
31
+ });
53
32
  }
33
+
34
+ export default { render };