Skip to content

Commit 434a238

Browse files
Merge pull request #47 from webdevnerdstuff/dev
Dev
2 parents 84b8f35 + 695c5f5 commit 434a238

13 files changed

+148
-140
lines changed

Diff for: .gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ dist-ssr
2323
*.sln
2424
*.sw?
2525

26+
.history
27+
2628
.stylelintcache
2729
src/plugin/themes/scss/highlight-template.scss
2830
dist/themes/scss/highlight-template.scss

Diff for: CHANGELOG.md

+5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
# Change Log
22
All notable changes to the "vue-code-block" plugin will be documented in this file.
33

4+
## v2.3.2
5+
13-03-2024
6+
[main] (@webdevnerdstuff)
7+
* Change component to use `defineAsyncComponent`
8+
49
## v2.3.1
510
12-02-2023
611
[main] (@webdevnerdstuff)

Diff for: dist/plugin/VCodeBlock.vue.d.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Props } from '../plugin/types';
1+
import { Props } from './types';
22
declare function copyCode(): void;
33
declare function runCode(): void;
44
declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<Props>, {
@@ -30,7 +30,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__
3030
}>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
3131
run: (...args: any[]) => void;
3232
"update:copy-status": (...args: any[]) => void;
33-
}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<Props>, {
33+
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<Props>, {
3434
browserWindow: boolean;
3535
cssPath: undefined;
3636
code: string;

Diff for: dist/plugin/components/StatusIcons.vue.d.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ declare const _default: import("vue").DefineComponent<{
33
type: StringConstructor;
44
required: true;
55
};
6-
}, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
6+
}, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
77
icon: {
88
type: StringConstructor;
99
required: true;

Diff for: dist/plugin/composables/classes.d.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { UseCodeBlockClasses, UseCopyButtonClasses, UseIconClasses, UseLabelClasses, UseTabClasses } from '../../plugin/types';
1+
import { UseCodeBlockClasses, UseCopyButtonClasses, UseIconClasses, UseLabelClasses, UseTabClasses } from '../types';
22
export declare const useCodeBlockClasses: UseCodeBlockClasses;
33
export declare const useCopyButtonClasses: UseCopyButtonClasses;
44
export declare const useIconClasses: UseIconClasses;

Diff for: dist/plugin/composables/helpers.d.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { UseConvertToUnit } from '../../plugin/types';
1+
import { UseConvertToUnit } from '../types';
22
/**
33
* Converts a string to a number with a unit.
44
*/

Diff for: dist/plugin/composables/styles.d.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { UseCodeTagStyles, UseHeaderStyles, UsePreTagStyles, UseTabGroupStyles } from '../../plugin/types';
1+
import { UseCodeTagStyles, UseHeaderStyles, UsePreTagStyles, UseTabGroupStyles } from '../types';
22
export declare const useCodeTagStyles: UseCodeTagStyles;
33
export declare const useHeaderStyles: UseHeaderStyles;
44
export declare const usePreTagStyles: UsePreTagStyles;

Diff for: dist/plugin/types/index.d.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { CSSProperties, MaybeRef } from 'vue';
1+
import type { CSSProperties, MaybeRef } from 'vue';
22
import VCodeBlock from '../VCodeBlock.vue';
33
export * from '../index';
44
export type UseTheme = MaybeRef<string | boolean>;

Diff for: dist/scss/themeStyles.scss

+69-70
Original file line numberDiff line numberDiff line change
@@ -475,76 +475,75 @@
475475
// Themes that use common styles //
476476
// ? New themes that do not require additional styles should be added her (alpha order please) //
477477
$hljs-themes: 'default',
478-
'a11y-dark',
479-
'a11y-light',
480-
'agate',
481-
'an-old-hope',
482-
'androidstudio',
483-
'arduino-light',
484-
'arta',
485-
'ascetic',
486-
'atom-one-dark-reasonable',
487-
'atom-one-dark',
488-
'atom-one-light',
489-
'base16-onedark',
490-
'codepen-embed',
491-
'color-brewer',
492-
'dark',
493-
'devibeans',
494-
'docco',
495-
'far',
496-
'felipec',
497-
'foundation',
498-
'github-dark-dimmed',
499-
'github-dark',
500-
'github',
501-
'gml',
502-
'googlecode',
503-
'grayscale',
504-
'hybrid',
505-
'idea',
506-
'intellij-light',
507-
'ir-black',
508-
'isbl-editor-dark',
509-
'isbl-editor-light',
510-
'kimbie-dark',
511-
'kimbie-light',
512-
'lightfair',
513-
'lioshi',
514-
'magula',
515-
'mono-blue',
516-
'monokai-sublime',
517-
'monokai',
518-
'night-owl',
519-
'nnfx-dark',
520-
'nnfx-light',
521-
'nord',
522-
'obsidian',
523-
'panda-syntax-dark',
524-
'panda-syntax-light',
525-
'paraiso-dark',
526-
'paraiso-light',
527-
'purebasic',
528-
'qtcreator-dark',
529-
'qtcreator-light',
530-
'rainbow',
531-
'routeros',
532-
'school-book',
533-
'shades-of-purple',
534-
'srcery',
535-
'stackoverflow-dark',
536-
'stackoverflow-light',
537-
'sunburst',
538-
'tokyo-night-dark',
539-
'tokyo-night-light',
540-
'tomorrow-night-blue',
541-
'tomorrow-night-bright',
542-
'vs',
543-
'vs2015',
544-
'xcode',
545-
'xt256',
546-
'base16-onedark',
547-
;
478+
'a11y-dark',
479+
'a11y-light',
480+
'agate',
481+
'an-old-hope',
482+
'androidstudio',
483+
'arduino-light',
484+
'arta',
485+
'ascetic',
486+
'atom-one-dark-reasonable',
487+
'atom-one-dark',
488+
'atom-one-light',
489+
'base16-onedark',
490+
'codepen-embed',
491+
'color-brewer',
492+
'dark',
493+
'devibeans',
494+
'docco',
495+
'far',
496+
'felipec',
497+
'foundation',
498+
'github-dark-dimmed',
499+
'github-dark',
500+
'github',
501+
'gml',
502+
'googlecode',
503+
'grayscale',
504+
'hybrid',
505+
'idea',
506+
'intellij-light',
507+
'ir-black',
508+
'isbl-editor-dark',
509+
'isbl-editor-light',
510+
'kimbie-dark',
511+
'kimbie-light',
512+
'lightfair',
513+
'lioshi',
514+
'magula',
515+
'mono-blue',
516+
'monokai-sublime',
517+
'monokai',
518+
'night-owl',
519+
'nnfx-dark',
520+
'nnfx-light',
521+
'nord',
522+
'obsidian',
523+
'panda-syntax-dark',
524+
'panda-syntax-light',
525+
'paraiso-dark',
526+
'paraiso-light',
527+
'purebasic',
528+
'qtcreator-dark',
529+
'qtcreator-light',
530+
'rainbow',
531+
'routeros',
532+
'school-book',
533+
'shades-of-purple',
534+
'srcery',
535+
'stackoverflow-dark',
536+
'stackoverflow-light',
537+
'sunburst',
538+
'tokyo-night-dark',
539+
'tokyo-night-light',
540+
'tomorrow-night-blue',
541+
'tomorrow-night-bright',
542+
'vs',
543+
'vs2015',
544+
'xcode',
545+
'xt256',
546+
'base16-onedark',;
548547

549548
// Generate the styles for each commonly styled themes //
550549
// ! Do not adjust the following code ! //

Diff for: dist/vue-code-block.cjs.js

+7-7
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: dist/vue-code-block.es.js

+53-53
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@wdns/vue-code-block",
3-
"version": "2.3.1",
3+
"version": "2.3.2",
44
"description": "Vue 3 CodeBlock - Highlight your code with ease using this syntax highlighting component powered by PrismJS or Highlight.js.",
55
"private": false,
66
"publishConfig": {

Diff for: src/plugin/index.ts

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { defineAsyncComponent } from 'vue';
12
import type { App } from 'vue';
23
import type { Props } from './types';
34
import './styles/cssVariables.css';
@@ -12,8 +13,9 @@ export const codeBlockOptions = Symbol();
1213
export function createVCodeBlock(options: Props = {}) {
1314
const install = (app: App) => {
1415
app.provide(codeBlockOptions, options);
15-
app.component('CodeBlock', VCodeBlock);
16-
app.component('VCodeBlock', VCodeBlock);
16+
17+
app.component('CodeBlock', defineAsyncComponent(() => import('./VCodeBlock.vue')));
18+
app.component('VCodeBlock', defineAsyncComponent(() => import('./VCodeBlock.vue')));
1719
};
1820

1921
return {

0 commit comments

Comments
 (0)