@barzhsieh/nuxt-content-mermaid 2.1.2 → 2.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +162 -1
- package/README.zh-TW.md +166 -2
- package/dist/module.d.mts +83 -1
- package/dist/module.json +1 -1
- package/dist/module.mjs +126 -9
- package/dist/runtime/components/Mermaid.d.vue.ts +6 -4
- package/dist/runtime/components/Mermaid.vue +492 -36
- package/dist/runtime/components/Mermaid.vue.d.ts +6 -4
- package/dist/runtime/components/MermaidExpandOverlay.d.vue.ts +25 -0
- package/dist/runtime/components/MermaidExpandOverlay.vue +140 -0
- package/dist/runtime/components/MermaidExpandOverlay.vue.d.ts +25 -0
- package/dist/runtime/components/MermaidZoomToolbar.d.vue.ts +23 -0
- package/dist/runtime/components/MermaidZoomToolbar.vue +66 -0
- package/dist/runtime/components/MermaidZoomToolbar.vue.d.ts +23 -0
- package/dist/runtime/components/icons/IconClipboard.d.vue.ts +8 -0
- package/dist/runtime/components/icons/IconClipboard.vue +32 -0
- package/dist/runtime/components/icons/IconClipboard.vue.d.ts +8 -0
- package/dist/runtime/components/icons/IconClipboardHover.d.vue.ts +8 -0
- package/dist/runtime/components/icons/IconClipboardHover.vue +33 -0
- package/dist/runtime/components/icons/IconClipboardHover.vue.d.ts +8 -0
- package/dist/runtime/components/icons/IconClipboardSuccess.d.vue.ts +8 -0
- package/dist/runtime/components/icons/IconClipboardSuccess.vue +33 -0
- package/dist/runtime/components/icons/IconClipboardSuccess.vue.d.ts +8 -0
- package/dist/runtime/components/icons/IconCollapse.d.vue.ts +8 -0
- package/dist/runtime/components/icons/IconCollapse.vue +34 -0
- package/dist/runtime/components/icons/IconCollapse.vue.d.ts +8 -0
- package/dist/runtime/components/icons/IconExpand.d.vue.ts +8 -0
- package/dist/runtime/components/icons/IconExpand.vue +34 -0
- package/dist/runtime/components/icons/IconExpand.vue.d.ts +8 -0
- package/dist/runtime/components/icons/IconMinus.d.vue.ts +8 -0
- package/dist/runtime/components/icons/IconMinus.vue +46 -0
- package/dist/runtime/components/icons/IconMinus.vue.d.ts +8 -0
- package/dist/runtime/components/icons/IconPlus.d.vue.ts +8 -0
- package/dist/runtime/components/icons/IconPlus.vue +57 -0
- package/dist/runtime/components/icons/IconPlus.vue.d.ts +8 -0
- package/dist/runtime/components/icons/iconFullScreen.d.vue.ts +8 -0
- package/dist/runtime/components/icons/iconFullScreen.vue +26 -0
- package/dist/runtime/components/icons/iconFullScreen.vue.d.ts +8 -0
- package/dist/runtime/components/icons/iconFullScreenExit.d.vue.ts +8 -0
- package/dist/runtime/components/icons/iconFullScreenExit.vue +26 -0
- package/dist/runtime/components/icons/iconFullScreenExit.vue.d.ts +8 -0
- package/dist/runtime/composables/_configurable.d.ts +27 -0
- package/dist/runtime/composables/_configurable.js +5 -0
- package/dist/runtime/composables/shared/index.d.ts +5 -0
- package/dist/runtime/composables/shared/index.js +5 -0
- package/dist/runtime/composables/shared/tryOnMounted.d.ts +10 -0
- package/dist/runtime/composables/shared/tryOnMounted.js +11 -0
- package/dist/runtime/composables/shared/tryOnScopeDispose.d.ts +7 -0
- package/dist/runtime/composables/shared/tryOnScopeDispose.js +8 -0
- package/dist/runtime/composables/shared/watchImmediate.d.ts +5 -0
- package/dist/runtime/composables/shared/watchImmediate.js +11 -0
- package/dist/runtime/composables/unrefElement.d.ts +12 -0
- package/dist/runtime/composables/unrefElement.js +5 -0
- package/dist/runtime/composables/useEventListener.d.ts +73 -0
- package/dist/runtime/composables/useEventListener.js +40 -0
- package/dist/runtime/composables/useFullscreen.d.ts +25 -0
- package/dist/runtime/composables/useFullscreen.js +122 -0
- package/dist/runtime/composables/useMermaidCursors.d.ts +12 -0
- package/dist/runtime/composables/useMermaidCursors.js +41 -0
- package/dist/runtime/composables/useMermaidExpand.d.ts +45 -0
- package/dist/runtime/composables/useMermaidExpand.js +480 -0
- package/dist/runtime/composables/useMermaidZoom.d.ts +37 -0
- package/dist/runtime/composables/useMermaidZoom.js +261 -0
- package/dist/runtime/composables/useMounted.d.ts +8 -0
- package/dist/runtime/composables/useMounted.js +16 -0
- package/dist/runtime/composables/useSupported.d.ts +2 -0
- package/dist/runtime/composables/useSupported.js +10 -0
- package/dist/runtime/constants.d.ts +4 -0
- package/dist/runtime/constants.js +24 -0
- package/dist/runtime/mermaid-config.d.ts +1 -1
- package/dist/runtime/plugins/mermaid.client.d.ts +2 -2
- package/dist/runtime/styles.css +1 -0
- package/dist/runtime/types/expand.d.ts +48 -0
- package/dist/runtime/types/expand.js +0 -0
- package/dist/runtime/types/utils.d.ts +115 -0
- package/dist/runtime/types/utils.js +0 -0
- package/dist/runtime/utils/index.d.ts +52 -0
- package/dist/runtime/utils/index.js +113 -0
- package/dist/runtime/utils/is.d.ts +15 -0
- package/dist/runtime/utils/is.js +31 -0
- package/dist/runtime/utils/mermaid-transform.d.ts +18 -0
- package/dist/runtime/utils/mermaid-transform.js +345 -0
- package/dist/runtime/utils/vue.d.ts +2 -0
- package/dist/runtime/utils/vue.js +4 -0
- package/package.json +4 -2
- package/dist/runtime/utils.d.ts +0 -1
- package/dist/runtime/utils.js +0 -30
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { CSSProperties, ComponentPublicInstance } from 'vue';
|
|
2
|
+
import type { MermaidZoomReturn } from '../composables/useMermaidZoom.js';
|
|
3
|
+
type __VLS_Props = {
|
|
4
|
+
active: boolean;
|
|
5
|
+
isVisable: boolean;
|
|
6
|
+
overlayStyle?: CSSProperties;
|
|
7
|
+
contentStyle?: CSSProperties;
|
|
8
|
+
targetStyle?: CSSProperties;
|
|
9
|
+
targetRef: (el: Element | ComponentPublicInstance | null) => void;
|
|
10
|
+
allowOverlayClose: boolean;
|
|
11
|
+
allowCloseButton: boolean;
|
|
12
|
+
targetHasMargin: boolean;
|
|
13
|
+
iconSize?: number;
|
|
14
|
+
zoom?: MermaidZoomReturn;
|
|
15
|
+
showHint?: boolean;
|
|
16
|
+
};
|
|
17
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
18
|
+
close: (event?: Event | undefined) => any;
|
|
19
|
+
transitionend: (event: TransitionEvent) => any;
|
|
20
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
21
|
+
onClose?: ((event?: Event | undefined) => any) | undefined;
|
|
22
|
+
onTransitionend?: ((event: TransitionEvent) => any) | undefined;
|
|
23
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
24
|
+
declare const _default: typeof __VLS_export;
|
|
25
|
+
export default _default;
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import MermaidZoomToolbar from "./MermaidZoomToolbar.vue";
|
|
3
|
+
const props = defineProps({
|
|
4
|
+
active: { type: Boolean, required: true },
|
|
5
|
+
isVisable: { type: Boolean, required: true },
|
|
6
|
+
overlayStyle: { type: Object, required: false },
|
|
7
|
+
contentStyle: { type: Object, required: false },
|
|
8
|
+
targetStyle: { type: Object, required: false },
|
|
9
|
+
targetRef: { type: Function, required: true },
|
|
10
|
+
allowOverlayClose: { type: Boolean, required: true },
|
|
11
|
+
allowCloseButton: { type: Boolean, required: true },
|
|
12
|
+
targetHasMargin: { type: Boolean, required: true },
|
|
13
|
+
iconSize: { type: Number, required: false },
|
|
14
|
+
zoom: { type: null, required: false },
|
|
15
|
+
showHint: { type: Boolean, required: false }
|
|
16
|
+
});
|
|
17
|
+
const isMac = import.meta.client ? /Mac|iPhone|iPad|iPod/.test(navigator.userAgent) : false;
|
|
18
|
+
const emit = defineEmits(["close", "transitionend"]);
|
|
19
|
+
const handleButtonClick = (event) => {
|
|
20
|
+
if (!props.allowCloseButton) return;
|
|
21
|
+
emit("close", event);
|
|
22
|
+
};
|
|
23
|
+
const handleModalClick = (event) => {
|
|
24
|
+
if (props.zoom?.isSpacePressed.value) return;
|
|
25
|
+
if (props.zoom?.wasLastInteractionDrag.value) {
|
|
26
|
+
event.stopPropagation();
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
const target = event.target;
|
|
30
|
+
if (target.classList.contains("ncm-expand-overlay") || target.classList.contains("ncm-expand-modal")) {
|
|
31
|
+
if (props.allowOverlayClose) {
|
|
32
|
+
emit("close", event);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
</script>
|
|
37
|
+
|
|
38
|
+
<template>
|
|
39
|
+
<Teleport to="body">
|
|
40
|
+
<div
|
|
41
|
+
v-if="active"
|
|
42
|
+
class="ncm-expand-modal"
|
|
43
|
+
:style="{
|
|
44
|
+
cursor: zoom?.cursor.value || 'auto'
|
|
45
|
+
}"
|
|
46
|
+
@click="handleModalClick"
|
|
47
|
+
@mousedown="zoom?.handleDragStart($event)"
|
|
48
|
+
@mousemove="zoom?.handleDragMove($event)"
|
|
49
|
+
@touchstart="zoom?.handleDragStart($event)"
|
|
50
|
+
@touchmove="zoom?.handleDragMove($event)"
|
|
51
|
+
@touchend="zoom?.handleDragEnd()"
|
|
52
|
+
>
|
|
53
|
+
<div
|
|
54
|
+
class="ncm-expand-overlay"
|
|
55
|
+
:style="overlayStyle"
|
|
56
|
+
:class="{
|
|
57
|
+
'ncm-expand-overlay-visible': isVisable,
|
|
58
|
+
'ncm-expand-overlay-closable': allowOverlayClose && !zoom?.isSpacePressed.value,
|
|
59
|
+
'ncm-expand-dragging': zoom?.isDragging.value
|
|
60
|
+
}"
|
|
61
|
+
/>
|
|
62
|
+
<div
|
|
63
|
+
class="ncm-expand-content"
|
|
64
|
+
:style="contentStyle"
|
|
65
|
+
>
|
|
66
|
+
<div
|
|
67
|
+
:ref="targetRef"
|
|
68
|
+
class="ncm-expand-target"
|
|
69
|
+
:class="{
|
|
70
|
+
'ncm-expand-target-with-margin': targetHasMargin
|
|
71
|
+
}"
|
|
72
|
+
:style="targetStyle"
|
|
73
|
+
@transitionend="emit('transitionend', $event)"
|
|
74
|
+
/>
|
|
75
|
+
|
|
76
|
+
<!-- Zoom Toolbar -->
|
|
77
|
+
<MermaidZoomToolbar
|
|
78
|
+
v-if="zoom"
|
|
79
|
+
:scale="zoom.scale.value"
|
|
80
|
+
:icon-size="iconSize"
|
|
81
|
+
:icon-scale="0.75"
|
|
82
|
+
@zoom-out="zoom.zoomOut()"
|
|
83
|
+
@zoom-in="zoom.zoomIn()"
|
|
84
|
+
@reset="zoom.reset()"
|
|
85
|
+
/>
|
|
86
|
+
|
|
87
|
+
<!-- Zoom Hint Toast -->
|
|
88
|
+
<Transition name="ncm-hint-fade">
|
|
89
|
+
<div
|
|
90
|
+
v-if="showHint"
|
|
91
|
+
class="ncm-zoom-hint"
|
|
92
|
+
>
|
|
93
|
+
{{ isMac ? "\u2318" : "Ctrl" }} + Scroll to zoom
|
|
94
|
+
</div>
|
|
95
|
+
</Transition>
|
|
96
|
+
|
|
97
|
+
<button
|
|
98
|
+
v-if="allowCloseButton"
|
|
99
|
+
type="button"
|
|
100
|
+
class="ncm-expand-btn"
|
|
101
|
+
aria-label="Minimize diagram"
|
|
102
|
+
@click="handleButtonClick"
|
|
103
|
+
@mousedown.stop
|
|
104
|
+
@touchstart.stop
|
|
105
|
+
>
|
|
106
|
+
<svg
|
|
107
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
108
|
+
:width="iconSize || 22"
|
|
109
|
+
:height="iconSize || 22"
|
|
110
|
+
viewBox="0 0 24 24"
|
|
111
|
+
fill="none"
|
|
112
|
+
stroke="currentColor"
|
|
113
|
+
stroke-width="2"
|
|
114
|
+
stroke-linecap="round"
|
|
115
|
+
stroke-linejoin="round"
|
|
116
|
+
>
|
|
117
|
+
<polyline points="4 14 10 14 10 20" />
|
|
118
|
+
<polyline points="20 10 14 10 14 4" />
|
|
119
|
+
<line
|
|
120
|
+
x1="14"
|
|
121
|
+
y1="10"
|
|
122
|
+
x2="21"
|
|
123
|
+
y2="3"
|
|
124
|
+
/>
|
|
125
|
+
<line
|
|
126
|
+
x1="3"
|
|
127
|
+
y1="21"
|
|
128
|
+
x2="10"
|
|
129
|
+
y2="14"
|
|
130
|
+
/>
|
|
131
|
+
</svg>
|
|
132
|
+
</button>
|
|
133
|
+
</div>
|
|
134
|
+
</div>
|
|
135
|
+
</Teleport>
|
|
136
|
+
</template>
|
|
137
|
+
|
|
138
|
+
<style scoped>
|
|
139
|
+
.ncm-expand-modal{inset:0;position:fixed;touch-action:none;z-index:1000}.ncm-expand-overlay{background-color:transparent;inset:0;position:absolute;transition:background-color .3s,opacity .3s,backdrop-filter .3s;z-index:0}.ncm-expand-overlay.ncm-expand-overlay-visible{backdrop-filter:var(--ncm-overlay-backdrop,none);background-color:color-mix(in oklab,var(--ncm-overlay-bg,var(--ncm-code-bg,#fff)) 95%,var(--ncm-text) 5%);opacity:var(--ncm-overlay-opacity,1)}.ncm-expand-overlay-closable{cursor:var(--ncm-cursor-collapse)}.ncm-expand-dragging{cursor:grabbing!important;-webkit-user-select:none;-moz-user-select:none;user-select:none}.ncm-expand-content{height:100%;pointer-events:none;position:relative;width:100%;z-index:1}.ncm-expand-target{cursor:inherit;pointer-events:auto;position:absolute;transform-origin:top left;transition:transform .3s;z-index:2}.ncm-expand-target.ncm-expand-target-with-margin{background-color:var(--ncm-expand-target-bg,color-mix(in oklab,var(--ncm-overlay-bg,var(--ncm-code-bg,#fff)) 90%,var(--ncm-code-bg,#fff) 10%));border-radius:8px}.ncm-expand-target :deep(svg){display:block;height:100%;width:100%}.ncm-expand-btn{align-items:center;backdrop-filter:blur(8px);-webkit-backdrop-filter:blur(8px);background-color:color-mix(in oklab,var(--ncm-code-bg) 35%,transparent);border:none;border:1px solid color-mix(in oklab,var(--ncm-text) 8%,transparent);border-radius:4px;color:color-mix(in oklab,var(--ncm-text) 60%,transparent);cursor:pointer;display:flex;justify-content:center;padding:6px;pointer-events:auto;position:absolute;right:10px;top:10px;touch-action:manipulation;transition:color .2s,background-color .2s;z-index:3}.ncm-expand-btn:hover{background-color:var(--ncm-code-bg-hover);color:var(--ncm-text)}.ncm-zoom-hint{background-color:var(--ncm-hint-bg,rgba(0,0,0,.75));border-radius:var(--ncm-hint-radius,8px);color:var(--ncm-hint-text,#fff);font-size:14px;font-weight:500;left:50%;padding:12px 24px;pointer-events:none;position:absolute;top:50%;transform:translate(-50%,-50%);-webkit-user-select:none;-moz-user-select:none;user-select:none;white-space:nowrap;z-index:10}.ncm-hint-fade-enter-active,.ncm-hint-fade-leave-active{transition:opacity .2s ease}.ncm-hint-fade-enter-from,.ncm-hint-fade-leave-to{opacity:0}@media (prefers-reduced-motion:reduce){.ncm-expand-overlay,.ncm-expand-target,.ncm-hint-fade-enter-active,.ncm-hint-fade-leave-active{transition-duration:.01ms!important}}
|
|
140
|
+
</style>
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { CSSProperties, ComponentPublicInstance } from 'vue';
|
|
2
|
+
import type { MermaidZoomReturn } from '../composables/useMermaidZoom.js';
|
|
3
|
+
type __VLS_Props = {
|
|
4
|
+
active: boolean;
|
|
5
|
+
isVisable: boolean;
|
|
6
|
+
overlayStyle?: CSSProperties;
|
|
7
|
+
contentStyle?: CSSProperties;
|
|
8
|
+
targetStyle?: CSSProperties;
|
|
9
|
+
targetRef: (el: Element | ComponentPublicInstance | null) => void;
|
|
10
|
+
allowOverlayClose: boolean;
|
|
11
|
+
allowCloseButton: boolean;
|
|
12
|
+
targetHasMargin: boolean;
|
|
13
|
+
iconSize?: number;
|
|
14
|
+
zoom?: MermaidZoomReturn;
|
|
15
|
+
showHint?: boolean;
|
|
16
|
+
};
|
|
17
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
18
|
+
close: (event?: Event | undefined) => any;
|
|
19
|
+
transitionend: (event: TransitionEvent) => any;
|
|
20
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
21
|
+
onClose?: ((event?: Event | undefined) => any) | undefined;
|
|
22
|
+
onTransitionend?: ((event: TransitionEvent) => any) | undefined;
|
|
23
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
24
|
+
declare const _default: typeof __VLS_export;
|
|
25
|
+
export default _default;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
scale: number;
|
|
3
|
+
iconSize?: number;
|
|
4
|
+
iconScale?: number;
|
|
5
|
+
variant?: 'fullscreen' | 'overlay';
|
|
6
|
+
resetLabel?: string;
|
|
7
|
+
};
|
|
8
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
9
|
+
reset: () => void;
|
|
10
|
+
"zoom-in": () => void;
|
|
11
|
+
"zoom-out": () => void;
|
|
12
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
13
|
+
onReset?: (() => any) | undefined;
|
|
14
|
+
"onZoom-in"?: (() => any) | undefined;
|
|
15
|
+
"onZoom-out"?: (() => any) | undefined;
|
|
16
|
+
}>, {
|
|
17
|
+
iconSize: number;
|
|
18
|
+
iconScale: number;
|
|
19
|
+
variant: "fullscreen" | "overlay";
|
|
20
|
+
resetLabel: string;
|
|
21
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
22
|
+
declare const _default: typeof __VLS_export;
|
|
23
|
+
export default _default;
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { computed } from "vue";
|
|
3
|
+
import IconMinus from "./icons/IconMinus.vue";
|
|
4
|
+
import IconPlus from "./icons/IconPlus.vue";
|
|
5
|
+
const props = defineProps({
|
|
6
|
+
scale: { type: Number, required: true },
|
|
7
|
+
iconSize: { type: Number, required: false, default: 18 },
|
|
8
|
+
iconScale: { type: Number, required: false, default: 1 },
|
|
9
|
+
variant: { type: String, required: false, default: "overlay" },
|
|
10
|
+
resetLabel: { type: String, required: false, default: "Reset" }
|
|
11
|
+
});
|
|
12
|
+
const emit = defineEmits(["zoom-in", "zoom-out", "reset"]);
|
|
13
|
+
const zoomIconSize = computed(() => {
|
|
14
|
+
const base = typeof props.iconSize === "number" ? props.iconSize : 18;
|
|
15
|
+
return Math.max(12, Math.round(base * props.iconScale));
|
|
16
|
+
});
|
|
17
|
+
const zoomPercent = computed(() => Math.round(props.scale * 100));
|
|
18
|
+
const isFullscreen = computed(() => props.variant === "fullscreen");
|
|
19
|
+
const handleAction = (event, action) => {
|
|
20
|
+
emit(action);
|
|
21
|
+
event.currentTarget?.blur();
|
|
22
|
+
};
|
|
23
|
+
</script>
|
|
24
|
+
|
|
25
|
+
<template>
|
|
26
|
+
<div
|
|
27
|
+
class="ncm-zoom-toolbar"
|
|
28
|
+
:class="{
|
|
29
|
+
'ncm-zoom-toolbar--fullscreen': isFullscreen,
|
|
30
|
+
'ncm-zoom-toolbar--overlay': !isFullscreen
|
|
31
|
+
}"
|
|
32
|
+
@mousedown.stop
|
|
33
|
+
@touchstart.stop
|
|
34
|
+
>
|
|
35
|
+
<button
|
|
36
|
+
type="button"
|
|
37
|
+
class="ncm-zoom-btn"
|
|
38
|
+
aria-label="Zoom Out"
|
|
39
|
+
@click.stop="handleAction($event, 'zoom-out')"
|
|
40
|
+
>
|
|
41
|
+
<IconMinus :size="zoomIconSize" />
|
|
42
|
+
</button>
|
|
43
|
+
<span class="ncm-zoom-info">{{ zoomPercent }}%</span>
|
|
44
|
+
<button
|
|
45
|
+
type="button"
|
|
46
|
+
class="ncm-zoom-btn"
|
|
47
|
+
aria-label="Zoom In"
|
|
48
|
+
@click.stop="handleAction($event, 'zoom-in')"
|
|
49
|
+
>
|
|
50
|
+
<IconPlus :size="zoomIconSize" />
|
|
51
|
+
</button>
|
|
52
|
+
<span class="ncm-zoom-toolbar-separator">|</span>
|
|
53
|
+
<button
|
|
54
|
+
type="button"
|
|
55
|
+
class="ncm-zoom-btn ncm-zoom-reset"
|
|
56
|
+
aria-label="Reset Zoom"
|
|
57
|
+
@click.stop="handleAction($event, 'reset')"
|
|
58
|
+
>
|
|
59
|
+
{{ resetLabel }}
|
|
60
|
+
</button>
|
|
61
|
+
</div>
|
|
62
|
+
</template>
|
|
63
|
+
|
|
64
|
+
<style scoped>
|
|
65
|
+
.ncm-zoom-toolbar{align-items:center;backdrop-filter:blur(8px);-webkit-backdrop-filter:blur(8px);background-color:color-mix(in oklab,var(--ncm-code-bg) 35%,transparent);border:1px solid color-mix(in oklab,var(--ncm-text) 8%,transparent);border-radius:var(--ncm-zoom-radius,8px);display:flex;font-size:var(--ncm-zoom-font-size,14px);gap:var(--ncm-zoom-gap,4px);padding:var(--ncm-zoom-padding,4px 8px);pointer-events:auto}.ncm-zoom-toolbar--overlay{position:absolute;right:50px;top:10px;z-index:3;--ncm-zoom-font-size:14px;--ncm-zoom-padding:4px 8px}.ncm-zoom-toolbar--fullscreen{position:fixed;right:12px;top:calc(var(--ncm-toolbar-height, 37px) + 12px);z-index:10;--ncm-zoom-font-size:20px;--ncm-zoom-padding:4px 12px;will-change:transform,opacity}.ncm-zoom-btn{align-items:center;background-color:transparent;border:none;border-radius:var(--ncm-zoom-btn-radius,6px);color:color-mix(in oklab,var(--ncm-text) 55%,transparent);cursor:pointer;display:flex;font-weight:500;justify-content:center;min-height:24px;min-width:24px;padding:var(--ncm-zoom-btn-padding,3px 6px);transition:color .2s,background-color .2s}.ncm-zoom-btn:hover{background-color:var(--ncm-code-bg-hover);color:var(--ncm-text)}.ncm-zoom-info{color:color-mix(in oklab,var(--ncm-text) 60%,transparent);font-size:.85em;font-variant-numeric:tabular-nums;min-width:40px;text-align:center;-webkit-user-select:none;-moz-user-select:none;user-select:none}.ncm-zoom-reset{font-size:.85em;line-height:1}.ncm-zoom-btn:active{background-color:color-mix(in oklab,var(--ncm-text) 20%,transparent);transform:translateY(1px)}.ncm-zoom-toolbar-separator{color:color-mix(in oklab,var(--ncm-text) 50%,transparent);margin:0 .24rem;transform:scaleY(.81);-webkit-user-select:none;-moz-user-select:none;user-select:none}
|
|
66
|
+
</style>
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
scale: number;
|
|
3
|
+
iconSize?: number;
|
|
4
|
+
iconScale?: number;
|
|
5
|
+
variant?: 'fullscreen' | 'overlay';
|
|
6
|
+
resetLabel?: string;
|
|
7
|
+
};
|
|
8
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
9
|
+
reset: () => void;
|
|
10
|
+
"zoom-in": () => void;
|
|
11
|
+
"zoom-out": () => void;
|
|
12
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
13
|
+
onReset?: (() => any) | undefined;
|
|
14
|
+
"onZoom-in"?: (() => any) | undefined;
|
|
15
|
+
"onZoom-out"?: (() => any) | undefined;
|
|
16
|
+
}>, {
|
|
17
|
+
iconSize: number;
|
|
18
|
+
iconScale: number;
|
|
19
|
+
variant: "fullscreen" | "overlay";
|
|
20
|
+
resetLabel: string;
|
|
21
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
22
|
+
declare const _default: typeof __VLS_export;
|
|
23
|
+
export default _default;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
size?: number | string;
|
|
3
|
+
};
|
|
4
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
5
|
+
size: number | string;
|
|
6
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
7
|
+
declare const _default: typeof __VLS_export;
|
|
8
|
+
export default _default;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
defineProps({
|
|
3
|
+
size: { type: [Number, String], required: false, default: 20 }
|
|
4
|
+
});
|
|
5
|
+
</script>
|
|
6
|
+
|
|
7
|
+
<template>
|
|
8
|
+
<svg
|
|
9
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
10
|
+
:width="size"
|
|
11
|
+
:height="size"
|
|
12
|
+
viewBox="0 0 24 24"
|
|
13
|
+
>
|
|
14
|
+
<g
|
|
15
|
+
fill="none"
|
|
16
|
+
stroke="currentColor"
|
|
17
|
+
stroke-linecap="round"
|
|
18
|
+
stroke-linejoin="round"
|
|
19
|
+
stroke-width="2"
|
|
20
|
+
>
|
|
21
|
+
<rect
|
|
22
|
+
width="8"
|
|
23
|
+
height="4"
|
|
24
|
+
x="8"
|
|
25
|
+
y="2"
|
|
26
|
+
rx="1"
|
|
27
|
+
ry="1"
|
|
28
|
+
/>
|
|
29
|
+
<path d="M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2" />
|
|
30
|
+
</g>
|
|
31
|
+
</svg>
|
|
32
|
+
</template>
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
size?: number | string;
|
|
3
|
+
};
|
|
4
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
5
|
+
size: number | string;
|
|
6
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
7
|
+
declare const _default: typeof __VLS_export;
|
|
8
|
+
export default _default;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
size?: number | string;
|
|
3
|
+
};
|
|
4
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
5
|
+
size: number | string;
|
|
6
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
7
|
+
declare const _default: typeof __VLS_export;
|
|
8
|
+
export default _default;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
defineProps({
|
|
3
|
+
size: { type: [Number, String], required: false, default: 20 }
|
|
4
|
+
});
|
|
5
|
+
</script>
|
|
6
|
+
|
|
7
|
+
<template>
|
|
8
|
+
<svg
|
|
9
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
10
|
+
:width="size"
|
|
11
|
+
:height="size"
|
|
12
|
+
viewBox="0 0 24 24"
|
|
13
|
+
>
|
|
14
|
+
<g
|
|
15
|
+
fill="none"
|
|
16
|
+
stroke="currentColor"
|
|
17
|
+
stroke-linecap="round"
|
|
18
|
+
stroke-linejoin="round"
|
|
19
|
+
stroke-width="2"
|
|
20
|
+
>
|
|
21
|
+
<rect
|
|
22
|
+
width="8"
|
|
23
|
+
height="4"
|
|
24
|
+
x="8"
|
|
25
|
+
y="2"
|
|
26
|
+
rx="1"
|
|
27
|
+
ry="1"
|
|
28
|
+
/>
|
|
29
|
+
<path d="M8 4H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-2M16 4h2a2 2 0 0 1 2 2v4m1 4H11" />
|
|
30
|
+
<path d="m15 10l-4 4l4 4" />
|
|
31
|
+
</g>
|
|
32
|
+
</svg>
|
|
33
|
+
</template>
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
size?: number | string;
|
|
3
|
+
};
|
|
4
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
5
|
+
size: number | string;
|
|
6
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
7
|
+
declare const _default: typeof __VLS_export;
|
|
8
|
+
export default _default;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
size?: number | string;
|
|
3
|
+
};
|
|
4
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
5
|
+
size: number | string;
|
|
6
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
7
|
+
declare const _default: typeof __VLS_export;
|
|
8
|
+
export default _default;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
defineProps({
|
|
3
|
+
size: { type: [Number, String], required: false, default: 20 }
|
|
4
|
+
});
|
|
5
|
+
</script>
|
|
6
|
+
|
|
7
|
+
<template>
|
|
8
|
+
<svg
|
|
9
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
10
|
+
:width="size"
|
|
11
|
+
:height="size"
|
|
12
|
+
viewBox="0 0 24 24"
|
|
13
|
+
>
|
|
14
|
+
<g
|
|
15
|
+
fill="none"
|
|
16
|
+
stroke="currentColor"
|
|
17
|
+
stroke-linecap="round"
|
|
18
|
+
stroke-linejoin="round"
|
|
19
|
+
stroke-width="2"
|
|
20
|
+
>
|
|
21
|
+
<rect
|
|
22
|
+
width="8"
|
|
23
|
+
height="4"
|
|
24
|
+
x="8"
|
|
25
|
+
y="2"
|
|
26
|
+
rx="1"
|
|
27
|
+
ry="1"
|
|
28
|
+
/>
|
|
29
|
+
<path d="M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2" />
|
|
30
|
+
<path d="m9 14l2 2l4-4" />
|
|
31
|
+
</g>
|
|
32
|
+
</svg>
|
|
33
|
+
</template>
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
size?: number | string;
|
|
3
|
+
};
|
|
4
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
5
|
+
size: number | string;
|
|
6
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
7
|
+
declare const _default: typeof __VLS_export;
|
|
8
|
+
export default _default;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
size?: number | string;
|
|
3
|
+
};
|
|
4
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
5
|
+
size: number | string;
|
|
6
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
7
|
+
declare const _default: typeof __VLS_export;
|
|
8
|
+
export default _default;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
defineProps({
|
|
3
|
+
size: { type: [Number, String], required: false, default: 20 }
|
|
4
|
+
});
|
|
5
|
+
</script>
|
|
6
|
+
|
|
7
|
+
<template>
|
|
8
|
+
<svg
|
|
9
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
10
|
+
:width="size"
|
|
11
|
+
:height="size"
|
|
12
|
+
viewBox="0 0 24 24"
|
|
13
|
+
fill="none"
|
|
14
|
+
stroke="currentColor"
|
|
15
|
+
stroke-width="2"
|
|
16
|
+
stroke-linecap="round"
|
|
17
|
+
stroke-linejoin="round"
|
|
18
|
+
>
|
|
19
|
+
<polyline points="4 14 10 14 10 20" />
|
|
20
|
+
<polyline points="20 10 14 10 14 4" />
|
|
21
|
+
<line
|
|
22
|
+
x1="14"
|
|
23
|
+
y1="10"
|
|
24
|
+
x2="21"
|
|
25
|
+
y2="3"
|
|
26
|
+
/>
|
|
27
|
+
<line
|
|
28
|
+
x1="3"
|
|
29
|
+
y1="21"
|
|
30
|
+
x2="10"
|
|
31
|
+
y2="14"
|
|
32
|
+
/>
|
|
33
|
+
</svg>
|
|
34
|
+
</template>
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
size?: number | string;
|
|
3
|
+
};
|
|
4
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
5
|
+
size: number | string;
|
|
6
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
7
|
+
declare const _default: typeof __VLS_export;
|
|
8
|
+
export default _default;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
size?: number | string;
|
|
3
|
+
};
|
|
4
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
5
|
+
size: number | string;
|
|
6
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
7
|
+
declare const _default: typeof __VLS_export;
|
|
8
|
+
export default _default;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
defineProps({
|
|
3
|
+
size: { type: [Number, String], required: false, default: 20 }
|
|
4
|
+
});
|
|
5
|
+
</script>
|
|
6
|
+
|
|
7
|
+
<template>
|
|
8
|
+
<svg
|
|
9
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
10
|
+
:width="size"
|
|
11
|
+
:height="size"
|
|
12
|
+
viewBox="0 0 24 24"
|
|
13
|
+
fill="none"
|
|
14
|
+
stroke="currentColor"
|
|
15
|
+
stroke-width="2"
|
|
16
|
+
stroke-linecap="round"
|
|
17
|
+
stroke-linejoin="round"
|
|
18
|
+
>
|
|
19
|
+
<polyline points="15 3 21 3 21 9" />
|
|
20
|
+
<polyline points="9 21 3 21 3 15" />
|
|
21
|
+
<line
|
|
22
|
+
x1="21"
|
|
23
|
+
y1="3"
|
|
24
|
+
x2="14"
|
|
25
|
+
y2="10"
|
|
26
|
+
/>
|
|
27
|
+
<line
|
|
28
|
+
x1="3"
|
|
29
|
+
y1="21"
|
|
30
|
+
x2="10"
|
|
31
|
+
y2="14"
|
|
32
|
+
/>
|
|
33
|
+
</svg>
|
|
34
|
+
</template>
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
size?: number | string;
|
|
3
|
+
};
|
|
4
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
5
|
+
size: number | string;
|
|
6
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
7
|
+
declare const _default: typeof __VLS_export;
|
|
8
|
+
export default _default;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
size?: number | string;
|
|
3
|
+
};
|
|
4
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
5
|
+
size: number | string;
|
|
6
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
7
|
+
declare const _default: typeof __VLS_export;
|
|
8
|
+
export default _default;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
defineProps({
|
|
3
|
+
size: { type: [Number, String], required: false, default: 20 }
|
|
4
|
+
});
|
|
5
|
+
</script>
|
|
6
|
+
|
|
7
|
+
<template>
|
|
8
|
+
<svg
|
|
9
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
10
|
+
:width="size"
|
|
11
|
+
:height="size"
|
|
12
|
+
viewBox="0 0 24 24"
|
|
13
|
+
class="ncm-icon-animate"
|
|
14
|
+
><g
|
|
15
|
+
fill="none"
|
|
16
|
+
stroke="currentColor"
|
|
17
|
+
stroke-linecap="round"
|
|
18
|
+
stroke-linejoin="round"
|
|
19
|
+
stroke-width="2"
|
|
20
|
+
><path
|
|
21
|
+
class="ncm-icon-ring"
|
|
22
|
+
stroke-dasharray="64"
|
|
23
|
+
stroke-dashoffset="64"
|
|
24
|
+
d="M3 12c0 -4.97 4.03 -9 9 -9c4.97 0 9 4.03 9 9c0 4.97 -4.03 9 -9 9c-4.97 0 -9 -4.03 -9 -9Z"
|
|
25
|
+
><animate
|
|
26
|
+
fill="freeze"
|
|
27
|
+
attributeName="stroke-dashoffset"
|
|
28
|
+
dur="0.6s"
|
|
29
|
+
values="64;0"
|
|
30
|
+
/></path><path
|
|
31
|
+
class="ncm-icon-line"
|
|
32
|
+
stroke-dasharray="12"
|
|
33
|
+
stroke-dashoffset="12"
|
|
34
|
+
d="M7 12h10"
|
|
35
|
+
><animate
|
|
36
|
+
fill="freeze"
|
|
37
|
+
attributeName="stroke-dashoffset"
|
|
38
|
+
begin="0.6s"
|
|
39
|
+
dur="0.2s"
|
|
40
|
+
values="12;0"
|
|
41
|
+
/></path></g></svg>
|
|
42
|
+
</template>
|
|
43
|
+
|
|
44
|
+
<style scoped>
|
|
45
|
+
@media (prefers-reduced-motion:reduce){.ncm-icon-animate .ncm-icon-line,.ncm-icon-animate .ncm-icon-ring{stroke-dashoffset:0}.ncm-icon-animate animate{display:none}}
|
|
46
|
+
</style>
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
size?: number | string;
|
|
3
|
+
};
|
|
4
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
5
|
+
size: number | string;
|
|
6
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
7
|
+
declare const _default: typeof __VLS_export;
|
|
8
|
+
export default _default;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
size?: number | string;
|
|
3
|
+
};
|
|
4
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
5
|
+
size: number | string;
|
|
6
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
7
|
+
declare const _default: typeof __VLS_export;
|
|
8
|
+
export default _default;
|