@takuhon/ui 0.15.0 → 0.16.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/GravatarField.module-2DD457OD.module.css +26 -0
- package/dist/admin/index.d.ts +20 -1
- package/dist/admin/index.js +211 -151
- package/dist/admin/index.js.map +1 -1
- package/package.json +2 -2
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
.actionRow {
|
|
2
|
+
display: flex;
|
|
3
|
+
margin-block-start: var(--takuhon-space-2);
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
.applyButton {
|
|
7
|
+
min-height: var(--takuhon-tap-target);
|
|
8
|
+
padding-inline: var(--takuhon-space-3);
|
|
9
|
+
border: 1px solid var(--takuhon-color-border);
|
|
10
|
+
border-radius: var(--takuhon-radius-sm);
|
|
11
|
+
background-color: var(--takuhon-color-bg);
|
|
12
|
+
color: var(--takuhon-color-text);
|
|
13
|
+
font-family: var(--takuhon-font-family);
|
|
14
|
+
font-size: var(--takuhon-font-size-base);
|
|
15
|
+
cursor: pointer;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.applyButton:disabled {
|
|
19
|
+
opacity: 0.4;
|
|
20
|
+
cursor: not-allowed;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.applyButton:focus-visible {
|
|
24
|
+
outline: 2px solid var(--takuhon-color-primary);
|
|
25
|
+
outline-offset: 2px;
|
|
26
|
+
}
|
package/dist/admin/index.d.ts
CHANGED
|
@@ -176,6 +176,22 @@ interface ImageFieldProps {
|
|
|
176
176
|
*/
|
|
177
177
|
declare function ImageField({ label, value, onChange, errors, hint, uploadAsset, }: ImageFieldProps): React.JSX.Element;
|
|
178
178
|
|
|
179
|
+
interface GravatarFieldProps {
|
|
180
|
+
/** Called with the generated Gravatar URL when the owner applies an email. */
|
|
181
|
+
onApply: (url: string) => void;
|
|
182
|
+
}
|
|
183
|
+
/**
|
|
184
|
+
* "Use Gravatar" control: an email input plus a button that turns the email into
|
|
185
|
+
* a Gravatar avatar URL via core's pure {@link gravatarUrl}. This is the third
|
|
186
|
+
* way to set an avatar, alongside pasting a URL and uploading an image.
|
|
187
|
+
*
|
|
188
|
+
* The email is local-only — it is never written to the document or sent
|
|
189
|
+
* anywhere. Only the generated URL is handed to {@link GravatarFieldProps.onApply}
|
|
190
|
+
* (which the parent writes into `avatar.url`); the email input is cleared once
|
|
191
|
+
* applied, so nothing about the address lingers in the form.
|
|
192
|
+
*/
|
|
193
|
+
declare function GravatarField({ onApply }: GravatarFieldProps): React.JSX.Element;
|
|
194
|
+
|
|
179
195
|
interface LocaleTabsProps {
|
|
180
196
|
/** Group label, e.g. `"Display name"`. */
|
|
181
197
|
label: string;
|
|
@@ -285,6 +301,8 @@ declare const EN: {
|
|
|
285
301
|
readonly 'field.avatarUrl': "Avatar URL";
|
|
286
302
|
readonly 'field.avatarUpload': "Upload image";
|
|
287
303
|
readonly 'field.avatarAlt': "Avatar alternative text";
|
|
304
|
+
readonly 'field.gravatarEmail': "Gravatar email";
|
|
305
|
+
readonly 'field.gravatarApply': "Use Gravatar";
|
|
288
306
|
readonly 'field.location.country': "Country";
|
|
289
307
|
readonly 'field.location.region': "Region";
|
|
290
308
|
readonly 'field.location.locality': "Locality";
|
|
@@ -328,6 +346,7 @@ declare const EN: {
|
|
|
328
346
|
readonly 'empty.skills': "No skills yet.";
|
|
329
347
|
readonly 'hint.avatarNoUpload': "Paste an image URL. Uploading image files is not available yet.";
|
|
330
348
|
readonly 'hint.avatarUpload': "Paste an image URL, or upload a JPEG, PNG, WebP, or GIF.";
|
|
349
|
+
readonly 'hint.gravatar': "Enter an email to generate a Gravatar avatar URL. The email is not saved — only the resulting URL is stored.";
|
|
331
350
|
readonly 'hint.month': "Format: YYYY-MM (e.g. 2024-03).";
|
|
332
351
|
readonly 'hint.country': "ISO 3166-1 alpha-2 code, e.g. US.";
|
|
333
352
|
readonly 'hint.tags': "Comma-separated.";
|
|
@@ -469,4 +488,4 @@ interface AdminEditorProps {
|
|
|
469
488
|
*/
|
|
470
489
|
declare function AdminEditor({ initialDocument, onSave, onReload, onExport, onImport, formatLocale, uploadAsset, }: AdminEditorProps): React.JSX.Element;
|
|
471
490
|
|
|
472
|
-
export { AdminEditor, type AdminEditorProps, type AdminLabelKey, type AdminSaveOutcome, type AssetUploadResult, CareersForm, type CareersFormProps, CheckboxField, type CheckboxFieldProps, Field, type FieldControlProps, type FieldErrorIndex, type FieldErrorLike, type FieldProps, ImageField, type ImageFieldProps, LinksForm, type LinksFormProps, LocaleTabs, type LocaleTabsProps, NO_FIELD_ERRORS, ProfileForm, type ProfileFormProps, ProjectsForm, type ProjectsFormProps, RawJsonEditor, type RawJsonEditorProps, Repeater, type RepeaterProps, SelectField, type SelectFieldProps, type SelectOption, SettingsForm, type SettingsFormProps, SkillsForm, type SkillsFormProps, TextAreaField, type TextAreaFieldProps, TextField, type TextFieldProps, type UploadAsset, canonicalPointer, collectErrorsUnder, errorsAt, getAdminLabel, hasErrorsUnder, indexErrors, indexValidationErrors };
|
|
491
|
+
export { AdminEditor, type AdminEditorProps, type AdminLabelKey, type AdminSaveOutcome, type AssetUploadResult, CareersForm, type CareersFormProps, CheckboxField, type CheckboxFieldProps, Field, type FieldControlProps, type FieldErrorIndex, type FieldErrorLike, type FieldProps, GravatarField, type GravatarFieldProps, ImageField, type ImageFieldProps, LinksForm, type LinksFormProps, LocaleTabs, type LocaleTabsProps, NO_FIELD_ERRORS, ProfileForm, type ProfileFormProps, ProjectsForm, type ProjectsFormProps, RawJsonEditor, type RawJsonEditorProps, Repeater, type RepeaterProps, SelectField, type SelectFieldProps, type SelectOption, SettingsForm, type SettingsFormProps, SkillsForm, type SkillsFormProps, TextAreaField, type TextAreaFieldProps, TextField, type TextFieldProps, type UploadAsset, canonicalPointer, collectErrorsUnder, errorsAt, getAdminLabel, hasErrorsUnder, indexErrors, indexValidationErrors };
|