zuljaman-banner-components 1.0.39 → 1.0.40
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/constants/bannerDefaults.d.ts +19 -0
- package/dist/constants/bannerDefaults.d.ts.map +1 -0
- package/dist/constants/bannerDefaults.js +90 -0
- package/dist/constants/index.d.ts +1 -0
- package/dist/constants/index.d.ts.map +1 -1
- package/dist/constants/index.js +1 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +15 -1
- package/dist/{utils.d.ts → utils/index.d.ts} +5 -2
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/{utils.js → utils/index.js} +7 -1
- package/dist/utils/styleDefaults.d.ts +35 -0
- package/dist/utils/styleDefaults.d.ts.map +1 -0
- package/dist/utils/styleDefaults.js +53 -0
- package/dist/utils/styleRouter.d.ts +7 -0
- package/dist/utils/styleRouter.d.ts.map +1 -0
- package/dist/utils/styleRouter.js +34 -0
- package/package.json +1 -1
- package/dist/utils.d.ts.map +0 -1
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared constants used by both zuljaman and Lambda.
|
|
3
|
+
* Single source of truth for banner defaults.
|
|
4
|
+
*/
|
|
5
|
+
/** Default placeholder text for copies when no user text is provided */
|
|
6
|
+
export declare const DEFAULT_COPY_TEXTS: string[];
|
|
7
|
+
/** Available Google Fonts and their loaded weights (matches CDN imports) */
|
|
8
|
+
export declare const FONT_WEIGHTS: Record<string, number[]>;
|
|
9
|
+
/** All available font families for the font picker UI */
|
|
10
|
+
export declare const AVAILABLE_FONTS: Array<{
|
|
11
|
+
value: string;
|
|
12
|
+
label: string;
|
|
13
|
+
category: 'sans-serif' | 'serif' | 'cursive';
|
|
14
|
+
}>;
|
|
15
|
+
/** Extract font family name from CSS value like "'Playfair Display', serif" -> "Playfair Display" */
|
|
16
|
+
export declare function extractFontName(cssValue: string): string;
|
|
17
|
+
/** Get available weights for a font family (by CSS value or name) */
|
|
18
|
+
export declare function getFontWeights(fontFamilyOrName: string): number[];
|
|
19
|
+
//# sourceMappingURL=bannerDefaults.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bannerDefaults.d.ts","sourceRoot":"","sources":["../../src/constants/bannerDefaults.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,wEAAwE;AACxE,eAAO,MAAM,kBAAkB,UAI9B,CAAC;AAEF,4EAA4E;AAC5E,eAAO,MAAM,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CA+BjD,CAAC;AAEF,yDAAyD;AACzD,eAAO,MAAM,eAAe,EAAE,KAAK,CAAC;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,YAAY,GAAG,OAAO,GAAG,SAAS,CAAA;CAAE,CA+BjH,CAAC;AAEF,qGAAqG;AACrG,wBAAgB,eAAe,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAExD;AAED,qEAAqE;AACrE,wBAAgB,cAAc,CAAC,gBAAgB,EAAE,MAAM,GAAG,MAAM,EAAE,CAGjE"}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Shared constants used by both zuljaman and Lambda.
|
|
4
|
+
* Single source of truth for banner defaults.
|
|
5
|
+
*/
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.AVAILABLE_FONTS = exports.FONT_WEIGHTS = exports.DEFAULT_COPY_TEXTS = void 0;
|
|
8
|
+
exports.extractFontName = extractFontName;
|
|
9
|
+
exports.getFontWeights = getFontWeights;
|
|
10
|
+
/** Default placeholder text for copies when no user text is provided */
|
|
11
|
+
exports.DEFAULT_COPY_TEXTS = [
|
|
12
|
+
'Lorem ipsum dolor sit amet',
|
|
13
|
+
'Consectetur adipiscing elit sed do eiusmod',
|
|
14
|
+
'Tempor incididunt ut labore',
|
|
15
|
+
];
|
|
16
|
+
/** Available Google Fonts and their loaded weights (matches CDN imports) */
|
|
17
|
+
exports.FONT_WEIGHTS = {
|
|
18
|
+
"Roboto": [300, 400, 500, 700, 900],
|
|
19
|
+
"Roboto Condensed": [300, 400, 500, 600, 700, 800, 900],
|
|
20
|
+
"Lato": [300, 400, 700, 900],
|
|
21
|
+
"Inter": [300, 400, 500, 600, 700, 800, 900],
|
|
22
|
+
"Open Sans": [300, 400, 500, 600, 700, 800],
|
|
23
|
+
"Source Sans 3": [300, 400, 500, 600, 700, 800, 900],
|
|
24
|
+
"Work Sans": [300, 400, 500, 600, 700, 800],
|
|
25
|
+
"DM Sans": [300, 400, 500, 600, 700],
|
|
26
|
+
"Montserrat": [300, 400, 500, 600, 700, 800, 900],
|
|
27
|
+
"Poppins": [400, 500, 600, 700, 800, 900],
|
|
28
|
+
"Raleway": [300, 400, 500, 600, 700, 800],
|
|
29
|
+
"Oswald": [300, 400, 500, 600, 700],
|
|
30
|
+
"Nunito": [300, 400, 500, 600, 700, 800, 900],
|
|
31
|
+
"Quicksand": [400, 500, 600, 700],
|
|
32
|
+
"Josefin Sans": [300, 400, 500, 600, 700],
|
|
33
|
+
"Bebas Neue": [400],
|
|
34
|
+
"Anton": [400],
|
|
35
|
+
"Archivo Black": [400],
|
|
36
|
+
"Cormorant Garamond": [300, 400, 500, 600, 700],
|
|
37
|
+
"Playfair Display": [400, 500, 600, 700, 800, 900],
|
|
38
|
+
"Merriweather": [300, 400, 700, 900],
|
|
39
|
+
"Lora": [400, 500, 600, 700],
|
|
40
|
+
"Libre Baskerville": [400, 700],
|
|
41
|
+
"EB Garamond": [400, 500, 600, 700, 800],
|
|
42
|
+
"Crimson Text": [400, 600, 700],
|
|
43
|
+
"Source Serif 4": [300, 400, 500, 600, 700],
|
|
44
|
+
"Dancing Script": [400, 500, 600, 700],
|
|
45
|
+
"Caveat": [400, 500, 600, 700],
|
|
46
|
+
"Pacifico": [400],
|
|
47
|
+
"Satisfy": [400],
|
|
48
|
+
};
|
|
49
|
+
/** All available font families for the font picker UI */
|
|
50
|
+
exports.AVAILABLE_FONTS = [
|
|
51
|
+
{ value: "Roboto, sans-serif", label: "Roboto", category: "sans-serif" },
|
|
52
|
+
{ value: "'Roboto Condensed', sans-serif", label: "Roboto Condensed", category: "sans-serif" },
|
|
53
|
+
{ value: "Lato, sans-serif", label: "Lato", category: "sans-serif" },
|
|
54
|
+
{ value: "Inter, sans-serif", label: "Inter", category: "sans-serif" },
|
|
55
|
+
{ value: "'Open Sans', sans-serif", label: "Open Sans", category: "sans-serif" },
|
|
56
|
+
{ value: "'Source Sans 3', sans-serif", label: "Source Sans", category: "sans-serif" },
|
|
57
|
+
{ value: "'Work Sans', sans-serif", label: "Work Sans", category: "sans-serif" },
|
|
58
|
+
{ value: "'DM Sans', sans-serif", label: "DM Sans", category: "sans-serif" },
|
|
59
|
+
{ value: "Montserrat, sans-serif", label: "Montserrat", category: "sans-serif" },
|
|
60
|
+
{ value: "Poppins, sans-serif", label: "Poppins", category: "sans-serif" },
|
|
61
|
+
{ value: "Raleway, sans-serif", label: "Raleway", category: "sans-serif" },
|
|
62
|
+
{ value: "Oswald, sans-serif", label: "Oswald", category: "sans-serif" },
|
|
63
|
+
{ value: "Nunito, sans-serif", label: "Nunito", category: "sans-serif" },
|
|
64
|
+
{ value: "Quicksand, sans-serif", label: "Quicksand", category: "sans-serif" },
|
|
65
|
+
{ value: "'Josefin Sans', sans-serif", label: "Josefin Sans", category: "sans-serif" },
|
|
66
|
+
{ value: "'Bebas Neue', sans-serif", label: "Bebas Neue", category: "sans-serif" },
|
|
67
|
+
{ value: "Anton, sans-serif", label: "Anton", category: "sans-serif" },
|
|
68
|
+
{ value: "'Archivo Black', sans-serif", label: "Archivo Black", category: "sans-serif" },
|
|
69
|
+
{ value: "'Cormorant Garamond', serif", label: "Cormorant Garamond", category: "serif" },
|
|
70
|
+
{ value: "'Playfair Display', serif", label: "Playfair Display", category: "serif" },
|
|
71
|
+
{ value: "Merriweather, serif", label: "Merriweather", category: "serif" },
|
|
72
|
+
{ value: "Lora, serif", label: "Lora", category: "serif" },
|
|
73
|
+
{ value: "'Libre Baskerville', serif", label: "Libre Baskerville", category: "serif" },
|
|
74
|
+
{ value: "'EB Garamond', serif", label: "EB Garamond", category: "serif" },
|
|
75
|
+
{ value: "'Crimson Text', serif", label: "Crimson Text", category: "serif" },
|
|
76
|
+
{ value: "'Source Serif 4', serif", label: "Source Serif", category: "serif" },
|
|
77
|
+
{ value: "'Dancing Script', cursive", label: "Dancing Script", category: "cursive" },
|
|
78
|
+
{ value: "Caveat, cursive", label: "Caveat", category: "cursive" },
|
|
79
|
+
{ value: "Pacifico, cursive", label: "Pacifico", category: "cursive" },
|
|
80
|
+
{ value: "Satisfy, cursive", label: "Satisfy", category: "cursive" },
|
|
81
|
+
];
|
|
82
|
+
/** Extract font family name from CSS value like "'Playfair Display', serif" -> "Playfair Display" */
|
|
83
|
+
function extractFontName(cssValue) {
|
|
84
|
+
return cssValue.replace(/['"`]/g, '').split(',')[0].trim();
|
|
85
|
+
}
|
|
86
|
+
/** Get available weights for a font family (by CSS value or name) */
|
|
87
|
+
function getFontWeights(fontFamilyOrName) {
|
|
88
|
+
const name = fontFamilyOrName.includes(',') ? extractFontName(fontFamilyOrName) : fontFamilyOrName;
|
|
89
|
+
return exports.FONT_WEIGHTS[name] || [400, 700];
|
|
90
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/constants/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,cAAc,gBAAgB,CAAC;AAC/B,cAAc,mBAAmB,CAAC;AAClC,cAAc,YAAY,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/constants/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,cAAc,gBAAgB,CAAC;AAC/B,cAAc,mBAAmB,CAAC;AAClC,cAAc,YAAY,CAAC;AAC3B,cAAc,kBAAkB,CAAC"}
|
package/dist/constants/index.js
CHANGED
|
@@ -20,3 +20,4 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
20
20
|
__exportStar(require("./styleConfigs"), exports);
|
|
21
21
|
__exportStar(require("./characterLimits"), exports);
|
|
22
22
|
__exportStar(require("./defaults"), exports);
|
|
23
|
+
__exportStar(require("./bannerDefaults"), exports);
|
package/dist/index.d.ts
CHANGED
|
@@ -28,4 +28,8 @@ export type { SubstyleConfig as Style8SubstyleConfig } from './components/styles
|
|
|
28
28
|
export { STYLE8_SUBSTYLE_CONFIGS, getSubstyleConfig as getStyle8SubstyleConfig } from './components/styles/Style8/substyleConfig';
|
|
29
29
|
export type { SubstyleConfig as Style9SubstyleConfig } from './components/styles/Style9/substyleConfig';
|
|
30
30
|
export { STYLE9_SUBSTYLE_CONFIGS, getSubstyleConfig as getStyle9SubstyleConfig } from './components/styles/Style9/substyleConfig';
|
|
31
|
+
export { getSubstyleConfigForStyle } from './utils/styleRouter';
|
|
32
|
+
export { DEFAULT_COPY_TEXTS, FONT_WEIGHTS, AVAILABLE_FONTS, extractFontName, getFontWeights } from './constants/bannerDefaults';
|
|
33
|
+
export { getStyleShadowDefaults, getCopyDefaults } from './utils/styleDefaults';
|
|
34
|
+
export type { StyleShadowDefaults, CopyDefaults } from './utils/styleDefaults';
|
|
31
35
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,cAAc,cAAc,CAAC;AAG7B,cAAc,YAAY,CAAC;AAG3B,cAAc,SAAS,CAAC;AAGxB,cAAc,SAAS,CAAC;AAGxB,cAAc,UAAU,CAAC;AAGzB,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC;AAC9B,cAAc,2CAA2C,C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ACvB,iBAAiB,IAAI,uBAAuB,EAC7C,MAAM,2CAA2C,CAAC;AAEnD,YAAY,EAAE,cAAc,IAAI,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACxG,OAAO,EACL,uBAAuB,EACvB,iBAAiB,IAAI,uBAAuB,EAC7C,MAAM,2CAA2C,CAAC;AAGnD,OAAO,EAAE,yBAAyB,EAAE,MAAM,qBAAqB,CAAC;AAGhE,OAAO,EAAE,kBAAkB,EAAE,YAAY,EAAE,eAAe,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAGhI,OAAO,EAAE,sBAAsB,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAChF,YAAY,EAAE,mBAAmB,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -20,7 +20,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
20
20
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
21
21
|
};
|
|
22
22
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
23
|
-
exports.getStyle9SubstyleConfig = exports.STYLE9_SUBSTYLE_CONFIGS = exports.getStyle8SubstyleConfig = exports.STYLE8_SUBSTYLE_CONFIGS = exports.getStyle7SubstyleConfig = exports.STYLE7_SUBSTYLE_CONFIGS = exports.getStyle6SubstyleConfig = exports.STYLE6_SUBSTYLE_CONFIGS = exports.getStyle5SubstyleConfig = exports.STYLE5_SUBSTYLE_CONFIGS = exports.getStyle4SubstyleConfig = exports.STYLE4_SUBSTYLE_CONFIGS = exports.getStyle3SubstyleConfig = exports.STYLE3_SUBSTYLE_CONFIGS = exports.getStyle2SubstyleConfig = exports.STYLE2_SUBSTYLE_CONFIGS = void 0;
|
|
23
|
+
exports.getCopyDefaults = exports.getStyleShadowDefaults = exports.getFontWeights = exports.extractFontName = exports.AVAILABLE_FONTS = exports.FONT_WEIGHTS = exports.DEFAULT_COPY_TEXTS = exports.getSubstyleConfigForStyle = exports.getStyle9SubstyleConfig = exports.STYLE9_SUBSTYLE_CONFIGS = exports.getStyle8SubstyleConfig = exports.STYLE8_SUBSTYLE_CONFIGS = exports.getStyle7SubstyleConfig = exports.STYLE7_SUBSTYLE_CONFIGS = exports.getStyle6SubstyleConfig = exports.STYLE6_SUBSTYLE_CONFIGS = exports.getStyle5SubstyleConfig = exports.STYLE5_SUBSTYLE_CONFIGS = exports.getStyle4SubstyleConfig = exports.STYLE4_SUBSTYLE_CONFIGS = exports.getStyle3SubstyleConfig = exports.STYLE3_SUBSTYLE_CONFIGS = exports.getStyle2SubstyleConfig = exports.STYLE2_SUBSTYLE_CONFIGS = void 0;
|
|
24
24
|
// Core components
|
|
25
25
|
__exportStar(require("./components"), exports);
|
|
26
26
|
// Platform adapters
|
|
@@ -59,3 +59,17 @@ Object.defineProperty(exports, "getStyle8SubstyleConfig", { enumerable: true, ge
|
|
|
59
59
|
var substyleConfig_8 = require("./components/styles/Style9/substyleConfig");
|
|
60
60
|
Object.defineProperty(exports, "STYLE9_SUBSTYLE_CONFIGS", { enumerable: true, get: function () { return substyleConfig_8.STYLE9_SUBSTYLE_CONFIGS; } });
|
|
61
61
|
Object.defineProperty(exports, "getStyle9SubstyleConfig", { enumerable: true, get: function () { return substyleConfig_8.getSubstyleConfig; } });
|
|
62
|
+
// Unified style router (replaces consumer switch statements)
|
|
63
|
+
var styleRouter_1 = require("./utils/styleRouter");
|
|
64
|
+
Object.defineProperty(exports, "getSubstyleConfigForStyle", { enumerable: true, get: function () { return styleRouter_1.getSubstyleConfigForStyle; } });
|
|
65
|
+
// Shared constants
|
|
66
|
+
var bannerDefaults_1 = require("./constants/bannerDefaults");
|
|
67
|
+
Object.defineProperty(exports, "DEFAULT_COPY_TEXTS", { enumerable: true, get: function () { return bannerDefaults_1.DEFAULT_COPY_TEXTS; } });
|
|
68
|
+
Object.defineProperty(exports, "FONT_WEIGHTS", { enumerable: true, get: function () { return bannerDefaults_1.FONT_WEIGHTS; } });
|
|
69
|
+
Object.defineProperty(exports, "AVAILABLE_FONTS", { enumerable: true, get: function () { return bannerDefaults_1.AVAILABLE_FONTS; } });
|
|
70
|
+
Object.defineProperty(exports, "extractFontName", { enumerable: true, get: function () { return bannerDefaults_1.extractFontName; } });
|
|
71
|
+
Object.defineProperty(exports, "getFontWeights", { enumerable: true, get: function () { return bannerDefaults_1.getFontWeights; } });
|
|
72
|
+
// Style defaults utilities
|
|
73
|
+
var styleDefaults_1 = require("./utils/styleDefaults");
|
|
74
|
+
Object.defineProperty(exports, "getStyleShadowDefaults", { enumerable: true, get: function () { return styleDefaults_1.getStyleShadowDefaults; } });
|
|
75
|
+
Object.defineProperty(exports, "getCopyDefaults", { enumerable: true, get: function () { return styleDefaults_1.getCopyDefaults; } });
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Enhanced font size calculation for banner styles with separate sizing for copy1 and copy2
|
|
3
3
|
* Extracted from Next.js app implementation
|
|
4
4
|
*/
|
|
5
|
-
import type { StyleFontConfig, FontSizeResult } from '
|
|
5
|
+
import type { StyleFontConfig, FontSizeResult } from '../types';
|
|
6
6
|
/**
|
|
7
7
|
* Calculates dynamic font sizes for both copy1 and copy2 based on content length
|
|
8
8
|
* and style-specific constraints.
|
|
@@ -12,5 +12,8 @@ import type { StyleFontConfig, FontSizeResult } from './types';
|
|
|
12
12
|
* @param config - Style-specific font configuration
|
|
13
13
|
* @returns Object with fontSize_01 and fontSize_02 strings
|
|
14
14
|
*/
|
|
15
|
+
export { getSubstyleConfigForStyle } from './styleRouter';
|
|
16
|
+
export { getStyleShadowDefaults, getCopyDefaults } from './styleDefaults';
|
|
17
|
+
export type { StyleShadowDefaults, CopyDefaults } from './styleDefaults';
|
|
15
18
|
export declare const calculateStyleFontSizes: (copy1: string | null | undefined, copy2: string | null | undefined, config: StyleFontConfig) => FontSizeResult;
|
|
16
|
-
//# sourceMappingURL=
|
|
19
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAEhE;;;;;;;;GAQG;AAEH,OAAO,EAAE,yBAAyB,EAAE,MAAM,eAAe,CAAC;AAC1D,OAAO,EAAE,sBAAsB,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAC1E,YAAY,EAAE,mBAAmB,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAEzE,eAAO,MAAM,uBAAuB,GAClC,OAAO,MAAM,GAAG,IAAI,GAAG,SAAS,EAChC,OAAO,MAAM,GAAG,IAAI,GAAG,SAAS,EAChC,QAAQ,eAAe,KACtB,cAmBF,CAAC"}
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Extracted from Next.js app implementation
|
|
5
5
|
*/
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
exports.calculateStyleFontSizes = void 0;
|
|
7
|
+
exports.calculateStyleFontSizes = exports.getCopyDefaults = exports.getStyleShadowDefaults = exports.getSubstyleConfigForStyle = void 0;
|
|
8
8
|
/**
|
|
9
9
|
* Calculates dynamic font sizes for both copy1 and copy2 based on content length
|
|
10
10
|
* and style-specific constraints.
|
|
@@ -14,6 +14,12 @@ exports.calculateStyleFontSizes = void 0;
|
|
|
14
14
|
* @param config - Style-specific font configuration
|
|
15
15
|
* @returns Object with fontSize_01 and fontSize_02 strings
|
|
16
16
|
*/
|
|
17
|
+
// Re-export new utilities
|
|
18
|
+
var styleRouter_1 = require("./styleRouter");
|
|
19
|
+
Object.defineProperty(exports, "getSubstyleConfigForStyle", { enumerable: true, get: function () { return styleRouter_1.getSubstyleConfigForStyle; } });
|
|
20
|
+
var styleDefaults_1 = require("./styleDefaults");
|
|
21
|
+
Object.defineProperty(exports, "getStyleShadowDefaults", { enumerable: true, get: function () { return styleDefaults_1.getStyleShadowDefaults; } });
|
|
22
|
+
Object.defineProperty(exports, "getCopyDefaults", { enumerable: true, get: function () { return styleDefaults_1.getCopyDefaults; } });
|
|
17
23
|
const calculateStyleFontSizes = (copy1, copy2, config) => {
|
|
18
24
|
var _a, _b;
|
|
19
25
|
const { baseSizeRem1, baseSizeRem2, maxLengthThreshold, reductionFactor } = config;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
export interface StyleShadowDefaults {
|
|
2
|
+
textShadowEnabled: boolean;
|
|
3
|
+
textShadowSize: number;
|
|
4
|
+
textShadowIntensity: number;
|
|
5
|
+
logoShadowEnabled: boolean;
|
|
6
|
+
logoShadowSize: number;
|
|
7
|
+
logoShadowIntensity: number;
|
|
8
|
+
noiseEnabled: boolean;
|
|
9
|
+
noiseIntensity: number;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Get shadow/noise defaults for a style.
|
|
13
|
+
* Extracts values from STYLE_CONFIGS with sensible fallbacks.
|
|
14
|
+
*/
|
|
15
|
+
export declare function getStyleShadowDefaults(bannerStyle: number): StyleShadowDefaults;
|
|
16
|
+
export interface CopyDefaults {
|
|
17
|
+
styleSlot: number;
|
|
18
|
+
text: string;
|
|
19
|
+
fontSize: number;
|
|
20
|
+
fontWeight: string;
|
|
21
|
+
align: string;
|
|
22
|
+
rotation: number;
|
|
23
|
+
color?: string;
|
|
24
|
+
bgColor?: string;
|
|
25
|
+
hasBg?: boolean;
|
|
26
|
+
paddingX?: string;
|
|
27
|
+
paddingY?: string;
|
|
28
|
+
borderRadius?: string;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Get default copy configuration for a style slot.
|
|
32
|
+
* Returns the substyle-defined defaults for position, font, and visual properties.
|
|
33
|
+
*/
|
|
34
|
+
export declare function getCopyDefaults(bannerStyle: number, bannerSubstyle: number, styleSlot: number): CopyDefaults;
|
|
35
|
+
//# sourceMappingURL=styleDefaults.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"styleDefaults.d.ts","sourceRoot":"","sources":["../../src/utils/styleDefaults.ts"],"names":[],"mappings":"AAQA,MAAM,WAAW,mBAAmB;IAClC,iBAAiB,EAAE,OAAO,CAAC;IAC3B,cAAc,EAAE,MAAM,CAAC;IACvB,mBAAmB,EAAE,MAAM,CAAC;IAC5B,iBAAiB,EAAE,OAAO,CAAC;IAC3B,cAAc,EAAE,MAAM,CAAC;IACvB,mBAAmB,EAAE,MAAM,CAAC;IAC5B,YAAY,EAAE,OAAO,CAAC;IACtB,cAAc,EAAE,MAAM,CAAC;CACxB;AAED;;;GAGG;AACH,wBAAgB,sBAAsB,CAAC,WAAW,EAAE,MAAM,GAAG,mBAAmB,CAY/E;AAED,MAAM,WAAW,YAAY;IAC3B,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAAC,WAAW,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,YAAY,CAmB5G"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getStyleShadowDefaults = getStyleShadowDefaults;
|
|
4
|
+
exports.getCopyDefaults = getCopyDefaults;
|
|
5
|
+
/**
|
|
6
|
+
* Style defaults utilities — shadow configs, copy initialization.
|
|
7
|
+
* Used by both zuljaman and Lambda.
|
|
8
|
+
*/
|
|
9
|
+
const styleConfig_1 = require("../styleConfig");
|
|
10
|
+
const styleRouter_1 = require("./styleRouter");
|
|
11
|
+
const bannerDefaults_1 = require("../constants/bannerDefaults");
|
|
12
|
+
/**
|
|
13
|
+
* Get shadow/noise defaults for a style.
|
|
14
|
+
* Extracts values from STYLE_CONFIGS with sensible fallbacks.
|
|
15
|
+
*/
|
|
16
|
+
function getStyleShadowDefaults(bannerStyle) {
|
|
17
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u;
|
|
18
|
+
const styleConfig = (0, styleConfig_1.getStyleConfig)(bannerStyle);
|
|
19
|
+
return {
|
|
20
|
+
textShadowEnabled: (_c = (_b = (_a = styleConfig.shadows) === null || _a === void 0 ? void 0 : _a.textShadow) === null || _b === void 0 ? void 0 : _b.enabled) !== null && _c !== void 0 ? _c : true,
|
|
21
|
+
textShadowSize: (_f = (_e = (_d = styleConfig.shadows) === null || _d === void 0 ? void 0 : _d.textShadow) === null || _e === void 0 ? void 0 : _e.size) !== null && _f !== void 0 ? _f : 70,
|
|
22
|
+
textShadowIntensity: (_j = (_h = (_g = styleConfig.shadows) === null || _g === void 0 ? void 0 : _g.textShadow) === null || _h === void 0 ? void 0 : _h.intensity) !== null && _j !== void 0 ? _j : 0.85,
|
|
23
|
+
logoShadowEnabled: (_m = (_l = (_k = styleConfig.shadows) === null || _k === void 0 ? void 0 : _k.logoShadow) === null || _l === void 0 ? void 0 : _l.enabled) !== null && _m !== void 0 ? _m : true,
|
|
24
|
+
logoShadowSize: (_q = (_p = (_o = styleConfig.shadows) === null || _o === void 0 ? void 0 : _o.logoShadow) === null || _p === void 0 ? void 0 : _p.size) !== null && _q !== void 0 ? _q : 150,
|
|
25
|
+
logoShadowIntensity: (_t = (_s = (_r = styleConfig.shadows) === null || _r === void 0 ? void 0 : _r.logoShadow) === null || _s === void 0 ? void 0 : _s.intensity) !== null && _t !== void 0 ? _t : 0.375,
|
|
26
|
+
noiseEnabled: (_u = styleConfig.noiseEnabled) !== null && _u !== void 0 ? _u : false,
|
|
27
|
+
noiseIntensity: 2.0,
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Get default copy configuration for a style slot.
|
|
32
|
+
* Returns the substyle-defined defaults for position, font, and visual properties.
|
|
33
|
+
*/
|
|
34
|
+
function getCopyDefaults(bannerStyle, bannerSubstyle, styleSlot) {
|
|
35
|
+
var _a, _b, _c, _d, _e;
|
|
36
|
+
const styleConfig = (0, styleConfig_1.getStyleConfig)(bannerStyle);
|
|
37
|
+
const substyleConfig = (0, styleRouter_1.getSubstyleConfigForStyle)(bannerStyle, bannerSubstyle);
|
|
38
|
+
const copyConfig = (_a = substyleConfig === null || substyleConfig === void 0 ? void 0 : substyleConfig.copies) === null || _a === void 0 ? void 0 : _a[styleSlot];
|
|
39
|
+
return {
|
|
40
|
+
styleSlot,
|
|
41
|
+
text: bannerDefaults_1.DEFAULT_COPY_TEXTS[styleSlot] || bannerDefaults_1.DEFAULT_COPY_TEXTS[0],
|
|
42
|
+
fontSize: (_c = (_b = substyleConfig === null || substyleConfig === void 0 ? void 0 : substyleConfig.fontSizes) === null || _b === void 0 ? void 0 : _b[styleSlot]) !== null && _c !== void 0 ? _c : 1.0,
|
|
43
|
+
fontWeight: ((_d = styleConfig.copyFontWeights) === null || _d === void 0 ? void 0 : _d[styleSlot]) || 'normal',
|
|
44
|
+
align: (copyConfig === null || copyConfig === void 0 ? void 0 : copyConfig.alignment) || 'center',
|
|
45
|
+
rotation: (_e = copyConfig === null || copyConfig === void 0 ? void 0 : copyConfig.rotation) !== null && _e !== void 0 ? _e : 0,
|
|
46
|
+
color: copyConfig === null || copyConfig === void 0 ? void 0 : copyConfig.color,
|
|
47
|
+
bgColor: copyConfig === null || copyConfig === void 0 ? void 0 : copyConfig.bgColor,
|
|
48
|
+
hasBg: copyConfig === null || copyConfig === void 0 ? void 0 : copyConfig.hasBg,
|
|
49
|
+
paddingX: copyConfig === null || copyConfig === void 0 ? void 0 : copyConfig.paddingX,
|
|
50
|
+
paddingY: copyConfig === null || copyConfig === void 0 ? void 0 : copyConfig.paddingY,
|
|
51
|
+
borderRadius: copyConfig === null || copyConfig === void 0 ? void 0 : copyConfig.borderRadius,
|
|
52
|
+
};
|
|
53
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { SubstyleConfig } from '../components/styles/types/substyleTypes';
|
|
2
|
+
/**
|
|
3
|
+
* Get substyle config for any style+substyle combination.
|
|
4
|
+
* Eliminates the switch-statement pattern that was duplicated in every consumer.
|
|
5
|
+
*/
|
|
6
|
+
export declare function getSubstyleConfigForStyle(bannerStyle: number, bannerSubstyle: number): SubstyleConfig;
|
|
7
|
+
//# sourceMappingURL=styleRouter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"styleRouter.d.ts","sourceRoot":"","sources":["../../src/utils/styleRouter.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,0CAA0C,CAAC;AAE/E;;;GAGG;AACH,wBAAgB,yBAAyB,CAAC,WAAW,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,GAAG,cAAc,CAarG"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getSubstyleConfigForStyle = getSubstyleConfigForStyle;
|
|
4
|
+
/**
|
|
5
|
+
* Unified substyle config router — single function that replaces the switch-statement
|
|
6
|
+
* pattern duplicated across zuljaman and Lambda.
|
|
7
|
+
*/
|
|
8
|
+
const substyleConfig_1 = require("../components/styles/Style1/substyleConfig");
|
|
9
|
+
const substyleConfig_2 = require("../components/styles/Style2/substyleConfig");
|
|
10
|
+
const substyleConfig_3 = require("../components/styles/Style3/substyleConfig");
|
|
11
|
+
const substyleConfig_4 = require("../components/styles/Style4/substyleConfig");
|
|
12
|
+
const substyleConfig_5 = require("../components/styles/Style5/substyleConfig");
|
|
13
|
+
const substyleConfig_6 = require("../components/styles/Style6/substyleConfig");
|
|
14
|
+
const substyleConfig_7 = require("../components/styles/Style7/substyleConfig");
|
|
15
|
+
const substyleConfig_8 = require("../components/styles/Style8/substyleConfig");
|
|
16
|
+
const substyleConfig_9 = require("../components/styles/Style9/substyleConfig");
|
|
17
|
+
/**
|
|
18
|
+
* Get substyle config for any style+substyle combination.
|
|
19
|
+
* Eliminates the switch-statement pattern that was duplicated in every consumer.
|
|
20
|
+
*/
|
|
21
|
+
function getSubstyleConfigForStyle(bannerStyle, bannerSubstyle) {
|
|
22
|
+
switch (bannerStyle) {
|
|
23
|
+
case 2: return (0, substyleConfig_2.getSubstyleConfig)(bannerSubstyle);
|
|
24
|
+
case 3: return (0, substyleConfig_3.getSubstyleConfig)(bannerSubstyle);
|
|
25
|
+
case 4: return (0, substyleConfig_4.getSubstyleConfig)(bannerSubstyle);
|
|
26
|
+
case 5: return (0, substyleConfig_5.getSubstyleConfig)(bannerSubstyle);
|
|
27
|
+
case 6: return (0, substyleConfig_6.getSubstyleConfig)(bannerSubstyle);
|
|
28
|
+
case 7: return (0, substyleConfig_7.getSubstyleConfig)(bannerSubstyle);
|
|
29
|
+
case 8: return (0, substyleConfig_8.getSubstyleConfig)(bannerSubstyle);
|
|
30
|
+
case 9: return (0, substyleConfig_9.getSubstyleConfig)(bannerSubstyle);
|
|
31
|
+
case 1:
|
|
32
|
+
default: return (0, substyleConfig_1.getSubstyleConfig)(bannerSubstyle);
|
|
33
|
+
}
|
|
34
|
+
}
|
package/package.json
CHANGED
package/dist/utils.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAE/D;;;;;;;;GAQG;AACH,eAAO,MAAM,uBAAuB,GAClC,OAAO,MAAM,GAAG,IAAI,GAAG,SAAS,EAChC,OAAO,MAAM,GAAG,IAAI,GAAG,SAAS,EAChC,QAAQ,eAAe,KACtB,cAmBF,CAAC"}
|