@pixerate/editor 0.175.0 → 0.177.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (39) hide show
  1. package/dist/{chunk-FKUKJ3XA.cjs → chunk-4XSBOGMK.cjs} +5 -4
  2. package/dist/{chunk-CJE5MOIS.js → chunk-N4ZXW3WB.js} +2 -1
  3. package/dist/{chunk-OVYQAYGH.cjs → chunk-UHMSMUHK.cjs} +75 -66
  4. package/dist/{chunk-BDIM6NVW.js → chunk-Y46OMERN.js} +10 -1
  5. package/dist/effects/fake.d.cts +1 -1
  6. package/dist/effects/fake.d.ts +1 -1
  7. package/dist/effects/index.cjs +38 -24
  8. package/dist/effects/index.js +20 -6
  9. package/dist/effects/types.d.cts +6 -0
  10. package/dist/effects/types.d.ts +6 -0
  11. package/dist/effects/ui.d.cts +0 -6
  12. package/dist/effects/ui.d.ts +0 -6
  13. package/dist/image-editor/controller.d.cts +28 -5
  14. package/dist/image-editor/controller.d.ts +28 -5
  15. package/dist/image-editor/effect-layers.d.cts +40 -0
  16. package/dist/image-editor/effect-layers.d.ts +40 -0
  17. package/dist/image-editor/index.cjs +931 -812
  18. package/dist/image-editor/index.d.cts +1 -0
  19. package/dist/image-editor/index.d.ts +1 -0
  20. package/dist/image-editor/index.js +152 -33
  21. package/dist/image-editor/layers/model.d.cts +15 -1
  22. package/dist/image-editor/layers/model.d.ts +15 -1
  23. package/dist/image-editor/layers/panel.d.cts +6 -2
  24. package/dist/image-editor/layers/panel.d.ts +6 -2
  25. package/dist/image-editor/provider-effect-tools.d.cts +2 -1
  26. package/dist/image-editor/provider-effect-tools.d.ts +2 -1
  27. package/dist/paint-editor/index.cjs +6 -6
  28. package/dist/paint-editor/index.js +1 -1
  29. package/dist/typography/index.cjs +185 -40
  30. package/dist/typography/index.d.cts +1 -0
  31. package/dist/typography/index.d.ts +1 -0
  32. package/dist/typography/index.js +149 -4
  33. package/dist/typography/registry.d.cts +4 -0
  34. package/dist/typography/registry.d.ts +4 -0
  35. package/dist/typography/stylesheet.d.cts +86 -0
  36. package/dist/typography/stylesheet.d.ts +86 -0
  37. package/package.json +1 -1
  38. package/skills/pixerate-image-editor/SKILL.md +2 -1
  39. package/skills/pixerate-typography/SKILL.md +7 -3
@@ -30,8 +30,9 @@ function fontHasWeight(font, weight) {
30
30
  }
