typograph-editor-documentation
    Preparing search index...

    Release Notes - Version 1.0.0-20261027

    Replacing placed pictures from a host without losing how they fit their frame.

    • set_manifest_data() can replace pictures and keep their fit. A new value for its second argument, 'refit', keeps an image set to Scale to fit or Scale to fill in that mode, recomputed for the new picture, and gives an image the user sized by hand Scale to fill. The new picture always keeps its own proportions, and an alignment the user chose stays. A third argument, 'Scale_to_Fit', gives images sized by hand Scale to fit instead:

      await doc.set_manifest_data(manifest, 'refit');
      await doc.set_manifest_data(manifest, 'refit', 'Scale_to_Fit');

      set_manifest_url(url, replace, preserve_geometry, refit_scale) takes the same values.

      Before, false turned every replaced picture into Scale to fit, also one set to Scale to fill, and true drew a new picture with other proportions stretched into an image the user had sized by hand. true (the default) and false behave as before.

      refit_scale is an argument, never a key in the manifest: the manifest's shape belongs to the document schema, which refuses a key it does not know.

    • TYP-1206, canvas #224: PageElementImage.set_asset() (canvas src/page.ts) takes 'refit' and a refit_scale; set_manifest_data(), set_manifest_url() and refresh_image_asset() (src/typograph_document.ts) pass them on, to grouped images too. Like true, 'refit' leaves an image that already shows the same web_url alone. See canvas docs/HostContract.md, "Replacing placed pictures".
    • Nothing in the editor calls set_manifest_data() with false or 'refit'; this is for hosts.
    • Canvas pin: c21e042 → 9cb2588 (canvas #224 only). canvas-service moves to the same commit.
    • docs-ui #129 documents 'refit' in the editor integration guide; it merges once this release is live.