labellife-design-tool 2.4.6 → 2.5.1

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/cjs/index.js CHANGED
@@ -1657,6 +1657,152 @@ var History = mobxStateTree.types.model('History', {
1657
1657
  };
1658
1658
  });
1659
1659
 
1660
+ var GOOGLE_FONTS_API = 'https://www.googleapis.com/webfonts/v1/webfonts';
1661
+ var cachedFonts = null;
1662
+ function fetchGoogleFonts(_x) {
1663
+ return _fetchGoogleFonts.apply(this, arguments);
1664
+ }
1665
+ function _fetchGoogleFonts() {
1666
+ _fetchGoogleFonts = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(apiKey) {
1667
+ var url, response, data, _t;
1668
+ return _regenerator().w(function (_context) {
1669
+ while (1) switch (_context.p = _context.n) {
1670
+ case 0:
1671
+ if (!cachedFonts) {
1672
+ _context.n = 1;
1673
+ break;
1674
+ }
1675
+ return _context.a(2, cachedFonts);
1676
+ case 1:
1677
+ _context.p = 1;
1678
+ url = apiKey ? "".concat(GOOGLE_FONTS_API, "?key=").concat(apiKey, "&sort=popularity") : "".concat(GOOGLE_FONTS_API, "?sort=popularity");
1679
+ _context.n = 2;
1680
+ return fetch(url);
1681
+ case 2:
1682
+ response = _context.v;
1683
+ _context.n = 3;
1684
+ return response.json();
1685
+ case 3:
1686
+ data = _context.v;
1687
+ cachedFonts = (data.items || []).map(function (font) {
1688
+ return {
1689
+ fontFamily: font.family,
1690
+ variants: font.variants || [],
1691
+ category: font.category,
1692
+ url: "https://fonts.googleapis.com/css2?family=".concat(encodeURIComponent(font.family), "&display=swap")
1693
+ };
1694
+ });
1695
+ return _context.a(2, cachedFonts);
1696
+ case 4:
1697
+ _context.p = 4;
1698
+ _t = _context.v;
1699
+ console.warn('Failed to fetch Google Fonts list', _t);
1700
+ return _context.a(2, []);
1701
+ }
1702
+ }, _callee, null, [[1, 4]]);
1703
+ }));
1704
+ return _fetchGoogleFonts.apply(this, arguments);
1705
+ }
1706
+ function loadGoogleFont(_x2) {
1707
+ return _loadGoogleFont.apply(this, arguments);
1708
+ }
1709
+ function _loadGoogleFont() {
1710
+ _loadGoogleFont = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2(fontFamily) {
1711
+ var id, existing, _t2;
1712
+ return _regenerator().w(function (_context2) {
1713
+ while (1) switch (_context2.p = _context2.n) {
1714
+ case 0:
1715
+ id = "google-font-".concat(fontFamily.replace(/\s+/g, '-').toLowerCase());
1716
+ existing = document.getElementById(id);
1717
+ if (existing) {
1718
+ _context2.n = 1;
1719
+ break;
1720
+ }
1721
+ _context2.n = 1;
1722
+ return new Promise(function (resolve) {
1723
+ var link = document.createElement('link');
1724
+ link.id = id;
1725
+ link.href = "https://fonts.googleapis.com/css2?family=".concat(encodeURIComponent(fontFamily), ":wght@100;200;300;400;500;600;700;800;900&display=swap");
1726
+ link.rel = 'stylesheet';
1727
+ link.onload = function () {
1728
+ return resolve();
1729
+ };
1730
+ link.onerror = function () {
1731
+ return resolve();
1732
+ };
1733
+ document.head.appendChild(link);
1734
+ });
1735
+ case 1:
1736
+ _context2.p = 1;
1737
+ _context2.n = 2;
1738
+ return document.fonts.load("16px \"".concat(fontFamily, "\""));
1739
+ case 2:
1740
+ _context2.n = 3;
1741
+ return document.fonts.load("bold 16px \"".concat(fontFamily, "\""));
1742
+ case 3:
1743
+ _context2.n = 4;
1744
+ return document.fonts.ready;
1745
+ case 4:
1746
+ _context2.n = 6;
1747
+ break;
1748
+ case 5:
1749
+ _context2.p = 5;
1750
+ _t2 = _context2.v;
1751
+ console.warn("Font \"".concat(fontFamily, "\" may not have loaded correctly."), _t2);
1752
+ case 6:
1753
+ return _context2.a(2);
1754
+ }
1755
+ }, _callee2, null, [[1, 5]]);
1756
+ }));
1757
+ return _loadGoogleFont.apply(this, arguments);
1758
+ }
1759
+
1760
+ // Infers the @font-face format() hint from a font file URL's extension.
1761
+ function inferFontFormat(url) {
1762
+ var ext = (url.split('?')[0].split('.').pop() || '').toLowerCase();
1763
+ var map = {
1764
+ woff2: 'woff2',
1765
+ woff: 'woff',
1766
+ ttf: 'truetype',
1767
+ otf: 'opentype'
1768
+ };
1769
+ return map[ext] || 'woff2';
1770
+ }
1771
+
1772
+ // Neutralizes characters that could let a font `name` break out of the
1773
+ // single-quoted `font-family: '...'` CSS value (or the surrounding rule
1774
+ // block) when interpolated into injected CSS. This is defense-in-depth for
1775
+ // a published, general-purpose library that cannot assume every consumer
1776
+ // only ever passes trusted, admin-managed catalog data.
1777
+ function sanitizeFontFamilyName(name) {
1778
+ return String(name)
1779
+ // eslint-disable-next-line no-control-regex
1780
+ .replace(/['"\\{};\r\n\u0000-\u001f]/g, '').trim();
1781
+ }
1782
+
1783
+ // Neutralizes characters that could let a font `file` URL break out of the
1784
+ // `url('...')` CSS value, and requires it to at least look like an
1785
+ // absolute http(s) URL or a relative path (not a full URL parser — this is
1786
+ // a simple guard, not the primary trust boundary).
1787
+ function sanitizeFontFileUrl(file) {
1788
+ var cleaned = String(file).replace(/['"()\s\r\n]/g, '');
1789
+ var looksSafe = /^(https?:\/\/|\.{0,2}\/)/i.test(cleaned);
1790
+ return looksSafe ? cleaned : '';
1791
+ }
1792
+
1793
+ // Builds the @font-face CSS text for a custom font's uploaded variants.
1794
+ // `customFont` shape: { name: string, variants: [{ weight, style, file }] }
1795
+ function buildFontFaceCss(customFont) {
1796
+ var safeName = sanitizeFontFamilyName(customFont.name);
1797
+ return customFont.variants.map(function (v) {
1798
+ var safeFile = sanitizeFontFileUrl(v.file);
1799
+ return "@font-face {\n font-family: '".concat(safeName, "';\n font-weight: ").concat(v.weight, ";\n font-style: ").concat(v.style, ";\n src: url('").concat(safeFile, "') format('").concat(inferFontFormat(safeFile), "');\n font-display: swap;\n}");
1800
+ }).join('\n');
1801
+ }
1802
+
1803
+ // Comprehensive list of Google Fonts matching Polotno's font library
1804
+ var DEFAULT_FONTS = ['ABeeZee', 'Abel', 'Abhaya Libre', 'Abril Fatface', 'Aclonica', 'Acme', 'Actor', 'Adamina', 'Advent Pro', 'Aguafina Script', 'Akronim', 'Aladin', 'Alata', 'Alatsi', 'Albert Sans', 'Aldrich', 'Alef', 'Alegreya', 'Alegreya Sans', 'Alegreya Sans SC', 'Alegreya SC', 'Aleo', 'Alex Brush', 'Alfa Slab One', 'Alice', 'Alike', 'Alike Angular', 'Allan', 'Allerta', 'Allerta Stencil', 'Allison', 'Allura', 'Almarai', 'Almendra', 'Almendra Display', 'Almendra SC', 'Alumni Sans', 'Alumni Sans Inline One', 'Amarante', 'Amaranth', 'Amatic SC', 'Amethysta', 'Amiko', 'Amiri', 'Amita', 'Anaheim', 'Andada Pro', 'Andika', 'Anek Bangla', 'Anek Devanagari', 'Anek Gujarati', 'Anek Gurmukhi', 'Anek Kannada', 'Anek Latin', 'Anek Malayalam', 'Anek Odia', 'Anek Tamil', 'Anek Telugu', 'Angkor', 'Annie Use Your Telescope', 'Anonymous Pro', 'Antic', 'Antic Didone', 'Antic Slab', 'Anton', 'Antonio', 'Anybody', 'Arapey', 'Arbutus', 'Arbutus Slab', 'Architects Daughter', 'Archivo', 'Archivo Black', 'Archivo Narrow', 'Are You Serious', 'Aref Ruqaa', 'Arima', 'Arimo', 'Arizonia', 'Armata', 'Arsenal', 'Artifika', 'Arvo', 'Arya', 'Asap', 'Asap Condensed', 'Asar', 'Asset', 'Assistant', 'Astloch', 'Asul', 'Athiti', 'Atkinson Hyperlegible', 'Atma', 'Atomic Age', 'Aubrey', 'Audiowide', 'Autour One', 'Average', 'Average Sans', 'Averia Gruesa Libre', 'Averia Libre', 'Averia Sans Libre', 'Averia Serif Libre', 'Azeret Mono', 'B612', 'B612 Mono', 'Bad Script', 'Bahiana', 'Bahianita', 'Bai Jamjuree', 'Bakbak One', 'Ballet', 'Baloo 2', 'Baloo Bhai 2', 'Baloo Bhaijaan 2', 'Baloo Bhaina 2', 'Baloo Chettan 2', 'Baloo Da 2', 'Baloo Paaji 2', 'Baloo Tamma 2', 'Baloo Tammudu 2', 'Baloo Thambi 2', 'Balsamiq Sans', 'Balthazar', 'Bangers', 'Barlow', 'Barlow Condensed', 'Barlow Semi Condensed', 'Barriecito', 'Barrio', 'Basic', 'Baskervville', 'Battambang', 'Baumans', 'Bayon', 'Be Vietnam Pro', 'Beau Rivage', 'Bebas Neue', 'Belgrano', 'Bellefair', 'Belleza', 'Bellota', 'Bellota Text', 'BenchNine', 'Benne', 'Bentham', 'Berkshire Swash', 'Besley', 'Beth Ellen', 'Bevan', 'BIZ UDGothic', 'BIZ UDMincho', 'BIZ UDPGothic', 'BIZ UDPMincho', 'Big Shoulders Display', 'Big Shoulders Inline Display', 'Big Shoulders Inline Text', 'Big Shoulders Stencil Display', 'Big Shoulders Stencil Text', 'Big Shoulders Text', 'Bigelow Rules', 'Bigshot One', 'Bilbo', 'Bilbo Swash Caps', 'BioRhyme', 'BioRhyme Expanded', 'Birthstone', 'Birthstone Bounce', 'Bitter', 'Black And White Picture', 'Black Han Sans', 'Black Ops One', 'Blaka', 'Blaka Hollow', 'Blaka Ink', 'Blinker', 'Bodoni Moda', 'Bokor', 'Bona Nova', 'Bonbon', 'Bonheur Royale', 'Boogaloo', 'Bowlby One', 'Bowlby One SC', 'Brawler', 'Bree Serif', 'Brygada 1918', 'Bubblegum Sans', 'Bubbler One', 'Buda', 'Buenard', 'Bungee', 'Bungee Hairline', 'Bungee Inline', 'Bungee Outline', 'Bungee Shade', 'Bungee Spice', 'Butcherman', 'Butterfly Kids', 'Cabin', 'Cabin Condensed', 'Cabin Sketch', 'Caesar Dressing', 'Cagliostro', 'Cairo', 'Cairo Play', 'Caladea', 'Calistoga', 'Calligraffitti', 'Cambay', 'Cambo', 'Candal', 'Cantarell', 'Cantata One', 'Cantora One', 'Caprasimo', 'Capriola', 'Caramel', 'Carattere', 'Cardo', 'Carlito', 'Carme', 'Carrois Gothic', 'Carrois Gothic SC', 'Carter One', 'Castoro', 'Catamaran', 'Caudex', 'Caveat', 'Caveat Brush', 'Cedarville Cursive', 'Ceviche One', 'Chakra Petch', 'Changa', 'Changa One', 'Chango', 'Charis SIL', 'Charm', 'Charmonman', 'Chathura', 'Chau Philomene One', 'Chela One', 'Chelsea Market', 'Chenla', 'Cherry Bomb One', 'Cherry Cream Soda', 'Cherry Swash', 'Chewy', 'Chicle', 'Chilanka', 'Chivo', 'Chivo Mono', 'Chonburi', 'Cinzel', 'Cinzel Decorative', 'Clicker Script', 'Coda', 'Coda Caption', 'Codystar', 'Coiny', 'Combo', 'Comfortaa', 'Comforter', 'Comforter Brush', 'Comic Neue', 'Coming Soon', 'Commissioner', 'Concert One', 'Condiment', 'Content', 'Contrail One', 'Convergence', 'Cookie', 'Copse', 'Corben', 'Corinthia', 'Cormorant', 'Cormorant Garamond', 'Cormorant Infant', 'Cormorant SC', 'Cormorant Unicase', 'Cormorant Upright', 'Courgette', 'Courier Prime', 'Cousine', 'Coustard', 'Covered By Your Grace', 'Crafty Girls', 'Creepster', 'Crete Round', 'Crimson Pro', 'Crimson Text', 'Croissant One', 'Crushed', 'Cuprum', 'Cute Font', 'Cutive', 'Cutive Mono', 'DM Mono', 'DM Sans', 'DM Serif Display', 'DM Serif Text', 'Damion', 'Dancing Script', 'Dangrek', 'Darker Grotesque', 'David Libre', 'Dawning of a New Day', 'Days One', 'Dekko', 'Dela Gothic One', 'Delius', 'Delius Swash Caps', 'Delius Unicase', 'Della Respira', 'Denk One', 'Devonshire', 'Dhurjati', 'Didact Gothic', 'Diplomata', 'Diplomata SC', 'Do Hyeon', 'Dokdo', 'Domine', 'Donegal One', 'Dongle', 'Doppio One', 'Dorsa', 'Dosis', 'DotGothic16', 'Dr Sugiyama', 'Duru Sans', 'DynaPuff', 'Dynalight', 'EB Garamond', 'Eagle Lake', 'East Sea Dokdo', 'Eater', 'Economica', 'Eczar', 'El Messiri', 'Electrolize', 'Elsie', 'Elsie Swash Caps', 'Emblema One', 'Emilys Candy', 'Encode Sans', 'Encode Sans Condensed', 'Encode Sans Expanded', 'Encode Sans SC', 'Encode Sans Semi Condensed', 'Encode Sans Semi Expanded', 'Engagement', 'Englebert', 'Enriqueta', 'Ephesis', 'Epilogue', 'Erica One', 'Esteban', 'Estonia', 'Euphoria Script', 'Ewert', 'Exo', 'Exo 2', 'Expletus Sans', 'Explora', 'Fahkwang', 'Familjen Grotesk', 'Fanwood Text', 'Farro', 'Farsan', 'Fascinate', 'Fascinate Inline', 'Faster One', 'Fasthand', 'Fauna One', 'Faustina', 'Federant', 'Federo', 'Felipa', 'Fenix', 'Festive', 'Finger Paint', 'Finlandica', 'Fira Code', 'Fira Mono', 'Fira Sans', 'Fira Sans Condensed', 'Fira Sans Extra Condensed', 'Fjalla One', 'Fjord One', 'Flamenco', 'Flavors', 'Fleur De Leah', 'Flow Block', 'Flow Circular', 'Flow Rounded', 'Fondamento', 'Fontdiner Swanky', 'Forum', 'Fragment Mono', 'Francois One', 'Frank Ruhl Libre', 'Fraunces', 'Freckle Face', 'Fredericka the Great', 'Fredoka', 'Freehand', 'Fresca', 'Frijole', 'Fruktur', 'Fugaz One', 'Fuggles', 'Fuzzy Bubbles', 'GFS Didot', 'GFS Neohellenic', 'Gabriela', 'Gaegu', 'Gafata', 'Galada', 'Galdeano', 'Galindo', 'Gamja Flower', 'Gantari', 'Gas', 'Gayathri', 'Gelasio', 'Gemunu Libre', 'Genos', 'Gentium Book Plus', 'Gentium Plus', 'Geo', 'Georama', 'Geostar', 'Geostar Fill', 'Germania One', 'Gideon Roman', 'Gidugu', 'Gilda Display', 'Girassol', 'Give You Glory', 'Glass Antiqua', 'Glegoo', 'Gloria Hallelujah', 'Glory', 'Gluten', 'Goblin One', 'Gochi Hand', 'Goldman', 'Goldplay', 'Golos Text', 'Gorditas', 'Gothic A1', 'Gotu', 'Goudy Bookletter 1911', 'Gowun Batang', 'Gowun Dodum', 'Graduate', 'Grand Hotel', 'Grandstander', 'Grape Nuts', 'Gravitas One', 'Great Vibes', 'Grechen Fuemen', 'Grenze', 'Grenze Gotisch', 'Grey Qo', 'Griffy', 'Gruppo', 'Gudea', 'Gugi', 'Gulzar', 'Gupter', 'Gurajada', 'Gwendolyn', 'Habibi', 'Hachi Maru Pop', 'Hahmlet', 'Halant', 'Hammersmith One', 'Hanalei', 'Hanalei Fill', 'Handlee', 'Hanken Grotesk', 'Hanuman', 'Happy Monkey', 'Harmattan', 'Headland One', 'Heebo', 'Henny Penny', 'Hepta Slab', 'Herr Von Muellerhoff', 'Hi Melody', 'Hina Mincho', 'Hind', 'Hind Guntur', 'Hind Madurai', 'Hind Siliguri', 'Hind Vadodara', 'Holtwood One SC', 'Homemade Apple', 'Homenaje', 'Hubballi', 'Hurricane', 'IBM Plex Mono', 'IBM Plex Sans', 'IBM Plex Sans Arabic', 'IBM Plex Sans Condensed', 'IBM Plex Sans Devanagari', 'IBM Plex Sans Hebrew', 'IBM Plex Sans JP', 'IBM Plex Sans KR', 'IBM Plex Sans Thai', 'IBM Plex Sans Thai Looped', 'IBM Plex Serif', 'Iceberg', 'Iceland', 'Imbue', 'Imperial Script', 'Imprima', 'Inconsolata', 'Inder', 'Indie Flower', 'Ingrid Darling', 'Inika', 'Inknut Antiqua', 'Inria Sans', 'Inria Serif', 'Inspiration', 'Inter', 'Inter Tight', 'Irish Grover', 'Island Moments', 'Istok Web', 'Italiana', 'Italianno', 'Itim', 'Jacques Francois', 'Jacques Francois Shadow', 'Jaldi', 'JetBrains Mono', 'Jim Nightshade', 'Joan', 'Jockey One', 'Jolly Lodger', 'Jomhuria', 'Jomolhari', 'Josefin Sans', 'Josefin Slab', 'Jost', 'Joti One', 'Jua', 'Judson', 'Julee', 'Julius Sans One', 'Junge', 'Jura', 'K2D', 'Kadwa', 'Kaisei Decol', 'Kaisei HarunoUmi', 'Kaisei Opti', 'Kaisei Tokumin', 'Kalam', 'Kameron', 'Kanit', 'Kantumruy Pro', 'Karantina', 'Karla', 'Karma', 'Katibeh', 'Kaushan Script', 'Kavivanar', 'Kavoon', 'Kdam Thmor Pro', 'Keania One', 'Kelly Slab', 'Kenia', 'Khand', 'Khmer', 'Khula', 'Kings', 'Kirang Haerang', 'Kite One', 'Kiwi Maru', 'Klee One', 'Knewave', 'KoHo', 'Kodchasan', 'Koh Santepheap', 'Kolker Brush', 'Konkhmer Sleokchher', 'Kosugi', 'Kosugi Maru', 'Kotta One', 'Koulen', 'Kranky', 'Kreon', 'Kristi', 'Krona One', 'Krub', 'Kufam', 'Kulim Park', 'Kumar One', 'Kumar One Outline', 'Kumbh Sans', 'Kurale', 'La Belle Aurore', 'Lacquer', 'Laila', 'Lakki Reddy', 'Lalezar', 'Lancelot', 'Langar', 'Lango', 'Lateef', 'Lato', 'Lavishly Yours', 'League Gothic', 'League Script', 'League Spartan', 'Leckerli One', 'Ledger', 'Lekton', 'Lemon', 'Lemonada', 'Lexend', 'Lexend Deca', 'Lexend Exa', 'Lexend Giga', 'Lexend Mega', 'Lexend Peta', 'Lexend Tera', 'Lexend Zetta', 'Libre Barcode 128', 'Libre Barcode 128 Text', 'Libre Barcode 39', 'Libre Barcode 39 Extended', 'Libre Barcode 39 Extended Text', 'Libre Barcode 39 Text', 'Libre Barcode EAN13 Text', 'Libre Baskerville', 'Libre Bodoni', 'Libre Caslon Display', 'Libre Caslon Text', 'Libre Franklin', 'Licorice', 'Life Savers', 'Lilita One', 'Lily Script One', 'Limelight', 'Linden Hill', 'Lingua Franca', 'Literata', 'Liu Jian Mao Cao', 'Livvic', 'Lobster', 'Lobster Two', 'Londrina Outline', 'Londrina Shadow', 'Londrina Sketch', 'Londrina Solid', 'Long Cang', 'Lora', 'Love Light', 'Love Ya Like A Sister', 'Loved by the King', 'Lovers Quarrel', 'Luckiest Guy', 'Lusitana', 'Lustria', 'Luxurious Roman', 'Luxurious Script', 'M PLUS 1', 'M PLUS 1 Code', 'M PLUS 1p', 'M PLUS 2', 'M PLUS Code Latin', 'M PLUS Rounded 1c', 'Ma Shan Zheng', 'Macondo', 'Macondo Swash Caps', 'Mada', 'Magra', 'Maiden Orange', 'Maitree', 'Major Mono Display', 'Mako', 'Mali', 'Mallanna', 'Mandali', 'Manjari', 'Manrope', 'Mansalva', 'Manuale', 'Marcellus', 'Marcellus SC', 'Marck Script', 'Margarine', 'Marhey', 'Markazi Text', 'Marko One', 'Marmelad', 'Martel', 'Martel Sans', 'Marvel', 'Mate', 'Mate SC', 'Maven Pro', 'McLaren', 'Mea Culpa', 'Meddon', 'MedievalSharp', 'Medula One', 'Meera Inimai', 'Megrim', 'Meie Script', 'Meow Script', 'Merienda', 'Merriweather', 'Merriweather Sans', 'Metal', 'Metal Mania', 'Metamorphous', 'Metrophobic', 'Michroma', 'Milonga', 'Miltonian', 'Miltonian Tattoo', 'Mina', 'Miniver', 'Miriam Libre', 'Mirza', 'Miss Fajardose', 'Mitr', 'Mochiy Pop One', 'Mochiy Pop P One', 'Modak', 'Modern Antiqua', 'Mogra', 'Mohave', 'Moirai One', 'Molengo', 'Molle', 'Monda', 'Monofett', 'Monoton', 'Monsieur La Doulaise', 'Montaga', 'Montagu Slab', 'MonteCarlo', 'Montez', 'Montserrat', 'Montserrat Alternates', 'Montserrat Subrayada', 'Moon Dance', 'Moul', 'Moulpali', 'Mountains of Christmas', 'Mouse Memoirs', 'Mr Bedfort', 'Mr Dafoe', 'Mr De Haviland', 'Mrs Saint Delafield', 'Mrs Sheppards', 'Mukta', 'Mukta Mahee', 'Mukta Malar', 'Mukta Vaani', 'Mulish', 'Murecho', 'MuseoModerno', 'My Soul', 'Mynerve', 'Mystery Quest', 'NTR', 'Nabla', 'Nanum Brush Script', 'Nanum Gothic', 'Nanum Gothic Coding', 'Nanum Myeongjo', 'Nanum Pen Script', 'Neonderthaw', 'Nerko One', 'Neucha', 'Neuton', 'New Rocker', 'New Tegomin', 'News Cycle', 'Newsreader', 'Niconne', 'Niramit', 'Nixie One', 'Nobile', 'Nokora', 'Norican', 'Nosifer', 'Notable', 'Nothing You Could Do', 'Noticia Text', 'Noto Color Emoji', 'Noto Emoji', 'Noto Kufi Arabic', 'Noto Music', 'Noto Naskh Arabic', 'Noto Nastaliq Urdu', 'Noto Sans', 'Noto Sans Arabic', 'Noto Sans Display', 'Noto Sans Mono', 'Noto Serif', 'Noto Serif Display', 'Nova Cut', 'Nova Flat', 'Nova Mono', 'Nova Oval', 'Nova Round', 'Nova Script', 'Nova Slim', 'Nova Square', 'Numans', 'Nunito', 'Nunito Sans', 'Odibee Sans', 'Odor Mean Chey', 'Offside', 'Oi', 'Old Standard TT', 'Oldenburg', 'Ole', 'Oleo Script', 'Oleo Script Swash Caps', 'Oooh Baby', 'Open Sans', 'Oranienbaum', 'Orbit', 'Orbitron', 'Oregano', 'Orelega One', 'Orienta', 'Original Surfer', 'Oswald', 'Outfit', 'Over the Rainbow', 'Overlock', 'Overlock SC', 'Overpass', 'Overpass Mono', 'Ovo', 'Oxanium', 'Oxygen', 'Oxygen Mono', 'PT Mono', 'PT Sans', 'PT Sans Caption', 'PT Sans Narrow', 'PT Serif', 'PT Serif Caption', 'Pacifico', 'Padauk', 'Padyakke Expanded One', 'Palanquin', 'Palanquin Dark', 'Palette Mosaic', 'Pangolin', 'Paprika', 'Parisienne', 'Passero One', 'Passion One', 'Passions Conflict', 'Pathway Extreme', 'Pathway Gothic One', 'Patrick Hand', 'Patrick Hand SC', 'Pattaya', 'Patua One', 'Pavanam', 'Paytone One', 'Peddana', 'Peralta', 'Permanent Marker', 'Petit Formal Script', 'Petrona', 'Philosopher', 'Phudu', 'Piazzolla', 'Piedra', 'Pinyon Script', 'Pirata One', 'Plaster', 'Play', 'Playball', 'Playfair Display', 'Playfair Display SC', 'Playpen Sans', 'Plus Jakarta Sans', 'Podkova', 'Poiret One', 'Poller One', 'Poltawski Nowy', 'Poly', 'Pompiere', 'Pontano Sans', 'Poor Story', 'Poppins', 'Port Lligat Sans', 'Port Lligat Slab', 'Potta One', 'Pragati Narrow', 'Praise', 'Prata', 'Preahvihear', 'Press Start 2P', 'Pridi', 'Princess Sofia', 'Prociono', 'Prompt', 'Prosto One', 'Proza Libre', 'Public Sans', 'Puppies Play', 'Puritan', 'Purple Purse', 'Pushster', 'Quando', 'Quantico', 'Quattrocento', 'Quattrocento Sans', 'Questrial', 'Quicksand', 'Quintessential', 'Qwigley', 'Qwitcher Grypen', 'REM', 'Racing Sans One', 'Radio Canada', 'Radley', 'Rajdhani', 'Rakkas', 'Raleway', 'Raleway Dots', 'Ramabhadra', 'Ramaraja', 'Rambla', 'Rammetto One', 'Rampart One', 'Ranchers', 'Rancho', 'Ranga', 'Rasa', 'Rationale', 'Ravi Prakash', 'Readex Pro', 'Recursive', 'Red Hat Display', 'Red Hat Mono', 'Red Hat Text', 'Red Rose', 'Redacted', 'Redacted Script', 'Redressed', 'Reem Kufi', 'Reem Kufi Fun', 'Reem Kufi Ink', 'Reenie Beanie', 'Reggae One', 'Revalia', 'Rhodium Libre', 'Ribeye', 'Ribeye Marrow', 'Righteous', 'Risque', 'Road Rage', 'RocknRoll One', 'Rokkitt', 'Romanesco', 'Ropa Sans', 'Rosario', 'Rosarivo', 'Rouge Script', 'Rowdies', 'Rozha One', 'Rubik', 'Rubik Beastly', 'Rubik Bubbles', 'Rubik Burned', 'Rubik Dirt', 'Rubik Distressed', 'Rubik Gemstones', 'Rubik Glitch', 'Rubik Iso', 'Rubik Marker Hatch', 'Rubik Maze', 'Rubik Microbe', 'Rubik Mono One', 'Rubik Moonrocks', 'Rubik Pixels', 'Rubik Puddles', 'Rubik Spray Paint', 'Rubik Storm', 'Rubik Vinyl', 'Rubik Wet Paint', 'Ruda', 'Rufina', 'Ruge Boogie', 'Ruluko', 'Rum Raisin', 'Ruslan Display', 'Russo One', 'Ruthie', 'Rye', 'STIX Two Text', 'Sacramento', 'Sahitya', 'Sail', 'Saira', 'Saira Condensed', 'Saira Extra Condensed', 'Saira Semi Condensed', 'Saira Stencil One', 'Salsa', 'Sanchez', 'Sancreek', 'Sansita', 'Sansita Swashed', 'Sarabun', 'Sarala', 'Sarina', 'Sarpanch', 'Sassybold', 'Satisfy', 'Sawarabi Gothic', 'Sawarabi Mincho', 'Scada', 'Scheherazade New', 'Schoolbell', 'Scope One', 'Seaweed Script', 'Secular One', 'Sedgwick Ave', 'Sedgwick Ave Display', 'Sen', 'Send Flowers', 'Sevillana', 'Seymour One', 'Shadows Into Light', 'Shadows Into Light Two', 'Shalimar', 'Shanti', 'Share', 'Share Tech', 'Share Tech Mono', 'Shippori Antique', 'Shippori Antique B1', 'Shippori Mincho', 'Shippori Mincho B1', 'Shizuru', 'Shojumaru', 'Short Stack', 'Shrikhand', 'Siemreap', 'Sigmar One', 'Signika', 'Signika Negative', 'Silkscreen', 'Simonetta', 'Single Day', 'Sintony', 'Sirin Stencil', 'Six Caps', 'Skranji', 'Slabo 13px', 'Slabo 27px', 'Slackey', 'Smokum', 'Smooch', 'Smooch Sans', 'Smythe', 'Sniglet', 'Snippet', 'Snowburst One', 'Sofadi One', 'Sofia', 'Sofia Sans', 'Sofia Sans Condensed', 'Sofia Sans Extra Condensed', 'Sofia Sans Semi Condensed', 'Solitreo', 'Solway', 'Song Myung', 'Sono', 'Sonsie One', 'Sora', 'Sorts Mill Goudy', 'Source Code Pro', 'Source Sans 3', 'Source Sans Pro', 'Source Serif 4', 'Source Serif Pro', 'Space Grotesk', 'Space Mono', 'Special Elite', 'Spectral', 'Spectral SC', 'Spicy Rice', 'Spinnaker', 'Spirax', 'Splash', 'Spline Sans', 'Spline Sans Mono', 'Squada One', 'Square Peg', 'Sree Krushnadevaraya', 'Sriracha', 'Srisakdi', 'Staatliches', 'Stalemate', 'Stalinist One', 'Stardos Stencil', 'Stick', 'Stick No Bills', 'Stint Ultra Condensed', 'Stint Ultra Expanded', 'Stoke', 'Strait', 'Style Script', 'Stylish', 'Sue Ellen Francisco', 'Suez One', 'Sulphur Point', 'Sumana', 'Sunflower', 'Sunshiney', 'Supermercado One', 'Sura', 'Suranna', 'Suravaram', 'Suwannaphum', 'Swanky and Moo Moo', 'Syncopate', 'Syne', 'Syne Mono', 'Syne Tactile', 'Tac One', 'Tai Heritage Pro', 'Tajawal', 'Tangerine', 'Tapestry', 'Taprom', 'Tauri', 'Taviraj', 'Teko', 'Telex', 'Tenali Ramakrishna', 'Tenor Sans', 'Text Me One', 'Texturina', 'Thasadith', 'The Girl Next Door', 'The Nautigal', 'Tienne', 'Tillana', 'Tilt Neon', 'Tilt Prism', 'Tilt Warp', 'Timmana', 'Tinos', 'Tiro Bangla', 'Tiro Devanagari Marathi', 'Tiro Devanagari Sanskrit', 'Tiro Gurmukhi', 'Tiro Kannada', 'Tiro Tamil', 'Tiro Telugu', 'Titan One', 'Titillium Web', 'Tomorrow', 'Tourney', 'Trade Winds', 'Train One', 'Trirong', 'Trispace', 'Trocchi', 'Trochut', 'Truculenta', 'Trykker', 'Tsukimi Rounded', 'Tulpen One', 'Turret Road', 'Twinkle Star', 'Ubuntu', 'Ubuntu Condensed', 'Ubuntu Mono', 'Uchen', 'Ultra', 'Unbounded', 'Uncial Antiqua', 'Underdog', 'Unica One', 'UnifrakturCook', 'UnifrakturMaguntia', 'Unkempt', 'Unlock', 'Unna', 'Updock', 'Urbanist', 'Vast Shadow', 'Vazirmatn', 'Vesper Libre', 'Viaoda Libre', 'Vibes', 'Vibur', 'Vidaloka', 'Viga', 'Voces', 'Volkhov', 'Vollkorn', 'Vollkorn SC', 'Voltaire', 'Vujahday Script', 'Waiting for the Sunrise', 'Wallpoet', 'Walter Turncoat', 'Warnes', 'Waterfall', 'Wavefont', 'Wellfleet', 'Wendy One', 'Whisper', 'WindSong', 'Wire One', 'Work Sans', 'Wix Madefor Display', 'Wix Madefor Text', 'Xanh Mono', 'Yaldevi', 'Yanone Kaffeesatz', 'Yantramanav', 'Yatra One', 'Yellowtail', 'Yeon Sung', 'Yeseva One', 'Yesteryear', 'Yomogi', 'Yrsa', 'Ysabeau', 'Ysabeau Infant', 'Ysabeau Office', 'Ysabeau SC', 'Yuji Boku', 'Yuji Hentaigana Akari', 'Yuji Hentaigana Akebono', 'Yuji Mai', 'Yuji Syuku', 'Yusei Magic', 'ZCOOL KuaiLe', 'ZCOOL QingKe HuangYou', 'ZCOOL XiaoWei', 'Zen Antique', 'Zen Antique Soft', 'Zen Dots', 'Zen Kaku Gothic Antique', 'Zen Kaku Gothic New', 'Zen Kurenaido', 'Zen Loop', 'Zen Maru Gothic', 'Zen Old Mincho', 'Zen Tokyo Zoo', 'Zeyada', 'Zhi Mang Xing', 'Zilla Slab', 'Zilla Slab Highlight'];
1805
+
1660
1806
  var _excluded$5 = ["mimeType", "quality", "dpi", "dpiMetadata"],
1661
1807
  _excluded2$1 = ["mimeType", "quality"],
1662
1808
  _excluded3$1 = ["fileName"],
@@ -1771,7 +1917,9 @@ var Store = mobxStateTree.types.model('Store', {
1771
1917
  // null | { type: 'effects'|'mask', elementId: string }
1772
1918
  _fontVersion: 0,
1773
1919
  // incremented after each font load to trigger canvas re-render
1774
- _pendingInputFields: [] // elements awaiting user input after loadJSON
1920
+ _pendingInputFields: [],
1921
+ // elements awaiting user input after loadJSON
1922
+ customFonts: [] // host-injected custom font catalog: [{ name, variants: [{weight,style,file}] }]
1775
1923
  };
1776
1924
  }).views(function (self) {
1777
1925
  return {
@@ -2633,6 +2781,11 @@ var Store = mobxStateTree.types.model('Store', {
2633
2781
  self.fonts.splice(idx, 1);
2634
2782
  }
2635
2783
  },
2784
+ // Full replace, mirroring `_setStageRef`'s plain-assignment style for volatile state.
2785
+ // Host app calls this with the complete active font list — no incremental add/remove.
2786
+ setCustomFonts: function setCustomFonts(fonts) {
2787
+ self.customFonts = fonts || [];
2788
+ },
2636
2789
  addAudio: function addAudio(data) {
2637
2790
  self.audios.push(_objectSpread2({
2638
2791
  id: uuid.v4()
@@ -2648,15 +2801,24 @@ var Store = mobxStateTree.types.model('Store', {
2648
2801
  },
2649
2802
  loadFont: function loadFont(fontFamily) {
2650
2803
  return _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee8() {
2651
- var id, link, _t;
2804
+ var customFont, id, link, _t;
2652
2805
  return _regenerator().w(function (_context8) {
2653
2806
  while (1) switch (_context8.p = _context8.n) {
2654
2807
  case 0:
2808
+ _context8.p = 1;
2809
+ customFont = self.customFonts.find(function (f) {
2810
+ return f.name === fontFamily;
2811
+ });
2812
+ if (!customFont) {
2813
+ _context8.n = 2;
2814
+ break;
2815
+ }
2816
+ return _context8.a(2, self._loadCustomFont(customFont));
2817
+ case 2:
2655
2818
  // Load font via Google Fonts CSS API
2656
2819
  id = "google-font-".concat(fontFamily.replace(/\s+/g, '-').toLowerCase());
2657
- _context8.p = 1;
2658
2820
  if (document.getElementById(id)) {
2659
- _context8.n = 2;
2821
+ _context8.n = 3;
2660
2822
  break;
2661
2823
  }
2662
2824
  link = document.createElement('link');
@@ -2665,38 +2827,76 @@ var Store = mobxStateTree.types.model('Store', {
2665
2827
  link.rel = 'stylesheet';
2666
2828
 
2667
2829
  // Wait for the CSS stylesheet to load so @font-face rules are parsed
2668
- _context8.n = 2;
2830
+ _context8.n = 3;
2669
2831
  return new Promise(function (resolve) {
2670
2832
  link.onload = resolve;
2671
2833
  link.onerror = resolve; // don't block on network errors
2672
2834
  document.head.appendChild(link);
2673
2835
  });
2674
- case 2:
2675
- _context8.n = 3;
2676
- return document.fonts.load("16px \"".concat(fontFamily, "\""));
2677
2836
  case 3:
2678
2837
  _context8.n = 4;
2679
- return document.fonts.load("bold 16px \"".concat(fontFamily, "\""));
2838
+ return document.fonts.load("16px \"".concat(fontFamily, "\""));
2680
2839
  case 4:
2681
2840
  _context8.n = 5;
2682
- return document.fonts.ready;
2841
+ return document.fonts.load("bold 16px \"".concat(fontFamily, "\""));
2683
2842
  case 5:
2843
+ _context8.n = 6;
2844
+ return document.fonts.ready;
2845
+ case 6:
2684
2846
  // Bump version so MobX observers re-render with the real font
2685
2847
  self._fontVersion += 1;
2686
2848
  // Force Konva to redraw all text nodes with the newly loaded font
2687
2849
  if (self._stageRef) {
2688
2850
  self._stageRef.batchDraw();
2689
2851
  }
2690
- _context8.n = 7;
2852
+ _context8.n = 8;
2691
2853
  break;
2692
- case 6:
2693
- _context8.p = 6;
2854
+ case 7:
2855
+ _context8.p = 7;
2694
2856
  _t = _context8.v;
2695
2857
  console.warn("Failed to load font: ".concat(fontFamily), _t);
2696
- case 7:
2858
+ case 8:
2697
2859
  return _context8.a(2);
2698
2860
  }
2699
- }, _callee8, null, [[1, 6]]);
2861
+ }, _callee8, null, [[1, 7]]);
2862
+ }))();
2863
+ },
2864
+ _loadCustomFont: function _loadCustomFont(customFont) {
2865
+ return _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee9() {
2866
+ var id, styleEl, _t2;
2867
+ return _regenerator().w(function (_context9) {
2868
+ while (1) switch (_context9.p = _context9.n) {
2869
+ case 0:
2870
+ _context9.p = 0;
2871
+ id = "custom-font-".concat(customFont.name.replace(/\s+/g, '-').toLowerCase());
2872
+ if (!document.getElementById(id)) {
2873
+ styleEl = document.createElement('style');
2874
+ styleEl.id = id;
2875
+ styleEl.textContent = buildFontFaceCss(customFont);
2876
+ document.head.appendChild(styleEl);
2877
+ }
2878
+ _context9.n = 1;
2879
+ return Promise.all(customFont.variants.map(function (v) {
2880
+ return document.fonts.load("".concat(v.style === 'italic' ? 'italic ' : '').concat(v.weight, " 16px \"").concat(customFont.name, "\""));
2881
+ }));
2882
+ case 1:
2883
+ _context9.n = 2;
2884
+ return document.fonts.ready;
2885
+ case 2:
2886
+ self._fontVersion += 1;
2887
+ if (self._stageRef) {
2888
+ self._stageRef.batchDraw();
2889
+ }
2890
+ _context9.n = 4;
2891
+ break;
2892
+ case 3:
2893
+ _context9.p = 3;
2894
+ _t2 = _context9.v;
2895
+ console.warn("Failed to load custom font: ".concat(customFont.name), _t2);
2896
+ case 4:
2897
+ return _context9.a(2);
2898
+ }
2899
+ }, _callee9, null, [[0, 3]]);
2700
2900
  }))();
2701
2901
  },
2702
2902
  _autoLoadFonts: function _autoLoadFonts(data) {
@@ -2912,6 +3112,12 @@ function getTheme() {
2912
3112
  return _theme;
2913
3113
  }
2914
3114
 
3115
+ // ── Backend API base URL (used by background-panel.js's Unsplash proxy calls) ─
3116
+ var _apiBaseUrl = '';
3117
+ function getApiBaseUrl() {
3118
+ return _apiBaseUrl;
3119
+ }
3120
+
2915
3121
  // ── Input Fields Dialog Config ───────────────────────────────────────
2916
3122
  var INPUT_FIELDS_CONFIG_KEY = '__labellife_input_fields_config__';
2917
3123
  if (typeof window !== 'undefined' && !window[INPUT_FIELDS_CONFIG_KEY]) {
@@ -3504,6 +3710,33 @@ var TextSection = {
3504
3710
  Panel: TextPanelContent
3505
3711
  };
3506
3712
 
3713
+ // src/side-panel/unsplash-api.js
3714
+ //
3715
+ // Pure, framework-free URL helpers for the Unsplash background search, proxied through the
3716
+ // labellife backend (see labellifeBackendRepo's UnsplashBackgroundSearchView /
3717
+ // UnsplashTrackDownloadView). Deliberately has no internal imports so it can be unit-tested
3718
+ // with plain `node`, following the same convention as ./fonts.js.
3719
+
3720
+ var UNSPLASH_UTM_SOURCE = 'labellife';
3721
+ function buildUnsplashSearchUrl(apiBaseUrl, query) {
3722
+ var page = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1;
3723
+ var perPage = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 20;
3724
+ var trimmed = query && String(query).trim();
3725
+ var q = trimmed || 'gradient';
3726
+ return "".concat(apiBaseUrl, "/api/polotno/unsplash/search/?query=").concat(encodeURIComponent(q), "&per_page=").concat(perPage, "&page=").concat(page);
3727
+ }
3728
+ function buildUnsplashTrackDownloadUrl(apiBaseUrl) {
3729
+ return "".concat(apiBaseUrl, "/api/polotno/unsplash/track-download/");
3730
+ }
3731
+
3732
+ // Unsplash API Guidelines require attribution links back to unsplash.com and to the
3733
+ // photographer's profile to carry UTM params identifying this app.
3734
+ function withUnsplashAttribution(url) {
3735
+ if (!url) return url;
3736
+ var separator = url.includes('?') ? '&' : '?';
3737
+ return "".concat(url).concat(separator, "utm_source=").concat(encodeURIComponent(UNSPLASH_UTM_SOURCE), "&utm_medium=referral");
3738
+ }
3739
+
3507
3740
  function hsvToRgb(h, s, v) {
3508
3741
  var i = Math.floor(h / 60) % 6;
3509
3742
  var f = h / 60 - Math.floor(h / 60);
@@ -3579,8 +3812,6 @@ function hueToColor(h) {
3579
3812
 
3580
3813
  // ─── Constants ───────────────────────────────────────────────────────
3581
3814
 
3582
- var UNSPLASH_KEY = 'zwiE802FyRjTmLhZjXqW';
3583
- var UNSPLASH_BASE = 'https://api.polotno.com/api/get-unsplash';
3584
3815
  var SWATCH_COLORS = ['#ffffff', '#1a237e', '#ff6d00', '#2e7d32', '#fdd835', '#9c27b0'];
3585
3816
  var PICKER_PRESETS = ['#f44336', '#ff9800', '#ffeb3b', '#4caf50', '#2196f3', '#9c27b0', '#00bcd4', '#8bc34a', '#cddc39', '#000000', '#607d8b', '#ffffff'];
3586
3817
  var CHECKER_SVG = "data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16'%3E%3Crect width='8' height='8' fill='%23ccc'/%3E%3Crect x='8' y='8' width='8' height='8' fill='%23ccc'/%3E%3Crect x='8' width='8' height='8' fill='%23fff'/%3E%3Crect y='8' width='8' height='8' fill='%23fff'/%3E%3C/svg%3E";
@@ -4178,7 +4409,7 @@ var BackgroundPanelContent = mobxReactLite.observer(function (_ref5) {
4178
4409
  _context.p = 2;
4179
4410
  q = query || 'gradient';
4180
4411
  _context.n = 3;
4181
- return fetch("".concat(UNSPLASH_BASE, "?query=").concat(encodeURIComponent(q), "&per_page=20&page=").concat(pg, "&KEY=").concat(UNSPLASH_KEY));
4412
+ return fetch(buildUnsplashSearchUrl(getApiBaseUrl(), q, pg, 20));
4182
4413
  case 3:
4183
4414
  res = _context.v;
4184
4415
  _context.n = 4;
@@ -4410,7 +4641,7 @@ var BackgroundPanelContent = mobxReactLite.observer(function (_ref5) {
4410
4641
  color: '#888'
4411
4642
  },
4412
4643
  children: ["Photos by", ' ', /*#__PURE__*/jsxRuntime.jsx("a", {
4413
- href: "https://unsplash.com",
4644
+ href: withUnsplashAttribution('https://unsplash.com'),
4414
4645
  target: "_blank",
4415
4646
  rel: "noopener noreferrer",
4416
4647
  style: {
@@ -4426,16 +4657,33 @@ var BackgroundPanelContent = mobxReactLite.observer(function (_ref5) {
4426
4657
  gap: 1
4427
4658
  },
4428
4659
  children: photos.map(function (photo, idx) {
4429
- var _photo$urls, _photo$urls2;
4660
+ var _photo$urls, _photo$urls2, _photo$user, _photo$user2;
4430
4661
  var thumb = ((_photo$urls = photo.urls) === null || _photo$urls === void 0 ? void 0 : _photo$urls.small) || ((_photo$urls2 = photo.urls) === null || _photo$urls2 === void 0 ? void 0 : _photo$urls2.thumb) || photo.src;
4431
4662
  if (!thumb) return null;
4432
- return /*#__PURE__*/jsxRuntime.jsx(material.Box, {
4663
+ var photographerName = (_photo$user = photo.user) === null || _photo$user === void 0 ? void 0 : _photo$user.name;
4664
+ var photographerUrl = ((_photo$user2 = photo.user) === null || _photo$user2 === void 0 || (_photo$user2 = _photo$user2.links) === null || _photo$user2 === void 0 ? void 0 : _photo$user2.html) && withUnsplashAttribution(photo.user.links.html);
4665
+ return /*#__PURE__*/jsxRuntime.jsxs(material.Box, {
4433
4666
  onClick: function onClick() {
4434
- var _photo$urls3, _photo$urls4;
4667
+ var _photo$urls3, _photo$urls4, _photo$links;
4435
4668
  var url = ((_photo$urls3 = photo.urls) === null || _photo$urls3 === void 0 ? void 0 : _photo$urls3.regular) || ((_photo$urls4 = photo.urls) === null || _photo$urls4 === void 0 ? void 0 : _photo$urls4.small) || photo.src;
4436
- if (url) setBackground(url);
4669
+ if (!url) return;
4670
+ setBackground(url);
4671
+ // Unsplash API Guidelines require registering a "download" whenever a photo is used.
4672
+ // Best-effort: don't block or fail background-setting if this ping fails.
4673
+ if ((_photo$links = photo.links) !== null && _photo$links !== void 0 && _photo$links.download_location) {
4674
+ fetch(buildUnsplashTrackDownloadUrl(getApiBaseUrl()), {
4675
+ method: 'POST',
4676
+ headers: {
4677
+ 'Content-Type': 'application/json'
4678
+ },
4679
+ body: JSON.stringify({
4680
+ download_location: photo.links.download_location
4681
+ })
4682
+ })["catch"](function () {});
4683
+ }
4437
4684
  },
4438
4685
  sx: {
4686
+ position: 'relative',
4439
4687
  cursor: 'pointer',
4440
4688
  borderRadius: '8px',
4441
4689
  overflow: 'hidden',
@@ -4445,7 +4693,7 @@ var BackgroundPanelContent = mobxReactLite.observer(function (_ref5) {
4445
4693
  },
4446
4694
  transition: 'opacity 0.15s'
4447
4695
  },
4448
- children: /*#__PURE__*/jsxRuntime.jsx("img", {
4696
+ children: [/*#__PURE__*/jsxRuntime.jsx("img", {
4449
4697
  src: thumb,
4450
4698
  alt: photo.alt_description || 'Background',
4451
4699
  style: {
@@ -4455,7 +4703,32 @@ var BackgroundPanelContent = mobxReactLite.observer(function (_ref5) {
4455
4703
  display: 'block'
4456
4704
  },
4457
4705
  loading: "lazy"
4458
- })
4706
+ }), photographerName && /*#__PURE__*/jsxRuntime.jsx(material.Typography, {
4707
+ variant: "caption",
4708
+ component: "a",
4709
+ href: photographerUrl || undefined,
4710
+ target: "_blank",
4711
+ rel: "noopener noreferrer",
4712
+ onClick: function onClick(e) {
4713
+ return e.stopPropagation();
4714
+ },
4715
+ sx: {
4716
+ position: 'absolute',
4717
+ left: 0,
4718
+ right: 0,
4719
+ bottom: 0,
4720
+ px: 0.75,
4721
+ py: 0.25,
4722
+ fontSize: 10,
4723
+ color: '#fff',
4724
+ textDecoration: 'none',
4725
+ background: 'linear-gradient(to top, rgba(0,0,0,0.55), transparent)',
4726
+ whiteSpace: 'nowrap',
4727
+ overflow: 'hidden',
4728
+ textOverflow: 'ellipsis'
4729
+ },
4730
+ children: photographerName
4731
+ })]
4459
4732
  }, photo.id || idx);
4460
4733
  })
4461
4734
  }), hasMore && /*#__PURE__*/jsxRuntime.jsx(material.Box, {
@@ -8714,110 +8987,7 @@ mobxReactLite.observer(function (_ref2) {
8714
8987
  });
8715
8988
  });
8716
8989
 
8717
- var GOOGLE_FONTS_API = 'https://www.googleapis.com/webfonts/v1/webfonts';
8718
- var cachedFonts = null;
8719
- function fetchGoogleFonts(_x) {
8720
- return _fetchGoogleFonts.apply(this, arguments);
8721
- }
8722
- function _fetchGoogleFonts() {
8723
- _fetchGoogleFonts = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(apiKey) {
8724
- var url, response, data, _t;
8725
- return _regenerator().w(function (_context) {
8726
- while (1) switch (_context.p = _context.n) {
8727
- case 0:
8728
- if (!cachedFonts) {
8729
- _context.n = 1;
8730
- break;
8731
- }
8732
- return _context.a(2, cachedFonts);
8733
- case 1:
8734
- _context.p = 1;
8735
- url = apiKey ? "".concat(GOOGLE_FONTS_API, "?key=").concat(apiKey, "&sort=popularity") : "".concat(GOOGLE_FONTS_API, "?sort=popularity");
8736
- _context.n = 2;
8737
- return fetch(url);
8738
- case 2:
8739
- response = _context.v;
8740
- _context.n = 3;
8741
- return response.json();
8742
- case 3:
8743
- data = _context.v;
8744
- cachedFonts = (data.items || []).map(function (font) {
8745
- return {
8746
- fontFamily: font.family,
8747
- variants: font.variants || [],
8748
- category: font.category,
8749
- url: "https://fonts.googleapis.com/css2?family=".concat(encodeURIComponent(font.family), "&display=swap")
8750
- };
8751
- });
8752
- return _context.a(2, cachedFonts);
8753
- case 4:
8754
- _context.p = 4;
8755
- _t = _context.v;
8756
- console.warn('Failed to fetch Google Fonts list', _t);
8757
- return _context.a(2, []);
8758
- }
8759
- }, _callee, null, [[1, 4]]);
8760
- }));
8761
- return _fetchGoogleFonts.apply(this, arguments);
8762
- }
8763
- function loadGoogleFont(_x2) {
8764
- return _loadGoogleFont.apply(this, arguments);
8765
- }
8766
- function _loadGoogleFont() {
8767
- _loadGoogleFont = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2(fontFamily) {
8768
- var id, existing, _t2;
8769
- return _regenerator().w(function (_context2) {
8770
- while (1) switch (_context2.p = _context2.n) {
8771
- case 0:
8772
- id = "google-font-".concat(fontFamily.replace(/\s+/g, '-').toLowerCase());
8773
- existing = document.getElementById(id);
8774
- if (existing) {
8775
- _context2.n = 1;
8776
- break;
8777
- }
8778
- _context2.n = 1;
8779
- return new Promise(function (resolve) {
8780
- var link = document.createElement('link');
8781
- link.id = id;
8782
- link.href = "https://fonts.googleapis.com/css2?family=".concat(encodeURIComponent(fontFamily), ":wght@100;200;300;400;500;600;700;800;900&display=swap");
8783
- link.rel = 'stylesheet';
8784
- link.onload = function () {
8785
- return resolve();
8786
- };
8787
- link.onerror = function () {
8788
- return resolve();
8789
- };
8790
- document.head.appendChild(link);
8791
- });
8792
- case 1:
8793
- _context2.p = 1;
8794
- _context2.n = 2;
8795
- return document.fonts.load("16px \"".concat(fontFamily, "\""));
8796
- case 2:
8797
- _context2.n = 3;
8798
- return document.fonts.load("bold 16px \"".concat(fontFamily, "\""));
8799
- case 3:
8800
- _context2.n = 4;
8801
- return document.fonts.ready;
8802
- case 4:
8803
- _context2.n = 6;
8804
- break;
8805
- case 5:
8806
- _context2.p = 5;
8807
- _t2 = _context2.v;
8808
- console.warn("Font \"".concat(fontFamily, "\" may not have loaded correctly."), _t2);
8809
- case 6:
8810
- return _context2.a(2);
8811
- }
8812
- }, _callee2, null, [[1, 5]]);
8813
- }));
8814
- return _loadGoogleFont.apply(this, arguments);
8815
- }
8816
-
8817
- // Comprehensive list of Google Fonts matching Polotno's font library
8818
- var DEFAULT_FONTS = ['ABeeZee', 'Abel', 'Abhaya Libre', 'Abril Fatface', 'Aclonica', 'Acme', 'Actor', 'Adamina', 'Advent Pro', 'Aguafina Script', 'Akronim', 'Aladin', 'Alata', 'Alatsi', 'Albert Sans', 'Aldrich', 'Alef', 'Alegreya', 'Alegreya Sans', 'Alegreya Sans SC', 'Alegreya SC', 'Aleo', 'Alex Brush', 'Alfa Slab One', 'Alice', 'Alike', 'Alike Angular', 'Allan', 'Allerta', 'Allerta Stencil', 'Allison', 'Allura', 'Almarai', 'Almendra', 'Almendra Display', 'Almendra SC', 'Alumni Sans', 'Alumni Sans Inline One', 'Amarante', 'Amaranth', 'Amatic SC', 'Amethysta', 'Amiko', 'Amiri', 'Amita', 'Anaheim', 'Andada Pro', 'Andika', 'Anek Bangla', 'Anek Devanagari', 'Anek Gujarati', 'Anek Gurmukhi', 'Anek Kannada', 'Anek Latin', 'Anek Malayalam', 'Anek Odia', 'Anek Tamil', 'Anek Telugu', 'Angkor', 'Annie Use Your Telescope', 'Anonymous Pro', 'Antic', 'Antic Didone', 'Antic Slab', 'Anton', 'Antonio', 'Anybody', 'Arapey', 'Arbutus', 'Arbutus Slab', 'Architects Daughter', 'Archivo', 'Archivo Black', 'Archivo Narrow', 'Are You Serious', 'Aref Ruqaa', 'Arima', 'Arimo', 'Arizonia', 'Armata', 'Arsenal', 'Artifika', 'Arvo', 'Arya', 'Asap', 'Asap Condensed', 'Asar', 'Asset', 'Assistant', 'Astloch', 'Asul', 'Athiti', 'Atkinson Hyperlegible', 'Atma', 'Atomic Age', 'Aubrey', 'Audiowide', 'Autour One', 'Average', 'Average Sans', 'Averia Gruesa Libre', 'Averia Libre', 'Averia Sans Libre', 'Averia Serif Libre', 'Azeret Mono', 'B612', 'B612 Mono', 'Bad Script', 'Bahiana', 'Bahianita', 'Bai Jamjuree', 'Bakbak One', 'Ballet', 'Baloo 2', 'Baloo Bhai 2', 'Baloo Bhaijaan 2', 'Baloo Bhaina 2', 'Baloo Chettan 2', 'Baloo Da 2', 'Baloo Paaji 2', 'Baloo Tamma 2', 'Baloo Tammudu 2', 'Baloo Thambi 2', 'Balsamiq Sans', 'Balthazar', 'Bangers', 'Barlow', 'Barlow Condensed', 'Barlow Semi Condensed', 'Barriecito', 'Barrio', 'Basic', 'Baskervville', 'Battambang', 'Baumans', 'Bayon', 'Be Vietnam Pro', 'Beau Rivage', 'Bebas Neue', 'Belgrano', 'Bellefair', 'Belleza', 'Bellota', 'Bellota Text', 'BenchNine', 'Benne', 'Bentham', 'Berkshire Swash', 'Besley', 'Beth Ellen', 'Bevan', 'BIZ UDGothic', 'BIZ UDMincho', 'BIZ UDPGothic', 'BIZ UDPMincho', 'Big Shoulders Display', 'Big Shoulders Inline Display', 'Big Shoulders Inline Text', 'Big Shoulders Stencil Display', 'Big Shoulders Stencil Text', 'Big Shoulders Text', 'Bigelow Rules', 'Bigshot One', 'Bilbo', 'Bilbo Swash Caps', 'BioRhyme', 'BioRhyme Expanded', 'Birthstone', 'Birthstone Bounce', 'Bitter', 'Black And White Picture', 'Black Han Sans', 'Black Ops One', 'Blaka', 'Blaka Hollow', 'Blaka Ink', 'Blinker', 'Bodoni Moda', 'Bokor', 'Bona Nova', 'Bonbon', 'Bonheur Royale', 'Boogaloo', 'Bowlby One', 'Bowlby One SC', 'Brawler', 'Bree Serif', 'Brygada 1918', 'Bubblegum Sans', 'Bubbler One', 'Buda', 'Buenard', 'Bungee', 'Bungee Hairline', 'Bungee Inline', 'Bungee Outline', 'Bungee Shade', 'Bungee Spice', 'Butcherman', 'Butterfly Kids', 'Cabin', 'Cabin Condensed', 'Cabin Sketch', 'Caesar Dressing', 'Cagliostro', 'Cairo', 'Cairo Play', 'Caladea', 'Calistoga', 'Calligraffitti', 'Cambay', 'Cambo', 'Candal', 'Cantarell', 'Cantata One', 'Cantora One', 'Caprasimo', 'Capriola', 'Caramel', 'Carattere', 'Cardo', 'Carlito', 'Carme', 'Carrois Gothic', 'Carrois Gothic SC', 'Carter One', 'Castoro', 'Catamaran', 'Caudex', 'Caveat', 'Caveat Brush', 'Cedarville Cursive', 'Ceviche One', 'Chakra Petch', 'Changa', 'Changa One', 'Chango', 'Charis SIL', 'Charm', 'Charmonman', 'Chathura', 'Chau Philomene One', 'Chela One', 'Chelsea Market', 'Chenla', 'Cherry Bomb One', 'Cherry Cream Soda', 'Cherry Swash', 'Chewy', 'Chicle', 'Chilanka', 'Chivo', 'Chivo Mono', 'Chonburi', 'Cinzel', 'Cinzel Decorative', 'Clicker Script', 'Coda', 'Coda Caption', 'Codystar', 'Coiny', 'Combo', 'Comfortaa', 'Comforter', 'Comforter Brush', 'Comic Neue', 'Coming Soon', 'Commissioner', 'Concert One', 'Condiment', 'Content', 'Contrail One', 'Convergence', 'Cookie', 'Copse', 'Corben', 'Corinthia', 'Cormorant', 'Cormorant Garamond', 'Cormorant Infant', 'Cormorant SC', 'Cormorant Unicase', 'Cormorant Upright', 'Courgette', 'Courier Prime', 'Cousine', 'Coustard', 'Covered By Your Grace', 'Crafty Girls', 'Creepster', 'Crete Round', 'Crimson Pro', 'Crimson Text', 'Croissant One', 'Crushed', 'Cuprum', 'Cute Font', 'Cutive', 'Cutive Mono', 'DM Mono', 'DM Sans', 'DM Serif Display', 'DM Serif Text', 'Damion', 'Dancing Script', 'Dangrek', 'Darker Grotesque', 'David Libre', 'Dawning of a New Day', 'Days One', 'Dekko', 'Dela Gothic One', 'Delius', 'Delius Swash Caps', 'Delius Unicase', 'Della Respira', 'Denk One', 'Devonshire', 'Dhurjati', 'Didact Gothic', 'Diplomata', 'Diplomata SC', 'Do Hyeon', 'Dokdo', 'Domine', 'Donegal One', 'Dongle', 'Doppio One', 'Dorsa', 'Dosis', 'DotGothic16', 'Dr Sugiyama', 'Duru Sans', 'DynaPuff', 'Dynalight', 'EB Garamond', 'Eagle Lake', 'East Sea Dokdo', 'Eater', 'Economica', 'Eczar', 'El Messiri', 'Electrolize', 'Elsie', 'Elsie Swash Caps', 'Emblema One', 'Emilys Candy', 'Encode Sans', 'Encode Sans Condensed', 'Encode Sans Expanded', 'Encode Sans SC', 'Encode Sans Semi Condensed', 'Encode Sans Semi Expanded', 'Engagement', 'Englebert', 'Enriqueta', 'Ephesis', 'Epilogue', 'Erica One', 'Esteban', 'Estonia', 'Euphoria Script', 'Ewert', 'Exo', 'Exo 2', 'Expletus Sans', 'Explora', 'Fahkwang', 'Familjen Grotesk', 'Fanwood Text', 'Farro', 'Farsan', 'Fascinate', 'Fascinate Inline', 'Faster One', 'Fasthand', 'Fauna One', 'Faustina', 'Federant', 'Federo', 'Felipa', 'Fenix', 'Festive', 'Finger Paint', 'Finlandica', 'Fira Code', 'Fira Mono', 'Fira Sans', 'Fira Sans Condensed', 'Fira Sans Extra Condensed', 'Fjalla One', 'Fjord One', 'Flamenco', 'Flavors', 'Fleur De Leah', 'Flow Block', 'Flow Circular', 'Flow Rounded', 'Fondamento', 'Fontdiner Swanky', 'Forum', 'Fragment Mono', 'Francois One', 'Frank Ruhl Libre', 'Fraunces', 'Freckle Face', 'Fredericka the Great', 'Fredoka', 'Freehand', 'Fresca', 'Frijole', 'Fruktur', 'Fugaz One', 'Fuggles', 'Fuzzy Bubbles', 'GFS Didot', 'GFS Neohellenic', 'Gabriela', 'Gaegu', 'Gafata', 'Galada', 'Galdeano', 'Galindo', 'Gamja Flower', 'Gantari', 'Gas', 'Gayathri', 'Gelasio', 'Gemunu Libre', 'Genos', 'Gentium Book Plus', 'Gentium Plus', 'Geo', 'Georama', 'Geostar', 'Geostar Fill', 'Germania One', 'Gideon Roman', 'Gidugu', 'Gilda Display', 'Girassol', 'Give You Glory', 'Glass Antiqua', 'Glegoo', 'Gloria Hallelujah', 'Glory', 'Gluten', 'Goblin One', 'Gochi Hand', 'Goldman', 'Goldplay', 'Golos Text', 'Gorditas', 'Gothic A1', 'Gotu', 'Goudy Bookletter 1911', 'Gowun Batang', 'Gowun Dodum', 'Graduate', 'Grand Hotel', 'Grandstander', 'Grape Nuts', 'Gravitas One', 'Great Vibes', 'Grechen Fuemen', 'Grenze', 'Grenze Gotisch', 'Grey Qo', 'Griffy', 'Gruppo', 'Gudea', 'Gugi', 'Gulzar', 'Gupter', 'Gurajada', 'Gwendolyn', 'Habibi', 'Hachi Maru Pop', 'Hahmlet', 'Halant', 'Hammersmith One', 'Hanalei', 'Hanalei Fill', 'Handlee', 'Hanken Grotesk', 'Hanuman', 'Happy Monkey', 'Harmattan', 'Headland One', 'Heebo', 'Henny Penny', 'Hepta Slab', 'Herr Von Muellerhoff', 'Hi Melody', 'Hina Mincho', 'Hind', 'Hind Guntur', 'Hind Madurai', 'Hind Siliguri', 'Hind Vadodara', 'Holtwood One SC', 'Homemade Apple', 'Homenaje', 'Hubballi', 'Hurricane', 'IBM Plex Mono', 'IBM Plex Sans', 'IBM Plex Sans Arabic', 'IBM Plex Sans Condensed', 'IBM Plex Sans Devanagari', 'IBM Plex Sans Hebrew', 'IBM Plex Sans JP', 'IBM Plex Sans KR', 'IBM Plex Sans Thai', 'IBM Plex Sans Thai Looped', 'IBM Plex Serif', 'Iceberg', 'Iceland', 'Imbue', 'Imperial Script', 'Imprima', 'Inconsolata', 'Inder', 'Indie Flower', 'Ingrid Darling', 'Inika', 'Inknut Antiqua', 'Inria Sans', 'Inria Serif', 'Inspiration', 'Inter', 'Inter Tight', 'Irish Grover', 'Island Moments', 'Istok Web', 'Italiana', 'Italianno', 'Itim', 'Jacques Francois', 'Jacques Francois Shadow', 'Jaldi', 'JetBrains Mono', 'Jim Nightshade', 'Joan', 'Jockey One', 'Jolly Lodger', 'Jomhuria', 'Jomolhari', 'Josefin Sans', 'Josefin Slab', 'Jost', 'Joti One', 'Jua', 'Judson', 'Julee', 'Julius Sans One', 'Junge', 'Jura', 'K2D', 'Kadwa', 'Kaisei Decol', 'Kaisei HarunoUmi', 'Kaisei Opti', 'Kaisei Tokumin', 'Kalam', 'Kameron', 'Kanit', 'Kantumruy Pro', 'Karantina', 'Karla', 'Karma', 'Katibeh', 'Kaushan Script', 'Kavivanar', 'Kavoon', 'Kdam Thmor Pro', 'Keania One', 'Kelly Slab', 'Kenia', 'Khand', 'Khmer', 'Khula', 'Kings', 'Kirang Haerang', 'Kite One', 'Kiwi Maru', 'Klee One', 'Knewave', 'KoHo', 'Kodchasan', 'Koh Santepheap', 'Kolker Brush', 'Konkhmer Sleokchher', 'Kosugi', 'Kosugi Maru', 'Kotta One', 'Koulen', 'Kranky', 'Kreon', 'Kristi', 'Krona One', 'Krub', 'Kufam', 'Kulim Park', 'Kumar One', 'Kumar One Outline', 'Kumbh Sans', 'Kurale', 'La Belle Aurore', 'Lacquer', 'Laila', 'Lakki Reddy', 'Lalezar', 'Lancelot', 'Langar', 'Lango', 'Lateef', 'Lato', 'Lavishly Yours', 'League Gothic', 'League Script', 'League Spartan', 'Leckerli One', 'Ledger', 'Lekton', 'Lemon', 'Lemonada', 'Lexend', 'Lexend Deca', 'Lexend Exa', 'Lexend Giga', 'Lexend Mega', 'Lexend Peta', 'Lexend Tera', 'Lexend Zetta', 'Libre Barcode 128', 'Libre Barcode 128 Text', 'Libre Barcode 39', 'Libre Barcode 39 Extended', 'Libre Barcode 39 Extended Text', 'Libre Barcode 39 Text', 'Libre Barcode EAN13 Text', 'Libre Baskerville', 'Libre Bodoni', 'Libre Caslon Display', 'Libre Caslon Text', 'Libre Franklin', 'Licorice', 'Life Savers', 'Lilita One', 'Lily Script One', 'Limelight', 'Linden Hill', 'Lingua Franca', 'Literata', 'Liu Jian Mao Cao', 'Livvic', 'Lobster', 'Lobster Two', 'Londrina Outline', 'Londrina Shadow', 'Londrina Sketch', 'Londrina Solid', 'Long Cang', 'Lora', 'Love Light', 'Love Ya Like A Sister', 'Loved by the King', 'Lovers Quarrel', 'Luckiest Guy', 'Lusitana', 'Lustria', 'Luxurious Roman', 'Luxurious Script', 'M PLUS 1', 'M PLUS 1 Code', 'M PLUS 1p', 'M PLUS 2', 'M PLUS Code Latin', 'M PLUS Rounded 1c', 'Ma Shan Zheng', 'Macondo', 'Macondo Swash Caps', 'Mada', 'Magra', 'Maiden Orange', 'Maitree', 'Major Mono Display', 'Mako', 'Mali', 'Mallanna', 'Mandali', 'Manjari', 'Manrope', 'Mansalva', 'Manuale', 'Marcellus', 'Marcellus SC', 'Marck Script', 'Margarine', 'Marhey', 'Markazi Text', 'Marko One', 'Marmelad', 'Martel', 'Martel Sans', 'Marvel', 'Mate', 'Mate SC', 'Maven Pro', 'McLaren', 'Mea Culpa', 'Meddon', 'MedievalSharp', 'Medula One', 'Meera Inimai', 'Megrim', 'Meie Script', 'Meow Script', 'Merienda', 'Merriweather', 'Merriweather Sans', 'Metal', 'Metal Mania', 'Metamorphous', 'Metrophobic', 'Michroma', 'Milonga', 'Miltonian', 'Miltonian Tattoo', 'Mina', 'Miniver', 'Miriam Libre', 'Mirza', 'Miss Fajardose', 'Mitr', 'Mochiy Pop One', 'Mochiy Pop P One', 'Modak', 'Modern Antiqua', 'Mogra', 'Mohave', 'Moirai One', 'Molengo', 'Molle', 'Monda', 'Monofett', 'Monoton', 'Monsieur La Doulaise', 'Montaga', 'Montagu Slab', 'MonteCarlo', 'Montez', 'Montserrat', 'Montserrat Alternates', 'Montserrat Subrayada', 'Moon Dance', 'Moul', 'Moulpali', 'Mountains of Christmas', 'Mouse Memoirs', 'Mr Bedfort', 'Mr Dafoe', 'Mr De Haviland', 'Mrs Saint Delafield', 'Mrs Sheppards', 'Mukta', 'Mukta Mahee', 'Mukta Malar', 'Mukta Vaani', 'Mulish', 'Murecho', 'MuseoModerno', 'My Soul', 'Mynerve', 'Mystery Quest', 'NTR', 'Nabla', 'Nanum Brush Script', 'Nanum Gothic', 'Nanum Gothic Coding', 'Nanum Myeongjo', 'Nanum Pen Script', 'Neonderthaw', 'Nerko One', 'Neucha', 'Neuton', 'New Rocker', 'New Tegomin', 'News Cycle', 'Newsreader', 'Niconne', 'Niramit', 'Nixie One', 'Nobile', 'Nokora', 'Norican', 'Nosifer', 'Notable', 'Nothing You Could Do', 'Noticia Text', 'Noto Color Emoji', 'Noto Emoji', 'Noto Kufi Arabic', 'Noto Music', 'Noto Naskh Arabic', 'Noto Nastaliq Urdu', 'Noto Sans', 'Noto Sans Arabic', 'Noto Sans Display', 'Noto Sans Mono', 'Noto Serif', 'Noto Serif Display', 'Nova Cut', 'Nova Flat', 'Nova Mono', 'Nova Oval', 'Nova Round', 'Nova Script', 'Nova Slim', 'Nova Square', 'Numans', 'Nunito', 'Nunito Sans', 'Odibee Sans', 'Odor Mean Chey', 'Offside', 'Oi', 'Old Standard TT', 'Oldenburg', 'Ole', 'Oleo Script', 'Oleo Script Swash Caps', 'Oooh Baby', 'Open Sans', 'Oranienbaum', 'Orbit', 'Orbitron', 'Oregano', 'Orelega One', 'Orienta', 'Original Surfer', 'Oswald', 'Outfit', 'Over the Rainbow', 'Overlock', 'Overlock SC', 'Overpass', 'Overpass Mono', 'Ovo', 'Oxanium', 'Oxygen', 'Oxygen Mono', 'PT Mono', 'PT Sans', 'PT Sans Caption', 'PT Sans Narrow', 'PT Serif', 'PT Serif Caption', 'Pacifico', 'Padauk', 'Padyakke Expanded One', 'Palanquin', 'Palanquin Dark', 'Palette Mosaic', 'Pangolin', 'Paprika', 'Parisienne', 'Passero One', 'Passion One', 'Passions Conflict', 'Pathway Extreme', 'Pathway Gothic One', 'Patrick Hand', 'Patrick Hand SC', 'Pattaya', 'Patua One', 'Pavanam', 'Paytone One', 'Peddana', 'Peralta', 'Permanent Marker', 'Petit Formal Script', 'Petrona', 'Philosopher', 'Phudu', 'Piazzolla', 'Piedra', 'Pinyon Script', 'Pirata One', 'Plaster', 'Play', 'Playball', 'Playfair Display', 'Playfair Display SC', 'Playpen Sans', 'Plus Jakarta Sans', 'Podkova', 'Poiret One', 'Poller One', 'Poltawski Nowy', 'Poly', 'Pompiere', 'Pontano Sans', 'Poor Story', 'Poppins', 'Port Lligat Sans', 'Port Lligat Slab', 'Potta One', 'Pragati Narrow', 'Praise', 'Prata', 'Preahvihear', 'Press Start 2P', 'Pridi', 'Princess Sofia', 'Prociono', 'Prompt', 'Prosto One', 'Proza Libre', 'Public Sans', 'Puppies Play', 'Puritan', 'Purple Purse', 'Pushster', 'Quando', 'Quantico', 'Quattrocento', 'Quattrocento Sans', 'Questrial', 'Quicksand', 'Quintessential', 'Qwigley', 'Qwitcher Grypen', 'REM', 'Racing Sans One', 'Radio Canada', 'Radley', 'Rajdhani', 'Rakkas', 'Raleway', 'Raleway Dots', 'Ramabhadra', 'Ramaraja', 'Rambla', 'Rammetto One', 'Rampart One', 'Ranchers', 'Rancho', 'Ranga', 'Rasa', 'Rationale', 'Ravi Prakash', 'Readex Pro', 'Recursive', 'Red Hat Display', 'Red Hat Mono', 'Red Hat Text', 'Red Rose', 'Redacted', 'Redacted Script', 'Redressed', 'Reem Kufi', 'Reem Kufi Fun', 'Reem Kufi Ink', 'Reenie Beanie', 'Reggae One', 'Revalia', 'Rhodium Libre', 'Ribeye', 'Ribeye Marrow', 'Righteous', 'Risque', 'Road Rage', 'RocknRoll One', 'Rokkitt', 'Romanesco', 'Ropa Sans', 'Rosario', 'Rosarivo', 'Rouge Script', 'Rowdies', 'Rozha One', 'Rubik', 'Rubik Beastly', 'Rubik Bubbles', 'Rubik Burned', 'Rubik Dirt', 'Rubik Distressed', 'Rubik Gemstones', 'Rubik Glitch', 'Rubik Iso', 'Rubik Marker Hatch', 'Rubik Maze', 'Rubik Microbe', 'Rubik Mono One', 'Rubik Moonrocks', 'Rubik Pixels', 'Rubik Puddles', 'Rubik Spray Paint', 'Rubik Storm', 'Rubik Vinyl', 'Rubik Wet Paint', 'Ruda', 'Rufina', 'Ruge Boogie', 'Ruluko', 'Rum Raisin', 'Ruslan Display', 'Russo One', 'Ruthie', 'Rye', 'STIX Two Text', 'Sacramento', 'Sahitya', 'Sail', 'Saira', 'Saira Condensed', 'Saira Extra Condensed', 'Saira Semi Condensed', 'Saira Stencil One', 'Salsa', 'Sanchez', 'Sancreek', 'Sansita', 'Sansita Swashed', 'Sarabun', 'Sarala', 'Sarina', 'Sarpanch', 'Sassybold', 'Satisfy', 'Sawarabi Gothic', 'Sawarabi Mincho', 'Scada', 'Scheherazade New', 'Schoolbell', 'Scope One', 'Seaweed Script', 'Secular One', 'Sedgwick Ave', 'Sedgwick Ave Display', 'Sen', 'Send Flowers', 'Sevillana', 'Seymour One', 'Shadows Into Light', 'Shadows Into Light Two', 'Shalimar', 'Shanti', 'Share', 'Share Tech', 'Share Tech Mono', 'Shippori Antique', 'Shippori Antique B1', 'Shippori Mincho', 'Shippori Mincho B1', 'Shizuru', 'Shojumaru', 'Short Stack', 'Shrikhand', 'Siemreap', 'Sigmar One', 'Signika', 'Signika Negative', 'Silkscreen', 'Simonetta', 'Single Day', 'Sintony', 'Sirin Stencil', 'Six Caps', 'Skranji', 'Slabo 13px', 'Slabo 27px', 'Slackey', 'Smokum', 'Smooch', 'Smooch Sans', 'Smythe', 'Sniglet', 'Snippet', 'Snowburst One', 'Sofadi One', 'Sofia', 'Sofia Sans', 'Sofia Sans Condensed', 'Sofia Sans Extra Condensed', 'Sofia Sans Semi Condensed', 'Solitreo', 'Solway', 'Song Myung', 'Sono', 'Sonsie One', 'Sora', 'Sorts Mill Goudy', 'Source Code Pro', 'Source Sans 3', 'Source Sans Pro', 'Source Serif 4', 'Source Serif Pro', 'Space Grotesk', 'Space Mono', 'Special Elite', 'Spectral', 'Spectral SC', 'Spicy Rice', 'Spinnaker', 'Spirax', 'Splash', 'Spline Sans', 'Spline Sans Mono', 'Squada One', 'Square Peg', 'Sree Krushnadevaraya', 'Sriracha', 'Srisakdi', 'Staatliches', 'Stalemate', 'Stalinist One', 'Stardos Stencil', 'Stick', 'Stick No Bills', 'Stint Ultra Condensed', 'Stint Ultra Expanded', 'Stoke', 'Strait', 'Style Script', 'Stylish', 'Sue Ellen Francisco', 'Suez One', 'Sulphur Point', 'Sumana', 'Sunflower', 'Sunshiney', 'Supermercado One', 'Sura', 'Suranna', 'Suravaram', 'Suwannaphum', 'Swanky and Moo Moo', 'Syncopate', 'Syne', 'Syne Mono', 'Syne Tactile', 'Tac One', 'Tai Heritage Pro', 'Tajawal', 'Tangerine', 'Tapestry', 'Taprom', 'Tauri', 'Taviraj', 'Teko', 'Telex', 'Tenali Ramakrishna', 'Tenor Sans', 'Text Me One', 'Texturina', 'Thasadith', 'The Girl Next Door', 'The Nautigal', 'Tienne', 'Tillana', 'Tilt Neon', 'Tilt Prism', 'Tilt Warp', 'Timmana', 'Tinos', 'Tiro Bangla', 'Tiro Devanagari Marathi', 'Tiro Devanagari Sanskrit', 'Tiro Gurmukhi', 'Tiro Kannada', 'Tiro Tamil', 'Tiro Telugu', 'Titan One', 'Titillium Web', 'Tomorrow', 'Tourney', 'Trade Winds', 'Train One', 'Trirong', 'Trispace', 'Trocchi', 'Trochut', 'Truculenta', 'Trykker', 'Tsukimi Rounded', 'Tulpen One', 'Turret Road', 'Twinkle Star', 'Ubuntu', 'Ubuntu Condensed', 'Ubuntu Mono', 'Uchen', 'Ultra', 'Unbounded', 'Uncial Antiqua', 'Underdog', 'Unica One', 'UnifrakturCook', 'UnifrakturMaguntia', 'Unkempt', 'Unlock', 'Unna', 'Updock', 'Urbanist', 'Vast Shadow', 'Vazirmatn', 'Vesper Libre', 'Viaoda Libre', 'Vibes', 'Vibur', 'Vidaloka', 'Viga', 'Voces', 'Volkhov', 'Vollkorn', 'Vollkorn SC', 'Voltaire', 'Vujahday Script', 'Waiting for the Sunrise', 'Wallpoet', 'Walter Turncoat', 'Warnes', 'Waterfall', 'Wavefont', 'Wellfleet', 'Wendy One', 'Whisper', 'WindSong', 'Wire One', 'Work Sans', 'Wix Madefor Display', 'Wix Madefor Text', 'Xanh Mono', 'Yaldevi', 'Yanone Kaffeesatz', 'Yantramanav', 'Yatra One', 'Yellowtail', 'Yeon Sung', 'Yeseva One', 'Yesteryear', 'Yomogi', 'Yrsa', 'Ysabeau', 'Ysabeau Infant', 'Ysabeau Office', 'Ysabeau SC', 'Yuji Boku', 'Yuji Hentaigana Akari', 'Yuji Hentaigana Akebono', 'Yuji Mai', 'Yuji Syuku', 'Yusei Magic', 'ZCOOL KuaiLe', 'ZCOOL QingKe HuangYou', 'ZCOOL XiaoWei', 'Zen Antique', 'Zen Antique Soft', 'Zen Dots', 'Zen Kaku Gothic Antique', 'Zen Kaku Gothic New', 'Zen Kurenaido', 'Zen Loop', 'Zen Maru Gothic', 'Zen Old Mincho', 'Zen Tokyo Zoo', 'Zeyada', 'Zhi Mang Xing', 'Zilla Slab', 'Zilla Slab Highlight'];
8819
-
8820
- var _excluded$1 = ["fontFamily"];
8990
+ var _excluded$1 = ["fontFamily", "store"];
8821
8991
  var _positionMenuItemSx = {
8822
8992
  textTransform: 'none',
8823
8993
  fontSize: 12,
@@ -8844,6 +9014,7 @@ function loadFontPreview(fontFamily) {
8844
9014
  }
8845
9015
  var FontPreviewOption = /*#__PURE__*/React.memo(function FontPreviewOption(_ref) {
8846
9016
  var fontFamily = _ref.fontFamily,
9017
+ store = _ref.store,
8847
9018
  liProps = _objectWithoutProperties(_ref, _excluded$1);
8848
9019
  var ref = React.useRef(null);
8849
9020
  React.useEffect(function () {
@@ -8853,7 +9024,15 @@ var FontPreviewOption = /*#__PURE__*/React.memo(function FontPreviewOption(_ref)
8853
9024
  var _ref3 = _slicedToArray(_ref2, 1),
8854
9025
  entry = _ref3[0];
8855
9026
  if (entry.isIntersecting) {
8856
- loadFontPreview(fontFamily);
9027
+ var _store$customFonts;
9028
+ var isCustom = store === null || store === void 0 || (_store$customFonts = store.customFonts) === null || _store$customFonts === void 0 ? void 0 : _store$customFonts.some(function (f) {
9029
+ return f.name === fontFamily;
9030
+ });
9031
+ if (isCustom) {
9032
+ store.loadFont(fontFamily);
9033
+ } else {
9034
+ loadFontPreview(fontFamily);
9035
+ }
8857
9036
  io.disconnect();
8858
9037
  }
8859
9038
  }, {
@@ -8863,7 +9042,7 @@ var FontPreviewOption = /*#__PURE__*/React.memo(function FontPreviewOption(_ref)
8863
9042
  return function () {
8864
9043
  return io.disconnect();
8865
9044
  };
8866
- }, [fontFamily]);
9045
+ }, [fontFamily, store]);
8867
9046
  return /*#__PURE__*/jsxRuntime.jsx("li", _objectSpread2(_objectSpread2({
8868
9047
  ref: ref
8869
9048
  }, liProps), {}, {
@@ -8929,6 +9108,7 @@ var TextToolbar = mobxReactLite.observer(function (_ref4) {
8929
9108
  });
8930
9109
  store.history.addUndoState();
8931
9110
  };
9111
+ var customFonts = store.customFonts || [];
8932
9112
  return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
8933
9113
  children: [/*#__PURE__*/jsxRuntime.jsx(material.Autocomplete, {
8934
9114
  size: "small",
@@ -8943,16 +9123,27 @@ var TextToolbar = mobxReactLite.observer(function (_ref4) {
8943
9123
  }
8944
9124
  },
8945
9125
  options: function () {
8946
- var fonts = _toConsumableArray(DEFAULT_FONTS);
9126
+ var customFontNames = customFonts.map(function (f) {
9127
+ return f.name;
9128
+ });
9129
+ var fonts = [].concat(_toConsumableArray(DEFAULT_FONTS.filter(function (f) {
9130
+ return !customFontNames.includes(f);
9131
+ })), _toConsumableArray(customFontNames));
8947
9132
  if (element.fontFamily && !fonts.includes(element.fontFamily)) {
8948
9133
  fonts.unshift(element.fontFamily);
8949
9134
  }
8950
9135
  return fonts;
8951
9136
  }(),
9137
+ groupBy: customFonts.length > 0 ? function (option) {
9138
+ return customFonts.some(function (f) {
9139
+ return f.name === option;
9140
+ }) ? 'Custom Fonts' : 'Google Fonts';
9141
+ } : undefined,
8952
9142
  disableClearable: true,
8953
9143
  renderOption: function renderOption(props, option) {
8954
9144
  return /*#__PURE__*/jsxRuntime.jsx(FontPreviewOption, _objectSpread2({
8955
- fontFamily: option
9145
+ fontFamily: option,
9146
+ store: store
8956
9147
  }, props), option);
8957
9148
  },
8958
9149
  renderInput: function renderInput(params) {