UNPKG

@atlaskit/adf-schema

Version:

Shared package that contains the ADF-schema (json) and ProseMirror node/mark specs

85 lines (84 loc) 3.35 kB
import type { ParagraphDefinition as Paragraph } from './paragraph'; import type { OrderedListDefinition as OrderedList, BulletListDefinition as BulletList } from './types/list'; import type { HeadingDefinition as Heading } from './heading'; import type { BlockCardDefinition as BlockCard } from './block-card'; import type { CodeBlockDefinition as CodeBlock } from './code-block'; import type { MediaGroupDefinition as MediaGroup } from './media-group'; import type { MediaSingleDefinition as MediaSingle } from './media-single'; import type { DecisionListDefinition as DecisionList } from './decision-list'; import type { TaskListDefinition as TaskList } from './task-list'; import type { RuleDefinition as Rule } from './rule'; import type { TableDefinition as Table } from './tableNodes'; import type { NodeSpec } from '@atlaskit/editor-prosemirror/model'; export declare enum PanelType { INFO = "info", NOTE = "note", TIP = "tip", WARNING = "warning", ERROR = "error", SUCCESS = "success", CUSTOM = "custom" } export interface PanelAttributes { localId?: string; panelColor?: string; panelIcon?: string; panelIconId?: string; panelIconText?: string; panelType: PanelType; } /** * @name panel_node */ export interface PanelDefinition { attrs: PanelAttributes; /** // eslint-disable-next-line eslint-plugin-jsdoc/check-tag-names * @minItems 1 // eslint-disable-next-line eslint-plugin-jsdoc/check-tag-names * @allowUnsupportedBlock true */ content: Array<Paragraph | Heading | OrderedList | BulletList | BlockCard | CodeBlock | MediaGroup | MediaSingle | DecisionList | TaskList | Rule>; type: 'panel'; } /** * @name panel_c1_node */ export interface PanelC1Definition { attrs: PanelAttributes; /** // eslint-disable-next-line eslint-plugin-jsdoc/check-tag-names * @minItems 1 // eslint-disable-next-line eslint-plugin-jsdoc/check-tag-names * @allowUnsupportedBlock true */ content: Array<Paragraph | Heading | OrderedList | BulletList | BlockCard | CodeBlock | MediaGroup | MediaSingle | DecisionList | TaskList | Rule | Table>; type: 'panel'; } export interface DOMAttributes { [propName: string]: string; } /** * @name extended_panel * * it allows more content to be nested as compared to panel node. * Specifically, it allows Media, action, code-block, rule and decision nodes in * addition to content allowed inside panel */ export declare const extendedPanel: (allowCustomPanel: boolean) => NodeSpec; export declare const extendedPanelWithLocalId: (allowCustomPanel: boolean) => NodeSpec; /** * @name extended_panel_c1 * * Depth-level-1 variant of panel. Allows all standard panel content * plus table nodes. Derives its parseDOM/toDOM behaviour from the same * createPanelNodeSpecOptions helper as extendedPanel so that allowCustomPanel * and generateLocalId propagate identically. */ export declare const extendedPanelC1: (allowCustomPanel: boolean) => NodeSpec; export declare const extendedPanelC1WithLocalId: (allowCustomPanel: boolean) => NodeSpec; /** * @name extended_panel_root_only */ export declare const extendedPanelRootOnlyStage0: (allowCustomPanel: boolean) => NodeSpec; export declare const extendedPanelC1RootOnlyStage0: (allowCustomPanel: boolean) => NodeSpec;