@atlaskit/adf-schema
Version:
Shared package that contains the ADF-schema (json) and ProseMirror node/mark specs
58 lines (57 loc) • 2.08 kB
TypeScript
import type { LayoutColumnDefinition } from './layout-column';
import type { BreakoutMarkDefinition } from '../marks';
import type { NodeSpec } from '@atlaskit/editor-prosemirror/model';
/**
* @name layoutSection_node
*/
export type LayoutSectionBaseDefinition = {
attrs?: {
localId?: string;
};
content: Array<LayoutColumnDefinition>;
marks?: Array<BreakoutMarkDefinition>;
type: 'layoutSection';
};
/**
* Need duplicate `type` and `marks` to make both validator and json-schema satisfied
*/
/**
* @name layoutSection_full_node
*/
export type LayoutSectionFullDefinition = LayoutSectionBaseDefinition & {
/**
// eslint-disable-next-line eslint-plugin-jsdoc/check-tag-names
* @minItems 2
// eslint-disable-next-line eslint-plugin-jsdoc/check-tag-names
* @maxItems 3
// eslint-disable-next-line eslint-plugin-jsdoc/check-tag-names
* @allowUnsupportedBlock true
*/
content: Array<LayoutColumnDefinition>;
marks?: Array<BreakoutMarkDefinition>;
type: 'layoutSection';
};
/**
// eslint-disable-next-line eslint-plugin-jsdoc/check-tag-names
* @stage 0
* @name layoutSection_with_single_column_node
*/
export type LayoutSectionWithSingleColumnDefinition = LayoutSectionBaseDefinition & {
/**
// eslint-disable-next-line eslint-plugin-jsdoc/check-tag-names
* @minItems 1
// eslint-disable-next-line eslint-plugin-jsdoc/check-tag-names
* @maxItems 3
// eslint-disable-next-line eslint-plugin-jsdoc/check-tag-names
* @allowUnsupportedBlock true
*/
content: Array<LayoutColumnDefinition>;
marks?: Array<BreakoutMarkDefinition>;
type: 'layoutSection';
};
export type LayoutSectionDefinition = LayoutSectionFullDefinition | LayoutSectionWithSingleColumnDefinition;
export declare const layoutSection: NodeSpec;
export declare const layoutSectionFull: NodeSpec;
export declare const layoutSectionWithSingleColumn: NodeSpec;
export declare const layoutSectionWithLocalId: NodeSpec;
export declare const layoutSectionWithSingleColumnLocalId: NodeSpec;