@live-change/content-frontend 0.2.12 → 0.2.16
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.
- package/front/src/components/Metadata.vue +70 -68
- package/front/src/components/NotAuthorizedAdminButtons.vue +32 -0
- package/front/src/components/Page.vue +8 -2
- package/front/src/components/PageEditor.vue +7 -4
- package/front/src/components/contentConfig.js +3 -2
- package/package.json +4 -8
- package/server/page.documentType.js +103 -0
- package/server/{content.documentType.js → rich.documentType.js} +0 -0
- package/server/services.config.js +2 -1
|
@@ -58,75 +58,77 @@
|
|
|
58
58
|
const canonicalUrl = `https://${canonicalUrlDomain}/${canonical.value?.path ?? ''}`
|
|
59
59
|
|
|
60
60
|
let ogImage = []
|
|
61
|
-
if(m
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
61
|
+
if(m) {
|
|
62
|
+
if (m.ogImage) {
|
|
63
|
+
const image = m.ogImage
|
|
64
|
+
ogImage = [
|
|
65
|
+
{property: 'og:image', content: `https://${canonicalUrlDomain}/api/image/image/${image.id}`},
|
|
66
|
+
{property: 'og:image:width', content: image.width},
|
|
67
|
+
{property: 'og:image:height', content: image.height},
|
|
68
|
+
{property: 'og:image:type', content: 'image/' + image.extension}
|
|
69
|
+
]
|
|
70
|
+
}
|
|
70
71
|
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
72
|
+
useMeta({
|
|
73
|
+
title: m.title,
|
|
74
|
+
description: m.description,
|
|
75
|
+
link: [
|
|
76
|
+
{rel: 'canonical', href: canonicalUrl}
|
|
77
|
+
],
|
|
78
|
+
meta: [
|
|
79
|
+
metaProperty('og:title', m.og.title),
|
|
80
|
+
metaProperty('og:description', m.og.description),
|
|
81
|
+
...ogImage,
|
|
82
|
+
metaProperty('og:determiner', m.og.determiner),
|
|
83
|
+
metaProperty('og:locale', m.og.locale),
|
|
84
|
+
...metaProperties('og:locale:alternate', m.og.localeAlternate),
|
|
85
|
+
metaProperty('og:type', m.og.type),
|
|
86
|
+
|
|
87
|
+
metaProperty('og:music:duration', m.og.music.duration),
|
|
88
|
+
...metaPropertiesObjects('og:music:album', m.og.music.album),
|
|
89
|
+
...metaPropertiesObjects('og:music:song', m.og.music.song),
|
|
90
|
+
...metaProperties('og:music:musician', m.og.music.duration),
|
|
91
|
+
metaProperty('og:music:release_date', m.og.music.releaseDate),
|
|
92
|
+
...metaProperties('og:music:creator', m.og.music.creator),
|
|
93
|
+
|
|
94
|
+
metaProperty('og:video:duration', m.og.video.duration),
|
|
95
|
+
metaProperty('og:viceo:release_date', m.og.video.releaseDate),
|
|
96
|
+
...metaPropertiesObjects('og:video:duration', m.og.video.actors),
|
|
97
|
+
...metaProperties('og:video:director', m.og.video.director),
|
|
98
|
+
...metaProperties('og:video:writer', m.og.video.writer),
|
|
99
|
+
...metaProperties('og:video:series', m.og.video.series),
|
|
100
|
+
...metaProperties('og:video:tag', m.og.video.tag),
|
|
101
|
+
|
|
102
|
+
...metaProperties('og:profile:first_name', m.og.profile.firstName),
|
|
103
|
+
...metaProperties('og:profile:last_name', m.og.profile.lastName),
|
|
104
|
+
...metaProperties('og:profile:username', m.og.profile.username),
|
|
105
|
+
...metaProperties('og:profile:gender', m.og.profile.gender),
|
|
106
|
+
|
|
107
|
+
metaProperty('og:article:published_time', m.og.article.publishedTime),
|
|
108
|
+
metaProperty('og:article:modified_time', m.og.article.modifiedTime),
|
|
109
|
+
metaProperty('og:article:expiration_time', m.og.article.expirationTime),
|
|
110
|
+
...metaProperties('og:article:author', m.og.article.author),
|
|
111
|
+
metaProperty('og:article:section', m.og.article.section),
|
|
112
|
+
...metaProperties('og:article:tag', m.og.article.tag),
|
|
113
|
+
|
|
114
|
+
...metaProperties('og:book:author', m.og.book.author),
|
|
115
|
+
metaProperty('og:book:isbn', m.og.book.isbn),
|
|
116
|
+
metaProperty('og:book:release_date', m.og.book.releaseDate),
|
|
117
|
+
...metaProperties('og:book:tag', m.og.book.tag),
|
|
118
|
+
|
|
119
|
+
{property: 'og:url', content: canonicalUrl},
|
|
120
|
+
|
|
121
|
+
|
|
122
|
+
/* { property: 'og:url', content: m.url },
|
|
123
|
+
{ property: 'og:type', content: 'website' },
|
|
124
|
+
{ property: 'twitter:card', content: 'summary_large_image' },
|
|
125
|
+
{ property: 'twitter:title', content: metadata.value.title },
|
|
126
|
+
{ property: 'twitter:description', content: metadata.value.description },
|
|
127
|
+
{ property: 'twitter:image', content: metadata.value.image },
|
|
128
|
+
{ property: 'twitter:url', content: metadata.value.url }*/
|
|
129
|
+
].filter(x => !!x)
|
|
130
|
+
})
|
|
131
|
+
}
|
|
130
132
|
</script>
|
|
131
133
|
|
|
132
134
|
<style scoped>
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="absolute top-0 right-0 pr-4 max-h-0 flex align-items-center z-5">
|
|
3
|
+
<router-link :to="{ name: 'content:pageEditor', params: { pageId: target } }" class="no-underline">
|
|
4
|
+
<Button icon="pi pi-pencil"
|
|
5
|
+
class="p-button p-button-icon-only p-button-rounded p-button-warning mr-2" />
|
|
6
|
+
</router-link>
|
|
7
|
+
</div>
|
|
8
|
+
</template>
|
|
9
|
+
|
|
10
|
+
<script setup>
|
|
11
|
+
import Button from 'primevue/button'
|
|
12
|
+
|
|
13
|
+
const props = defineProps({
|
|
14
|
+
path: {
|
|
15
|
+
type: String,
|
|
16
|
+
required: true
|
|
17
|
+
},
|
|
18
|
+
target: {
|
|
19
|
+
type: String,
|
|
20
|
+
required: true
|
|
21
|
+
}
|
|
22
|
+
})
|
|
23
|
+
|
|
24
|
+
import { toRefs } from "@vueuse/core"
|
|
25
|
+
|
|
26
|
+
const { target } = toRefs(props)
|
|
27
|
+
|
|
28
|
+
</script>
|
|
29
|
+
|
|
30
|
+
<style scoped>
|
|
31
|
+
|
|
32
|
+
</style>
|
|
@@ -5,12 +5,17 @@
|
|
|
5
5
|
<LimitedAccess :requiredRoles="['writer']" objectType="content_Page" :object="target" hidden>
|
|
6
6
|
<PageAdminButtons :page="target" :style="style" :class="clazz" :name="urlPath.value" />
|
|
7
7
|
</LimitedAccess>
|
|
8
|
-
<Content objectType="content_Page" :object="target" />
|
|
8
|
+
<Content objectType="content_Page" :object="target" class="w-full" />
|
|
9
9
|
</template>
|
|
10
10
|
<template #notFound="{ path, style, class: clazz }">
|
|
11
11
|
<NotFoundAdminButtons v-if="canCreatePage" :path="urlPath" :style="style" :class="clazz" />
|
|
12
12
|
<NotFound :style="style" :class="clazz" />
|
|
13
13
|
</template>
|
|
14
|
+
<template #notAuthorized="{ path, style, class: clazz, target, access }">
|
|
15
|
+
<NotAuthorizedAdminButtons v-if="(access?.roles ?? []).includes('writer')"
|
|
16
|
+
:path="urlPath" :style="style" :class="clazz" :target="target" />
|
|
17
|
+
<NotAuthorized :style="style" :class="clazz" />
|
|
18
|
+
</template>
|
|
14
19
|
</ResolveUrl>
|
|
15
20
|
</template>
|
|
16
21
|
|
|
@@ -18,8 +23,9 @@
|
|
|
18
23
|
import Button from "primevue/button"
|
|
19
24
|
import PageAdminButtons from "./PageAdminButtons.vue"
|
|
20
25
|
import NotFoundAdminButtons from "./NotFoundAdminButtons.vue"
|
|
26
|
+
import NotAuthorizedAdminButtons from "./NotAuthorizedAdminButtons.vue"
|
|
21
27
|
|
|
22
|
-
import { ResolveUrl, NotFound } from "@live-change/url-frontend"
|
|
28
|
+
import { ResolveUrl, NotFound, NotAuthorized } from "@live-change/url-frontend"
|
|
23
29
|
import { LimitedAccess } from "@live-change/access-control-frontend";
|
|
24
30
|
import Content from "./Content.vue"
|
|
25
31
|
import Metadata from "./Metadata.vue"
|
|
@@ -23,10 +23,13 @@
|
|
|
23
23
|
</Accordion>
|
|
24
24
|
|
|
25
25
|
<DocumentEditor v-if="pageData" targetType="content_Page" :target="pageId" purpose="page"
|
|
26
|
-
:config="contentConfig" type="
|
|
26
|
+
:config="contentConfig" type="page" v-model:saveState="saveState" v-model:version="version">
|
|
27
27
|
<template #menuEnd="{}">
|
|
28
28
|
|
|
29
|
-
<
|
|
29
|
+
<router-link :to="{name: 'content:pagePreview', params: { page: pageId }}" target="_blank"
|
|
30
|
+
class="no-underline">
|
|
31
|
+
<Button icon="pi pi-eye" label="Preview" class="p-button-secondary p-button-sm mr-1 mb-1" />
|
|
32
|
+
</router-link>
|
|
30
33
|
|
|
31
34
|
<div class="p-buttonset mr-1 mb-1 border-round">
|
|
32
35
|
<button type="button"
|
|
@@ -110,7 +113,7 @@
|
|
|
110
113
|
live(liveCanonicalUrlPath),
|
|
111
114
|
live(livePublicAccessPath),
|
|
112
115
|
live(liveMetadataPath)
|
|
113
|
-
])
|
|
116
|
+
]).catch(e => [null, null, null, null])
|
|
114
117
|
|
|
115
118
|
const publicAccessLevel = computed(() => {
|
|
116
119
|
if(publicAccessData?.sessionRoles?.includes('reader')) return 'session'
|
|
@@ -129,7 +132,7 @@
|
|
|
129
132
|
acceptClass: 'p-button-danger',
|
|
130
133
|
accept: async () => {
|
|
131
134
|
api.actions.content.publish({
|
|
132
|
-
objectType: 'content_Page', object: pageId.value, version: snapshotVersion, type: '
|
|
135
|
+
objectType: 'content_Page', object: pageId.value, version: snapshotVersion, type: 'page'
|
|
133
136
|
}).then(() => {
|
|
134
137
|
toast.add({ severity: 'success', summary: 'Published', detail: 'Page published', life: 3000 })
|
|
135
138
|
}).catch(e => {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { config } from "@live-change/wysiwyg-frontend"
|
|
2
2
|
|
|
3
|
-
const { basicMarks,
|
|
3
|
+
const { basicMarks, pageNodes } = config
|
|
4
4
|
|
|
5
5
|
const contentConfig = {
|
|
6
6
|
marks: {
|
|
@@ -8,7 +8,8 @@ const contentConfig = {
|
|
|
8
8
|
},
|
|
9
9
|
nodes: {
|
|
10
10
|
//...messageNodes,
|
|
11
|
-
|
|
11
|
+
//...richEditorNodes
|
|
12
|
+
...pageNodes
|
|
12
13
|
}
|
|
13
14
|
}
|
|
14
15
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@live-change/content-frontend",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.16",
|
|
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",
|
|
@@ -26,14 +26,10 @@
|
|
|
26
26
|
"@live-change/dao-vue3": "0.5.8",
|
|
27
27
|
"@live-change/dao-websocket": "0.5.8",
|
|
28
28
|
"@live-change/framework": "0.7.5",
|
|
29
|
-
"@live-change/image-service": "0.3.
|
|
30
|
-
"@live-change/session-service": "0.3.
|
|
29
|
+
"@live-change/image-service": "0.3.5",
|
|
30
|
+
"@live-change/session-service": "0.3.5",
|
|
31
31
|
"@live-change/vue3-components": "0.2.16",
|
|
32
32
|
"@live-change/vue3-ssr": "0.2.16",
|
|
33
|
-
"@tiptap/extension-highlight": "^2.0.0-beta.33",
|
|
34
|
-
"@tiptap/extension-underline": "2.0.0-beta.23",
|
|
35
|
-
"@tiptap/starter-kit": "^2.0.0-beta.185",
|
|
36
|
-
"@tiptap/vue-3": "2.0.0-beta.91",
|
|
37
33
|
"@vueuse/core": "^9.1.0",
|
|
38
34
|
"codeceptjs-assert": "^0.0.5",
|
|
39
35
|
"compression": "^1.7.4",
|
|
@@ -67,5 +63,5 @@
|
|
|
67
63
|
"author": "",
|
|
68
64
|
"license": "ISC",
|
|
69
65
|
"description": "",
|
|
70
|
-
"gitHead": "
|
|
66
|
+
"gitHead": "6faf9721eb991a0d08289aa9a7914479afb893fb"
|
|
71
67
|
}
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
"marks": {
|
|
3
|
+
"bold": {},
|
|
4
|
+
"italic": {},
|
|
5
|
+
"underline": {},
|
|
6
|
+
"strike": {}
|
|
7
|
+
},
|
|
8
|
+
"nodes": {
|
|
9
|
+
"paragraph": {
|
|
10
|
+
"content": "inline*",
|
|
11
|
+
"group": "block"
|
|
12
|
+
},
|
|
13
|
+
"horizontalRule": {
|
|
14
|
+
"group": "block"
|
|
15
|
+
},
|
|
16
|
+
"heading": {
|
|
17
|
+
"content": "inline*",
|
|
18
|
+
"group": "block",
|
|
19
|
+
"defining": true,
|
|
20
|
+
"attrs": {
|
|
21
|
+
"level": {
|
|
22
|
+
"default": 1
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
"blockquote": {
|
|
27
|
+
"content": "block+",
|
|
28
|
+
"group": "block",
|
|
29
|
+
"defining": true
|
|
30
|
+
},
|
|
31
|
+
"codeBlock": {
|
|
32
|
+
"content": "text*",
|
|
33
|
+
"marks": "",
|
|
34
|
+
"group": "block",
|
|
35
|
+
"code": true,
|
|
36
|
+
"defining": true,
|
|
37
|
+
"attrs": {
|
|
38
|
+
"language": {
|
|
39
|
+
"default": null
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
"bulletList": {
|
|
44
|
+
"content": "listItem+",
|
|
45
|
+
"group": "block list"
|
|
46
|
+
},
|
|
47
|
+
"orderedList": {
|
|
48
|
+
"content": "listItem+",
|
|
49
|
+
"group": "block list",
|
|
50
|
+
"attrs": {
|
|
51
|
+
"start": {
|
|
52
|
+
"default": 1
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
},
|
|
56
|
+
"listItem": {
|
|
57
|
+
"content": "paragraph block*",
|
|
58
|
+
"defining": true
|
|
59
|
+
},
|
|
60
|
+
"image": {
|
|
61
|
+
"content": "",
|
|
62
|
+
"marks": "",
|
|
63
|
+
"group": "block",
|
|
64
|
+
"inline": false,
|
|
65
|
+
"atom": true,
|
|
66
|
+
"selectable": true,
|
|
67
|
+
"draggable": true,
|
|
68
|
+
"attrs": {
|
|
69
|
+
"image": {
|
|
70
|
+
"default": null
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
},
|
|
74
|
+
"doc": {
|
|
75
|
+
"content": "block+"
|
|
76
|
+
},
|
|
77
|
+
"text": {
|
|
78
|
+
"group": "inline"
|
|
79
|
+
},
|
|
80
|
+
"hardBreak": {
|
|
81
|
+
"group": "inline",
|
|
82
|
+
"inline": true,
|
|
83
|
+
"selectable": false
|
|
84
|
+
},
|
|
85
|
+
"component": {
|
|
86
|
+
"content": "block*",
|
|
87
|
+
"marks": "",
|
|
88
|
+
"group": "block",
|
|
89
|
+
"inline": false,
|
|
90
|
+
"selectable": true,
|
|
91
|
+
"draggable": true,
|
|
92
|
+
"attrs": {
|
|
93
|
+
"is": {
|
|
94
|
+
"default": "card"
|
|
95
|
+
},
|
|
96
|
+
"attrs": {
|
|
97
|
+
"default": {}
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
},
|
|
102
|
+
"topNode": "doc"
|
|
103
|
+
}
|
|
File without changes
|
|
@@ -43,7 +43,8 @@ module.exports = {
|
|
|
43
43
|
name: 'prosemirror',
|
|
44
44
|
path: '@live-change/prosemirror-service',
|
|
45
45
|
documentTypes: {
|
|
46
|
-
|
|
46
|
+
page: require('./page.documentType.js'),
|
|
47
|
+
rich: require('./rich.documentType.js'),
|
|
47
48
|
},
|
|
48
49
|
testLatency: 2000
|
|
49
50
|
},
|