File tree Expand file tree Collapse file tree 9 files changed +2459
-4716
lines changed Expand file tree Collapse file tree 9 files changed +2459
-4716
lines changed Original file line number Diff line number Diff line change 11{
22 "name" : " @dword-design/component" ,
33 "testInContainer" : true ,
4- "cdnExtraScripts" : [
5- " <script src=\" https://unpkg.com/mermaid/dist/mermaid.min.js\" ></script>"
6- ],
74 "seeAlso" : [
85 { "repository" : " nuxt-mermaid-string" , "description" : " Embed a Mermaid diagram in a Nuxt.js app by providing its diagram string." }
96 ]
Original file line number Diff line number Diff line change 1+ {
2+ "features" : {
3+ "ghcr.io/devcontainers/features/docker-in-docker:2" : {}
4+ },
5+ "image" : " mcr.microsoft.com/devcontainers/javascript-node:0-16" ,
6+ "updateContentCommand" : " yarn --frozen-lockfile"
7+ }
Original file line number Diff line number Diff line change @@ -7,7 +7,6 @@ RUN git lfs install
77
88# https://www.gitpod.io/docs/languages/javascript
99RUN bash -c 'VERSION="16" && source $HOME/.nvm/nvm.sh && nvm install $VERSION && nvm use $VERSION && nvm alias default $VERSION'
10- RUN echo "nvm use default &>/dev/null" >> ~/.bashrc.d/51-nvm-fix
1110
1211RUN echo "\n export PATH=$(yarn global bin):\$ PATH" >> /home/gitpod/.bashrc
1312
Original file line number Diff line number Diff line change 66 ".browserslistrc" : true ,
77 ".commitlintrc.json" : true ,
88 ".cz.json" : true ,
9+ ".devcontainer" : true ,
910 ".editorconfig" : true ,
1011 ".eslintrc.json" : true ,
1112 ".gitattributes" : true ,
1718 ".nyc_output" : true ,
1819 ".releaserc.json" : true ,
1920 ".renovaterc.json" : true ,
21+ ".vscode" : true ,
2022 "CHANGELOG.md" : true ,
2123 "LICENSE.md" : true ,
2224 "coverage" : true ,
Original file line number Diff line number Diff line change @@ -101,8 +101,7 @@ Vue.use(VueMermaidString)
101101## Install via CDN
102102
103103``` html
104- <
script src =
" https://cdn.jsdelivr.net/npm/[email protected] /dist/vue.js" ></
script >
105- <script src =" https://unpkg.com/mermaid/dist/mermaid.min.js" ></script >
104+ <script src =" https://unpkg.com/vue@3/dist/vue.global.js" ></script >
106105<script src =" https://unpkg.com/vue-mermaid-string" ></script >
107106```
108107<!-- /INSTALL -->
Original file line number Diff line number Diff line change 3030 },
3131 "devDependencies" : {
3232 "@dword-design/base" : " ^9.1.10" ,
33- "@dword-design/base-config-component" : " ^1.1.7 " ,
33+ "@dword-design/base-config-component" : " ^2.0.0 " ,
3434 "@dword-design/functions" : " ^4.0.0" ,
3535 "@dword-design/puppeteer" : " ^6.0.0" ,
3636 "@dword-design/tester" : " ^2.0.0" ,
37- "@dword-design/tester-plugin-component" : " ^2 .0.0" ,
37+ "@dword-design/tester-plugin-component" : " ^3 .0.0" ,
3838 "@dword-design/tester-plugin-puppeteer" : " ^2.0.0"
3939 },
4040 "engines" : {
Original file line number Diff line number Diff line change @@ -42,6 +42,8 @@ export default tester(
4242 async test ( ) {
4343 await this . page . goto ( 'http://localhost:3000' )
4444 await this . page . waitForSelector ( '.foo' )
45+ console . log ( 'ready' )
46+ await new Promise ( resolve => setTimeout ( resolve , 30000 ) )
4547 await this . page . click ( 'button' )
4648 expect (
4749 await this . page . screenshot ( { fullPage : true } )
Original file line number Diff line number Diff line change 33</template >
44
55<script >
6+ import mermaid from ' mermaid'
67import { nanoid } from ' nanoid'
78
89import addClickEvent from ' ./add-click-event.js'
910
1011export default {
11- beforeDestroy () {
12+ beforeUnmount () {
1213 delete window [` mermaidClick_${ this .id } ` ]
1314 },
1415 computed: {
@@ -20,22 +21,15 @@ export default {
2021 methods: {
2122 update () {
2223 if (typeof window !== ' undefined' ) {
23- const mermaid = window .mermaid || require (' mermaid' ).default
24- mermaid .parseError = error => this .$emit (' parse-error' , error)
2524 this .$el .removeAttribute (' data-processed' )
26- this .$el .replaceChild (
27- document .createTextNode (this .finalValue ),
28- this .$el .firstChild
29- )
25+ mermaid .parseError = error => this .$emit (' parse-error' , error)
3026 mermaid .init (this .finalValue , this .$el )
3127 }
3228 },
3329 },
3430 mounted () {
3531 if (typeof window !== ' undefined' ) {
3632 window [` mermaidClick_${ this .id } ` ] = id => this .$emit (' node-click' , id)
37-
38- const mermaid = window .mermaid || require (' mermaid' ).default
3933 mermaid .initialize ({
4034 securityLevel: ' loose' ,
4135 startOnLoad: false ,
@@ -52,8 +46,11 @@ export default {
5246 value: { required: true , type: String },
5347 },
5448 watch: {
55- finalValue () {
56- return this .update ()
49+ finalValue: {
50+ flush: ' post' ,
51+ async handler () {
52+ await this .update ()
53+ },
5754 },
5855 },
5956}
Load Diff Large diffs are not rendered by default.
You can’t perform that action at this time.
0 commit comments