-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 923b1f1
Showing
19 changed files
with
5,254 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
root = true | ||
|
||
[*] | ||
charset = utf-8 | ||
indent_style = space | ||
indent_size = 2 | ||
end_of_line = lf | ||
insert_final_newline = true | ||
trim_trailing_whitespace = true | ||
|
||
[*.md] | ||
insert_final_newline = false | ||
trim_trailing_whitespace = false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
dist | ||
node_modules | ||
.output | ||
.nuxt | ||
pnpm-lock.yaml | ||
renovate.json5 | ||
.github |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"extends": "@antfu", | ||
"rules": { | ||
"vue/max-attributes-per-line": ["error", { | ||
"singleline": { | ||
"max": 2 | ||
} | ||
}] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
* text=auto eol=lf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
node_modules | ||
*.log | ||
.nuxt | ||
nuxt.d.ts | ||
.output | ||
.env | ||
.idea | ||
dist |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
shamefully-hoist=true | ||
strict-peer-dependencies=false | ||
auto-install-peers=true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
# Vue Tiptap Renderer | ||
|
||
A Vue component to render JSON content generated by tiptap editor | ||
|
||
## :heavy_check_mark: Supported features | ||
|
||
- [x] Headings | ||
- [x] Blockquote | ||
- [x] Bullet list | ||
- [x] Ordered list | ||
- [x] Line feed | ||
- [x] Images | ||
- [x] Marks | ||
- [x] Text styles | ||
- [x] Text align | ||
- [x] Font family (customisable class name) | ||
- [x] Bold | ||
- [x] Italic | ||
- [x] Underline | ||
- [x] Strike | ||
- [x] Links | ||
|
||
If any feature is missing a `console.warn` will pop. Do not hesitate to start a new issue to request missing feature. | ||
|
||
## Usage | ||
|
||
```shell | ||
npm i @leo91000/vue-tiptap-renderer | ||
# or | ||
yarn add @leo91000/vue-tiptap-renderer | ||
# or | ||
pnpm add @leo91000/vue-tiptap-renderer | ||
``` | ||
|
||
```vue | ||
<script setup lang="ts"> | ||
// Optional : Import CSS Classes or provide your own | ||
// You can also whitelist those tailwind css classes : italic line-through underline font-bold text-center text-justify text-left text-right font-bold | ||
import '@leo91000/vue-tiptap-renderer/styles.css' | ||
import type { JSONContent } from '@leo91000/vue-tiptap-renderer' | ||
import { JsonRenderer } from '@leo91000/vue-tiptap-renderer' | ||
defineProps<{ | ||
article: JSONContent | ||
}>() | ||
// Inject css class for font family text style | ||
const fontFamilyClasses = { | ||
'Roboto': 'font-roboto' | ||
} | ||
</script> | ||
<template> | ||
<JsonRenderer | ||
:content="article" | ||
:font-family-classes="fontFamilyClasses" | ||
/> | ||
</template> | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import { copyFile } from 'fs/promises' | ||
import { resolve } from 'path' | ||
import { defineBuildConfig } from 'unbuild' | ||
|
||
export default defineBuildConfig({ | ||
clean: true, | ||
declaration: true, | ||
rollup: { | ||
emitCJS: true, | ||
}, | ||
entries: [ | ||
{ input: 'src/index' }, | ||
], | ||
externals: [ | ||
'vue-demi', | ||
], | ||
hooks: { | ||
'build:done': async () => { | ||
await copyFile(resolve(__dirname, 'style.css'), resolve(__dirname, 'dist/style.css')) | ||
}, | ||
}, | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
{ | ||
"name": "@leo91000/vue-tiptap-renderer", | ||
"keywords": [ | ||
"tiptap", | ||
"json", | ||
"vue", | ||
"render", | ||
"function" | ||
], | ||
"license": "MIT", | ||
"description": "Tiptap JSON content renderer for Vue 2/3", | ||
"author": { | ||
"name": "Léo Coletta", | ||
"email": "[email protected]", | ||
"url": "https://leo-coletta.fr" | ||
}, | ||
"sideEffects": false, | ||
"repository": "github:leo91000/vue-tiptap-renderer", | ||
"homepage": "https://github.com/leo91000/vue-tiptap-renderer#readme", | ||
"bugs": "https://github.com/leo91000/vue-tiptap-renderer/issues", | ||
"funding": "https://github.com/leo91000", | ||
"main": "dist/index.cjs", | ||
"module": "dist/index.mjs", | ||
"types": "dist/index.d.ts", | ||
"exports": { | ||
".": { | ||
"import": "./dist/index.mjs", | ||
"require": "./dist/index.cjs" | ||
} | ||
}, | ||
"files": [ | ||
"dist" | ||
], | ||
"scripts": { | ||
"build": "unbuild", | ||
"dev": "vitest", | ||
"lint": "eslint --ext .ts .", | ||
"prepack": "nr build", | ||
"release": "nr test && standard-version && git push --follow-tags && nr publish", | ||
"test": "nr lint && vitest run" | ||
}, | ||
"version": "0.1.0", | ||
"packageManager": "[email protected]", | ||
"volta": { | ||
"node": "16.15.0", | ||
"npm": "8.10.0" | ||
}, | ||
"dependencies": { | ||
"vue-demi": "*" | ||
}, | ||
"devDependencies": { | ||
"@antfu/eslint-config": "0.23.1", | ||
"@antfu/ni": "0.16.2", | ||
"@vue/test-utils": "2.0.0-rc.21", | ||
"eslint": "8.15.0", | ||
"jsdom": "^19.0.0", | ||
"standard-version": "9.3.2", | ||
"typescript": "4.6.4", | ||
"unbuild": "0.7.4", | ||
"vitest": "0.12.6", | ||
"vue": "3.2.33" | ||
}, | ||
"peerDependencies": { | ||
"@vue/composition-api": "^1.0.0-rc.1", | ||
"vue": "^2.0.0 || >=3.0.0" | ||
}, | ||
"peerDependenciesMeta": { | ||
"@vue/composition-api": { | ||
"optional": true | ||
}, | ||
"vue": { | ||
"optional": true | ||
} | ||
} | ||
} |
Oops, something went wrong.