diff --git a/packages/core/lib/components/Schlechtenburg.tsx b/packages/core/lib/components/Schlechtenburg.tsx index 16ef119..0fe44a3 100644 --- a/packages/core/lib/components/Schlechtenburg.tsx +++ b/packages/core/lib/components/Schlechtenburg.tsx @@ -13,7 +13,7 @@ import { ITreeNode, } from '../types'; import { model } from '../block-helpers'; -import { Mode, SbMode } from '../mode'; +import { SymMode, SbMode } from '../mode'; import { SymBlockLibrary} from '../use-dynamic-blocks'; import { SymBlockTree, @@ -58,7 +58,7 @@ export const SbMain = defineComponent({ useResizeObserver(el, SymEditorDimensions); const mode = ref(props.mode); - provide(Mode, mode); + provide(SymMode, mode); const activeBlock = ref(null); provide(SymActiveBlock, activeBlock); diff --git a/packages/core/lib/mode.ts b/packages/core/lib/mode.ts index 4139fb9..3325c31 100644 --- a/packages/core/lib/mode.ts +++ b/packages/core/lib/mode.ts @@ -1,5 +1,8 @@ +/** + * The mode the Schlechtenburg editor is currently in + */ export enum SbMode { Edit = 'edit', Display = 'display', } -export const Mode = Symbol('Schlechtenburg mode'); +export const SymMode = Symbol('Schlechtenburg mode'); diff --git a/packages/core/lib/use-dynamic-blocks.ts b/packages/core/lib/use-dynamic-blocks.ts index 23fe5a2..1da0ce0 100644 --- a/packages/core/lib/use-dynamic-blocks.ts +++ b/packages/core/lib/use-dynamic-blocks.ts @@ -4,11 +4,11 @@ import { reactive, } from 'vue'; import { IBlockLibrary } from './types'; -import { Mode, SbMode } from './mode'; +import { SymMode, SbMode } from './mode'; export const SymBlockLibrary = Symbol('Schlechtenburg block library'); export function useDynamicBlocks() { - const mode = inject(Mode, ref(SbMode.Edit)); + const mode = inject(SymMode, ref(SbMode.Edit)); const customBlocks: IBlockLibrary = inject(SymBlockLibrary, reactive({})); const getBlock = (name: string) => customBlocks[name]; diff --git a/packages/docs/lib/App.scss b/packages/docs/lib/App.scss index cce0aed..f0b8357 100644 --- a/packages/docs/lib/App.scss +++ b/packages/docs/lib/App.scss @@ -3,9 +3,20 @@ -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; color: #2c3e50; - padding: 3rem 4rem; + display: flex; - &--mode { - margin-bottom: 2rem; + &--sidemenu { + width: 300px; + padding: 3rem 1rem; + } + + &--main { + padding: 3rem 4rem; + margin: 0 auto; + flex-basis: 700px; + flex-shrink: 1; + flex-grow: 0; + display: flex; + flex-direction: column; } } diff --git a/packages/docs/lib/App.tsx b/packages/docs/lib/App.tsx index ac604d0..7a700ec 100644 --- a/packages/docs/lib/App.tsx +++ b/packages/docs/lib/App.tsx @@ -11,8 +11,8 @@ export default defineComponent({ setup() { return () =>
Component <{docs.displayName} />
{docs.description}
+ +{prop.description}
+ {prop.type ?Type: {prop.type.name}
Default: {prop.defaultValue.value}
{docs.kindString}
-{docs.comment}
+{docs.kindString}
+{docs.comment?.shortText || ''}
+ + {...(docs.children || []).map(child =>
+ {child.name}: {child.type?.name}
+
)}