|
|
@@ -1,127 +0,0 @@
|
|
|
-<script setup lang="ts">
|
|
|
-import { Block } from "@enesis/editor"
|
|
|
-import { ref } from "vue"
|
|
|
-
|
|
|
-const content = ref(`# Welcome
|
|
|
-This is a **block editor** with markdown decorations.
|
|
|
-
|
|
|
-> [!NOTE] This is a callout block with important information.
|
|
|
-> This is a continuation of the callout -^
|
|
|
-
|
|
|
-[[Page Name]] creates a page reference chip, while ((block-id)) creates a block reference.
|
|
|
-
|
|
|
-#tag creates a tag chip, and you can use links like [this link](https://example.com).
|
|
|
-
|
|
|
-📅 2026-05-20 is a date
|
|
|
-
|
|
|
-\`\`\`python
|
|
|
-def hello():
|
|
|
- print("Hello from CM6!")
|
|
|
- for i in range(3):
|
|
|
- print(f"Line {i}")
|
|
|
-\`\`\`
|
|
|
-
|
|
|
-property:: This is a property line
|
|
|
-another:: [[Page reference]] in a property
|
|
|
-`)
|
|
|
-
|
|
|
-const task1 = ref(`# Test callout
|
|
|
-> [!NOTE] First line of the callout
|
|
|
-> second line continuation
|
|
|
-`)
|
|
|
-const task2 = ref("DOING this is another task")
|
|
|
-const task3 = ref("DONE a completed task [#A]")
|
|
|
-
|
|
|
-function log(event: string, payload?: unknown) {
|
|
|
- console.log(`[Block] ${event}`, payload)
|
|
|
-
|
|
|
- if (event === "blur") {
|
|
|
- console.log(content.value)
|
|
|
- }
|
|
|
-}
|
|
|
-</script>
|
|
|
-
|
|
|
-<template>
|
|
|
- <div class="p-8 max-w-2xl mx-auto">
|
|
|
- <Block
|
|
|
- v-model:content="content"
|
|
|
- :focused="true"
|
|
|
- cursor-position="end"
|
|
|
- marker-mode="always-visible"
|
|
|
- @change="log('change', $event)"
|
|
|
- @split="log('split', $event)"
|
|
|
- @merge-previous="log('merge-previous')"
|
|
|
- @delete-if-empty="log('delete-if-empty')"
|
|
|
- @indent="log('indent')"
|
|
|
- @outdent="log('outdent')"
|
|
|
- @arrow-up-from-start="log('arrow-up-from-start')"
|
|
|
- @arrow-down-from-end="log('arrow-down-from-end')"
|
|
|
- @pattern-open="log('pattern-open', $event)"
|
|
|
- @pattern-update="log('pattern-update', $event)"
|
|
|
- @pattern-close="log('pattern-close', $event)"
|
|
|
- @focus="log('focus', $event)"
|
|
|
- @blur="log('blur')"
|
|
|
- @selection-change="log('selection-change', $event)"
|
|
|
- />
|
|
|
-
|
|
|
- <Block
|
|
|
- v-model:content="task1"
|
|
|
- :focused="true"
|
|
|
- cursor-position="end"
|
|
|
- @change="log('change', $event)"
|
|
|
- @split="log('split', $event)"
|
|
|
- @merge-previous="log('merge-previous')"
|
|
|
- @delete-if-empty="log('delete-if-empty')"
|
|
|
- @indent="log('indent')"
|
|
|
- @outdent="log('outdent')"
|
|
|
- @arrow-up-from-start="log('arrow-up-from-start')"
|
|
|
- @arrow-down-from-end="log('arrow-down-from-end')"
|
|
|
- @pattern-open="log('pattern-open', $event)"
|
|
|
- @pattern-update="log('pattern-update', $event)"
|
|
|
- @pattern-close="log('pattern-close', $event)"
|
|
|
- @focus="log('focus', $event)"
|
|
|
- @blur="log('blur')"
|
|
|
- @selection-change="log('selection-change', $event)"
|
|
|
- />
|
|
|
-
|
|
|
- <Block
|
|
|
- v-model:content="task2"
|
|
|
- :focused="true"
|
|
|
- cursor-position="end"
|
|
|
- @change="log('change', $event)"
|
|
|
- @split="log('split', $event)"
|
|
|
- @merge-previous="log('merge-previous')"
|
|
|
- @delete-if-empty="log('delete-if-empty')"
|
|
|
- @indent="log('indent')"
|
|
|
- @outdent="log('outdent')"
|
|
|
- @arrow-up-from-start="log('arrow-up-from-start')"
|
|
|
- @arrow-down-from-end="log('arrow-down-from-end')"
|
|
|
- @pattern-open="log('pattern-open', $event)"
|
|
|
- @pattern-update="log('pattern-update', $event)"
|
|
|
- @pattern-close="log('pattern-close', $event)"
|
|
|
- @focus="log('focus', $event)"
|
|
|
- @blur="log('blur')"
|
|
|
- @selection-change="log('selection-change', $event)"
|
|
|
- />
|
|
|
-
|
|
|
- <Block
|
|
|
- v-model:content="task3"
|
|
|
- :focused="true"
|
|
|
- cursor-position="end"
|
|
|
- @change="log('change', $event)"
|
|
|
- @split="log('split', $event)"
|
|
|
- @merge-previous="log('merge-previous')"
|
|
|
- @delete-if-empty="log('delete-if-empty')"
|
|
|
- @indent="log('indent')"
|
|
|
- @outdent="log('outdent')"
|
|
|
- @arrow-up-from-start="log('arrow-up-from-start')"
|
|
|
- @arrow-down-from-end="log('arrow-down-from-end')"
|
|
|
- @pattern-open="log('pattern-open', $event)"
|
|
|
- @pattern-update="log('pattern-update', $event)"
|
|
|
- @pattern-close="log('pattern-close', $event)"
|
|
|
- @focus="log('focus', $event)"
|
|
|
- @blur="log('blur')"
|
|
|
- @selection-change="log('selection-change', $event)"
|
|
|
- />
|
|
|
- </div>
|
|
|
-</template>
|