slidev-theme-neversink 0.3.1 → 0.3.3

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.
@@ -1,6 +1,5 @@
1
1
  <script setup>
2
2
  import { computed } from 'vue'
3
- //import { resolveColor } from '../layoutHelper'
4
3
  const props = defineProps({
5
4
  color: {
6
5
  type: String,
package/layoutHelper.ts CHANGED
@@ -1,41 +1,41 @@
1
1
  import type { CSSProperties } from 'vue'
2
- import { colors } from '@unocss/preset-mini'
2
+ // import { colors } from '@unocss/preset-mini'
3
3
 
4
- export function resolveColor(colorName: string, defaultColor: string = '#000000'): string {
5
- // If the input is already a hex code, return it
6
- if (/^#([0-9A-F]{3}){1,2}$/i.test(colorName)) {
7
- return colorName
8
- }
4
+ // export function resolveColor(colorName: string, defaultColor: string = '#000000'): string {
5
+ // // If the input is already a hex code, return it
6
+ // if (/^#([0-9A-F]{3}){1,2}$/i.test(colorName)) {
7
+ // return colorName
8
+ // }
9
9
 
10
- // Split the color name into base and shade
11
- const [baseColor, shade] = colorName.toLowerCase().split('-')
10
+ // // Split the color name into base and shade
11
+ // const [baseColor, shade] = colorName.toLowerCase().split('-')
12
12
 
13
- // Function to find the color in the colors object
14
- function findColor(obj: any, base: string, shade?: string): string | null {
15
- if (base in obj) {
16
- if (shade && typeof obj[base] === 'object' && shade in obj[base]) {
17
- return obj[base][shade]
18
- } else if (!shade && typeof obj[base] === 'string') {
19
- return obj[base]
20
- }
21
- }
13
+ // // Function to find the color in the colors object
14
+ // function findColor(obj: any, base: string, shade?: string): string | null {
15
+ // if (base in obj) {
16
+ // if (shade && typeof obj[base] === 'object' && shade in obj[base]) {
17
+ // return obj[base][shade]
18
+ // } else if (!shade && typeof obj[base] === 'string') {
19
+ // return obj[base]
20
+ // }
21
+ // }
22
22
 
23
- for (const value of Object.values(obj)) {
24
- if (typeof value === 'object' && value !== null) {
25
- const result = findColor(value, base, shade)
26
- if (result) return result
27
- }
28
- }
23
+ // for (const value of Object.values(obj)) {
24
+ // if (typeof value === 'object' && value !== null) {
25
+ // const result = findColor(value, base, shade)
26
+ // if (result) return result
27
+ // }
28
+ // }
29
29
 
30
- return null
31
- }
30
+ // return null
31
+ // }
32
32
 
33
- // Search for the color in the UnoCSS colors object
34
- const hexCode = findColor(colors, baseColor, shade)
33
+ // // Search for the color in the UnoCSS colors object
34
+ // const hexCode = findColor(colors, baseColor, shade)
35
35
 
36
- // If a valid color is found, return its hex code; otherwise, return the default color
37
- return hexCode || defaultColor
38
- }
36
+ // // If a valid color is found, return its hex code; otherwise, return the default color
37
+ // return hexCode || defaultColor
38
+ // }
39
39
 
40
40
  /**
41
41
  * Resolve urls from frontmatter and append with the base url
@@ -1,9 +1,7 @@
1
- <script setup lang="ts">
2
- import { computed, useSlots } from 'vue'
1
+ <script setup lang="js">
2
+ import { computed } from 'vue'
3
3
  import { compute_alignment, compute_column_size } from '../layoutHelper'
4
4
 
5
- const slots = useSlots()
6
-
7
5
  const props = defineProps({
8
6
  side: {
9
7
  default: 'l',
@@ -55,15 +53,15 @@ const colorscheme = computed(() => {
55
53
  <p>
56
54
  There are three parameters: <code>color</code>, <code>columns</code> and <code>align</code>. Currently:
57
55
  <code>color: {{ props.color }}</code
58
- >, <code>columns: {{ props.columns }}</code> and <code>align: {{ props.align }}</code
56
+ >, <code>columns: {{ props.titlewidth }}</code> and <code>align: {{ props.align }}</code
59
57
  >.
60
58
  </p>
61
59
  <p>The "slots" of the page are default and <code>:: content ::</code></p>
62
60
  <p>
63
- Options for <code>columns</code> are divided into 12 column units. So with <code>columns: is-1-11</code> the left
64
- column is 1/12 wide and the the right columns is 11/12 wide. The component admits a short had of only specifying
65
- the left column (<code>columns: is-1</code> does the same thing). In addition there are short hands like
66
- <code>columns: is-one-quarter</code> which resolves to <code>is-3-9</code>, etc...
61
+ Options for <code>titlewidth</code> are divided into 12 column units. So with <code>titlewidth: is-1-11</code> the
62
+ left column is 1/12 wide and the the right columns is 11/12 wide. The component admits a short had of only
63
+ specifying the left column (<code>titlewidth: is-1</code> does the same thing). In addition there are short hands
64
+ like <code>titlewidth: is-one-quarter</code> which resolves to <code>is-3-9</code>, etc...
67
65
  </p>
68
66
  <p>
69
67
  Here are a bunch of examples:
@@ -1,9 +1,7 @@
1
- <script setup lang="ts">
2
- import { computed, useSlots } from 'vue'
1
+ <script setup lang="js">
2
+ import { computed } from 'vue'
3
3
  import { compute_alignment, compute_column_size } from '../layoutHelper'
4
4
 
5
- const slots = useSlots()
6
-
7
5
  const props = defineProps({
8
6
  columns: {
9
7
  default: 'is-one-half',
@@ -59,7 +57,7 @@ const colorscheme = computed(() => {
59
57
 
60
58
  <p>The <code>color</code> parameter determines color of the title.</p>
61
59
  </div>
62
- <template v-else>
60
+ <div v-else>
63
61
  <div class="flex flex-col h-full w-full">
64
62
  <div class="w-full h-fit min-h-13 pt-2 pb-2 slidecolor" :class="colorscheme">
65
63
  <div class="slidev-layout toptitle title p-0 ml-6 mr-6 mt-auto mb-auto" :class="alignment.t">
@@ -80,7 +78,7 @@ const colorscheme = computed(() => {
80
78
  <slot name="default" />
81
79
  </div>
82
80
  </div>
83
- </template>
81
+ </div>
84
82
  </template>
85
83
 
86
84
  <style>
@@ -1,8 +1,6 @@
1
- <script setup lang="ts">
2
- import { computed, useSlots } from 'vue'
3
- import { compute_alignment, compute_column_size } from '../layoutHelper'
4
-
5
- const slots = useSlots()
1
+ <script setup lang="js">
2
+ import { computed } from 'vue'
3
+ import { compute_alignment } from '../layoutHelper'
6
4
 
7
5
  const props = defineProps({
8
6
  color: {
@@ -41,7 +39,7 @@ const colorscheme = computed(() => {
41
39
 
42
40
  <p>The <code>color</code> parameter determines color of the title.</p>
43
41
  </div>
44
- <template v-else>
42
+ <div v-else>
45
43
  <div class="flex flex-col h-full w-full">
46
44
  <div class="w-full h-fit min-h-13 pt-2 pb-2 slidecolor" :class="colorscheme">
47
45
  <div class="slidev-layout toptitle title p-0 pt-0 ml-6 mr-6 mt-auto mb-auto" :class="alignment">
@@ -55,7 +53,7 @@ const colorscheme = computed(() => {
55
53
  <slot name="default" />
56
54
  </div>
57
55
  </div>
58
- </template>
56
+ </div>
59
57
  </template>
60
58
 
61
59
  <style>
@@ -1,4 +1,4 @@
1
- <script setup lang="ts">
1
+ <script setup lang="js">
2
2
  import { computed, useSlots } from 'vue'
3
3
  import { compute_alignment, compute_column_size } from '../layoutHelper'
4
4
 
@@ -1,9 +1,7 @@
1
- <script setup lang="ts">
2
- import { computed, useSlots } from 'vue'
1
+ <script setup lang="js">
2
+ import { computed } from 'vue'
3
3
  import { compute_alignment, compute_column_size } from '../layoutHelper'
4
4
 
5
- const slots = useSlots()
6
-
7
5
  const props = defineProps({
8
6
  columns: {
9
7
  default: 'is-one-half',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "slidev-theme-neversink",
3
- "version": "0.3.1",
3
+ "version": "0.3.3",
4
4
  "author": "gureckis",
5
5
  "type": "module",
6
6
  "keywords": [