@live-change/url-frontend 0.2.3 → 0.2.5

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.
@@ -0,0 +1,43 @@
1
+ <template>
2
+ <div class="surface-section px-4 py-8 md:px-6 lg:px-8">
3
+ <div class="text-center code404">
4
+ <span class="bg-white text-pink-500 font-bold text-2xl inline-block px-3">404</span>
5
+ </div>
6
+ <div class="mt-6 mb-5 font-bold text-6xl text-900 text-center">Page Not Found</div>
7
+ <p class="text-700 text-3xl mt-0 mb-6 text-center">Sorry, we couldn't find the page.</p>
8
+ <div class="text-center">
9
+ <Button v-if="canGoBack" @click="goBack()"
10
+ class="p-button-text mr-2" label="Go Back" icon="pi pi-arrow-left" />
11
+ <router-link to="/" replace class="no-underline">
12
+ <Button label="Go to Home" icon="pi pi-home" />
13
+ </router-link>
14
+ </div>
15
+ </div>
16
+ </template>
17
+
18
+ <script setup>
19
+
20
+ import Button from "primevue/button"
21
+
22
+ import { computed, ref, onMounted } from 'vue'
23
+
24
+ const isMounted = ref(false)
25
+ onMounted(() => isMounted.value = true)
26
+
27
+ const canGoBack = computed(() => {
28
+ return isMounted.value && history.length > 1
29
+ })
30
+
31
+ import { useRouter } from 'vue-router'
32
+ const router = useRouter()
33
+ function goBack() {
34
+ router.back()
35
+ }
36
+
37
+ </script>
38
+
39
+ <style scoped>
40
+ .code404 {
41
+ background: radial-gradient(50% 109137.91% at 50% 50%, rgba(233, 30, 99, 0.1) 0%, rgba(254, 244, 247, 0) 100%);
42
+ }
43
+ </style>
@@ -1,8 +1,11 @@
1
1
  <template>
2
- <slot v-if="url" :url="url" :target="url.target">
3
- <pre>{{ JSON.stringify(url, null, " ") }}</pre>
2
+ <slot v-if="url" :url="url" :target="url.target" :class="clazz" :style="style">
3
+ <div class="w-full surface-card p-4 shadow-2 border-round">
4
+ <h2>Url resolved:</h2>
5
+ <pre>{{ JSON.stringify(url, null, " ") }}</pre>
6
+ </div>
4
7
  </slot>
5
- <slot v-else name="notFound" :path="urlPath">
8
+ <slot v-else name="notFound" :path="urlPath" :class="clazz" :style="style">
6
9
  <div class="surface-section px-4 py-8 md:px-6 lg:px-8">
7
10
  <div style="background: radial-gradient(50% 109137.91% at 50% 50%, rgba(233, 30, 99, 0.1) 0%, rgba(254, 244, 247, 0) 100%);" class="text-center">
8
11
  <span class="bg-white text-pink-500 font-bold text-2xl inline-block px-3">404</span>
@@ -10,16 +13,17 @@
10
13
  <div class="mt-6 mb-5 font-bold text-6xl text-900 text-center">Page Not Found</div>
11
14
  <p class="text-700 text-3xl mt-0 mb-6 text-center">Sorry, we couldn't find the page.</p>
12
15
  <div class="text-center">
13
- <Button class="p-button-text mr-2" label="Go Back" icon="pi pi-arrow-left"></Button>
14
- <Button label="Go to Dashboard" icon="pi pi-home"></Button>
16
+ <Button class="p-button-text mr-2" label="Go Back" icon="pi pi-arrow-left" />
17
+ <Button label="Go to Dashboard" icon="pi pi-home" />
15
18
  </div>
16
19
  </div>
17
20
  </slot>
18
-
19
21
  </template>
20
22
 
21
23
  <script setup>
22
24
 
25
+ import Button from "primevue/button"
26
+
23
27
  import { computed, watch, ref, onMounted } from 'vue'
24
28
  import { toRefs } from "@vueuse/core"
25
29
  import { useHost } from "@live-change/frontend-base"
@@ -39,9 +43,11 @@
39
43
  fetchMore: {
40
44
  type: Array,
41
45
  default: () => []
42
- }
46
+ },
47
+ class: {},
48
+ style: {}
43
49
  })
44
- const { path: urlPath, targetType, fetchMore } = toRefs(props)
50
+ const { path: urlPath, targetType, fetchMore, class: clazz, style } = toRefs(props)
45
51
 
46
52
  const urlDomain = useHost()
47
53
 
@@ -65,7 +71,6 @@
65
71
  return fetchPath
66
72
  }
67
73
 
68
-
69
74
  const livePathWithDomain = computed(
70
75
  () => liveUrlPath(targetType.value, urlDomain, urlPath.value, fetchMore.value)
71
76
  )
@@ -79,8 +79,6 @@
79
79
  import { useConfirm } from 'primevue/useconfirm'
80
80
  const confirm = useConfirm()
81
81
 
82
- import { synchronized, synchronizedList } from "@live-change/vue3-components"
83
-
84
82
  import { computed, watch, ref, onMounted } from 'vue'
85
83
 
86
84
  const isMounted = ref(false)
