@vueless/storybook 0.0.34 → 0.0.35

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,4 +1,4 @@
1
- import vuelessDocsTheme from "../themes/vueless.docs.theme";
1
+ import vuelessDocsTheme from "../themes/vueless.docs.theme.js";
2
2
  import colors from "tailwindcss/colors.js";
3
3
 
4
4
  export const docs = {
@@ -79,18 +79,21 @@ function templateSourceCode(templateSource, args, argTypes) {
79
79
  }
80
80
  }
81
81
 
82
- const slotTemplateCode =
82
+ const slotTemplateCodeBefore =
83
83
  // eslint-disable-next-line vue/max-len
84
- `<template v-for="(slot, index) of slots" :key="index" v-slot:[slot]><template v-if="args[slot + 'Slot']">{{ args[slot + 'Slot'] }}</template></template>`;
85
- const templateDefaultRegEx = /<template #default>([\s\S]*?)<\/template>/g;
84
+ `<template v-for="(slot, index) of slots" :key="index" v-slot:[slot]><template v-if="slot === 'default' && !args['defaultSlot']">`;
85
+
86
+ const slotTemplateCodeAfter =
87
+ // eslint-disable-next-line vue/max-len
88
+ `</template><template v-else-if="slot === 'default' && args['defaultSlot']">{{ args['defaultSlot'] }}</template><template v-else-if="args[slot + 'Slot']">{{ args[slot + 'Slot'] }}</template></template>`;
86
89
 
87
90
  return templateSource
88
91
  .replace(/>[\s]+</g, "><")
89
92
  .trim()
90
- .replace(slotTemplateCode, "")
91
- .replace(templateDefaultRegEx, "$1")
93
+ .replace(slotTemplateCodeBefore, "")
94
+ .replace(slotTemplateCodeAfter, "")
92
95
  .replace(
93
- 'v-model="args.modelValue"',
96
+ `v-model="args.${MODEL_VALUE_KEY}"`,
94
97
  args[MODEL_VALUE_KEY] ? `v-model="${args[MODEL_VALUE_KEY]}"` : "",
95
98
  )
96
99
  .replace(
@@ -109,6 +112,8 @@ function propToSource(key, val) {
109
112
  return val ? key : "";
110
113
  case "string":
111
114
  return `${key}="${val}"`;
115
+ case "object":
116
+ return `:${key}="${JSON.stringify(val)}"`;
112
117
  default:
113
118
  return `:${key}="${val}"`;
114
119
  }
@@ -1,9 +1,9 @@
1
1
  /** @type { import('@storybook/vue3-vite').StorybookConfig } */
2
2
  export default {
3
3
  stories: [
4
- "../node_modules/vueless/**/*.stories.@(js|jsx|ts|tsx)",
4
+ "../node_modules/vueless/**/*stories.@(js|jsx|ts|tsx)",
5
5
  "../node_modules/vueless/**/*.@(mdx)",
6
- "../src/**/*.stories.@(js|jsx|ts|tsx)",
6
+ "../src/**/*stories.@(js|jsx|ts|tsx)",
7
7
  "../src/**/*.@(mdx)",
8
8
  ],
9
9
  addons: [
@@ -1,5 +1,5 @@
1
1
  import { addons } from "@storybook/manager-api";
2
- import vuelessTheme from "./themes/vueless.theme";
2
+ import vuelessTheme from "./themes/vueless.theme.js";
3
3
 
4
4
  addons.setConfig({
5
5
  theme: vuelessTheme,
@@ -1,7 +1,7 @@
1
1
  import { setup } from "@storybook/vue3";
2
2
 
3
- import { backgrounds, docs, layout } from "./configs/main.config";
4
- import { vue3SourceDecorator } from "./decorators/vue3SourceDecorator";
3
+ import { backgrounds, docs, layout } from "./configs/main.config.js";
4
+ import { vue3SourceDecorator } from "./decorators/vue3SourceDecorator.js";
5
5
 
6
6
  // Vue plugins
7
7
  import { createVueless } from "vueless";
@@ -9,7 +9,8 @@ export default create({
9
9
 
10
10
  brandTitle: "Vueless UI",
11
11
  brandUrl: "https://vueless.com",
12
- brandImage: "https://raw.githubusercontent.com/vuelessjs/vueless-storybook/main/public/images/logo.png",
12
+ brandImage:
13
+ "https://raw.githubusercontent.com/vuelessjs/vueless-storybook/main/public/images/logo.png",
13
14
  brandTarget: "_blank",
14
15
 
15
16
  // Main colors
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vueless/storybook",
3
- "version": "0.0.34",
3
+ "version": "0.0.35",
4
4
  "description": "Simplifies Storybook configuration for Vueless UI library.",
5
5
  "homepage": "https://vueless.com",
6
6
  "author": "Johnny Grid",