@gryt/ui 0.23.0 → 0.25.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/dist/components/OwlDesigner/owlDesigner.d.ts +66 -0
- package/dist/components/OwlDesigner/owlDesigner.d.ts.map +1 -0
- package/dist/components/OwlDesigner/owlExport.d.ts +31 -0
- package/dist/components/OwlDesigner/owlExport.d.ts.map +1 -0
- package/dist/components/OwlDesigner/owlSeen.d.ts +47 -0
- package/dist/components/OwlDesigner/owlSeen.d.ts.map +1 -0
- package/dist/components/OwlDesigner/owlWardrobe.d.ts +26 -0
- package/dist/components/OwlDesigner/owlWardrobe.d.ts.map +1 -0
- package/dist/components/ThemeEditor/CurveEditor.d.ts +20 -0
- package/dist/components/ThemeEditor/CurveEditor.d.ts.map +1 -0
- package/dist/components/ThemeEditor/FontField.d.ts +11 -0
- package/dist/components/ThemeEditor/FontField.d.ts.map +1 -0
- package/dist/components/ThemeEditor/MotionField.d.ts +8 -0
- package/dist/components/ThemeEditor/MotionField.d.ts.map +1 -0
- package/dist/components/ThemeEditor/ThemeEditor.d.ts +10 -1
- package/dist/components/ThemeEditor/ThemeEditor.d.ts.map +1 -1
- package/dist/components/ThemeEditor/fonts.d.ts +25 -0
- package/dist/components/ThemeEditor/fonts.d.ts.map +1 -0
- package/dist/index.cjs +4 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +10 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2301 -1278
- package/dist/index.js.map +1 -1
- package/dist/styles.css +1 -1
- package/dist/theme.css +40 -6
- package/package.json +2 -2
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Choosing what your owl looks like, instead of only what your name hashes to.
|
|
3
|
+
*
|
|
4
|
+
* Everybody already has an owl — `@gryt/owl` draws one from the nickname, and
|
|
5
|
+
* that is what a member list shows for anyone who has not uploaded a picture.
|
|
6
|
+
* This lets somebody take that owl and choose its colours, its expression and
|
|
7
|
+
* what it is wearing.
|
|
8
|
+
*
|
|
9
|
+
* Three columns: the slots on a rail, every option for the chosen slot as a
|
|
10
|
+
* grid of owls, and the owl itself pinned on the right where it does not scroll
|
|
11
|
+
* away. That last part is the whole reason for this shape — comparing two hats
|
|
12
|
+
* should be looking rather than remembering.
|
|
13
|
+
*
|
|
14
|
+
* Options are drawn, never named. The expression slot holds fourteen things and
|
|
15
|
+
* `eyes-eyelashes-surprised` in a dropdown tells nobody anything.
|
|
16
|
+
*/
|
|
17
|
+
export declare function AvatarChoiceDialog({ open, nickname, onOpenChange, onUpload, onDesign, }: {
|
|
18
|
+
open: boolean;
|
|
19
|
+
nickname: string;
|
|
20
|
+
onOpenChange: (open: boolean) => void;
|
|
21
|
+
onUpload: () => void;
|
|
22
|
+
onDesign: () => void;
|
|
23
|
+
}): import("react").JSX.Element;
|
|
24
|
+
/**
|
|
25
|
+
* The designer itself, with no dialog around it.
|
|
26
|
+
*
|
|
27
|
+
* Split out so it can sit in a page as well as in a modal. The client opens it
|
|
28
|
+
* from settings and wants the dialog; gryt.chat puts it straight on the front
|
|
29
|
+
* page, where a modal would mean asking somebody to open a window to look at a
|
|
30
|
+
* toy. `OwlDesignerDialog` below is now a thin wrapper around this.
|
|
31
|
+
*
|
|
32
|
+
* `onCancel` is optional. Inline there is nothing to cancel back to, so the
|
|
33
|
+
* button is simply absent rather than present and inert.
|
|
34
|
+
*/
|
|
35
|
+
export declare function OwlDesigner({ nickname, saving, onSave, onCancel, active, followSeed, }: {
|
|
36
|
+
nickname: string;
|
|
37
|
+
saving: boolean;
|
|
38
|
+
onSave: (png: Blob, worn: string) => void;
|
|
39
|
+
onCancel?: () => void;
|
|
40
|
+
/** Reset when this goes true. The dialog uses it for "was just opened". */
|
|
41
|
+
active?: boolean;
|
|
42
|
+
/**
|
|
43
|
+
* Open on the owl the nickname already draws, and keep following it while
|
|
44
|
+
* the nickname changes, until somebody changes something here.
|
|
45
|
+
*
|
|
46
|
+
* gryt.chat sets this. The client does not: there you open the designer to
|
|
47
|
+
* design, and your last look is the right place to start.
|
|
48
|
+
*/
|
|
49
|
+
followSeed?: boolean;
|
|
50
|
+
}): import("react").JSX.Element;
|
|
51
|
+
/**
|
|
52
|
+
* The designer in a modal, which is how the client opens it from settings.
|
|
53
|
+
*
|
|
54
|
+
* Kept as a wrapper rather than as the only shape, because gryt.chat renders
|
|
55
|
+
* `OwlDesigner` straight into the page. The title is here rather than inside
|
|
56
|
+
* the designer: a dialog needs an accessible name, a section on a page already
|
|
57
|
+
* has a heading above it.
|
|
58
|
+
*/
|
|
59
|
+
export declare function OwlDesignerDialog({ open, nickname, saving, onOpenChange, onSave, }: {
|
|
60
|
+
open: boolean;
|
|
61
|
+
nickname: string;
|
|
62
|
+
saving: boolean;
|
|
63
|
+
onOpenChange: (open: boolean) => void;
|
|
64
|
+
onSave: (png: Blob, worn: string) => void;
|
|
65
|
+
}): import("react").JSX.Element;
|
|
66
|
+
//# sourceMappingURL=owlDesigner.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"owlDesigner.d.ts","sourceRoot":"","sources":["../../../src/components/OwlDesigner/owlDesigner.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AA6WH,wBAAgB,kBAAkB,CAAC,EACjC,IAAI,EACJ,QAAQ,EACR,YAAY,EACZ,QAAQ,EACR,QAAQ,GACT,EAAE;IACD,IAAI,EAAE,OAAO,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IACtC,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,QAAQ,EAAE,MAAM,IAAI,CAAC;CACtB,+BAiEA;AAID;;;;;;;;;;GAUG;AACH,wBAAgB,WAAW,CAAC,EAC1B,QAAQ,EACR,MAAM,EACN,MAAM,EACN,QAAQ,EACR,MAAa,EACb,UAAkB,GACnB,EAAE;IACD,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,OAAO,CAAC;IAChB,MAAM,EAAE,CAAC,GAAG,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAC1C,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IACtB,2EAA2E;IAC3E,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB;;;;;;OAMG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB,+BA2YA;AAED;;;;;;;GAOG;AACH,wBAAgB,iBAAiB,CAAC,EAChC,IAAI,EACJ,QAAQ,EACR,MAAM,EACN,YAAY,EACZ,MAAM,GACP,EAAE;IACD,IAAI,EAAE,OAAO,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,OAAO,CAAC;IAChB,YAAY,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IACtC,MAAM,EAAE,CAAC,GAAG,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;CAC3C,+BAkBA"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { WornLook } from '@gryt/owl';
|
|
2
|
+
/** The size a raster export is written at. See the note above. */
|
|
3
|
+
export declare const EXPORT_SIZE = 1024;
|
|
4
|
+
export interface ExportFormat {
|
|
5
|
+
id: "svg" | "png" | "webp" | "jpeg";
|
|
6
|
+
label: string;
|
|
7
|
+
/** What it is good for, in the few words a menu row has. */
|
|
8
|
+
hint: string;
|
|
9
|
+
extension: string;
|
|
10
|
+
mime: string;
|
|
11
|
+
}
|
|
12
|
+
export declare const EXPORT_FORMATS: readonly ExportFormat[];
|
|
13
|
+
/**
|
|
14
|
+
* The owl as a blob in one of the formats above.
|
|
15
|
+
*
|
|
16
|
+
* The rasters go through an `<img>` and a canvas so the browser draws the same
|
|
17
|
+
* SVG it would have drawn on screen, rather than this reimplementing the
|
|
18
|
+
* geometry and getting a slightly different owl.
|
|
19
|
+
*/
|
|
20
|
+
export declare function renderOwl(seed: string, look: WornLook, format: ExportFormat, size?: number): Promise<Blob>;
|
|
21
|
+
/** `sivert-owl.png`, and nothing a filesystem will refuse. */
|
|
22
|
+
export declare function exportFilename(nickname: string, format: ExportFormat): string;
|
|
23
|
+
/**
|
|
24
|
+
* Hand the blob to the browser as a download.
|
|
25
|
+
*
|
|
26
|
+
* The object URL is revoked on a timer rather than immediately. Revoking in the
|
|
27
|
+
* same tick can beat the download starting, and the failure is a save that
|
|
28
|
+
* silently does nothing.
|
|
29
|
+
*/
|
|
30
|
+
export declare function saveBlob(blob: Blob, filename: string): void;
|
|
31
|
+
//# sourceMappingURL=owlExport.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"owlExport.d.ts","sourceRoot":"","sources":["../../../src/components/OwlDesigner/owlExport.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,OAAO,EAAkC,KAAK,QAAQ,EAAgB,MAAM,WAAW,CAAC;AAExF,kEAAkE;AAClE,eAAO,MAAM,WAAW,OAAO,CAAC;AAEhC,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,KAAK,GAAG,KAAK,GAAG,MAAM,GAAG,MAAM,CAAC;IACpC,KAAK,EAAE,MAAM,CAAC;IACd,4DAA4D;IAC5D,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;CACd;AAED,eAAO,MAAM,cAAc,EAAE,SAAS,YAAY,EAKjD,CAAC;AAEF;;;;;;GAMG;AACH,wBAAsB,SAAS,CAC7B,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,QAAQ,EACd,MAAM,EAAE,YAAY,EACpB,IAAI,SAAc,GACjB,OAAO,CAAC,IAAI,CAAC,CAwCf;AAED,8DAA8D;AAC9D,wBAAgB,cAAc,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,YAAY,GAAG,MAAM,CAQ7E;AAED;;;;;;GAMG;AACH,wBAAgB,QAAQ,CAAC,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,GAAG,IAAI,CAS3D"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Which cosmetics somebody has already had a look at.
|
|
3
|
+
*
|
|
4
|
+
* Cosmetics get added and nothing says so, so the editor puts a dot on the ones
|
|
5
|
+
* that are new — on the drawing itself, and on its slot in the rail so you know
|
|
6
|
+
* which category to open.
|
|
7
|
+
*
|
|
8
|
+
* The whole feature turns on one decision, and it is the first-run case rather
|
|
9
|
+
* than anything about drawing dots.
|
|
10
|
+
*
|
|
11
|
+
* A fresh install has no record. Treating "not in the record" as "new" would
|
|
12
|
+
* light up all thirty-seven on the first open, which is worse than no badge at
|
|
13
|
+
* all: a badge on everything is a badge on nothing, and it trains somebody to
|
|
14
|
+
* ignore the dot before they have ever seen it mean something. So the first
|
|
15
|
+
* read writes the whole registry into the record and reports nothing as new.
|
|
16
|
+
*
|
|
17
|
+
* The badge therefore means exactly one thing — added since you last looked —
|
|
18
|
+
* which is the only thing it is any use for.
|
|
19
|
+
*
|
|
20
|
+
* localStorage, beside the wardrobe. It is a list of names; losing it costs a
|
|
21
|
+
* dot rather than an avatar, and IndexedDB would be a lot of machinery for
|
|
22
|
+
* something with that consequence.
|
|
23
|
+
*/
|
|
24
|
+
/**
|
|
25
|
+
* The cosmetics that have appeared since this person last opened the editor.
|
|
26
|
+
*
|
|
27
|
+
* `all` is every accessory name the running build knows. Pass the registry —
|
|
28
|
+
* this deliberately does not import it, so the caller decides what "everything"
|
|
29
|
+
* means and this stays a store rather than a second source of truth.
|
|
30
|
+
*
|
|
31
|
+
* Empty on a first run, by design. See the note at the top.
|
|
32
|
+
*/
|
|
33
|
+
export declare function readNewCosmetics(all: readonly string[]): Set<string>;
|
|
34
|
+
/**
|
|
35
|
+
* Record that somebody has tried one on, and return what is still new.
|
|
36
|
+
*
|
|
37
|
+
* Tried on, not hovered or scrolled past. Wearing a thing is the moment you
|
|
38
|
+
* have actually seen it, and it is also the moment the dot has done its job.
|
|
39
|
+
*/
|
|
40
|
+
export declare function markCosmeticSeen(name: string, all: readonly string[]): Set<string>;
|
|
41
|
+
/**
|
|
42
|
+
* Record every one of them, for "I have looked, stop telling me".
|
|
43
|
+
*
|
|
44
|
+
* Returns an empty set so a caller can use it as the new state directly.
|
|
45
|
+
*/
|
|
46
|
+
export declare function markAllCosmeticsSeen(all: readonly string[]): Set<string>;
|
|
47
|
+
//# sourceMappingURL=owlSeen.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"owlSeen.d.ts","sourceRoot":"","sources":["../../../src/components/OwlDesigner/owlSeen.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAyBH;;;;;;;;GAQG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,SAAS,MAAM,EAAE,GAAG,GAAG,CAAC,MAAM,CAAC,CAUpE;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,SAAS,MAAM,EAAE,GAAG,GAAG,CAAC,MAAM,CAAC,CAQlF;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,SAAS,MAAM,EAAE,GAAG,GAAG,CAAC,MAAM,CAAC,CAGxE"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Every look somebody has worn, kept so going back to one is a click.
|
|
3
|
+
*
|
|
4
|
+
* A look is a sixteen-character string from `@gryt/owl`, which is what makes a
|
|
5
|
+
* wardrobe cheap enough to be worth having: a wardrobe of pictures would be an
|
|
6
|
+
* upload and a stored file per entry, and nobody would keep more than a couple.
|
|
7
|
+
* A wardrobe of strings is a list in settings.
|
|
8
|
+
*
|
|
9
|
+
* Newest first, deduplicated, and capped — see LIMIT for why there is one.
|
|
10
|
+
*/
|
|
11
|
+
export interface WardrobeEntry {
|
|
12
|
+
/** The encoded look. */
|
|
13
|
+
worn: string;
|
|
14
|
+
/** When it was last used, so the newest reads as "what I have on". */
|
|
15
|
+
at: number;
|
|
16
|
+
}
|
|
17
|
+
export declare function readWardrobe(): WardrobeEntry[];
|
|
18
|
+
/**
|
|
19
|
+
* Records a look as worn, and returns the wardrobe as it now stands.
|
|
20
|
+
*
|
|
21
|
+
* Wearing something again moves it to the front rather than adding a second
|
|
22
|
+
* copy, so the list stays a set of looks rather than a history of clicks.
|
|
23
|
+
*/
|
|
24
|
+
export declare function rememberLook(worn: string): WardrobeEntry[];
|
|
25
|
+
export declare function forgetLook(worn: string): WardrobeEntry[];
|
|
26
|
+
//# sourceMappingURL=owlWardrobe.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"owlWardrobe.d.ts","sourceRoot":"","sources":["../../../src/components/OwlDesigner/owlWardrobe.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAWH,MAAM,WAAW,aAAa;IAC5B,wBAAwB;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,sEAAsE;IACtE,EAAE,EAAE,MAAM,CAAC;CACZ;AAED,wBAAgB,YAAY,IAAI,aAAa,EAAE,CAiB9C;AAUD;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,aAAa,EAAE,CAK1D;AAED,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,aAAa,EAAE,CAIxD"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { GrytBezier } from '@gryt/theme';
|
|
2
|
+
interface CurveEditorProps {
|
|
3
|
+
value: GrytBezier;
|
|
4
|
+
onChange: (next: GrytBezier) => void;
|
|
5
|
+
/** Drawn faintly behind, to compare against. */
|
|
6
|
+
reference?: readonly number[];
|
|
7
|
+
/**
|
|
8
|
+
* A sampled curve to draw instead of the bezier, with no handles.
|
|
9
|
+
*
|
|
10
|
+
* For the named curves. A spring is not a cubic bezier and cannot be shown
|
|
11
|
+
* as one, so while a named curve is selected the graph draws the samples the
|
|
12
|
+
* theme will actually run and offers nothing to drag — the alternative was
|
|
13
|
+
* a prominent line that was not the curve in effect, which is worse than no
|
|
14
|
+
* line at all.
|
|
15
|
+
*/
|
|
16
|
+
samples?: readonly number[];
|
|
17
|
+
}
|
|
18
|
+
export declare function CurveEditor({ value, onChange, reference, samples }: CurveEditorProps): import("react").JSX.Element;
|
|
19
|
+
export {};
|
|
20
|
+
//# sourceMappingURL=CurveEditor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CurveEditor.d.ts","sourceRoot":"","sources":["../../../src/components/ThemeEditor/CurveEditor.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAuB9C,UAAU,gBAAgB;IACxB,KAAK,EAAE,UAAU,CAAC;IAClB,QAAQ,EAAE,CAAC,IAAI,EAAE,UAAU,KAAK,IAAI,CAAC;IACrC,gDAAgD;IAChD,SAAS,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAC9B;;;;;;;;OAQG;IACH,OAAO,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;CAC7B;AAID,wBAAgB,WAAW,CAAC,EAC1B,KAAK,EACL,QAAQ,EACR,SAAS,EACT,OAAO,EACR,EAAE,gBAAgB,+BA2IlB"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { GrytFontKey, GrytFonts } from '@gryt/theme';
|
|
2
|
+
interface FontFieldProps {
|
|
3
|
+
role: GrytFontKey;
|
|
4
|
+
fonts: GrytFonts | null | undefined;
|
|
5
|
+
onChange: (stack: string) => void;
|
|
6
|
+
/** Says so when a remote face will not be fetched on this machine. */
|
|
7
|
+
remoteAllowed?: boolean;
|
|
8
|
+
}
|
|
9
|
+
export declare function FontField({ role, fonts, onChange, remoteAllowed }: FontFieldProps): import("react").JSX.Element;
|
|
10
|
+
export {};
|
|
11
|
+
//# sourceMappingURL=FontField.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FontField.d.ts","sourceRoot":"","sources":["../../../src/components/ThemeEditor/FontField.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AA6B1D,UAAU,cAAc;IACtB,IAAI,EAAE,WAAW,CAAC;IAClB,KAAK,EAAE,SAAS,GAAG,IAAI,GAAG,SAAS,CAAC;IACpC,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,sEAAsE;IACtE,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB;AAID,wBAAgB,SAAS,CAAC,EACxB,IAAI,EACJ,KAAK,EACL,QAAQ,EACR,aAAoB,EACrB,EAAE,cAAc,+BAqFhB"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { GrytMotion } from '@gryt/theme';
|
|
2
|
+
interface MotionFieldProps {
|
|
3
|
+
motion: GrytMotion | null | undefined;
|
|
4
|
+
onChange: (next: GrytMotion) => void;
|
|
5
|
+
}
|
|
6
|
+
export declare function MotionField({ motion, onChange }: MotionFieldProps): import("react").JSX.Element;
|
|
7
|
+
export {};
|
|
8
|
+
//# sourceMappingURL=MotionField.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MotionField.d.ts","sourceRoot":"","sources":["../../../src/components/ThemeEditor/MotionField.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAc,UAAU,EAAmB,MAAM,aAAa,CAAC;AAoC3E,UAAU,gBAAgB;IACxB,MAAM,EAAE,UAAU,GAAG,IAAI,GAAG,SAAS,CAAC;IACtC,QAAQ,EAAE,CAAC,IAAI,EAAE,UAAU,KAAK,IAAI,CAAC;CACtC;AAED,wBAAgB,WAAW,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,EAAE,gBAAgB,+BAuHjE"}
|
|
@@ -13,11 +13,20 @@ export interface ThemeEditorProps {
|
|
|
13
13
|
*/
|
|
14
14
|
appearance: GrytAppearance;
|
|
15
15
|
onAppearanceChange: (next: GrytAppearance) => void;
|
|
16
|
+
/**
|
|
17
|
+
* Whether a face this machine has to fetch will actually be fetched.
|
|
18
|
+
*
|
|
19
|
+
* The client keeps that behind a setting, so the picker says when a choice
|
|
20
|
+
* will not take effect rather than letting somebody pick a font and wonder
|
|
21
|
+
* why nothing changed. Defaults to true, which is right for the docs site
|
|
22
|
+
* and for anything with no such setting.
|
|
23
|
+
*/
|
|
24
|
+
remoteFontsAllowed?: boolean;
|
|
16
25
|
/** End of the header row. Where a host puts its own copy or save control. */
|
|
17
26
|
actions?: ReactNode;
|
|
18
27
|
/** Under the controls. Where the docs site puts the export tabs. */
|
|
19
28
|
footer?: ReactNode;
|
|
20
29
|
className?: string;
|
|
21
30
|
}
|
|
22
|
-
export declare function ThemeEditor({ value: draft, onChange, appearance, onAppearanceChange, actions, footer, className }: ThemeEditorProps): import("react").JSX.Element;
|
|
31
|
+
export declare function ThemeEditor({ value: draft, onChange, appearance, onAppearanceChange, remoteFontsAllowed, actions, footer, className }: ThemeEditorProps): import("react").JSX.Element;
|
|
23
32
|
//# sourceMappingURL=ThemeEditor.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ThemeEditor.d.ts","sourceRoot":"","sources":["../../../src/components/ThemeEditor/ThemeEditor.tsx"],"names":[],"mappings":"AA0BA,OAAO,KAAK,EAAE,cAAc,
|
|
1
|
+
{"version":3,"file":"ThemeEditor.d.ts","sourceRoot":"","sources":["../../../src/components/ThemeEditor/ThemeEditor.tsx"],"names":[],"mappings":"AA0BA,OAAO,KAAK,EAAE,cAAc,EAA2B,MAAM,aAAa,CAAC;AAU3E,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AA0BvC,OAAO,KAAK,EAKV,UAAU,EACX,MAAM,SAAS,CAAC;AA8BjB,MAAM,WAAW,gBAAgB;IAC/B,sEAAsE;IACtE,KAAK,EAAE,UAAU,CAAC;IAClB,QAAQ,EAAE,CAAC,IAAI,EAAE,UAAU,KAAK,IAAI,CAAC;IACrC;;;;;OAKG;IACH,UAAU,EAAE,cAAc,CAAC;IAC3B,kBAAkB,EAAE,CAAC,IAAI,EAAE,cAAc,KAAK,IAAI,CAAC;IACnD;;;;;;;OAOG;IACH,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,6EAA6E;IAC7E,OAAO,CAAC,EAAE,SAAS,CAAC;IACpB,oEAAoE;IACpE,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,wBAAgB,WAAW,CAAC,EAC1B,KAAK,EAAE,KAAK,EACZ,QAAQ,EACR,UAAU,EACV,kBAAkB,EAClB,kBAAyB,EACzB,OAAO,EACP,MAAM,EACN,SAAS,EACV,EAAE,gBAAgB,+BAsblB"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { GrytFontKey, GrytFonts } from '@gryt/theme';
|
|
2
|
+
export interface FontChoice {
|
|
3
|
+
/** What the picker shows. */
|
|
4
|
+
label: string;
|
|
5
|
+
/** The whole stack, fallbacks included. */
|
|
6
|
+
stack: string;
|
|
7
|
+
/** Needs fetching from Google. False for anything already on the machine. */
|
|
8
|
+
remote: boolean;
|
|
9
|
+
/** One line on what it is for. */
|
|
10
|
+
note: string;
|
|
11
|
+
}
|
|
12
|
+
export declare const FONT_CHOICES: FontChoice[];
|
|
13
|
+
/** Roles in the order somebody sets them, with what each one is actually for. */
|
|
14
|
+
export declare const FONT_ROLE_LABELS: Record<GrytFontKey, string>;
|
|
15
|
+
export declare const FONT_ROLE_HINTS: Record<GrytFontKey, string>;
|
|
16
|
+
/** The stack a role is on, whether or not the theme carries any fonts. */
|
|
17
|
+
export declare function fontFor(fonts: GrytFonts | null | undefined, role: GrytFontKey): string;
|
|
18
|
+
/** The listed choice a stack corresponds to, if it is one of them. */
|
|
19
|
+
export declare function choiceFor(stack: string): FontChoice | undefined;
|
|
20
|
+
/**
|
|
21
|
+
* The family a stack asks for first, for a picker to show and a loader to
|
|
22
|
+
* fetch. `"Inter", ui-sans-serif, …` is Inter.
|
|
23
|
+
*/
|
|
24
|
+
export declare function primaryFamily(stack: string): string;
|
|
25
|
+
//# sourceMappingURL=fonts.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fonts.d.ts","sourceRoot":"","sources":["../../../src/components/ThemeEditor/fonts.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAoB1D,MAAM,WAAW,UAAU;IACzB,6BAA6B;IAC7B,KAAK,EAAE,MAAM,CAAC;IACd,2CAA2C;IAC3C,KAAK,EAAE,MAAM,CAAC;IACd,6EAA6E;IAC7E,MAAM,EAAE,OAAO,CAAC;IAChB,kCAAkC;IAClC,IAAI,EAAE,MAAM,CAAC;CACd;AAMD,eAAO,MAAM,YAAY,EAAE,UAAU,EA+EpC,CAAC;AAEF,iFAAiF;AACjF,eAAO,MAAM,gBAAgB,EAAE,MAAM,CAAC,WAAW,EAAE,MAAM,CAIxD,CAAC;AAEF,eAAO,MAAM,eAAe,EAAE,MAAM,CAAC,WAAW,EAAE,MAAM,CAIvD,CAAC;AAEF,0EAA0E;AAC1E,wBAAgB,OAAO,CAAC,KAAK,EAAE,SAAS,GAAG,IAAI,GAAG,SAAS,EAAE,IAAI,EAAE,WAAW,GAAG,MAAM,CAEtF;AAED,sEAAsE;AACtE,wBAAgB,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,UAAU,GAAG,SAAS,CAE/D;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAGnD"}
|