Compare commits

...

7 Commits

6 changed files with 104 additions and 11 deletions

View File

@ -1,3 +1,4 @@
import { isLocalFont } from "@reactive-resume/utils";
import { useEffect, useMemo } from "react"; import { useEffect, useMemo } from "react";
import { Helmet } from "react-helmet-async"; import { Helmet } from "react-helmet-async";
import { Outlet } from "react-router"; import { Outlet } from "react-router";
@ -18,6 +19,18 @@ export const ArtboardPage = () => {
}, [metadata.typography.font]); }, [metadata.typography.font]);
useEffect(() => { useEffect(() => {
const family = metadata.typography.font.family;
if (isLocalFont(family)) {
let frame = 0;
frame = requestAnimationFrame(() => {
const width = window.document.body.offsetWidth;
const height = window.document.body.offsetHeight;
const message = { type: "PAGE_LOADED", payload: { width, height } };
window.postMessage(message, "*");
});
return () => { cancelAnimationFrame(frame); };
}
webfontloader.load({ webfontloader.load({
google: { families: [fontString] }, google: { families: [fontString] },
active: () => { active: () => {

View File

@ -8,7 +8,7 @@ msgstr ""
"Language: fr\n" "Language: fr\n"
"Project-Id-Version: reactive-resume\n" "Project-Id-Version: reactive-resume\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2025-11-04 14:22\n" "PO-Revision-Date: 2025-11-12 00:11\n"
"Last-Translator: \n" "Last-Translator: \n"
"Language-Team: French\n" "Language-Team: French\n"
"Plural-Forms: nplurals=2; plural=(n > 1);\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n"
@ -180,7 +180,7 @@ msgstr "Êtes-vous sûr de vouloir verrouiller ce CV ?"
#: apps/client/src/pages/dashboard/settings/_sections/danger.tsx:94 #: apps/client/src/pages/dashboard/settings/_sections/danger.tsx:94
msgid "Are you sure?" msgid "Are you sure?"
msgstr "Etes-vous sûr?" msgstr "Êtes-vous sûr ?"
#. For example, Computer Science or Business Administration #. For example, Computer Science or Business Administration
#: apps/client/src/pages/builder/sidebars/left/dialogs/education.tsx:73 #: apps/client/src/pages/builder/sidebars/left/dialogs/education.tsx:73
@ -314,13 +314,13 @@ msgstr "Le code doit comporter exactement 6 chiffres."
#: apps/client/src/pages/builder/sidebars/left/index.tsx:272 #: apps/client/src/pages/builder/sidebars/left/index.tsx:272
msgid "Collapse All" msgid "Collapse All"
msgstr "" msgstr "Tout réduire"
#: apps/client/src/pages/builder/sidebars/left/sections/basics.tsx:30 #: apps/client/src/pages/builder/sidebars/left/sections/basics.tsx:30
#: apps/client/src/pages/builder/sidebars/left/sections/shared/section-base.tsx:115 #: apps/client/src/pages/builder/sidebars/left/sections/shared/section-base.tsx:115
#: apps/client/src/pages/builder/sidebars/left/sections/summary.tsx:33 #: apps/client/src/pages/builder/sidebars/left/sections/summary.tsx:33
msgid "Collapse section" msgid "Collapse section"
msgstr "" msgstr "Réduire la section"
#: apps/client/src/pages/builder/sidebars/left/sections/shared/section-options.tsx:136 #: apps/client/src/pages/builder/sidebars/left/sections/shared/section-options.tsx:136
msgid "Columns" msgid "Columns"
@ -583,13 +583,13 @@ msgstr "Même si vous n'êtes pas en mesure de contribuer financièrement, vous
#: apps/client/src/pages/builder/sidebars/left/index.tsx:271 #: apps/client/src/pages/builder/sidebars/left/index.tsx:271
msgid "Expand All" msgid "Expand All"
msgstr "" msgstr "Tout développer"
#: apps/client/src/pages/builder/sidebars/left/sections/basics.tsx:30 #: apps/client/src/pages/builder/sidebars/left/sections/basics.tsx:30
#: apps/client/src/pages/builder/sidebars/left/sections/shared/section-base.tsx:115 #: apps/client/src/pages/builder/sidebars/left/sections/shared/section-base.tsx:115
#: apps/client/src/pages/builder/sidebars/left/sections/summary.tsx:33 #: apps/client/src/pages/builder/sidebars/left/sections/summary.tsx:33
msgid "Expand section" msgid "Expand section"
msgstr "" msgstr "Développer la section"
#: apps/client/src/pages/home/sections/templates/index.tsx:12 #: apps/client/src/pages/home/sections/templates/index.tsx:12
msgid "Explore the templates available in Reactive Resume and view the resumes crafted with them. They could also serve as examples to help guide the creation of your next resume." msgid "Explore the templates available in Reactive Resume and view the resumes crafted with them. They could also serve as examples to help guide the creation of your next resume."

View File

@ -8,7 +8,7 @@ msgstr ""
"Language: te\n" "Language: te\n"
"Project-Id-Version: reactive-resume\n" "Project-Id-Version: reactive-resume\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2025-11-04 14:22\n" "PO-Revision-Date: 2025-11-06 00:11\n"
"Last-Translator: \n" "Last-Translator: \n"
"Language-Team: Telugu\n" "Language-Team: Telugu\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n"
@ -314,13 +314,13 @@ msgstr "కోడ్ ఖచ్చితంగా 6 అంకెలు ఉండ
#: apps/client/src/pages/builder/sidebars/left/index.tsx:272 #: apps/client/src/pages/builder/sidebars/left/index.tsx:272
msgid "Collapse All" msgid "Collapse All"
msgstr "" msgstr "అన్నిటినీ మూసివేయి"
#: apps/client/src/pages/builder/sidebars/left/sections/basics.tsx:30 #: apps/client/src/pages/builder/sidebars/left/sections/basics.tsx:30
#: apps/client/src/pages/builder/sidebars/left/sections/shared/section-base.tsx:115 #: apps/client/src/pages/builder/sidebars/left/sections/shared/section-base.tsx:115
#: apps/client/src/pages/builder/sidebars/left/sections/summary.tsx:33 #: apps/client/src/pages/builder/sidebars/left/sections/summary.tsx:33
msgid "Collapse section" msgid "Collapse section"
msgstr "" msgstr "విభాగాన్ని మూసివేయి"
#: apps/client/src/pages/builder/sidebars/left/sections/shared/section-options.tsx:136 #: apps/client/src/pages/builder/sidebars/left/sections/shared/section-options.tsx:136
msgid "Columns" msgid "Columns"
@ -583,13 +583,13 @@ msgstr "మీరు ఆర్థికంగా సహాయం చేయలే
#: apps/client/src/pages/builder/sidebars/left/index.tsx:271 #: apps/client/src/pages/builder/sidebars/left/index.tsx:271
msgid "Expand All" msgid "Expand All"
msgstr "" msgstr "అన్నింటినీ తెరవు"
#: apps/client/src/pages/builder/sidebars/left/sections/basics.tsx:30 #: apps/client/src/pages/builder/sidebars/left/sections/basics.tsx:30
#: apps/client/src/pages/builder/sidebars/left/sections/shared/section-base.tsx:115 #: apps/client/src/pages/builder/sidebars/left/sections/shared/section-base.tsx:115
#: apps/client/src/pages/builder/sidebars/left/sections/summary.tsx:33 #: apps/client/src/pages/builder/sidebars/left/sections/summary.tsx:33
msgid "Expand section" msgid "Expand section"
msgstr "" msgstr "విభాగాన్ని తెరవు"
#: apps/client/src/pages/home/sections/templates/index.tsx:12 #: apps/client/src/pages/home/sections/templates/index.tsx:12
msgid "Explore the templates available in Reactive Resume and view the resumes crafted with them. They could also serve as examples to help guide the creation of your next resume." msgid "Explore the templates available in Reactive Resume and view the resumes crafted with them. They could also serve as examples to help guide the creation of your next resume."

40
azure-pipelines.yml Normal file
View File

@ -0,0 +1,40 @@
# Docker
# Build and push an image to Azure Container Registry
# https://docs.microsoft.com/azure/devops/pipelines/languages/docker
trigger:
- main
resources:
- repo: self
variables:
# Container registry service connection established during pipeline creation
dockerRegistryServiceConnection: 'c6da80c0-7d65-4b93-9203-3b91c4f6b5dc'
imageRepository: 'reactiveresume'
containerRegistry: 'reactiveresume.azurecr.io'
dockerfilePath: '$(Build.SourcesDirectory)/Dockerfile'
tag: '$(Build.BuildId)'
# Agent VM image name
vmImageName: 'ubuntu-latest'
stages:
- stage: Build
displayName: Build and push stage
jobs:
- job: Build
displayName: Build
pool:
vmImage: $(vmImageName)
steps:
- task: Docker@2
displayName: Build and push an image to container registry
inputs:
command: buildAndPush
repository: $(imageRepository)
dockerfile: $(dockerfilePath)
containerRegistry: $(dockerRegistryServiceConnection)
arguments: '--platform linux/amd64,linux/arm64'
tags: |
$(tag)

View File

@ -6,6 +6,21 @@ export type Font = {
files: Record<string, string>; files: Record<string, string>;
}; };
/**
* Known system fonts we consider available locally without fetching from Google Fonts.
* Extend this list when adding more system-safe families to the app.
*/
export const localFonts = ["Arial", "Cambria", "Garamond", "Times New Roman"];
/**
* Checks whether a font family is a local/system font.
*
* Input: font family name (case-insensitive)
* Output: true if present in localFonts, otherwise false
*/
export const isLocalFont = (family: string): boolean =>
localFonts.some((f) => f.toLowerCase() === family.toLowerCase());
export const fonts: Font[] = [ export const fonts: Font[] = [
{ {
family: "Roboto", family: "Roboto",

View File

@ -0,0 +1,25 @@
import { describe, expect, it } from "vitest";
import { isLocalFont, localFonts } from "../fonts";
describe("isLocalFont", () => {
it("returns true for known local fonts (case-insensitive)", () => {
expect(isLocalFont("Arial")).toBe(true);
expect(isLocalFont("arial")).toBe(true);
expect(isLocalFont("Times New Roman")).toBe(true);
expect(isLocalFont("times new roman")).toBe(true);
});
it("returns false for non-local fonts", () => {
expect(isLocalFont("Roboto")).toBe(false);
expect(isLocalFont("Open Sans")).toBe(false);
});
});
describe("localFonts", () => {
it("includes the expected base set", () => {
for (const f of ["Arial", "Cambria", "Garamond", "Times New Roman"]) {
expect(localFonts).toContain(f);
}
});
});