Add comprehensive models and script for handling inline scripts and structured data
- Implement `remove-inline-scripts.js` to externalize Next.js inline scripts, enhancing CSP compliance. - Add models for `Book`, `Character`, `Story`, `Editor`, `System`, and `BookSerie` with relevant properties and utilities. - Include macOS entitlements plist for app development with advanced permissions. - Add utility functions to handle script hashing, cookie management, and content formatting.
This commit is contained in:
20
lib/models/Editor.ts
Executable file
20
lib/models/Editor.ts
Executable file
@@ -0,0 +1,20 @@
|
||||
import {IconDefinition} from "@fortawesome/free-solid-svg-icons";
|
||||
|
||||
export interface PanelComponent {
|
||||
id: number,
|
||||
title: string,
|
||||
badge: string,
|
||||
description: string,
|
||||
icon: IconDefinition,
|
||||
action?: () => void,
|
||||
}
|
||||
|
||||
export default class Editor {
|
||||
public static convertToHtml(text: string): string {
|
||||
return text
|
||||
.split(/\n\s*\n/)
|
||||
.map((paragraph: string): string => `<p>${paragraph.trim()}</p>`)
|
||||
.join('');
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user