Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Doc updates for Document Sandbox APIs #94

Merged
merged 18 commits into from
Oct 3, 2024
Merged

Conversation

vamshich13
Copy link
Collaborator

@vamshich13 vamshich13 commented Sep 27, 2024

Doc updates

  • Text/Fonts APIs
  • Character Styles
  • Grid Cell Node
  • Per Element Metadata APIs (Private Storage)
  • Selection Change Notification Events APIs

Related Issue

Motivation and Context

How Has This Been Tested?

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • I have signed the Adobe Open Source CLA.
  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@vamshich13 vamshich13 changed the title recent APIs exposed to addon SDK Doc updates for Document Sandbox APIs Sep 27, 2024
## 2024-09-30

- Added many new **Text APIs** for improved text management.
- New [`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. `fullContent.text` supersedes `TextNode.text`, now deprecated.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

...returns the TextContentModel containing the complete text string and its styles associated to the Text Flow (aka Threaded Text or Overflow Text).

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Am wondering if we should have a separate section for deprecated methods to highlight it.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added the new text, moved the deprecation in an independent section.

- Added many new **Text APIs** for improved text management.
- New [`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. `fullContent.text` supersedes `TextNode.text`, now deprecated.
- New [`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.
- New [`TextNode.nextTextNode`](./document-sandbox/document-apis/classes/TextNode.md#nexttextnode) accessor: gets the newxt node that overflowing text will spill into.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo 'newxt'.
Can we move this to the second place so that all threaded text related points are next to each other?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done!

- New supporting interfaces, enumerations and type aliases.
- 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.
- 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.
- Added a new [`GridCellNode`](./document-sandbox/document-apis/classes/GridCellNode.md) class that represents a cell in a grid.
Copy link

@padmkris123 padmkris123 Sep 30, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lets also call out the fix for allchildren() which will return the GridCellNode in a logical order from left to right and top to bottom.


#### Returns

`Promise`<`undefined` \| [`AvailableFont`](AvailableFont.md)\>

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vamshich13 Can you check this once? I tried this API. It doesnt return a promise.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

worked for me using:

            const font = await fonts.fromPostscriptName("SourceSans3-Regular");
            console.log("Font:------", font);

@undavide undavide merged commit 02fe7e7 into main Oct 3, 2024
4 checks passed
@undavide undavide deleted the vchiluka/doc-updates branch October 3, 2024 10:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants