@slogvo/vue-notion 0.1.0
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 +26 -0
- package/README.md +129 -0
- package/build/CollectionCard.vue_vue_type_script_setup_true_lang-14wiD7gP.js +86 -0
- package/build/CollectionViewBoard-CgsTRxVb.js +131 -0
- package/build/CollectionViewGallery-B_vTmafL.js +73 -0
- package/build/CollectionViewList-D3G1ACy1.js +124 -0
- package/build/CollectionViewTable-UDQc6cpa.js +177 -0
- package/build/collection-utils-Cqo2kyVg.js +116 -0
- package/build/collection-utils.d.ts +1 -0
- package/build/components/Asset.vue.d.ts +16 -0
- package/build/components/Block.vue.d.ts +35 -0
- package/build/components/Bookmark.vue.d.ts +6 -0
- package/build/components/Breadcrumbs.vue.d.ts +6 -0
- package/build/components/Checkbox.vue.d.ts +6 -0
- package/build/components/Code.vue.d.ts +11 -0
- package/build/components/Collection.vue.d.ts +9 -0
- package/build/components/CollectionCard.vue.d.ts +13 -0
- package/build/components/CollectionColumnTitle.vue.d.ts +7 -0
- package/build/components/CollectionGroup.vue.d.ts +25 -0
- package/build/components/CollectionView.vue.d.ts +15 -0
- package/build/components/CollectionViewBoard.vue.d.ts +15 -0
- package/build/components/CollectionViewGallery.vue.d.ts +11 -0
- package/build/components/CollectionViewList.vue.d.ts +11 -0
- package/build/components/CollectionViewTable.vue.d.ts +15 -0
- package/build/components/Equation.vue.d.ts +8 -0
- package/build/components/ExternalObjectInstance.vue.d.ts +8 -0
- package/build/components/Header.vue.d.ts +13 -0
- package/build/components/LazyImage.vue.d.ts +20 -0
- package/build/components/Modal.vue.d.ts +19 -0
- package/build/components/NotionBlockRenderer.vue.d.ts +7 -0
- package/build/components/NotionRenderer.vue.d.ts +27 -0
- package/build/components/PageIcon.vue.d.ts +18 -0
- package/build/components/PageTitle.vue.d.ts +8 -0
- package/build/components/Property.vue.d.ts +15 -0
- package/build/components/SearchDialog.vue.d.ts +14 -0
- package/build/components/TableOfContents.vue.d.ts +6 -0
- package/build/components/text/PageLink.vue.d.ts +21 -0
- package/build/components/text/Text.vue.d.ts +7 -0
- package/build/components/text/TextDecorator.vue.d.ts +6 -0
- package/build/context.d.ts +5 -0
- package/build/index-BNMgDI2p.js +2917 -0
- package/build/index.css +1 -0
- package/build/index.d.ts +1 -0
- package/build/index.js +4 -0
- package/build/index.umd.cjs +2 -0
- package/build/styles.css +3198 -0
- package/build/types.d.ts +36 -0
- package/build/utils.d.ts +10 -0
- package/package.json +79 -0
- package/src/styles.css +3198 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Vue Notion X Contributors
|
|
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.
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
This project extends MIT-licensed work from react-notion-x by Travis Fischer
|
|
26
|
+
and other contributors.
|
package/README.md
ADDED
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
# @slogvo/vue-notion
|
|
2
|
+
|
|
3
|
+
> **Vue Notion** is a fast and accurate Vue 3 renderer for Notion. Use Notion as a CMS for your Vue or Nuxt applications. ⚡️
|
|
4
|
+
>
|
|
5
|
+
> **Vue Notion** là bộ render Notion cho **Vue 3** và **Nuxt 3** cực nhanh và chính xác. Giải pháp hoàn hảo để dùng Notion làm CMS. 🚀
|
|
6
|
+
>
|
|
7
|
+
> **Vue Notion** は、Vue 3 および Nuxt 3 向けの高速で正確な Notion レンダラーです。Notion を CMS として利用するための最適なソリューションです。 ⚡️
|
|
8
|
+
|
|
9
|
+
## SEO Keywords
|
|
10
|
+
|
|
11
|
+
`Vue Notion Renderer`, `Vue 3 Notion`, `Nuxt 3 Notion API`, `Notion CMS Vue`, `Renderer Notion Vue 3`, `Hiển thị Notion trên Vue`, `Notion API client for Vue`, `Notion SDK Vue`, `Notion to HTML Vue`
|
|
12
|
+
|
|
13
|
+
## Features
|
|
14
|
+
|
|
15
|
+
- ⚡ **Fast** - Optimized rendering with lazy loading
|
|
16
|
+
- 🎨 **Flexible** - Fully customizable components and styling
|
|
17
|
+
- 🔍 **Search** - Built-in full-text search support
|
|
18
|
+
- 🗂️ **Collections** - Rich support for database views:
|
|
19
|
+
- Table (with resizing)
|
|
20
|
+
- Gallery
|
|
21
|
+
- List
|
|
22
|
+
- Board (with grouping)
|
|
23
|
+
- 🛠️ **Universal** - Works with Vue 3 and Nuxt 3 (SSR/SSG friendly)
|
|
24
|
+
|
|
25
|
+
## Installation
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
# using pnpm
|
|
29
|
+
pnpm add @slogvo/vue-notion @slogvo/notion-client @slogvo/notion-types @slogvo/notion-utils
|
|
30
|
+
|
|
31
|
+
# using npm
|
|
32
|
+
npm install @slogvo/vue-notion @slogvo/notion-client @slogvo/notion-types @slogvo/notion-utils
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
## Usage
|
|
36
|
+
|
|
37
|
+
### Basic Rendering
|
|
38
|
+
|
|
39
|
+
```vue
|
|
40
|
+
<script setup lang="ts">
|
|
41
|
+
import { NotionRenderer } from '@slogvo/vue-notion'
|
|
42
|
+
import { NotionAPI } from '@slogvo/notion-client'
|
|
43
|
+
|
|
44
|
+
// Fetch data on the server (e.g., in Nuxt useAsyncData or getServerSideProps)
|
|
45
|
+
const api = new NotionAPI()
|
|
46
|
+
const recordMap = await api.getPage('your-page-id')
|
|
47
|
+
</script>
|
|
48
|
+
|
|
49
|
+
<template>
|
|
50
|
+
<NotionRenderer :record-map="recordMap" full-page class="notion-page" />
|
|
51
|
+
</template>
|
|
52
|
+
|
|
53
|
+
<style>
|
|
54
|
+
/* Import the styles */
|
|
55
|
+
@import '@slogvo/vue-notion/dist/style.css';
|
|
56
|
+
/* Or if using the source directly */
|
|
57
|
+
/* @import '@slogvo/vue-notion/src/styles.css'; */
|
|
58
|
+
</style>
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
### Enabling Search
|
|
62
|
+
|
|
63
|
+
To enable the search functionality, pass the `searchNotion` prop to the renderer:
|
|
64
|
+
|
|
65
|
+
```vue
|
|
66
|
+
<script setup lang="ts">
|
|
67
|
+
import { NotionRenderer } from '@slogvo/vue-notion'
|
|
68
|
+
|
|
69
|
+
// Define your search function (server-side wrapper)
|
|
70
|
+
const searchNotion = async params => {
|
|
71
|
+
// Call your API endpoint that wraps notion-client's search
|
|
72
|
+
return await $fetch('/api/notion/search', {
|
|
73
|
+
method: 'POST',
|
|
74
|
+
body: params
|
|
75
|
+
})
|
|
76
|
+
}
|
|
77
|
+
</script>
|
|
78
|
+
|
|
79
|
+
<template>
|
|
80
|
+
<NotionRenderer
|
|
81
|
+
:record-map="recordMap"
|
|
82
|
+
:search-notion="searchNotion"
|
|
83
|
+
full-page
|
|
84
|
+
/>
|
|
85
|
+
</template>
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
### Customizing Components
|
|
89
|
+
|
|
90
|
+
You can override any default component by passing a `components` map:
|
|
91
|
+
|
|
92
|
+
```vue
|
|
93
|
+
<script setup lang="ts">
|
|
94
|
+
import { NotionRenderer } from '@slogvo/vue-notion'
|
|
95
|
+
import MyCustomLink from './MyCustomLink.vue'
|
|
96
|
+
|
|
97
|
+
const customComponents = {
|
|
98
|
+
PageLink: MyCustomLink
|
|
99
|
+
}
|
|
100
|
+
</script>
|
|
101
|
+
|
|
102
|
+
<template>
|
|
103
|
+
<NotionRenderer :record-map="recordMap" :components="customComponents" />
|
|
104
|
+
</template>
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
## Styling
|
|
108
|
+
|
|
109
|
+
`@slogvo/vue-notion` comes with a comprehensive CSS file that closely mimics Notion's default styling.
|
|
110
|
+
|
|
111
|
+
You can import it in your main CSS file or component:
|
|
112
|
+
|
|
113
|
+
```css
|
|
114
|
+
@import '@slogvo/vue-notion/dist/style.css';
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
Classes are prefixed with `.notion-` to avoid conflicts. You can easily override variables for theming:
|
|
118
|
+
|
|
119
|
+
```css
|
|
120
|
+
:root {
|
|
121
|
+
--notion-font: 'Inter', sans-serif;
|
|
122
|
+
--fg-color: #333;
|
|
123
|
+
--bg-color: #fff;
|
|
124
|
+
}
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
## Credits
|
|
128
|
+
|
|
129
|
+
This project is a Vue port of the excellent [react-notion-x](https://github.com/NotionX/react-notion-x) by [Travis Fischer](https://github.com/transitive-bullshit).
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { defineComponent as N, computed as o, createBlock as z, openBlock as l, resolveDynamicComponent as V, unref as m, normalizeClass as x, withCtx as w, createElementBlock as n, createCommentVNode as u, createElementVNode as d, createVNode as s, normalizeStyle as B, Fragment as v, renderList as F } from "vue";
|
|
2
|
+
import { u as U, c as $, a as E } from "./index-BNMgDI2p.js";
|
|
3
|
+
import { a as p } from "./collection-utils-Cqo2kyVg.js";
|
|
4
|
+
const L = {
|
|
5
|
+
key: 0,
|
|
6
|
+
class: "notion-collection-card-cover"
|
|
7
|
+
}, P = { class: "notion-collection-card-body" }, S = { class: "notion-collection-card-property" }, j = {
|
|
8
|
+
key: 0,
|
|
9
|
+
class: "notion-collection-card-property"
|
|
10
|
+
}, A = {
|
|
11
|
+
name: "NotionCollectionCard"
|
|
12
|
+
}, H = /* @__PURE__ */ N({
|
|
13
|
+
...A,
|
|
14
|
+
props: {
|
|
15
|
+
block: {},
|
|
16
|
+
collection: {},
|
|
17
|
+
collectionView: {},
|
|
18
|
+
className: {}
|
|
19
|
+
},
|
|
20
|
+
setup(e) {
|
|
21
|
+
const c = e, { recordMap: D, mapPageUrl: y, mapImageUrl: k, components: b } = U(), a = o(() => c.collectionView.format || {}), f = o(
|
|
22
|
+
() => a.value.gallery_cover || { type: "none" }
|
|
23
|
+
), g = o(
|
|
24
|
+
() => a.value.gallery_cover_size || "medium"
|
|
25
|
+
), h = o(
|
|
26
|
+
() => a.value.gallery_cover_aspect || "cover"
|
|
27
|
+
), C = o(() => a.value.gallery_properties || []), r = o(() => {
|
|
28
|
+
if (f.value.type === "page_cover") {
|
|
29
|
+
const i = c.block.format?.page_cover;
|
|
30
|
+
if (i)
|
|
31
|
+
return {
|
|
32
|
+
src: k(i, c.block),
|
|
33
|
+
alt: c.block.properties?.title?.[0]?.[0] || "notion image"
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
return null;
|
|
37
|
+
}), _ = o(() => y(c.block.id));
|
|
38
|
+
return (i, I) => (l(), z(V(m(b).PageLink), {
|
|
39
|
+
href: _.value,
|
|
40
|
+
class: x(
|
|
41
|
+
m($)(
|
|
42
|
+
"notion-collection-card",
|
|
43
|
+
`notion-collection-card-size-${g.value}`,
|
|
44
|
+
e.className
|
|
45
|
+
)
|
|
46
|
+
)
|
|
47
|
+
}, {
|
|
48
|
+
default: w(() => [
|
|
49
|
+
r.value ? (l(), n("div", L, [
|
|
50
|
+
s(E, {
|
|
51
|
+
src: r.value.src,
|
|
52
|
+
alt: r.value.alt,
|
|
53
|
+
style: B({ objectFit: h.value })
|
|
54
|
+
}, null, 8, ["src", "alt", "style"])
|
|
55
|
+
])) : u("", !0),
|
|
56
|
+
d("div", P, [
|
|
57
|
+
d("div", S, [
|
|
58
|
+
s(p, {
|
|
59
|
+
schema: e.collection.schema.title,
|
|
60
|
+
data: e.block.properties?.title,
|
|
61
|
+
block: e.block,
|
|
62
|
+
collection: e.collection
|
|
63
|
+
}, null, 8, ["schema", "data", "block", "collection"])
|
|
64
|
+
]),
|
|
65
|
+
(l(!0), n(v, null, F(C.value, (t) => (l(), n(v, {
|
|
66
|
+
key: t.property
|
|
67
|
+
}, [
|
|
68
|
+
t.visible && t.property !== "title" && e.block.properties?.[t.property] ? (l(), n("div", j, [
|
|
69
|
+
s(p, {
|
|
70
|
+
schema: e.collection.schema[t.property],
|
|
71
|
+
data: e.block.properties[t.property],
|
|
72
|
+
block: e.block,
|
|
73
|
+
collection: e.collection,
|
|
74
|
+
inline: ""
|
|
75
|
+
}, null, 8, ["schema", "data", "block", "collection"])
|
|
76
|
+
])) : u("", !0)
|
|
77
|
+
], 64))), 128))
|
|
78
|
+
])
|
|
79
|
+
]),
|
|
80
|
+
_: 1
|
|
81
|
+
}, 8, ["href", "class"]));
|
|
82
|
+
}
|
|
83
|
+
});
|
|
84
|
+
export {
|
|
85
|
+
H as _
|
|
86
|
+
};
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
import { defineComponent as L, computed as s, createElementBlock as e, openBlock as o, Fragment as r, renderList as c, createBlock as f, mergeProps as E, withCtx as F, createElementVNode as t, normalizeStyle as z, normalizeClass as x, unref as b, createCommentVNode as _, toDisplayString as h } from "vue";
|
|
2
|
+
import { u as I, c as G } from "./index-BNMgDI2p.js";
|
|
3
|
+
import { _ as N } from "./CollectionCard.vue_vue_type_script_setup_true_lang-14wiD7gP.js";
|
|
4
|
+
import { g as K, _ as M } from "./collection-utils-Cqo2kyVg.js";
|
|
5
|
+
const P = { class: "notion-board" }, R = { class: "notion-board-header" }, j = { class: "notion-board-header-inner" }, q = {
|
|
6
|
+
key: 0,
|
|
7
|
+
class: "notion-board-th-body"
|
|
8
|
+
}, A = { class: "notion-board-th-title" }, H = { class: "notion-board-th-count" }, J = { class: "notion-board-body" }, O = {
|
|
9
|
+
key: 1,
|
|
10
|
+
class: "notion-board"
|
|
11
|
+
}, Q = { class: "notion-board-header" }, T = { class: "notion-board-header-inner" }, U = {
|
|
12
|
+
key: 0,
|
|
13
|
+
class: "notion-board-th-body"
|
|
14
|
+
}, W = { class: "notion-board-th-title" }, X = { class: "notion-board-th-count" }, Y = { class: "notion-board-body" }, Z = {
|
|
15
|
+
name: "NotionCollectionViewBoard"
|
|
16
|
+
}, lo = /* @__PURE__ */ L({
|
|
17
|
+
...Z,
|
|
18
|
+
props: {
|
|
19
|
+
collection: {},
|
|
20
|
+
collectionView: {},
|
|
21
|
+
collectionData: {},
|
|
22
|
+
width: {},
|
|
23
|
+
padding: {}
|
|
24
|
+
},
|
|
25
|
+
setup(d) {
|
|
26
|
+
const n = d, w = s(() => ({
|
|
27
|
+
paddingLeft: n.padding ? `${n.padding}px` : "0"
|
|
28
|
+
})), { recordMap: m } = I(), C = s(
|
|
29
|
+
() => !!n.collectionView?.format?.collection_group_by
|
|
30
|
+
), B = s(() => C.value ? K(
|
|
31
|
+
n.collection,
|
|
32
|
+
n.collectionView,
|
|
33
|
+
n.collectionData
|
|
34
|
+
) : []), y = s(() => n.collectionView.format || {}), V = s(
|
|
35
|
+
() => y.value.board_cover_size || "medium"
|
|
36
|
+
), p = s(() => y.value.board_columns || y.value.board_groups2 || []), k = (u) => {
|
|
37
|
+
const i = `results:${u?.value?.type}:${u?.value?.value || "uncategorized"}`;
|
|
38
|
+
return n.collectionData[i] || { blockIds: [] };
|
|
39
|
+
}, S = (u) => {
|
|
40
|
+
const i = k(u);
|
|
41
|
+
return i.total || i.blockIds?.length || 0;
|
|
42
|
+
}, D = s(() => ({
|
|
43
|
+
paddingLeft: n.padding ? `${n.padding}px` : "0"
|
|
44
|
+
}));
|
|
45
|
+
return (u, i) => C.value ? (o(!0), e(r, { key: 0 }, c(B.value, (a, v) => (o(), f(M, E({ key: v }, { ref_for: !0 }, a, {
|
|
46
|
+
"summary-props": { style: D.value }
|
|
47
|
+
}), {
|
|
48
|
+
default: F(() => [
|
|
49
|
+
t("div", P, [
|
|
50
|
+
t("div", {
|
|
51
|
+
class: x(
|
|
52
|
+
b(G)("notion-board-view", `notion-board-view-size-${V.value}`)
|
|
53
|
+
),
|
|
54
|
+
style: z(w.value)
|
|
55
|
+
}, [
|
|
56
|
+
t("div", R, [
|
|
57
|
+
t("div", j, [
|
|
58
|
+
(o(!0), e(r, null, c(p.value, (l, g) => (o(), e("div", {
|
|
59
|
+
key: g,
|
|
60
|
+
class: "notion-board-th"
|
|
61
|
+
}, [
|
|
62
|
+
l.hidden ? _("", !0) : (o(), e("div", q, [
|
|
63
|
+
t("span", A, h(l.value?.value || "No Select"), 1),
|
|
64
|
+
t("span", H, h(S(l)), 1)
|
|
65
|
+
]))
|
|
66
|
+
]))), 128))
|
|
67
|
+
])
|
|
68
|
+
]),
|
|
69
|
+
i[0] || (i[0] = t("div", { class: "notion-board-header-placeholder" }, null, -1)),
|
|
70
|
+
t("div", J, [
|
|
71
|
+
(o(!0), e(r, null, c(p.value, (l, g) => (o(), e("div", {
|
|
72
|
+
key: g,
|
|
73
|
+
class: "notion-board-group"
|
|
74
|
+
}, [
|
|
75
|
+
l.hidden ? _("", !0) : (o(!0), e(r, { key: 0 }, c(k(l).blockIds, ($) => (o(), f(N, {
|
|
76
|
+
key: $,
|
|
77
|
+
block: b(m).block[$]?.value,
|
|
78
|
+
collection: d.collection,
|
|
79
|
+
"collection-view": d.collectionView,
|
|
80
|
+
class: "notion-board-group-card"
|
|
81
|
+
}, null, 8, ["block", "collection", "collection-view"]))), 128))
|
|
82
|
+
]))), 128))
|
|
83
|
+
])
|
|
84
|
+
], 6)
|
|
85
|
+
])
|
|
86
|
+
]),
|
|
87
|
+
_: 1
|
|
88
|
+
}, 16, ["summary-props"]))), 128)) : (o(), e("div", O, [
|
|
89
|
+
t("div", {
|
|
90
|
+
class: x(
|
|
91
|
+
b(G)("notion-board-view", `notion-board-view-size-${V.value}`)
|
|
92
|
+
),
|
|
93
|
+
style: z(w.value)
|
|
94
|
+
}, [
|
|
95
|
+
t("div", Q, [
|
|
96
|
+
t("div", T, [
|
|
97
|
+
(o(!0), e(r, null, c(p.value, (a, v) => (o(), e("div", {
|
|
98
|
+
key: v,
|
|
99
|
+
class: "notion-board-th"
|
|
100
|
+
}, [
|
|
101
|
+
a.hidden ? _("", !0) : (o(), e("div", U, [
|
|
102
|
+
t("span", W, h(a.value?.value || "No Select"), 1),
|
|
103
|
+
t("span", X, h(S(a)), 1)
|
|
104
|
+
]))
|
|
105
|
+
]))), 128))
|
|
106
|
+
])
|
|
107
|
+
]),
|
|
108
|
+
i[1] || (i[1] = t("div", { class: "notion-board-header-placeholder" }, null, -1)),
|
|
109
|
+
t("div", Y, [
|
|
110
|
+
(o(!0), e(r, null, c(p.value, (a, v) => (o(), e("div", {
|
|
111
|
+
key: v,
|
|
112
|
+
class: "notion-board-group"
|
|
113
|
+
}, [
|
|
114
|
+
a.hidden ? _("", !0) : (o(!0), e(r, { key: 0 }, c(k(a).blockIds, (l) => (o(), e(r, { key: l }, [
|
|
115
|
+
b(m).block[l]?.value ? (o(), f(N, {
|
|
116
|
+
key: 0,
|
|
117
|
+
block: b(m).block[l].value,
|
|
118
|
+
collection: d.collection,
|
|
119
|
+
"collection-view": d.collectionView,
|
|
120
|
+
class: "notion-board-group-card"
|
|
121
|
+
}, null, 8, ["block", "collection", "collection-view"])) : _("", !0)
|
|
122
|
+
], 64))), 128))
|
|
123
|
+
]))), 128))
|
|
124
|
+
])
|
|
125
|
+
], 6)
|
|
126
|
+
]));
|
|
127
|
+
}
|
|
128
|
+
});
|
|
129
|
+
export {
|
|
130
|
+
lo as default
|
|
131
|
+
};
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { defineComponent as C, computed as c, createElementBlock as i, openBlock as e, Fragment as a, renderList as s, createBlock as u, mergeProps as V, withCtx as h, createElementVNode as n, normalizeClass as g, unref as r } from "vue";
|
|
2
|
+
import { u as z, c as y } from "./index-BNMgDI2p.js";
|
|
3
|
+
import { _ as f } from "./CollectionCard.vue_vue_type_script_setup_true_lang-14wiD7gP.js";
|
|
4
|
+
import { g as x, _ as D } from "./collection-utils-Cqo2kyVg.js";
|
|
5
|
+
const G = { class: "notion-gallery" }, $ = { class: "notion-gallery-view" }, B = {
|
|
6
|
+
key: 1,
|
|
7
|
+
class: "notion-gallery"
|
|
8
|
+
}, N = { class: "notion-gallery-view" }, E = {
|
|
9
|
+
name: "NotionCollectionViewGallery"
|
|
10
|
+
}, j = /* @__PURE__ */ C({
|
|
11
|
+
...E,
|
|
12
|
+
props: {
|
|
13
|
+
collection: {},
|
|
14
|
+
collectionView: {},
|
|
15
|
+
collectionData: {}
|
|
16
|
+
},
|
|
17
|
+
setup(l) {
|
|
18
|
+
const o = l, { recordMap: d } = z(), m = c(
|
|
19
|
+
() => !!o.collectionView?.format?.collection_group_by
|
|
20
|
+
), k = c(() => m.value ? x(
|
|
21
|
+
o.collection,
|
|
22
|
+
o.collectionView,
|
|
23
|
+
o.collectionData
|
|
24
|
+
) : []), w = c(() => o.collectionData.collection_group_results?.blockIds || o.collectionData.blockIds || []), p = c(() => o.collectionView.format || {}), v = c(
|
|
25
|
+
() => p.value.gallery_cover_size || "medium"
|
|
26
|
+
);
|
|
27
|
+
return (F, I) => m.value ? (e(!0), i(a, { key: 0 }, s(k.value, (t, b) => (e(), u(D, V({ key: b }, { ref_for: !0 }, t), {
|
|
28
|
+
default: h(() => [
|
|
29
|
+
n("div", G, [
|
|
30
|
+
n("div", $, [
|
|
31
|
+
n("div", {
|
|
32
|
+
class: g(
|
|
33
|
+
r(y)(
|
|
34
|
+
"notion-gallery-grid",
|
|
35
|
+
`notion-gallery-grid-size-${v.value}`
|
|
36
|
+
)
|
|
37
|
+
)
|
|
38
|
+
}, [
|
|
39
|
+
(e(!0), i(a, null, s(t.blockIds, (_) => (e(), u(f, {
|
|
40
|
+
key: _,
|
|
41
|
+
block: r(d).block[_]?.value,
|
|
42
|
+
collection: l.collection,
|
|
43
|
+
"collection-view": l.collectionView
|
|
44
|
+
}, null, 8, ["block", "collection", "collection-view"]))), 128))
|
|
45
|
+
], 2)
|
|
46
|
+
])
|
|
47
|
+
])
|
|
48
|
+
]),
|
|
49
|
+
_: 2
|
|
50
|
+
}, 1040))), 128)) : (e(), i("div", B, [
|
|
51
|
+
n("div", N, [
|
|
52
|
+
n("div", {
|
|
53
|
+
class: g(
|
|
54
|
+
r(y)(
|
|
55
|
+
"notion-gallery-grid",
|
|
56
|
+
`notion-gallery-grid-size-${v.value}`
|
|
57
|
+
)
|
|
58
|
+
)
|
|
59
|
+
}, [
|
|
60
|
+
(e(!0), i(a, null, s(w.value, (t) => (e(), u(f, {
|
|
61
|
+
key: t,
|
|
62
|
+
block: r(d).block[t]?.value,
|
|
63
|
+
collection: l.collection,
|
|
64
|
+
"collection-view": l.collectionView
|
|
65
|
+
}, null, 8, ["block", "collection", "collection-view"]))), 128))
|
|
66
|
+
], 2)
|
|
67
|
+
])
|
|
68
|
+
]));
|
|
69
|
+
}
|
|
70
|
+
});
|
|
71
|
+
export {
|
|
72
|
+
j as default
|
|
73
|
+
};
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
import { defineComponent as x, computed as _, createElementBlock as i, openBlock as t, Fragment as r, renderList as m, createBlock as v, mergeProps as L, withCtx as k, createElementVNode as n, resolveDynamicComponent as C, unref as e, createVNode as d, createCommentVNode as V } from "vue";
|
|
2
|
+
import { u as B, _ as D } from "./index-BNMgDI2p.js";
|
|
3
|
+
import { g as G, _ as $, a as h } from "./collection-utils-Cqo2kyVg.js";
|
|
4
|
+
const E = { class: "notion-list-collection" }, F = { class: "notion-list-view" }, M = { class: "notion-list-body" }, U = { class: "notion-list-item-title" }, j = { class: "notion-list-item-body" }, q = {
|
|
5
|
+
key: 0,
|
|
6
|
+
class: "notion-list-item-property"
|
|
7
|
+
}, z = {
|
|
8
|
+
key: 1,
|
|
9
|
+
class: "notion-list-collection"
|
|
10
|
+
}, A = { class: "notion-list-view" }, H = { class: "notion-list-body" }, J = { class: "notion-list-item-title" }, K = { class: "notion-list-item-body" }, O = {
|
|
11
|
+
key: 0,
|
|
12
|
+
class: "notion-list-item-property"
|
|
13
|
+
}, Q = {
|
|
14
|
+
name: "NotionCollectionViewList"
|
|
15
|
+
}, X = /* @__PURE__ */ x({
|
|
16
|
+
...Q,
|
|
17
|
+
props: {
|
|
18
|
+
collection: {},
|
|
19
|
+
collectionView: {},
|
|
20
|
+
collectionData: {}
|
|
21
|
+
},
|
|
22
|
+
setup(c) {
|
|
23
|
+
const s = c, { recordMap: o, mapPageUrl: f, components: y } = B(), b = _(
|
|
24
|
+
() => !!s.collectionView?.format?.collection_group_by
|
|
25
|
+
), N = _(() => b.value ? G(
|
|
26
|
+
s.collection,
|
|
27
|
+
s.collectionView,
|
|
28
|
+
s.collectionData
|
|
29
|
+
) : []), P = _(() => s.collectionData.collection_group_results?.blockIds || s.collectionData.blockIds || []), g = _(() => s.collectionView.format?.list_properties?.filter(
|
|
30
|
+
(w) => w.visible
|
|
31
|
+
) || []);
|
|
32
|
+
return (w, R) => b.value ? (t(!0), i(r, { key: 0 }, m(N.value, (l, u) => (t(), v($, L({ key: u }, { ref_for: !0 }, l), {
|
|
33
|
+
default: k(() => [
|
|
34
|
+
n("div", E, [
|
|
35
|
+
n("div", F, [
|
|
36
|
+
n("div", M, [
|
|
37
|
+
(t(!0), i(r, null, m(l.blockIds, (a) => (t(), v(C(e(y).PageLink), {
|
|
38
|
+
key: a,
|
|
39
|
+
href: e(f)(a),
|
|
40
|
+
class: "notion-list-item notion-page-link"
|
|
41
|
+
}, {
|
|
42
|
+
default: k(() => [
|
|
43
|
+
n("div", U, [
|
|
44
|
+
d(D, {
|
|
45
|
+
block: e(o).block[a]?.value,
|
|
46
|
+
class: "notion-page-title-icon",
|
|
47
|
+
"hide-default-icon": ""
|
|
48
|
+
}, null, 8, ["block"]),
|
|
49
|
+
d(h, {
|
|
50
|
+
schema: c.collection.schema.title,
|
|
51
|
+
data: e(o).block[a]?.value?.properties?.title,
|
|
52
|
+
block: e(o).block[a]?.value,
|
|
53
|
+
collection: c.collection
|
|
54
|
+
}, null, 8, ["schema", "data", "block", "collection"])
|
|
55
|
+
]),
|
|
56
|
+
n("div", j, [
|
|
57
|
+
(t(!0), i(r, null, m(g.value, (p) => (t(), i(r, {
|
|
58
|
+
key: p.property
|
|
59
|
+
}, [
|
|
60
|
+
p.property !== "title" ? (t(), i("div", q, [
|
|
61
|
+
d(h, {
|
|
62
|
+
schema: c.collection.schema[p.property],
|
|
63
|
+
data: e(o).block[a]?.value?.properties?.[p.property],
|
|
64
|
+
block: e(o).block[a]?.value,
|
|
65
|
+
collection: c.collection
|
|
66
|
+
}, null, 8, ["schema", "data", "block", "collection"])
|
|
67
|
+
])) : V("", !0)
|
|
68
|
+
], 64))), 128))
|
|
69
|
+
])
|
|
70
|
+
]),
|
|
71
|
+
_: 2
|
|
72
|
+
}, 1032, ["href"]))), 128))
|
|
73
|
+
])
|
|
74
|
+
])
|
|
75
|
+
])
|
|
76
|
+
]),
|
|
77
|
+
_: 2
|
|
78
|
+
}, 1040))), 128)) : (t(), i("div", z, [
|
|
79
|
+
n("div", A, [
|
|
80
|
+
n("div", H, [
|
|
81
|
+
(t(!0), i(r, null, m(P.value, (l) => (t(), v(C(e(y).PageLink), {
|
|
82
|
+
key: l,
|
|
83
|
+
href: e(f)(l),
|
|
84
|
+
class: "notion-list-item notion-page-link"
|
|
85
|
+
}, {
|
|
86
|
+
default: k(() => [
|
|
87
|
+
n("div", J, [
|
|
88
|
+
d(D, {
|
|
89
|
+
block: e(o).block[l]?.value,
|
|
90
|
+
class: "notion-page-title-icon",
|
|
91
|
+
"hide-default-icon": ""
|
|
92
|
+
}, null, 8, ["block"]),
|
|
93
|
+
d(h, {
|
|
94
|
+
schema: c.collection.schema.title,
|
|
95
|
+
data: e(o).block[l]?.value?.properties?.title,
|
|
96
|
+
block: e(o).block[l]?.value,
|
|
97
|
+
collection: c.collection
|
|
98
|
+
}, null, 8, ["schema", "data", "block", "collection"])
|
|
99
|
+
]),
|
|
100
|
+
n("div", K, [
|
|
101
|
+
(t(!0), i(r, null, m(g.value, (u) => (t(), i(r, {
|
|
102
|
+
key: u.property
|
|
103
|
+
}, [
|
|
104
|
+
u.property !== "title" ? (t(), i("div", O, [
|
|
105
|
+
d(h, {
|
|
106
|
+
schema: c.collection.schema[u.property],
|
|
107
|
+
data: e(o).block[l]?.value?.properties?.[u.property],
|
|
108
|
+
block: e(o).block[l]?.value,
|
|
109
|
+
collection: c.collection
|
|
110
|
+
}, null, 8, ["schema", "data", "block", "collection"])
|
|
111
|
+
])) : V("", !0)
|
|
112
|
+
], 64))), 128))
|
|
113
|
+
])
|
|
114
|
+
]),
|
|
115
|
+
_: 2
|
|
116
|
+
}, 1032, ["href"]))), 128))
|
|
117
|
+
])
|
|
118
|
+
])
|
|
119
|
+
]));
|
|
120
|
+
}
|
|
121
|
+
});
|
|
122
|
+
export {
|
|
123
|
+
X as default
|
|
124
|
+
};
|