-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: attribute standardization (#1685)
The current attributes for our standard annotations have some messiness about them. This is an effort to clean up attributes and to provide a more standardized API that is consistent across more annotations. These decisions are made in conjunction with thinking about how our content is presented by our designers for sites like vogue.com, where some features that editors and writers use are not representable currently in our annotations. We would like to provide more support and therefore, I'm introducing two major changes: size and inset become layout. These fields did not mix and match and allowing both properties made it confusing for developers as to which field took precedence. This also allows designers to add new types of layouts without having to change the data model. alignment becomes textAlignment This is pretty self-explanatory, and is about clarity. Note that layout as a property is added to many more blocks than size and inset were on previously. This is intentional, since there are instances where editorial teams have used these features on these blocks. We may not provide them controls to change these properties, but we would like to fully support these and respect their decisions when it comes time to represent the data for our sites to use for rendering. Additionally, support was added for x.com / twitter.com, and other unimplemented embeds were removed.
- Loading branch information
Showing
46 changed files
with
652 additions
and
369 deletions.
There are no files selected for viewing
13 changes: 12 additions & 1 deletion
13
packages/@atjson/offset-annotations/src/annotations/blockquote.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 0 additions & 32 deletions
32
packages/@atjson/offset-annotations/src/annotations/caption-source.ts
This file was deleted.
Oops, something went wrong.
22 changes: 21 additions & 1 deletion
22
packages/@atjson/offset-annotations/src/annotations/ceros-embed.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 29 additions & 2 deletions
31
packages/@atjson/offset-annotations/src/annotations/facebook-embed.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,33 @@ | ||
import { IframeEmbed } from "./iframe-embed"; | ||
import { BlockAnnotation } from "@atjson/document"; | ||
|
||
export class FacebookEmbed extends IframeEmbed { | ||
export class FacebookEmbed extends BlockAnnotation<{ | ||
/** | ||
* The URL to the embed on www.facebook.com | ||
*/ | ||
url: string; | ||
|
||
/** | ||
* If set to true, this hides the text attached to a photo post. | ||
*/ | ||
hideText?: boolean; | ||
|
||
/** | ||
* Layout information, used to indicate mutually | ||
* exclusive layouts, for example sizes, floats, etc. | ||
*/ | ||
layout?: string; | ||
|
||
/** | ||
* A named identifier used to quickly jump to this item | ||
*/ | ||
anchorName?: string; | ||
|
||
/** | ||
* The post content at the time of embedding, ususally | ||
* a textual representation of the content with some links. | ||
*/ | ||
content?: string; | ||
}> { | ||
static type = "facebook-embed"; | ||
static vendorPrefix = "offset"; | ||
} |
19 changes: 19 additions & 0 deletions
19
packages/@atjson/offset-annotations/src/annotations/firework-embed.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 18 additions & 1 deletion
19
packages/@atjson/offset-annotations/src/annotations/heading.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 8 additions & 1 deletion
9
packages/@atjson/offset-annotations/src/annotations/horizontal-rule.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,13 @@ | ||
import { BlockAnnotation } from "@atjson/document"; | ||
|
||
export class HorizontalRule extends BlockAnnotation { | ||
export class HorizontalRule extends BlockAnnotation<{ | ||
/** | ||
* Indicates a stylistic alternate for a horizontal | ||
* rule, which can be used to divide content for | ||
* special reports or stories. | ||
*/ | ||
style?: string; | ||
}> { | ||
static vendorPrefix = "offset"; | ||
static type = "horizontal-rule"; | ||
} |
32 changes: 30 additions & 2 deletions
32
packages/@atjson/offset-annotations/src/annotations/iframe-embed.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
packages/@atjson/offset-annotations/src/annotations/image.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 30 additions & 2 deletions
32
packages/@atjson/offset-annotations/src/annotations/instagram-embed.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,34 @@ | ||
import { IframeEmbed } from "./iframe-embed"; | ||
import { BlockAnnotation } from "@atjson/document"; | ||
|
||
export class InstagramEmbed extends IframeEmbed { | ||
export class InstagramEmbed extends BlockAnnotation<{ | ||
/** | ||
* The URL to the post on www.instagram.com | ||
*/ | ||
url: string; | ||
|
||
/** | ||
* If set to false, this excludes the caption attached to the post. | ||
* This maps to the `captioned` option on the embed. | ||
*/ | ||
excludePostCaption?: boolean; | ||
|
||
/** | ||
* Layout information, used to indicate mutually | ||
* exclusive layouts, for example sizes, floats, etc. | ||
*/ | ||
layout?: string; | ||
|
||
/** | ||
* A named identifier used to quickly jump to this item | ||
*/ | ||
anchorName?: string; | ||
|
||
/** | ||
* The post content at the time of embedding, ususally | ||
* a textual representation of the content with some links. | ||
*/ | ||
content?: string; | ||
}> { | ||
static type = "instagram-embed"; | ||
static vendorPrefix = "offset"; | ||
} |
Oops, something went wrong.