create-slidev 0.48.9 → 0.49.0-beta.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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "create-slidev",
3
3
  "type": "module",
4
- "version": "0.48.9",
4
+ "version": "0.49.0-beta.2",
5
5
  "description": "Create starter template for Slidev",
6
6
  "author": "antfu <anthonyfu117@hotmail.com>",
7
7
  "license": "MIT",
@@ -8,7 +8,7 @@
8
8
  "export": "slidev export"
9
9
  },
10
10
  "dependencies": {
11
- "@slidev/cli": "^0.48.9",
11
+ "@slidev/cli": "^0.49.0-beta.2",
12
12
  "@slidev/theme-default": "latest",
13
13
  "@slidev/theme-seriph": "latest",
14
14
  "vue": "^3.4.21"
@@ -559,6 +559,43 @@ database "MySql" {
559
559
 
560
560
  [Learn More](https://sli.dev/guide/syntax.html#diagrams)
561
561
 
562
+ ---
563
+ foo: bar
564
+ dragPos:
565
+ square: 691,33,167,_,-16
566
+ ---
567
+
568
+ # Draggable Elements
569
+
570
+ Double-click on the draggable elements to edit their positions.
571
+
572
+ <br>
573
+
574
+ ###### Directive Usage
575
+
576
+ ```md
577
+ <img v-drag="'square'" src="https://sli.dev/logo.png">
578
+ ```
579
+
580
+ <br>
581
+
582
+ ###### Component Usage
583
+
584
+ ```md
585
+ <v-drag text-3xl>
586
+ <carbon:arrow-up />
587
+ Use the `v-drag` component to have a draggable container!
588
+ </v-drag>
589
+ ```
590
+
591
+ <v-drag pos="671,205,253,_,-15">
592
+ <div text-center text-3xl border border-main rounded>
593
+ Double-click me!
594
+ </div>
595
+ </v-drag>
596
+
597
+ <img v-drag="'square'" src="https://sli.dev/logo.png">
598
+
562
599
  ---
563
600
  src: ./pages/multiple-entries.md
564
601
  hide: false
@@ -574,23 +611,20 @@ Add `{monaco}` to the code block to turn it into an editor:
574
611
 
575
612
  ```ts {monaco}
576
613
  import { ref } from 'vue'
577
- import hello from './external'
614
+ import { emptyArray } from './external'
578
615
 
579
- const code = ref(hello())
616
+ const arr = ref(emptyArray(10))
580
617
  ```
581
618
 
582
619
  Use `{monaco-run}` to create an editor that can execute the code directly in the slide:
583
620
 
584
621
  ```ts {monaco-run}
585
622
  import { version } from 'vue'
623
+ import { emptyArray, sayHello } from './external'
586
624
 
587
- function fibonacci(n: number): number {
588
- return n <= 1
589
- ? n
590
- : fibonacci(n - 1) + fibonacci(n - 2) // you know, this is NOT the best way to do it :P
591
- }
592
-
593
- console.log(version, Array.from({ length: 10 }, (_, i) => fibonacci(i + 1)))
625
+ sayHello()
626
+ console.log(`vue ${version}`)
627
+ console.log(emptyArray<number>(10).reduce(fib => [...fib, fib.at(-1)! + fib.at(-2)!], [1, 1]))
594
628
  ```
595
629
 
596
630
  ---
@@ -1,9 +1,12 @@
1
1
  /* eslint-disable no-console */
2
2
 
3
3
  // #region snippet
4
- function hello() {
5
- console.log('Hello from snippets/external.ts')
4
+ // Inside ./snippets/external.ts
5
+ export function emptyArray<T>(length: number) {
6
+ return Array.from<T>({ length })
6
7
  }
7
8
  // #endregion snippet
8
9
 
9
- export default hello
10
+ export function sayHello() {
11
+ console.log('Hello from snippets/external.ts')
12
+ }