@bagelink/blox 1.10.42 → 1.11.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.
- package/dist/core.d.ts +15 -0
- package/dist/core.d.ts.map +1 -1
- package/dist/defineBlock.d.ts +28 -11
- package/dist/defineBlock.d.ts.map +1 -1
- package/dist/index.cjs +28 -10
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.mjs +29 -11
- package/dist/schema.d.ts +2 -2
- package/dist/schema.d.ts.map +1 -1
- package/dist/vite-plugin.cjs +1133 -0
- package/dist/vite-plugin.d.ts +26 -0
- package/dist/vite-plugin.d.ts.map +1 -0
- package/dist/vite-plugin.mjs +1133 -0
- package/package.json +13 -2
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { Plugin } from 'vite';
|
|
2
|
+
/**
|
|
3
|
+
* Vite plugin that hoists `defineBlock({ name: '...', ... })` call statements
|
|
4
|
+
* out of `<script setup>` into a plain `<script>` block as
|
|
5
|
+
* `export const <name> = defineBlock({ ... })`.
|
|
6
|
+
*
|
|
7
|
+
* Write a single clean `<script setup>` with no assignment or export:
|
|
8
|
+
* ```vue
|
|
9
|
+
* <script setup lang="ts">
|
|
10
|
+
* defineBlock({ name: 'aboutBox', label: 'About Box', icon: 'info', schema })
|
|
11
|
+
* defineProps<AboutBoxProps>()
|
|
12
|
+
* </script>
|
|
13
|
+
* ```
|
|
14
|
+
*
|
|
15
|
+
* The plugin rewrites it before Vue's compiler sees it:
|
|
16
|
+
* ```vue
|
|
17
|
+
* <script lang="ts">
|
|
18
|
+
* export const aboutBox = defineBlock({ name: 'aboutBox', label: 'About Box', icon: 'info', schema })
|
|
19
|
+
* </script>
|
|
20
|
+
* <script setup lang="ts">
|
|
21
|
+
* defineProps<AboutBoxProps>()
|
|
22
|
+
* </script>
|
|
23
|
+
* ```
|
|
24
|
+
*/
|
|
25
|
+
export declare function bloxPlugin(): Plugin;
|
|
26
|
+
//# sourceMappingURL=vite-plugin.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vite-plugin.d.ts","sourceRoot":"","sources":["../src/vite-plugin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,MAAM,CAAA;AAGlC;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,UAAU,IAAI,MAAM,CAiFnC"}
|