summaryrefslogtreecommitdiff
path: root/src/client/pages/page-editor/els/page-editor.el.section.vue
diff options
context:
space:
mode:
Diffstat (limited to 'src/client/pages/page-editor/els/page-editor.el.section.vue')
-rw-r--r--src/client/pages/page-editor/els/page-editor.el.section.vue96
1 files changed, 0 insertions, 96 deletions
diff --git a/src/client/pages/page-editor/els/page-editor.el.section.vue b/src/client/pages/page-editor/els/page-editor.el.section.vue
deleted file mode 100644
index 75bdf120c0..0000000000
--- a/src/client/pages/page-editor/els/page-editor.el.section.vue
+++ /dev/null
@@ -1,96 +0,0 @@
-<template>
-<XContainer @remove="() => $emit('remove')" :draggable="true">
- <template #header><i class="fas fa-sticky-note"></i> {{ value.title }}</template>
- <template #func>
- <button @click="rename()" class="_button">
- <i class="fas fa-pencil-alt"></i>
- </button>
- <button @click="add()" class="_button">
- <i class="fas fa-plus"></i>
- </button>
- </template>
-
- <section class="ilrvjyvi">
- <XBlocks class="children" v-model="value.children" :hpml="hpml"/>
- </section>
-</XContainer>
-</template>
-
-<script lang="ts">
-import { defineComponent, defineAsyncComponent } from 'vue';
-import { v4 as uuid } from 'uuid';
-import XContainer from '../page-editor.container.vue';
-import * as os from '@client/os';
-
-export default defineComponent({
- components: {
- XContainer,
- XBlocks: defineAsyncComponent(() => import('../page-editor.blocks.vue')),
- },
-
- inject: ['getPageBlockList'],
-
- props: {
- value: {
- required: true
- },
- hpml: {
- required: true,
- },
- },
-
- data() {
- return {
- };
- },
-
- created() {
- if (this.value.title == null) this.value.title = null;
- if (this.value.children == null) this.value.children = [];
- },
-
- mounted() {
- if (this.value.title == null) {
- this.rename();
- }
- },
-
- methods: {
- async rename() {
- const { canceled, result: title } = await os.dialog({
- title: 'Enter title',
- input: {
- type: 'text',
- default: this.value.title
- },
- showCancelButton: true
- });
- if (canceled) return;
- this.value.title = title;
- },
-
- async add() {
- const { canceled, result: type } = await os.dialog({
- type: null,
- title: this.$ts._pages.chooseBlock,
- select: {
- groupedItems: this.getPageBlockList()
- },
- showCancelButton: true
- });
- if (canceled) return;
-
- const id = uuid();
- this.value.children.push({ id, type });
- },
- }
-});
-</script>
-
-<style lang="scss" scoped>
-.ilrvjyvi {
- > .children {
- padding: 16px;
- }
-}
-</style>