@liiift-studio/sanity-font-manager 2.5.2 → 2.5.3
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/UploadModal-NQZGBJAH.js +7 -0
- package/dist/UploadModal-YJCVHM63.mjs +7 -0
- package/dist/chunk-EBO3CZXG.mjs +15 -0
- package/dist/chunk-MCKGQKYU.js +15 -0
- package/dist/{chunk-YMQEM4AO.js → chunk-PGSHWNGW.js} +5 -3466
- package/dist/{chunk-FT7YTFZW.mjs → chunk-WSQYNIIZ.mjs} +4 -3465
- package/dist/index.js +46 -45
- package/dist/index.mjs +3 -2
- package/dist/unbrotli-CTU3FKHW.mjs +3434 -0
- package/dist/unbrotli-NSXTNE2T.js +3434 -0
- package/package.json +1 -1
- package/src/utils/parseFont.js +12 -16
- package/dist/UploadModal-2AAJXZJK.js +0 -6
- package/dist/UploadModal-DDTVJ2MA.mjs +0 -6
package/dist/index.js
CHANGED
|
@@ -60,7 +60,8 @@
|
|
|
60
60
|
|
|
61
61
|
|
|
62
62
|
|
|
63
|
-
var
|
|
63
|
+
var _chunkPGSHWNGWjs = require('./chunk-PGSHWNGW.js');
|
|
64
|
+
require('./chunk-MCKGQKYU.js');
|
|
64
65
|
|
|
65
66
|
// src/components/BatchUploadFonts.jsx
|
|
66
67
|
var _react = require('react'); var _react2 = _interopRequireDefault(_react);
|
|
@@ -114,7 +115,7 @@ var uploadFontFiles = async (fontsObjects, subfamilies, client, inputPrice, styl
|
|
|
114
115
|
if (fileType === "woff2") {
|
|
115
116
|
console.log(`[${i + 1}/${fontObjectKeys.length}][${j + 1}/${files.length}] Generating CSS for: ${fontObject.title}`);
|
|
116
117
|
setStatus(`[${i + 1}/${fontObjectKeys.length}][${j + 1}/${files.length}] Generating CSS for: ${fontObject.title}`);
|
|
117
|
-
newFileInput = await
|
|
118
|
+
newFileInput = await _chunkPGSHWNGWjs.generateCssFile.call(void 0, {
|
|
118
119
|
woff2File: file,
|
|
119
120
|
fileInput: newFileInput,
|
|
120
121
|
fontName: fontObject.title,
|
|
@@ -128,7 +129,7 @@ var uploadFontFiles = async (fontsObjects, subfamilies, client, inputPrice, styl
|
|
|
128
129
|
if (fileType === "ttf") {
|
|
129
130
|
console.log(`[${i + 1}/${fontObjectKeys.length}][${j + 1}/${files.length}] Generating font data for: ${fontObject.title}`);
|
|
130
131
|
setStatus(`[${i + 1}/${fontObjectKeys.length}][${j + 1}/${files.length}] Generating font data for: ${fontObject.title}`);
|
|
131
|
-
const metadata = await
|
|
132
|
+
const metadata = await _chunkPGSHWNGWjs.generateFontData.call(void 0, {
|
|
132
133
|
fontId: fontObject._id,
|
|
133
134
|
url: baseAsset.url,
|
|
134
135
|
fontKit,
|
|
@@ -241,7 +242,7 @@ var createOrUpdateFontDocument = async (font, client, setError) => {
|
|
|
241
242
|
delete font.fontKit;
|
|
242
243
|
delete font.originalFilename;
|
|
243
244
|
if (font.variableFont && font.variableInstances) {
|
|
244
|
-
const instanceMappings = await
|
|
245
|
+
const instanceMappings = await _chunkPGSHWNGWjs.parseVariableFontInstances.call(void 0, font, client);
|
|
245
246
|
if (instanceMappings.length > 0) {
|
|
246
247
|
font.variableInstanceReferences = instanceMappings;
|
|
247
248
|
}
|
|
@@ -406,9 +407,9 @@ var renameFontDocuments = async ({
|
|
|
406
407
|
const res = await fetch(ttfAsset.url);
|
|
407
408
|
file = await res.blob();
|
|
408
409
|
}
|
|
409
|
-
const fontBuffer = await
|
|
410
|
-
const font = await
|
|
411
|
-
const { weightName, subfamilyName, fontTitle } =
|
|
410
|
+
const fontBuffer = await _chunkPGSHWNGWjs.readFontFile.call(void 0, file);
|
|
411
|
+
const font = await _chunkPGSHWNGWjs.parseFont.call(void 0, fontBuffer, `${fontDoc._id}.ttf`);
|
|
412
|
+
const { weightName, subfamilyName, fontTitle } = _chunkPGSHWNGWjs.extractFontMetadata.call(void 0,
|
|
412
413
|
font,
|
|
413
414
|
typefaceName,
|
|
414
415
|
weightKeywordList,
|
|
@@ -588,7 +589,7 @@ var groupFontsBySubfamily = (fonts) => {
|
|
|
588
589
|
if ((_a = font.title) == null ? void 0 : _a.includes("VF")) {
|
|
589
590
|
subfamilies[`VF_${font.title}`] = [font];
|
|
590
591
|
} else {
|
|
591
|
-
const subfamilyName = font.subfamily ?
|
|
592
|
+
const subfamilyName = font.subfamily ? _chunkPGSHWNGWjs.expandAbbreviations.call(void 0, font.subfamily) : "Regular";
|
|
592
593
|
if (!subfamilies[subfamilyName]) subfamilies[subfamilyName] = [];
|
|
593
594
|
subfamilies[subfamilyName].push(font);
|
|
594
595
|
}
|
|
@@ -636,7 +637,7 @@ var updateTypefaceSubfamilies = async (doc_id, stylesObject, newSubfamiliesArray
|
|
|
636
637
|
};
|
|
637
638
|
|
|
638
639
|
// src/components/BatchUploadFonts.jsx
|
|
639
|
-
var UploadModal2 = _react.lazy.call(void 0, () => Promise.resolve().then(() => _interopRequireWildcard(require("./UploadModal-
|
|
640
|
+
var UploadModal2 = _react.lazy.call(void 0, () => Promise.resolve().then(() => _interopRequireWildcard(require("./UploadModal-NQZGBJAH.js"))));
|
|
640
641
|
var ACCEPTED_EXTENSIONS = ["ttf", "otf", "woff", "woff2", "eot", "svg"];
|
|
641
642
|
var formatElapsed = (s) => {
|
|
642
643
|
const m = Math.floor(s / 60);
|
|
@@ -665,7 +666,7 @@ var BatchUploadFonts = () => {
|
|
|
665
666
|
const slug = _sanity.useFormValue.call(void 0, ["slug"]);
|
|
666
667
|
const stylesObject = _sanity.useFormValue.call(void 0, ["styles"]) || { fonts: [], variableFont: [] };
|
|
667
668
|
const subfamiliesArray = (stylesObject == null ? void 0 : stylesObject.subfamilies) || [];
|
|
668
|
-
const { weightKeywordList, italicKeywordList } = _react.useMemo.call(void 0, () =>
|
|
669
|
+
const { weightKeywordList, italicKeywordList } = _react.useMemo.call(void 0, () => _chunkPGSHWNGWjs.generateStyleKeywords.call(void 0, ), []);
|
|
669
670
|
_react.useEffect.call(void 0, () => {
|
|
670
671
|
if (ready !== true) {
|
|
671
672
|
setElapsedSeconds(0);
|
|
@@ -778,7 +779,7 @@ var BatchUploadFonts = () => {
|
|
|
778
779
|
}
|
|
779
780
|
const sortedFiles = sortFilesByType(pendingFiles);
|
|
780
781
|
setPendingFiles([]);
|
|
781
|
-
const { fontsObjects, subfamilies, uniqueSubfamilies, newPreferredStyle, failedFiles } = await
|
|
782
|
+
const { fontsObjects, subfamilies, uniqueSubfamilies, newPreferredStyle, failedFiles } = await _chunkPGSHWNGWjs.processFontFiles.call(void 0,
|
|
782
783
|
sortedFiles,
|
|
783
784
|
title,
|
|
784
785
|
weightKeywordList,
|
|
@@ -797,7 +798,7 @@ var BatchUploadFonts = () => {
|
|
|
797
798
|
setError,
|
|
798
799
|
preserveFileNames
|
|
799
800
|
);
|
|
800
|
-
await
|
|
801
|
+
await _chunkPGSHWNGWjs.updateTypefaceDocument.call(void 0,
|
|
801
802
|
doc_id,
|
|
802
803
|
fontRefs,
|
|
803
804
|
variableRefs,
|
|
@@ -914,7 +915,7 @@ var BatchUploadFonts = () => {
|
|
|
914
915
|
const woff2Blob = await woff2Response.blob();
|
|
915
916
|
const woff2File = new File([woff2Blob], `${fontDoc._id}.woff2`, { type: "font/woff2" });
|
|
916
917
|
setStatus(`Regenerating CSS for font ${i + 1}/${fontRefs.length}: ${fontDoc.title}`);
|
|
917
|
-
const updatedFileInput = await
|
|
918
|
+
const updatedFileInput = await _chunkPGSHWNGWjs.generateCssFile.call(void 0, {
|
|
918
919
|
woff2File,
|
|
919
920
|
fileInput: fontDoc.fileInput,
|
|
920
921
|
fileName: fontDoc._id,
|
|
@@ -1136,7 +1137,7 @@ var BatchUploadFonts = () => {
|
|
|
1136
1137
|
), renderTooltipLabel(
|
|
1137
1138
|
"Preserve shortened names",
|
|
1138
1139
|
'Abbreviations in font names are kept as-is (e.g. "XNarrow" stays "XNarrow", "Bd" stays "Bd").'
|
|
1139
|
-
)), ready === "rename" ? renderProcessing() : /* @__PURE__ */ _react2.default.createElement(_ui.Button, { mode: "ghost", tone: "primary", text: "Rename Existing Fonts", style: { width: "100%" }, onClick: handleRenameExistingFonts, disabled: ready !== true })), /* @__PURE__ */ _react2.default.createElement(_ui.Stack, { space: 3 }, /* @__PURE__ */ _react2.default.createElement(_ui.Text, { size: 1, weight: "semibold", style: { lineHeight: 1.6 } }, "Update Font Prices"), ready === "price" ? renderProcessing() : /* @__PURE__ */ _react2.default.createElement(_ui.Stack, { space: 2 }, /* @__PURE__ */ _react2.default.createElement(
|
|
1140
|
+
)), ready === "rename" ? renderProcessing() : /* @__PURE__ */ _react2.default.createElement(_ui.Button, { mode: "ghost", tone: "primary", text: "Rename Existing Fonts", style: { width: "100%" }, onClick: handleRenameExistingFonts, disabled: ready !== true })), /* @__PURE__ */ _react2.default.createElement(_ui.Stack, { space: 3 }, /* @__PURE__ */ _react2.default.createElement(_ui.Text, { size: 1, weight: "semibold", style: { lineHeight: 1.6 } }, "Update Font Prices"), ready === "price" ? renderProcessing() : /* @__PURE__ */ _react2.default.createElement(_ui.Stack, { space: 2 }, /* @__PURE__ */ _react2.default.createElement(_chunkPGSHWNGWjs.PriceInput_default, { inputPrice, handleInputChange }), /* @__PURE__ */ _react2.default.createElement(_ui.Button, { mode: "ghost", tone: "primary", text: "Update All Font Prices", style: { width: "100%" }, onClick: handleChangeFontPrice, disabled: ready !== true }))), /* @__PURE__ */ _react2.default.createElement(_ui.Stack, { space: 3 }, /* @__PURE__ */ _react2.default.createElement(_ui.Text, { size: 1, weight: "semibold", style: { lineHeight: 1.6 } }, "Regenerate CSS"), /* @__PURE__ */ _react2.default.createElement(_ui.Text, { size: 1, muted: true, style: { lineHeight: 1.6 } }, "Rebuilds the CSS @font-face files for all fonts in the typeface fonts list."), ready === "css" ? renderProcessing() : /* @__PURE__ */ _react2.default.createElement(_ui.Button, { mode: "ghost", tone: "primary", text: "Regenerate CSS Files", style: { width: "100%" }, onClick: handleRegenerateCssFiles, disabled: ready !== true }))))));
|
|
1140
1141
|
};
|
|
1141
1142
|
|
|
1142
1143
|
// src/components/GenerateCollectionsPairsComponent.jsx
|
|
@@ -1488,7 +1489,7 @@ var SingleUploaderTool = (props) => {
|
|
|
1488
1489
|
const doc_style = _sanity.useFormValue.call(void 0, ["style"]);
|
|
1489
1490
|
const doc_slug = _sanity.useFormValue.call(void 0, ["slug"]);
|
|
1490
1491
|
const doc_metaData = _sanity.useFormValue.call(void 0, ["metaData"]);
|
|
1491
|
-
const { weightKeywordList, italicKeywordList } = _react.useMemo.call(void 0, () =>
|
|
1492
|
+
const { weightKeywordList, italicKeywordList } = _react.useMemo.call(void 0, () => _chunkPGSHWNGWjs.generateStyleKeywords.call(void 0, ), []);
|
|
1492
1493
|
_react.useEffect.call(void 0, () => {
|
|
1493
1494
|
handleSetFilenames();
|
|
1494
1495
|
}, [fileInput]);
|
|
@@ -1542,7 +1543,7 @@ var SingleUploaderTool = (props) => {
|
|
|
1542
1543
|
{ id: woff2AssetRef }
|
|
1543
1544
|
);
|
|
1544
1545
|
const blob = await (await fetch(woff2Asset.url)).blob();
|
|
1545
|
-
const newFileInput = await
|
|
1546
|
+
const newFileInput = await _chunkPGSHWNGWjs.generateCssFile.call(void 0, {
|
|
1546
1547
|
woff2File: blob,
|
|
1547
1548
|
fileInput,
|
|
1548
1549
|
fontName: doc_title,
|
|
@@ -1633,16 +1634,16 @@ var SingleUploaderTool = (props) => {
|
|
|
1633
1634
|
);
|
|
1634
1635
|
if (!(ttfAsset == null ? void 0 : ttfAsset.url)) throw new Error("Could not fetch TTF file URL");
|
|
1635
1636
|
const arrayBuffer = await (await fetch(ttfAsset.url)).arrayBuffer();
|
|
1636
|
-
const font = await
|
|
1637
|
-
const { weightName, subfamilyName, style, variableFont } =
|
|
1637
|
+
const font = await _chunkPGSHWNGWjs.parseFont.call(void 0, arrayBuffer, `${doc_id}.ttf`);
|
|
1638
|
+
const { weightName, subfamilyName, style, variableFont } = _chunkPGSHWNGWjs.extractFontMetadata.call(void 0,
|
|
1638
1639
|
font,
|
|
1639
1640
|
doc_typefaceName,
|
|
1640
1641
|
weightKeywordList,
|
|
1641
1642
|
italicKeywordList
|
|
1642
1643
|
);
|
|
1643
|
-
const weight =
|
|
1644
|
+
const weight = _chunkPGSHWNGWjs.determineWeight.call(void 0, font, weightName);
|
|
1644
1645
|
await client.patch(doc_id).set({ weightName, subfamily: subfamilyName, style, variableFont, weight }).commit();
|
|
1645
|
-
const fontData = await
|
|
1646
|
+
const fontData = await _chunkPGSHWNGWjs.generateFontData.call(void 0, {
|
|
1646
1647
|
url: ttfAsset.url,
|
|
1647
1648
|
fontKit: font,
|
|
1648
1649
|
fontId: doc_id,
|
|
@@ -1656,7 +1657,7 @@ var SingleUploaderTool = (props) => {
|
|
|
1656
1657
|
variableFont,
|
|
1657
1658
|
variableInstances: fontData.variableInstances
|
|
1658
1659
|
};
|
|
1659
|
-
const instanceMappings = await
|
|
1660
|
+
const instanceMappings = await _chunkPGSHWNGWjs.parseVariableFontInstances.call(void 0, fontObj, client);
|
|
1660
1661
|
if (instanceMappings.length > 0) {
|
|
1661
1662
|
await client.patch(doc_id).set({ variableInstanceReferences: instanceMappings }).commit();
|
|
1662
1663
|
}
|
|
@@ -1775,7 +1776,7 @@ var SingleUploaderTool = (props) => {
|
|
|
1775
1776
|
if (code === "woff2") {
|
|
1776
1777
|
setMessage("Building CSS: " + doc_title + ".css");
|
|
1777
1778
|
setStatus("Building CSS file");
|
|
1778
|
-
newFileInput = await
|
|
1779
|
+
newFileInput = await _chunkPGSHWNGWjs.generateCssFile.call(void 0, {
|
|
1779
1780
|
woff2File: file,
|
|
1780
1781
|
fileInput: newFileInput,
|
|
1781
1782
|
fontName: doc_title,
|
|
@@ -1789,15 +1790,15 @@ var SingleUploaderTool = (props) => {
|
|
|
1789
1790
|
setStatus("CSS file built successfully");
|
|
1790
1791
|
}
|
|
1791
1792
|
if (code === "ttf") {
|
|
1792
|
-
const fontBuffer = await
|
|
1793
|
-
const font = await
|
|
1794
|
-
const { weightName, subfamilyName, style, variableFont } =
|
|
1793
|
+
const fontBuffer = await _chunkPGSHWNGWjs.readFontFile.call(void 0, file);
|
|
1794
|
+
const font = await _chunkPGSHWNGWjs.parseFont.call(void 0, fontBuffer, file.name);
|
|
1795
|
+
const { weightName, subfamilyName, style, variableFont } = _chunkPGSHWNGWjs.extractFontMetadata.call(void 0,
|
|
1795
1796
|
font,
|
|
1796
1797
|
doc_typefaceName,
|
|
1797
1798
|
weightKeywordList,
|
|
1798
1799
|
italicKeywordList
|
|
1799
1800
|
);
|
|
1800
|
-
const weight =
|
|
1801
|
+
const weight = _chunkPGSHWNGWjs.determineWeight.call(void 0, font, weightName);
|
|
1801
1802
|
const normalizedId = doc_id.startsWith("drafts.") ? doc_id.replace("drafts.", "") : doc_id;
|
|
1802
1803
|
await client.patch(normalizedId).set({ weightName, subfamily: subfamilyName, style, variableFont, weight }).commit();
|
|
1803
1804
|
}
|
|
@@ -2036,7 +2037,7 @@ var UploadScriptsComponent = (props) => {
|
|
|
2036
2037
|
const stylesObject = _sanity.useFormValue.call(void 0, ["styles"]);
|
|
2037
2038
|
let subfamiliesArray = (stylesObject == null ? void 0 : stylesObject.subfamilies) || [];
|
|
2038
2039
|
const { weightKeywordList, italicKeywordList } = _react.useMemo.call(void 0,
|
|
2039
|
-
() =>
|
|
2040
|
+
() => _chunkPGSHWNGWjs.generateStyleKeywords.call(void 0, ),
|
|
2040
2041
|
[]
|
|
2041
2042
|
);
|
|
2042
2043
|
const readFontFile3 = (file) => {
|
|
@@ -2068,21 +2069,21 @@ var UploadScriptsComponent = (props) => {
|
|
|
2068
2069
|
for (var i = 0; i < event.target.files.length; i++) {
|
|
2069
2070
|
const file = event.target.files[i];
|
|
2070
2071
|
const fontBuffer = await readFontFile3(file);
|
|
2071
|
-
const font = await
|
|
2072
|
-
const fullName =
|
|
2073
|
-
const familyName =
|
|
2072
|
+
const font = await _chunkPGSHWNGWjs.parseFont.call(void 0, fontBuffer, file.name);
|
|
2073
|
+
const fullName = _chunkPGSHWNGWjs.getNameString.call(void 0, font, 4);
|
|
2074
|
+
const familyName = _chunkPGSHWNGWjs.getNameString.call(void 0, font, 1);
|
|
2074
2075
|
console.log("Reading font:", fullName, file.name);
|
|
2075
|
-
let weightName =
|
|
2076
|
+
let weightName = _chunkPGSHWNGWjs.getNameString.call(void 0, font, 17) || _chunkPGSHWNGWjs.getNameString.call(void 0, font, 2) || "";
|
|
2076
2077
|
weightName = weightName.replace("Italic", "").replace("It", "").trim();
|
|
2077
2078
|
if ((weightName == "" || weightName.toLowerCase() == "roman") && fullName) {
|
|
2078
2079
|
weightName = fullName.replace(title + " ", "").replace(title, "").trim();
|
|
2079
2080
|
weightName = weightName.replace("Italic", "").replace("It", "").trim();
|
|
2080
2081
|
}
|
|
2081
|
-
const axes =
|
|
2082
|
+
const axes = _chunkPGSHWNGWjs.getVariationAxes.call(void 0, font);
|
|
2082
2083
|
let variableFont = axes !== null;
|
|
2083
2084
|
let subfamilyName = familyName.toLowerCase().trim().replace(title.toLowerCase().trim(), "").trim();
|
|
2084
2085
|
let fontTitle = fullName;
|
|
2085
|
-
const italicAngle =
|
|
2086
|
+
const italicAngle = _chunkPGSHWNGWjs.getItalicAngle.call(void 0, font);
|
|
2086
2087
|
let style = italicAngle !== 0 || fullName.toLowerCase().includes("italic") ? "Italic" : "Regular";
|
|
2087
2088
|
if (fontTitle.toLowerCase().trim().includes(script)) {
|
|
2088
2089
|
fontTitle = fontTitle.toLowerCase().trim().replace(script, "").trim();
|
|
@@ -2118,7 +2119,7 @@ var UploadScriptsComponent = (props) => {
|
|
|
2118
2119
|
}
|
|
2119
2120
|
if (variableFont && !fontTitle.toLowerCase().trim().endsWith(" vf")) fontTitle = fontTitle + " VF";
|
|
2120
2121
|
if (italicKW.length > 0) {
|
|
2121
|
-
italicKW = italicKW.map((item) =>
|
|
2122
|
+
italicKW = italicKW.map((item) => _chunkPGSHWNGWjs.reverseSpellingLookup.call(void 0, item));
|
|
2122
2123
|
fontTitle = fontTitle + italicKW.join(" ");
|
|
2123
2124
|
style = "Italic";
|
|
2124
2125
|
}
|
|
@@ -2152,7 +2153,7 @@ var UploadScriptsComponent = (props) => {
|
|
|
2152
2153
|
variableFont,
|
|
2153
2154
|
weightName,
|
|
2154
2155
|
normalWeight: true,
|
|
2155
|
-
weight:
|
|
2156
|
+
weight: _chunkPGSHWNGWjs.getWeightClass.call(void 0, font) || (/hairline|extra thin|extrathin/.test(weightName == null ? void 0 : weightName.toLowerCase()) ? 100 : /thin|extra light|extralight/.test(weightName == null ? void 0 : weightName.toLowerCase()) ? 200 : /light|book/.test(weightName == null ? void 0 : weightName.toLowerCase()) ? 300 : /regular|normal/.test(weightName == null ? void 0 : weightName.toLowerCase()) ? 400 : /medium/.test(weightName == null ? void 0 : weightName.toLowerCase()) ? 500 : /semi bold|semibold/.test(weightName == null ? void 0 : weightName.toLowerCase()) ? 600 : /bold/.test(weightName == null ? void 0 : weightName.toLowerCase()) ? 700 : /extra bold|extrabold/.test(weightName == null ? void 0 : weightName.toLowerCase()) ? 800 : /black|ultra/.test(weightName == null ? void 0 : weightName.toLowerCase()) ? 900 : 400),
|
|
2156
2157
|
files: [file],
|
|
2157
2158
|
fontKit: font,
|
|
2158
2159
|
scriptFileInput: { [script]: {} }
|
|
@@ -2201,7 +2202,7 @@ var UploadScriptsComponent = (props) => {
|
|
|
2201
2202
|
if (file.name.endsWith(".woff2")) {
|
|
2202
2203
|
console.log("generating css file for: ", fontObject.title);
|
|
2203
2204
|
setStatus("generating css file for: " + fontObject.title);
|
|
2204
|
-
newFileInput = await
|
|
2205
|
+
newFileInput = await _chunkPGSHWNGWjs.generateCssFile.call(void 0, {
|
|
2205
2206
|
woff2File: file,
|
|
2206
2207
|
fileInput: newFileInput,
|
|
2207
2208
|
// script: script,
|
|
@@ -2453,7 +2454,7 @@ var FontScriptUploaderComponent = (props) => {
|
|
|
2453
2454
|
);
|
|
2454
2455
|
let blob = await fetch(woff2Buffer.url);
|
|
2455
2456
|
blob = await blob.blob();
|
|
2456
|
-
let newFileInput = await
|
|
2457
|
+
let newFileInput = await _chunkPGSHWNGWjs.generateCssFile.call(void 0, {
|
|
2457
2458
|
woff2File: blob,
|
|
2458
2459
|
fileInput: scriptFileInput,
|
|
2459
2460
|
language,
|
|
@@ -2538,7 +2539,7 @@ var FontScriptUploaderComponent = (props) => {
|
|
|
2538
2539
|
if (code === "woff2") {
|
|
2539
2540
|
console.log("woff2");
|
|
2540
2541
|
setMessage({ ...message, [language]: "Generating Css: " + doc_title + ".css" });
|
|
2541
|
-
newFileInput = await
|
|
2542
|
+
newFileInput = await _chunkPGSHWNGWjs.generateCssFile.call(void 0, {
|
|
2542
2543
|
woff2File: file,
|
|
2543
2544
|
fileInput: newFileInput,
|
|
2544
2545
|
language,
|
|
@@ -2927,7 +2928,7 @@ function VariableInstanceReferencesInput(props) {
|
|
|
2927
2928
|
console.warn("Cannot autofill: no variableInstances data on this document");
|
|
2928
2929
|
return;
|
|
2929
2930
|
}
|
|
2930
|
-
const mappings = await
|
|
2931
|
+
const mappings = await _chunkPGSHWNGWjs.parseVariableFontInstances.call(void 0, formDocument, sanityClient);
|
|
2931
2932
|
if (mappings.length === 0) {
|
|
2932
2933
|
console.warn("No variable instances could be parsed from this font");
|
|
2933
2934
|
return;
|
|
@@ -3341,12 +3342,12 @@ async function getEmptyFontKit({ title, files, weightKeywordList, italicKeywordL
|
|
|
3341
3342
|
for (var i = 0; i < files.length; i++) {
|
|
3342
3343
|
const file = files[i];
|
|
3343
3344
|
const fontBuffer = await readFontFile2(file);
|
|
3344
|
-
const font = await
|
|
3345
|
-
let weightName =
|
|
3346
|
-
const axes =
|
|
3345
|
+
const font = await _chunkPGSHWNGWjs.parseFont.call(void 0, fontBuffer, file.name);
|
|
3346
|
+
let weightName = _chunkPGSHWNGWjs.getNameString.call(void 0, font, 17) || _chunkPGSHWNGWjs.getNameString.call(void 0, font, 2) || "";
|
|
3347
|
+
const axes = _chunkPGSHWNGWjs.getVariationAxes.call(void 0, font);
|
|
3347
3348
|
let variableFont = axes !== null;
|
|
3348
|
-
const familyName =
|
|
3349
|
-
const fullName =
|
|
3349
|
+
const familyName = _chunkPGSHWNGWjs.getNameString.call(void 0, font, 1);
|
|
3350
|
+
const fullName = _chunkPGSHWNGWjs.getNameString.call(void 0, font, 4);
|
|
3350
3351
|
let subfamilyName = familyName.toLowerCase().trim().replace(title.toLowerCase().trim(), "").trim();
|
|
3351
3352
|
let fontTitle = fullName.toLowerCase().trim();
|
|
3352
3353
|
weightKeywordList.forEach((keyword) => {
|
|
@@ -6216,4 +6217,4 @@ function createStylesField({
|
|
|
6216
6217
|
|
|
6217
6218
|
|
|
6218
6219
|
|
|
6219
|
-
exports.BatchUploadFonts = BatchUploadFonts; exports.BulkActions =
|
|
6220
|
+
exports.BatchUploadFonts = BatchUploadFonts; exports.BulkActions = _chunkPGSHWNGWjs.BulkActions; exports.DISCOUNT_REQUIREMENT_TYPES = DISCOUNT_REQUIREMENT_TYPES; exports.DISCOUNT_REQUIREMENT_TYPES_OBJECT = DISCOUNT_REQUIREMENT_TYPES_OBJECT; exports.EXECUTION_STATUS = _chunkPGSHWNGWjs.EXECUTION_STATUS; exports.ExistingDocumentResolver = _chunkPGSHWNGWjs.ExistingDocumentResolver; exports.FONT_STATUS = _chunkPGSHWNGWjs.FONT_STATUS; exports.FontReviewCard = _chunkPGSHWNGWjs.FontReviewCard_default; exports.FontScriptUploaderComponent = FontScriptUploaderComponent; exports.GenerateCollectionsPairsComponent = GenerateCollectionsPairsComponent; exports.HtmlDescription = HtmlDescription; exports.KeyValueInput = KeyValueInput; exports.KeyValueReferenceInput = KeyValueReferenceInput; exports.NestedObjectArraySelector = NestedObjectArraySelector; exports.PLAN_PHASE = _chunkPGSHWNGWjs.PLAN_PHASE; exports.PLAN_VERSION = _chunkPGSHWNGWjs.PLAN_VERSION; exports.PriceInput = _chunkPGSHWNGWjs.PriceInput_default; exports.PrimaryCollectionGeneratorTypeface = PrimaryCollectionGeneratorTypeface; exports.RECOMMENDATION = _chunkPGSHWNGWjs.RECOMMENDATION; exports.RegenerateSubfamiliesComponent = RegenerateSubfamiliesComponent; exports.SCRIPTS = SCRIPTS; exports.SCRIPTS_OBJECT = SCRIPTS_OBJECT; exports.SetOTF = SetOTF; exports.SingleUploaderTool = SingleUploaderTool; exports.StatusDisplay = StatusDisplay_default; exports.StyleCountInput = StyleCountInput; exports.UpdateScriptsComponent = UpdateScriptsComponent; exports.UploadButton = UploadButton_default; exports.UploadModal = _chunkPGSHWNGWjs.UploadModal; exports.UploadScriptsComponent = UploadScriptsComponent; exports.UploadStep1Settings = _chunkPGSHWNGWjs.UploadStep1Settings; exports.UploadStep2Review = _chunkPGSHWNGWjs.UploadStep2Review; exports.UploadStep3Execute = _chunkPGSHWNGWjs.UploadStep3Execute; exports.UploadStep3bInstances = _chunkPGSHWNGWjs.UploadStep3bInstances; exports.UploadSummary = _chunkPGSHWNGWjs.UploadSummary; exports.VariableInstanceReferencesInput = VariableInstanceReferencesInput; exports.addItalicToFontTitle = _chunkPGSHWNGWjs.addItalicToFontTitle; exports.buildUploadPlan = _chunkPGSHWNGWjs.buildUploadPlan; exports.createEmptyPlan = _chunkPGSHWNGWjs.createEmptyPlan; exports.createFontDecisions = _chunkPGSHWNGWjs.createFontDecisions; exports.createFontObject = _chunkPGSHWNGWjs.createFontObject; exports.createInitialExecutionState = _chunkPGSHWNGWjs.createInitialExecutionState; exports.createStylesField = createStylesField; exports.determineWeight = _chunkPGSHWNGWjs.determineWeight; exports.escapeCssFontName = _chunkPGSHWNGWjs.escapeCssFontName; exports.executeUploadPlan = _chunkPGSHWNGWjs.executeUploadPlan; exports.executionReducer = _chunkPGSHWNGWjs.executionReducer; exports.expandAbbreviations = _chunkPGSHWNGWjs.expandAbbreviations; exports.extractFontMetadata = _chunkPGSHWNGWjs.extractFontMetadata; exports.extractWeightFromFullName = _chunkPGSHWNGWjs.extractWeightFromFullName; exports.extractWeightName = _chunkPGSHWNGWjs.extractWeightName; exports.formatFontTitle = _chunkPGSHWNGWjs.formatFontTitle; exports.generateCssFile = _chunkPGSHWNGWjs.generateCssFile; exports.generateFontData = _chunkPGSHWNGWjs.generateFontData; exports.generateFontFile = generateFontFile; exports.generateStyleKeywords = _chunkPGSHWNGWjs.generateStyleKeywords; exports.generateSubset = generateSubset; exports.getAllFeatureTags = _chunkPGSHWNGWjs.getAllFeatureTags; exports.getCharacterSet = _chunkPGSHWNGWjs.getCharacterSet; exports.getEmptyFontKit = getEmptyFontKit; exports.getFamilyClass = _chunkPGSHWNGWjs.getFamilyClass; exports.getFontMetadata = _chunkPGSHWNGWjs.getFontMetadata; exports.getFontMetrics = _chunkPGSHWNGWjs.getFontMetrics; exports.getFsSelection = _chunkPGSHWNGWjs.getFsSelection; exports.getGlyphCount = _chunkPGSHWNGWjs.getGlyphCount; exports.getItalicAngle = _chunkPGSHWNGWjs.getItalicAngle; exports.getMacStyle = _chunkPGSHWNGWjs.getMacStyle; exports.getNameString = _chunkPGSHWNGWjs.getNameString; exports.getNamedInstances = _chunkPGSHWNGWjs.getNamedInstances; exports.getVariationAxes = _chunkPGSHWNGWjs.getVariationAxes; exports.getWeightClass = _chunkPGSHWNGWjs.getWeightClass; exports.logFontInfo = _chunkPGSHWNGWjs.logFontInfo; exports.openTypeField = openTypeField; exports.parseFont = _chunkPGSHWNGWjs.parseFont; exports.parseVariableFontInstances = _chunkPGSHWNGWjs.parseVariableFontInstances_default; exports.planReducer = _chunkPGSHWNGWjs.planReducer; exports.processFontFiles = _chunkPGSHWNGWjs.processFontFiles; exports.processItalicKeywords = _chunkPGSHWNGWjs.processItalicKeywords; exports.processSubfamilyName = _chunkPGSHWNGWjs.processSubfamilyName; exports.readFontFile = _chunkPGSHWNGWjs.readFontFile; exports.removeWeightNames = _chunkPGSHWNGWjs.removeWeightNames; exports.renameFontDocuments = renameFontDocuments; exports.resolveExistingFont = _chunkPGSHWNGWjs.resolveExistingFont; exports.reverseSpellingLookup = _chunkPGSHWNGWjs.reverseSpellingLookup; exports.sanitizeForSanityId = _chunkPGSHWNGWjs.sanitizeForSanityId; exports.sortFontObjects = _chunkPGSHWNGWjs.sortFontObjects; exports.styleCountField = styleCountField; exports.stylisticSetField = stylisticSetField; exports.updateFontPrices = updateFontPrices; exports.updateTypefaceDocument = _chunkPGSHWNGWjs.updateTypefaceDocument; exports.uploadFontFiles = uploadFontFiles; exports.useNestedObjects = useNestedObjects; exports.useSanityClient = useSanityClient;
|
package/dist/index.mjs
CHANGED
|
@@ -60,7 +60,8 @@ import {
|
|
|
60
60
|
sanitizeForSanityId,
|
|
61
61
|
sortFontObjects,
|
|
62
62
|
updateTypefaceDocument
|
|
63
|
-
} from "./chunk-
|
|
63
|
+
} from "./chunk-WSQYNIIZ.mjs";
|
|
64
|
+
import "./chunk-EBO3CZXG.mjs";
|
|
64
65
|
|
|
65
66
|
// src/components/BatchUploadFonts.jsx
|
|
66
67
|
import React3, { useCallback, useState as useState2, useMemo as useMemo2, useRef, useEffect, lazy, Suspense } from "react";
|
|
@@ -636,7 +637,7 @@ var updateTypefaceSubfamilies = async (doc_id, stylesObject, newSubfamiliesArray
|
|
|
636
637
|
};
|
|
637
638
|
|
|
638
639
|
// src/components/BatchUploadFonts.jsx
|
|
639
|
-
var UploadModal2 = lazy(() => import("./UploadModal-
|
|
640
|
+
var UploadModal2 = lazy(() => import("./UploadModal-YJCVHM63.mjs"));
|
|
640
641
|
var ACCEPTED_EXTENSIONS = ["ttf", "otf", "woff", "woff2", "eot", "svg"];
|
|
641
642
|
var formatElapsed = (s) => {
|
|
642
643
|
const m = Math.floor(s / 60);
|