66
77<script setup lang="ts">
88import { ref , provide } from ' vue' ;
9- import { dependencies , name } from ' ../package ' ;
9+ import { useCoreStore } from ' @/stores/index ' ;
1010import DemoPage from ' @/components/DemoPage.vue' ;
1111import NavBar from ' @/components/Layout/NavBar.vue' ;
1212import FooterBar from ' @/components/Layout/FooterBar.vue' ;
@@ -20,41 +20,12 @@ provide('styleData', {
2020 },
2121});
2222
23- const packageName = name ;
24- const repoBaseUrl = ` https://github.com/webdevnerdstuff/${packageName } ` ;
25- const prismVersion = dependencies .prismjs .replace (' ^' , ' ' );
26- const highlightJsVersion = dependencies [' highlight.js' ].replace (' ^' , ' ' );
23+ const store = useCoreStore ();
2724const selectedLibrary = ref ({});
2825
29-
30- const links = {
31- changeLog: ` ${repoBaseUrl }/blob/main/CHANGELOG.md ` ,
32- contribute: ` ${repoBaseUrl }/tree/main/src/plugin/styles ` ,
33- github: repoBaseUrl ,
34- githubProfile: ' https://github.com/webdevnerdstuff' ,
35- license: ` ${repoBaseUrl }/blob/main/LICENSE.md ` ,
36- neonBunnyTheme: ' https://marketplace.visualstudio.com/items?itemName=WebDevNerdStuff.neon-bunny' ,
37- npm: ` https://www.npmjs.com/package/${packageName } ` ,
38- uaParser: ' https://www.npmjs.com/package/ua-parser-js' ,
39- vueJs: ' https://vuejs.org/' ,
40- };
41-
42- const highlightJsLinks = {
43- cdn: ` https://cdn.jsdelivr.net/gh/highlightjs/cdn-release@${highlightJsVersion }/build/styles/ ` ,
44- homepage: ' https://highlightjs.org/' ,
45- themes: ` https://github.com/highlightjs/highlight.js/tree/${highlightJsVersion }/src/styles ` ,
46- };
47-
48- const prismLinks = {
49- cdn: ` https://cdn.jsdelivr.net/gh/PrismJS/prism@${prismVersion }/themes/ ` ,
50- homepage: ' https://prismjs.com/' ,
51- prismThemes: ` https://github.com/PrismJS/prism/tree/v${prismVersion }/themes ` ,
52- themes: ' https://github.com/PrismJS/prism-themes' ,
53- };
54-
55- provide (' links' , links );
56- provide (' highlightJsLinks' , highlightJsLinks );
57- provide (' prismLinks' , prismLinks );
26+ provide (' links' , store .links );
27+ provide (' highlightJsLinks' , store .highlightJsLinks );
28+ provide (' prismLinks' , store .prismLinks );
5829
5930const codeBlockOptions = ref ({
6031 browserWindow: false ,
0 commit comments