Skip to content

Commit

Permalink
add a super barebones section plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
Jonas-C committed Jan 16, 2025
1 parent 986c4cc commit a85006c
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 0 deletions.
14 changes: 14 additions & 0 deletions packages/editor/src/plugins/section/sectionPlugin.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/**
* Copyright (c) 2025-present, NDLA.
*
* This source code is licensed under the GPLv3 license found in the
* LICENSE file in the root directory of this source tree.
*
*/

import { createPlugin } from "../../core/createPlugin";
import { SECTION_ELEMENT_TYPE } from "./sectionTypes";

export const sectionPlugin = createPlugin({
type: SECTION_ELEMENT_TYPE,
});
18 changes: 18 additions & 0 deletions packages/editor/src/plugins/section/sectionTypes.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/**
* Copyright (c) 2025-present, NDLA.
*
* This source code is licensed under the GPLv3 license found in the
* LICENSE file in the root directory of this source tree.
*
*/

import type { Descendant } from "slate";

export const SECTION_ELEMENT_TYPE = "section";

export type SectionElementType = "section";

export interface SectionElement {
type: "section";
children: Descendant[];
}

0 comments on commit a85006c

Please sign in to comment.