Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
tewnut committed Nov 10, 2024
1 parent e245e81 commit 80efefb
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 26 deletions.
3 changes: 3 additions & 0 deletions components.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ declare module 'vue' {
Address: typeof import('./src/components/address/index.vue')['default']
Appointment: typeof import('./src/components/appointment/index.vue')['default']
Audio_recorder: typeof import('./src/components/audio_recorder/index.vue')['default']
Button: typeof import('primevue/button')['default']
Captcha: typeof import('./src/components/captcha/index.vue')['default']
Checkboxes: typeof import('./src/components/checkboxes/index.vue')['default']
Code_javascript: typeof import('./src/components/code_javascript/index.vue')['default']
Expand All @@ -30,6 +31,7 @@ declare module 'vue' {
Html_block_list: typeof import('./src/components/html_block_list/index.vue')['default']
Html_block_media: typeof import('./src/components/html_block_media/index.vue')['default']
Image_choice: typeof import('./src/components/image_choice/index.vue')['default']
InputText: typeof import('primevue/inputtext')['default']
Likert_scale: typeof import('./src/components/likert_scale/index.vue')['default']
List: typeof import('./src/components/list/index.vue')['default']
Locale_selector: typeof import('./src/components/locale_selector/index.vue')['default']
Expand All @@ -49,6 +51,7 @@ declare module 'vue' {
Signature: typeof import('./src/components/signature/index.vue')['default']
Slider: typeof import('./src/components/slider/index.vue')['default']
Term_of_service: typeof import('./src/components/term_of_service/index.vue')['default']
Textarea: typeof import('primevue/textarea')['default']
Time_picker: typeof import('./src/components/time_picker/index.vue')['default']
Website: typeof import('./src/components/website/index.vue')['default']
}
Expand Down
2 changes: 1 addition & 1 deletion src/components/html_block_content/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ defineProps<Props>()
</script>

<template>
<component :is="display.type">
<component :is="display.tag">
{{ display.content }}
</component>
</template>
2 changes: 1 addition & 1 deletion src/components/html_block_list/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ defineProps<Props>()
</script>

<template>
<ul v-if="display.type == 'unordered'" class="list-disc">
<ul v-if="display.tag == 'ul'" class="list-disc">
<li v-for="item in display.items" :key="item">{{ item }}</li>
</ul>
<ol v-else class="list-decimal">
Expand Down
10 changes: 5 additions & 5 deletions src/components/html_block_media/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,18 @@ defineProps<Props>()

<template>
<img
v-if="display.type == 'img'"
v-if="display.tag == 'img'"
:src="display.src"
:width="display.width"
:height="display.height"
:alt="display.alt"
/>
<component
v-else
:is="display.type"
:is="display.tag"
:controls="display.controls || true"
:width="display.type == 'video' ? display.height || 400 : undefined"
:height="display.type == 'video' ? display.height || 320 : undefined"
:width="display.tag == 'video' ? display.height || 400 : undefined"
:height="display.tag == 'video' ? display.height || 320 : undefined"
>
<source
v-for="source in display.sources || []"
Expand All @@ -33,7 +33,7 @@ defineProps<Props>()
<source :src="display.src" />
<p>
{{
display.alt || `Your browser does not support ${display.type}.`
display.alt || `Your browser does not support ${display.tag}.`
}}
</p>
</component>
Expand Down
26 changes: 13 additions & 13 deletions src/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -563,7 +563,7 @@
"properties": {
"display": {
"component": "html_block_content",
"type": "h1",
"tag": "h1",
"content": "Heading 1"
}
}
Expand All @@ -581,7 +581,7 @@
"properties": {
"display": {
"component": "html_block_content",
"type": "h2",
"tag": "h2",
"content": "Heading 2"
}
}
Expand All @@ -599,7 +599,7 @@
"properties": {
"display": {
"component": "html_block_content",
"type": "h3",
"tag": "h3",
"content": "Heading 3"
}
}
Expand All @@ -617,7 +617,7 @@
"properties": {
"display": {
"component": "html_block_content",
"type": "h4",
"tag": "h4",
"content": "Heading 4"
}
}
Expand All @@ -635,7 +635,7 @@
"properties": {
"display": {
"component": "html_block_content",
"type": "p",
"tag": "p",
"content": "This is a paragraph."
}
}
Expand All @@ -653,7 +653,7 @@
"properties": {
"display": {
"component": "html_block_content",
"type": "blockquote",
"tag": "blockquote",
"content": "This is a blockquote."
}
}
Expand All @@ -671,7 +671,7 @@
"properties": {
"display": {
"component": "html_block_content",
"type": "code",
"tag": "code",
"content": "This is a code snippet."
}
}
Expand All @@ -689,7 +689,7 @@
"properties": {
"display": {
"component": "html_block_content",
"type": "pre",
"tag": "pre",
"content": "This is preformatted text."
}
}
Expand All @@ -707,7 +707,7 @@
"properties": {
"display": {
"component": "html_block_list",
"type": "unordered",
"tag": "ul",
"items": ["First item", "Second item", "Third item"]
}
}
Expand All @@ -725,7 +725,7 @@
"properties": {
"display": {
"component": "html_block_list",
"type": "ordered",
"tag": "ol",
"items": ["First item", "Second item", "Third item"]
}
}
Expand All @@ -743,7 +743,7 @@
"properties": {
"display": {
"component": "html_block_media",
"type": "img",
"tag": "img",
"src": "https://images.pexels.com/photos/406014/pexels-photo-406014.jpeg?auto=compress&cs=tinysrgb&w=1260&h=750&dpr=1",
"alt": "Nice picture"
}
Expand All @@ -762,7 +762,7 @@
"properties": {
"display": {
"component": "html_block_media",
"type": "video",
"tag": "video",
"sources": [
{
"src": "https://www.w3schools.com/html/mov_bbb.mp4",
Expand All @@ -786,7 +786,7 @@
"properties": {
"display": {
"component": "html_block_media",
"type": "audio",
"tag": "audio",
"sources": [
{
"src": "https://www.w3schools.com/html/horse.ogg",
Expand Down
12 changes: 6 additions & 6 deletions src/types/display.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,13 +58,13 @@ export interface ActionRedirectProperties extends DisplayProperties {
/**
* Different types of HTML block content.
*/
type HTMLBlockContentType = 'h1' | 'h2' | 'h3' | 'h4' | 'p' | 'blockquote' | 'pre' | 'code';
type HTMLBlockContentTag = 'h1' | 'h2' | 'h3' | 'h4' | 'p' | 'blockquote' | 'pre' | 'code';

/**
* Properties for HTML content blocks.
*/
export interface HtmlBlockContentProperties extends DisplayProperties {
type: HTMLBlockContentType; // Type of HTML block
tag: HTMLBlockContentTag; // Type of HTML block
content: string; // Content of the HTML block
}

Expand All @@ -74,13 +74,13 @@ export interface HtmlBlockContentProperties extends DisplayProperties {
/**
* Different types of HTML lists.
*/
type HTMLBlockListType = 'ordered' | 'unordered';
type HTMLBlockListTag = 'ol' | 'ul';

/**
* Properties for HTML list blocks.
*/
export interface HTMLBlockListProperties extends DisplayProperties {
type: HTMLBlockListType; // Type of HTML list
tag: HTMLBlockListTag; // Type of HTML list
items: string[]; // Array of items in the list
}

Expand All @@ -90,7 +90,7 @@ export interface HTMLBlockListProperties extends DisplayProperties {
/**
* Different types of HTML media.
*/
type HTMLBlockMediaType = 'video' | 'audio' | 'img';
type HTMLBlockMediaTag = 'video' | 'audio' | 'img';

/**
* Attributes for media sources.
Expand All @@ -105,7 +105,7 @@ interface HTMLSourceAttributes {
* Properties for HTML media blocks.
*/
export interface HTMLBlockMediaProperties {
type: HTMLBlockMediaType; // Type of media block
tag: HTMLBlockMediaTag; // Type of media block
sources?: HTMLSourceAttributes[]; // Optional sources for the media
src?: string; // Optional source URL for the media
alt: string; // Alternative text for the media
Expand Down

0 comments on commit 80efefb

Please sign in to comment.