rimelight-components 2.0.99 → 2.1.2
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 +44 -45
- package/dist/module.json +1 -1
- package/dist/module.mjs +8 -7
- package/dist/runtime/app.config.d.ts +4 -2
- package/dist/runtime/components/app/ScrollToTop.vue +1 -3
- package/dist/runtime/components/blocks/Block.vue +1 -3
- package/dist/runtime/components/blocks/TextRenderer.vue +3 -5
- package/dist/runtime/components/blocks/editor/ImageBlockEditor.vue +2 -6
- package/dist/runtime/components/blocks/editor/ParagraphBlockEditor.vue +6 -7
- package/dist/runtime/components/blocks/editor/SectionBlockEditor.d.vue.ts +1 -1
- package/dist/runtime/components/blocks/editor/SectionBlockEditor.vue +21 -24
- package/dist/runtime/components/blocks/editor/SectionBlockEditor.vue.d.ts +1 -1
- package/dist/runtime/components/blocks/renderer/SectionBlockRenderer.vue +1 -6
- package/dist/runtime/components/blocks/renderer/TestBlockRenderer.vue +1 -1
- package/dist/runtime/components/content/Callout.vue +1 -4
- package/dist/runtime/components/content/Section.vue +8 -10
- package/dist/runtime/components/page/PageEditor.vue +18 -6
- package/dist/runtime/components/page/PageMention.d.vue.ts +6 -0
- package/dist/runtime/components/page/PageMention.vue +42 -0
- package/dist/runtime/components/page/PageMention.vue.d.ts +6 -0
- package/dist/runtime/components/page/PagePropertiesEditor.d.vue.ts +1 -1
- package/dist/runtime/components/page/PagePropertiesEditor.vue +42 -41
- package/dist/runtime/components/page/PagePropertiesEditor.vue.d.ts +1 -1
- package/dist/runtime/components/page/PagePropertiesRenderer.vue +157 -23
- package/dist/runtime/components/page/PageRenderer.d.vue.ts +9 -5
- package/dist/runtime/components/page/PageRenderer.vue +109 -43
- package/dist/runtime/components/page/PageRenderer.vue.d.ts +9 -5
- package/dist/runtime/components/page/PageSurround.vue +9 -9
- package/dist/runtime/components/{blocks/TOC.d.vue.ts → page/PageTOC.d.vue.ts} +5 -8
- package/dist/runtime/components/page/PageTOC.vue +107 -0
- package/dist/runtime/components/{blocks/TOC.vue.d.ts → page/PageTOC.vue.d.ts} +5 -8
- package/dist/runtime/components/swatches/ColorSwatch.vue +1 -4
- package/dist/runtime/composables/index.d.ts +1 -0
- package/dist/runtime/composables/index.js +1 -0
- package/dist/runtime/composables/useBlockEditor.d.ts +173 -517
- package/dist/runtime/composables/usePageEditor.js +7 -3
- package/dist/runtime/composables/usePageRegistry.d.ts +33 -0
- package/dist/runtime/composables/usePageRegistry.js +16 -0
- package/dist/runtime/types/blocks.d.ts +1 -3
- package/dist/runtime/types/pages.d.ts +16 -8
- package/dist/runtime/types/schemas.d.ts +6 -0
- package/dist/runtime/types/schemas.js +3 -1
- package/dist/runtime/utils/page.d.ts +4 -4
- package/dist/runtime/utils/richTextHelpers.js +9 -1
- package/package.json +17 -17
- package/dist/runtime/components/blocks/TOC.vue +0 -95
- package/dist/runtime/components/nodes/MentionNode.d.vue.ts +0 -8
- package/dist/runtime/components/nodes/MentionNode.vue +0 -22
- package/dist/runtime/components/nodes/MentionNode.vue.d.ts +0 -8
|
@@ -27,9 +27,13 @@ export function usePageEditor(page, maxHistorySize = 100) {
|
|
|
27
27
|
const save = () => {
|
|
28
28
|
return JSON.parse(JSON.stringify(page.value));
|
|
29
29
|
};
|
|
30
|
-
watch(
|
|
31
|
-
|
|
32
|
-
|
|
30
|
+
watch(
|
|
31
|
+
() => page.value.properties,
|
|
32
|
+
() => {
|
|
33
|
+
captureSnapshot();
|
|
34
|
+
},
|
|
35
|
+
{ deep: true }
|
|
36
|
+
);
|
|
33
37
|
return {
|
|
34
38
|
undo,
|
|
35
39
|
redo,
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { type PageType, type PageDefinition } from "../types/index.js";
|
|
2
|
+
export declare const usePageRegistry: () => {
|
|
3
|
+
registerDefinitions: (definitions: Record<string, PageDefinition>) => void;
|
|
4
|
+
getTypeLabelKey: (type: PageType) => string;
|
|
5
|
+
definitions: {
|
|
6
|
+
readonly Default?: {
|
|
7
|
+
readonly typeLabelKey: string;
|
|
8
|
+
readonly properties: {
|
|
9
|
+
readonly [x: string]: {
|
|
10
|
+
readonly label: {
|
|
11
|
+
readonly [x: string]: string;
|
|
12
|
+
};
|
|
13
|
+
readonly order?: number | undefined;
|
|
14
|
+
readonly fields: {
|
|
15
|
+
readonly [x: string]: {
|
|
16
|
+
readonly value: any;
|
|
17
|
+
readonly label: {
|
|
18
|
+
readonly [x: string]: string;
|
|
19
|
+
};
|
|
20
|
+
readonly type: "number" | "text" | "text-array" | "enum" | "page" | "page-array";
|
|
21
|
+
readonly options?: readonly string[] | undefined;
|
|
22
|
+
readonly allowedPageTypes?: readonly "Default"[] | undefined;
|
|
23
|
+
readonly order?: number | undefined;
|
|
24
|
+
readonly visibleIf?: ((properties: any) => boolean) | undefined;
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
readonly defaultOpen: boolean;
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
readonly initialBlocks?: (() => import("../types/index.js").Block[]) | undefined;
|
|
31
|
+
} | undefined;
|
|
32
|
+
};
|
|
33
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { reactive, readonly } from "vue";
|
|
2
|
+
const PAGE_DEFINITIONS = reactive({});
|
|
3
|
+
export const usePageRegistry = () => {
|
|
4
|
+
const registerDefinitions = (definitions) => {
|
|
5
|
+
Object.assign(PAGE_DEFINITIONS, definitions);
|
|
6
|
+
};
|
|
7
|
+
const getTypeLabelKey = (type) => {
|
|
8
|
+
const definition = PAGE_DEFINITIONS[type];
|
|
9
|
+
return definition?.typeLabelKey ?? `page.type.${type.toLowerCase()}`;
|
|
10
|
+
};
|
|
11
|
+
return {
|
|
12
|
+
registerDefinitions,
|
|
13
|
+
getTypeLabelKey,
|
|
14
|
+
definitions: readonly(PAGE_DEFINITIONS)
|
|
15
|
+
};
|
|
16
|
+
};
|
|
@@ -139,9 +139,7 @@ export interface InlineLink extends BaseInlineContent {
|
|
|
139
139
|
export interface InlineMention extends BaseInlineContent {
|
|
140
140
|
type: "mention";
|
|
141
141
|
props: {
|
|
142
|
-
|
|
143
|
-
target?: "_blank" | "_self";
|
|
144
|
-
content: string;
|
|
142
|
+
pageId: string;
|
|
145
143
|
};
|
|
146
144
|
}
|
|
147
145
|
/**
|
|
@@ -1,12 +1,15 @@
|
|
|
1
|
-
import { type Image } from "../types/index.js";
|
|
2
|
-
|
|
1
|
+
import { type Block, type Image, type Link } from "../types/index.js";
|
|
2
|
+
export type Localized<T = string> = Record<string, T>;
|
|
3
3
|
declare global {
|
|
4
4
|
interface RimelightRegisterPageTypes {
|
|
5
5
|
}
|
|
6
6
|
}
|
|
7
|
+
export interface RegisterPageTypes extends RimelightRegisterPageTypes {
|
|
8
|
+
Default: BasePageProperties;
|
|
9
|
+
}
|
|
7
10
|
export type PageType = keyof RegisterPageTypes;
|
|
8
11
|
export interface Property<T = any> {
|
|
9
|
-
value: T
|
|
12
|
+
value: T | string | string[] | number | Localized | Localized[];
|
|
10
13
|
label: Localized<string>;
|
|
11
14
|
type: "number" | "text" | "text-array" | "enum" | "page" | "page-array";
|
|
12
15
|
options?: string[];
|
|
@@ -14,7 +17,6 @@ export interface Property<T = any> {
|
|
|
14
17
|
order?: number;
|
|
15
18
|
visibleIf?: (properties: any) => boolean;
|
|
16
19
|
}
|
|
17
|
-
export type Localized<T = string> = Record<string, T>;
|
|
18
20
|
export interface PropertyGroup {
|
|
19
21
|
label: Localized<string>;
|
|
20
22
|
order?: number;
|
|
@@ -25,24 +27,25 @@ export interface PropertyGroup {
|
|
|
25
27
|
* A PageTemplate is the single definition for a page's properties and initial blocks.
|
|
26
28
|
*/
|
|
27
29
|
export interface PageDefinition {
|
|
30
|
+
typeLabelKey: string;
|
|
28
31
|
properties: Record<string, PropertyGroup>;
|
|
29
32
|
initialBlocks?: () => Block[];
|
|
30
33
|
}
|
|
31
34
|
export interface BasePageProperties {
|
|
32
35
|
}
|
|
33
|
-
export interface RegisterPageTypes extends RimelightRegisterPageTypes {
|
|
34
|
-
Default: BasePageProperties;
|
|
35
|
-
}
|
|
36
36
|
/**
|
|
37
37
|
* Common fields shared by every page regardless of type.
|
|
38
38
|
*/
|
|
39
39
|
export interface BasePage {
|
|
40
40
|
id: string;
|
|
41
41
|
slug: string;
|
|
42
|
-
|
|
42
|
+
icon?: Image;
|
|
43
|
+
banner?: Image;
|
|
44
|
+
images?: Image[];
|
|
43
45
|
title: Localized<string>;
|
|
44
46
|
description?: Localized<string>;
|
|
45
47
|
tags?: Localized<string>[];
|
|
48
|
+
links?: Link[];
|
|
46
49
|
authorsIds?: string[];
|
|
47
50
|
blocks: Block[];
|
|
48
51
|
posted_at?: Date | null;
|
|
@@ -58,3 +61,8 @@ export type Page = {
|
|
|
58
61
|
properties: RegisterPageTypes[K];
|
|
59
62
|
} & BasePage;
|
|
60
63
|
}[PageType];
|
|
64
|
+
export type SurroundItem = Pick<BasePage, "id" | "slug" | "title" | "description">;
|
|
65
|
+
export interface PageSurround {
|
|
66
|
+
previous: SurroundItem | null;
|
|
67
|
+
next: SurroundItem | null;
|
|
68
|
+
}
|
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
+
import { type Localized } from "./index.js";
|
|
3
|
+
/**
|
|
4
|
+
* Helper to create a Zod schema for the Localized<T> type
|
|
5
|
+
*/
|
|
6
|
+
export declare const LocalizedSchema: <T extends z.ZodTypeAny>(schema: T) => z.ZodType<Localized<z.infer<T>>>;
|
|
2
7
|
export declare const linkVariantEnum: z.ZodEnum<{
|
|
3
8
|
link: "link";
|
|
4
9
|
solid: "solid";
|
|
@@ -21,6 +26,7 @@ export declare const ImageSchema: z.ZodObject<{
|
|
|
21
26
|
alt: z.ZodString;
|
|
22
27
|
width: z.ZodOptional<z.ZodNumber>;
|
|
23
28
|
height: z.ZodOptional<z.ZodNumber>;
|
|
29
|
+
name: z.ZodOptional<z.ZodType<Localized<string>, unknown, z.core.$ZodTypeInternals<Localized<string>, unknown>>>;
|
|
24
30
|
}, z.core.$strip>;
|
|
25
31
|
export type Image = z.infer<typeof ImageSchema>;
|
|
26
32
|
export declare const LinkSchema: z.ZodObject<{
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
+
export const LocalizedSchema = (schema) => z.record(z.string(), schema);
|
|
2
3
|
export const linkVariantEnum = z.enum(["solid", "outline", "subtle", "soft", "ghost", "link"]);
|
|
3
4
|
export const linkColorEnum = z.enum([
|
|
4
5
|
"primary",
|
|
@@ -13,7 +14,8 @@ export const ImageSchema = z.object({
|
|
|
13
14
|
src: z.string().min(1, "Image source must be provided."),
|
|
14
15
|
alt: z.string().min(1, "Image alt text must be provided."),
|
|
15
16
|
width: z.number().int().positive().optional(),
|
|
16
|
-
height: z.number().int().positive().optional()
|
|
17
|
+
height: z.number().int().positive().optional(),
|
|
18
|
+
name: LocalizedSchema(z.string()).optional()
|
|
17
19
|
});
|
|
18
20
|
export const LinkSchema = z.object({
|
|
19
21
|
label: z.string().min(1, "Link label must be provided."),
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type MaybeRefOrGetter } from
|
|
1
|
+
import { type MaybeRefOrGetter } from "vue";
|
|
2
2
|
import { type Page, type Localized, type PageDefinition, type Property } from "../types/index.js";
|
|
3
3
|
export declare const getLocalizedContent: <T = string>(field: Localized<T> | undefined, currentLocale: MaybeRefOrGetter<string>) => T | string;
|
|
4
4
|
type WidenProperty<T> = T extends string ? string : T extends number ? number : T extends never[] ? Localized[] : T extends object ? {
|
|
@@ -9,12 +9,12 @@ type WidenProperty<T> = T extends string ? string : T extends number ? number :
|
|
|
9
9
|
* This is used by consuming apps to define their custom page types.
|
|
10
10
|
*/
|
|
11
11
|
export declare function definePageDefinition<T extends PageDefinition>(def: T): {
|
|
12
|
-
[K in keyof T]: K extends
|
|
13
|
-
[G in keyof T[
|
|
12
|
+
[K in keyof T]: K extends "properties" ? {
|
|
13
|
+
[G in keyof T["properties"]]: {
|
|
14
14
|
label: Localized<string>;
|
|
15
15
|
defaultOpen: boolean;
|
|
16
16
|
fields: {
|
|
17
|
-
[F in keyof T[
|
|
17
|
+
[F in keyof T["properties"][G]["fields"]]: Property<WidenProperty<T["properties"][G]["fields"][F]["value"]>>;
|
|
18
18
|
};
|
|
19
19
|
};
|
|
20
20
|
} : T[K];
|
|
@@ -1,6 +1,14 @@
|
|
|
1
1
|
import { v7 as uuidv7 } from "uuid";
|
|
2
2
|
export function richTextToHtml(content) {
|
|
3
|
-
return content.map((item) =>
|
|
3
|
+
return content.map((item) => {
|
|
4
|
+
if (item.type === "text" || item.type === "link") {
|
|
5
|
+
return item.props.content;
|
|
6
|
+
}
|
|
7
|
+
if (item.type === "mention") {
|
|
8
|
+
return "";
|
|
9
|
+
}
|
|
10
|
+
return "";
|
|
11
|
+
}).join("");
|
|
4
12
|
}
|
|
5
13
|
export function parseHtmlToRichText(html) {
|
|
6
14
|
if (html.trim().length === 0) {
|
package/package.json
CHANGED
|
@@ -1,20 +1,21 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "rimelight-components",
|
|
3
|
+
"version": "2.1.2",
|
|
3
4
|
"description": "A component library by Rimelight Entertainment.",
|
|
4
|
-
"
|
|
5
|
-
|
|
5
|
+
"keywords": [
|
|
6
|
+
"nuxt",
|
|
7
|
+
"rimelight",
|
|
8
|
+
"typescript",
|
|
9
|
+
"vue"
|
|
10
|
+
],
|
|
11
|
+
"homepage": "https://rimelight.com/tools/rimelight-components",
|
|
6
12
|
"repository": {
|
|
7
13
|
"type": "git",
|
|
8
14
|
"url": "git+https://github.com/Rimelight-Entertainment/rimelight-components.git"
|
|
9
15
|
},
|
|
10
|
-
"homepage": "https://rimelight.com/tools/rimelight-components",
|
|
11
16
|
"license": "MIT",
|
|
12
|
-
"
|
|
13
|
-
|
|
14
|
-
"typescript",
|
|
15
|
-
"vue",
|
|
16
|
-
"nuxt"
|
|
17
|
-
],
|
|
17
|
+
"type": "module",
|
|
18
|
+
"main": "./dist/module.mjs",
|
|
18
19
|
"imports": {
|
|
19
20
|
"#build/rimelight-components/*": "./.nuxt/rimelight-components/*.ts",
|
|
20
21
|
"#build/rimelight-components.css": "./.nuxt/rimelight-components.css"
|
|
@@ -22,12 +23,12 @@
|
|
|
22
23
|
"exports": {
|
|
23
24
|
".": {
|
|
24
25
|
"types": "./dist/module.d.mts",
|
|
25
|
-
"
|
|
26
|
-
"
|
|
26
|
+
"import": "./dist/module.mjs",
|
|
27
|
+
"style": "./dist/runtime/index.css"
|
|
27
28
|
},
|
|
28
|
-
"./runtime/*": "./dist/runtime/*",
|
|
29
29
|
"./components/*": "./dist/runtime/components/*",
|
|
30
30
|
"./composables/*": "./dist/runtime/composables/*",
|
|
31
|
+
"./runtime/*": "./dist/runtime/*",
|
|
31
32
|
"./utils/*": {
|
|
32
33
|
"types": "./dist/runtime/utils/*.d.mts",
|
|
33
34
|
"import": "./dist/runtime/utils/*.js"
|
|
@@ -59,7 +60,6 @@
|
|
|
59
60
|
}
|
|
60
61
|
},
|
|
61
62
|
"style": "./dist/runtime/index.css",
|
|
62
|
-
"main": "./dist/module.mjs",
|
|
63
63
|
"files": [
|
|
64
64
|
"dist"
|
|
65
65
|
],
|
|
@@ -79,6 +79,9 @@
|
|
|
79
79
|
"test": "vitest",
|
|
80
80
|
"release": "release-it --ci"
|
|
81
81
|
},
|
|
82
|
+
"resolutions": {
|
|
83
|
+
"rimelight-components": "workspace:*"
|
|
84
|
+
},
|
|
82
85
|
"dependencies": {
|
|
83
86
|
"@nuxt/kit": "^4.2.2",
|
|
84
87
|
"@vueuse/core": "^14.1.0",
|
|
@@ -123,8 +126,5 @@
|
|
|
123
126
|
"esbuild",
|
|
124
127
|
"sharp",
|
|
125
128
|
"vue-demi"
|
|
126
|
-
]
|
|
127
|
-
"resolutions": {
|
|
128
|
-
"rimelight-components": "workspace:*"
|
|
129
|
-
}
|
|
129
|
+
]
|
|
130
130
|
}
|
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
<script setup>
|
|
2
|
-
import { computed } from "vue";
|
|
3
|
-
import {} from "../../types";
|
|
4
|
-
import { slugify } from "../../utils";
|
|
5
|
-
import { useI18n } from "vue-i18n";
|
|
6
|
-
const { t } = useI18n();
|
|
7
|
-
const {
|
|
8
|
-
pageBlocks,
|
|
9
|
-
title = "table_of_contents",
|
|
10
|
-
levels = [2, 3, 4]
|
|
11
|
-
} = defineProps({
|
|
12
|
-
pageBlocks: { type: [Array, null], required: true },
|
|
13
|
-
title: { type: String, required: false },
|
|
14
|
-
levels: { type: Array, required: false }
|
|
15
|
-
});
|
|
16
|
-
const extractHeadings = (blocks) => {
|
|
17
|
-
const headings = [];
|
|
18
|
-
if (!blocks || blocks.length === 0) {
|
|
19
|
-
return headings;
|
|
20
|
-
}
|
|
21
|
-
for (const block of blocks) {
|
|
22
|
-
if (block.type === "SectionBlock") {
|
|
23
|
-
const props = block.props;
|
|
24
|
-
const title2 = props.title;
|
|
25
|
-
const level = props.level;
|
|
26
|
-
if (title2 && level) {
|
|
27
|
-
headings.push({
|
|
28
|
-
id: slugify(title2),
|
|
29
|
-
title: title2,
|
|
30
|
-
level
|
|
31
|
-
});
|
|
32
|
-
}
|
|
33
|
-
if (props.children && props.children.length > 0) {
|
|
34
|
-
headings.push(...extractHeadings(props.children));
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
return headings;
|
|
39
|
-
};
|
|
40
|
-
const tocItems = computed(() => {
|
|
41
|
-
if (!pageBlocks || pageBlocks.length === 0) {
|
|
42
|
-
return [];
|
|
43
|
-
}
|
|
44
|
-
if (levels.length === 0) {
|
|
45
|
-
return [];
|
|
46
|
-
}
|
|
47
|
-
const allHeadings = extractHeadings(pageBlocks);
|
|
48
|
-
const filteredHeadings = allHeadings.filter(
|
|
49
|
-
(item) => levels.includes(item.level)
|
|
50
|
-
);
|
|
51
|
-
return Array.from(new Set(filteredHeadings.map((h) => h.id))).map(
|
|
52
|
-
(id) => filteredHeadings.find((h) => h.id === id)
|
|
53
|
-
);
|
|
54
|
-
});
|
|
55
|
-
</script>
|
|
56
|
-
|
|
57
|
-
<template>
|
|
58
|
-
<nav
|
|
59
|
-
class="flex flex-col gap-md pt-lg"
|
|
60
|
-
aria-label="Table of Contents"
|
|
61
|
-
>
|
|
62
|
-
<h5 class="text-highlighted">
|
|
63
|
-
{{ t(title) }}
|
|
64
|
-
</h5>
|
|
65
|
-
|
|
66
|
-
<ul
|
|
67
|
-
v-if="tocItems.length > 0"
|
|
68
|
-
class="flex flex-col gap-0 border-s border-default"
|
|
69
|
-
>
|
|
70
|
-
<li
|
|
71
|
-
v-for="item in tocItems"
|
|
72
|
-
:key="item.id"
|
|
73
|
-
class="relative flex min-w-0"
|
|
74
|
-
:class="{
|
|
75
|
-
'ms-2': item.level === 2,
|
|
76
|
-
'ms-4': item.level === 3,
|
|
77
|
-
'ms-6': item.level === 4,
|
|
78
|
-
'ms-8': item.level === 5,
|
|
79
|
-
'ms-10': item.level === 6
|
|
80
|
-
}"
|
|
81
|
-
>
|
|
82
|
-
<NuxtLink
|
|
83
|
-
:href="`#${item.id}`"
|
|
84
|
-
class="group relative flex size-full items-center px-1.5 py-1.5 text-start text-sm font-medium before:absolute before:inset-x-0 before:inset-y-px before:z-[-1] before:rounded-md focus:outline-none focus-visible:outline-none focus-visible:before:ring-2 focus-visible:before:ring-inset dark:focus-visible:outline-none"
|
|
85
|
-
>
|
|
86
|
-
<span class="truncate">
|
|
87
|
-
{{ item.title }}
|
|
88
|
-
</span>
|
|
89
|
-
</NuxtLink>
|
|
90
|
-
</li>
|
|
91
|
-
</ul>
|
|
92
|
-
|
|
93
|
-
<slot name="bottom" />
|
|
94
|
-
</nav>
|
|
95
|
-
</template>
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
type __VLS_Props = {
|
|
2
|
-
href: string;
|
|
3
|
-
target?: string;
|
|
4
|
-
content: string;
|
|
5
|
-
};
|
|
6
|
-
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
7
|
-
declare const _default: typeof __VLS_export;
|
|
8
|
-
export default _default;
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
<script setup>
|
|
2
|
-
import { computed } from "vue";
|
|
3
|
-
const { href, target, content } = defineProps({
|
|
4
|
-
href: { type: String, required: true },
|
|
5
|
-
target: { type: String, required: false },
|
|
6
|
-
content: { type: String, required: true }
|
|
7
|
-
});
|
|
8
|
-
const rel = computed(
|
|
9
|
-
() => target === "_blank" ? "noopener noreferrer" : void 0
|
|
10
|
-
);
|
|
11
|
-
</script>
|
|
12
|
-
|
|
13
|
-
<template>
|
|
14
|
-
<ULink
|
|
15
|
-
:to="href"
|
|
16
|
-
:target="target"
|
|
17
|
-
:rel="rel"
|
|
18
|
-
class="rounded-md bg-secondary-700 px-1.5 py-0.5 text-secondary-300"
|
|
19
|
-
>
|
|
20
|
-
{{ content }}
|
|
21
|
-
</ULink>
|
|
22
|
-
</template>
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
type __VLS_Props = {
|
|
2
|
-
href: string;
|
|
3
|
-
target?: string;
|
|
4
|
-
content: string;
|
|
5
|
-
};
|
|
6
|
-
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
7
|
-
declare const _default: typeof __VLS_export;
|
|
8
|
-
export default _default;
|