@pixerate/editor 0.140.1 → 0.140.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.
@@ -363,7 +363,7 @@ import {
363
363
  writePsd,
364
364
  xyToTempTint,
365
365
  xyToUv
366
- } from "../chunk-QKREDTPW.js";
366
+ } from "../chunk-6UZCFD7Y.js";
367
367
  import {
368
368
  parseCssColor
369
369
  } from "../chunk-3CI7FRMK.js";
@@ -48,7 +48,7 @@ export declare function renderText(layer: TypeLayer, env: TextEnv): {
48
48
  /** The layer drawn again (`rendering` and `missingFonts` updated); refuses when nothing can draw it. */
49
49
  export declare function rerenderText(layer: TypeLayer, env: TextEnv): TypeLayer;
50
50
  /** Fields of `TextStyle` an edit can set (`null` clears an optional one). */
51
- export declare const TEXT_STYLE_FIELDS: readonly ["fontFamily", "fontWeight", "italic", "fontSize", "color", "opacity", "tracking", "leading", "baselineShift", "underline", "strikethrough"];
51
+ export declare const TEXT_STYLE_FIELDS: readonly ["fontFamily", "fontWeight", "italic", "fontSize", "color", "opacity", "tracking", "leading", "baselineShift", "underline", "strikethrough", "postScriptName"];
52
52
  /** `base` with the given style fields changed, validated (`null` clears leading, tracking, …). */
53
53
  export declare function patchTextStyle(base: TextStyle, patch: Record<string, unknown>, path?: string): TextStyle;
54
54
  export declare const PARAGRAPH_STYLE_FIELDS: readonly ["align", "autoLeading", "firstLineIndent", "startIndent", "endIndent", "spaceBefore", "spaceAfter"];
@@ -48,7 +48,7 @@ export declare function renderText(layer: TypeLayer, env: TextEnv): {
48
48
  /** The layer drawn again (`rendering` and `missingFonts` updated); refuses when nothing can draw it. */
49
49
  export declare function rerenderText(layer: TypeLayer, env: TextEnv): TypeLayer;
50
50
  /** Fields of `TextStyle` an edit can set (`null` clears an optional one). */
51
- export declare const TEXT_STYLE_FIELDS: readonly ["fontFamily", "fontWeight", "italic", "fontSize", "color", "opacity", "tracking", "leading", "baselineShift", "underline", "strikethrough"];
51
+ export declare const TEXT_STYLE_FIELDS: readonly ["fontFamily", "fontWeight", "italic", "fontSize", "color", "opacity", "tracking", "leading", "baselineShift", "underline", "strikethrough", "postScriptName"];
52
52
  /** `base` with the given style fields changed, validated (`null` clears leading, tracking, …). */
53
53
  export declare function patchTextStyle(base: TextStyle, patch: Record<string, unknown>, path?: string): TextStyle;
54
54
  export declare const PARAGRAPH_STYLE_FIELDS: readonly ["align", "autoLeading", "firstLineIndent", "startIndent", "endIndent", "spaceBefore", "spaceAfter"];
@@ -7,7 +7,7 @@ var _chunkVKF3PWKRcjs = require('../chunk-VKF3PWKR.cjs');
7
7
 
8
8
 
9
9
 
10
- var _chunkV4GUQCDZcjs = require('../chunk-V4GUQCDZ.cjs');
10
+ var _chunkO3ZU6QIZcjs = require('../chunk-O3ZU6QIZ.cjs');
11
11
  require('../chunk-A2IS7EHE.cjs');
12
12
 
13
13
 
@@ -1627,11 +1627,11 @@ function header(state, options) {
1627
1627
  return out;
1628
1628
  }
1629
1629
  function serializePaintDocument(state, options = {}) {
1630
- const { layers, assets } = _chunkV4GUQCDZcjs.serializeLayers.call(void 0, state.layers);
1630
+ const { layers, assets } = _chunkO3ZU6QIZcjs.serializeLayers.call(void 0, state.layers);
1631
1631
  return { ...header(state, options), layers, assets };
1632
1632
  }
1633
1633
  async function serializePaintDocumentExternal(state, store, options = {}) {
1634
- const { layers, assets } = await _chunkV4GUQCDZcjs.serializeLayersExternal.call(void 0, state.layers, store);
1634
+ const { layers, assets } = await _chunkO3ZU6QIZcjs.serializeLayersExternal.call(void 0, state.layers, store);
1635
1635
  return { ...header(state, options), layers, assets };
1636
1636
  }
1637
1637
  function paintLayersOnly(layers, problems) {
@@ -1668,7 +1668,7 @@ function deserializePaintDocument(raw) {
1668
1668
  const canvas = normalizeCanvas({ width: r.width, height: r.height, dpi: _nullishCoalesce(r.dpi, () => ( void 0)) });
1669
1669
  const paper = _chunkBXMIBMVGcjs.normalizePaper.call(void 0, _nullishCoalesce(r.paper, () => ( {})));
1670
1670
  const assets = r.assets && typeof r.assets === "object" ? r.assets : {};
1671
- const layers = paintLayersOnly(_chunkV4GUQCDZcjs.deserializeLayers.call(void 0, r.layers, { assets, problems }), problems);
1671
+ const layers = paintLayersOnly(_chunkO3ZU6QIZcjs.deserializeLayers.call(void 0, r.layers, { assets, problems }), problems);
1672
1672
  const wanted = typeof r.activeLayerId === "string" ? r.activeLayerId : null;
1673
1673
  const activeLayerId = wanted && _chunkHGTDMKNEcjs.findLayer.call(void 0, layers, wanted) ? wanted : _nullishCoalesce(_optionalChain([_chunkHGTDMKNEcjs.flattenLayers.call(void 0, layers), 'access', _70 => _70.filter, 'call', _71 => _71((l) => l.type === "pixel"), 'access', _72 => _72.pop, 'call', _73 => _73(), 'optionalAccess', _74 => _74.id]), () => ( null));
1674
1674
  const wetEvents = Array.isArray(r.wetEvents) ? r.wetEvents.filter((e) => e && typeof e === "object" && Number.isInteger(e.clock) && typeof e.kind === "string") : [];
@@ -1682,7 +1682,7 @@ async function deserializePaintDocumentAsync(raw, store) {
1682
1682
  if (!raw || typeof raw !== "object") throw new Error("Not a paint document: expected a JSON object.");
1683
1683
  const r = raw;
1684
1684
  const problems = [];
1685
- const assets = await _chunkV4GUQCDZcjs.resolveExternalAssets.call(void 0, _nullishCoalesce(r.assets, () => ( {})), store, problems);
1685
+ const assets = await _chunkO3ZU6QIZcjs.resolveExternalAssets.call(void 0, _nullishCoalesce(r.assets, () => ( {})), store, problems);
1686
1686
  const loaded = deserializePaintDocument({ ...r, assets });
1687
1687
  return { ...loaded, problems: [...problems, ...loaded.problems] };
1688
1688
  }
@@ -5346,7 +5346,7 @@ var PaintEditorController = (_class10 = class _PaintEditorController {
5346
5346
  return next.type === "group" ? { ...next, children: toStandard(next.children) } : next;
5347
5347
  });
5348
5348
  const layers = toStandard(dried);
5349
- const result = _chunkV4GUQCDZcjs.exportPsd.call(void 0, { width, height, layers: [paperLayer, ...layers], merged, resolution: dpi });
5349
+ const result = _chunkO3ZU6QIZcjs.exportPsd.call(void 0, { width, height, layers: [paperLayer, ...layers], merged, resolution: dpi });
5350
5350
  for (const [mode, names] of changed) {
5351
5351
  const label = _nullishCoalesce(_optionalChain([_chunkCWM3CUUXcjs.BLEND_MODES, 'access', _268 => _268.find, 'call', _269 => _269((m) => m.id === mode), 'optionalAccess', _270 => _270.label]), () => ( mode));
5352
5352
  const std = _nullishCoalesce(_optionalChain([_chunkCWM3CUUXcjs.BLEND_MODES, 'access', _271 => _271.find, 'call', _272 => _272((m) => m.id === _chunkCWM3CUUXcjs.standardBlendMode.call(void 0, mode)), 'optionalAccess', _273 => _273.label]), () => ( _chunkCWM3CUUXcjs.standardBlendMode.call(void 0, mode)));
@@ -7,7 +7,7 @@ import {
7
7
  resolveExternalAssets,
8
8
  serializeLayers,
9
9
  serializeLayersExternal
10
- } from "../chunk-QKREDTPW.js";
10
+ } from "../chunk-6UZCFD7Y.js";
11
11
  import "../chunk-3CI7FRMK.js";
12
12
  import {
13
13
  EffectRendererPool
@@ -4362,7 +4362,7 @@ function createVideoEditorToolProvider(controller, options = {}) {
4362
4362
  const setTransition = {
4363
4363
  name: "set_video_transition",
4364
4364
  title: "Set a transition",
4365
- description: "Sets (or with null removes) the transition into a clip from the clip that ends where it starts on the same track (one undo step). Every type but dip plays half before and half after the cut, so both clips need that much media past the cut; when they do not, the error says the longest that fits. Returns the clip.",
4365
+ description: "Sets (or with null removes) a built-in transition into a clip from the clip that ends where it starts on the same track: crossfade (a cross dissolve), dip to a colour, wipe, push, slide or iris. One undo step. Use set_video_effect_transition only for a transition effect from the effects provider. Every type but dip plays half before and half after the cut, so both clips need that much media past the cut; when they do not, the error says the longest that fits. Returns the clip.",
4366
4366
  inputSchema: object({ clip: { ...CLIP_ID, description: "The incoming clip (the one after the cut)." }, transition: { anyOf: [TRANSITION, { type: "null" }], description: "The transition, or null to remove it." } }, ["clip", "transition"]),
4367
4367
  annotations: { title: "Set a transition", ...WRITE_IDEMPOTENT },
4368
4368
  handler: ({ clip, transition }) => apply({ op: "set_transition", clip, transition }, transition ? "Set transition" : "Remove transition", (r) => ({ clip: clipOut(r.project, clip) }))
@@ -4757,7 +4757,7 @@ function createVideoEffectsToolProvider(controller, options = {}) {
4757
4757
  {
4758
4758
  name: "set_video_effect_transition",
4759
4759
  title: "Set an effect transition",
4760
- description: `Sets a provider transition effect (search_effects with use transition) into a clip from the clip that ends where it starts on the same track, centred on the cut; like a crossfade it needs half its length in media past the cut on both sides. Replaces any transition there. One undo step. Returns the clip's effects. Remove it with remove_effect (effect "transition") or set_video_transition null.`,
4760
+ description: `Sets a transition effect from the effects provider (search_effects with use transition) into a clip from the clip that ends where it starts on the same track, centred on the cut. For the built-in crossfade (cross dissolve), dip, wipe, push, slide and iris use set_video_transition instead. It needs half its length in media past the cut on both sides. Replaces any transition there. One undo step. Returns the clip's effects. Remove it with remove_effect (effect "transition") or set_video_transition null.`,
4761
4761
  inputSchema: {
4762
4762
  type: "object",
4763
4763
  properties: {
@@ -4362,7 +4362,7 @@ function createVideoEditorToolProvider(controller, options = {}) {
4362
4362
  const setTransition = {
4363
4363
  name: "set_video_transition",
4364
4364
  title: "Set a transition",
4365
- description: "Sets (or with null removes) the transition into a clip from the clip that ends where it starts on the same track (one undo step). Every type but dip plays half before and half after the cut, so both clips need that much media past the cut; when they do not, the error says the longest that fits. Returns the clip.",
4365
+ description: "Sets (or with null removes) a built-in transition into a clip from the clip that ends where it starts on the same track: crossfade (a cross dissolve), dip to a colour, wipe, push, slide or iris. One undo step. Use set_video_effect_transition only for a transition effect from the effects provider. Every type but dip plays half before and half after the cut, so both clips need that much media past the cut; when they do not, the error says the longest that fits. Returns the clip.",
4366
4366
  inputSchema: object({ clip: { ...CLIP_ID, description: "The incoming clip (the one after the cut)." }, transition: { anyOf: [TRANSITION, { type: "null" }], description: "The transition, or null to remove it." } }, ["clip", "transition"]),
4367
4367
  annotations: { title: "Set a transition", ...WRITE_IDEMPOTENT },
4368
4368
  handler: ({ clip, transition }) => apply({ op: "set_transition", clip, transition }, transition ? "Set transition" : "Remove transition", (r) => ({ clip: clipOut(r.project, clip) }))
@@ -4757,7 +4757,7 @@ function createVideoEffectsToolProvider(controller, options = {}) {
4757
4757
  {
4758
4758
  name: "set_video_effect_transition",
4759
4759
  title: "Set an effect transition",
4760
- description: `Sets a provider transition effect (search_effects with use transition) into a clip from the clip that ends where it starts on the same track, centred on the cut; like a crossfade it needs half its length in media past the cut on both sides. Replaces any transition there. One undo step. Returns the clip's effects. Remove it with remove_effect (effect "transition") or set_video_transition null.`,
4760
+ description: `Sets a transition effect from the effects provider (search_effects with use transition) into a clip from the clip that ends where it starts on the same track, centred on the cut. For the built-in crossfade (cross dissolve), dip, wipe, push, slide and iris use set_video_transition instead. It needs half its length in media past the cut on both sides. Replaces any transition there. One undo step. Returns the clip's effects. Remove it with remove_effect (effect "transition") or set_video_transition null.`,
4761
4761
  inputSchema: {
4762
4762
  type: "object",
4763
4763
  properties: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pixerate/editor",
3
- "version": "0.140.1",
3
+ "version": "0.140.3",
4
4
  "description": "UI-agnostic rich text and media editing core library",
5
5
  "author": "Pixerate",
6
6
  "license": "MIT",
@@ -251,7 +251,7 @@ and every write tool is refused with the reason.
251
251
  | `update_effect` | Change an applied effect: `values` merged over its own (null resets a control), `enabled`, `opacity`, `index` (reorder). For `generator` and `transition` only `values`. Returns the effect now. |
252
252
  | `remove_effect` | Take an effect off a clip (`transition` removes an effect transition; an effect clip is deleted with `delete_video_clips`). Returns what was removed and what is left. |
253
253
  | `add_video_effect_clip` | Put a generator, title or overlay effect on a video `track` as a clip filling the frame (`start`, `duration` default the effect's own length, `values`, `mode`). Transparent effects show the tracks beneath. Returns the clip id. |
254
- | `set_video_effect_transition` | Use a provider transition effect into a `clip` from the one ending where it starts (`duration` centred on the cut, `values`). Needs handles like a crossfade. |
254
+ | `set_video_effect_transition` | Use a transition effect from the effects provider into a `clip` from the one ending where it starts (`duration` centred on the cut, `values`). Needs handles like a crossfade. For a cross dissolve, dip, wipe, push, slide or iris use the built-in `set_video_transition` instead. |
255
255
  | `set_video_effect_keyframes` | Animate one number `control` of a clip effect (or an effect clip's `generator`) with `keys` in clip ms, or `null` to stop animating it. |
256
256
 
257
257
  ## Pitfalls