# Partial state imports: template, theme and named sections

## Problem found

The modular state format already exposed a `scope`, but explicit partial scopes inherited the full-state defaults for omitted branches. Importing only `appearance.theme` from a full JSON could therefore also restore layout, modules or document data.

The theme itself was not serialized in the modular appearance payload either: only application defaults were present. In addition, the State module used its selected scope for export but not consistently for import.

## Public API

Named helpers now expose the supported durable sections:

```ts
const template = designer.util.state.exportPart('template');
designer.util.state.importPart('template', template);

const fullState = designer.util.state.exportFull();
designer.util.state.importPart('theme', fullState);
```

Supported names:

- `template`
- `theme`
- `layout`
- `modules`
- `document`
- `catalog`
- `pricing`
- `tools`
- `behavior`
- `configuration`
- `permissions`

## Semantics

- An explicit scope is strictly opt-in. Every omitted branch is false.
- `theme` changes only the active theme tokens and does not rebuild Fabric or Babylon.
- `template` restores the reusable editor/template structure and document while preserving the consumer theme, pricing, permissions, integrations and history.
- `document` restores the mixed 2D/3D document and the element catalog required by its 3D products.
- Non-document imports do not enter the canvas restoration guard and cannot clear a mounted canvas.
- The State module applies the selected preset to both export and import.

## Validation

Tests cover:

- theme-only import from a complete full-state JSON;
- template import with preservation of unrelated state;
- independent catalog, pricing and configuration imports;
- self-describing exported part scopes;
- mirrored `src/` and `pass/src/` implementations.
