fontastic 1.1.0 → 1.3.0
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/.github/workflows/claude-code-review.yml +0 -6
- package/.github/workflows/release-please.yml +25 -0
- package/.github/workflows/release.yml +5 -109
- package/.release-please-manifest.json +3 -0
- package/CHANGELOG.md +39 -0
- package/README.md +6 -0
- package/app/Application.js +4 -4
- package/app/Application.ts +13 -13
- package/app/config/database.js +1 -1
- package/app/config/database.ts +1 -1
- package/app/config/mimes.js +23 -23
- package/app/config/mimes.ts +35 -29
- package/app/core/ConfigManager.js +27 -0
- package/app/core/ConfigManager.ts +28 -0
- package/app/core/FontFinder.js +66 -15
- package/app/core/FontFinder.ts +81 -22
- package/app/core/FontManager.js +20 -18
- package/app/core/FontManager.ts +21 -19
- package/app/core/FontObject.js +44 -24
- package/app/core/FontObject.ts +47 -27
- package/app/core/MessageHandler.js +70 -19
- package/app/core/MessageHandler.ts +82 -21
- package/app/core/SystemManager.js +5 -1
- package/app/core/SystemManager.ts +5 -1
- package/app/database/entity/Collection.schema.js +20 -18
- package/app/database/entity/Collection.schema.ts +22 -21
- package/app/database/repository/Collection.repository.js +17 -18
- package/app/database/repository/Collection.repository.ts +27 -18
- package/app/database/repository/Store.repository.js +13 -18
- package/app/database/repository/Store.repository.ts +13 -21
- package/app/enums/ChannelType.js +18 -0
- package/app/enums/ChannelType.ts +24 -0
- package/app/main.js +98 -10
- package/app/main.ts +126 -19
- package/app/package.json +1 -1
- package/app/types/NativeThemeState.js +3 -0
- package/app/types/NativeThemeState.ts +4 -0
- package/app/types/ScanProgress.js +3 -0
- package/app/types/ScanProgress.ts +6 -0
- package/app/types/SystemPreferencesState.js +3 -0
- package/app/types/SystemPreferencesState.ts +4 -0
- package/app/types/index.js +3 -0
- package/app/types/index.ts +3 -0
- package/package.json +2 -2
- package/release-please-config.json +20 -0
- package/scripts/patch-electron-plist.js +41 -0
- package/src/app/core/services/database/database.service.ts +6 -0
- package/src/app/core/services/message/message.service.ts +33 -1
- package/src/app/core/services/presentation/presentation.service.ts +100 -1
- package/src/app/layout/footer/footer.component.html +13 -2
- package/src/app/layout/footer/footer.component.ts +18 -2
- package/src/app/layout/header/header.component.html +0 -10
- package/src/app/layout/header/header.component.ts +4 -23
- package/src/app/layout/navigation/navigation.component.html +66 -16
- package/src/app/layout/navigation/navigation.component.ts +65 -12
- package/src/app/settings/ai-keys/ai-keys.component.ts +13 -18
- package/src/app/settings/danger-zone/danger-zone.component.html +8 -0
- package/src/app/settings/danger-zone/danger-zone.component.ts +12 -0
- package/src/app/settings/news-api/news-api.component.ts +6 -8
- package/src/app/settings/theme/theme.component.html +15 -2
- package/src/app/settings/theme/theme.component.ts +4 -0
- package/src/app/shared/components/datagrid/datagrid.component.html +8 -17
- package/src/app/shared/components/datagrid/datagrid.component.ts +6 -10
- package/src/app/shared/components/glyphs/glyphs.component.html +5 -15
- package/src/app/shared/components/glyphs/glyphs.component.ts +3 -0
- package/src/app/shared/components/preview/preview.component.html +1 -1
- package/src/app/shared/components/preview/preview.component.ts +3 -8
- package/src/app/shared/components/prompt-dialog/prompt-dialog.component.html +2 -2
- package/src/app/shared/components/prompt-dialog/prompt-dialog.component.ts +2 -1
- package/src/app/shared/components/rule-builder/rule-builder.component.html +18 -6
- package/src/app/shared/components/rule-builder/rule-builder.component.ts +34 -2
- package/src/app/shared/components/search/search.component.html +9 -36
- package/src/app/shared/components/search/search.component.ts +2 -1
- package/src/app/shared/components/waterfall/waterfall.component.html +1 -3
- package/src/app/shared/components/waterfall/waterfall.component.ts +2 -1
- package/src/app/shared/directives/disabled-opacity/disabled-opacity.directive.ts +18 -0
- package/src/app/shared/directives/hover-highlight/hover-highlight.directive.ts +38 -0
- package/src/app/shared/directives/index.ts +5 -0
- package/src/app/shared/directives/modal-backdrop/modal-backdrop.directive.ts +18 -0
- package/src/app/shared/directives/scroll-reset/scroll-reset.directive.ts +15 -0
- package/src/app/shared/directives/stop-propagation/stop-propagation.directive.ts +12 -0
- package/src/assets/icons/favicon.256x256.png +0 -0
- package/src/assets/icons/favicon.512x512.png +0 -0
- package/src/assets/icons/favicon.icns +0 -0
- package/src/assets/icons/favicon.ico +0 -0
- package/src/assets/icons/favicon.png +0 -0
- package/src/favicon.ico +0 -0
|
@@ -12,12 +12,6 @@ on:
|
|
|
12
12
|
|
|
13
13
|
jobs:
|
|
14
14
|
claude-review:
|
|
15
|
-
# Optional: Filter by PR author
|
|
16
|
-
# if: |
|
|
17
|
-
# github.event.pull_request.user.login == 'external-contributor' ||
|
|
18
|
-
# github.event.pull_request.user.login == 'new-developer' ||
|
|
19
|
-
# github.event.pull_request.author_association == 'FIRST_TIME_CONTRIBUTOR'
|
|
20
|
-
|
|
21
15
|
runs-on: ubuntu-latest
|
|
22
16
|
permissions:
|
|
23
17
|
contents: read
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
on:
|
|
2
|
+
push:
|
|
3
|
+
branches:
|
|
4
|
+
- master
|
|
5
|
+
workflow_dispatch:
|
|
6
|
+
|
|
7
|
+
concurrency:
|
|
8
|
+
group: ${{ github.workflow }}-${{ github.ref }}
|
|
9
|
+
cancel-in-progress: true
|
|
10
|
+
|
|
11
|
+
permissions:
|
|
12
|
+
contents: write
|
|
13
|
+
pull-requests: write
|
|
14
|
+
|
|
15
|
+
name: release-please
|
|
16
|
+
|
|
17
|
+
jobs:
|
|
18
|
+
release-please:
|
|
19
|
+
runs-on: ubuntu-latest
|
|
20
|
+
steps:
|
|
21
|
+
- uses: googleapis/release-please-action@v4.4.0
|
|
22
|
+
with:
|
|
23
|
+
token: ${{ secrets.RELEASE_PLEASE_TOKEN }}
|
|
24
|
+
config-file: release-please-config.json
|
|
25
|
+
manifest-file: .release-please-manifest.json
|
|
@@ -1,117 +1,14 @@
|
|
|
1
|
-
name: Release
|
|
1
|
+
name: Release Build
|
|
2
2
|
|
|
3
3
|
on:
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
bump:
|
|
7
|
-
description: 'Version bump type'
|
|
8
|
-
required: true
|
|
9
|
-
type: choice
|
|
10
|
-
options: [patch, minor, major]
|
|
4
|
+
release:
|
|
5
|
+
types: [published]
|
|
11
6
|
|
|
12
7
|
permissions:
|
|
13
8
|
contents: write
|
|
14
9
|
|
|
15
10
|
jobs:
|
|
16
|
-
version:
|
|
17
|
-
runs-on: ubuntu-22.04
|
|
18
|
-
outputs:
|
|
19
|
-
version: ${{ steps.version.outputs.version }}
|
|
20
|
-
steps:
|
|
21
|
-
- name: Guard — owner only
|
|
22
|
-
if: github.actor != github.repository_owner
|
|
23
|
-
run: |
|
|
24
|
-
echo "Only the repository owner can trigger releases."
|
|
25
|
-
exit 1
|
|
26
|
-
|
|
27
|
-
- name: Checkout
|
|
28
|
-
uses: actions/checkout@v6
|
|
29
|
-
with:
|
|
30
|
-
fetch-depth: 0
|
|
31
|
-
|
|
32
|
-
- name: Setup Node 24
|
|
33
|
-
uses: actions/setup-node@v6
|
|
34
|
-
with:
|
|
35
|
-
node-version: '24'
|
|
36
|
-
|
|
37
|
-
- name: Configure git
|
|
38
|
-
run: |
|
|
39
|
-
git config user.name "github-actions[bot]"
|
|
40
|
-
git config user.email "github-actions[bot]@users.noreply.github.com"
|
|
41
|
-
|
|
42
|
-
- name: Bump version
|
|
43
|
-
env:
|
|
44
|
-
BUMP: ${{ github.event.inputs.bump }}
|
|
45
|
-
run: |
|
|
46
|
-
npm version "$BUMP" --no-git-tag-version
|
|
47
|
-
node -e "const fs=require('fs');const app=JSON.parse(fs.readFileSync('./app/package.json'));app.version=require('./package.json').version;fs.writeFileSync('./app/package.json',JSON.stringify(app,null,2)+'\n');"
|
|
48
|
-
|
|
49
|
-
- name: Capture new version
|
|
50
|
-
id: version
|
|
51
|
-
run: echo "version=$(jq -r .version package.json)" >> "$GITHUB_OUTPUT"
|
|
52
|
-
|
|
53
|
-
- name: Generate changelog
|
|
54
|
-
run: |
|
|
55
|
-
node -e "
|
|
56
|
-
const { execSync } = require('child_process');
|
|
57
|
-
const fs = require('fs');
|
|
58
|
-
|
|
59
|
-
const lastTag = execSync('git describe --tags --abbrev=0').toString().trim();
|
|
60
|
-
const log = execSync('git log ' + lastTag + '..HEAD --format=%s').toString().trim();
|
|
61
|
-
|
|
62
|
-
const types = [
|
|
63
|
-
['feat', '### Features'],
|
|
64
|
-
['fix', '### Bug Fixes'],
|
|
65
|
-
['refactor', '### Refactoring'],
|
|
66
|
-
['revert', '### Reverts'],
|
|
67
|
-
['perf', '### Performance'],
|
|
68
|
-
];
|
|
69
|
-
const typeMap = Object.fromEntries(types.map(([k, v]) => [k, v]));
|
|
70
|
-
|
|
71
|
-
const pattern = /^(\w+)(\(.+?\))?(!)?: (.+)$/;
|
|
72
|
-
const groups = {};
|
|
73
|
-
|
|
74
|
-
for (const line of log.split('\n')) {
|
|
75
|
-
const m = line.match(pattern);
|
|
76
|
-
if (!m) continue;
|
|
77
|
-
const type = m[1];
|
|
78
|
-
const scope = m[2] ? m[2].slice(1, -1) : null;
|
|
79
|
-
const msg = m[4];
|
|
80
|
-
const label = typeMap[type];
|
|
81
|
-
if (!label) continue;
|
|
82
|
-
if (!groups[type]) groups[type] = [];
|
|
83
|
-
groups[type].push(scope ? '- **' + scope + '**: ' + msg : '- ' + msg);
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
const sections = types
|
|
87
|
-
.filter(([k]) => groups[k])
|
|
88
|
-
.map(([k, header]) => header + '\n' + groups[k].join('\n'))
|
|
89
|
-
.join('\n\n');
|
|
90
|
-
|
|
91
|
-
const body = sections || '_No conventional commits found since last release._';
|
|
92
|
-
fs.writeFileSync('CHANGELOG_BODY.md', body);
|
|
93
|
-
console.log('Changelog written.');
|
|
94
|
-
"
|
|
95
|
-
|
|
96
|
-
- name: Commit, tag, and push
|
|
97
|
-
env:
|
|
98
|
-
VERSION: ${{ steps.version.outputs.version }}
|
|
99
|
-
run: |
|
|
100
|
-
git add package.json app/package.json
|
|
101
|
-
git commit -m "[Bumped Version] ${VERSION}"
|
|
102
|
-
git push origin master
|
|
103
|
-
git tag "${VERSION}"
|
|
104
|
-
git push origin "${VERSION}"
|
|
105
|
-
|
|
106
|
-
- name: Create GitHub Release
|
|
107
|
-
env:
|
|
108
|
-
GH_TOKEN: ${{ github.token }}
|
|
109
|
-
VERSION: ${{ steps.version.outputs.version }}
|
|
110
|
-
run: gh release create "${VERSION}" --notes-file CHANGELOG_BODY.md --title "${VERSION}"
|
|
111
|
-
|
|
112
|
-
|
|
113
11
|
build:
|
|
114
|
-
needs: version
|
|
115
12
|
strategy:
|
|
116
13
|
matrix:
|
|
117
14
|
include:
|
|
@@ -126,7 +23,7 @@ jobs:
|
|
|
126
23
|
- name: Checkout tag
|
|
127
24
|
uses: actions/checkout@v6
|
|
128
25
|
with:
|
|
129
|
-
ref: ${{
|
|
26
|
+
ref: ${{ github.event.release.tag_name }}
|
|
130
27
|
|
|
131
28
|
- name: Setup Node 24
|
|
132
29
|
uses: actions/setup-node@v6
|
|
@@ -152,13 +49,12 @@ jobs:
|
|
|
152
49
|
- name: Upload artifacts to release
|
|
153
50
|
env:
|
|
154
51
|
GH_TOKEN: ${{ github.token }}
|
|
155
|
-
VERSION: ${{ needs.version.outputs.version }}
|
|
156
52
|
shell: bash
|
|
157
53
|
run: |
|
|
158
54
|
shopt -s nullglob
|
|
159
55
|
files=(release/*.dmg release/*.AppImage release/*.exe release/*.zip release/*.deb release/*.rpm)
|
|
160
56
|
if [ ${#files[@]} -gt 0 ]; then
|
|
161
|
-
gh release upload "${
|
|
57
|
+
gh release upload "${{ github.event.release.tag_name }}" "${files[@]}" --clobber
|
|
162
58
|
else
|
|
163
59
|
echo "No release artifacts found"
|
|
164
60
|
exit 1
|
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## [1.3.0](https://github.com/tomshaw/fontastic/compare/fontastic-v1.2.0...fontastic-v1.3.0) (2026-03-15)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### 🎉 Features
|
|
7
|
+
|
|
8
|
+
* add smart collection preview functionality and enhance rule builder component ([436b162](https://github.com/tomshaw/fontastic/commit/436b16242ddae4eaaff3279d749b70dc79c9098c))
|
|
9
|
+
* enhance application with secure storage and scan progress features ([7a2576b](https://github.com/tomshaw/fontastic/commit/7a2576b5484ce3d8ce1c06171f60608b43c3e42b))
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
### 🛠️ Fixes
|
|
13
|
+
|
|
14
|
+
* add height class to footer layout for improved display ([10da788](https://github.com/tomshaw/fontastic/commit/10da78803ba3ccec3cf9f76646a896a013a8935f))
|
|
15
|
+
* adjust collection order handling in createParent and createChild methods ([3c9a0c4](https://github.com/tomshaw/fontastic/commit/3c9a0c4e2062a3c8a36b32f71193b01ddc57073e))
|
|
16
|
+
* refactor footer component layout and enhance version handling ([dc0475e](https://github.com/tomshaw/fontastic/commit/dc0475ed4c67a326a7710894d9145731a7909b5d))
|
|
17
|
+
* update collection order handling in createParent and createChild methods ([ce855d0](https://github.com/tomshaw/fontastic/commit/ce855d0664ab391fd15fed0bbffd16568a019699))
|
|
18
|
+
* update footer layout to use grid for improved structure and responsiveness ([b2a4dac](https://github.com/tomshaw/fontastic/commit/b2a4dac434f9ea732180f32477854905c0fa80fb))
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
### 🏗️ Refactor
|
|
22
|
+
|
|
23
|
+
* standardize string quotes and improve code readability ([f352ddb](https://github.com/tomshaw/fontastic/commit/f352ddb248e6c7dc1e566917ebf57ebabdde3531))
|
|
24
|
+
|
|
25
|
+
## [1.2.0](https://github.com/tomshaw/fontastic/compare/fontastic-v1.1.0...fontastic-v1.2.0) (2026-03-14)
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
### 🎉 Features
|
|
29
|
+
|
|
30
|
+
* **app:** enhance application plist patching and update icon handling ([297c052](https://github.com/tomshaw/fontastic/commit/297c052a2561962d8d6d1dd2f28f31bf5dcb66ba))
|
|
31
|
+
* **app:** set application name to 'Fontastic' and add plist patching script ([af31cf6](https://github.com/tomshaw/fontastic/commit/af31cf61153b82c8a625755f5fc460b6d8205291))
|
|
32
|
+
* **collection:** implement root collection creation request handling ([cba01d0](https://github.com/tomshaw/fontastic/commit/cba01d098998797d914c75f6cd32f814b3703fb0))
|
|
33
|
+
* **navigation:** implement smart collection creation with input handling ([5cb72ae](https://github.com/tomshaw/fontastic/commit/5cb72ae9f576e0fb8dc1372ab411ea4e2d764191))
|
|
34
|
+
* **release:** add release-please configuration and manifest files ([5cb72ae](https://github.com/tomshaw/fontastic/commit/5cb72ae9f576e0fb8dc1372ab411ea4e2d764191))
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
### 🛠️ Fixes
|
|
38
|
+
|
|
39
|
+
* **release:** update release configuration and manifest version ([759486b](https://github.com/tomshaw/fontastic/commit/759486b556982d90c5e3eaef38cfa0c214e7ac38))
|
package/README.md
CHANGED
|
@@ -23,6 +23,12 @@ Fontastic is an Electron-based font management and cataloging application built
|
|
|
23
23
|
- Glyph inspector — browse and examine individual characters and Unicode points
|
|
24
24
|
- Waterfall preview — compare text rendering across multiple sizes at a glance
|
|
25
25
|
- Font table viewer — read raw OpenType and TrueType metadata tables
|
|
26
|
+
- System theme sync — automatically matches OS light/dark mode via `nativeTheme`
|
|
27
|
+
- Encrypted storage — API keys secured at rest using OS keychain via `safeStorage`
|
|
28
|
+
- Scan progress — real-time font import progress streamed over `MessageChannelMain`
|
|
29
|
+
- Power aware — pauses activity on system sleep and resumes on wake via `powerMonitor`
|
|
30
|
+
- Session hardening — CSP headers, permission deny-list, and cache management via `session`
|
|
31
|
+
- Accessibility — respects OS reduced motion and accent color via `systemPreferences`
|
|
26
32
|
- Cross-platform — builds for Windows, macOS, and Linux
|
|
27
33
|
|
|
28
34
|
## Getting Started
|
package/app/Application.js
CHANGED
|
@@ -26,12 +26,12 @@ class Application {
|
|
|
26
26
|
const systemManager = new SystemManager_1.default(this.machineId, this.isProduction);
|
|
27
27
|
const configManager = new ConfigManager_1.default(systemManager);
|
|
28
28
|
configManager.initialize();
|
|
29
|
+
const menuBuilder = new MenuBuilder_1.default(this.mainWindow, this.isProduction);
|
|
29
30
|
const connectionManager = new ConnectionManager_1.default(configManager);
|
|
30
|
-
|
|
31
|
+
// Initialize menu and database connection in parallel — menu doesn't depend on DB
|
|
32
|
+
yield Promise.all([connectionManager.initialize(), Promise.resolve(menuBuilder.initialize())]);
|
|
31
33
|
const fontManager = new FontManager_1.default(systemManager, configManager, connectionManager);
|
|
32
|
-
const
|
|
33
|
-
menuBuilder.initialize();
|
|
34
|
-
const messageHandler = new MessageHandler_1.default(systemManager, configManager, connectionManager, fontManager);
|
|
34
|
+
const messageHandler = new MessageHandler_1.default(systemManager, configManager, connectionManager, fontManager, this.mainWindow);
|
|
35
35
|
messageHandler.initialize();
|
|
36
36
|
});
|
|
37
37
|
}
|
package/app/Application.ts
CHANGED
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
import SystemManager from
|
|
2
|
-
import ConfigManager from
|
|
3
|
-
import ConnectionManager from
|
|
4
|
-
import FontManager from
|
|
5
|
-
import MessageHandler from
|
|
6
|
-
import MenuBuilder from
|
|
7
|
-
import { BrowserWindow } from
|
|
1
|
+
import SystemManager from './core/SystemManager';
|
|
2
|
+
import ConfigManager from './core/ConfigManager';
|
|
3
|
+
import ConnectionManager from './core/ConnectionManager';
|
|
4
|
+
import FontManager from './core/FontManager';
|
|
5
|
+
import MessageHandler from './core/MessageHandler';
|
|
6
|
+
import MenuBuilder from './core/menu/MenuBuilder';
|
|
7
|
+
import { BrowserWindow } from 'electron';
|
|
8
8
|
|
|
9
9
|
export default class Application {
|
|
10
|
-
|
|
11
10
|
machineId: string;
|
|
12
11
|
isProduction: boolean;
|
|
13
12
|
mainWindow: BrowserWindow;
|
|
@@ -24,15 +23,16 @@ export default class Application {
|
|
|
24
23
|
const configManager = new ConfigManager(systemManager);
|
|
25
24
|
configManager.initialize();
|
|
26
25
|
|
|
26
|
+
const menuBuilder = new MenuBuilder(this.mainWindow, this.isProduction);
|
|
27
|
+
|
|
27
28
|
const connectionManager = new ConnectionManager(configManager);
|
|
28
|
-
await connectionManager.initialize()
|
|
29
29
|
|
|
30
|
-
|
|
30
|
+
// Initialize menu and database connection in parallel — menu doesn't depend on DB
|
|
31
|
+
await Promise.all([connectionManager.initialize(), Promise.resolve(menuBuilder.initialize())]);
|
|
31
32
|
|
|
32
|
-
const
|
|
33
|
-
menuBuilder.initialize();
|
|
33
|
+
const fontManager = new FontManager(systemManager, configManager, connectionManager);
|
|
34
34
|
|
|
35
|
-
const messageHandler = new MessageHandler(systemManager, configManager, connectionManager, fontManager);
|
|
35
|
+
const messageHandler = new MessageHandler(systemManager, configManager, connectionManager, fontManager, this.mainWindow);
|
|
36
36
|
messageHandler.initialize();
|
|
37
37
|
}
|
|
38
38
|
}
|
package/app/config/database.js
CHANGED
package/app/config/database.ts
CHANGED
package/app/config/mimes.js
CHANGED
|
@@ -3,41 +3,41 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.installable = exports.mimeTypes = exports.fontMimeTypes = void 0;
|
|
4
4
|
exports.fontMimeTypes = [
|
|
5
5
|
{
|
|
6
|
-
type:
|
|
7
|
-
name:
|
|
6
|
+
type: 'font/ttf',
|
|
7
|
+
name: 'TrueType',
|
|
8
8
|
description: "TrueType is an outline font standard developed by Apple in the late 1980s as a competitor to Adobe's Type 1 fonts used in PostScript. It has become the most common format for fonts on the classic Mac OS, macOS, and Microsoft Windows operating systems.",
|
|
9
|
-
installable: true
|
|
9
|
+
installable: true,
|
|
10
10
|
},
|
|
11
11
|
{
|
|
12
|
-
type:
|
|
13
|
-
name:
|
|
12
|
+
type: 'font/otf',
|
|
13
|
+
name: 'OpenType',
|
|
14
14
|
description: "OpenType is a format for scalable computer fonts. It was built on its predecessor TrueType, retaining TrueType's basic structure and adding many intricate data structures for prescribing typographic behavior. OpenType is a registered trademark of Microsoft Corporation.",
|
|
15
|
-
installable: true
|
|
15
|
+
installable: true,
|
|
16
16
|
},
|
|
17
17
|
{
|
|
18
|
-
type:
|
|
19
|
-
name:
|
|
20
|
-
description:
|
|
21
|
-
installable: false
|
|
18
|
+
type: 'font/woff',
|
|
19
|
+
name: 'Web Open Font Format',
|
|
20
|
+
description: 'The Web Open Font Format is a font format for use in web pages. WOFF files are OpenType or TrueType fonts, with format-specific compression applied and additional XML metadata added.',
|
|
21
|
+
installable: false,
|
|
22
22
|
},
|
|
23
23
|
{
|
|
24
|
-
type:
|
|
25
|
-
name:
|
|
26
|
-
description:
|
|
27
|
-
installable: false
|
|
24
|
+
type: 'font/woff2',
|
|
25
|
+
name: 'Web Open Font Format 2',
|
|
26
|
+
description: 'A WOFF2 file is a web font file created in the WOFF (Web Open Font Format) 2.0 format, an open format used to deliver webpage fonts on the fly. It is saved as a compressed container that supports TrueType (. TTF) and OpenType (. OTF) fonts. WOFF2 files also support font licensing metadata.',
|
|
27
|
+
installable: false,
|
|
28
28
|
},
|
|
29
29
|
{
|
|
30
|
-
type:
|
|
31
|
-
name:
|
|
32
|
-
description:
|
|
33
|
-
installable: false
|
|
30
|
+
type: 'font/ttc',
|
|
31
|
+
name: 'TrueType Collection',
|
|
32
|
+
description: 'TrueType Collection (TTC) is an extension of TrueType format that allows combining multiple fonts into a single file, creating substantial space savings for a collection of fonts with many glyphs in common.',
|
|
33
|
+
installable: false,
|
|
34
34
|
},
|
|
35
35
|
{
|
|
36
|
-
type:
|
|
37
|
-
name:
|
|
38
|
-
description:
|
|
39
|
-
installable: false
|
|
40
|
-
}
|
|
36
|
+
type: 'font/dfont',
|
|
37
|
+
name: 'Datafork TrueType',
|
|
38
|
+
description: 'Datafork TrueType is a font wrapper used on Apple Macintosh computers running Mac OS X. It is a TrueType suitcase with the resource map in the data fork, rather than the resource fork as had been the case in Mac OS 9.',
|
|
39
|
+
installable: false,
|
|
40
|
+
},
|
|
41
41
|
];
|
|
42
42
|
exports.mimeTypes = exports.fontMimeTypes.map((item) => item.type);
|
|
43
43
|
exports.installable = exports.fontMimeTypes.reduce((prev, curr) => {
|
package/app/config/mimes.ts
CHANGED
|
@@ -1,54 +1,60 @@
|
|
|
1
1
|
interface Mime {
|
|
2
2
|
type: string;
|
|
3
3
|
name: string;
|
|
4
|
-
description: string
|
|
5
|
-
installable: boolean
|
|
4
|
+
description: string;
|
|
5
|
+
installable: boolean;
|
|
6
6
|
}
|
|
7
7
|
|
|
8
8
|
export const fontMimeTypes: Mime[] = [
|
|
9
9
|
{
|
|
10
|
-
type:
|
|
11
|
-
name:
|
|
12
|
-
description:
|
|
13
|
-
|
|
10
|
+
type: 'font/ttf',
|
|
11
|
+
name: 'TrueType',
|
|
12
|
+
description:
|
|
13
|
+
"TrueType is an outline font standard developed by Apple in the late 1980s as a competitor to Adobe's Type 1 fonts used in PostScript. It has become the most common format for fonts on the classic Mac OS, macOS, and Microsoft Windows operating systems.",
|
|
14
|
+
installable: true,
|
|
14
15
|
},
|
|
15
16
|
{
|
|
16
|
-
type:
|
|
17
|
-
name:
|
|
18
|
-
description:
|
|
19
|
-
|
|
17
|
+
type: 'font/otf',
|
|
18
|
+
name: 'OpenType',
|
|
19
|
+
description:
|
|
20
|
+
"OpenType is a format for scalable computer fonts. It was built on its predecessor TrueType, retaining TrueType's basic structure and adding many intricate data structures for prescribing typographic behavior. OpenType is a registered trademark of Microsoft Corporation.",
|
|
21
|
+
installable: true,
|
|
20
22
|
},
|
|
21
23
|
{
|
|
22
|
-
type:
|
|
23
|
-
name:
|
|
24
|
-
description:
|
|
25
|
-
|
|
24
|
+
type: 'font/woff',
|
|
25
|
+
name: 'Web Open Font Format',
|
|
26
|
+
description:
|
|
27
|
+
'The Web Open Font Format is a font format for use in web pages. WOFF files are OpenType or TrueType fonts, with format-specific compression applied and additional XML metadata added.',
|
|
28
|
+
installable: false,
|
|
26
29
|
},
|
|
27
30
|
{
|
|
28
|
-
type:
|
|
29
|
-
name:
|
|
30
|
-
description:
|
|
31
|
-
|
|
31
|
+
type: 'font/woff2',
|
|
32
|
+
name: 'Web Open Font Format 2',
|
|
33
|
+
description:
|
|
34
|
+
'A WOFF2 file is a web font file created in the WOFF (Web Open Font Format) 2.0 format, an open format used to deliver webpage fonts on the fly. It is saved as a compressed container that supports TrueType (. TTF) and OpenType (. OTF) fonts. WOFF2 files also support font licensing metadata.',
|
|
35
|
+
installable: false,
|
|
32
36
|
},
|
|
33
37
|
{
|
|
34
|
-
type:
|
|
35
|
-
name:
|
|
36
|
-
description:
|
|
37
|
-
|
|
38
|
+
type: 'font/ttc',
|
|
39
|
+
name: 'TrueType Collection',
|
|
40
|
+
description:
|
|
41
|
+
'TrueType Collection (TTC) is an extension of TrueType format that allows combining multiple fonts into a single file, creating substantial space savings for a collection of fonts with many glyphs in common.',
|
|
42
|
+
installable: false,
|
|
38
43
|
},
|
|
39
44
|
{
|
|
40
|
-
type:
|
|
41
|
-
name:
|
|
42
|
-
description:
|
|
43
|
-
|
|
44
|
-
|
|
45
|
+
type: 'font/dfont',
|
|
46
|
+
name: 'Datafork TrueType',
|
|
47
|
+
description:
|
|
48
|
+
'Datafork TrueType is a font wrapper used on Apple Macintosh computers running Mac OS X. It is a TrueType suitcase with the resource map in the data fork, rather than the resource fork as had been the case in Mac OS 9.',
|
|
49
|
+
installable: false,
|
|
50
|
+
},
|
|
45
51
|
];
|
|
46
52
|
|
|
47
53
|
export const mimeTypes: string[] = fontMimeTypes.map((item) => item.type);
|
|
48
54
|
|
|
49
|
-
export const installable:
|
|
55
|
+
export const installable: string[] = fontMimeTypes.reduce((prev: string[], curr) => {
|
|
50
56
|
if (curr.installable) {
|
|
51
57
|
prev.push(curr.type);
|
|
52
58
|
}
|
|
53
59
|
return prev;
|
|
54
|
-
}, []);
|
|
60
|
+
}, []);
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const electron_1 = require("electron");
|
|
3
4
|
const database_1 = require("../config/database");
|
|
4
5
|
const StorageType_1 = require("../enums/StorageType");
|
|
5
6
|
const Store = require('electron-store');
|
|
@@ -26,6 +27,32 @@ class ConfigManager {
|
|
|
26
27
|
clear() {
|
|
27
28
|
return store.clear();
|
|
28
29
|
}
|
|
30
|
+
// --- Safe Storage (OS keychain encryption) ---
|
|
31
|
+
setSecure(key, value) {
|
|
32
|
+
if (electron_1.safeStorage.isEncryptionAvailable()) {
|
|
33
|
+
const encrypted = electron_1.safeStorage.encryptString(value);
|
|
34
|
+
store.set(key, encrypted.toString('base64'));
|
|
35
|
+
}
|
|
36
|
+
else {
|
|
37
|
+
store.set(key, value);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
getSecure(key) {
|
|
41
|
+
const raw = store.get(key);
|
|
42
|
+
if (!raw)
|
|
43
|
+
return null;
|
|
44
|
+
if (electron_1.safeStorage.isEncryptionAvailable() && typeof raw === 'string') {
|
|
45
|
+
try {
|
|
46
|
+
const buffer = Buffer.from(raw, 'base64');
|
|
47
|
+
return electron_1.safeStorage.decryptString(buffer);
|
|
48
|
+
}
|
|
49
|
+
catch (_a) {
|
|
50
|
+
// Fallback: value may have been stored before encryption was enabled
|
|
51
|
+
return raw;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
return typeof raw === 'string' ? raw : null;
|
|
55
|
+
}
|
|
29
56
|
toArray() {
|
|
30
57
|
return store.store;
|
|
31
58
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { safeStorage } from 'electron';
|
|
1
2
|
import SystemManager from './SystemManager';
|
|
2
3
|
import { database } from '../config/database';
|
|
3
4
|
import { StorageType } from '../enums/StorageType';
|
|
@@ -35,6 +36,33 @@ export default class ConfigManager {
|
|
|
35
36
|
return store.clear();
|
|
36
37
|
}
|
|
37
38
|
|
|
39
|
+
// --- Safe Storage (OS keychain encryption) ---
|
|
40
|
+
|
|
41
|
+
setSecure(key: string, value: string): void {
|
|
42
|
+
if (safeStorage.isEncryptionAvailable()) {
|
|
43
|
+
const encrypted = safeStorage.encryptString(value);
|
|
44
|
+
store.set(key, encrypted.toString('base64'));
|
|
45
|
+
} else {
|
|
46
|
+
store.set(key, value);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
getSecure(key: string): string | null {
|
|
51
|
+
const raw = store.get(key);
|
|
52
|
+
if (!raw) return null;
|
|
53
|
+
|
|
54
|
+
if (safeStorage.isEncryptionAvailable() && typeof raw === 'string') {
|
|
55
|
+
try {
|
|
56
|
+
const buffer = Buffer.from(raw, 'base64');
|
|
57
|
+
return safeStorage.decryptString(buffer);
|
|
58
|
+
} catch {
|
|
59
|
+
// Fallback: value may have been stored before encryption was enabled
|
|
60
|
+
return raw;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
return typeof raw === 'string' ? raw : null;
|
|
64
|
+
}
|
|
65
|
+
|
|
38
66
|
toArray(): any {
|
|
39
67
|
return store.store;
|
|
40
68
|
}
|