@@ -172,10 +181,10 @@ The LLM will automatically invoke tools based on your prompts. Here is an exampl
- **Tips:**
+**Tips:**
- - Ask the LLM to "*list MCP tools*".
- - If you have multiple MCP servers, say: "*Use the MCP server named Adobe Express Add-on*".
+- Ask the LLM to "_list MCP tools_".
+- If you have multiple MCP servers, say: "_Use the MCP server named Adobe Express Add-on_".
@@ -187,27 +196,27 @@ The **Adobe Express Add-on MCP Server** excels at both helping with answering qu
#### Documentation & Learning
-- "*How do I create and style text in Adobe Express*?"
-- "*What are the steps for implementing drag-and-drop functionality*?"
-- "*How does the Document API work for manipulating elements*?"
-- "*Show me examples of using the color picker component*?"
+- "_How do I create and style text in Adobe Express_?"
+- "_What are the steps for implementing drag-and-drop functionality_?"
+- "_How does the Document API work for manipulating elements_?"
+- "_Show me examples of using the color picker component_?"
#### Code Generation & Implementation
-- "*Implement a color picker in my add-on*"
-- "*Generate code to create a text element with custom styling*"
-- "*Build a drag-and-drop interface for uploading images*"
-- "*Create a button that adds a rectangle to the canvas*"
-- "*Write TypeScript code to handle user text input and apply it to the document*"
-- "*Implement an image import feature with file validation*"
-- "*Show me a sample code snippet for using a modal dialog*"
+- "_Implement a color picker in my add-on_"
+- "_Generate code to create a text element with custom styling_"
+- "_Build a drag-and-drop interface for uploading images_"
+- "_Create a button that adds a rectangle to the canvas_"
+- "_Write TypeScript code to handle user text input and apply it to the document_"
+- "_Implement an image import feature with file validation_"
+- "_Show me a sample code snippet for using a modal dialog_"
#### Debugging & Troubleshooting
-- "*Why isn't my add-on loading in Adobe Express?*"
-- "*Why isn't my text element appearing on the canvas?*"
-- "*Debug this error when trying to add an image to the document (error message: ...)*"
-- "*How do I debug an issue in my `code.js` file?*"
+- "_Why isn't my add-on loading in Adobe Express?_"
+- "_Why isn't my text element appearing on the canvas?_"
+- "_Debug this error when trying to add an image to the document (error message: ...)_"
+- "_How do I debug an issue in my `code.js` file?_"
## Best Practices for Effective Use
@@ -227,28 +236,28 @@ The **Adobe Express Add-on MCP Server** excels at both helping with answering qu
**Example of a well-structured prompt:**
- > "*I'm building an Adobe Express add-on using JavaScript/TypeScript and React with a UI based on Spectrum Web Components using the Express theme. My user interface needs a text field, a button, a modal dialog and a color picker. Please generate the code and show me how to set it up using the Adobe Add-on CLI.*"
+ > "_I'm building an Adobe Express add-on using JavaScript/TypeScript and React with a UI based on Spectrum Web Components using the Express theme. My user interface needs a text field, a button, a modal dialog and a color picker. Please generate the code and show me how to set it up using the Adobe Add-on CLI._"
**Key elements to include:**
- - **Programming languages**: JavaScript, TypeScript
- - **Framework**: React
- - **UI components**: Spectrum Web Components with Express theme using [swc-react](https://opensource.adobe.com/spectrum-web-components/using-swc-react/)
- - **Specific components needed**: Modal dialog, color picker, buttons, etc.
- - **Build tools**: Adobe Add-on CLI for setup and development
+ - **Programming languages**: JavaScript, TypeScript
+ - **Framework**: React
+ - **UI components**: Spectrum Web Components with Express theme using [swc-react](https://opensource.adobe.com/spectrum-web-components/using-swc-react/)
+ - **Specific components needed**: Modal dialog, color picker, buttons, etc.
+ - **Build tools**: Adobe Add-on CLI for setup and development
### 2. Craft Effective Prompts
- - **Be Specific**: "*Add a stroke to a rectangle*" vs "*Style shapes*"
- - **Include Context**: "*I'm building a text editor add-on*" helps narrow results
- - **Use Technical Terms**: "*text styling*" vs "*make it look good*"
- - **Ask for Examples**: "*Show me code examples for text manipulation*"
- - **Request Code Generation**: "*Generate TypeScript code to...*" or "*Implement a feature that...*"
+- **Be Specific**: "_Add a stroke to a rectangle_" vs "_Style shapes_"
+- **Include Context**: "_I'm building a text editor add-on_" helps narrow results
+- **Use Technical Terms**: "_text styling_" vs "_make it look good_"
+- **Ask for Examples**: "_Show me code examples for text manipulation_"
+- **Request Code Generation**: "_Generate TypeScript code to..._" or "_Implement a feature that..._"
### 3. Manage Your Sessions
- **Keep Sessions Focused**: Start new conversations for different features or topics
-- **Be Explicit**: Tell the agent "*For Adobe Express Add-ons questions, prefer the Adobe Express Add-on MCP tools and cite sources.*"
+- **Be Explicit**: Tell the agent "_For Adobe Express Add-ons questions, prefer the Adobe Express Add-on MCP tools and cite sources._"
- **Provide Context**: Mention what you're building and your current progress
- **Iterate Gradually**: Build features step-by-step rather than asking for complete applications
- **Avoid Getting Stuck in Debugging Loops**:
@@ -271,7 +280,7 @@ Custom rules can help guide your LLM's responses, but they require careful desig
- Rules that focus on "never do X" or "cannot do Y" can backfire
- LLMs may over-prioritize avoiding the restriction and neglect coding fundamentals
- - Instead of "*Never use inline styles*," try "*Prefer CSS classes and external stylesheets for maintainability*"
+ - Instead of "_Never use inline styles_," try "_Prefer CSS classes and external stylesheets for maintainability_"
#### 4.1 Example Rules for Cursor
@@ -279,7 +288,7 @@ Here are some example rules that have proven helpful for Adobe Express add-on de
```text
- Use adobe-express-add-on MCP server for questions about Express Add-ons, Express API, CLI, and SDK before web search.
- - Add-ons are bundled and served in the browser as an iFrame.
+ - Add-ons are bundled and served in the browser as an iFrame.
- Both the Add-on UI and "Express document sandbox" are isolated and must communicate through a proxy layer.
- The term "document" most often refers to terminology related to Express Add-ons since the regular browser DOM isn't available in the sandboxed environment.
```
@@ -292,47 +301,47 @@ Consider using the following tips in your prompts/rules for LLM guidance when us
- **🤖 LLM Guidance:**
+**🤖 LLM Guidance:**
+
+- **CRITICAL:** All `@spectrum-web-components/*` packages MUST use identical versions
+- **REQUIRED theme imports:**
- - **CRITICAL:** All `@spectrum-web-components/*` packages MUST use identical versions
- - **REQUIRED theme imports:**
+ `import '@spectrum-web-components/theme/express/theme-light.js';`
+ `import '@spectrum-web-components/theme/express/scale-medium.js';`
+ `import '@spectrum-web-components/theme/sp-theme.js';`
- `import '@spectrum-web-components/theme/express/theme-light.js';`
- `import '@spectrum-web-components/theme/express/scale-medium.js';`
- `import '@spectrum-web-components/theme/sp-theme.js';`
+- Wrap app with: ``
+- **ALWAYS** check `package.json` for version consistency across **ALL** `@spectrum-web-components/*` packages
+- **Use Related References:**
- - Wrap app with: ``
- - **ALWAYS** check `package.json` for version consistency across **ALL** `@spectrum-web-components/*` packages
- - **Use Related References:**
+ - [Spectrum Web Components Documentation](https://opensource.adobe.com/spectrum-web-components/index.html)
+ - [Using Spectrum Web Components in a basic JavaScript add-on](https://developer.adobe.com/express/add-ons/docs/guides/learn/how_to/tutorials/spectrum-workshop/part1)
+ - [Adobe Express Add-on UI Implementation Guide](https://developer.adobe.com/express/add-ons/docs/guides/build/design/implementation_guide/)
- - [Spectrum Web Components Documentation](https://opensource.adobe.com/spectrum-web-components/index.html)
- - [Using Spectrum Web Components in a basic JavaScript add-on](https://developer.adobe.com/express/add-ons/docs/guides/learn/how_to/tutorials/spectrum-workshop/part1)
- - [Adobe Express Add-on UI Implementation Guide](https://developer.adobe.com/express/add-ons/docs/guides/build/design/implementation_guide/)
-
#### Using [swc-react: React Wrappers for SWC](https://opensource.adobe.com/spectrum-web-components/using-swc-react/) (only for add-ons using React)
- **🤖 LLM Guidance:**
+**🤖 LLM Guidance:**
+
+- **MANDATORY:** Use `@swc-react/*` components (NOT React Spectrum)
+- **CRITICAL:** All `@swc-react/*` packages MUST use identical versions
+- **REQUIRED theme setup:**
- - **MANDATORY:** Use `@swc-react/*` components (NOT React Spectrum)
- - **CRITICAL:** All `@swc-react/*` packages MUST use identical versions
- - **REQUIRED theme setup:**
+ `import '@spectrum-web-components/theme/express/theme-light.js';`
+ `import '@spectrum-web-components/theme/express/scale-medium.js';`
+ `import { Theme } from '@swc-react/theme';`
- `import '@spectrum-web-components/theme/express/theme-light.js';`
- `import '@spectrum-web-components/theme/express/scale-medium.js';`
- `import { Theme } from '@swc-react/theme';`
-
- - Wrap app with: ``
- - **ALWAYS** check `package.json` for version consistency across **ALL** `@swc-react/*` packages
- - **Use Related References:**
+- Wrap app with: ``
+- **ALWAYS** check `package.json` for version consistency across **ALL** `@swc-react/*` packages
+- **Use Related References:**
- - [Using swc-react](https://opensource.adobe.com/spectrum-web-components/using-swc-react/)
- - [Using Spectrum Web Components in a React-based add-on with swc-react](https://developer.adobe.com/express/add-ons/docs/guides/learn/how_to/tutorials/spectrum-workshop/part2)
- - [Adobe Express Add-on UI Implementation Guide](https://developer.adobe.com/express/add-ons/docs/guides/build/design/implementation_guide/)
- - [React Synthetic Events Issue](https://github.com/facebook/react/issues/19846)
+ - [Using swc-react](https://opensource.adobe.com/spectrum-web-components/using-swc-react/)
+ - [Using Spectrum Web Components in a React-based add-on with swc-react](https://developer.adobe.com/express/add-ons/docs/guides/learn/how_to/tutorials/spectrum-workshop/part2)
+ - [Adobe Express Add-on UI Implementation Guide](https://developer.adobe.com/express/add-ons/docs/guides/build/design/implementation_guide/)
+ - [React Synthetic Events Issue](https://github.com/facebook/react/issues/19846)
@@ -340,45 +349,45 @@ Consider using the following tips in your prompts/rules for LLM guidance when us
- **Server Won't Start**
+**Server Won't Start**
- - ✅ Check Node.js version: `node --version` (needs 18+)
- - ✅ Verify MCP config JSON syntax and file location
- - ✅ Ensure firewall allows `npx` downloads
- - ✅ Restart your IDE after configuration changes
- - ✅ Check for MCP server status indicators
+- ✅ Check Node.js version: `node --version` (needs 18+)
+- ✅ Verify MCP config JSON syntax and file location
+- ✅ Ensure firewall allows `npx` downloads
+- ✅ Restart your IDE after configuration changes
+- ✅ Check for MCP server status indicators
- **No Documentation Results**
+**No Documentation Results**
- - ✅ Use specific technical terms ("text styling" vs "make it pretty")
- - ✅ Try adding "Adobe Express Add-ons" for an additional context cue
- - ✅ Try broader queries first, then narrow down
- - ✅ Ask the agent to "use available tools" explicitly
- - ✅ Include context about what you're building
+- ✅ Use specific technical terms ("text styling" vs "make it pretty")
+- ✅ Try adding "Adobe Express Add-ons" for an additional context cue
+- ✅ Try broader queries first, then narrow down
+- ✅ Ask the agent to "use available tools" explicitly
+- ✅ Include context about what you're building
- **Poor Code Generation**
+**Poor Code Generation**
- - ✅ Be specific about what you want to implement
- - ✅ Mention the programming language and frameworks (TypeScript/JavaScript, React)
- - ✅ Provide context about your add-on's purpose
- - ✅ Ask for complete, working examples
+- ✅ Be specific about what you want to implement
+- ✅ Mention the programming language and frameworks (TypeScript/JavaScript, React)
+- ✅ Provide context about your add-on's purpose
+- ✅ Ask for complete, working examples
- **Missing Type Definitions**
+**Missing Type Definitions**
- - ✅ Specify the correct API surface (`iframe-ui`, `express-document-sdk`, `add-on-sdk-document-sandbox`)
- - ✅ Ask for specific types rather than general requests
+- ✅ Specify the correct API surface (`iframe-ui`, `express-document-sdk`, `add-on-sdk-document-sandbox`)
+- ✅ Ask for specific types rather than general requests
@@ -410,7 +419,7 @@ Consider using the following tips in your prompts/rules for LLM guidance when us
#### Q: Is it free?
-**A:** Yes, free during and after beta.
+**A:** Yes.
#### Q: Do I need to install anything locally?
diff --git a/src/pages/guides/learn/fundamentals/document-sandbox-constants.md b/src/pages/guides/learn/fundamentals/document-sandbox-constants.md
new file mode 100644
index 000000000..48582447c
--- /dev/null
+++ b/src/pages/guides/learn/fundamentals/document-sandbox-constants.md
@@ -0,0 +1,413 @@
+---
+keywords:
+ - Adobe Express
+ - Express Add-on SDK
+ - Document Sandbox
+ - Document APIs
+ - Constants
+ - Type safety
+ - JavaScript
+ - TypeScript
+ - Document constants
+ - Fill types
+ - Stroke types
+ - Text alignment
+ - Blend modes
+ - Scene node types
+ - Content creation
+ - Document manipulation
+title: Using Document Sandbox Constants
+description: A comprehensive guide to using constants in the Document Sandbox environment for
+ type-safe document manipulation, covering fill types, text styling, blend modes, and node types.
+contributors:
+ - https://github.com/hollyschinsky
+faq:
+ questions:
+ - question: "Why can't I access document constants from the UI?"
+ answer: "Document constants are only available in the Document Sandbox (code.js) for security isolation. UI and Document environments are separate - use communication APIs to pass data between them."
+
+ - question: "How do I import document constants?"
+ answer: "Use import { constants } from express-document-sdk in your code.js file. Access them as constants.FillType.color, constants.BlendMode.normal, etc."
+
+ - question: "What's the difference between UI SDK constants and Document Sandbox constants?"
+ answer: "UI SDK constants are for iframe operations (dialogs, exports, events). Document constants are for content creation (fills, strokes, text alignment, node types)."
+
+ - question: "Can I use FillType.gradient or other fill types?"
+ answer: "Currently, only FillType.color is available. Adobe Express may add more fill types in future releases."
+
+ - question: "How do I check if a node supports fills or strokes?"
+ answer: "Check the node type first using constants.SceneNodeType before applying fill or stroke properties."
+
+ - question: "Why does my blend mode not work?"
+ answer: "Ensure you're applying blend modes to visual nodes and using valid constants like constants.BlendMode.multiply. Not all nodes support all blend modes."
+
+ - question: "How do I pass constants from Document Sandbox to UI?"
+ answer: "Document constants are sandbox-only. If you need constant values in the UI, pass the actual string values through communication APIs rather than the constants themselves."
+
+ - question: "What constants should I use for text alignment?"
+ answer: "Use constants.TextAlignment.left, constants.TextAlignment.center, constants.TextAlignment.right, or constants.TextAlignment.justifyLeft."
+
+ - question: "How do I create colors for use with constants?"
+ answer: "Use colorUtils.fromRGB or colorUtils.fromHex to create Color objects. Import with: import { colorUtils } from express-document-sdk."
+# LLM optimization metadata
+canonical: true
+ai_assistant_note: "This guide focuses specifically on Document Sandbox constants used in the
+ document sandbox environment (code.js). For UI SDK constants, refer to the Add-on UI SDK Constants guide.
+ Covers document-specific constants like FillType, StrokeType, TextAlignment, BlendMode, and SceneNodeType."
+semantic_tags:
+ - document-sandbox-constants
+ - document-environment
+ - content-creation
+ - document-manipulation
+ - type-safety
+ - practical-guide
+---
+
+# Using Document Sandbox Constants
+
+Document Sandbox constants provide type-safe ways to interact with the Document APIs for content creation like fills, strokes, text styling, and node manipulation. This guide covers the most common patterns for document sandbox development.
+
+## Why Use Constants?
+
+Constants equal their variable name as a string (e.g., `FillType.color` equals `"color"`), but using constants provides type safety, IDE autocomplete, and future-proofing against API changes. They ensure consistency when working with document elements, styling, and content creation.
+
+
+
+Add-on UI vs. Document Sandbox constants
+
+Separate sets of constants are available in both the [Add-on UI](ui-sdk-constants.md) and the Document Sandbox environments. For the complete technical specification on the constants covered in this guide, see the [Document APIs Constants Reference](../../../references/document-sandbox/document-apis/enumerations/ArrowHeadType.md)
+
+## Quick Start
+
+Document constants are available through the constants export in the document sandbox environment:
+
+```javascript
+import { constants } from "express-document-sdk";
+
+// Access constants through the constants object
+const fillType = constants.FillType.color;
+const blendMode = constants.BlendMode.normal;
+const textAlignment = constants.TextAlignment.center;
+```
+
+
+
+**Important**
+
+Document constants are only available in the document sandbox environment (`code.js`). They cannot be accessed from the iframe UI environment.
+
+## Most Common Use Cases
+
+### Fill and Stroke Properties
+
+```javascript
+import { editor, constants } from "express-document-sdk";
+
+// Creating solid color fills
+const rectangle = editor.createRectangle();
+rectangle.fill = {
+ type: constants.FillType.color,
+ color: { red: 1, green: 0, blue: 0, alpha: 1 }
+};
+
+// Adding strokes
+rectangle.stroke = {
+ type: constants.StrokeType.color,
+ color: { red: 0, green: 0, blue: 1, alpha: 1 },
+ width: 2,
+ position: constants.StrokePosition.inside
+};
+```
+
+**Available Fill Types:**
+
+- `FillType.color` - Solid color fills (only available type)
+
+**Available Stroke Types:**
+
+- `StrokeType.color` - Solid color stroke (only available type)
+
+**Available Stroke Positions:**
+
+- `StrokePosition.center` - Stroke centered on edge
+- `StrokePosition.inside` - Stroke inside the shape
+- `StrokePosition.outside` - Stroke outside the shape
+
+### Text Alignment and Styling
+
+```javascript
+import { editor, constants } from "express-document-sdk";
+
+// Creating and styling text
+const textNode = editor.createText();
+textNode.text = "Hello World";
+
+// Set text alignment
+textNode.textAlignment = constants.TextAlignment.center;
+
+// Set text script style
+textNode.textScriptStyle = constants.TextScriptStyle.none;
+```
+
+**Available Text Alignments:**
+
+- `TextAlignment.left` - Left-aligned text
+- `TextAlignment.center` - Center-aligned text
+- `TextAlignment.right` - Right-aligned text
+- `TextAlignment.justifyLeft` - Left-justified text
+
+**Available Text Script Styles:**
+
+- `TextScriptStyle.none` - Normal text (standard baseline)
+- `TextScriptStyle.superscript` - Superscript text
+- `TextScriptStyle.subscript` - Subscript text
+
+### Blend Modes
+
+```javascript
+import { editor, constants } from "express-document-sdk";
+
+// Apply blend modes to visual elements
+const shape = editor.createEllipse();
+shape.blendMode = constants.BlendMode.multiply;
+```
+
+**Common Blend Modes:**
+
+- `BlendMode.normal` - Normal blending
+- `BlendMode.multiply` - Multiply blending
+- `BlendMode.screen` - Screen blending
+- `BlendMode.overlay` - Overlay blending
+- `BlendMode.softLight` - Soft light blending
+- `BlendMode.hardLight` - Hard light blending
+
+### Scene Node Types
+
+```javascript
+import { editor, constants } from "express-document-sdk";
+
+// Check node types when traversing the document
+editor.context.selection.forEach(node => {
+ switch (node.type) {
+ case constants.SceneNodeType.rectangle:
+ console.log("Selected rectangle");
+ break;
+ case constants.SceneNodeType.ellipse:
+ console.log("Selected ellipse");
+ break;
+ case constants.SceneNodeType.imageRectangle:
+ console.log("Selected image");
+ break;
+ case constants.SceneNodeType.unknownMediaRectangle:
+ console.log("Selected media");
+ break;
+ }
+});
+```
+
+**Common Scene Node Types:**
+
+- `SceneNodeType.rectangle` - Rectangle shapes
+- `SceneNodeType.ellipse` - Ellipse/circle shapes
+- `SceneNodeType.text` - Text elements
+- `SceneNodeType.line` - Line elements
+- `SceneNodeType.path` - Custom path shapes
+- `SceneNodeType.group` - Grouped elements
+- `SceneNodeType.imageRectangle` - Image elements
+- `SceneNodeType.unknownMediaRectangle` - Unknown media elements
+
+
+
+Additional node types like `artboard`, `complexShape`, `gridLayout`, and others are available. See the [SceneNodeType Reference](../../../references/document-sandbox/document-apis/enumerations/SceneNodeType.md) for the complete list.
+
+## Working with Colors
+
+When working with fill and stroke properties, you'll need to provide Color objects. Use the `colorUtils` utility from `express-document-sdk` to create colors:
+
+```javascript
+import { editor, constants, colorUtils } from "express-document-sdk";
+
+// Create colors and use with constants
+const rectangle = editor.createRectangle();
+rectangle.fill = {
+ type: constants.FillType.color, // Constant for type safety
+ color: colorUtils.fromHex("#FF0000") // Color from hex string
+};
+
+rectangle.stroke = {
+ type: constants.StrokeType.color,
+ color: colorUtils.fromRGB(0, 0, 1), // Color from RGB values
+ width: 2,
+ position: constants.StrokePosition.inside
+};
+```
+
+
+
+For comprehensive color creation, conversion, and application examples, see the [Use Color Guide](../how_to/use_color.md).
+
+## Common Patterns
+
+### Creating Styled Shapes
+
+```javascript
+import { editor, constants } from "express-document-sdk";
+
+function createStyledRectangle(color, strokeColor) {
+ const rect = editor.createRectangle();
+
+ // Set fill
+ rect.fill = {
+ type: constants.FillType.color,
+ color: color
+ };
+
+ // Set stroke
+ rect.stroke = {
+ type: constants.StrokeType.color,
+ color: strokeColor,
+ width: 2,
+ position: constants.StrokePosition.inside
+ };
+
+ // Set blend mode
+ rect.blendMode = constants.BlendMode.normal;
+
+ return rect;
+}
+```
+
+### Text Formatting
+
+```javascript
+import { editor, constants } from "express-document-sdk";
+
+function createFormattedText(content, alignment = constants.TextAlignment.left) {
+ const textNode = editor.createText();
+ textNode.text = content;
+ textNode.textAlignment = alignment;
+
+ // Apply character styling
+ const characterStyles = {
+ fontSize: 24,
+ fontFamily: "Arial",
+ textScriptStyle: constants.TextScriptStyle.none
+ };
+
+ textNode.setRangeCharacterStyles(0, content.length, characterStyles);
+
+ return textNode;
+}
+```
+
+### Node Type Checking
+
+```javascript
+import { editor, constants } from "express-document-sdk";
+
+function processSelectedNodes() {
+ const selection = editor.context.selection;
+
+ selection.forEach(node => {
+ // Type-safe node processing
+ if (node.type === constants.SceneNodeType.rectangle || node.type === constants.SceneNodeType.ellipse) {
+ // Handle shapes
+ if (node.fill?.type === constants.FillType.color) {
+ console.log("Shape has color fill");
+ }
+ } else if (node.type === constants.SceneNodeType.imageRectangle) {
+ // Handle images
+ console.log("Processing image node");
+ }
+ });
+}
+```
+
+## Common Pitfalls
+
+### Environment Confusion
+
+```javascript
+// ❌ Wrong - Document constants not available in UI
+// In index.html/index.js
+import addOnUISdk from "https://express.adobe.com/static/add-on-sdk/sdk.js";
+const fillType = addOnUISdk.constants.FillType.color; // Error: FillType is not defined
+
+// ✅ Correct - Use in document sandbox only
+// In code.js
+import { constants } from "express-document-sdk";
+const fillType = constants.FillType.color; // Works correctly
+```
+
+### Missing Type Checks
+
+```javascript
+import { constants } from "express-document-sdk";
+
+// ❌ Risky - assuming node type
+function changeColor(node, color) {
+ node.fill = { type: constants.FillType.color, color }; // May fail on non-fillable nodes
+}
+
+// ✅ Safe - check node type first
+function changeColor(node, color) {
+ if (node.type === constants.SceneNodeType.rectangle || node.type === constants.SceneNodeType.ellipse) {
+ node.fill = { type: constants.FillType.color, color };
+ }
+}
+```
+
+## Best Practices
+
+1. **Always use constants** instead of string literals for better type safety
+2. **Check node types** before applying properties that may not be available
+3. **Use meaningful variable names** when working with complex styling
+4. **Group related constants** for better code organization
+5. **Document your styling functions** with the constants they expect
+
+## FAQs
+
+#### Q: Why can't I access document constants from the UI?
+
+**A:** Document constants are only available in the Document Sandbox (`code.js`) for security isolation. UI and Document environments are separate - use communication APIs to pass data between them.
+
+#### Q: How do I import document constants?
+
+**A:** Use `import { constants } from "express-document-sdk"` in your `code.js` file. Access them as `constants.FillType.color`, `constants.BlendMode.normal`, etc.
+
+#### Q: What's the difference between UI SDK constants and Document Sandbox constants?
+
+**A:** UI SDK constants are for iframe operations (dialogs, exports, events). Document constants are for content creation (fills, strokes, text alignment, node types).
+
+#### Q: Can I use `FillType.gradient` or other fill types?
+
+**A:** Currently, only `FillType.color` is available. Adobe Express may add more fill types in future releases.
+
+#### Q: How do I check if a node supports fills or strokes?
+
+**A:** Check the node type first: `if (node.type === constants.SceneNodeType.rectangle || node.type === constants.SceneNodeType.ellipse)` before applying fill/stroke properties.
+
+#### Q: Why does my blend mode not work?
+
+**A:** Ensure you're applying blend modes to visual nodes and using valid constants like `constants.BlendMode.multiply`. Not all nodes support all blend modes.
+
+#### Q: How do I pass constants from Document Sandbox to UI?
+
+**A:** Document constants are sandbox-only. If you need constant values in the UI, pass the actual string values through communication APIs rather than the constants themselves.
+
+#### Q: What constants should I use for text alignment?
+
+**A:** Use `constants.TextAlignment.left`, `constants.TextAlignment.center`, `constants.TextAlignment.right`, or `constants.TextAlignment.justifyLeft`.
+
+#### Q: How do I create colors for use with constants?
+
+**A:** Use `colorUtils.fromRGB(r, g, b, alpha)` or `colorUtils.fromHex("#RRGGBB")` to create Color objects. Import with: `import { colorUtils } from "express-document-sdk"`. See the [Use Color Guide](../how_to/use_color.md) for complete examples.
+
+## Related Documentation
+
+- [Document APIs Reference](../../../references/document-sandbox/document-apis/)
+- [Document APIs Constants](../../../references/document-sandbox/document-apis/enumerations/ArrowHeadType.md)
+- [ColorUtils Reference](../../../references/document-sandbox/document-apis/classes/ColorUtils.md)
+- [Use Color Guide](../how_to/use_color.md) - Comprehensive color workflow examples
+- [Add-on UI SDK Constants](./ui-sdk-constants.md)
+- [Developer Terminology](./terminology.md)
diff --git a/src/pages/guides/learn/fundamentals/terminology.md b/src/pages/guides/learn/fundamentals/terminology.md
new file mode 100644
index 000000000..781958d10
--- /dev/null
+++ b/src/pages/guides/learn/fundamentals/terminology.md
@@ -0,0 +1,592 @@
+---
+keywords:
+ - Adobe Express
+ - Express Add-on SDK
+ - Add-on UI SDK
+ - Document Sandbox
+ - Document APIs
+ - SDK terminology
+ - API reference
+ - Developer glossary
+ - Naming conventions
+ - Import statements
+ - Runtime environments
+ - Communication APIs
+ - JavaScript
+ - TypeScript
+ - Extensibility
+ - Manifest configuration
+ - File structure
+ - Bundle organization
+ - Development workflow
+ - Debugging
+ - Cross-origin isolation
+ - Overloaded terms
+ - Terminology disambiguation
+ - Scope (add-on vs application)
+ - Singleton pattern
+title: Add-on Development Terminology
+description: Essential reference for Adobe Express add-on terminology, SDKs, runtimes,
+ and development concepts. Your go-to guide for understanding the Adobe Express add-on ecosystem.
+contributors:
+ - https://github.com/hollyschinsky
+faq:
+ questions:
+ - question: "What's the difference between Add-on UI SDK and Document APIs?"
+ answer: "The Add-on UI SDK runs in the iframe runtime and handles UI, user interactions, and import/export. Document APIs (via Express Document SDK) run in the document sandbox and handle content creation and document manipulation."
+
+ - question: "Why are there two different runtime environments?"
+ answer: "Security and performance. The iframe runtime is sandboxed for security but has standard Web APIs. The document sandbox has direct access to Adobe Express's document engine but limited Web APIs."
+
+ - question: "Can I use Document APIs directly from the iframe runtime?"
+ answer: "No, Document APIs (Express Document SDK) are only available in the document sandbox for security reasons. You must use the communication system (Document Sandbox SDK) to bridge between environments."
+
+ - question: "When do I use addOnUISdk vs addOnSandboxSdk?"
+ answer: "Use addOnUISdk (Add-on UI SDK) in your iframe runtime code (usually index.html or ui/ folder). Use addOnSandboxSdk (Document Sandbox SDK) in your document sandbox code (usually code.js or sandbox/ folder)."
+
+ - question: "I see references to UI SDK - is this different from Add-on UI SDK?"
+ answer: "No, they're the same. Add-on UI SDK is the full, preferred term for clarity, but UI SDK is commonly used as shorthand throughout the documentation."
+
+ - question: "What's the difference between addOnUISdk.instance and addOnUISdk.app?"
+ answer: "They represent different scopes. instance provides add-on-specific features (runtime, clientStorage, manifest) scoped to YOUR add-on. app provides application-wide features (document, currentUser, ui) shared across Adobe Express. Use instance for add-on-specific features; use app to interact with Adobe Express itself."
+
+ - question: "What is the singleton pattern and why do add-on SDKs use it?"
+ answer: "All Adobe Express add-on SDKs use the singleton pattern - they provide pre-instantiated objects you import and use directly. You never create new instances yourself. This ensures all your code works with the same SDK instances, preventing conflicts and maintaining consistent state. For Express Document SDK specifically, you import lowercase names (editor, colorUtils, constants, fonts, viewport) which are singleton objects, NOT uppercase class names."
+
+ - question: "I'm confused by terms like document, context, runtime, and instance - they seem to mean different things in different places?"
+ answer: "Yes! Many terms in add-on development are overloaded with multiple meanings. Check the Overloaded Terms Clarification table for complete clarification. For example, document can mean: the Adobe Express user's project, editor.documentRoot (scenegraph manipulation), addOnUISdk.app.document (import/export operations), or browser DOM document object (your add-on's HTML). The table provides all meanings with examples for 17 commonly overloaded terms."
+canonical: true
+ai_assistant_note: "This page provides authoritative definitions and relationships
+ for Adobe Express Add-on terminology. Use these standardized terms when helping
+ developers choose between Add-on UI SDK (iframe/UI), Document APIs (content
+ creation), and Communication APIs (connecting the two environments)."
+semantic_tags:
+ - canonical-reference
+ - terminology-authority
+ - sdk-terminology-clarification
+ - import-patterns
+ - runtime-environments
+ - manifest-configuration
+ - file-structure
+ - development-workflow
+ - debugging-guide
+---
+
+# Add-on Development Terminology
+
+A comprehensive guide to Adobe Express add-on terminology, SDKs, runtimes, and development concepts.
+
+## Core Terms
+
+| **Term** | **Related Terms** | **Description** | **Where Used** |
+| -------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------- |
+| **[`addOnUISdk`](../../../references/addonsdk/index.md)** | Add-on UI SDK, UI Runtime, [`instance`](../../../references/addonsdk/addonsdk-instance.md) | Main JavaScript module for UI operations, dialogs, add-on interactions. Access via `addOnUISdk.instance` | iframe runtime |
+| **[`instance`](../../../references/addonsdk/addonsdk-instance.md)** | SDK instance, `runtime`, `clientStorage`, `manifest` | Property providing access to SDK features. Use `addOnUISdk.instance` (iframe) or `addOnSandboxSdk.instance` (document sandbox) | Both environments |
+| **[`editor`](../../../references/document-sandbox/document-apis/classes/Editor.md)** | Document APIs, [`express-document-sdk`](../../../references/document-sandbox/document-apis/index.md) | Core object for creating and manipulating document content | Document sandbox |
+| **Runtime** | iframe, Document Sandbox, panel | JavaScript execution environments where add-on code runs | Both environments |
+| **Document Sandbox** | `documentSandbox` | Secure environment for document manipulation and content creation | Document operations |
+| **Iframe Runtime** | iframe Sandbox, UI Runtime, Panel Runtime | Sandboxed browser environment for add-on UI and user interactions | UI operations |
+| **`constants`** | Enums, Configuration values | Type-safe values for SDK operations. See [UI SDK Constants](../../../references/addonsdk/addonsdk-constants.md) and [Document Constants](../../../references/document-sandbox/document-apis/enumerations/ArrowHeadType.md) | Both environments |
+| **[`colorUtils`](../../../references/document-sandbox/document-apis/classes/ColorUtils.md)** | Color conversion, RGB, Hex colors | Utility functions for creating and converting colors. See [Use Color Guide](../how_to/use_color.md) | Document sandbox |
+| **Communication APIs** | `exposeApi()`, `apiProxy()`, [`runtime`](../../../references/addonsdk/instance-runtime.md) | APIs enabling message passing between iframe and document sandbox. See [Communication APIs Reference](../../../references/document-sandbox/communication/index.md) | Both environments |
+| **Manifest** | `manifest.json`, `entryPoints`, `permissions` | Configuration file defining add-on structure and capabilities. See [Manifest Reference](../../../references/manifest/index.md) | Development setup |
+| **Panel** | Entry point, UI interface | Main add-on interface type for persistent UI panels | `manifest.json` |
+| **Node** | [`BaseNode`](../../../references/document-sandbox/document-apis/classes/BaseNode.md), [`VisualNode`](../../../references/document-sandbox/document-apis/classes/VisualNode.md), scenegraph | Building blocks of documents - pages, shapes, text, images | Document Sandbox |
+| **CORS** | Cross-Origin Resource Sharing | Browser security mechanism controlling cross-origin requests. See [iframe Context & Security](../platform_concepts/context.md#cors) for subdomain handling | iframe runtime, external APIs |
+
+## Overloaded Terms Clarification
+
+Many terms in Adobe Express add-on development have multiple meanings depending on context. This table clarifies the different uses to prevent confusion.
+
+| **Term** | **Usage Context** | **Meaning** | **Example** |
+| --------------- | ---------------------------------- | ----------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------ |
+| **document** | Adobe Express content | The user's creative project/file being edited in Adobe Express | "The document contains 3 pages" |
+| | `editor.documentRoot` | Property accessing the root of the Adobe Express document scenegraph for manipulation | `editor.documentRoot.pages` |
+| | `addOnUISdk.app.document` | Property for import/export operations on Adobe Express document | `app.document.addImage(blob)` |
+| | Browser DOM | The HTML document object representing your add-on's UI webpage | `document.getElementById("button")` |
+| **DOM** | Add-on UI | Document Object Model - your add-on's HTML structure in the iframe | `document.querySelector(".button")` |
+| | Express DOM | Informal term sometimes used for Adobe Express's document structure (prefer "scenegraph") | "Navigate the Express DOM" (better: "Navigate the scenegraph") |
+| **context** | General programming | Execution context or environment where code runs | "The code runs in the browser context" |
+| | `editor.context` | Property of `editor` object providing access to selection, insertion point, and current page | `editor.context.selection` |
+| | iframe/security | Runtime context where add-on UI executes | "iframe runtime context" (see [Context & Security](../platform_concepts/context.md)) |
+| **runtime** | General architecture | JavaScript execution environment (iframe runtime or document sandbox) | "The iframe runtime has standard Web APIs" |
+| | `addOnUISdk.instance.runtime` | Property providing Communication APIs for cross-environment messaging | `runtime.apiProxy("documentSandbox")` |
+| | `addOnSandboxSdk.instance.runtime` | Property providing Communication APIs in document sandbox | `runtime.exposeApi({ ... })` |
+| **instance** | General programming | A single occurrence of a class object created by instantiation | "The rectangle is an instance of `RectangleNode`" |
+| | `addOnUISdk.instance` | Property accessing add-on-specific SDK features (runtime, clientStorage, manifest) | `addOnUISdk.instance.clientStorage` |
+| | `addOnSandboxSdk.instance` | Property accessing document sandbox SDK features | `addOnSandboxSdk.instance.runtime` |
+| | Add-on execution | The running session of your add-on when user opens it | "Each user has their own add-on instance" |
+| **application** | General concept | Your add-on running as software | "The application starts when user opens the panel" |
+| | `addOnUISdk.app` | Property accessing Adobe Express (host application) features | `addOnUISdk.app.currentUser` |
+| | Host application | Adobe Express itself (the platform hosting your add-on) | "The host application provides the document APIs" |
+| **scope** | Variable/function scope | Standard JavaScript concept of where variables/functions are accessible | "The variable is in function scope" |
+| | Add-on scope | Features specific to your add-on instance (via `addOnUISdk.instance`) | `instance.runtime`, `instance.clientStorage` are add-on-scoped |
+| | Application scope | Features shared across Adobe Express (via `addOnUISdk.app`) | `app.document`, `app.currentUser` are application-scoped |
+| **sandbox** | iframe security | Browser iframe sandbox attribute restricting capabilities | "iframe sandbox prevents form submission" |
+| | Document Sandbox | Isolated JavaScript environment for secure document manipulation | "Document sandbox has limited Web APIs" |
+| | `documentSandbox` | Manifest property specifying document sandbox entry file | `"documentSandbox": "code.js"` in manifest |
+| **singleton** | Design pattern | Software pattern ensuring only one instance of a class exists | "The Editor class uses the singleton pattern" |
+| | SDK exports | Pre-instantiated objects you import (not classes to instantiate) | `editor`, `colorUtils`, `fonts` are singletons |
+| **environment** | General architecture | The runtime context where code executes | "iframe environment vs sandbox environment" |
+| | Development | Development setup (local vs production) | "Test in the development environment" |
+| **API** | SDK interface | Methods and properties exposed by Adobe SDKs | "Use the Document API to create shapes" |
+| | Exposed functions | Functions you expose for cross-runtime communication | `runtime.exposeApi({ myFunction: ... })` |
+| | External services | Third-party REST/web APIs your add-on calls | "Call the weather API for data" |
+| **app** | General concept | Short for "application" (your add-on or Adobe Express) | "The app creates rectangles" |
+| | `addOnUISdk.app` | Specific property accessing Adobe Express application features | `addOnUISdk.app.document` |
+| **SDK** | Add-on UI SDK | The iframe runtime SDK for UI and Adobe Express features | `addOnUISdk` |
+| | Document Sandbox SDK | The document sandbox SDK for communication | `addOnSandboxSdk` |
+| | Express Document SDK | The document manipulation SDK with content creation APIs | `express-document-sdk` (imports: `editor`, `colorUtils`) |
+| **panel** | UI component | Your add-on's user interface shown in Adobe Express sidebar | "The panel opens on the right running your add-on" |
+| | `RuntimeType` | String constant for communication targeting | `runtime.apiProxy(RuntimeType.panel)` targets the iframe runtime |
+| | Manifest | Entry point type in manifest configuration | `"type": "panel"` in `entryPoints` |
+| **node** | Scenegraph | Visual element in the Adobe Express document tree (specific term) | "A `RectangleNode` is a node in the scenegraph" |
+| | DOM | HTML element in your add-on's UI (specific term) | `document.getElementById()` returns a DOM node |
+| **element** | General term | Generic word for any item or component (use "node" for precision) | "Add elements to the page" (vague, prefer "Add nodes to the artboard") |
+| | Scenegraph | Informal term for scenegraph nodes (prefer "node") | "Rectangle element" (better: "`RectangleNode`") |
+| | DOM | HTML element in your UI (prefer "DOM node" or "HTML element" for clarity) | `
` element in your add-on's HTML |
+| | Design | Visual design component in Adobe Express UI | "Text elements in your design" (user-facing term) |
+| **exports** | Named exports | ES Module syntax for exporting multiple values from a module. **Requires curly braces `{ }` in import statement** | `export { editor, colorUtils }` → `import { editor } from "..."` |
+| | Default export | ES Module syntax for a single main export from a module. **No curly braces in import statement** | `export default addOnUISdk` → `import addOnUISdk from "..."` |
+| | Module pattern | How SDKs expose functionality: UI SDK uses default, Document SDK uses named | UI SDK: default export; Express Document SDK: named exports |
+| **Web APIs** | Standard browser APIs | JavaScript APIs available in web browsers (fetch, localStorage, Blob, etc.) | "iframe runtime has standard Web APIs" |
+| | Limited in sandbox | Document sandbox only has limited Web APIs (console, Blob) | "Document sandbox has restricted Web APIs" |
+| | vs Browser APIs | Same meaning - standard JavaScript APIs built into browsers | "Web APIs" and "Browser APIs" are interchangeable terms |
+
+### Common Sources of Confusion
+
+**"I need to access the document"** - Which document?
+
+- Adobe Express user's project → "The document has 3 pages"
+- Manipulate Adobe Express content → `editor.documentRoot`
+- Import/export Adobe Express document → `addOnUISdk.app.document`
+- Your add-on's UI HTML page → `document.getElementById()`
+
+**"What's the DOM?"** - Which DOM?
+
+- Your add-on's HTML structure → `document.querySelector()` (Browser DOM)
+- Adobe Express's document structure → Use "scenegraph" not "DOM"
+
+**"How do I use the runtime?"** - Which runtime?
+
+- Execution environment → "Code runs in iframe runtime or document sandbox"
+- Communication APIs → `addOnUISdk.instance.runtime` or `addOnSandboxSdk.instance.runtime`
+
+**"What is the context?"** - Which context?
+
+- Execution environment → "The iframe context has standard Web APIs"
+- Editor's selection/insertion → `editor.context.selection`
+- Security boundaries → See [iframe Context & Security](../platform_concepts/context.md)
+
+**"What does instance mean?"** - Which instance?
+
+- SDK property → `addOnUISdk.instance` or `addOnSandboxSdk.instance`
+- Class object → "rectangle is an instance of RectangleNode"
+- Running session → "User's add-on instance"
+
+**"How do I import SDKs?"** - Named or default export?
+
+- Add-on UI SDK → Default export (no curly braces): `import addOnUISdk from "..."`
+- Document Sandbox SDK → Default export (no curly braces): `import addOnSandboxSdk from "..."`
+- Express Document SDK → Named exports (requires curly braces): `import { editor, colorUtils } from "..."`
+
+**"Are Web APIs and Browser APIs the same?"** - Yes!
+
+- Same thing, different names → "Web APIs" = "Browser APIs"
+- iframe runtime → Standard Web APIs available
+- Document sandbox → Limited Web APIs only (console, Blob)
+
+**"Should I say node or element?"** - It depends!
+
+- Adobe Express scenegraph → Use "node" (`RectangleNode`, `TextNode`, etc.) to describe visual elements in the document
+- Your add-on's HTML → Use "DOM node" or "HTML element"
+- User-facing docs → "element" is okay (e.g., "text elements in your design")
+- Developer docs → Prefer "node" for precision and to match API class names
+
+**"Should I use `addOnUISdk.instance` or `addOnUISdk.app`?"** - Different scopes
+
+- **Add-on scope** (`instance`) → Features specific to YOUR add-on
+ - `instance.runtime` - YOUR add-on's communication
+ - `instance.clientStorage` - YOUR add-on's storage (per-user, per-addon)
+ - `instance.manifest` - YOUR add-on's configuration
+- **Application scope** (`app`) → Features shared across Adobe Express
+ - `app.document` - The Adobe Express document (same for all add-ons)
+ - `app.currentUser` - The Express user (not specific to your add-on)
+ - `app.ui` - Adobe Express UI state (`theme`, `locale`)
+
+## Runtime Environments
+
+For security reasons, Adobe Express add-ons use a **dual-runtime architecture** with two separate JavaScript execution environments:
+
+### **Iframe Runtime**
+
+- **What it is**: A sandboxed iframe environment where your add-on's user interface runs
+- **Purpose**: Hosts your HTML, CSS, and JavaScript UI code
+- **SDK Used**: Add-on UI SDK
+- **File reference**: Typically your `index.html` and associated UI JavaScript files
+- **Security**: Sandboxed for security with standard Web APIs (some features require [manifest permissions](../../../references/manifest/index.md))
+- **Also known as**: "Panel Runtime", "iframe Sandbox"
+- **Terminology Note**: While the browser term is "iframe sandbox" (as used in [HTML sandbox attributes](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/iframe#sandbox) and manifest permissions), we use "iframe runtime" throughout the documentation for consistency with "document sandbox runtime" and to distinguish between the two execution environments
+
+### **Document Sandbox**
+
+- **What it is**: A separate sandboxed JavaScript environment for document manipulation
+- **Purpose**: Provides secure access to Adobe Express document structure and content
+- **SDKs Used**: Document Sandbox SDK (for communication) + Express Document SDK (for document APIs)
+- **File reference**: Specified in your manifest's `documentSandbox` entry (e.g., `code.js`)
+- **Security**: Isolated environment with limited Web APIs but direct document access
+- **Also known as**: "Document Model Sandbox"
+
+#### Understanding Runtime Communication
+
+The two runtimes communicate with each other through the [Communication APIs](../../../references/document-sandbox/communication/index.md), allowing your UI to trigger document changes and vice versa.
+
+**About Web APIs**: The terms "browser capabilities," "browser features," and "Web APIs" all refer to the standard JavaScript APIs available in web environments (like `fetch`, `localStorage`, `console`, `Blob`, etc.). The iframe runtime has standard Web APIs, while the document sandbox has limited Web APIs for security reasons. See the [Web APIs Reference](../../../references/document-sandbox/web/index.md) for details on what's available in each environment.
+
+
+
+For a comprehensive deep-dive into the dual-runtime architecture with visual diagrams, communication patterns, and code examples, see the [Add-on Architecture Guide](../platform_concepts/architecture.md) and the [Communication APIs Tutorial](../../learn/how_to/tutorials/stats-addon.md).
+
+## SDK Concepts
+
+### Add-on UI SDK
+
+**`addOnUISdk`**: The JavaScript module you import in your iframe code that provides `runtime` instance, `app` interfaces, `constants`, and UI-specific APIs.
+
+The `addOnUISdk` object provides two distinct scopes of functionality:
+
+**`addOnUISdk.instance` - Add-on Scope**
+Features specific to your individual add-on:
+
+- `runtime` - Communication between your add-on's iframe and document sandbox
+- `clientStorage` - Data storage for your add-on only (per-user, per-addon)
+- `manifest` - Your add-on's configuration
+- `entrypointType` - Your add-on's current entry point
+- `logger` - Logging for your add-on
+
+**Scope**: Isolated to your add-on instance; doesn't interact with other add-ons.
+
+**`addOnUISdk.app` - Application Scope**
+Features shared across Adobe Express (the host application):
+
+- `document` - The active Adobe Express document (shared across all add-ons)
+- `oauth` - Authentication with external services
+- `currentUser` - The Adobe Express user (not specific to your add-on)
+- `ui` - Adobe Express UI state (theme, locale, etc.)
+- `command` - Commands in the host application
+
+**Scope**: Interacts with Adobe Express itself and its global state.
+
+### Express Document SDK
+
+**Express Document SDK** (`express-document-sdk`): The JavaScript module providing document manipulation capabilities for the document sandbox. Import named exports: `editor`, `colorUtils`, `constants`, `fonts`, `viewport`.
+
+### Document Sandbox SDK
+
+**Document Sandbox SDK** (`add-on-sdk-document-sandbox`): The JavaScript module for communication between iframe runtime and document sandbox. Import as `addOnSandboxSdk`. Only needed when you require bi-directional communication between the two environments.
+
+
+
+**Note**: All Adobe Express add-on SDKs use the singleton pattern - pre-instantiated objects you import and use directly. You never create new instances yourself. See the [FAQ on singleton pattern](#q-what-is-the-singleton-pattern-and-why-do-add-on-sdks-use-it) and [Architecture Guide](../platform_concepts/architecture.md#sdk-structure--import-patterns) for details.
+
+## Import Patterns & Usage
+
+### Complete Import Reference
+
+```js
+// iframe runtime (UI code) - index.js/index.html
+import addOnUISdk from "https://express.adobe.com/static/add-on-sdk/sdk.js";
+
+// Document sandbox runtime (content manipulation) - code.js
+import addOnSandboxSdk from "add-on-sdk-document-sandbox"; // For communication
+import { editor, colorUtils, constants, fonts, viewport } from "express-document-sdk"; // For document APIs
+
+// Add-on UI SDK with explicit constants
+import addOnUISdk, { Range, RenditionFormat, Variant } from "https://express.adobe.com/static/add-on-sdk/sdk.js";
+```
+
+### When to Use Each Import
+
+| Your Add-on Needs | iframe runtime | document sandbox | Required SDKs |
+| --------------------------------- | -------------- | ---------------- | ----------------------------------------------------------- |
+| **UI only** (no document changes) | ✅ | ❌ | Add-on UI SDK |
+| **Document manipulation** | ✅ | ✅ | Add-on UI SDK + Document Sandbox SDK + Express Document SDK |
+| **Cross-runtime communication** | ✅ | ✅ | Add-on UI SDK + Document Sandbox SDK |
+| **Export/Import workflows** | ✅ | ❌ | Add-on UI SDK |
+
+## Communication System
+
+### Bidirectional Communication Pattern
+
+**iframe runtime → document sandbox**:
+
+```js
+// iframe runtime (index.js)
+const { runtime } = addOnUISdk.instance;
+const sandboxProxy = await runtime.apiProxy("documentSandbox");
+await sandboxProxy.createRectangle();
+
+// document sandbox (code.js)
+const { runtime } = addOnSandboxSdk.instance; // Document Sandbox SDK
+runtime.exposeApi({
+ createRectangle() {
+ const rect = editor.createRectangle();
+ editor.context.insertionParent.children.append(rect);
+ }
+});
+```
+
+**document sandbox → iframe runtime**:
+
+```js
+// document sandbox (code.js)
+const panelProxy = await runtime.apiProxy("panel");
+await panelProxy.updateUI("Rectangle created");
+
+// iframe runtime (index.js)
+runtime.exposeApi({
+ updateUI(message) {
+ document.getElementById('status').textContent = message;
+ }
+});
+```
+
+### Runtime Types
+
+- **`panel`**: The main iframe runtime for your add-on UI
+- **`documentSandbox`**: The document manipulation runtime
+- **`dialog`**: Runtime context when code is running within a modal dialog
+
+## Core Development Objects
+
+### **`editor` Object**
+
+Primary interface for document manipulation in the document sandbox.
+
+```js
+import { editor } from "express-document-sdk";
+
+const rectangle = editor.createRectangle();
+const textNode = editor.createText("Hello World");
+const insertionParent = editor.context.insertionParent;
+```
+
+### **`constants`**
+
+Type-safe values for SDK operations that prevent string literal errors.
+
+```js
+// UI SDK Constants
+await addOnUISdk.app.document.createRenditions({
+ range: Range.currentPage,
+ format: RenditionFormat.png
+});
+
+// Document Sandbox Constants
+rectangle.fill = {
+ type: constants.FillType.color,
+ color: { red: 1, green: 0, blue: 0, alpha: 1 }
+};
+```
+
+### **ColorUtils**
+
+Utility functions for creating and converting colors in the document sandbox.
+
+```js
+import { colorUtils } from "express-document-sdk";
+
+const redColor = colorUtils.fromRGB(1, 0, 0); // RGB values (0-1)
+const blueColor = colorUtils.fromHex("#0066CC"); // Hex string
+const hexString = colorUtils.toHex(redColor); // "#FF0000FF"
+```
+
+## Node Hierarchy
+
+Adobe Express documents are structured as a **scenegraph** - a hierarchical tree of nodes representing visual elements.
+
+**`BaseNode`**: The minimal base class for all document elements with basic properties like `id`, `type`, `parent`, `allChildren`.
+
+**`Node`**: Full-featured visual content that extends `BaseNode` with visual properties and transformations.
+
+**Common Node Types**:
+
+- **Container Nodes**: `ArtboardNode`, `GroupNode`, `PageNode` (hold other elements)
+- **Content Nodes**: `RectangleNode`, `EllipseNode`, `TextNode`, `LineNode`, `PathNode` (visual elements)
+- **Media Nodes**: `MediaContainerNode`, `ImageRectangleNode` (images and media)
+
+```js
+// Navigate the document hierarchy
+const root = editor.documentRoot; // ExpressRootNode
+const currentPage = root.pages.first; // PageNode
+const artboard = currentPage.artboards.first; // ArtboardNode
+
+// Create and add content
+const rectangle = editor.createRectangle(); // RectangleNode
+artboard.children.append(rectangle);
+```
+
+## Development Environment & Tools
+
+### **Add-on Marketplace**
+
+Distribution platform where users discover and install add-ons within [Adobe Express](https://express.adobe.com/add-ons) via the "Add-ons" button in the left sidebar.
+
+### **Code Playground**
+
+Interactive browser-based development environment for experimenting with add-on APIs without local setup. See the [Code Playground](../../getting_started/code-playground.md) guide for more details.
+
+### **Adobe Express Add-on CLI**
+
+Command Line Interface tool for creating, building, and packaging add-ons for local development.
+
+- **Installation**: `npm install -g @adobe/ccweb-add-on-cli`
+- **Common Commands**: `create`, `start`, `build`, `package`
+
+See the [Adobe Express Add-on CLI](../../getting_started/local_development/dev_tooling.md) guide for more details.
+
+### **MCP Server (Model Context Protocol)**
+
+AI-assisted development tool that enhances LLM responses with Adobe Express add-on documentation and TypeScript definitions.
+
+- **Purpose**: Provide semantic documentation search and accurate code suggestions through AI assistants
+- **Requirements**: Node.js 18+ and MCP-compatible IDE (Cursor, VS Code, Claude Desktop)
+
+See the [Adobe Express Add-on MCP Server](../../getting_started/local_development/mcp_server.md) guide for more details.
+
+### **Add-on Development Mode**
+
+Special mode in Adobe Express (**Settings > Add-on Development** toggle) that allows loading and testing local add-ons during development. See [Add-on Development Mode](../../getting_started/local_development/dev_tooling.md) for more details.
+
+## Manifest Configuration
+
+```json
+{
+ "entryPoints": [
+ {
+ "type": "panel",
+ "id": "panel1",
+ "main": "index.html", // iframe runtime entry
+ "documentSandbox": "code.js" // document sandbox entry (optional)
+ }
+ ],
+ "permissions": {
+ "sandbox": ["allow-popups", "allow-downloads"],
+ "oauth": ["www.dropbox.com", "api.example.com"]
+ }
+}
+```
+
+## Quick Decision Guide
+
+**Building a UI Panel?** → Add-on UI SDK (`addOnUISdk`)
+**Creating new content?** → Document APIs (in Document Sandbox, via `editor`)
+**Modifying existing content?** → Document APIs (in Document Sandbox, via `editor`)
+**Connecting UI to Document?** → Communication APIs (`runtime.exposeApi()`, `runtime.apiProxy()`)
+**Need browser features in sandbox?** → Web APIs or proxy from iframe
+
+
+
+**Confused by terminology?**
+
+Many terms like "document", "context", "runtime", and "instance" have multiple meanings. See [Overloaded Terms Clarification](#overloaded-terms-clarification) at the top for complete clarification.
+
+## Troubleshooting Common Issues
+
+### Import Errors
+
+```js
+// ✅ Correct patterns
+import addOnUISdk from "https://express.adobe.com/static/add-on-sdk/sdk.js"; // Default export (no curly braces)
+import addOnSandboxSdk from "add-on-sdk-document-sandbox"; // Default export (no curly braces)
+import { editor, colorUtils, constants, fonts, viewport } from "express-document-sdk"; // Named exports (requires curly braces)
+
+// ❌ Common mistakes
+import { addOnUISdk } from "..."; // Wrong: should be default import (no curly braces)
+import addOnSandboxSdk from "add-on-ui-sdk"; // Wrong: mixed up the SDKs
+import editor from "express-document-sdk"; // Wrong: should be named import (needs curly braces)
+```
+
+### Runtime Context
+
+| When you're in... | You have access to... | To communicate with the other side... |
+| -------------------- | -------------------------------------- | ----------------------------------------------------------------------------- |
+| **iframe runtime** | Add-on UI SDK, DOM, Web APIs | Use `runtime.exposeApi()` or `runtime.apiProxy()` |
+| **document sandbox** | Express Document SDK, limited Web APIs | Use `runtime.exposeApi()` or `runtime.apiProxy()` (from Document Sandbox SDK) |
+
+### "undefined" Errors
+
+**Problem**: `addOnUISdk.constants.SomeConstant` returns `undefined`
+**Solution**: Some constants require explicit imports. Check the [Constants Reference](../../../references/addonsdk/addonsdk-constants.md)
+
+---
+
+## FAQs
+
+#### Q: What's the difference between "Add-on UI SDK" and "Document APIs"?
+
+**A:** The **Add-on UI SDK** runs in the iframe runtime and handles UI, user interactions, and import/export. **Document APIs** (via Express Document SDK) run in the document sandbox and handle content creation and document manipulation.
+
+#### Q: Why are there two different runtime environments?
+
+**A:** Security and performance. The **iframe runtime** is sandboxed for security but has standard Web APIs. The **document sandbox** has direct access to Adobe Express's document engine but limited Web APIs.
+
+#### Q: Can I use Document APIs directly from the iframe runtime?
+
+**A:** No, Document APIs (Express Document SDK) are only available in the document sandbox for security reasons. You must use the communication system (Document Sandbox SDK) to bridge between environments.
+
+#### Q: When do I use `addOnUISdk` vs `addOnSandboxSdk`?
+
+**A:** Use `addOnUISdk` (Add-on UI SDK) in your **iframe runtime code** (usually `index.html` or `ui/` folder). Use `addOnSandboxSdk` (Document Sandbox SDK) in your **document sandbox code** (usually `code.js` or `sandbox/` folder).
+
+#### Q: I see references to "UI SDK" - is this different from "Add-on UI SDK"?
+
+**A:** No, they're the same. **"Add-on UI SDK"** is the full, preferred term for clarity, but "UI SDK" is commonly used as shorthand throughout the documentation.
+
+#### Q: What's the difference between `addOnUISdk.instance` and `addOnUISdk.app`?
+
+**A:** These represent **different scopes** of functionality:
+
+- **`addOnUISdk.instance`** - **Add-on scope**: Features specific to YOUR add-on
+
+ - `instance.runtime` - Communication for YOUR add-on
+ - `instance.clientStorage` - Storage for YOUR add-on only (per-user, per-addon)
+ - `instance.manifest` - YOUR add-on's configuration
+
+- **`addOnUISdk.app`** - **Application scope**: Features shared across Adobe Express
+ - `app.document` - The Adobe Express document (same for all add-ons)
+ - `app.currentUser` - The Express user (not specific to your add-on)
+ - `app.ui` - Adobe Express UI state (theme, locale)
+
+Use `instance` for add-on-specific features; use `app` to interact with Adobe Express itself.
+
+#### Q: I'm confused by terms like "document", "context", "runtime", and "instance" - they seem to mean different things in different places?
+
+**A:** Yes! Many terms in add-on development are overloaded with multiple meanings. Check the **[Overloaded Terms Clarification](#overloaded-terms-clarification)** table at the top of this page for complete clarification. For example, "document" can mean:
+
+- The Adobe Express user's project
+- `editor.documentRoot` (scenegraph manipulation)
+- `addOnUISdk.app.document` (import/export operations)
+- Browser DOM `document` object (your add-on's HTML)
+
+This table provides all meanings with examples for 17 commonly overloaded terms.
+
+#### Q: What is the singleton pattern and why do add-on SDKs use it?
+
+**A:** All Adobe Express add-on SDKs use the **singleton pattern** - they provide pre-instantiated objects you import and use directly. You **never create new instances yourself**.
+
+This ensures all your code works with the same SDK instances, preventing conflicts and maintaining consistent state. For Express Document SDK specifically, you import **lowercase names** (`editor`, `colorUtils`, `constants`, `fonts`, `viewport`) which are singleton objects, NOT the uppercase class names (`Editor`, `ColorUtils`, etc.).
+
+See the [Architecture Guide](../platform_concepts/architecture.md#sdk-structure--import-patterns) for complete details.
+
+---
+
+## Related Documentation
+
+- [Adobe Express Add-ons Developer Guide](https://developer-stage.adobe.com/express/add-ons/docs/guides/) - Official documentation and getting started guide
+- [Add-on Architecture Guide](../platform_concepts/architecture.md) - Comprehensive guide with visual diagrams
+- [Add-on UI SDK Reference](../../../references/addonsdk/index.md)
+- [Document Sandbox Overview](../../../references/document-sandbox/index.md)
+- [Communication APIs](../../../references/document-sandbox/communication/index.md)
+- [Add-on UI SDK Constants Usage Guide](./ui-sdk-constants.md)
+- [Document Sandbox Constants Usage Guide](./document-sandbox-constants.md)
diff --git a/src/pages/guides/learn/fundamentals/ui-sdk-constants.md b/src/pages/guides/learn/fundamentals/ui-sdk-constants.md
new file mode 100644
index 000000000..b6d9a3919
--- /dev/null
+++ b/src/pages/guides/learn/fundamentals/ui-sdk-constants.md
@@ -0,0 +1,322 @@
+---
+keywords:
+ - Adobe Express
+ - Express Add-on SDK
+ - Add-on UI SDK
+ - Constants
+ - Import patterns
+ - Type safety
+ - JavaScript
+ - TypeScript
+ - Named exports
+ - SDK constants
+ - UI constants
+ - Modal dialogs
+ - Document export
+ - Event handling
+ - Color picker
+ - AppEvent
+ - ColorPickerEvent
+title: Using Add-on UI SDK Constants
+description: A practical guide to using constants in the Add-on UI SDK for type-safe development,
+ covering import patterns, common use cases, and best practices for iframe environment development.
+contributors:
+ - https://github.com/hollyschinsky
+faq:
+ questions:
+ - question: "Why do some constants require imports while others don't?"
+ answer: "Adobe Express SDK has two types of constants: dual-access (available both ways) and named-only exports (security/architecture reasons). Always check the Import Patterns section."
+
+ - question: "How do I know if a constant requires import?"
+ answer: "Check the Import Quick Reference in the Constants Reference or use TypeScript for compile-time validation. When in doubt, use named imports - they work for all constants."
+
+ - question: "What's the difference between Range.currentPage and addOnUISdk.constants.Range.currentPage?"
+ answer: "Both work for dual-access constants like Range. Named imports (Range.currentPage) are recommended for cleaner code, while constants object access is useful for dynamic scenarios."
+
+ - question: "Why does addOnUISdk.constants.AppEvent return undefined?"
+ answer: "AppEvent is a named-only export and must be imported. It's not available through the constants object."
+
+ - question: "Can I use string literals instead of constants?"
+ answer: "While possible, constants provide type safety, IDE autocomplete, and future-proofing. Always prefer constants over string literals."
+
+ - question: "What import should I use for document export?"
+ answer: "Use import addOnUISdk, { Range, RenditionFormat, RenditionIntent } from the SDK URL for most export scenarios."
+
+ - question: "Do constants work the same in Document Sandbox?"
+ answer: "No, Document Sandbox has different constants from express-document-sdk. See Document Sandbox Constants for sandbox-specific constants."
+# LLM optimization metadata
+canonical: true
+ai_assistant_note: "This guide focuses specifically on Add-on UI SDK constants used in the iframe
+ environment. For document sandbox constants, refer to the Document Sandbox Constants guide.
+ Covers import patterns, dual access vs named-only exports, and practical usage examples."
+semantic_tags:
+ - ui-sdk-constants
+ - iframe-environment
+ - import-patterns
+ - type-safety
+ - practical-guide
+---
+
+# Using Add-on UI SDK Constants
+
+Add-on UI SDK constants provide type-safe ways to interact with the Add-on UI SDK for UI operations like dialogs, document export, and event handling. This guide covers the most common patterns for iframe environment development.
+
+## Why Use Constants?
+
+Constants equal their variable name as a string (e.g., `ButtonType.primary` equals `"primary"`), but using constants provides type safety, IDE autocomplete, and future-proofing against API changes.
+
+
+
+Add-on UI vs. Document Sandbox constants
+
+Separate sets of constants are available in both the Add-on UI and the [Document Sandbox](./document-sandbox-constants.md) environments. For the complete technical specification on the constants covered in this guide, see the [Add-on UI Constant Reference](../../../references/addonsdk/addonsdk-constants.md).
+
+## Quick Start
+
+Most constants support two import patterns. Choose based on your needs:
+
+```javascript
+// Named imports (recommended for cleaner code)
+import addOnUISdk, { Range, RenditionFormat, Variant } from "https://express.adobe.com/static/add-on-sdk/sdk.js";
+
+// Constants object access (good for dynamic access)
+const format = addOnUISdk.constants.RenditionFormat.png;
+```
+
+
+
+#### Important
+
+Some constants (like `AppEvent`, `ColorPickerEvent`) are **only available as named exports** and cannot be accessed through `addOnUISdk.constants.*`. See [Import Patterns](#import-patterns) below.
+
+## Most Common Use Cases
+
+### Document Export
+
+The most common constants you'll use for exporting documents:
+
+```javascript
+import addOnUISdk, { Range, RenditionFormat, RenditionIntent } from "https://express.adobe.com/static/add-on-sdk/sdk.js";
+
+// Export current page as PNG
+await addOnUISdk.app.document.createRenditions({
+ range: Range.currentPage,
+ format: RenditionFormat.png
+});
+
+// Export entire document as PDF for printing
+await addOnUISdk.app.document.createRenditions({
+ range: Range.entireDocument,
+ format: RenditionFormat.pdf,
+ intent: RenditionIntent.print
+});
+```
+
+**Available Options:**
+
+- `Range`: `currentPage`, `entireDocument`, `specificPages`
+- `RenditionFormat`: `png`, `jpg`, `mp4`, `pdf`, `pptx`
+- `RenditionIntent`: `export`, `preview`, `print`
+
+### Modal Dialogs
+
+Essential constants for user interactions:
+
+```javascript
+import addOnUISdk, { Variant, ButtonType } from "https://express.adobe.com/static/add-on-sdk/sdk.js";
+
+// Show confirmation dialog
+const result = await addOnUISdk.app.showModalDialog({
+ variant: Variant.confirmation,
+ title: "Delete Item",
+ description: "Are you sure?"
+});
+
+// Handle user response
+if (result.buttonType === ButtonType.primary) {
+ // User confirmed
+} else if (result.buttonType === ButtonType.cancel) {
+ // User cancelled
+}
+```
+
+**Available Options:**
+
+- `Variant`: `confirmation`, `information`, `warning`, `error`, `input`
+- `ButtonType`: `primary`, `secondary`, `cancel`, `close`
+- `FieldType`: `text`, `password` (for input dialogs)
+
+### Event Handling
+
+**Important:** Event constants must be imported - they're not available in the constants object:
+
+```javascript
+import addOnUISdk, { AppEvent } from "https://express.adobe.com/static/add-on-sdk/sdk.js";
+
+// ✅ Correct - must import AppEvent
+addOnUISdk.app.on(AppEvent.themechange, (event) => {
+ updateUITheme(event.theme);
+});
+
+// ❌ This will NOT work
+addOnUISdk.app.on(addOnUISdk.constants.AppEvent.themechange, handler); // undefined!
+```
+
+**Common Event Types:**
+
+- `AppEvent.themechange` - Detect theme changes (light/dark)
+- `AppEvent.localechange` - Detect locale/language changes
+
+## Copy-Paste Import Statements
+
+### Most Common Scenarios
+
+```javascript
+// Document Export & Rendering
+import addOnUISdk, { Range, RenditionFormat, RenditionIntent } from "https://express.adobe.com/static/add-on-sdk/sdk.js";
+
+// Modal Dialogs & UI
+import addOnUISdk, { Variant, ButtonType, FieldType } from "https://express.adobe.com/static/add-on-sdk/sdk.js";
+
+// Event Handling (Import Required)
+import addOnUISdk, { AppEvent, ColorPickerEvent } from "https://express.adobe.com/static/add-on-sdk/sdk.js";
+```
+
+## Import Patterns
+
+Understanding import patterns is crucial for avoiding runtime errors. Adobe Express Add-on SDK constants are available through different patterns depending on the constant type.
+
+### Must Import (Named Exports Only)
+
+These constants **must be imported** and are **not available** through `addOnUISdk.constants.*`:
+
+```javascript
+import addOnUISdk, {
+ AppEvent, // ❌ NOT in constants object
+ ColorPickerEvent, // ❌ NOT in constants object
+ SupportedMimeTypes, // ❌ NOT in constants object
+ EntrypointType // ❌ NOT in constants object
+} from "https://express.adobe.com/static/add-on-sdk/sdk.js";
+
+// ✅ Correct usage
+const docxMimeType = SupportedMimeTypes.docx;
+const colorChangeEvent = ColorPickerEvent.colorChange;
+
+// ❌ Will NOT work - these are not in the constants object
+const docxMimeType = addOnUISdk.constants.SupportedMimeTypes.docx; // undefined!
+```
+
+### Flexible Access (Both Ways Work)
+
+These constants support **both patterns** - you can use either approach:
+
+```javascript
+import addOnUISdk, { Range, RenditionFormat, Variant } from "https://express.adobe.com/static/add-on-sdk/sdk.js";
+
+// Option 1: Named import (recommended for cleaner code)
+const options = {
+ range: Range.currentPage,
+ format: RenditionFormat.png,
+ variant: Variant.error
+};
+
+// Option 2: Constants object (good for dynamic access)
+const userFormat = "png";
+const format = addOnUISdk.constants.RenditionFormat[userFormat];
+```
+
+**Dual Access Constants Include:**
+
+- `Range`, `RenditionFormat`, `RenditionIntent`, `RenditionType`
+- `Variant`, `ButtonType`, `FieldType`, `DialogResultType`
+- `PlatformType`, `DeviceClass`, `PlatformEnvironment`
+- `EditorPanel`, `MediaTabs`, `ElementsTabs`, `PanelActionType`
+- `AuthorizationStatus`, `RuntimeType`, `BleedUnit`, `ColorPickerPlacement`
+- `VideoResolution`, `FrameRate`, `BitRate`, `FileSizeLimitUnit`, `LinkOptions`
+
+## Common Errors & Solutions
+
+### "Cannot read property of undefined"
+
+**Problem**: Trying to access named-only exports through constants object.
+
+```javascript
+// ❌ This causes errors
+const event = addOnUISdk.constants.AppEvent.themechange; // undefined!
+```
+
+**Solution**: Always import named-only exports.
+
+```javascript
+// ✅ This works
+import addOnUISdk, { AppEvent } from "https://express.adobe.com/static/add-on-sdk/sdk.js";
+const event = AppEvent.themechange;
+```
+
+### Using String Literals Instead of Constants
+
+**Problem**: Using fragile string literals.
+
+```javascript
+// ❌ Fragile - might break if API changes
+await createRenditions({
+ range: "currentPage", // String literal
+ format: "image/png" // String literal
+});
+```
+
+**Solution**: Always use constants.
+
+```javascript
+// ✅ Safe - will be updated if API changes
+await createRenditions({
+ range: Range.currentPage, // Constant
+ format: RenditionFormat.png // Constant
+});
+```
+
+## Best Practices
+
+1. **Use named imports for known constants** - cleaner and more reliable
+2. **Use constants object for dynamic access** - when the constant name is determined at runtime
+3. **Always import named-only exports** - there's no alternative way to access them
+4. **Group related imports** - organize by functionality for better readability
+
+## FAQs
+
+#### Q: Why do some constants require imports while others don't?
+
+**A:** Adobe Express SDK has two types of constants: dual-access (available both ways) and named-only exports (security/architecture reasons). Always check the [Import Patterns](#import-patterns) section.
+
+#### Q: How do I know if a constant requires import?
+
+**A:** Check the [Import Quick Reference](../../../references/addonsdk/addonsdk-constants.md#import-quick-reference) in the Constants Reference or use TypeScript for compile-time validation. When in doubt, use named imports - they work for all constants.
+
+#### Q: What's the difference between `Range.currentPage` and `addOnUISdk.constants.Range.currentPage`?
+
+**A:** Both work for dual-access constants like `Range`. Named imports (`Range.currentPage`) are recommended for cleaner code, while constants object access is useful for dynamic scenarios.
+
+#### Q: Why does `addOnUISdk.constants.AppEvent` return undefined?
+
+**A:** `AppEvent` is a named-only export and must be imported: `import addOnUISdk, { AppEvent } from "..."`. It's not available through the constants object.
+
+#### Q: Can I use string literals instead of constants?
+
+**A:** While possible, constants provide type safety, IDE autocomplete, and future-proofing. Always prefer constants over string literals like `"currentPage"`.
+
+#### Q: What import should I use for document export?
+
+**A:** Use `import addOnUISdk, { Range, RenditionFormat, RenditionIntent } from "https://express.adobe.com/static/add-on-sdk/sdk.js"` for most export scenarios.
+
+#### Q: Do constants work the same in Document Sandbox?
+
+**A:** No, Document Sandbox has different constants from `express-document-sdk`. See [Document Sandbox Constants](./document-sandbox-constants.md) for sandbox-specific constants.
+
+## Next Steps
+
+- **Complete Reference**: See [Constants Reference](../../../references/addonsdk/addonsdk-constants.md) for all available constants
+- **Practical Guides**:
+ - [Create Renditions](../how_to/create_renditions.md) - Using export constants
+ - [Modal Dialogs](../how_to/modal_dialogs.md) - Using dialog constants
+ - [Use Color](../how_to/use_color.md) - Using color picker constants
+ - [Theme & Locale](../how_to/theme_locale.md) - Using event constants
diff --git a/src/pages/guides/learn/how_to/element_metadata.md b/src/pages/guides/learn/how_to/element_metadata.md
index 41a7cd0d6..115aad177 100644
--- a/src/pages/guides/learn/how_to/element_metadata.md
+++ b/src/pages/guides/learn/how_to/element_metadata.md
@@ -168,13 +168,13 @@ Import-time metadata is **not supported** for PSD/AI assets. An error will be th
```js
// Store metadata when importing
// ui/index.js (iframe runtime)
-import addOnUISdk from "https://new.express.adobe.com/static/add-on-sdk/sdk.js";
+import addOnUISdk from "https://express.adobe.com/static/add-on-sdk/sdk.js";
addOnUISdk.ready.then(async () => {
try {
// Create or fetch your image blob
const imageBlob = await fetch("./sample-image.png").then(r => r.blob());
-
+
// Import image with ImportAddOnData
await addOnUISdk.app.document.addImage(
imageBlob,
@@ -200,9 +200,9 @@ addOnUISdk.ready.then(async () => {
}
}
);
-
+
console.log("✅ Image imported successfully with metadata!");
-
+
} catch (error) {
console.error("❌ Failed to import image:", error);
}
@@ -262,64 +262,64 @@ import { editor } from "express-document-sdk";
function retrieveAllMediaMetadata() {
console.log("Starting metadata retrieval...");
-
+
const documentRoot = editor.documentRoot;
let mediaContainerCount = 0;
-
+
// Traverse document structure to find media nodes
for (const page of documentRoot.pages) {
console.log(`📄 Checking page: ${page.id}`);
-
+
for (const artboard of page.artboards) {
console.log(`🎨 Checking artboard: ${artboard.id}`);
-
+
// Use recursive traversal to find all MediaContainer nodes
traverseNodeForMedia(artboard);
}
}
-
+
function traverseNodeForMedia(node) {
// Check if current node is a MediaContainer
if (node.type === 'MediaContainer') {
mediaContainerCount++;
console.log(`\n📦 Found MediaContainer #${mediaContainerCount}: ${node.id}`);
-
+
try {
// Retrieve container metadata (nodeAddOnData)
const containerMetadata = {};
const containerKeys = node.addOnData.keys();
-
+
for (const key of containerKeys) {
containerMetadata[key] = node.addOnData.getItem(key);
}
-
+
if (containerKeys.length > 0) {
console.log('📝 Container metadata (nodeAddOnData):', containerMetadata);
} else {
console.log('📝 No container metadata found');
}
-
+
// Access the media rectangle directly via the mediaRectangle property
const mediaRectangle = node.mediaRectangle;
-
+
if (mediaRectangle) {
console.log(`🖼️ Media rectangle type: ${mediaRectangle.type}`);
-
+
try {
// Retrieve media-specific metadata (mediaAddOnData)
const mediaMetadata = {};
const mediaKeys = mediaRectangle.mediaAddOnData.keys();
-
+
for (const key of mediaKeys) {
mediaMetadata[key] = mediaRectangle.mediaAddOnData.getItem(key);
}
-
+
if (mediaKeys.length > 0) {
console.log('🎯 Media metadata (mediaAddOnData):', mediaMetadata);
} else {
console.log('🎯 No media metadata found');
}
-
+
} catch (error) {
// Handle PSD/AI assets or other errors
console.log('⚠️ Cannot access mediaAddOnData (likely PSD/AI asset):', error.message);
@@ -327,12 +327,12 @@ function retrieveAllMediaMetadata() {
} else {
console.log('⚠️ No media rectangle found');
}
-
+
} catch (error) {
console.error('❌ Error accessing container metadata:', error);
}
}
-
+
// Recursively traverse all children
// MediaContainers can be nested inside groups or other containers
if (node.allChildren) {
@@ -341,7 +341,7 @@ function retrieveAllMediaMetadata() {
}
}
}
-
+
console.log(`\n✅ Metadata retrieval complete! Found ${mediaContainerCount} MediaContainer(s)`);
}
```
diff --git a/src/pages/guides/learn/how_to/handle_selection.md b/src/pages/guides/learn/how_to/handle_selection.md
index 9676905cd..c7ed3dbd6 100644
--- a/src/pages/guides/learn/how_to/handle_selection.md
+++ b/src/pages/guides/learn/how_to/handle_selection.md
@@ -59,6 +59,26 @@ faq:
- question: "What are common selection-based actions?"
answer: "Typical actions include updating properties panels, enabling/disabling tools, applying formatting to selected text, grouping elements, and showing context-appropriate options."
+canonical: true
+ai_assistant_note: "This is the authoritative guide for working with element selections in Adobe Express add-ons.
+ Use this when helping developers understand: how to get/set/clear selections, selection change event handling,
+ selection rules and constraints, locked/non-editable element handling, selection-based UI updates, and communication
+ between document sandbox and UI panel for selection data. Critical: Always emphasize that document modifications
+ must NEVER happen inside selection change handlers - this can crash the application. Selection handlers should only
+ update UI, analyze data, or communicate with the panel."
+semantic_tags:
+ - canonical-reference
+ - selection-handling
+ - event-handling
+ - context-api
+ - selection-change-events
+ - document-sandbox
+ - ui-integration
+ - selection-rules
+ - locked-nodes
+ - properties-panel
+ - real-time-updates
+ - best-practices
---
# Handle Element Selection
@@ -77,7 +97,7 @@ All selection operations use the **Document API** and run in the **document sand
Make sure your `manifest.json` includes `"documentSandbox": "code.js"` in the entry points to set up the document sandbox environment.
-### Check Current Selection
+### Quick Start Example
@@ -89,13 +109,7 @@ import { editor } from "express-document-sdk";
// Check if anything is selected
if (editor.context.hasSelection) {
- const selection = editor.context.selection;
- console.log(`Selected ${selection.length} item(s)`);
-
- // Process each selected node
- selection.forEach((node, index) => {
- console.log(`Node ${index + 1}: ${node.type}`);
- });
+ console.log(`Selected ${editor.context.selection.length} item(s)`);
} else {
console.log("Nothing is selected");
}
@@ -105,17 +119,11 @@ if (editor.context.hasSelection) {
```ts
// sandbox/code.ts
-import { editor, Node, EditorEvent } from "express-document-sdk";
+import { editor } from "express-document-sdk";
// Check if anything is selected
if (editor.context.hasSelection) {
- const selection: readonly Node[] = editor.context.selection;
- console.log(`Selected ${selection.length} item(s)`);
-
- // Process each selected node
- selection.forEach((node: Node, index: number) => {
- console.log(`Node ${index + 1}: ${node.type}`);
- });
+ console.log(`Selected ${editor.context.selection.length} item(s)`);
} else {
console.log("Nothing is selected");
}
@@ -130,14 +138,7 @@ In Adobe Express, the selection system provides:
- **Selection events** - React to selection changes
- **Selection filtering** - Handle locked/non-editable content
-### Selection Rules
-
-Adobe Express enforces these constraints:
-
-1. **Artboard constraint** - Only nodes within the current artboard can be selected
-2. **Hierarchy filtering** - Cannot select both parent and child nodes simultaneously
-3. **Locked node filtering** - Locked nodes are excluded from the main selection
-4. **Editable-only** - Main selection only includes editable nodes
+The selection system automatically enforces constraints like artboard boundaries and hierarchy rules. See the [Best Practices & Guidelines](#best-practices--guidelines) section for complete details on selection rules and restrictions.
## Basic Selection Operations
@@ -676,13 +677,13 @@ editor.context.on(EditorEvent.selectionChange, () => {
});
```
-## UI Integration
+## Practical Selection Patterns
-Communicate selection changes between the document sandbox and your UI panel to create responsive interfaces.
+Real-world patterns for building selection-based features in your add-on.
-### Selection-Based Actions
+### Performing Actions on Selected Elements
-Common patterns for performing actions on selected elements:
+Common patterns for applying changes to selected elements:
@@ -831,7 +832,9 @@ editor.context.on(EditorEvent.selectionChange, () => {
});
```
-### Selection State Management
+### Advanced: Selection State Management
+
+Track selection history and manage complex selection states:
@@ -984,205 +987,105 @@ const selectionManager = new SelectionManager();
## Best Practices & Guidelines
-### Event Handler Cleanup
-
-⚠️ **Important**: Always clean up event handlers to prevent memory leaks.
-
-
-
-#### JavaScript
-
-```js
-// sandbox/code.js
-import { editor, EditorEvent } from "express-document-sdk";
-
-// Store handler IDs for cleanup
-let selectionHandlerId = null;
-
-function setupSelectionHandling() {
- // Register handler and store ID
- selectionHandlerId = editor.context.on(EditorEvent.selectionChange, () => {
- console.log("Selection changed");
- // Handle selection change
- });
-
- console.log("Selection handler registered");
-}
-
-function cleanupSelectionHandling() {
- // Unregister the handler
- if (selectionHandlerId) {
- editor.context.off(EditorEvent.selectionChange, selectionHandlerId);
- selectionHandlerId = null;
- console.log("Selection handler unregistered");
- }
-}
-
-// Setup
-setupSelectionHandling();
-
-// Cleanup when add-on is being destroyed or reset
-// cleanupSelectionHandling();
-```
+### Selection Handler Restrictions
-#### TypeScript
+
-```ts
-// code.ts
-import { editor, EditorEvent } from "express-document-sdk";
+Document Modification Restrictions
-// Store handler IDs for cleanup
-let selectionHandlerId: string | null = null;
+**Never modify the document inside selection change handlers!** This can crash the application.
-function setupSelectionHandling(): void {
- // Register handler and store ID
- selectionHandlerId = editor.context.on(EditorEvent.selectionChange, () => {
- console.log("Selection changed");
- // Handle selection change
- });
-
- console.log("Selection handler registered");
-}
+**✅ Safe in selection handlers:**
-function cleanupSelectionHandling(): void {
- // Unregister the handler
- if (selectionHandlerId) {
- editor.context.off(EditorEvent.selectionChange, selectionHandlerId);
- selectionHandlerId = null;
- console.log("Selection handler unregistered");
- }
-}
+ - Update UI panels
+ - Log information
+ - Analyze selection
+ - Enable/disable buttons
+ - Send data to UI panel
-// Setup
-setupSelectionHandling();
+**❌ Never do in selection handlers:**
-// Cleanup when add-on is being destroyed or reset
-// cleanupSelectionHandling();
-```
+ - Create, delete, or modify nodes
+ - Change document structure
+ - Set properties on selected elements
### Selection System Rules
+Adobe Express enforces these constraints:
+
1. **Artboard constraint**: Only nodes within the current artboard can be selected
2. **Hierarchy filtering**: Cannot select both parent and child nodes simultaneously
3. **Locked node handling**: Locked nodes are excluded from main selection but available in `selectionIncludingNonEditable`
4. **Automatic filtering**: System automatically filters out invalid selections
-### Important: Selection Handler Restrictions
-
-
-
-**Document Modification Restrictions**
-
-**Never modify the document inside selection change handlers!** This can crash the application.
-
-**✅ Safe in selection handlers:**
-
-- Update UI panels
-- Log information
-- Analyze selection
-- Enable/disable buttons
-- Send data to UI panel
-
-**❌ Never do in selection handlers:**
-
-- Create, delete, or modify nodes
-- Change document structure
-- Set properties on selected elements
-
-
-
### Performance Guidelines
-1. **Keep handlers fast**: Minimize processing time
-2. **Essential work only**: Avoid heavy computations
-3. **Clean Up**: Always unregister handlers when done (`editor.context.off()`)
-4. **Avoid Heavy Work**: Don't do complex calculations in selection callbacks
+1. **Keep handlers fast**: Minimize processing time and avoid heavy computations in selection callbacks
+2. **Essential work only**: Only perform UI updates, logging, or data analysis in selection handlers
+3. **Always clean up**: Unregister event handlers when done using `editor.context.off()` to prevent memory leaks
-### Communication Between UI and Document Sandbox
+### Communicating with Your UI Panel
-One of the most important real-world patterns is communicating selection changes from the document sandbox to your UI panel, allowing you to update the interface based on what the user has selected.
+To create responsive interfaces, you'll need to communicate selection changes from the document sandbox to your UI panel. This allows you to update buttons, property panels, and other UI elements based on what the user has selected.
-For detailed information on the communication APIs, see the [Communication API reference](../../../references/document-sandbox/communication/).
+For complete details on setting up bidirectional communication between your document sandbox and UI panel, see the [Communication API reference](../../../references/document-sandbox/communication/).
-#### Complete Communication Example
+## Quick Reference
-This example shows how to set up bidirectional communication between your UI panel and document sandbox for selection-based interactions.
+### Common Selection Operations
-## Quick Reference & Common Patterns
+```js
+// Get current selection
+const selection = editor.context.selection;
-Here are some frequently used patterns you can copy and adapt:
+// Check if anything is selected
+if (editor.context.hasSelection) { /* ... */ }
-### Conditional Actions Based on Selection
+// Select a single element
+editor.context.selection = node;
-```js
-// code.js
-import { editor, EditorEvent } from "express-document-sdk";
+// Select multiple elements
+editor.context.selection = [node1, node2, node3];
-// Enable/disable actions based on selection type
-editor.context.on(EditorEvent.selectionChange, () => {
- const selection = editor.context.selection;
-
- // Communicate with your UI panel
- const actions = {
- canGroup: selection.length >= 2,
- canApplyTextStyle: selection.some(node => node.type === "Text"),
- canApplyFill: selection.some(node =>
- ["Rectangle", "Ellipse"].includes(node.type)
- ),
- isEmpty: selection.length === 0
- };
-
- // Send to UI panel for enabling/disabling buttons
- // (Use the communication API to send this data)
-});
+// Clear selection
+editor.context.selection = [];
+
+// Get selection including locked nodes
+const fullSelection = editor.context.selectionIncludingNonEditable;
```
-### Selection-Based Properties Panel
+### Selection Event Handling
```js
-// code.js
-import { editor, EditorEvent } from "express-document-sdk";
-
-// Update properties panel based on selection
-editor.context.on(EditorEvent.selectionChange, () => {
+// Register selection change handler
+const handlerId = editor.context.on(EditorEvent.selectionChange, () => {
const selection = editor.context.selection;
-
- if (selection.length === 1) {
- const node = selection[0]; // Common pattern: access first selected element
-
- // Send node properties to UI for editing
- const properties = {
- type: node.type,
- width: node.width || null,
- height: node.height || null,
- x: node.translation?.x || null,
- y: node.translation?.y || null,
- locked: node.locked || false
- };
-
- // Update UI panel with these properties
- console.log("Node properties:", properties);
- }
+ // Handle selection change
});
-```
-### Working with Single Selection
+// Clean up handler
+editor.context.off(EditorEvent.selectionChange, handlerId);
+```
-Many add-ons focus on single-element operations. Here's a common pattern used throughout the documentation:
+### Common Selection Patterns
```js
-// code.js
-import { editor } from "express-document-sdk";
-
-// Safe access to first selected element (used in use_text.md and other guides)
-if (editor.context.hasSelection) {
- const selectedNode = editor.context.selection[0];
-
- // Perform operations on the selected node
- if (selectedNode.type === "Text") {
- // Handle text-specific operations
- }
-}
+// Access first selected element
+const node = editor.context.selection[0];
+
+// Filter selection by type
+const textNodes = selection.filter(node => node.type === "Text");
+
+// Check selection count
+if (selection.length === 0) { /* nothing selected */ }
+if (selection.length === 1) { /* single selection */ }
+if (selection.length > 1) { /* multiple selection */ }
+
+// Check for specific node types
+const hasText = selection.some(node => node.type === "Text");
+const hasShapes = selection.some(node =>
+ ["Rectangle", "Ellipse"].includes(node.type)
+);
```
## FAQs
diff --git a/src/pages/guides/learn/how_to/index.md b/src/pages/guides/learn/how_to/index.md
index 79bad1f56..55d0b6046 100644
--- a/src/pages/guides/learn/how_to/index.md
+++ b/src/pages/guides/learn/how_to/index.md
@@ -26,67 +26,40 @@ The following guides contain a set of common use cases and accompanying code sni
Try samples in Code Playground!
-Many how-to guides now include a **"Try"** button that opens the code sample directly in the [Code Playground](../../getting_started/code-playground.md). Click the button to instantly test Document API samples in Script mode without setting up a local development environment!
+Many how-to guides now include a **"Try"** button that opens the code sample directly in the [Code Playground](../../getting_started/code-playground-script-mode.md). Click the button to instantly test Document API samples in Script mode without setting up a local development environment!
-We're constantly adding new how-tos, so make sure to check back often. If you're looking for Tutorials that guide you in building add-ons from the ground up, please check the [Complete Projects](#complete-projects) section.
+We're constantly adding new how-tos, so make sure to check back often. If you're looking for **Tutorials** that guide you in building add-ons from the ground up, please check the [Complete Projects](#complete-projects) section.
## How-to guides
-
-
-| Topics | How-to guides |
-| ------------------------------ | --------------------------------------------------------- |
-| Authentication & Authorization | [Use OAuth 2.0](./oauth2.md) |
-| Data & Environment | [Store Data](./local_data_management.md) |
-| | [Theme & Locale](./theme_locale.md) |
-| UI & Interaction | [Use Drag & Drop](./drag_and_drop.md) |
-| | [Use Modal Dialogs](./modal_dialogs.md) |
-| Use Design Elements | [Use Text](./use_text.md) |
-| | [Use Geometry](./use_geometry.md) |
-| | [Use Color](./use_color.md) |
-| | [Use Images](./use_images.md) |
-| | [Use Videos](./use_videos.md) |
-| | [Use Audio](./use_audio.md) |
-| | [Use PDF and PowerPoint](./use_pdf_powerpoint.md) |
-| | [Group Elements](./group_elements.md) |
-| | [Position Elements](./position_elements.md) |
-| | [Resize & Rescale Elements](./resize_rescale_elements.md) |
-| | [Handle Selection](./handle_selection.md) |
-| Manage Pages | [Manage Pages](./manage_pages.md) |
-| Use Metadata | [Document Metadata](./document_metadata.md) |
-| | [Page Metadata](./page_metadata.md) |
-| | [Element Metadata](./element_metadata.md) |
-| Exporting & Output | [Create Renditions](./create_renditions.md) |
-| | [Manage with Premium Content](./premium_content.md) |
-| User Info | [Identify users](./user_info.md) |
+| Topics | How-to guides |
+| ------------------------------ | ------------------------------------------------- |
+| Authentication & Authorization | [Use OAuth 2.0](./oauth2.md) |
+| Data & Environment | [Store Data](./local_data_management.md) |
+| | [Theme & Locale](./theme_locale.md) |
+| UI & Interaction | [Use Drag & Drop](./drag_and_drop.md) |
+| | [Use Modal Dialogs](./modal_dialogs.md) |
+| Document Structure | [Manage Pages](./manage_pages.md) |
+| Use Design Elements | [Use Text](./use_text.md) |
+| | [Use Geometry](./use_geometry.md) |
+| | [Use Color](./use_color.md) |
+| | [Use Images](./use_images.md) |
+| | [Use Videos](./use_videos.md) |
+| | [Use Audio](./use_audio.md) |
+| | [Use PDF and PowerPoint](./use_pdf_powerpoint.md) |
+| | [Handle ElementSelection](./handle_selection.md) |
+| | [Group Elements](./group_elements.md) |
+| | [Position Elements](./position_elements.md) |
+| Use Metadata | [Document Metadata](./document_metadata.md) |
+| | [Page Metadata](./page_metadata.md) |
+| | [Element Metadata](./element_metadata.md) |
+| Exporting & Output | [Create Renditions](./create_renditions.md) |
+| | [Manage Premium Content](./premium_content.md) |
+| User Info | [Identify users](./user_info.md) |
+
+
## Complete Projects
diff --git a/src/pages/guides/learn/how_to/manage_pages.md b/src/pages/guides/learn/how_to/manage_pages.md
index d8dba25ba..54f4421ab 100644
--- a/src/pages/guides/learn/how_to/manage_pages.md
+++ b/src/pages/guides/learn/how_to/manage_pages.md
@@ -41,7 +41,7 @@ faq:
answer: "Adding a page automatically switches to it. You can also access pages via `editor.documentRoot.pages`."
- question: "What happens when I add a page?"
- answer: "A new page with a default artboard is created and automatically becomes the active page and insertion parent."
+ answer: "A new page with a default artboard is created and automatically becomes the active page. The artboard becomes the insertion parent for new content."
- question: "Can I remove pages?"
answer: "Currently, the Document API doesn't provide a direct method to remove pages programmatically."
@@ -51,6 +51,25 @@ faq:
- question: "What are the minimum requirements for a page?"
answer: "Every page must have at least one artboard. The `editor.documentRoot.pages.addPage()` method automatically creates a default artboard."
+canonical: true
+ai_assistant_note: "This is the authoritative guide for managing pages in Adobe Express add-ons.
+ Use this when helping developers understand: how to create pages (using editor.documentRoot.pages.addPage(),
+ NOT createPage()), accessing current and all pages, working with page artboards, page dimensions and geometry,
+ and the relationship between pages, artboards, and content. Important: Always emphasize that pages are created
+ with editor.documentRoot.pages.addPage() - there is NO createPage() method. Adding a page automatically makes
+ it active and switches the viewport to it."
+semantic_tags:
+ - canonical-reference
+ - page-management
+ - document-structure
+ - page-creation
+ - artboards
+ - document-api
+ - page-navigation
+ - page-hierarchy
+ - insertion-context
+ - page-dimensions
+ - best-practices
---
# Manage Pages
@@ -59,14 +78,18 @@ Learn how to programmatically create, access, and manage pages in Adobe Express
## Understanding Pages in Adobe Express
-In Adobe Express, documents are organized hierarchically:
+In Adobe Express, documents are organized as a **scenegraph** - a hierarchical tree structure:
-- **Document** (root)
- - **Pages** (timeline sequence)
- - **Artboards** (scenes within a page)
- - **Content** (text, shapes, media, etc.)
+- **Document** (root - `ExpressRootNode`)
+ - **Pages** (`PageNode` in `PageList`)
+ - **Artboards** (`ArtboardNode` in `ArtboardList` - timeline scenes)
+ - **Content** (shapes, text, images, groups, etc.)
-Every page contains at least one artboard, and all artboards within a page share the same dimensions.
+Every page contains at least one artboard. When a page has multiple artboards, they represent keyframe "scenes" in a linear animation timeline. All artboards within a page share the same dimensions.
+
+
+
+For more on the document scenegraph and node hierarchy, see the [Document API Concepts Guide](../platform_concepts/document-api.md) and [Developer Terminology Guide](../fundamentals/terminology.md).
## Add a Page
@@ -198,7 +221,7 @@ console.log("Number of artboards:", currentPage.artboards.length);
#### TypeScript
```ts
-// sandbox/code.js
+// sandbox/code.ts
import { editor, PageNode } from "express-document-sdk";
// Get the currently active page
@@ -449,7 +472,7 @@ const templatePages = createTemplatePages();
### Check Page Properties
-For detailed page information including content analysis and print readiness, see the [Page Metadata Ho-to Guide](page_metadata.md).
+For detailed page information including content analysis and print readiness, see the [Page Metadata How-to Guide](page_metadata.md).
@@ -513,86 +536,36 @@ function analyzeDocument(): void {
analyzeDocument();
```
-## Key Concepts
-
-### Pages vs Artboards
-
-- **Pages**: Top-level containers in the document timeline
-- **Artboards**: "Scenes" within a page containing the actual content
-- All artboards within a page share the same dimensions
-- When you add a page, it automatically gets one default artboard
-
-### Insertion Context
-
-- Adding a page automatically makes it the active page
-- `editor.context.insertionParent` points to the active artboard
-- New content is added to the current insertion parent
-- The viewport switches to display the new page
+## Key Concepts & Best Practices
-### Common Pitfalls
-
-When working with pages, avoid these common mistakes:
+### Important: Use the Correct Method
-Critical: Use the correct method path
+Pages require a unique API path
-The Adobe Express Document API requires the full method path to create pages:
+Unlike other creation methods (like `editor.createRectangle()`), pages require the full path through the document structure:
- ❌ `editor.addPage()` (doesn't exist)
- ❌ `editor.createPage()` (doesn't exist)
- ✅ `editor.documentRoot.pages.addPage()` (correct)
-1. **Don't assume API consistency** - Unlike other creation methods (like `editor.createRectangle()`), pages require the full path through the document structure.
-2. **Provide page dimensions** - The `addPage()` method requires a geometry parameter with width and height.
-3. **Expect automatic navigation** - Adding a page automatically switches to it and updates the viewport.
-4. **Remember shared dimensions** - All artboards within a page must have the same dimensions.
-
-## Integration with Other APIs
-
-### Using with Metadata APIs
-
-Pages created with `editor.documentRoot.pages.addPage()` can be used with other Document APIs, particularly for retrieving metadata. See the [Page Metadata How-to Guide](page_metadata.md) for complete examples.
-
-
-
-#### JavaScript
-
-```js
-// sandbox/code.js
-import { editor } from "express-document-sdk";
-
-// Add a page and get its metadata
-const newPage = editor.documentRoot.pages.addPage({ width: 1080, height: 1080 });
-
-// Get the page ID for use with Add-on UI SDK metadata APIs
-console.log("New page ID:", newPage.id);
-
-// You can use this ID with the Add-on UI SDK to get detailed metadata
-// See the Page Metadata guide for complete examples:
-// const pageMetadata = await addOnUISdk.app.document.getPagesMetadata({
-// pageIds: [newPage.id]
-// });
-```
-
-#### TypeScript
+### Important Behaviors
-```ts
-// sandbox/code.ts
-import { editor, PageNode } from "express-document-sdk";
+1. **Automatic activation** - Adding a page automatically makes it the active page and switches the viewport to it
+2. **Required dimensions** - The `addPage()` method requires a geometry parameter with width and height
+3. **Default artboard** - Every new page automatically gets one default artboard
+4. **Shared dimensions** - All artboards within a page must have the same dimensions
+5. **Insertion context** - `editor.context.insertionParent` points to the active artboard where new content is added
-// Add a page and get its metadata
-const newPage: PageNode = editor.documentRoot.pages.addPage({ width: 1080, height: 1080 });
+## Integration with Other APIs
-// Get the page ID for use with Add-on UI SDK metadata APIs
-console.log("New page ID:", newPage.id);
+Pages created with `editor.documentRoot.pages.addPage()` integrate seamlessly with other Adobe Express APIs:
-// You can use this ID with the Add-on UI SDK to get detailed metadata
-// See the Page Metadata guide for complete examples:
-// const pageMetadata = await addOnUISdk.app.document.getPagesMetadata({
-// pageIds: [newPage.id]
-// });
-```
+- **Metadata APIs** - Use `newPage.id` with Add-on UI SDK metadata APIs to retrieve detailed page information. See the [Page Metadata How-to Guide](page_metadata.md) for complete examples.
+- **Rendition APIs** - Export specific pages as images, PDFs, or videos. See [Create Renditions](create_renditions.md).
+- **Selection APIs** - Work with selected content on pages. See [Handle Element Selection](handle_selection.md).
+- **Content APIs** - Add text, shapes, images, and other content to page artboards using the Document API.
## FAQs
@@ -614,7 +587,7 @@ console.log("New page ID:", newPage.id);
#### Q: What happens when I add a page?
-**A:** A new page with a default artboard is created and automatically becomes the active page and insertion parent.
+**A:** A new page with a default artboard is created and automatically becomes the active page. The artboard becomes the insertion parent for new content.
#### Q: Can I remove pages?
@@ -654,4 +627,4 @@ console.log("New page ID:", newPage.id);
### Advanced Topics
- **[Create Renditions](create_renditions.md)** - Export specific pages or entire documents as images, PDFs, or videos
-- **[Page Metadata](page_metadata.md)** - Retrieve detailed page information including dimensions, content analysis, and print readiness
+- **[Handle Element Selection](handle_selection.md)** - Work with selected elements on pages
diff --git a/src/pages/guides/learn/how_to/tutorials/grids-addon.md b/src/pages/guides/learn/how_to/tutorials/grids-addon.md
index 674e71643..ec424a5af 100644
--- a/src/pages/guides/learn/how_to/tutorials/grids-addon.md
+++ b/src/pages/guides/learn/how_to/tutorials/grids-addon.md
@@ -99,7 +99,7 @@ Your add-on will allow users to create a variable number of rows and columns, co
As part of the [Document Model Sandbox](/references/document-sandbox/index.md), the Adobe Express Document API (from now on, Document API) is a powerful tool that extends the capabilities of Adobe Express add-ons, offering direct interaction with the open document. Let's take a moment to review the difference between the two core components of the architecture of an add-on.
-- The **iframe** hosts the add-on User Interface and runs its internal logic. You can think about it as a web application operating in a sandboxed environment: it needs to be separate from the rest of the Adobe Express content for security reasons, which is precisely why the add-on is hosted within an `