Skip to content

Commit 43468e4

Browse files
authored
Revert "fix: complete Google Font setup in brand panel (#2867)" (#2869)
This reverts commit 4e6562d.
1 parent 4e6562d commit 43468e4

3 files changed

Lines changed: 2 additions & 36 deletions

File tree

apps/web/client/src/components/store/editor/font/index.ts

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -154,14 +154,6 @@ export class FontManager {
154154
*/
155155
async addFont(font: Font): Promise<boolean> {
156156
try {
157-
const sandbox = this.editorEngine.activeSandbox;
158-
if (!sandbox) {
159-
console.error('No sandbox session found');
160-
return false;
161-
}
162-
163-
await this.ensureConfigFilesExist();
164-
165157
const success = await this.fontConfigManager.addFont(font);
166158
if (success) {
167159
// Update the fonts array
@@ -173,15 +165,6 @@ export class FontManager {
173165
// Load the new font in the search manager
174166
await this.fontSearchManager.loadFontFromBatch([font]);
175167

176-
// Add font to Tailwind config
177-
await addFontToTailwindConfig(font, sandbox);
178-
179-
// Add font variable to root layout
180-
await this.layoutManager.addFontVariableToRootLayout(font.id);
181-
182-
// Reload all views to apply new font styles
183-
this.editorEngine.frames.reloadAllViews();
184-
185168
return true;
186169
}
187170
return false;
@@ -212,9 +195,6 @@ export class FontManager {
212195
this._defaultFont = null;
213196
}
214197

215-
// Reload all views to apply font removal
216-
this.editorEngine.frames.reloadAllViews();
217-
218198
return result;
219199
}
220200
return false;
@@ -408,9 +388,6 @@ export class FontManager {
408388
this._fonts = currentFonts;
409389
// Update font search manager with current fonts
410390
this.fontSearchManager.updateFontsList(this._fonts);
411-
412-
// Reload all views to apply font changes
413-
this.editorEngine.frames.reloadAllViews();
414391
}
415392

416393
this.previousFonts = currentFonts;

packages/fonts/src/helpers/ast-generators.ts

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -55,17 +55,11 @@ function createFontConfigAst(font: Font): T.ObjectExpression {
5555
* }
5656
*/
5757
export function createFontFamilyProperty(font: Font): T.ObjectProperty {
58-
// Use string literal if font ID contains special characters (like hyphens)
59-
// otherwise use identifier for cleaner output
60-
const fontIdKey = /^[a-zA-Z_$][a-zA-Z0-9_$]*$/.test(font.id)
61-
? t.identifier(font.id)
62-
: t.stringLiteral(font.id);
63-
6458
return t.objectProperty(
6559
t.identifier('fontFamily'),
6660
t.objectExpression([
6761
t.objectProperty(
68-
fontIdKey,
62+
t.identifier(font.id),
6963
t.arrayExpression([
7064
t.stringLiteral(`var(${font.variable})`),
7165
t.stringLiteral('sans-serif'),

packages/fonts/src/helpers/ast-manipulators.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -347,14 +347,9 @@ export function addFontToTailwindTheme(font: Font, content: string): string {
347347
);
348348
if (!fontExists) {
349349
// Add the new font to existing fontFamily
350-
// Use string literal if font ID contains special characters (like hyphens)
351-
const fontIdKey = /^[a-zA-Z_$][a-zA-Z0-9_$]*$/.test(font.id)
352-
? t.identifier(font.id)
353-
: t.stringLiteral(font.id);
354-
355350
fontFamilyValue.properties.push(
356351
t.objectProperty(
357-
fontIdKey,
352+
t.identifier(font.id),
358353
t.arrayExpression([
359354
t.stringLiteral(`var(${font.variable})`),
360355
t.stringLiteral('sans-serif'),

0 commit comments

Comments
 (0)