# Public API Contract

Product name: UnifiedSlide  
Native work file extension: `.usldx`  
Public AMD entry: `scripts/main.js`

## Host boundary

Hosts use `createControl`, `createEditorControl`, `createWorkbenchControl`, or
`createViewerControl`.  Hosts should not access internal canvas DOM, toolbar
buttons or Demo shell elements directly.

## Command contract

Commands are owned by `CommandRegistry` and can be executed through
`control.exec(commandId, args)`.  This build preserves current short legacy ids
and adds package-prefixed aliases for Host integration.

Examples:

- `unifiedSlide.file.open`
- `unifiedSlide.file.save`
- `unifiedSlide.file.saveAs`
- `unifiedSlide.file.import`
- `unifiedSlide.file.export`
- `unifiedSlide.slide.add`
- `unifiedSlide.format.bold`
- `unifiedSlide.script.open`
- `unifiedSlide.pptx.compatibilityReport`

Menu, toolbar and context-menu descriptors reference command ids and do not own
operation logic.

## Contribution contract

- `getMenuContributions({ surface, mode })`
- `getToolbarContributions({ surface, mode, density })`
- `getContextMenuContributions({ selection })`
- `getFileCapabilities()`

For `surface: 'oneEditor'`, the File menu contribution is omitted by default so
the integrated Host can own the File menu UI and delegate to current Control
commands/capabilities.  Passing `includeFileMenu: true` includes it.


## UnifiedControl dependency

Host/Demo configures `UnifiedControl` as a RequireJS alias to the shared Control Framework package. UnifiedSlide does not copy UnifiedControl into this ZIP.

```js
require.config({
  paths: {
    UnifiedControl: 'https://cdn.skylarkjs.com/itoolkits/developments/UnifiedControl/scripts',
    UnifiedSlide: '<UnifiedSlidePackageRoot>/scripts'
  }
});
```


## alpha36-fix11 File Payload Contract

Host/Workbench code must call `OpenFile` only to acquire a file and `SaveFile` only to persist generated data. Parsing and data generation are exposed through `EditorControl.openFile`, `saveFile`, `saveAsFile`, and `exportFile`.
