@live-change/wysiwyg-frontend 0.2.7 → 0.2.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  <template>
2
2
  <div>
3
- <DocumentEditor targetType="Example" target="one" :type="'rich'" :purpose="'test'"
3
+ <DocumentEditor targetType="Example" :target="target" :type="'rich'" :purpose="'test'"
4
4
  :initialContent="emptyContent"
5
5
  :config="contentConfig" />
6
6
  </div>
@@ -11,6 +11,16 @@
11
11
  import DocumentEditor from "./components/DocumentEditor.vue"
12
12
  import { ref } from 'vue'
13
13
  import { basicMarks, messageNodes, richEditorNodes } from "./components/contentConfig.js"
14
+ import { toRefs } from '@vueuse/core'
15
+
16
+ const props = defineProps({
17
+ target: {
18
+ type: String,
19
+ default: 'one'
20
+ }
21
+ })
22
+
23
+ const { target } = toRefs(props)
14
24
 
15
25
  const contentConfig = {
16
26
  marks: {
@@ -0,0 +1,13 @@
1
+ <template>
2
+
3
+ </template>
4
+
5
+ <script>
6
+ export default {
7
+ name: "DocumentPreviewTest"
8
+ }
9
+ </script>
10
+
11
+ <style scoped>
12
+
13
+ </style>
@@ -75,7 +75,7 @@
75
75
  initialContent: props.initialContent
76
76
  })
77
77
 
78
- const saveState = computed(() => authority.synchronizationState ?? 'loading')
78
+ const saveState = computed(() => authority.synchronizationState.value ?? 'loading')
79
79
  emit('update:saveState', saveState.value)
80
80
  watch(() => saveState.value, async (state) => {
81
81
  emit('update:saveState', state)
@@ -110,9 +110,8 @@
110
110
  const documentData = await authority.loadDocument()
111
111
  version.value = authority.remoteVersion
112
112
 
113
- console.log("CONFIG", props.config, 'EXTENSIONS', extensions
114
- )
115
- console.log("DOCUMENT DATA", documentData)
113
+ //console.log("CONFIG", props.config, 'EXTENSIONS', extensions)
114
+ //console.log("DOCUMENT DATA", documentData)
116
115
  const editor = useEditor({
117
116
  content: documentData.content,
118
117
  extensions: [
@@ -76,6 +76,9 @@
76
76
  </FileInput>
77
77
  <!-- </div>-->
78
78
 
79
+ <Button v-if="config.nodes.component" label="Insert Component" class="p-button-sm p-button-primary"
80
+ @click="editor.chain().focus().setHorizontalRule().run()" />
81
+
79
82
  <span v-if="saveState"
80
83
  class="p-button p-component p-button-sm p-button-outlined p-button-secondary cursor-auto
81
84
  inline-block mr-1 mb-1"
@@ -122,6 +125,10 @@
122
125
  saveState: {
123
126
  type: String,
124
127
  default: null
128
+ },
129
+ availableComponents: {
130
+ type: Array,
131
+ default: () => []
125
132
  }
126
133
  })
127
134
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@live-change/wysiwyg-frontend",
3
- "version": "0.2.7",
3
+ "version": "0.2.9",
4
4
  "scripts": {
5
5
  "memDev": "lcli memDev --enableSessions --initScript ./init.js --dbAccess",
6
6
  "localDevInit": "rm tmp.db; lcli localDev --enableSessions --initScript ./init.js",
@@ -20,7 +20,7 @@
20
20
  "debug": "node --inspect-brk server"
21
21
  },
22
22
  "dependencies": {
23
- "@fortawesome/fontawesome-free": "^6.1.1",
23
+ "@fortawesome/fontawesome-free": "^6.2.0",
24
24
  "@live-change/cli": "0.7.4",
25
25
  "@live-change/dao": "0.5.8",
26
26
  "@live-change/dao-vue3": "0.5.8",
@@ -31,8 +31,8 @@
31
31
  "@live-change/secret-code-service": "0.3.2",
32
32
  "@live-change/secret-link-service": "0.3.2",
33
33
  "@live-change/session-service": "0.3.2",
34
- "@live-change/vue3-components": "0.2.15",
35
- "@live-change/vue3-ssr": "0.2.15",
34
+ "@live-change/vue3-components": "0.2.16",
35
+ "@live-change/vue3-ssr": "0.2.16",
36
36
  "@tiptap/extension-blockquote": "^2.0.0-beta.29",
37
37
  "@tiptap/extension-bold": "^2.0.0-beta.28",
38
38
  "@tiptap/extension-bullet-list": "^2.0.0-beta.29",
@@ -85,5 +85,5 @@
85
85
  "author": "",
86
86
  "license": "ISC",
87
87
  "description": "",
88
- "gitHead": "ef577fb31dd857acb491bd7114e611638283fe6f"
88
+ "gitHead": "703c9723562ade7b2420e1b25b28ced51a96db09"
89
89
  }