Skip to content

Commit

Permalink
feat: new annotation design
Browse files Browse the repository at this point in the history
  • Loading branch information
vinay-pr committed Jun 6, 2024
1 parent 2625c62 commit 154229e
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 49 deletions.

This file was deleted.

43 changes: 17 additions & 26 deletions packages/@atjson/offset-annotations/src/annotations/accordion.ts
Original file line number Diff line number Diff line change
@@ -1,37 +1,28 @@
import { BlockAnnotation } from "@atjson/document";
/**
*
* Each accordion item contains the following attributes
* header: contains the title of the content in the panel
* panel: could contain text, pictures, embeds, videos
* opened: determines whether the panel is hidden or shown
* anchorName: helps as hyperlinks on the web page
* Web Accessibility Initiative – Accessible Rich Internet Applications
* WAI/ARIA
* https://www.w3.org/WAI/ARIA/apg/patterns/accordion/examples/accordion/
*/

export class Accordion extends BlockAnnotation<{
/**
* Slice referring to the header of the accordion,
* which is initially visible.
* Each accordion has an array of accordion items, where each item
* has the slice ID for the header and the sliceID for the panel
* Each item can also optionally have an `anchorName` and an `opened` flag
* to describe its initial state.
* WAI ARIA - https://www.w3.org/WAI/ARIA/apg/patterns/accordion/examples/accordion/
*/
header: string;
/**
* Slice referring to the panel content of the accordion.
* This should be shown when the panel is in a default
* opened state or it is opened by a user by tapping
* the header.
*/
panel?: string;
/**
* Initial state of this accordion.
* (TBD what consumers initially should do.)
*/
opened?: boolean;
items: {
header: string;
panel: string;
anchorName?: string;
opened?: boolean;
}[];
/**
* A named identifier used to quickly jump to this item
*/
anchorName?: string;
/**
* Layout information, used to indicate mutually
* exclusive layouts, for example sizes, floats, etc.
*/
layout?: string;
}> {
static type = "accordion";
static vendorPrefix = "offset";
Expand Down
1 change: 0 additions & 1 deletion packages/@atjson/offset-annotations/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ export default class OffsetSource extends Document {
static contentType = "application/vnd.atjson+offset";
static schema = [
Accordion,
AccordionGroup,
Blockquote,
Bold,
CerosEmbed,
Expand Down

0 comments on commit 154229e

Please sign in to comment.