fontdue-js 3.15.1 → 3.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/AGENTS.md +29 -0
- package/CHANGELOG.md +5 -0
- package/dist/__generated__/FreeDownloadFormMutation.graphql.d.ts +43 -0
- package/dist/__generated__/FreeDownloadFormMutation.graphql.js +98 -0
- package/dist/__generated__/FreeDownloadForm_Query.graphql.d.ts +46 -0
- package/dist/__generated__/FreeDownloadForm_Query.graphql.js +186 -0
- package/dist/__tests__/freeDownloadForm.test.js +222 -0
- package/dist/__tests__/trackEvents.test.js +131 -0
- package/dist/components/FreeDownloadForm/FreeDownloadFormElement.d.ts +10 -0
- package/dist/components/FreeDownloadForm/FreeDownloadFormElement.js +17 -0
- package/dist/components/FreeDownloadForm/index.d.ts +21 -0
- package/dist/components/FreeDownloadForm/index.js +283 -0
- package/dist/components/FreeDownloadForm/index.server.d.ts +9 -0
- package/dist/components/FreeDownloadForm/index.server.js +22 -0
- package/dist/components/FreeDownloadForm/variables.d.ts +8 -0
- package/dist/components/FreeDownloadForm/variables.js +18 -0
- package/dist/components/Root/index.js +1 -0
- package/dist/components/Tracking/sendTrackEvent.d.ts +28 -0
- package/dist/components/Tracking/sendTrackEvent.js +68 -0
- package/dist/components/track.d.ts +21 -0
- package/dist/components/track.js +31 -0
- package/dist/fontdue.css +32 -0
- package/dist/i18n/de.js +12 -0
- package/dist/i18n/en.d.ts +11 -0
- package/dist/i18n/en.js +12 -0
- package/dist/version.js +1 -1
- package/package.json +6 -1
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import { useCallback } from 'react';
|
|
4
|
+
import { useFontdueUrl } from './UrlContext.js';
|
|
5
|
+
import { fontdueBaseUrl } from '../relay/environment.js';
|
|
6
|
+
import { sendTrackEvent } from './Tracking/sendTrackEvent.js';
|
|
7
|
+
/**
|
|
8
|
+
* Returns a function that records one of your own analytics events, sent to
|
|
9
|
+
* the Fontdue site `<FontdueProvider>` is configured for.
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* const track = useTrack();
|
|
13
|
+
* <button onClick={() => track('Contest Entered', { contest: 'summer' })}>Enter</button>
|
|
14
|
+
*/
|
|
15
|
+
export function useTrack() {
|
|
16
|
+
const url = useFontdueUrl();
|
|
17
|
+
return useCallback((event, properties, options) => sendTrackEvent(url, event, properties, options), [url]);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Records one of your own analytics events from outside a React component,
|
|
22
|
+
* sent to the Fontdue site configured in the environment (`FONTDUE_URL`,
|
|
23
|
+
* `NEXT_PUBLIC_FONTDUE_URL`…). Inside a component, prefer `useTrack()`, which
|
|
24
|
+
* follows `<FontdueProvider url>`.
|
|
25
|
+
*
|
|
26
|
+
* @example
|
|
27
|
+
* track('Newsletter Link Clicked', { placement: 'footer' });
|
|
28
|
+
*/
|
|
29
|
+
export function track(event, properties, options) {
|
|
30
|
+
return sendTrackEvent(fontdueBaseUrl() ?? '', event, properties, options);
|
|
31
|
+
}
|
package/dist/fontdue.css
CHANGED
|
@@ -116,6 +116,37 @@
|
|
|
116
116
|
text-decoration: underline;
|
|
117
117
|
}
|
|
118
118
|
|
|
119
|
+
.free-download__styles, .free-download__section {
|
|
120
|
+
margin-bottom: 30px;
|
|
121
|
+
}
|
|
122
|
+
.free-download__errors {
|
|
123
|
+
color: red;
|
|
124
|
+
margin-bottom: 30px;
|
|
125
|
+
}
|
|
126
|
+
.free-download__errors p {
|
|
127
|
+
margin: 0 0 0.5em;
|
|
128
|
+
}
|
|
129
|
+
.free-download__checkbox-field {
|
|
130
|
+
display: flex;
|
|
131
|
+
align-items: center;
|
|
132
|
+
margin-bottom: 20px;
|
|
133
|
+
}
|
|
134
|
+
.free-download__checkbox-field a {
|
|
135
|
+
color: inherit;
|
|
136
|
+
}
|
|
137
|
+
.free-download__checkbox-field .checkbox {
|
|
138
|
+
--checkbox-color: currentColor;
|
|
139
|
+
}
|
|
140
|
+
.free-download__checkbox-field label p {
|
|
141
|
+
margin: 0;
|
|
142
|
+
}
|
|
143
|
+
.free-download__checkbox-field[data-highlighted=true] {
|
|
144
|
+
color: red;
|
|
145
|
+
}
|
|
146
|
+
.free-download__required {
|
|
147
|
+
opacity: 0.6;
|
|
148
|
+
}
|
|
149
|
+
|
|
119
150
|
.icon {
|
|
120
151
|
display: inline-flex;
|
|
121
152
|
justify-content: center;
|
|
@@ -4099,6 +4130,7 @@ input:disabled + .fontdue-admin-toolbar__switch {
|
|
|
4099
4130
|
}
|
|
4100
4131
|
|
|
4101
4132
|
fontdue-test-fonts-form,
|
|
4133
|
+
fontdue-free-download-form,
|
|
4102
4134
|
fontdue-newsletter-signup,
|
|
4103
4135
|
fontdue-customer-login-form,
|
|
4104
4136
|
fontdue-customer-sign-in {
|
package/dist/i18n/de.js
CHANGED
|
@@ -228,6 +228,18 @@ const de = {
|
|
|
228
228
|
'testFonts.unavailable': 'Für diese Familie sind keine Testschriften verfügbar.',
|
|
229
229
|
'testFonts.families': 'Familien',
|
|
230
230
|
'testFonts.selectAll': 'Alle auswählen',
|
|
231
|
+
// Free download form
|
|
232
|
+
'freeDownload.download': 'Herunterladen',
|
|
233
|
+
'freeDownload.unavailable': 'Diese Schriften sind nicht als kostenloser Download verfügbar.',
|
|
234
|
+
'freeDownload.freeStyles': 'Kostenlose Schnitte: {styles}',
|
|
235
|
+
'freeDownload.agreement': {
|
|
236
|
+
one: 'Ich stimme der Lizenz {licenses} zu',
|
|
237
|
+
other: 'Ich stimme den Lizenzen {licenses} zu'
|
|
238
|
+
},
|
|
239
|
+
'freeDownload.and': 'und',
|
|
240
|
+
'freeDownload.newsletter': 'Für den Newsletter anmelden',
|
|
241
|
+
'freeDownload.newsletterRequired': '(für den Download erforderlich)',
|
|
242
|
+
'freeDownload.sent': 'Bitte prüfen Sie Ihr Postfach – wir haben den Download-Link an {email} gesendet.',
|
|
231
243
|
// Password-protected collections
|
|
232
244
|
'password.incorrect': 'Falsches Passwort',
|
|
233
245
|
'password.label': 'Passwort *',
|
package/dist/i18n/en.d.ts
CHANGED
|
@@ -170,6 +170,17 @@ declare const en: {
|
|
|
170
170
|
'testFonts.unavailable': string;
|
|
171
171
|
'testFonts.families': string;
|
|
172
172
|
'testFonts.selectAll': string;
|
|
173
|
+
'freeDownload.download': string;
|
|
174
|
+
'freeDownload.unavailable': string;
|
|
175
|
+
'freeDownload.freeStyles': string;
|
|
176
|
+
'freeDownload.agreement': {
|
|
177
|
+
one: string;
|
|
178
|
+
other: string;
|
|
179
|
+
};
|
|
180
|
+
'freeDownload.and': string;
|
|
181
|
+
'freeDownload.newsletter': string;
|
|
182
|
+
'freeDownload.newsletterRequired': string;
|
|
183
|
+
'freeDownload.sent': string;
|
|
173
184
|
'password.incorrect': string;
|
|
174
185
|
'password.label': string;
|
|
175
186
|
'password.placeholder': string;
|
package/dist/i18n/en.js
CHANGED
|
@@ -208,6 +208,18 @@ const en = {
|
|
|
208
208
|
'testFonts.unavailable': 'Test fonts aren’t available for this family.',
|
|
209
209
|
'testFonts.families': 'Families',
|
|
210
210
|
'testFonts.selectAll': 'Select all',
|
|
211
|
+
// Free download form
|
|
212
|
+
'freeDownload.download': 'Download',
|
|
213
|
+
'freeDownload.unavailable': 'These fonts aren’t available as a free download.',
|
|
214
|
+
'freeDownload.freeStyles': 'Free styles: {styles}',
|
|
215
|
+
'freeDownload.agreement': {
|
|
216
|
+
one: 'I agree to the {licenses} license',
|
|
217
|
+
other: 'I agree to the {licenses} licenses'
|
|
218
|
+
},
|
|
219
|
+
'freeDownload.and': 'and',
|
|
220
|
+
'freeDownload.newsletter': 'Sign me up for the newsletter',
|
|
221
|
+
'freeDownload.newsletterRequired': '(required to download)',
|
|
222
|
+
'freeDownload.sent': 'Check your email – we’ve sent the download link to {email}.',
|
|
211
223
|
// Password-protected collections
|
|
212
224
|
'password.incorrect': 'Incorrect password',
|
|
213
225
|
'password.label': 'Password *',
|
package/dist/version.js
CHANGED
|
@@ -8,4 +8,4 @@
|
|
|
8
8
|
// (Fontage.ClientVersions) to spot sites that need to upgrade before a
|
|
9
9
|
// feature that depends on a newer client can work for them.
|
|
10
10
|
export const CLIENT_VERSION_HEADER = 'fontdue-client-version';
|
|
11
|
-
export const version = "3.
|
|
11
|
+
export const version = "3.16.0";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "fontdue-js",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.16.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"build": "npm run relay && run-p build-js build-css build-ts",
|
|
@@ -112,6 +112,10 @@
|
|
|
112
112
|
"react-server": "./dist/components/FontdueProvider/index.server.js",
|
|
113
113
|
"default": "./dist/components/FontdueProvider/index.js"
|
|
114
114
|
},
|
|
115
|
+
"./FreeDownloadForm": {
|
|
116
|
+
"react-server": "./dist/components/FreeDownloadForm/index.server.js",
|
|
117
|
+
"default": "./dist/components/FreeDownloadForm/index.js"
|
|
118
|
+
},
|
|
115
119
|
"./NewsletterSignup": {
|
|
116
120
|
"react-server": "./dist/components/NewsletterSignup/index.server.js",
|
|
117
121
|
"default": "./dist/components/NewsletterSignup/index.js"
|
|
@@ -132,6 +136,7 @@
|
|
|
132
136
|
"default": "./dist/components/TypeTesters/index.js"
|
|
133
137
|
},
|
|
134
138
|
"./useAutofit": "./dist/hooks/useAutofit.js",
|
|
139
|
+
"./track": "./dist/components/track.js",
|
|
135
140
|
"./useConsent": "./dist/components/useConsent.js",
|
|
136
141
|
"./useFont": "./dist/components/useFont.js",
|
|
137
142
|
"./useFontStyle": "./dist/components/useFont.js"
|