chore: add export
This commit is contained in:
@@ -1 +1,2 @@
|
|||||||
|
export { displayedFontsStore } from './model';
|
||||||
export { FontDisplay } from './ui';
|
export { FontDisplay } from './ui';
|
||||||
|
|||||||
@@ -28,6 +28,8 @@ export class DisplayedFontsStore {
|
|||||||
|
|
||||||
#selectedPair = $state<Partial<[UnifiedFont, UnifiedFont]>>([]);
|
#selectedPair = $state<Partial<[UnifiedFont, UnifiedFont]>>([]);
|
||||||
|
|
||||||
|
#hasAnySelectedFonts = $derived(this.#displayedFonts.length > 0);
|
||||||
|
|
||||||
get fonts() {
|
get fonts() {
|
||||||
return this.#displayedFonts;
|
return this.#displayedFonts;
|
||||||
}
|
}
|
||||||
@@ -41,7 +43,9 @@ export class DisplayedFontsStore {
|
|||||||
}
|
}
|
||||||
|
|
||||||
set selectedPair(pair: Partial<[UnifiedFont, UnifiedFont]>) {
|
set selectedPair(pair: Partial<[UnifiedFont, UnifiedFont]>) {
|
||||||
this.#selectedPair = pair;
|
const [first, second] = this.#selectedPair;
|
||||||
|
const [newFist, newSecond] = pair;
|
||||||
|
this.#selectedPair = [newFist ?? first, newSecond ?? second];
|
||||||
}
|
}
|
||||||
|
|
||||||
get text() {
|
get text() {
|
||||||
@@ -52,6 +56,10 @@ export class DisplayedFontsStore {
|
|||||||
this.#sampleText = text;
|
this.#sampleText = text;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
get hasAnyFonts() {
|
||||||
|
return this.#hasAnySelectedFonts;
|
||||||
|
}
|
||||||
|
|
||||||
isSelectedPairEmpty(): boolean {
|
isSelectedPairEmpty(): boolean {
|
||||||
const [font1, font2] = this.#selectedPair;
|
const [font1, font2] = this.#selectedPair;
|
||||||
return !font1 || !font2;
|
return !font1 || !font2;
|
||||||
|
|||||||
Reference in New Issue
Block a user