@live-change/blog-frontend 0.2.17

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2021 Michał Łaszczewski
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,11 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <!--head-->
5
+ </head>
6
+ <body>
7
+ <div id="app"><!--app-html--></div>
8
+ <!--app-data-->
9
+ <script type="module" src="/src/entry-client.js"></script>
10
+ </body>
11
+ </html>
@@ -0,0 +1,84 @@
1
+ {
2
+ "content": {
3
+ "metadata": {
4
+ "title": "Title",
5
+ "description": "Description",
6
+ "og:title": "Open Graph",
7
+ "og": {
8
+ "title": "Title",
9
+ "description": "Description",
10
+ "image": "Image",
11
+ "determiner": "Determiner",
12
+ "locale": "Locale",
13
+ "localeAlternate:title": "Locale Alternate",
14
+ "type": "Type",
15
+ "type:options": {
16
+ "website": "Website",
17
+ "article": "Article",
18
+ "profile": "Profile",
19
+ "book": "Book",
20
+ "music": {
21
+ "song": "Music Song",
22
+ "album": "Music Album",
23
+ "playlist": "Music Playlist",
24
+ "radio_station": "Music Radio Station"
25
+ },
26
+ "video": {
27
+ "movie": "Video Movie",
28
+ "episode": "Video Episode",
29
+ "tv_show": "Video TV Show",
30
+ "other": "Video Other"
31
+ }
32
+ },
33
+ "music:title": "Music",
34
+ "music": {
35
+ "duration": "Duration",
36
+ "song:title": "Song",
37
+ "creator:title": "Creator",
38
+ "album:title": "Album",
39
+ "album": {
40
+ "url": "URL",
41
+ "disc": "Disc",
42
+ "track": "Track"
43
+ },
44
+ "song": {
45
+ "url": "URL",
46
+ "disc": "Disc",
47
+ "track": "Track"
48
+ },
49
+ "musician:title": "Musician"
50
+ },
51
+ "video:title": "Video",
52
+ "video": {
53
+ "duration": "Duration",
54
+ "actor:title": "Actor",
55
+ "actor": {
56
+ "url": "URL",
57
+ "role": "Role"
58
+ },
59
+ "director:title": "Director",
60
+ "writer:title": "Writer",
61
+ "releaseDate": "Release Date",
62
+ "tag:title": "Tag",
63
+ "series": "Series"
64
+ },
65
+ "article:title": "Article",
66
+ "article": {
67
+ "publishedTime": "Published Time",
68
+ "modifiedTime": "Modified Time",
69
+ "expirationTime": "Expiration Time",
70
+ "author:title": "Authors",
71
+ "section": "Section",
72
+ "tag:title": "Tags"
73
+ },
74
+ "book:title": "Book",
75
+ "book": {
76
+ "author:title": "Authors",
77
+ "isbn": "ISBN",
78
+ "releaseDate": "Release Date",
79
+ "tag:title": "Tags"
80
+ }
81
+ }
82
+ }
83
+ }
84
+ }
Binary file
@@ -0,0 +1,38 @@
1
+ <?xml version="1.0" encoding="UTF-8" standalone="no"?>
2
+ <!-- Generator: Adobe Illustrator 16.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
3
+
4
+ <svg
5
+ version="1.1"
6
+ id="Layer_1"
7
+ x="0px"
8
+ y="0px"
9
+ width="512px"
10
+ height="512px"
11
+ viewBox="0 0 512 512"
12
+ enable-background="new 0 0 512 512"
13
+ xml:space="preserve"
14
+ xmlns="http://www.w3.org/2000/svg"
15
+ xmlns:svg="http://www.w3.org/2000/svg"
16
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
17
+ xmlns:cc="http://creativecommons.org/ns#"
18
+ xmlns:dc="http://purl.org/dc/elements/1.1/"><metadata
19
+ id="metadata9"><rdf:RDF><cc:Work
20
+ rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
21
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" /></cc:Work></rdf:RDF></metadata><defs
22
+ id="defs7" />
23
+ <rect
24
+ style="fill:#dbdbdb;fill-opacity:1;stroke:none;stroke-width:1.88976383;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
25
+ id="rect821"
26
+ width="512.54236"
27
+ height="512.54236"
28
+ x="0.54237288"
29
+ y="0.54237235" />
30
+ <path
31
+ style="fill:#f6f6f6;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
32
+ d="M 0.54237288,470.23729 125.83051,306.44068 l 60.20339,70.50847 130.71186,-174.10169 195.79661,261.42373 0.54235,48.81353 H 0.54237288 Z"
33
+ id="path816" /><circle
34
+ style="fill:#f6f6f6;fill-opacity:1;stroke:none;stroke-width:4.80000019;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
35
+ id="path818"
36
+ cx="118.50848"
37
+ cy="106.57627"
38
+ r="57.762711" /></svg>
@@ -0,0 +1,33 @@
1
+ <?xml version="1.0" encoding="UTF-8" standalone="no"?>
2
+ <!-- Generator: Adobe Illustrator 16.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
3
+
4
+ <svg
5
+ version="1.1"
6
+ id="Layer_1"
7
+ x="0px"
8
+ y="0px"
9
+ width="512px"
10
+ height="512px"
11
+ viewBox="0 0 512 512"
12
+ enable-background="new 0 0 512 512"
13
+ xml:space="preserve"
14
+ xmlns="http://www.w3.org/2000/svg"
15
+ xmlns:svg="http://www.w3.org/2000/svg"
16
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
17
+ xmlns:cc="http://creativecommons.org/ns#"
18
+ xmlns:dc="http://purl.org/dc/elements/1.1/"><metadata
19
+ id="metadata9"><rdf:RDF><cc:Work
20
+ rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
21
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" /></cc:Work></rdf:RDF></metadata><defs
22
+ id="defs7" />
23
+ <rect
24
+ style="fill:#dbdbdb;fill-opacity:1;stroke:none;stroke-width:1.88976383;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
25
+ id="rect821"
26
+ width="512.54236"
27
+ height="512.54236"
28
+ x="0.54237288"
29
+ y="0.54237235" /><path
30
+ d="m 313.14122,310.64877 c 9.02181,-8.85097 12.15686,-31.23733 20.41627,-39.3056 11.69771,-11.43183 24.39381,-25.50218 27.98588,-43.06851 4.82003,-23.34203 -4.96846,-26.30516 -4.96846,-34.3713 0,-16.90002 -0.15376,-44.65739 -5.43081,-62.68607 -0.30326,-23.7809 -4.20499,-34.123578 -12.38858,-43.031138 -7.72017,-8.33522 -26.68637,-6.366203 -36.59125,-11.85361 C 286.83605,67.825407 274.23818,64.594254 258.15823,64.17461 v -0.09503 c -0.47624,0 -0.93539,0.05659 -1.41162,0.05659 -0.78484,0 -1.53123,-0.05659 -2.35343,-0.05659 l 0.0395,0.151627 c -39.17105,1.472492 -80.84608,26.170627 -95.16524,65.895863 -5.31335,14.71958 -3.28881,46.87521 -3.28881,63.77522 0,8.06721 -9.78742,11.02927 -4.96846,34.37131 3.61129,17.56632 16.28817,31.63668 27.98588,43.06851 8.26048,8.06827 11.39446,30.45462 20.39705,39.30559 1.96902,13.0378 2.1986,9.31012 2.12278,21.23954 -0.0203,4.03307 0.11426,10.28502 -6.32669,16.4398 -12.17822,11.6614 -40.14595,36.95324 -63.08756,46.79832 -30.24,12.98014 -79.41203,33.74237 -90.746691,39.59069 -11.334661,5.84833 -41.2532541,21.69763 -41.2532541,31.79045 0,10.11417 0,47.33542 0,47.33542 h 253.3742451 5.79494 253.37318 c 0,0 0,-37.22125 0,-47.33542 0,-10.09282 -29.89723,-25.94212 -41.25645,-31.79045 -11.35389,-5.84938 -60.48321,-26.61055 -90.72641,-39.59069 -22.32976,-9.57707 -49.43685,-33.81712 -62.09344,-45.84158 -4.2808,-4.05228 -7.3016,-8.29784 -7.3411,-18.62023 -0.0737,-12.00417 0.23278,-7.41692 2.14306,-20.01478"
31
+ id="path2"
32
+ style="clip-rule:evenodd;fill-rule:evenodd;stroke-width:1.06779659;fill:#f6f6f6;fill-opacity:1" />
33
+ </svg>
@@ -0,0 +1,34 @@
1
+ <?xml version="1.0" encoding="UTF-8" standalone="no"?>
2
+ <svg
3
+ width="512"
4
+ height="512"
5
+ viewBox="0 0 135.46667 135.46667"
6
+ version="1.1"
7
+ id="svg977"
8
+ xmlns="http://www.w3.org/2000/svg"
9
+ xmlns:svg="http://www.w3.org/2000/svg"
10
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
11
+ xmlns:cc="http://creativecommons.org/ns#"
12
+ xmlns:dc="http://purl.org/dc/elements/1.1/">
13
+ <defs
14
+ id="defs971" />
15
+ <metadata
16
+ id="metadata974">
17
+ <rdf:RDF>
18
+ <cc:Work
19
+ rdf:about="">
20
+ <dc:format>image/svg+xml</dc:format>
21
+ <dc:type
22
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
23
+ </cc:Work>
24
+ </rdf:RDF>
25
+ </metadata>
26
+ <g
27
+ id="layer1"
28
+ style="fill:#666666">
29
+ <path
30
+ style="fill:#666666;fill-opacity:1;stroke:none;stroke-width:2.70907px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
31
+ d="M 54.181439,13.558436 67.726801,0.01304296 135.45359,67.739804 67.726801,135.46667 29.799793,97.539626 V 65.030766 L 13.545362,81.285197 0,67.739804 40.636077,27.103727 81.272154,67.739804 67.726801,81.285197 51.472371,65.030766 V 92.12155 l 16.25443,16.25433 40.636069,-40.636076 z"
32
+ id="path892" />
33
+ </g>
34
+ </svg>
Binary file
@@ -0,0 +1,42 @@
1
+ <template>
2
+ <view-root>
3
+ <template #navbar>
4
+ <NavBar />
5
+ </template>
6
+ </view-root>
7
+ </template>
8
+
9
+ <script setup>
10
+ import 'primevue/resources/themes/saga-green/theme.css'
11
+ import "@fortawesome/fontawesome-free/css/all.min.css"
12
+
13
+ import ViewRoot from "@live-change/frontend-base/ViewRoot.vue"
14
+ import NavBar from "./NavBar.vue"
15
+
16
+ import { useI18n } from 'vue-i18n'
17
+ const i18n = useI18n()
18
+
19
+ import { useMeta } from 'vue-meta'
20
+ const { meta } = useMeta({
21
+ title: 'Title',
22
+ htmlAttrs: {
23
+ lang: i18n.locale.value,
24
+ amp: true
25
+ }
26
+ })
27
+
28
+ import { watch } from 'vue'
29
+ import { client as useClient } from '@live-change/vue3-ssr'
30
+ const client = useClient()
31
+ watch(client, (newClient, oldClient) => {
32
+ console.log("WATCH CLIENT", oldClient, '=>', newClient)
33
+ })
34
+
35
+ import { useApi } from '@live-change/vue3-ssr'
36
+ const api = useApi()
37
+ import emailValidator from "@live-change/email-service/clientEmailValidator.js"
38
+ import passwordValidator from "@live-change/password-authentication-service/clientPasswordValidator.js"
39
+ api.validators.email = emailValidator
40
+ api.validators.password = passwordValidator
41
+
42
+ </script>
@@ -0,0 +1,127 @@
1
+ <template>
2
+ <div class="surface-overlay py-3 px-6 shadow-2 flex align-items-center justify-content-between
3
+ relative sticky top-0 z-5"
4
+ style="min-height: 80px" key="navbar">
5
+ <img src="/images/logo.svg" alt="Image" height="40" class="mr-0 lg:mr-6">
6
+ <div class="hidden lg:flex">
7
+ <!-- place for desktop menu -->
8
+ </div>
9
+ <div class="flex flex-grow-1"></div>
10
+ <UserIcon />
11
+
12
+
13
+ <div class="static w-auto w-full surface-overlay left-0 top-100 z-1 shadow-none hidden">
14
+ <ul class="list-none p-0 m-0 flex align-items-center select-none flex-row border-top-none">
15
+ <li>
16
+ <a v-ripple class="flex p-3 px-3 align-items-center text-600 hover:text-900 hover:surface-100
17
+ font-medium border-round cursor-pointer transition-colors transition-duration-150 p-ripple">
18
+ <i class="pi pi-inbox text-base text-2xl mr-0"></i>
19
+ </a>
20
+ </li>
21
+ <li>
22
+ <a v-ripple class="flex p-3 px-3 align-items-center text-600 hover:text-900 hover:surface-100 font-medium
23
+ border-round cursor-pointer transition-colors transition-duration-150 p-ripple">
24
+ <i class="pi pi-bell text-base lg:text-2xl mr-2 lg:mr-0" v-badge.danger></i>
25
+ </a>
26
+ </li>
27
+ </ul>
28
+ </div>
29
+
30
+
31
+ <a v-ripple class="cursor-pointer block lg:hidden text-700 p-ripple ml-2 hover:surface-100 p-2"
32
+ v-styleclass="{ selector: '@next', enterClass: 'hidden', leaveToClass: 'hidden', hideOnOutsideClick: true }">
33
+ <i class="pi pi-bars text-4xl"></i>
34
+ </a>
35
+ <div class="align-items-center flex-grow-1 justify-content-between hidden absolute lg:static w-full surface-overlay left-0 top-100 z-1 shadow-2 lg:shadow-none">
36
+ <ul class="list-none p-0 m-0 flex lg:align-items-center select-none flex-column lg:flex-row">
37
+ <li>
38
+ <a v-ripple class="flex px-6 p-3 lg:px-3 lg:py-2 align-items-center text-600 hover:text-900 hover:surface-100 font-medium border-round cursor-pointer transition-colors transition-duration-150 p-ripple">
39
+ <i class="pi pi-home mr-2"></i>
40
+ <span>Home</span>
41
+ </a>
42
+ </li>
43
+ <li class="lg:relative">
44
+ <a v-ripple class="flex px-6 p-3 lg:px-3 lg:py-2 align-items-center text-600 hover:text-900 hover:surface-100 font-medium border-round cursor-pointer transition-colors transition-duration-150 p-ripple"
45
+ v-styleclass="{ selector: '@next', enterClass: 'hidden', enterActiveClass: 'scalein', leaveToClass: 'hidden', leaveActiveClass: 'fadeout', hideOnOutsideClick: true }">
46
+ <i class="pi pi-users mr-2"></i>
47
+ <span>Customers</span>
48
+ <i class="pi pi-angle-down ml-auto lg:ml-3"></i>
49
+ </a>
50
+ <ul class="list-none py-3 px-6 m-0 lg:px-0 lg:py-0 border-round shadow-0 lg:shadow-2 lg:border-1 border-50 lg:absolute surface-overlay hidden origin-top w-full lg:w-15rem cursor-pointer">
51
+ <li>
52
+ <a v-ripple class="flex p-3 align-items-center text-600 hover:text-900 hover:surface-100 transition-colors transition-duration-150 p-ripple">
53
+ <i class="pi pi-user-plus mr-2"></i>
54
+ <span class="font-medium">Add New</span>
55
+ </a>
56
+ </li>
57
+ <li class="relative">
58
+ <a v-ripple class="flex p-3 align-items-center text-600 hover:text-900 hover:surface-100 transition-colors transition-duration-150 p-ripple"
59
+ v-styleclass="{ selector: '@next', enterClass: 'hidden', enterActiveClass: 'scalein', leaveToClass: 'hidden', leaveActiveClass: 'fadeout', hideOnOutsideClick: true }">
60
+ <i class="pi pi-search mr-2"></i>
61
+ <span class="font-medium">Search</span>
62
+ <i class="pi pi-angle-down ml-auto lg:-rotate-90"></i>
63
+ </a>
64
+ <ul class="list-none py-3 pl-3 m-0 lg:px-0 lg:py-0 border-round shadow-0 lg:shadow-2 lg:border-1 border-50 lg:absolute surface-overlay hidden origin-top w-full lg:w-15rem cursor-pointer left-100 top-0">
65
+ <li>
66
+ <a v-ripple class="flex p-3 align-items-center text-600 hover:text-900 hover:surface-100 transition-colors transition-duration-150 p-ripple">
67
+ <i class="pi pi-shopping-cart mr-2"></i>
68
+ <span class="font-medium">Purchases</span>
69
+ </a>
70
+ </li>
71
+ <li class="relative">
72
+ <a v-ripple class="flex p-3 align-items-center text-600 hover:text-900 hover:surface-100 transition-colors transition-duration-150 p-ripple">
73
+ <i class="pi pi-comments mr-2"></i>
74
+ <span class="font-medium">Messages</span>
75
+ </a>
76
+ </li>
77
+ </ul>
78
+ </li>
79
+ </ul>
80
+ </li>
81
+ <li>
82
+ <a v-ripple class="flex px-6 p-3 lg:px-3 lg:py-2 align-items-center text-600 hover:text-900 hover:surface-100 font-medium border-round cursor-pointer transition-colors transition-duration-150 p-ripple">
83
+ <i class="pi pi-calendar mr-2"></i>
84
+ <span>Calendar</span>
85
+ </a>
86
+ </li>
87
+ <li>
88
+ <a v-ripple class="flex px-6 p-3 lg:px-3 lg:py-2 align-items-center text-600 hover:text-900 hover:surface-100 font-medium border-round cursor-pointer transition-colors transition-duration-150 p-ripple">
89
+ <i class="pi pi-chart-line mr-2"></i>
90
+ <span>Stats</span>
91
+ </a>
92
+ </li>
93
+ </ul>
94
+ <ul class="list-none p-0 m-0 flex lg:align-items-center select-none flex-column lg:flex-row border-top-1 surface-border lg:border-top-none">
95
+ <li>
96
+ <a v-ripple class="flex px-6 p-3 lg:px-3 lg:py-2 align-items-center text-600 hover:text-900 hover:surface-100 font-medium border-round cursor-pointer transition-colors transition-duration-150 p-ripple">
97
+ <i class="pi pi-inbox text-base lg:text-2xl mr-2 lg:mr-0"></i>
98
+ <span class="block lg:hidden font-medium">Inbox</span>
99
+ </a>
100
+ </li>
101
+ <li class="border-top-1 surface-border lg:border-top-none">
102
+ <a v-ripple class="flex px-6 p-3 lg:px-3 lg:py-2 align-items-center hover:surface-100 font-medium border-round cursor-pointer transition-colors transition-duration-150 p-ripple">
103
+ <img src="/images/empty-user-photo.svg" class="mr-3 lg:mr-0 border-circle" style="width: 28px; height: 28px"/>
104
+ <div class="block lg:hidden">
105
+ <div class="text-900 font-medium">Josephine Lillard</div>
106
+ <span class="text-600 font-medium text-sm">Marketing Specialist</span>
107
+ </div>
108
+ </a>
109
+ </li>
110
+ </ul>
111
+ </div>
112
+ </div>
113
+ </template>
114
+
115
+ <script setup>
116
+
117
+ import { NotificationsIcon } from "@live-change/user-frontend"
118
+
119
+ import { UserIcon } from "@live-change/user-frontend"
120
+
121
+
122
+
123
+ </script>
124
+
125
+ <style scoped>
126
+
127
+ </style>
@@ -0,0 +1,24 @@
1
+ <template>
2
+ <UrlContent objectType="blog_Post" :path="urlPath" :class="clazz" :style="style" />
3
+ </template>
4
+
5
+ <script setup>
6
+
7
+ import { toRefs } from "@vueuse/core"
8
+ import { UrlContent } from "@live-change/content-frontend";
9
+
10
+ const props = defineProps({
11
+ path: {
12
+ type: String,
13
+ required: true
14
+ },
15
+ class: {},
16
+ style: {}
17
+ })
18
+ const { path: urlPath, class: clazz, style } = toRefs(props)
19
+
20
+ </script>
21
+
22
+ <style scoped>
23
+
24
+ </style>
@@ -0,0 +1,64 @@
1
+ <template>
2
+ <ContentSettings v-if="objectData" :objectType="objectType" :object="object" />
3
+
4
+ <ContentEditor v-if="objectData"
5
+ :objectType="objectType" :object="object"
6
+ :publishTarget="`page `+`${canonicalUrlData.domain ?? '*'}/${canonicalUrlData.path}`"
7
+ contentType="page" purpose="blog-post" />
8
+ <NotFound v-if="objectData === null" />
9
+ </template>
10
+
11
+ <script setup>
12
+
13
+ import { NotFound } from "@live-change/url-frontend";
14
+
15
+ import { ContentSettings, ContentEditor } from "@live-change/content-frontend"
16
+
17
+ import { computed, watch, ref, onMounted, inject } from 'vue'
18
+ import { toRefs } from "@vueuse/core"
19
+
20
+ const isMounted = ref(false)
21
+ onMounted(() => isMounted.value = true)
22
+
23
+ const props = defineProps({
24
+ postId: {
25
+ type: String,
26
+ required: true
27
+ },
28
+ class: {},
29
+ style: {}
30
+ })
31
+ const { postId, class: clazz, style } = toRefs(props)
32
+
33
+ const objectType = "blog_Post"
34
+ const object = postId
35
+
36
+ import { useApi, path, live } from '@live-change/vue3-ssr'
37
+ const api = useApi()
38
+ const p = path()
39
+
40
+ const livePagePath = computed(
41
+ () => p.blog.post({ post: object.value })
42
+ )
43
+ const liveCanonicalUrlPath = computed(
44
+ () => p.url.targetOwnedCanonical({ targetType: objectType, target: object.value })
45
+ )
46
+ const livePublicAccessPath = computed(
47
+ () => p.accessControl.objectOwnedPublicAccess({ objectType, object: object.value })
48
+ )
49
+ const liveMetadataPath = computed(
50
+ () => p.content.objectOwnedMetadata({ objectType, object: object.value })
51
+ )
52
+
53
+ const [objectData, canonicalUrlData, publicAccessData, metadata] = await Promise.all([
54
+ live(livePagePath),
55
+ live(liveCanonicalUrlPath),
56
+ live(livePublicAccessPath),
57
+ live(liveMetadataPath)
58
+ ]).catch(e => [null, null, null, null])
59
+
60
+ </script>
61
+
62
+ <style scoped>
63
+
64
+ </style>
@@ -0,0 +1,26 @@
1
+ <template>
2
+
3
+ <ContentPreview objectType="blog_Post" :object="postId" :style="style" :class="clazz" />
4
+
5
+ </template>
6
+
7
+ <script setup>
8
+
9
+ import { ContentPreview } from "@live-change/content-frontend"
10
+ import { toRefs } from "@vueuse/core"
11
+
12
+ const props = defineProps({
13
+ postId: {
14
+ type: String,
15
+ required: true
16
+ },
17
+ class: {},
18
+ style: {}
19
+ })
20
+ const { postId, class: clazz, style } = toRefs(props)
21
+
22
+ </script>
23
+
24
+ <style scoped>
25
+
26
+ </style>
@@ -0,0 +1,44 @@
1
+ import { sitemap } from "@live-change/url-frontend"
2
+
3
+ export function contentEditRoutes(config = {}) {
4
+ const { prefix = '/', route = (r) => r } = config
5
+
6
+ return [
7
+ route({ name: 'blog:postEditor', path: prefix + 'post-editor/:postId', meta: { }, props: true,
8
+ component: () => import("./BlogPostEditor.vue") }),
9
+ route({ name: 'blog:postPreview', path: prefix + 'post-preview/:postId', meta: { }, props: true,
10
+ component: () => import("./BlogPostPreview.vue") }),
11
+ ]
12
+ }
13
+
14
+ export function catchAllPagesRoute(config = {}) {
15
+ const { prefix = '/', route = (r) => r } = config
16
+
17
+ return [
18
+
19
+ route({
20
+ name: 'blog:post', path: prefix + ':path(.*)', meta: { },
21
+ component: () => import("./BlogPost.vue"),
22
+ props: true
23
+ })
24
+
25
+ ]
26
+ }
27
+
28
+
29
+ export function routes(config = {}) {
30
+ const { prefix = '/', route = (r) => r } = config
31
+
32
+ return [
33
+
34
+ ...contentEditRoutes(config),
35
+ ...catchAllPagesRoute({ ...config, prefix: config.blogPrefix ?? '/blog/' })
36
+
37
+ ]
38
+ }
39
+
40
+ export async function pagesSitemap(route, api) {
41
+ await sitemap(route, api, 'blog_Post', '/blog/')
42
+ }
43
+
44
+ export default routes
@@ -0,0 +1,13 @@
1
+ import deepmerge from 'deepmerge';
2
+
3
+ import contentEn from "../locales/en.json"
4
+ import { locales as autoFormLocales } from "@live-change/frontend-auto-form"
5
+
6
+ export default {
7
+ i18nMessages: {
8
+ en: deepmerge.all([
9
+ contentEn,
10
+ autoFormLocales.en
11
+ ])
12
+ }
13
+ }
@@ -0,0 +1,6 @@
1
+ import { clientEntry } from '@live-change/frontend-base/client-entry.js'
2
+ import App from './App.vue'
3
+ import { createRouter } from './router'
4
+ import config from './config.js'
5
+
6
+ await clientEntry(App, createRouter, config)
@@ -0,0 +1,7 @@
1
+ import { serverEntry } from '@live-change/frontend-base/server-entry.js'
2
+ import App from './App.vue'
3
+ import { createRouter } from './router'
4
+ import config from './config.js'
5
+
6
+ const render = serverEntry(App, createRouter, config)
7
+ export { render }
@@ -0,0 +1,38 @@
1
+ import {
2
+ createMemoryHistory,
3
+ createRouter as _createRouter,
4
+ createWebHistory
5
+ } from 'vue-router'
6
+
7
+ import { dbAdminRoutes } from "@live-change/db-admin"
8
+ import { userRoutes } from "@live-change/user-frontend"
9
+ import { catchAllPagesRoute, contentEditRoutes, pagesSitemap } from "./components/routes.js"
10
+
11
+ export function blogRoutes(config = {}) {
12
+ const { prefix = '/', route = (r) => r } = config
13
+ return [
14
+ ...userRoutes({ ...config, prefix: prefix + 'user/' }),
15
+
16
+ ...contentEditRoutes({ ...config }),
17
+
18
+
19
+
20
+ ...dbAdminRoutes({ prefix: '/_db', route: r => ({ ...r, meta: { ...r.meta, raw: true }}) }),
21
+
22
+ ...catchAllPagesRoute({ ...config })
23
+ ]
24
+ }
25
+
26
+ export async function sitemap(route, api) {
27
+ await pagesSitemap(route, api)
28
+ }
29
+
30
+
31
+ export function createRouter(app, config) {
32
+ const router = _createRouter({
33
+ history: import.meta.env.SSR ? createMemoryHistory() : createWebHistory(),
34
+ routes: blogRoutes(config)
35
+ })
36
+ return router
37
+ }
38
+
@@ -0,0 +1,18 @@
1
+ import { defineConfig } from 'vite'
2
+
3
+ import baseViteConfig from '@live-change/frontend-base/vite-config.js'
4
+
5
+ export default defineConfig(async ({ command, mode }) => {
6
+ const baseConfig = (await baseViteConfig({ command, mode }))
7
+ return {
8
+ ...baseConfig,
9
+
10
+ resolve: {
11
+ alias: [
12
+ ...baseConfig.resolve.alias,
13
+ /* { find: 'vue', replacement: 'vue/dist/vue.esm-bundler.js' },
14
+ { find: 'vue/server-renderer', replacement: 'vue/server-renderer' },*/
15
+ ]
16
+ }
17
+ }
18
+ })
package/index.js ADDED
File without changes
package/package.json ADDED
@@ -0,0 +1,69 @@
1
+ {
2
+ "name": "@live-change/blog-frontend",
3
+ "version": "0.2.17",
4
+ "scripts": {
5
+ "memDev": "lcli memDev --enableSessions --initScript ./init.js --dbAccess",
6
+ "localDevInit": "rm tmp.db; lcli localDev --enableSessions --initScript ./init.js",
7
+ "localDev": "lcli localDev --enableSessions",
8
+ "dev": "lcli dev --enableSessions",
9
+ "ssrDev": "lcli ssrDev --enableSessions",
10
+ "serveAllMem": "cross-env NODE_ENV=production lcli ssrServer --withApi --withServices --updateServices --enableSessions --withDb --dbBackend mem --createDb",
11
+ "serveAll": "cross-env NODE_ENV=production lcli ssrServer --withApi --withServices --updateServices --enableSessions",
12
+ "serve": "cross-env NODE_ENV=production lcli ssrServer --enableSessions",
13
+ "apiServer": "lcli apiServer --enableSessions",
14
+ "devApiServer": "lcli devApiServer --enableSessions",
15
+ "memApiServer": "lcli memApiServer --enableSessions",
16
+ "build": "cd front; yarn build:client && yarn build:server",
17
+ "build:client": "cd front; vite build --ssrManifest --outDir dist/client",
18
+ "build:server": "cd front; vite build --ssr src/entry-server.js --outDir dist/server",
19
+ "generate": "vite build --ssrManifest --outDir dist/static && yarn build:server && node prerender",
20
+ "debug": "node --inspect-brk server"
21
+ },
22
+ "dependencies": {
23
+ "@fortawesome/fontawesome-free": "^6.2.0",
24
+ "@live-change/blog-service": "0.3.8",
25
+ "@live-change/cli": "0.7.6",
26
+ "@live-change/content-frontend": "^0.2.17",
27
+ "@live-change/dao": "0.5.8",
28
+ "@live-change/dao-vue3": "0.5.8",
29
+ "@live-change/dao-websocket": "0.5.8",
30
+ "@live-change/framework": "0.7.6",
31
+ "@live-change/image-service": "0.3.8",
32
+ "@live-change/session-service": "0.3.8",
33
+ "@live-change/vue3-components": "0.2.16",
34
+ "@live-change/vue3-ssr": "0.2.16",
35
+ "@vueuse/core": "^9.1.0",
36
+ "codeceptjs-assert": "^0.0.5",
37
+ "compression": "^1.7.4",
38
+ "cross-env": "^7.0.3",
39
+ "deepmerge": "^4.2.2",
40
+ "get-port-sync": "1.0.1",
41
+ "pica": "^9.0.1",
42
+ "pretty-bytes": "^6.0.0",
43
+ "primeflex": "^3.2.1",
44
+ "primeicons": "^6.0.1",
45
+ "primevue": "^3.18.1",
46
+ "rollup-plugin-node-builtins": "^2.1.2",
47
+ "rollup-plugin-visualizer": "5.6.0",
48
+ "serialize-javascript": "^6.0.0",
49
+ "serve-static": "^1.15.0",
50
+ "v-shared-element": "3.1.0",
51
+ "vue-meta": "^3.0.0-alpha.9",
52
+ "vue-router": "^4.1.3",
53
+ "vue3-scroll-border": "0.1.4"
54
+ },
55
+ "devDependencies": {
56
+ "@live-change/codeceptjs-helper": "0.7.6",
57
+ "@wdio/selenium-standalone-service": "^7.20.8",
58
+ "codeceptjs": "^3.3.4",
59
+ "generate-password": "1.7.0",
60
+ "playwright": "^1.24.2",
61
+ "random-profile-generator": "^2.3.0",
62
+ "txtgen": "^3.0.2",
63
+ "webdriverio": "^7.20.9"
64
+ },
65
+ "author": "",
66
+ "license": "ISC",
67
+ "description": "",
68
+ "gitHead": "61ea1e9554f3bf8cb8f9debffdabd8a88855c3b2"
69
+ }
package/server/init.js ADDED
@@ -0,0 +1,142 @@
1
+ const {createUser} = require("@live-change/user-frontend/server/init-functions.js");
2
+ const App = require('@live-change/framework')
3
+ const app = App.app()
4
+
5
+ module.exports = async function(services) {
6
+ async function createPost(postId) {
7
+ const documentId = App.encodeIdentifier(['blog_Post', postId])
8
+ const snapshotId = App.encodeIdentifier([documentId, (0).toFixed().padStart(10, '0')])
9
+
10
+ const documentContent = {
11
+ "type": "doc",
12
+ "content": [].concat(new Array(2).fill(
13
+ {
14
+ "type": "paragraph",
15
+ "content": [
16
+ {
17
+ "type": "text",
18
+ "text": "test"
19
+ },
20
+ {
21
+ "type": "text",
22
+ "marks": [
23
+ {
24
+ "type": "bold"
25
+ }
26
+ ],
27
+ "text": "est"
28
+ }
29
+ ]
30
+ }
31
+ ))
32
+ }
33
+ const documentTime = new Date()
34
+
35
+ await services.blog.models.Post.create({
36
+ id: postId
37
+ })
38
+
39
+ await services.prosemirror.models.Document.create({
40
+ id: documentId,
41
+ ownerType: 'blog_Post',
42
+ owner: postId,
43
+ type: 'content',
44
+ purpose: 'page',
45
+ version: 1,
46
+ content: documentContent,
47
+ created: documentTime,
48
+ lastModified: documentTime
49
+ })
50
+ await services.prosemirror.models.Snapshot.create({
51
+ id: snapshotId,
52
+ document: documentId,
53
+ version: 1,
54
+ content: documentContent,
55
+ timestamp: documentTime,
56
+ })
57
+
58
+ await services.content.models.Content.create({
59
+ id: documentId,
60
+ objectType: 'blog_Post',
61
+ object: postId,
62
+ snapshot: snapshotId
63
+ })
64
+ }
65
+
66
+ const user1 = await createUser(services,
67
+ 'Test User 1', 'test1@test.com', 'Testy123', 'u1', ['writer', 'administrator'])
68
+
69
+ await createPost('one')
70
+
71
+ await services.accessControl.models.PublicAccess.create({
72
+ id: App.encodeIdentifier(['blog_Post', 'one']),
73
+ objectType: 'blog_Post',
74
+ object: 'one',
75
+ sessionRoles: ['reader'] .concat(['writer'])
76
+ })
77
+ await services.accessControl.models.Access.create({
78
+ id: App.encodeIdentifier(['user_User', user1.id, 'blog_Post', 'one']),
79
+ sessionOrUserType: 'user_User', sessionOrUser: user1.id,
80
+ objectType: 'blog_Post', object: 'one',
81
+ roles: ['writer']
82
+ })
83
+
84
+ await services.url.models.Canonical.create({
85
+ id: App.encodeIdentifier(['blog_Post', 'one']),
86
+ domain: '',
87
+ path: 'test',
88
+ targetType: 'blog_Post',
89
+ target: 'one'
90
+ })
91
+ await services.url.models.Redirect.create({
92
+ id: app.generateUid(),
93
+ domain: 'localhost:8001',
94
+ path: 'test-redirect',
95
+ targetType: 'blog_Post',
96
+ target: 'one'
97
+ })
98
+
99
+ await services.content.models.Metadata.create({
100
+ id: App.encodeIdentifier(['blog_Post', 'one']),
101
+ objectType: 'blog_Post',
102
+ object: 'one',
103
+ title: 'Test Page',
104
+ description: 'Test Description',
105
+ "og": {
106
+ "locale": "en_US",
107
+ "localeAlternate": [],
108
+ "type": "website",
109
+ "music": {
110
+ "song": [],
111
+ "album": [],
112
+ "musician": [],
113
+ "creator": []
114
+ },
115
+ "video": {
116
+ "actor": [],
117
+ "director": [],
118
+ "writer": [],
119
+ "tag": []
120
+ },
121
+ "article": {
122
+ "author": [],
123
+ "tag": []
124
+ },
125
+ "profile": {},
126
+ "book": {
127
+ "author": [],
128
+ "tag": []
129
+ }
130
+ }
131
+ })
132
+
133
+ await createPost('two')
134
+
135
+ await services.url.models.Canonical.create({
136
+ id: App.encodeIdentifier(['blog_Post', 'two']),
137
+ domain: '',
138
+ path: 'test2',
139
+ targetType: 'blog_Post',
140
+ target: 'two'
141
+ })
142
+ }
@@ -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
+ }
@@ -0,0 +1,87 @@
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
+ },
86
+ "topNode": "doc"
87
+ }
@@ -0,0 +1,69 @@
1
+ const contactTypes = ['email']
2
+
3
+ module.exports = {
4
+ services: [
5
+ {
6
+ name: 'session',
7
+ path: '@live-change/session-service',
8
+ createSessionOnUpdate: true
9
+ },
10
+ {
11
+ name: 'user',
12
+ path: '@live-change/user-service'
13
+ },
14
+ {
15
+ name: 'email',
16
+ path: '@live-change/email-service'
17
+ },
18
+ {
19
+ name: 'passwordAuthentication',
20
+ path: '@live-change/password-authentication-service',
21
+ contactTypes,
22
+ signInWithoutPassword: true
23
+ },
24
+ {
25
+ name: 'userIdentification',
26
+ path: '@live-change/user-identification-service'
27
+ },
28
+ {
29
+ name: 'identicon',
30
+ path: '@live-change/identicon-service'
31
+ },
32
+ {
33
+ name: 'accessControl',
34
+ path: '@live-change/access-control-service',
35
+ createSessionOnUpdate: true,
36
+ contactTypes,
37
+ },
38
+ {
39
+ name: 'url',
40
+ path: '@live-change/url-service'
41
+ },
42
+ {
43
+ name: 'prosemirror',
44
+ path: '@live-change/prosemirror-service',
45
+ documentTypes: {
46
+ page: require('./page.documentType.js'),
47
+ rich: require('./rich.documentType.js'),
48
+ },
49
+ testLatency: 2000
50
+ },
51
+ {
52
+ name: 'upload',
53
+ path: '@live-change/upload-service'
54
+ },
55
+ {
56
+ name: "image",
57
+ path: '@live-change/image-service'
58
+ },
59
+ {
60
+ name: 'content',
61
+ path: '@live-change/content-service',
62
+ },
63
+ {
64
+ name: 'blog',
65
+ path: '@live-change/blog-service',
66
+ }
67
+
68
+ ]
69
+ }