Skip to content

Commit 02fe7e7

Browse files
authored
Merge pull request #94 from AdobeDocs/vchiluka/doc-updates
Doc updates for Document Sandbox APIs
2 parents dea462c + be8b4ac commit 02fe7e7

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+2351
-161
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ This section outlines the steps that should be taken to format the generated Doc
2222

2323
3. The API signatures generated in `classes`, `enumerations`, `interfaces`, `namespaces`, and `type-aliases` is indented. In these directories, find and replace all occurrences of `newline + > + space` with `newline + • + space`, ensuring no code example or closing tag is replaced.
2424

25-
4. Find and replace all \`mat2d\` --> \[\`mat2d\`\]\(https://glmatrix.net/docs/module-mat2d.html\)
25+
4. Find and replace all \`mat2d\` --> \[\`mat2d\`\]\(https://glmatrix.net/docs/module-mat2d.html)
2626

2727
5. Fix any `[iterator]` links to remove the brackets from the link references to ensure they work. For instance: `ArtboardList.md#%5Biterator%5D` should be `ArtboardList.md#iterator`. To fix, use Search again with a regex string of `.md#%5Biterator%5D` and replace with `.md#iterator`.
2828

gatsby-config.js

+94-2
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,10 @@ module.exports = {
126126
title: "Classes",
127127
path: "references/document-sandbox/document-apis/classes/Editor.md",
128128
pages: [
129+
{
130+
title: "AddOnData",
131+
path: "references/document-sandbox/document-apis/classes/AddOnData.md",
132+
},
129133
{
130134
title: "ArtboardList",
131135
path: "references/document-sandbox/document-apis/classes/ArtboardList.md",
@@ -134,6 +138,14 @@ module.exports = {
134138
title: "ArtboardNode",
135139
path: "references/document-sandbox/document-apis/classes/ArtboardNode.md",
136140
},
141+
{
142+
title: "AvailableFont",
143+
path: "references/document-sandbox/document-apis/classes/AvailableFont.md",
144+
},
145+
{
146+
title: "BaseFont",
147+
path: "references/document-sandbox/document-apis/classes/BaseFont.md",
148+
},
137149
{
138150
title: "BaseNode",
139151
path: "references/document-sandbox/document-apis/classes/BaseNode.md",
@@ -166,6 +178,14 @@ module.exports = {
166178
title: "FillableNode",
167179
path: "references/document-sandbox/document-apis/classes/FillableNode.md",
168180
},
181+
{
182+
title: "Fonts",
183+
path: "references/document-sandbox/document-apis/classes/Fonts.md",
184+
},
185+
{
186+
title: "GridCellNode",
187+
path: "references/document-sandbox/document-apis/classes/GridCellNode.md",
188+
},
169189
{
170190
title: "GridLayoutNode",
171191
path: "references/document-sandbox/document-apis/classes/GridLayoutNode.md",
@@ -230,10 +250,18 @@ module.exports = {
230250
title: "StrokeShapeNode",
231251
path: "references/document-sandbox/document-apis/classes/StrokeShapeNode.md",
232252
},
253+
{
254+
title: "TextContentModel",
255+
path: "references/document-sandbox/document-apis/classes/TextContentModel.md",
256+
},
233257
{
234258
title: "TextNode",
235259
path: "references/document-sandbox/document-apis/classes/TextNode.md",
236260
},
261+
{
262+
title: "UnavailableFont",
263+
path: "references/document-sandbox/document-apis/classes/UnavailableFont.md",
264+
},
237265
{
238266
title: "UnknownNode",
239267
path: "references/document-sandbox/document-apis/classes/UnknownNode.md",
@@ -246,12 +274,36 @@ module.exports = {
246274
},
247275
{
248276
title: "Interfaces",
249-
path: "references/document-sandbox/document-apis/interfaces/BitmapImage.md",
277+
path: "references/document-sandbox/document-apis/interfaces/AreaTextLayout.md",
250278
pages: [
279+
{
280+
title: "AreaTextLayout",
281+
path: "references/document-sandbox/document-apis/interfaces/AreaTextLayout.md",
282+
},
283+
{
284+
title: "AutoHeightTextLayout",
285+
path: "references/document-sandbox/document-apis/interfaces/AutoHeightTextLayout.md",
286+
},
251287
{
252288
title: "BitmapImage",
253289
path: "references/document-sandbox/document-apis/interfaces/BitmapImage.md",
254290
},
291+
{
292+
title: "CharacterStyles",
293+
path: "references/document-sandbox/document-apis/interfaces/CharacterStyles.md",
294+
},
295+
{
296+
title: "CharacterStylesInput",
297+
path: "references/document-sandbox/document-apis/interfaces/CharacterStylesInput.md",
298+
},
299+
{
300+
title: "CharacterStylesRange",
301+
path: "references/document-sandbox/document-apis/interfaces/CharacterStylesRange.md",
302+
},
303+
{
304+
title: "CharacterStylesRangeInput",
305+
path: "references/document-sandbox/document-apis/interfaces/CharacterStylesRangeInput.md",
306+
},
255307
{
256308
title: "Color",
257309
path: "references/document-sandbox/document-apis/interfaces/Color.md",
@@ -292,6 +344,14 @@ module.exports = {
292344
title: "Point",
293345
path: "references/document-sandbox/document-apis/interfaces/Point.md",
294346
},
347+
{
348+
title: "PointTextLayout",
349+
path: "references/document-sandbox/document-apis/interfaces/PointTextLayout.md",
350+
},
351+
{
352+
title: "Rect",
353+
path: "references/document-sandbox/document-apis/interfaces/Rect.md",
354+
},
295355
{
296356
title: "RectangleGeometry",
297357
path: "references/document-sandbox/document-apis/interfaces/RectangleGeometry.md",
@@ -300,6 +360,14 @@ module.exports = {
300360
title: "Stroke",
301361
path: "references/document-sandbox/document-apis/interfaces/Stroke.md",
302362
},
363+
{
364+
title: "StyleRange",
365+
path: "references/document-sandbox/document-apis/interfaces/StyleRange.md",
366+
},
367+
{
368+
title: "UnsupportedTextLayout",
369+
path: "references/document-sandbox/document-apis/interfaces/UnsupportedTextLayout.md",
370+
},
303371
],
304372
},
305373
{
@@ -314,6 +382,10 @@ module.exports = {
314382
title: "BlendMode",
315383
path: "references/document-sandbox/document-apis/enumerations/BlendMode.md",
316384
},
385+
{
386+
title: "EditorEvent",
387+
path: "references/document-sandbox/document-apis/enumerations/EditorEvent.md",
388+
},
317389
{
318390
title: "FillRule",
319391
path: "references/document-sandbox/document-apis/enumerations/FillRule.md",
@@ -338,12 +410,32 @@ module.exports = {
338410
title: "TextAlignment",
339411
path: "references/document-sandbox/document-apis/enumerations/TextAlignment.md",
340412
},
413+
{
414+
title: "TextType",
415+
path: "references/document-sandbox/document-apis/enumerations/TextType.md",
416+
},
417+
{
418+
title: "VisualEffectType",
419+
path: "references/document-sandbox/document-apis/enumerations/VisualEffectType.md",
420+
},
341421
],
342422
},
343423
{
344424
title: "Types",
345-
path: "references/document-sandbox/document-apis/type-aliases/SolidColorStrokeWithOptionalType.md",
425+
path: "references/document-sandbox/document-apis/type-aliases/EditorEventHandler.md",
346426
pages: [
427+
{
428+
title: "EditorEventHandler",
429+
path: "references/document-sandbox/document-apis/type-aliases/EditorEventHandler.md",
430+
},
431+
{
432+
title: "EventHandlerId",
433+
path: "references/document-sandbox/document-apis/type-aliases/EventHandlerId.md",
434+
},
435+
{
436+
title: "Font",
437+
path: "references/document-sandbox/document-apis/type-aliases/Font.md",
438+
},
347439
{
348440
title: "SolidColorStrokeWithOptionalType",
349441
path: "references/document-sandbox/document-apis/type-aliases/SolidColorStrokeWithOptionalType.md",

src/pages/references/changelog.md

+28
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,34 @@ contributors:
2121

2222
# Changelog
2323

24+
## 2024-09-30
25+
26+
### New
27+
28+
- Added many new **Text APIs** for improved text management.
29+
- [`TextNode.fullContent`](./document-sandbox/document-apis/classes/TextNode.md#fullcontent) accessor: returns the [`TextContentModel`](./document-sandbox/document-apis/classes/TextContentModel.md) containing the complete text string and its styles associated to the Text Flow (Threaded Text or Overflow Text).
30+
- [`TextNode.nextTextNode`](./document-sandbox/document-apis/classes/TextNode.md#nexttextnode) accessor: gets the next node that overflowing text will spill into.
31+
- [`TextNode.layout`](./document-sandbox/document-apis/classes/TextNode.md#layout) accessor: gets and sets the [`TextType`](./document-sandbox/document-apis/enumerations/TextType.md) of the text node frame.
32+
- [`TextNode.visualEffects`](./document-sandbox/document-apis/classes/TextNode.md#visualeffects) accessor: list of [`VisualEffectType`](./document-sandbox/document-apis/enumerations/VisualEffectType.md) applied to the text node.
33+
- [`TextContentModel.characterStyleRanges`](./document-sandbox/document-apis/classes/TextContentModel.md#characterstyleranges) accessor: list of [character style](./document-sandbox/document-apis/interfaces/CharacterStyles.md) ranges in the text content, controlling the [`color`](./document-sandbox/document-apis/interfaces/CharacterStyles.md#color), [`font`](./document-sandbox/document-apis/interfaces/CharacterStyles.md) ranges in the text content, controlling the [`color`](./document-sandbox/document-apis/interfaces/CharacterStyles.md#font), [`fontSize`](./document-sandbox/document-apis/interfaces/CharacterStyles.md) ranges in the text content, controlling the [`color`](./document-sandbox/document-apis/interfaces/CharacterStyles.md#fontsize), [`tracking`](./document-sandbox/document-apis/interfaces/CharacterStyles.md) ranges in the text content, controlling the [`color`](./document-sandbox/document-apis/interfaces/CharacterStyles.md#tracking) and [`underline`](./document-sandbox/document-apis/interfaces/CharacterStyles.md) ranges in the text content, controlling the [`color`](./document-sandbox/document-apis/interfaces/CharacterStyles.md#underline) properties.
34+
- [AvailableFont](./document-sandbox/document-apis/classes/AvailableFont.md) and [UnavailableFont](./document-sandbox/document-apis/classes/UnavailableFont.md) classes.
35+
- Supporting interfaces, enumerations and type aliases.
36+
- Added **Per Element Metadata APIs**: with this feature, add-ons can store private metadata to any node of the Express document. This metadata is accessible only to the add-on that has set it. See the [`AddOnData`](./document-sandbox/document-apis/classes/AddOnData.md) class and the [`addOnData`](./document-sandbox/document-apis/classes/BaseNode.md#addondata) accessor for the BaseNode class.
37+
- Added **Selection Change Notification Events APIs**: add-on can register to be notified when selection and properties in the selection changes on the document. The [`Context`](./document-sandbox/document-apis/classes/Context.md) class will expose two [`on()`](./document-sandbox/document-apis/classes/Context.md#on) and [`off()`](./document-sandbox/document-apis/classes/Context.md#off) methods which can be used to register and un-register selection change and selection properties change notifications.
38+
- Added a new [`GridCellNode`](./document-sandbox/document-apis/classes/GridCellNode.md) class that represents a **cell in a grid**.
39+
40+
<InlineAlert slots="text" variant="warning"/>
41+
42+
**IMPORTANT:** This round of new APIs is currently ***experimental only*** with the exception of `TextNode.fullContent.text`, and should not be used in any add-ons you will be distributing until it has been declared stable. To use them, you will first need to set the `experimentalApis` flag to `true` in the [`requirements`](../references/manifest/index.md#requirements) section of the `manifest.json`.
43+
44+
### Fixed
45+
46+
- [`GridLayoutNode.allChildren`](../references/document-sandbox/document-apis/classes/GridLayoutNode.md#allchildren) does not include rectangle nodes.
47+
48+
### Deprecated
49+
50+
- [`TextNode.text`](../references/document-sandbox/document-apis/classes/TextNode.md#text) is now deprecated; it is still working, but will be removed in a future update. Please use [`TextNode.fullContent.text`](../references/document-sandbox/document-apis/classes/TextNode.md#fullcontent) instead.
51+
2452
## 2024-09-24
2553

2654
- Adds a new [`addAnimatedImage()`](./addonsdk/app-document.md#addanimatedimage) method which can be used to add **animated GIF** images to the document (as long as they fit within certain [technical constraints](./addonsdk/app-document.md#image-requirements)).
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,131 @@
1+
[@express-document-sdk](../overview.md) / AddOnData
2+
3+
# Class: AddOnData
4+
5+
AddOnData class provides APIs to read, write, remove private metadata to a Node.
6+
This metadata is accessible only to the add-on that has set it.
7+
8+
<InlineAlert slots="text" variant="warning"/>
9+
10+
**IMPORTANT:** This is currently ***experimental only*** and should not be used in any add-ons you will be distributing until it has been declared stable. To use it, you will first need to set the `experimentalApis` flag to `true` in the [`requirements`](../../../manifest/index.md#requirements) section of the `manifest.json`.
11+
12+
## Accessors
13+
14+
### remainingQuota
15+
16+
`get` **remainingQuota**(): `Readonly`<`object`\>
17+
18+
#### Returns
19+
20+
`Readonly`<`object`\>
21+
22+
an object with the remaining quota for private metadata on the node for this add-on.
23+
The object contains the following properties:
24+
25+
- sizeInBytes: The remaining quota size in bytes (maximum 3KB).
26+
- numKeys: The remaining quota for the number of keys (maximum 20 keys).
27+
28+
##### numKeys
29+
30+
**numKeys**: `number`
31+
32+
##### sizeInBytes
33+
34+
**sizeInBytes**: `number`
35+
36+
## Methods
37+
38+
### `[iterator]`()
39+
40+
**\[iterator\]**(): `Iterator`<[`string`, `string`], `any`, `undefined`\>
41+
42+
#### Returns
43+
44+
`Iterator`<[`string`, `string`], `any`, `undefined`\>
45+
46+
an iterator for all the private metadata entries on the node.
47+
The iterator yields the metadata key-value pairs.
48+
49+
---
50+
51+
### clear()
52+
53+
**clear**(): `void`
54+
55+
Clears all private metadata entries on the node.
56+
57+
#### Returns
58+
59+
`void`
60+
61+
---
62+
63+
### getItem()
64+
65+
**getItem**(`key`): `undefined` \| `string`
66+
67+
Retrieves the private metadata value for the specified key on the node.
68+
69+
#### Parameters
70+
71+
**key**: `string`
72+
73+
The key of the private metadata entry to retrieve.
74+
75+
#### Returns
76+
77+
`undefined` \| `string`
78+
79+
The value of the private metadata entry.
80+
81+
---
82+
83+
### keys()
84+
85+
**keys**(): `string`[]
86+
87+
#### Returns
88+
89+
`string`[]
90+
91+
an array of all keys for the private metadata entries on the node.
92+
93+
---
94+
95+
### removeItem()
96+
97+
**removeItem**(`key`): `void`
98+
99+
Removes a single private metadata entry on the node.
100+
101+
#### Parameters
102+
103+
**key**: `string`
104+
105+
The key of the private metadata entry to remove.
106+
107+
#### Returns
108+
109+
`void`
110+
111+
---
112+
113+
### setItem()
114+
115+
**setItem**(`key`, `value`): `void`
116+
117+
Sets a private metadata entry on the node.
118+
119+
#### Parameters
120+
121+
**key**: `string`
122+
123+
The key for the private metadata entry.
124+
125+
**value**: `string`
126+
127+
The value for the private metadata entry.
128+
129+
#### Returns
130+
131+
`void`

0 commit comments

Comments
 (0)