mirror of
https://github.com/ueberdosis/tiptap.git
synced 2024-11-27 14:59:27 +08:00
initial commit
This commit is contained in:
commit
f9c7066302
22
.gitignore
vendored
Normal file
22
.gitignore
vendored
Normal file
@ -0,0 +1,22 @@
|
||||
*.log
|
||||
.cache
|
||||
.DS_Store
|
||||
src/.temp
|
||||
node_modules
|
||||
dist
|
||||
.env
|
||||
.env.*
|
||||
|
||||
# Log files
|
||||
npm-debug.log*
|
||||
yarn-debug.log*
|
||||
yarn-error.log*
|
||||
|
||||
# parcel-bundler cache (https://parceljs.org/)
|
||||
.cache
|
||||
|
||||
.rpt2_cache
|
||||
.rts2_cache
|
||||
.rts2_cache_cjs
|
||||
.rts2_cache_es
|
||||
.rts2_cache_umd
|
14
README.md
Normal file
14
README.md
Normal file
@ -0,0 +1,14 @@
|
||||
# Default starter for Gridsome
|
||||
|
||||
This is the project you get when you run `gridsome create new-project`.
|
||||
|
||||
### 1. Install Gridsome CLI tool if you don't have
|
||||
|
||||
`npm install --global @gridsome/cli`
|
||||
|
||||
### 2. Create a Gridsome project
|
||||
|
||||
1. `gridsome create my-gridsome-site` to install default starter
|
||||
2. `cd my-gridsome-site` to open the folder
|
||||
3. `gridsome develop` to start a local dev server at `http://localhost:8080`
|
||||
4. Happy coding 🎉🙌
|
7
content/posts/test.md
Normal file
7
content/posts/test.md
Normal file
@ -0,0 +1,7 @@
|
||||
---
|
||||
title: Test
|
||||
slug: test
|
||||
---
|
||||
|
||||
test
|
||||
|
31
gridsome.config.js
Normal file
31
gridsome.config.js
Normal file
@ -0,0 +1,31 @@
|
||||
module.exports = {
|
||||
siteName: 'TipTap',
|
||||
port: 3000,
|
||||
plugins: [
|
||||
{
|
||||
use: '@gridsome/vue-remark',
|
||||
options: {
|
||||
typeName: 'Post',
|
||||
baseDir: './content/posts',
|
||||
route: '/posts/:slug',
|
||||
template: './src/templates/Post.vue',
|
||||
plugins: [
|
||||
'@gridsome/remark-prismjs',
|
||||
[
|
||||
'@noxify/gridsome-plugin-remark-embed',
|
||||
{
|
||||
'enabledProviders' : ['Youtube', 'Twitter', 'Gist'],
|
||||
},
|
||||
],
|
||||
],
|
||||
}
|
||||
},
|
||||
// {
|
||||
// use: '@gridsome/source-filesystem',
|
||||
// options: {
|
||||
// path: './people/**/*.json',
|
||||
// typeName: 'People',
|
||||
// }
|
||||
// },
|
||||
]
|
||||
}
|
27
gridsome.server.js
Normal file
27
gridsome.server.js
Normal file
@ -0,0 +1,27 @@
|
||||
// Server API makes it possible to hook into various parts of Gridsome
|
||||
// on server-side and add custom data to the GraphQL data layer.
|
||||
// Learn more: https://gridsome.org/docs/server-api/
|
||||
|
||||
// Changes here require a server restart.
|
||||
// To restart press CTRL + C in terminal and run `gridsome develop`
|
||||
|
||||
const path = require('path')
|
||||
|
||||
module.exports = function (api) {
|
||||
api.loadSource(({ addCollection }) => {
|
||||
// Use the Data Store API here: https://gridsome.org/docs/data-store-api/
|
||||
})
|
||||
|
||||
api.createPages(({ createPage }) => {
|
||||
// Use the Pages API here: https://gridsome.org/docs/pages-api/
|
||||
})
|
||||
|
||||
api.chainWebpack(config => {
|
||||
config.resolve.extensions
|
||||
.add('.ts')
|
||||
|
||||
config.resolve.alias
|
||||
.set('@tiptap/core', path.resolve('./packages/tiptap-core'))
|
||||
})
|
||||
|
||||
}
|
8
lerna.json
Normal file
8
lerna.json
Normal file
@ -0,0 +1,8 @@
|
||||
{
|
||||
"packages": [
|
||||
"packages/*"
|
||||
],
|
||||
"npmClient": "yarn",
|
||||
"version": "independent",
|
||||
"useWorkspaces": true
|
||||
}
|
26
package.json
Normal file
26
package.json
Normal file
@ -0,0 +1,26 @@
|
||||
{
|
||||
"name": "tiptap-docs",
|
||||
"private": true,
|
||||
"workspaces": [
|
||||
"packages/*"
|
||||
],
|
||||
"scripts": {
|
||||
"start": "gridsome develop",
|
||||
"build:docs": "gridsome build",
|
||||
"build:packages": "yarn clean:packages && lerna exec --parallel -- microbundle --raw --compress",
|
||||
"clean:packages": "rm -rf ./packages/*/dist"
|
||||
},
|
||||
"dependencies": {
|
||||
"@gridsome/remark-prismjs": "^0.3.0",
|
||||
"@gridsome/source-filesystem": "^0.6.2",
|
||||
"@gridsome/transformer-json": "^0.2.1",
|
||||
"@gridsome/vue-remark": "^0.1.9",
|
||||
"@noxify/gridsome-plugin-remark-embed": "^1.1.5",
|
||||
"gridsome": "^0.7.0",
|
||||
"lerna": "^3.19.0",
|
||||
"microbundle": "^0.11.0",
|
||||
"parcel": "^1.12.4",
|
||||
"typescript": "^3.7.2",
|
||||
"raw-loader": "^4.0.0"
|
||||
}
|
||||
}
|
3
packages/tiptap-core/index.ts
Normal file
3
packages/tiptap-core/index.ts
Normal file
@ -0,0 +1,3 @@
|
||||
export default function() {
|
||||
return 1
|
||||
}
|
15
packages/tiptap-core/package.json
Normal file
15
packages/tiptap-core/package.json
Normal file
@ -0,0 +1,15 @@
|
||||
{
|
||||
"name": "@tiptap/core",
|
||||
"private": true,
|
||||
"version": "0.1.0",
|
||||
"source": "index.ts",
|
||||
"main": "dist/tiptap-core.js",
|
||||
"umd:main": "dist/tiptap-core.umd.js",
|
||||
"module": "dist/tiptap-core.mjs",
|
||||
"unpkg": "dist/tiptap-core.js",
|
||||
"jsdelivr": "dist/tiptap-core.js",
|
||||
"files": [
|
||||
"src",
|
||||
"dist"
|
||||
]
|
||||
}
|
3
packages/tiptap-vue/index.ts
Normal file
3
packages/tiptap-vue/index.ts
Normal file
@ -0,0 +1,3 @@
|
||||
export default function() {
|
||||
return 2
|
||||
}
|
15
packages/tiptap-vue/package.json
Normal file
15
packages/tiptap-vue/package.json
Normal file
@ -0,0 +1,15 @@
|
||||
{
|
||||
"name": "@tiptap/vue",
|
||||
"private": true,
|
||||
"version": "0.1.0",
|
||||
"source": "index.ts",
|
||||
"main": "dist/tiptap-vue.js",
|
||||
"umd:main": "dist/tiptap-vue.umd.js",
|
||||
"module": "dist/tiptap-vue.mjs",
|
||||
"unpkg": "dist/tiptap-vue.js",
|
||||
"jsdelivr": "dist/tiptap-vue.js",
|
||||
"files": [
|
||||
"src",
|
||||
"dist"
|
||||
]
|
||||
}
|
14
src/components/Ad.vue
Normal file
14
src/components/Ad.vue
Normal file
@ -0,0 +1,14 @@
|
||||
<template>
|
||||
<div>
|
||||
This is an ad ☠️
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
div {
|
||||
background-color: tomato;
|
||||
border-radius: 5px;
|
||||
color: white;
|
||||
padding: 20px;
|
||||
}
|
||||
</style>
|
14
src/components/CurrentTime.vue
Normal file
14
src/components/CurrentTime.vue
Normal file
@ -0,0 +1,14 @@
|
||||
<template>
|
||||
<div>
|
||||
Time: {{ new Date() }}
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
div {
|
||||
background-color: black;
|
||||
border-radius: 5px;
|
||||
color: white;
|
||||
padding: 20px;
|
||||
}
|
||||
</style>
|
35
src/components/Preview.vue
Normal file
35
src/components/Preview.vue
Normal file
@ -0,0 +1,35 @@
|
||||
<template>
|
||||
<div>
|
||||
<p>
|
||||
Rendered Preview:
|
||||
</p>
|
||||
<component :is="component" v-if="component" />
|
||||
<p>
|
||||
Code:
|
||||
</p>
|
||||
<pre v-if="content" class="language-markup"><code class="language-markup" v-html="$options.filters.highlight(content, 'markup')"></code></pre>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
props: {
|
||||
path: {
|
||||
type: String,
|
||||
required: true,
|
||||
},
|
||||
},
|
||||
|
||||
data() {
|
||||
return {
|
||||
component: null,
|
||||
content: null,
|
||||
}
|
||||
},
|
||||
|
||||
mounted() {
|
||||
this.content = require(`!!raw-loader!~/components/${this.path}`).default
|
||||
this.component = require(`~/components/${this.path}`).default
|
||||
}
|
||||
}
|
||||
</script>
|
BIN
src/favicon.png
Normal file
BIN
src/favicon.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 30 KiB |
46
src/layouts/Default.vue
Normal file
46
src/layouts/Default.vue
Normal file
@ -0,0 +1,46 @@
|
||||
<template>
|
||||
<div class="layout">
|
||||
<header class="header">
|
||||
<strong>
|
||||
<g-link to="/">{{ $static.metadata.siteName }}</g-link>
|
||||
</strong>
|
||||
</header>
|
||||
<slot/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<static-query>
|
||||
query {
|
||||
metadata {
|
||||
siteName
|
||||
}
|
||||
}
|
||||
</static-query>
|
||||
|
||||
<style>
|
||||
body {
|
||||
font-family: -apple-system,system-ui,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;
|
||||
margin:0;
|
||||
padding:0;
|
||||
line-height: 1.5;
|
||||
}
|
||||
|
||||
.layout {
|
||||
max-width: 760px;
|
||||
margin: 0 auto;
|
||||
padding-left: 20px;
|
||||
padding-right: 20px;
|
||||
}
|
||||
|
||||
.header {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
margin-bottom: 20px;
|
||||
height: 80px;
|
||||
}
|
||||
|
||||
.nav__link {
|
||||
margin-left: 20px;
|
||||
}
|
||||
</style>
|
5
src/layouts/README.md
Normal file
5
src/layouts/README.md
Normal file
@ -0,0 +1,5 @@
|
||||
Layout components are used to wrap pages and templates. Layouts should contain components like headers, footers or sidebars that will be used across the site.
|
||||
|
||||
Learn more about Layouts: https://gridsome.org/docs/layouts/
|
||||
|
||||
You can delete this file.
|
18
src/main.js
Normal file
18
src/main.js
Normal file
@ -0,0 +1,18 @@
|
||||
// This is the main.js file. Import global CSS and scripts here.
|
||||
// The Client API can be used here. Learn more: gridsome.org/docs/client-api
|
||||
|
||||
import 'prismjs/themes/prism-okaidia.css'
|
||||
|
||||
import DefaultLayout from '~/layouts/Default.vue'
|
||||
|
||||
import Prism from 'prismjs'
|
||||
|
||||
|
||||
export default function (Vue, { router, head, isClient }) {
|
||||
|
||||
Vue.filter('highlight', (code, lang = 'javascript') => {
|
||||
return Prism.highlight(code, Prism.languages[lang], lang)
|
||||
})
|
||||
|
||||
Vue.component('Layout', DefaultLayout)
|
||||
}
|
25
src/pages/Index.vue
Normal file
25
src/pages/Index.vue
Normal file
@ -0,0 +1,25 @@
|
||||
<template>
|
||||
<Layout>
|
||||
|
||||
<div v-for="edge in $static.allPost.edges" :key="edge.node.id">
|
||||
<g-link :to="edge.node.path">
|
||||
{{ edge.node.title }}
|
||||
</g-link>
|
||||
</div>
|
||||
|
||||
</Layout>
|
||||
</template>
|
||||
|
||||
<static-query>
|
||||
query {
|
||||
allPost {
|
||||
edges {
|
||||
node {
|
||||
id
|
||||
title
|
||||
path
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</static-query>
|
5
src/pages/README.md
Normal file
5
src/pages/README.md
Normal file
@ -0,0 +1,5 @@
|
||||
Pages are usually used for normal pages or for listing items from a GraphQL collection.
|
||||
Add .vue files here to create pages. For example **About.vue** will be **site.com/about**.
|
||||
Learn more about pages: https://gridsome.org/docs/pages/
|
||||
|
||||
You can delete this file.
|
24
src/templates/Post.vue
Normal file
24
src/templates/Post.vue
Normal file
@ -0,0 +1,24 @@
|
||||
<template>
|
||||
<Layout>
|
||||
<h1>{{ $page.post.title }}</h1>
|
||||
<VueRemarkContent />
|
||||
</Layout>
|
||||
</template>
|
||||
|
||||
<page-query>
|
||||
query Post ($id: ID!) {
|
||||
post(id: $id) {
|
||||
title
|
||||
}
|
||||
}
|
||||
</page-query>
|
||||
|
||||
<script>
|
||||
import tiptap from '@tiptap/core'
|
||||
|
||||
export default {
|
||||
mounted() {
|
||||
console.log(tiptap())
|
||||
}
|
||||
}
|
||||
</script>
|
7
src/templates/README.md
Normal file
7
src/templates/README.md
Normal file
@ -0,0 +1,7 @@
|
||||
Templates for **GraphQL collections** should be added here.
|
||||
To create a template for a collection called `WordPressPost`
|
||||
create a file named `WordPressPost.vue` in this folder.
|
||||
|
||||
Learn more: https://gridsome.org/docs/templates/
|
||||
|
||||
You can delete this file.
|
3
static/README.md
Normal file
3
static/README.md
Normal file
@ -0,0 +1,3 @@
|
||||
Add static files here. Files in this directory will be copied directly to `dist` folder during build. For example, /static/robots.txt will be located at https://yoursite.com/robots.txt.
|
||||
|
||||
This file should be deleted.
|
Loading…
Reference in New Issue
Block a user