vite-plugin-storybook-nextjs 3.1.6 → 3.1.7
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/index.cjs +6 -4
- package/dist/index.js +6 -4
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -4069,14 +4069,16 @@ async function getFontFaceDeclarations2(options) {
|
|
|
4069
4069
|
if ("fontReferenceId" in localFontSrc) {
|
|
4070
4070
|
return tsDedent.dedent`@font-face {
|
|
4071
4071
|
font-family: ${id};
|
|
4072
|
-
src: url(${localFontSrc.fontReferenceId ? getPlaceholderFontUrl(localFontSrc.fontReferenceId) : `/@fs
|
|
4072
|
+
src: url(${localFontSrc.fontReferenceId ? getPlaceholderFontUrl(localFontSrc.fontReferenceId) : `/@fs/${localFontSrc.fontPath}`});
|
|
4073
|
+
${weight ? `font-weight: ${weight};` : ""}
|
|
4074
|
+
${style ? `font-style: ${style};` : ""}
|
|
4073
4075
|
${fontDeclarations}
|
|
4074
4076
|
}`;
|
|
4075
4077
|
}
|
|
4076
4078
|
return localFontSrc.map((font) => {
|
|
4077
4079
|
return tsDedent.dedent`@font-face {
|
|
4078
4080
|
font-family: ${id};
|
|
4079
|
-
src: url(${font.path.fontReferenceId ? getPlaceholderFontUrl(font.path.fontReferenceId) : `/@fs
|
|
4081
|
+
src: url(${font.path.fontReferenceId ? getPlaceholderFontUrl(font.path.fontReferenceId) : `/@fs/${font.path.fontPath}`});
|
|
4080
4082
|
${font.weight ? `font-weight: ${font.weight};` : ""}
|
|
4081
4083
|
${font.style ? `font-style: ${font.style};` : ""}
|
|
4082
4084
|
${fontDeclarations}
|
|
@@ -4104,7 +4106,7 @@ function getCSSMeta(options) {
|
|
|
4104
4106
|
.${className} {
|
|
4105
4107
|
font-family: ${options.fontFamily};
|
|
4106
4108
|
${isNextCSSPropertyValid(options.styles) ? `font-style: ${options.styles[0]};` : ""}
|
|
4107
|
-
${isNextCSSPropertyValid(options.weights) ? `font-weight: ${options.weights[0]};` : ""}
|
|
4109
|
+
${isNextCSSPropertyValid(options.weights) && !options.weights[0]?.includes(" ") ? `font-weight: ${options.weights[0]};` : ""}
|
|
4108
4110
|
}
|
|
4109
4111
|
|
|
4110
4112
|
${options.variable ? `.${variableClassName} { ${options.variable}: '${options.fontFamily}'; }` : ""}
|
|
@@ -4121,7 +4123,7 @@ function getCSSMeta(options) {
|
|
|
4121
4123
|
function getClassName({ styles, weights, fontFamily }) {
|
|
4122
4124
|
const font = fontFamily.replaceAll(" ", "-").toLowerCase();
|
|
4123
4125
|
const style = isNextCSSPropertyValid(styles) ? styles[0] : null;
|
|
4124
|
-
const weight = isNextCSSPropertyValid(weights) ? weights[0] : null;
|
|
4126
|
+
const weight = isNextCSSPropertyValid(weights) ? weights[0]?.replaceAll(" ", "-") : null;
|
|
4125
4127
|
return `${font}${style ? `-${style}` : ""}${weight ? `-${weight}` : ""}`;
|
|
4126
4128
|
}
|
|
4127
4129
|
function getStylesObj({ styles, weights, fontFamily }) {
|
package/dist/index.js
CHANGED
|
@@ -4036,14 +4036,16 @@ async function getFontFaceDeclarations2(options) {
|
|
|
4036
4036
|
if ("fontReferenceId" in localFontSrc) {
|
|
4037
4037
|
return dedent`@font-face {
|
|
4038
4038
|
font-family: ${id};
|
|
4039
|
-
src: url(${localFontSrc.fontReferenceId ? getPlaceholderFontUrl(localFontSrc.fontReferenceId) : `/@fs
|
|
4039
|
+
src: url(${localFontSrc.fontReferenceId ? getPlaceholderFontUrl(localFontSrc.fontReferenceId) : `/@fs/${localFontSrc.fontPath}`});
|
|
4040
|
+
${weight ? `font-weight: ${weight};` : ""}
|
|
4041
|
+
${style ? `font-style: ${style};` : ""}
|
|
4040
4042
|
${fontDeclarations}
|
|
4041
4043
|
}`;
|
|
4042
4044
|
}
|
|
4043
4045
|
return localFontSrc.map((font) => {
|
|
4044
4046
|
return dedent`@font-face {
|
|
4045
4047
|
font-family: ${id};
|
|
4046
|
-
src: url(${font.path.fontReferenceId ? getPlaceholderFontUrl(font.path.fontReferenceId) : `/@fs
|
|
4048
|
+
src: url(${font.path.fontReferenceId ? getPlaceholderFontUrl(font.path.fontReferenceId) : `/@fs/${font.path.fontPath}`});
|
|
4047
4049
|
${font.weight ? `font-weight: ${font.weight};` : ""}
|
|
4048
4050
|
${font.style ? `font-style: ${font.style};` : ""}
|
|
4049
4051
|
${fontDeclarations}
|
|
@@ -4071,7 +4073,7 @@ function getCSSMeta(options) {
|
|
|
4071
4073
|
.${className} {
|
|
4072
4074
|
font-family: ${options.fontFamily};
|
|
4073
4075
|
${isNextCSSPropertyValid(options.styles) ? `font-style: ${options.styles[0]};` : ""}
|
|
4074
|
-
${isNextCSSPropertyValid(options.weights) ? `font-weight: ${options.weights[0]};` : ""}
|
|
4076
|
+
${isNextCSSPropertyValid(options.weights) && !options.weights[0]?.includes(" ") ? `font-weight: ${options.weights[0]};` : ""}
|
|
4075
4077
|
}
|
|
4076
4078
|
|
|
4077
4079
|
${options.variable ? `.${variableClassName} { ${options.variable}: '${options.fontFamily}'; }` : ""}
|
|
@@ -4088,7 +4090,7 @@ function getCSSMeta(options) {
|
|
|
4088
4090
|
function getClassName({ styles, weights, fontFamily }) {
|
|
4089
4091
|
const font = fontFamily.replaceAll(" ", "-").toLowerCase();
|
|
4090
4092
|
const style = isNextCSSPropertyValid(styles) ? styles[0] : null;
|
|
4091
|
-
const weight = isNextCSSPropertyValid(weights) ? weights[0] : null;
|
|
4093
|
+
const weight = isNextCSSPropertyValid(weights) ? weights[0]?.replaceAll(" ", "-") : null;
|
|
4092
4094
|
return `${font}${style ? `-${style}` : ""}${weight ? `-${weight}` : ""}`;
|
|
4093
4095
|
}
|
|
4094
4096
|
function getStylesObj({ styles, weights, fontFamily }) {
|