Function applyDrawingSettings

  • Turn { 'style.color': '#f00', 'text.value': 'Hi', zIndex: 2 } into the partial a controller's update accepts. Bags come back whole (style: { ...d.style, color }), so it does not matter whether the controller merges or replaces them. A value of undefined removes the key, which is how a host offers "reset to default".

    With a schema, each value is coerced to its field's kind and any path the schema does not declare is dropped: a host can hand over its form state as is. Without one, values are written verbatim. Paths the model has no home for are ignored either way.

    Parameters

    Returns Partial<Drawing>