@@ -0,0 +1,55 @@
1
+ <template>
2
+ <div class="flex">
3
+ <i class="pi pi-globe mr-2"></i>
4
+ <template v-if="canonical">
5
+ <span class="font-bold mr-2">Url:</span>
6
+ <span class="mr-1 font-normal">{{ canonical.domain || '*' }}</span>
7
+ <span class="text-overflow-ellipsis overflow-hidden font-normal flex-grow-1">
8
+ {{props.prefix}}{{ canonical.path }}
9
+ </span>
10
+
11
+ </template>
12
+ <span v-else>No Url</span>
13
+ <template v-if="redirects.length">
14
+ <i class="pi pi-arrow-up-right mr-1 ml-3"></i>
15
+ <span class="font-bold">{{ redirects.length }}</span>
16
+ </template>
17
+ </div>
18
+ </template>
19
+
20
+ <script setup>
21
+ const props = defineProps({
22
+ target: {
23
+ type: String,
24
+ required: true
25
+ },
26
+ targetType: {
27
+ type: String,
28
+ required: true
29
+ },
30
+ prefix: {
31
+ type: String,
32
+ default: '/'
33
+ }
34
+ })
35
+
36
+ import { computed } from 'vue'
37
+
38
+ import { path, live } from '@live-change/vue3-ssr'
39
+ const p = path()
40
+ const canonicalLivePath = computed(
41
+ () => p.url.targetOwnedCanonical({ targetType: props.targetType, target: props.target })
42
+ )
43
+ const redirectsLivePath = computed(
44
+ () => p.url.targetOwnedRedirects({ targetType: props.targetType, target: props.target })
45
+ )
46
+ const [canonical, redirects] = await Promise.all([
47
+ live(canonicalLivePath),
48
+ live(redirectsLivePath)
49
+ ])
50
+
51
+ </script>
52
+
53
+ <style scoped>
54
+
55
+ </style>
package/index.js CHANGED
@@ -1,6 +1,9 @@
1
1
  import Urls from "./front/src/components/Urls.vue"
2
2
  export { Urls }
3
3
 
4
+ import UrlsInfo from "./front/src/components/UrlsInfo.vue"
5
+ export { UrlsInfo }
6
+
4
7
  import TakeUrlForm from "./front/src/components/TakeUrlForm.vue"
5
8
  export { TakeUrlForm }
6
9
 
@@ -10,5 +13,8 @@ export { GenerateUrlForm }
10
13
  import ResolveUrl from "./front/src/components/ResolveUrl.vue"
11
14
  export { ResolveUrl }
12
15
 
16
+ import NotFound from "./front/src/components/NotFound.vue"
17
+ export { NotFound }
18
+
13
19
  import sitemap from "./front/src/sitemap.js"
14
20
  export { sitemap }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@live-change/url-frontend",
3
- "version": "0.2.3",
3
+ "version": "0.2.5",
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",
@@ -21,16 +21,16 @@
21
21
  },
22
22
  "dependencies": {
23
23
  "@fortawesome/fontawesome-free": "^6.1.1",
24
- "@live-change/cli": "0.6.14",
24
+ "@live-change/cli": "0.7.2",
25
25
  "@live-change/dao": "0.5.6",
26
26
  "@live-change/dao-vue3": "0.5.6",
27
27
  "@live-change/dao-websocket": "0.5.6",
28
- "@live-change/framework": "0.6.14",
29
- "@live-change/password-authentication-service": "0.2.51",
30
- "@live-change/prosemirror-service": "0.2.51",
31
- "@live-change/secret-code-service": "0.2.51",
32
- "@live-change/secret-link-service": "0.2.51",
33
- "@live-change/session-service": "0.2.51",
28
+ "@live-change/framework": "0.7.2",
29
+ "@live-change/password-authentication-service": "0.3.0",
30
+ "@live-change/prosemirror-service": "0.3.0",
31
+ "@live-change/secret-code-service": "0.3.0",
32
+ "@live-change/secret-link-service": "0.3.0",
33
+ "@live-change/session-service": "0.3.0",
34
34
  "@live-change/vue3-components": "0.2.15",
35
35
  "@live-change/vue3-ssr": "0.2.15",
36
36
  "@tiptap/extension-blockquote": "^2.0.0-beta.29",
@@ -60,8 +60,8 @@
60
60
  "cross-env": "^7.0.3",
61
61
  "get-port-sync": "1.0.1",
62
62
  "primeflex": "^3.2.1",
63
- "primeicons": "^5.0.0",
64
- "primevue": "^3.15.0",
63
+ "primeicons": "^6.0.1",
64
+ "primevue": "^3.18.1",
65
65
  "prosemirror-collab": "^1.3.0",
66
66
  "rollup-plugin-node-builtins": "^2.1.2",
67
67
  "rollup-plugin-visualizer": "5.6.0",
@@ -73,7 +73,7 @@
73
73
  "vue3-scroll-border": "0.1.2"
74
74
  },
75
75
  "devDependencies": {
76
- "@live-change/codeceptjs-helper": "0.6.14",
76
+ "@live-change/codeceptjs-helper": "0.7.2",
77
77
  "@wdio/selenium-standalone-service": "^7.20.8",
78
78
  "codeceptjs": "^3.3.4",
79
79
  "generate-password": "1.7.0",
@@ -85,5 +85,5 @@
85
85
  "author": "",
86
86
  "license": "ISC",
87
87
  "description": "",
88
- "gitHead": "a91ef8d26ea58cabf9fef85347826ccd32096f8d"
88
+ "gitHead": "76ac0dd54acf671cb564a1aa943d81a9e2bc99e9"
89
89
  }