@liiift-studio/sanity-font-manager 2.5.1 → 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/index.js CHANGED
@@ -60,7 +60,8 @@
60
60
 
61
61
 
62
62
 
63
- var _chunkJCDZ7SWZjs = require('./chunk-JCDZ7SWZ.js');
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 _chunkJCDZ7SWZjs.generateCssFile.call(void 0, {
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 _chunkJCDZ7SWZjs.generateFontData.call(void 0, {
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 _chunkJCDZ7SWZjs.parseVariableFontInstances.call(void 0, font, client);
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 _chunkJCDZ7SWZjs.readFontFile.call(void 0, file);
410
- const font = await _chunkJCDZ7SWZjs.parseFont.call(void 0, fontBuffer, `${fontDoc._id}.ttf`);
411
- const { weightName, subfamilyName, fontTitle } = _chunkJCDZ7SWZjs.extractFontMetadata.call(void 0,
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 ? _chunkJCDZ7SWZjs.expandAbbreviations.call(void 0, font.subfamily) : "Regular";
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-WPK2CXLR.js"))));
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, () => _chunkJCDZ7SWZjs.generateStyleKeywords.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 _chunkJCDZ7SWZjs.processFontFiles.call(void 0,
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 _chunkJCDZ7SWZjs.updateTypefaceDocument.call(void 0,
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 _chunkJCDZ7SWZjs.generateCssFile.call(void 0, {
918
+ const updatedFileInput = await _chunkPGSHWNGWjs.generateCssFile.call(void 0, {
918
919
  woff2File,
919
920
  fileInput: fontDoc.fileInput,
920
921
  fileName: fontDoc._id,
@@ -1021,7 +1022,7 @@ var BatchUploadFonts = () => {
1021
1022
  style: { fontFamily: "monospace", minWidth: "2.5rem", flexShrink: 0 }
1022
1023
  },
1023
1024
  ext
1024
- ), /* @__PURE__ */ _react2.default.createElement(_ui.Box, { style: { flex: 1, minWidth: 0, overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" } }, /* @__PURE__ */ _react2.default.createElement(_ui.Text, { size: 1 }, file.name))), /* @__PURE__ */ _react2.default.createElement(
1025
+ ), /* @__PURE__ */ _react2.default.createElement(_ui.Box, { style: { flex: 1, minWidth: 0 } }, /* @__PURE__ */ _react2.default.createElement(_ui.Text, { size: 1 }, file.name))), /* @__PURE__ */ _react2.default.createElement(
1025
1026
  _ui.Button,
1026
1027
  {
1027
1028
  mode: "bleed",
@@ -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(_chunkJCDZ7SWZjs.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
+ )), 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, () => _chunkJCDZ7SWZjs.generateStyleKeywords.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 _chunkJCDZ7SWZjs.generateCssFile.call(void 0, {
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 _chunkJCDZ7SWZjs.parseFont.call(void 0, arrayBuffer, `${doc_id}.ttf`);
1637
- const { weightName, subfamilyName, style, variableFont } = _chunkJCDZ7SWZjs.extractFontMetadata.call(void 0,
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 = _chunkJCDZ7SWZjs.determineWeight.call(void 0, font, weightName);
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 _chunkJCDZ7SWZjs.generateFontData.call(void 0, {
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 _chunkJCDZ7SWZjs.parseVariableFontInstances.call(void 0, fontObj, client);
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 _chunkJCDZ7SWZjs.generateCssFile.call(void 0, {
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 _chunkJCDZ7SWZjs.readFontFile.call(void 0, file);
1793
- const font = await _chunkJCDZ7SWZjs.parseFont.call(void 0, fontBuffer, file.name);
1794
- const { weightName, subfamilyName, style, variableFont } = _chunkJCDZ7SWZjs.extractFontMetadata.call(void 0,
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 = _chunkJCDZ7SWZjs.determineWeight.call(void 0, font, weightName);
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
  }
@@ -1938,18 +1939,18 @@ var SingleUploaderTool = (props) => {
1938
1939
  const formatUpper = format.toUpperCase();
1939
1940
  const hasFile = !!((_b2 = (_a2 = fileInput == null ? void 0 : fileInput[format]) == null ? void 0 : _a2.asset) == null ? void 0 : _b2._ref);
1940
1941
  const fileUrl = hasFile ? `https://cdn.sanity.io/files/${process.env.SANITY_STUDIO_PROJECT_ID}/${process.env.SANITY_STUDIO_DATASET}/${fileInput[format].asset._ref.replace("file-", "").replace("-", ".")}` : null;
1941
- return /* @__PURE__ */ _react2.default.createElement(_ui.Card, { border: true, radius: 1, paddingX: 2, paddingY: 3 }, /* @__PURE__ */ _react2.default.createElement(_ui.Flex, { justify: "space-between", align: "center", gap: 2 }, /* @__PURE__ */ _react2.default.createElement(_ui.Flex, { gap: 3, align: "center", style: { flex: 1, minWidth: 0 } }, /* @__PURE__ */ _react2.default.createElement(_ui.Text, { size: 0, style: { fontFamily: "monospace", minWidth: "2.5rem", flexShrink: 0, opacity: hasFile ? 1 : 0.5 } }, formatUpper), hasFile ? /* @__PURE__ */ _react2.default.createElement(_ui.Box, { style: { flex: 1, minWidth: 0, overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" } }, /* @__PURE__ */ _react2.default.createElement("a", { href: fileUrl, target: "_blank", rel: "noreferrer" }, (filenames == null ? void 0 : filenames[format]) || "File")) : /* @__PURE__ */ _react2.default.createElement(_ui.Text, { size: 1, muted: true }, "\u2014")), status === "ready" && /* @__PURE__ */ _react2.default.createElement(_ui.Flex, { gap: 1, align: "center", style: { flexShrink: 0 } }, buildSource && (fileInput == null ? void 0 : fileInput[buildSource]) && /* @__PURE__ */ _react2.default.createElement(_ui.Button, { mode: "ghost", tone: "primary", fontSize: 1, padding: 2, onClick: () => handleGenerateFontFile(format, fileInput[buildSource]), text: "Build" }), /* @__PURE__ */ _react2.default.createElement(_ui.Button, { as: "label", mode: "ghost", tone: "primary", fontSize: 1, padding: 2, style: { cursor: "pointer" } }, /* @__PURE__ */ _react2.default.createElement(_ui.Text, { size: 1 }, "Upload"), /* @__PURE__ */ _react2.default.createElement("input", { ref, type: "file", hidden: true, onChange: (e) => handleUpload(e, format) })), hasFile && /* @__PURE__ */ _react2.default.createElement(_ui.Button, { mode: "bleed", tone: "critical", icon: _icons.TrashIcon, padding: 2, onClick: () => handleDelete(format) }))));
1942
+ return /* @__PURE__ */ _react2.default.createElement(_ui.Card, { border: true, radius: 1, paddingX: 2, paddingY: 3 }, /* @__PURE__ */ _react2.default.createElement(_ui.Flex, { justify: "space-between", align: "center", gap: 2 }, /* @__PURE__ */ _react2.default.createElement(_ui.Flex, { gap: 3, align: "center", style: { flex: 1, minWidth: 0 } }, /* @__PURE__ */ _react2.default.createElement(_ui.Text, { size: 0, style: { fontFamily: "monospace", minWidth: "2.5rem", flexShrink: 0, opacity: hasFile ? 1 : 0.5 } }, formatUpper), hasFile ? /* @__PURE__ */ _react2.default.createElement(_ui.Box, { style: { flex: 1, minWidth: 0 } }, /* @__PURE__ */ _react2.default.createElement("a", { href: fileUrl, target: "_blank", rel: "noreferrer" }, (filenames == null ? void 0 : filenames[format]) || "File")) : /* @__PURE__ */ _react2.default.createElement(_ui.Text, { size: 1, muted: true }, "\u2014")), status === "ready" && /* @__PURE__ */ _react2.default.createElement(_ui.Flex, { gap: 1, align: "center", style: { flexShrink: 0 } }, buildSource && (fileInput == null ? void 0 : fileInput[buildSource]) && /* @__PURE__ */ _react2.default.createElement(_ui.Button, { mode: "ghost", tone: "primary", fontSize: 1, padding: 2, onClick: () => handleGenerateFontFile(format, fileInput[buildSource]), text: "Build" }), /* @__PURE__ */ _react2.default.createElement(_ui.Button, { as: "label", mode: "ghost", tone: "primary", fontSize: 1, padding: 2, style: { cursor: "pointer" } }, /* @__PURE__ */ _react2.default.createElement(_ui.Text, { size: 1 }, "Upload"), /* @__PURE__ */ _react2.default.createElement("input", { ref, type: "file", hidden: true, onChange: (e) => handleUpload(e, format) })), hasFile && /* @__PURE__ */ _react2.default.createElement(_ui.Button, { mode: "bleed", tone: "critical", icon: _icons.TrashIcon, padding: 2, onClick: () => handleDelete(format) }))));
1942
1943
  };
1943
1944
  const renderTopLevelAssetSection = (label, fieldName, assetRef, filename, onBuild) => {
1944
1945
  const hasFile = !!assetRef;
1945
1946
  const fileUrl = hasFile ? `https://cdn.sanity.io/files/${process.env.SANITY_STUDIO_PROJECT_ID}/${process.env.SANITY_STUDIO_DATASET}/${assetRef.replace("file-", "").replace("-", ".")}` : null;
1946
- return /* @__PURE__ */ _react2.default.createElement(_ui.Card, { border: true, radius: 1, paddingX: 2, paddingY: 3 }, /* @__PURE__ */ _react2.default.createElement(_ui.Flex, { justify: "space-between", align: "center", gap: 2 }, /* @__PURE__ */ _react2.default.createElement(_ui.Flex, { gap: 3, align: "center", style: { flex: 1, minWidth: 0 } }, /* @__PURE__ */ _react2.default.createElement(_ui.Text, { size: 0, style: { fontFamily: "monospace", minWidth: "2.5rem", flexShrink: 0, opacity: hasFile ? 1 : 0.5 } }, label), hasFile ? /* @__PURE__ */ _react2.default.createElement(_ui.Box, { style: { flex: 1, minWidth: 0, overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" } }, /* @__PURE__ */ _react2.default.createElement("a", { href: fileUrl, target: "_blank", rel: "noreferrer" }, filename || "File")) : /* @__PURE__ */ _react2.default.createElement(_ui.Text, { size: 1, muted: true }, "\u2014")), status === "ready" && /* @__PURE__ */ _react2.default.createElement(_ui.Flex, { gap: 1, align: "center", style: { flexShrink: 0 } }, onBuild && (fileInput == null ? void 0 : fileInput.woff2) && /* @__PURE__ */ _react2.default.createElement(_ui.Button, { mode: "ghost", tone: "primary", fontSize: 1, padding: 2, onClick: onBuild, text: "Build" }), /* @__PURE__ */ _react2.default.createElement(_ui.Button, { as: "label", mode: "ghost", tone: "primary", fontSize: 1, padding: 2, style: { cursor: "pointer" } }, /* @__PURE__ */ _react2.default.createElement(_ui.Text, { size: 1 }, "Upload"), /* @__PURE__ */ _react2.default.createElement("input", { type: "file", hidden: true, onChange: (e) => handleUploadTopLevelFile(e, fieldName) })), hasFile && /* @__PURE__ */ _react2.default.createElement(_ui.Button, { mode: "bleed", tone: "critical", icon: _icons.TrashIcon, padding: 2, onClick: () => handleDeleteTopLevel(fieldName) }))));
1947
+ return /* @__PURE__ */ _react2.default.createElement(_ui.Card, { border: true, radius: 1, paddingX: 2, paddingY: 3 }, /* @__PURE__ */ _react2.default.createElement(_ui.Flex, { justify: "space-between", align: "center", gap: 2 }, /* @__PURE__ */ _react2.default.createElement(_ui.Flex, { gap: 3, align: "center", style: { flex: 1, minWidth: 0 } }, /* @__PURE__ */ _react2.default.createElement(_ui.Text, { size: 0, style: { fontFamily: "monospace", minWidth: "2.5rem", flexShrink: 0, opacity: hasFile ? 1 : 0.5 } }, label), hasFile ? /* @__PURE__ */ _react2.default.createElement(_ui.Box, { style: { flex: 1, minWidth: 0 } }, /* @__PURE__ */ _react2.default.createElement("a", { href: fileUrl, target: "_blank", rel: "noreferrer" }, filename || "File")) : /* @__PURE__ */ _react2.default.createElement(_ui.Text, { size: 1, muted: true }, "\u2014")), status === "ready" && /* @__PURE__ */ _react2.default.createElement(_ui.Flex, { gap: 1, align: "center", style: { flexShrink: 0 } }, onBuild && (fileInput == null ? void 0 : fileInput.woff2) && /* @__PURE__ */ _react2.default.createElement(_ui.Button, { mode: "ghost", tone: "primary", fontSize: 1, padding: 2, onClick: onBuild, text: "Build" }), /* @__PURE__ */ _react2.default.createElement(_ui.Button, { as: "label", mode: "ghost", tone: "primary", fontSize: 1, padding: 2, style: { cursor: "pointer" } }, /* @__PURE__ */ _react2.default.createElement(_ui.Text, { size: 1 }, "Upload"), /* @__PURE__ */ _react2.default.createElement("input", { type: "file", hidden: true, onChange: (e) => handleUploadTopLevelFile(e, fieldName) })), hasFile && /* @__PURE__ */ _react2.default.createElement(_ui.Button, { mode: "bleed", tone: "critical", icon: _icons.TrashIcon, padding: 2, onClick: () => handleDeleteTopLevel(fieldName) }))));
1947
1948
  };
1948
1949
  const renderCssSection = () => {
1949
1950
  var _a2, _b2;
1950
1951
  const hasFile = !!((_b2 = (_a2 = fileInput == null ? void 0 : fileInput.css) == null ? void 0 : _a2.asset) == null ? void 0 : _b2._ref);
1951
1952
  const fileUrl = hasFile ? `https://cdn.sanity.io/files/${process.env.SANITY_STUDIO_PROJECT_ID}/${process.env.SANITY_STUDIO_DATASET}/${fileInput.css.asset._ref.replace("file-", "").replace("-", ".")}` : null;
1952
- return /* @__PURE__ */ _react2.default.createElement(_ui.Card, { border: true, radius: 1, paddingX: 2, paddingY: 3 }, /* @__PURE__ */ _react2.default.createElement(_ui.Flex, { justify: "space-between", align: "center", gap: 2 }, /* @__PURE__ */ _react2.default.createElement(_ui.Flex, { gap: 3, align: "center", style: { flex: 1, minWidth: 0 } }, /* @__PURE__ */ _react2.default.createElement(_ui.Text, { size: 0, style: { fontFamily: "monospace", minWidth: "2.5rem", flexShrink: 0, opacity: hasFile ? 1 : 0.5 } }, "CSS"), hasFile ? /* @__PURE__ */ _react2.default.createElement(_ui.Box, { style: { flex: 1, minWidth: 0, overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" } }, /* @__PURE__ */ _react2.default.createElement("a", { href: fileUrl, target: "_blank", rel: "noreferrer" }, (filenames == null ? void 0 : filenames.css) || "File")) : /* @__PURE__ */ _react2.default.createElement(_ui.Text, { size: 1, muted: true }, "\u2014")), status === "ready" && /* @__PURE__ */ _react2.default.createElement(_ui.Flex, { gap: 1, align: "center", style: { flexShrink: 0 } }, (fileInput == null ? void 0 : fileInput.woff2) && /* @__PURE__ */ _react2.default.createElement(_ui.Button, { mode: "ghost", tone: "primary", fontSize: 1, padding: 2, onClick: () => handleGenerateCssFile(), text: "Build" }), hasFile && /* @__PURE__ */ _react2.default.createElement(_ui.Button, { mode: "bleed", tone: "critical", icon: _icons.TrashIcon, padding: 2, onClick: () => handleDelete("css") }))));
1953
+ return /* @__PURE__ */ _react2.default.createElement(_ui.Card, { border: true, radius: 1, paddingX: 2, paddingY: 3 }, /* @__PURE__ */ _react2.default.createElement(_ui.Flex, { justify: "space-between", align: "center", gap: 2 }, /* @__PURE__ */ _react2.default.createElement(_ui.Flex, { gap: 3, align: "center", style: { flex: 1, minWidth: 0 } }, /* @__PURE__ */ _react2.default.createElement(_ui.Text, { size: 0, style: { fontFamily: "monospace", minWidth: "2.5rem", flexShrink: 0, opacity: hasFile ? 1 : 0.5 } }, "CSS"), hasFile ? /* @__PURE__ */ _react2.default.createElement(_ui.Box, { style: { flex: 1, minWidth: 0 } }, /* @__PURE__ */ _react2.default.createElement("a", { href: fileUrl, target: "_blank", rel: "noreferrer" }, (filenames == null ? void 0 : filenames.css) || "File")) : /* @__PURE__ */ _react2.default.createElement(_ui.Text, { size: 1, muted: true }, "\u2014")), status === "ready" && /* @__PURE__ */ _react2.default.createElement(_ui.Flex, { gap: 1, align: "center", style: { flexShrink: 0 } }, (fileInput == null ? void 0 : fileInput.woff2) && /* @__PURE__ */ _react2.default.createElement(_ui.Button, { mode: "ghost", tone: "primary", fontSize: 1, padding: 2, onClick: () => handleGenerateCssFile(), text: "Build" }), hasFile && /* @__PURE__ */ _react2.default.createElement(_ui.Button, { mode: "bleed", tone: "critical", icon: _icons.TrashIcon, padding: 2, onClick: () => handleDelete("css") }))));
1953
1954
  };
1954
1955
  const renderDataSection = () => /* @__PURE__ */ _react2.default.createElement(_ui.Card, { border: true, radius: 1, paddingX: 2, paddingY: 3 }, /* @__PURE__ */ _react2.default.createElement(_ui.Flex, { justify: "space-between", align: "center", gap: 2 }, /* @__PURE__ */ _react2.default.createElement(_ui.Flex, { gap: 3, align: "center", style: { flex: 1, minWidth: 0 } }, /* @__PURE__ */ _react2.default.createElement(_ui.Text, { size: 0, style: { fontFamily: "monospace", minWidth: "2.5rem", flexShrink: 0, opacity: (doc_metaData == null ? void 0 : doc_metaData.version) ? 1 : 0.5 } }, "DATA"), (doc_metaData == null ? void 0 : doc_metaData.version) ? /* @__PURE__ */ _react2.default.createElement(_ui.Text, { size: 1 }, "v", doc_metaData.version, " ", /* @__PURE__ */ _react2.default.createElement(_ui.Text, { as: "span", size: 1, muted: true }, "(", doc_metaData.genDate, ")")) : /* @__PURE__ */ _react2.default.createElement(_ui.Text, { size: 1, muted: true }, "\u2014")), status === "ready" && (fileInput == null ? void 0 : fileInput.ttf) && /* @__PURE__ */ _react2.default.createElement(_ui.Flex, { gap: 1, align: "center", style: { flexShrink: 0 } }, /* @__PURE__ */ _react2.default.createElement(_ui.Button, { mode: "ghost", tone: "primary", fontSize: 1, padding: 2, onClick: () => handleGenerateFontData(), text: "Build" }))));
1955
1956
  return /* @__PURE__ */ _react2.default.createElement(_ui.Stack, { space: 2 }, /* @__PURE__ */ _react2.default.createElement(
@@ -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
- () => _chunkJCDZ7SWZjs.generateStyleKeywords.call(void 0, ),
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 _chunkJCDZ7SWZjs.parseFont.call(void 0, fontBuffer, file.name);
2072
- const fullName = _chunkJCDZ7SWZjs.getNameString.call(void 0, font, 4);
2073
- const familyName = _chunkJCDZ7SWZjs.getNameString.call(void 0, font, 1);
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 = _chunkJCDZ7SWZjs.getNameString.call(void 0, font, 17) || _chunkJCDZ7SWZjs.getNameString.call(void 0, font, 2) || "";
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 = _chunkJCDZ7SWZjs.getVariationAxes.call(void 0, font);
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 = _chunkJCDZ7SWZjs.getItalicAngle.call(void 0, font);
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) => _chunkJCDZ7SWZjs.reverseSpellingLookup.call(void 0, 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: _chunkJCDZ7SWZjs.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
+ 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 _chunkJCDZ7SWZjs.generateCssFile.call(void 0, {
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 _chunkJCDZ7SWZjs.generateCssFile.call(void 0, {
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 _chunkJCDZ7SWZjs.generateCssFile.call(void 0, {
2542
+ newFileInput = await _chunkPGSHWNGWjs.generateCssFile.call(void 0, {
2542
2543
  woff2File: file,
2543
2544
  fileInput: newFileInput,
2544
2545
  language,
@@ -2811,21 +2812,36 @@ function KeyValueReferenceInput(props) {
2811
2812
  const pickerLabel = referenceType || valueTitle.toLowerCase();
2812
2813
  return /* @__PURE__ */ _react2.default.createElement(_ui.Stack, { space: 3 }, topActions && /* @__PURE__ */ _react2.default.createElement(_ui.Box, { paddingBottom: 2 }, topActions), /* @__PURE__ */ _react2.default.createElement(_ui.Box, null, /* @__PURE__ */ _react2.default.createElement(_ui.Stack, { space: 2 }, pairs.map((pair, index) => {
2813
2814
  var _a2;
2814
- return /* @__PURE__ */ _react2.default.createElement(_ui.Box, { key: index, style: { position: "relative" } }, /* @__PURE__ */ _react2.default.createElement("div", { style: { position: "absolute", height: "100%", top: "0", left: "-5px", width: "min-content", transform: "translate(-100%, 0%)" } }, /* @__PURE__ */ _react2.default.createElement("button", { className: "manualButton manualButtonUp", style: { fontSize: "15px", height: "50%" }, onClick: () => handleMoveUp(index) }, /* @__PURE__ */ _react2.default.createElement(_icons.ArrowUpIcon, null)), /* @__PURE__ */ _react2.default.createElement("button", { className: "manualButton manualButtonDown", style: { fontSize: "15px", height: "50%" }, onClick: () => handleMoveDown(index) }, /* @__PURE__ */ _react2.default.createElement(_icons.ArrowDownIcon, null))), /* @__PURE__ */ _react2.default.createElement(_ui.Flex, { gap: 2, align: "flex-start" }, /* @__PURE__ */ _react2.default.createElement(_ui.Box, { flex: 1 }, /* @__PURE__ */ _react2.default.createElement(
2815
+ return /* @__PURE__ */ _react2.default.createElement(_ui.Flex, { key: index, gap: 1, align: "center" }, /* @__PURE__ */ _react2.default.createElement(_ui.Flex, { direction: "column", style: { flexShrink: 0 } }, /* @__PURE__ */ _react2.default.createElement(
2816
+ _ui.Button,
2817
+ {
2818
+ mode: "bleed",
2819
+ icon: _icons.ArrowUpIcon,
2820
+ padding: 1,
2821
+ fontSize: 0,
2822
+ onClick: () => handleMoveUp(index),
2823
+ disabled: index === 0,
2824
+ style: { cursor: index === 0 ? "default" : "pointer" }
2825
+ }
2826
+ ), /* @__PURE__ */ _react2.default.createElement(
2827
+ _ui.Button,
2828
+ {
2829
+ mode: "bleed",
2830
+ icon: _icons.ArrowDownIcon,
2831
+ padding: 1,
2832
+ fontSize: 0,
2833
+ onClick: () => handleMoveDown(index),
2834
+ disabled: index === pairs.length - 1,
2835
+ style: { cursor: index === pairs.length - 1 ? "default" : "pointer" }
2836
+ }
2837
+ )), /* @__PURE__ */ _react2.default.createElement(_ui.Box, { flex: 1 }, /* @__PURE__ */ _react2.default.createElement(
2815
2838
  _ui.TextInput,
2816
2839
  {
2817
2840
  value: pair.key,
2818
2841
  onChange: (e) => handlePairChange(index, "key", e.target.value),
2819
2842
  placeholder: keyPlaceholder
2820
2843
  }
2821
- )), /* @__PURE__ */ _react2.default.createElement(_ui.Box, { flex: 1, style: { minHeight: "100%" } }, ((_a2 = pair.value) == null ? void 0 : _a2._ref) ? /* @__PURE__ */ _react2.default.createElement(_ui.Card, { className: "referenceCard", radius: 2, tone: "primary", style: { paddingLeft: "1rem", height: "fit-content" } }, /* @__PURE__ */ _react2.default.createElement(_ui.Flex, { align: "center", justify: "space-between" }, /* @__PURE__ */ _react2.default.createElement(
2822
- _ui.Text,
2823
- {
2824
- size: 2,
2825
- style: { whiteSpace: "nowrap", overflow: "hidden", textOverflow: "ellipsis", maxWidth: "90%" }
2826
- },
2827
- referenceData[pair.value._ref] || "Loading..."
2828
- ), /* @__PURE__ */ _react2.default.createElement(
2844
+ )), /* @__PURE__ */ _react2.default.createElement(_ui.Box, { flex: 1 }, ((_a2 = pair.value) == null ? void 0 : _a2._ref) ? /* @__PURE__ */ _react2.default.createElement(_ui.Card, { radius: 2, tone: "primary", style: { paddingLeft: "0.75rem", height: "fit-content" } }, /* @__PURE__ */ _react2.default.createElement(_ui.Flex, { align: "center", justify: "space-between" }, /* @__PURE__ */ _react2.default.createElement(_ui.Text, { size: 2, style: { whiteSpace: "nowrap" } }, referenceData[pair.value._ref] || "Loading..."), /* @__PURE__ */ _react2.default.createElement(
2829
2845
  _ui.MenuButton,
2830
2846
  {
2831
2847
  button: /* @__PURE__ */ _react2.default.createElement(_ui.Button, { icon: _icons.EllipsisHorizontalIcon, mode: "bleed", title: "Options" }),
@@ -2837,18 +2853,20 @@ function KeyValueReferenceInput(props) {
2837
2853
  _ui.Box,
2838
2854
  {
2839
2855
  padding: 2,
2840
- style: { minHeight: "100%", border: "1px dashed #ccc", borderRadius: "4px", display: "flex", alignItems: "center", justifyContent: "center", cursor: "pointer" },
2856
+ style: { border: "1px dashed #ccc", borderRadius: "4px", display: "flex", alignItems: "center", justifyContent: "center", cursor: "pointer" },
2841
2857
  onClick: () => openReferenceSelector(index)
2842
2858
  },
2843
2859
  /* @__PURE__ */ _react2.default.createElement(_ui.Text, { muted: true, size: 2 }, "Click to select a ", pickerLabel)
2844
- ))), /* @__PURE__ */ _react2.default.createElement(
2845
- "button",
2860
+ )), /* @__PURE__ */ _react2.default.createElement(
2861
+ _ui.Button,
2846
2862
  {
2847
- className: "manualButton",
2863
+ mode: "bleed",
2864
+ tone: "critical",
2865
+ icon: _icons.TrashIcon,
2866
+ padding: 2,
2848
2867
  onClick: () => handleRemovePair(index),
2849
- style: { position: "absolute", top: "0", right: "-7px", transform: "translate(100%, 0%)" }
2850
- },
2851
- /* @__PURE__ */ _react2.default.createElement(_icons.TrashIcon, null)
2868
+ style: { flexShrink: 0, cursor: "pointer" }
2869
+ }
2852
2870
  ));
2853
2871
  }))), /* @__PURE__ */ _react2.default.createElement(_ui.Button, { tone: "primary", mode: "ghost", onClick: handleAddPair, icon: _icons.AddIcon, text: `Add ${keyTitle}` }), isDialogOpen && /* @__PURE__ */ _react2.default.createElement(
2854
2872
  _ui.Dialog,
@@ -2910,7 +2928,7 @@ function VariableInstanceReferencesInput(props) {
2910
2928
  console.warn("Cannot autofill: no variableInstances data on this document");
2911
2929
  return;
2912
2930
  }
2913
- const mappings = await _chunkJCDZ7SWZjs.parseVariableFontInstances.call(void 0, formDocument, sanityClient);
2931
+ const mappings = await _chunkPGSHWNGWjs.parseVariableFontInstances.call(void 0, formDocument, sanityClient);
2914
2932
  if (mappings.length === 0) {
2915
2933
  console.warn("No variable instances could be parsed from this font");
2916
2934
  return;
@@ -3324,12 +3342,12 @@ async function getEmptyFontKit({ title, files, weightKeywordList, italicKeywordL
3324
3342
  for (var i = 0; i < files.length; i++) {
3325
3343
  const file = files[i];
3326
3344
  const fontBuffer = await readFontFile2(file);
3327
- const font = await _chunkJCDZ7SWZjs.parseFont.call(void 0, fontBuffer, file.name);
3328
- let weightName = _chunkJCDZ7SWZjs.getNameString.call(void 0, font, 17) || _chunkJCDZ7SWZjs.getNameString.call(void 0, font, 2) || "";
3329
- const axes = _chunkJCDZ7SWZjs.getVariationAxes.call(void 0, font);
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);
3330
3348
  let variableFont = axes !== null;
3331
- const familyName = _chunkJCDZ7SWZjs.getNameString.call(void 0, font, 1);
3332
- const fullName = _chunkJCDZ7SWZjs.getNameString.call(void 0, font, 4);
3349
+ const familyName = _chunkPGSHWNGWjs.getNameString.call(void 0, font, 1);
3350
+ const fullName = _chunkPGSHWNGWjs.getNameString.call(void 0, font, 4);
3333
3351
  let subfamilyName = familyName.toLowerCase().trim().replace(title.toLowerCase().trim(), "").trim();
3334
3352
  let fontTitle = fullName.toLowerCase().trim();
3335
3353
  weightKeywordList.forEach((keyword) => {
@@ -5908,7 +5926,9 @@ function createStylesField({
5908
5926
  subfamilyPreferredStyle = false,
5909
5927
  subfamilyFontFilter = false,
5910
5928
  subfamilyPreview = false,
5911
- pairs = true
5929
+ pairs = true,
5930
+ generateCollections = false,
5931
+ generateFullFamilyCollection = false
5912
5932
  } = {}) {
5913
5933
  const subfamilyFields = [
5914
5934
  {
@@ -6052,6 +6072,28 @@ function createStylesField({
6052
6072
  type: "array",
6053
6073
  of: [subfamilyItem]
6054
6074
  },
6075
+ ...field(generateCollections, {
6076
+ title: "Generate Collections and Pairs",
6077
+ name: "generateCollections",
6078
+ type: "string",
6079
+ description: "Generate Collections and Pairs from the typeface's fonts.",
6080
+ components: { input: GenerateCollectionsPairsComponent },
6081
+ hidden: ({ parent }) => {
6082
+ var _a;
6083
+ return !((_a = parent == null ? void 0 : parent.fonts) == null ? void 0 : _a.length);
6084
+ }
6085
+ }),
6086
+ ...field(generateFullFamilyCollection, {
6087
+ title: "Generate Full Family Collection",
6088
+ name: "generateCollectionGroup",
6089
+ type: "string",
6090
+ description: "Generate a Collection that includes all styles from this typeface.",
6091
+ components: { input: PrimaryCollectionGeneratorTypeface },
6092
+ hidden: ({ parent }) => {
6093
+ var _a;
6094
+ return !((_a = parent == null ? void 0 : parent.fonts) == null ? void 0 : _a.length);
6095
+ }
6096
+ }),
6055
6097
  {
6056
6098
  title: "Collections",
6057
6099
  name: "collections",
@@ -6175,4 +6217,4 @@ function createStylesField({
6175
6217
 
6176
6218
 
6177
6219
 
6178
- exports.BatchUploadFonts = BatchUploadFonts; exports.BulkActions = _chunkJCDZ7SWZjs.BulkActions; exports.DISCOUNT_REQUIREMENT_TYPES = DISCOUNT_REQUIREMENT_TYPES; exports.DISCOUNT_REQUIREMENT_TYPES_OBJECT = DISCOUNT_REQUIREMENT_TYPES_OBJECT; exports.EXECUTION_STATUS = _chunkJCDZ7SWZjs.EXECUTION_STATUS; exports.ExistingDocumentResolver = _chunkJCDZ7SWZjs.ExistingDocumentResolver; exports.FONT_STATUS = _chunkJCDZ7SWZjs.FONT_STATUS; exports.FontReviewCard = _chunkJCDZ7SWZjs.FontReviewCard_default; exports.FontScriptUploaderComponent = FontScriptUploaderComponent; exports.GenerateCollectionsPairsComponent = GenerateCollectionsPairsComponent; exports.HtmlDescription = HtmlDescription; exports.KeyValueInput = KeyValueInput; exports.KeyValueReferenceInput = KeyValueReferenceInput; exports.NestedObjectArraySelector = NestedObjectArraySelector; exports.PLAN_PHASE = _chunkJCDZ7SWZjs.PLAN_PHASE; exports.PLAN_VERSION = _chunkJCDZ7SWZjs.PLAN_VERSION; exports.PriceInput = _chunkJCDZ7SWZjs.PriceInput_default; exports.PrimaryCollectionGeneratorTypeface = PrimaryCollectionGeneratorTypeface; exports.RECOMMENDATION = _chunkJCDZ7SWZjs.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 = _chunkJCDZ7SWZjs.UploadModal; exports.UploadScriptsComponent = UploadScriptsComponent; exports.UploadStep1Settings = _chunkJCDZ7SWZjs.UploadStep1Settings; exports.UploadStep2Review = _chunkJCDZ7SWZjs.UploadStep2Review; exports.UploadStep3Execute = _chunkJCDZ7SWZjs.UploadStep3Execute; exports.UploadStep3bInstances = _chunkJCDZ7SWZjs.UploadStep3bInstances; exports.UploadSummary = _chunkJCDZ7SWZjs.UploadSummary; exports.VariableInstanceReferencesInput = VariableInstanceReferencesInput; exports.addItalicToFontTitle = _chunkJCDZ7SWZjs.addItalicToFontTitle; exports.buildUploadPlan = _chunkJCDZ7SWZjs.buildUploadPlan; exports.createEmptyPlan = _chunkJCDZ7SWZjs.createEmptyPlan; exports.createFontDecisions = _chunkJCDZ7SWZjs.createFontDecisions; exports.createFontObject = _chunkJCDZ7SWZjs.createFontObject; exports.createInitialExecutionState = _chunkJCDZ7SWZjs.createInitialExecutionState; exports.createStylesField = createStylesField; exports.determineWeight = _chunkJCDZ7SWZjs.determineWeight; exports.escapeCssFontName = _chunkJCDZ7SWZjs.escapeCssFontName; exports.executeUploadPlan = _chunkJCDZ7SWZjs.executeUploadPlan; exports.executionReducer = _chunkJCDZ7SWZjs.executionReducer; exports.expandAbbreviations = _chunkJCDZ7SWZjs.expandAbbreviations; exports.extractFontMetadata = _chunkJCDZ7SWZjs.extractFontMetadata; exports.extractWeightFromFullName = _chunkJCDZ7SWZjs.extractWeightFromFullName; exports.extractWeightName = _chunkJCDZ7SWZjs.extractWeightName; exports.formatFontTitle = _chunkJCDZ7SWZjs.formatFontTitle; exports.generateCssFile = _chunkJCDZ7SWZjs.generateCssFile; exports.generateFontData = _chunkJCDZ7SWZjs.generateFontData; exports.generateFontFile = generateFontFile; exports.generateStyleKeywords = _chunkJCDZ7SWZjs.generateStyleKeywords; exports.generateSubset = generateSubset; exports.getAllFeatureTags = _chunkJCDZ7SWZjs.getAllFeatureTags; exports.getCharacterSet = _chunkJCDZ7SWZjs.getCharacterSet; exports.getEmptyFontKit = getEmptyFontKit; exports.getFamilyClass = _chunkJCDZ7SWZjs.getFamilyClass; exports.getFontMetadata = _chunkJCDZ7SWZjs.getFontMetadata; exports.getFontMetrics = _chunkJCDZ7SWZjs.getFontMetrics; exports.getFsSelection = _chunkJCDZ7SWZjs.getFsSelection; exports.getGlyphCount = _chunkJCDZ7SWZjs.getGlyphCount; exports.getItalicAngle = _chunkJCDZ7SWZjs.getItalicAngle; exports.getMacStyle = _chunkJCDZ7SWZjs.getMacStyle; exports.getNameString = _chunkJCDZ7SWZjs.getNameString; exports.getNamedInstances = _chunkJCDZ7SWZjs.getNamedInstances; exports.getVariationAxes = _chunkJCDZ7SWZjs.getVariationAxes; exports.getWeightClass = _chunkJCDZ7SWZjs.getWeightClass; exports.logFontInfo = _chunkJCDZ7SWZjs.logFontInfo; exports.openTypeField = openTypeField; exports.parseFont = _chunkJCDZ7SWZjs.parseFont; exports.parseVariableFontInstances = _chunkJCDZ7SWZjs.parseVariableFontInstances_default; exports.planReducer = _chunkJCDZ7SWZjs.planReducer; exports.processFontFiles = _chunkJCDZ7SWZjs.processFontFiles; exports.processItalicKeywords = _chunkJCDZ7SWZjs.processItalicKeywords; exports.processSubfamilyName = _chunkJCDZ7SWZjs.processSubfamilyName; exports.readFontFile = _chunkJCDZ7SWZjs.readFontFile; exports.removeWeightNames = _chunkJCDZ7SWZjs.removeWeightNames; exports.renameFontDocuments = renameFontDocuments; exports.resolveExistingFont = _chunkJCDZ7SWZjs.resolveExistingFont; exports.reverseSpellingLookup = _chunkJCDZ7SWZjs.reverseSpellingLookup; exports.sanitizeForSanityId = _chunkJCDZ7SWZjs.sanitizeForSanityId; exports.sortFontObjects = _chunkJCDZ7SWZjs.sortFontObjects; exports.styleCountField = styleCountField; exports.stylisticSetField = stylisticSetField; exports.updateFontPrices = updateFontPrices; exports.updateTypefaceDocument = _chunkJCDZ7SWZjs.updateTypefaceDocument; exports.uploadFontFiles = uploadFontFiles; exports.useNestedObjects = useNestedObjects; exports.useSanityClient = useSanityClient;
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;