31
31
  function filterFonts(fonts, filter = {}) {
32
32
  const q = _nullishCoalesce(_optionalChain([filter, 'access', _ => _.query, 'optionalAccess', _2 => _2.trim, 'call', _3 => _3(), 'access', _4 => _4.toLowerCase, 'call', _5 => _5()]), () => ( ""));
33
+ const wantedTags = (_nullishCoalesce(filter.tags, () => ( []))).map((t) => t.trim().toLowerCase().replace(/\s+/g, "-")).filter(Boolean);
33
34
  const kept = fonts.filter(
34
- (f) => (!filter.category || f.category === filter.category) && (!filter.source || f.source === filter.source) && (filter.weight === void 0 || fontHasWeight(f, filter.weight)) && (!filter.style || f.styles.includes(filter.style)) && (filter.isVariable === void 0 || !!f.isVariable === filter.isVariable) && (!q || f.family.toLowerCase().includes(q))
35
+ (f) => (!filter.category || f.category === filter.category) && (!filter.source || f.source === filter.source) && (filter.weight === void 0 || fontHasWeight(f, filter.weight)) && (!filter.style || f.styles.includes(filter.style)) && (filter.isVariable === void 0 || !!f.isVariable === filter.isVariable) && (!wantedTags.length || wantedTags.every((t) => _optionalChain([f, 'access', _6 => _6.tags, 'optionalAccess', _7 => _7.includes, 'call', _8 => _8(t)]))) && (!q || f.family.toLowerCase().includes(q))
35
36
  );
36
37
  if (!q) return kept;
37
38
  const starts = kept.filter((f) => f.family.toLowerCase().startsWith(q));
@@ -217,7 +218,7 @@ function createSystemFontProvider(options = {}) {
217
218
  for (const e of entries) {
218
219
  const key = e.family.toLowerCase();
219
220
  const known = findFont(SYSTEM_FONT_CATALOG, e.family);
220
- const entry = _nullishCoalesce(byFamily.get(key), () => ( { family: _nullishCoalesce(_optionalChain([known, 'optionalAccess', _6 => _6.family]), () => ( e.family)), category: _nullishCoalesce(_optionalChain([known, 'optionalAccess', _7 => _7.category]), () => ( guessFontCategory(e.family))), weights: [], styles: [], source: "system" }));
221
+ const entry = _nullishCoalesce(byFamily.get(key), () => ( { family: _nullishCoalesce(_optionalChain([known, 'optionalAccess', _9 => _9.family]), () => ( e.family)), category: _nullishCoalesce(_optionalChain([known, 'optionalAccess', _10 => _10.category]), () => ( guessFontCategory(e.family))), weights: [], styles: [], source: "system" }));
221
222
  const w = weightFromStyleName(e.style);
222
223
  if (!entry.weights.includes(w)) entry.weights.push(w);
223
224
  const st = /italic/i.test(_nullishCoalesce(e.style, () => ( ""))) ? "italic" : /oblique/i.test(_nullishCoalesce(e.style, () => ( ""))) ? "oblique" : "normal";
@@ -279,7 +280,7 @@ function createWebFontProvider(options) {
279
280
  const done = /* @__PURE__ */ new Set();
280
281
  const g = globalThis;
281
282
  const createFace = _nullishCoalesce(options.createFontFace, () => ( (g.FontFace ? (family, source, descriptors) => new g.FontFace(family, source, descriptors) : void 0)));
282
- const set = () => _nullishCoalesce(options.fontFaceSet, () => ( _optionalChain([g, 'access', _8 => _8.document, 'optionalAccess', _9 => _9.fonts])));
283
+ const set = () => _nullishCoalesce(options.fontFaceSet, () => ( _optionalChain([g, 'access', _11 => _11.document, 'optionalAccess', _12 => _12.fonts])));
283
284
  const def = (family) => defs.find((d) => d.family.toLowerCase() === family.trim().toLowerCase());
284
285
  const key = (family, weight, style) => `${family.toLowerCase()}|${normalizeFontWeight(weight)}|${_nullishCoalesce(style, () => ( "normal"))}`;
285
286
  function pickSource(d, weight, style) {
@@ -314,7 +315,7 @@ function createWebFontProvider(options) {
314
315
  ...source.unicodeRange ? { unicodeRange: source.unicodeRange } : {}
315
316
  });
316
317
  const promise = face.load().then(() => {
317
- _optionalChain([set, 'call', _10 => _10(), 'optionalAccess', _11 => _11.add, 'call', _12 => _12(face)]);
318
+ _optionalChain([set, 'call', _13 => _13(), 'optionalAccess', _14 => _14.add, 'call', _15 => _15(face)]);
318
319
  done.add(k);
319
320
  return true;
320
321
  }).catch(() => {
@@ -30,8 +30,9 @@ function fontHasWeight(font, weight) {
30
30
  }
31
31
  function filterFonts(fonts, filter = {}) {
32
32
  const q = filter.query?.trim().toLowerCase() ?? "";
33
+ const wantedTags = (filter.tags ?? []).map((t) => t.trim().toLowerCase().replace(/\s+/g, "-")).filter(Boolean);
33
34
  const kept = fonts.filter(
34
- (f) => (!filter.category || f.category === filter.category) && (!filter.source || f.source === filter.source) && (filter.weight === void 0 || fontHasWeight(f, filter.weight)) && (!filter.style || f.styles.includes(filter.style)) && (filter.isVariable === void 0 || !!f.isVariable === filter.isVariable) && (!q || f.family.toLowerCase().includes(q))
35
+ (f) => (!filter.category || f.category === filter.category) && (!filter.source || f.source === filter.source) && (filter.weight === void 0 || fontHasWeight(f, filter.weight)) && (!filter.style || f.styles.includes(filter.style)) && (filter.isVariable === void 0 || !!f.isVariable === filter.isVariable) && (!wantedTags.length || wantedTags.every((t) => f.tags?.includes(t))) && (!q || f.family.toLowerCase().includes(q))
35
36
  );
36
37
  if (!q) return kept;
37
38
  const starts = kept.filter((f) => f.family.toLowerCase().startsWith(q));