zuljaman-banner-components 1.0.6 → 1.0.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/components/BannerRenderer.d.ts +48 -0
- package/dist/components/BannerRenderer.d.ts.map +1 -0
- package/dist/components/BannerRenderer.js +449 -0
- package/dist/components/BannerVisor.d.ts.map +1 -1
- package/dist/components/BannerVisor.js +132 -18
- package/dist/components/index.d.ts +1 -2
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.js +4 -2
- package/dist/components/shared/DraggableElement.d.ts +31 -0
- package/dist/components/shared/DraggableElement.d.ts.map +1 -0
- package/dist/components/shared/DraggableElement.js +367 -0
- package/dist/components/shared/index.d.ts +7 -0
- package/dist/components/shared/index.d.ts.map +1 -0
- package/dist/components/shared/index.js +9 -0
- package/dist/components/styles/Style1/substyleConfig.d.ts +20 -0
- package/dist/components/styles/Style1/substyleConfig.d.ts.map +1 -0
- package/dist/components/styles/Style1/substyleConfig.js +105 -0
- package/dist/components/styles/Style2/substyleConfig.d.ts +20 -0
- package/dist/components/styles/Style2/substyleConfig.d.ts.map +1 -0
- package/dist/components/styles/Style2/substyleConfig.js +133 -0
- package/dist/components/styles/Style3/substyleConfig.d.ts +20 -0
- package/dist/components/styles/Style3/substyleConfig.d.ts.map +1 -0
- package/dist/components/styles/Style3/substyleConfig.js +91 -0
- package/dist/components/styles/Style4/substyleConfig.d.ts +20 -0
- package/dist/components/styles/Style4/substyleConfig.d.ts.map +1 -0
- package/dist/components/styles/Style4/substyleConfig.js +112 -0
- package/dist/components/styles/types/substyleTypes.d.ts +68 -0
- package/dist/components/styles/types/substyleTypes.d.ts.map +1 -0
- package/dist/components/styles/types/substyleTypes.js +6 -0
- package/dist/components/styles/utils/calculations.d.ts +47 -0
- package/dist/components/styles/utils/calculations.d.ts.map +1 -0
- package/dist/components/styles/utils/calculations.js +69 -0
- package/dist/components/styles/utils/defaultsUtils.d.ts +54 -0
- package/dist/components/styles/utils/defaultsUtils.d.ts.map +1 -0
- package/dist/components/styles/utils/defaultsUtils.js +83 -0
- package/dist/components/styles/utils/fontSizeUtils.d.ts +32 -0
- package/dist/components/styles/utils/fontSizeUtils.d.ts.map +1 -0
- package/dist/components/styles/utils/fontSizeUtils.js +52 -0
- package/dist/components/styles/utils/positioningUtils.d.ts +38 -0
- package/dist/components/styles/utils/positioningUtils.d.ts.map +1 -0
- package/dist/components/styles/utils/positioningUtils.js +79 -0
- package/dist/components/styles/utils/substyleUtils.d.ts +14 -0
- package/dist/components/styles/utils/substyleUtils.d.ts.map +1 -0
- package/dist/components/styles/utils/substyleUtils.js +18 -0
- package/dist/components/styles/utils/transformUtils.d.ts +36 -0
- package/dist/components/styles/utils/transformUtils.d.ts.map +1 -0
- package/dist/components/styles/utils/transformUtils.js +53 -0
- package/dist/constants/characterLimits.d.ts +97 -0
- package/dist/constants/characterLimits.d.ts.map +1 -0
- package/dist/constants/characterLimits.js +144 -0
- package/dist/constants/defaults.d.ts +19 -0
- package/dist/constants/defaults.d.ts.map +1 -0
- package/dist/constants/defaults.js +27 -0
- package/dist/constants/index.d.ts +2 -0
- package/dist/constants/index.d.ts.map +1 -1
- package/dist/constants/index.js +2 -0
- package/dist/constants/styleConfigs.d.ts.map +1 -1
- package/dist/constants/styleConfigs.js +13 -7
- package/dist/index.d.ts +8 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +12 -0
- package/dist/styleConfig.d.ts +40 -0
- package/dist/styleConfig.d.ts.map +1 -0
- package/dist/styleConfig.js +115 -0
- package/dist/styles/shadowUtils.js +4 -4
- package/dist/types.d.ts +149 -1
- package/dist/types.d.ts.map +1 -1
- package/package.json +10 -9
- package/dist/components/Style1/BannerStyle1.d.ts +0 -19
- package/dist/components/Style1/BannerStyle1.d.ts.map +0 -1
- package/dist/components/Style1/BannerStyle1.js +0 -27
- package/dist/components/Style1/substyles/BannerSubstyle1.d.ts +0 -12
- package/dist/components/Style1/substyles/BannerSubstyle1.d.ts.map +0 -1
- package/dist/components/Style1/substyles/BannerSubstyle1.js +0 -52
- package/dist/components/Style1/substyles/BannerSubstyle2.d.ts +0 -12
- package/dist/components/Style1/substyles/BannerSubstyle2.d.ts.map +0 -1
- package/dist/components/Style1/substyles/BannerSubstyle2.js +0 -52
- package/dist/components/Style1/substyles/BannerSubstyle3.d.ts +0 -12
- package/dist/components/Style1/substyles/BannerSubstyle3.d.ts.map +0 -1
- package/dist/components/Style1/substyles/BannerSubstyle3.js +0 -61
- package/dist/components/Style1/substyles/index.d.ts +0 -7
- package/dist/components/Style1/substyles/index.d.ts.map +0 -1
- package/dist/components/Style1/substyles/index.js +0 -22
- package/dist/components/Style2/BannerStyle2.d.ts +0 -19
- package/dist/components/Style2/BannerStyle2.d.ts.map +0 -1
- package/dist/components/Style2/BannerStyle2.js +0 -32
- package/dist/components/Style2/substyles/BannerSubstyle1.d.ts +0 -12
- package/dist/components/Style2/substyles/BannerSubstyle1.d.ts.map +0 -1
- package/dist/components/Style2/substyles/BannerSubstyle1.js +0 -35
- package/dist/components/Style2/substyles/BannerSubstyle2.d.ts +0 -12
- package/dist/components/Style2/substyles/BannerSubstyle2.d.ts.map +0 -1
- package/dist/components/Style2/substyles/BannerSubstyle2.js +0 -35
- package/dist/components/Style2/substyles/BannerSubstyle3.d.ts +0 -12
- package/dist/components/Style2/substyles/BannerSubstyle3.d.ts.map +0 -1
- package/dist/components/Style2/substyles/BannerSubstyle3.js +0 -35
- package/dist/components/Style2/substyles/index.d.ts +0 -7
- package/dist/components/Style2/substyles/index.d.ts.map +0 -1
- package/dist/components/Style2/substyles/index.js +0 -22
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Platform-agnostic calculation utilities
|
|
4
|
+
* Common mathematical operations and conversions used across all banner styles
|
|
5
|
+
*/
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.lerp = exports.clamp = exports.percentStringToPixels = exports.parsePercent = exports.percentToPixels = exports.remToPixels = void 0;
|
|
8
|
+
const defaults_1 = require("../../../constants/defaults");
|
|
9
|
+
/**
|
|
10
|
+
* Convert rem units to pixels
|
|
11
|
+
* @param rem - Value in rem units
|
|
12
|
+
* @returns Value in pixels
|
|
13
|
+
*/
|
|
14
|
+
const remToPixels = (rem) => {
|
|
15
|
+
return rem * defaults_1.REM_TO_PIXELS;
|
|
16
|
+
};
|
|
17
|
+
exports.remToPixels = remToPixels;
|
|
18
|
+
/**
|
|
19
|
+
* Convert percentage to pixels based on container size
|
|
20
|
+
* @param percent - Percentage value (0-100)
|
|
21
|
+
* @param containerSize - Container size in pixels
|
|
22
|
+
* @returns Value in pixels
|
|
23
|
+
*/
|
|
24
|
+
const percentToPixels = (percent, containerSize) => {
|
|
25
|
+
return (percent / 100) * containerSize;
|
|
26
|
+
};
|
|
27
|
+
exports.percentToPixels = percentToPixels;
|
|
28
|
+
/**
|
|
29
|
+
* Parse a percentage string to a number
|
|
30
|
+
* @param percentString - String like "50%" or "10.5%"
|
|
31
|
+
* @returns Numeric percentage value (e.g., 50, 10.5)
|
|
32
|
+
*/
|
|
33
|
+
const parsePercent = (percentString) => {
|
|
34
|
+
return parseFloat(percentString.replace('%', ''));
|
|
35
|
+
};
|
|
36
|
+
exports.parsePercent = parsePercent;
|
|
37
|
+
/**
|
|
38
|
+
* Calculate the pixel position from a percentage string and container size
|
|
39
|
+
* @param percentString - String like "50%" or "10%"
|
|
40
|
+
* @param containerSize - Container size in pixels
|
|
41
|
+
* @returns Position in pixels
|
|
42
|
+
*/
|
|
43
|
+
const percentStringToPixels = (percentString, containerSize) => {
|
|
44
|
+
const percent = (0, exports.parsePercent)(percentString);
|
|
45
|
+
return (0, exports.percentToPixels)(percent, containerSize);
|
|
46
|
+
};
|
|
47
|
+
exports.percentStringToPixels = percentStringToPixels;
|
|
48
|
+
/**
|
|
49
|
+
* Clamp a value between min and max
|
|
50
|
+
* @param value - Value to clamp
|
|
51
|
+
* @param min - Minimum value
|
|
52
|
+
* @param max - Maximum value
|
|
53
|
+
* @returns Clamped value
|
|
54
|
+
*/
|
|
55
|
+
const clamp = (value, min, max) => {
|
|
56
|
+
return Math.min(Math.max(value, min), max);
|
|
57
|
+
};
|
|
58
|
+
exports.clamp = clamp;
|
|
59
|
+
/**
|
|
60
|
+
* Linear interpolation between two values
|
|
61
|
+
* @param start - Start value
|
|
62
|
+
* @param end - End value
|
|
63
|
+
* @param t - Interpolation factor (0-1)
|
|
64
|
+
* @returns Interpolated value
|
|
65
|
+
*/
|
|
66
|
+
const lerp = (start, end, t) => {
|
|
67
|
+
return start + (end - start) * t;
|
|
68
|
+
};
|
|
69
|
+
exports.lerp = lerp;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Default value utilities
|
|
3
|
+
* Provides helper functions for working with default values and fallbacks
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Get value with fallback to default
|
|
7
|
+
* @param value - Optional value
|
|
8
|
+
* @param defaultValue - Default value to use if value is undefined or null
|
|
9
|
+
* @returns Value or default
|
|
10
|
+
*/
|
|
11
|
+
export declare const getWithDefault: <T>(value: T | undefined | null, defaultValue: T) => T;
|
|
12
|
+
/**
|
|
13
|
+
* Get numeric value with fallback to default
|
|
14
|
+
* @param value - Optional numeric value
|
|
15
|
+
* @param defaultValue - Default numeric value
|
|
16
|
+
* @returns Number or default
|
|
17
|
+
*/
|
|
18
|
+
export declare const getNumberWithDefault: (value: number | undefined | null, defaultValue: number) => number;
|
|
19
|
+
/**
|
|
20
|
+
* Get string value with fallback to default
|
|
21
|
+
* @param value - Optional string value
|
|
22
|
+
* @param defaultValue - Default string value
|
|
23
|
+
* @returns String or default
|
|
24
|
+
*/
|
|
25
|
+
export declare const getStringWithDefault: (value: string | undefined | null, defaultValue: string) => string;
|
|
26
|
+
/**
|
|
27
|
+
* Get boolean value with fallback to default
|
|
28
|
+
* @param value - Optional boolean value
|
|
29
|
+
* @param defaultValue - Default boolean value
|
|
30
|
+
* @returns Boolean or default
|
|
31
|
+
*/
|
|
32
|
+
export declare const getBooleanWithDefault: (value: boolean | undefined | null, defaultValue: boolean) => boolean;
|
|
33
|
+
/**
|
|
34
|
+
* Merge two objects, with values from source overriding those in target
|
|
35
|
+
* @param target - Base object
|
|
36
|
+
* @param source - Object with override values
|
|
37
|
+
* @returns Merged object
|
|
38
|
+
*/
|
|
39
|
+
export declare const mergeDefaults: <T extends Record<string, any>>(target: T, source: Partial<T>) => T;
|
|
40
|
+
/**
|
|
41
|
+
* Parse a string value to float with fallback
|
|
42
|
+
* @param value - String to parse
|
|
43
|
+
* @param defaultValue - Default value if parsing fails
|
|
44
|
+
* @returns Parsed float or default
|
|
45
|
+
*/
|
|
46
|
+
export declare const parseFloatWithDefault: (value: string | undefined | null, defaultValue: number) => number;
|
|
47
|
+
/**
|
|
48
|
+
* Parse a string value to integer with fallback
|
|
49
|
+
* @param value - String to parse
|
|
50
|
+
* @param defaultValue - Default value if parsing fails
|
|
51
|
+
* @returns Parsed integer or default
|
|
52
|
+
*/
|
|
53
|
+
export declare const parseIntWithDefault: (value: string | undefined | null, defaultValue: number) => number;
|
|
54
|
+
//# sourceMappingURL=defaultsUtils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"defaultsUtils.d.ts","sourceRoot":"","sources":["../../../../src/components/styles/utils/defaultsUtils.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;GAKG;AACH,eAAO,MAAM,cAAc,GAAI,CAAC,EAAE,OAAO,CAAC,GAAG,SAAS,GAAG,IAAI,EAAE,cAAc,CAAC,KAAG,CAEhF,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,oBAAoB,GAAI,OAAO,MAAM,GAAG,SAAS,GAAG,IAAI,EAAE,cAAc,MAAM,KAAG,MAE7F,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,oBAAoB,GAAI,OAAO,MAAM,GAAG,SAAS,GAAG,IAAI,EAAE,cAAc,MAAM,KAAG,MAE7F,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,qBAAqB,GAAI,OAAO,OAAO,GAAG,SAAS,GAAG,IAAI,EAAE,cAAc,OAAO,KAAG,OAEhG,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,aAAa,GAAI,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,QAAQ,CAAC,EAAE,QAAQ,OAAO,CAAC,CAAC,CAAC,KAAG,CAE5F,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,qBAAqB,GAAI,OAAO,MAAM,GAAG,SAAS,GAAG,IAAI,EAAE,cAAc,MAAM,KAAG,MAI9F,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,mBAAmB,GAAI,OAAO,MAAM,GAAG,SAAS,GAAG,IAAI,EAAE,cAAc,MAAM,KAAG,MAI5F,CAAC"}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Default value utilities
|
|
4
|
+
* Provides helper functions for working with default values and fallbacks
|
|
5
|
+
*/
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.parseIntWithDefault = exports.parseFloatWithDefault = exports.mergeDefaults = exports.getBooleanWithDefault = exports.getStringWithDefault = exports.getNumberWithDefault = exports.getWithDefault = void 0;
|
|
8
|
+
/**
|
|
9
|
+
* Get value with fallback to default
|
|
10
|
+
* @param value - Optional value
|
|
11
|
+
* @param defaultValue - Default value to use if value is undefined or null
|
|
12
|
+
* @returns Value or default
|
|
13
|
+
*/
|
|
14
|
+
const getWithDefault = (value, defaultValue) => {
|
|
15
|
+
return value !== null && value !== void 0 ? value : defaultValue;
|
|
16
|
+
};
|
|
17
|
+
exports.getWithDefault = getWithDefault;
|
|
18
|
+
/**
|
|
19
|
+
* Get numeric value with fallback to default
|
|
20
|
+
* @param value - Optional numeric value
|
|
21
|
+
* @param defaultValue - Default numeric value
|
|
22
|
+
* @returns Number or default
|
|
23
|
+
*/
|
|
24
|
+
const getNumberWithDefault = (value, defaultValue) => {
|
|
25
|
+
return value !== null && value !== void 0 ? value : defaultValue;
|
|
26
|
+
};
|
|
27
|
+
exports.getNumberWithDefault = getNumberWithDefault;
|
|
28
|
+
/**
|
|
29
|
+
* Get string value with fallback to default
|
|
30
|
+
* @param value - Optional string value
|
|
31
|
+
* @param defaultValue - Default string value
|
|
32
|
+
* @returns String or default
|
|
33
|
+
*/
|
|
34
|
+
const getStringWithDefault = (value, defaultValue) => {
|
|
35
|
+
return value !== null && value !== void 0 ? value : defaultValue;
|
|
36
|
+
};
|
|
37
|
+
exports.getStringWithDefault = getStringWithDefault;
|
|
38
|
+
/**
|
|
39
|
+
* Get boolean value with fallback to default
|
|
40
|
+
* @param value - Optional boolean value
|
|
41
|
+
* @param defaultValue - Default boolean value
|
|
42
|
+
* @returns Boolean or default
|
|
43
|
+
*/
|
|
44
|
+
const getBooleanWithDefault = (value, defaultValue) => {
|
|
45
|
+
return value !== null && value !== void 0 ? value : defaultValue;
|
|
46
|
+
};
|
|
47
|
+
exports.getBooleanWithDefault = getBooleanWithDefault;
|
|
48
|
+
/**
|
|
49
|
+
* Merge two objects, with values from source overriding those in target
|
|
50
|
+
* @param target - Base object
|
|
51
|
+
* @param source - Object with override values
|
|
52
|
+
* @returns Merged object
|
|
53
|
+
*/
|
|
54
|
+
const mergeDefaults = (target, source) => {
|
|
55
|
+
return { ...target, ...source };
|
|
56
|
+
};
|
|
57
|
+
exports.mergeDefaults = mergeDefaults;
|
|
58
|
+
/**
|
|
59
|
+
* Parse a string value to float with fallback
|
|
60
|
+
* @param value - String to parse
|
|
61
|
+
* @param defaultValue - Default value if parsing fails
|
|
62
|
+
* @returns Parsed float or default
|
|
63
|
+
*/
|
|
64
|
+
const parseFloatWithDefault = (value, defaultValue) => {
|
|
65
|
+
if (value === undefined || value === null)
|
|
66
|
+
return defaultValue;
|
|
67
|
+
const parsed = parseFloat(value);
|
|
68
|
+
return isNaN(parsed) ? defaultValue : parsed;
|
|
69
|
+
};
|
|
70
|
+
exports.parseFloatWithDefault = parseFloatWithDefault;
|
|
71
|
+
/**
|
|
72
|
+
* Parse a string value to integer with fallback
|
|
73
|
+
* @param value - String to parse
|
|
74
|
+
* @param defaultValue - Default value if parsing fails
|
|
75
|
+
* @returns Parsed integer or default
|
|
76
|
+
*/
|
|
77
|
+
const parseIntWithDefault = (value, defaultValue) => {
|
|
78
|
+
if (value === undefined || value === null)
|
|
79
|
+
return defaultValue;
|
|
80
|
+
const parsed = parseInt(value, 10);
|
|
81
|
+
return isNaN(parsed) ? defaultValue : parsed;
|
|
82
|
+
};
|
|
83
|
+
exports.parseIntWithDefault = parseIntWithDefault;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Font size calculation utilities
|
|
3
|
+
* Handles font size calculations and conversions across all banner styles
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Calculate font size in rem units
|
|
7
|
+
* @param multiplier - Font size multiplier (e.g., 1.0 for base size, 1.5 for 150%)
|
|
8
|
+
* @param baseRem - Optional custom base size in rem (defaults to DEFAULT_BASE_FONT_SIZE_REM)
|
|
9
|
+
* @returns Font size in rem units as a string (e.g., "6rem")
|
|
10
|
+
*/
|
|
11
|
+
export declare const calculateFontSize: (multiplier: number, baseRem?: number) => string;
|
|
12
|
+
/**
|
|
13
|
+
* Calculate font sizes for multiple copies
|
|
14
|
+
* @param fontSizeMultipliers - Array of font size multipliers for each copy
|
|
15
|
+
* @param baseRem - Optional custom base size in rem
|
|
16
|
+
* @returns Array of font size strings
|
|
17
|
+
*/
|
|
18
|
+
export declare const calculateFontSizes: (fontSizeMultipliers: number[], baseRem?: number) => string[];
|
|
19
|
+
/**
|
|
20
|
+
* Convert font weight name to CSS font-weight value
|
|
21
|
+
* @param weight - Font weight name ('thin', 'normal', or 'bold')
|
|
22
|
+
* @returns CSS font-weight value as string
|
|
23
|
+
*/
|
|
24
|
+
export declare const getFontWeight: (weight: "thin" | "normal" | "bold") => string;
|
|
25
|
+
/**
|
|
26
|
+
* Get font size multiplier with fallback to default
|
|
27
|
+
* @param multiplier - Font size multiplier or undefined
|
|
28
|
+
* @param defaultMultiplier - Default multiplier to use if undefined (defaults to 1.0)
|
|
29
|
+
* @returns Font size multiplier
|
|
30
|
+
*/
|
|
31
|
+
export declare const getFontSizeMultiplier: (multiplier?: number, defaultMultiplier?: number) => number;
|
|
32
|
+
//# sourceMappingURL=fontSizeUtils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fontSizeUtils.d.ts","sourceRoot":"","sources":["../../../../src/components/styles/utils/fontSizeUtils.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH;;;;;GAKG;AACH,eAAO,MAAM,iBAAiB,GAAI,YAAY,MAAM,EAAE,UAAS,MAAmC,KAAG,MAEpG,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,kBAAkB,GAC7B,qBAAqB,MAAM,EAAE,EAC7B,UAAS,MAAmC,KAC3C,MAAM,EAER,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,aAAa,GAAI,QAAQ,MAAM,GAAG,QAAQ,GAAG,MAAM,KAAG,MAOlE,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,qBAAqB,GAAI,aAAa,MAAM,EAAE,oBAAmB,MAAY,KAAG,MAE5F,CAAC"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Font size calculation utilities
|
|
4
|
+
* Handles font size calculations and conversions across all banner styles
|
|
5
|
+
*/
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.getFontSizeMultiplier = exports.getFontWeight = exports.calculateFontSizes = exports.calculateFontSize = void 0;
|
|
8
|
+
const defaults_1 = require("../../../constants/defaults");
|
|
9
|
+
/**
|
|
10
|
+
* Calculate font size in rem units
|
|
11
|
+
* @param multiplier - Font size multiplier (e.g., 1.0 for base size, 1.5 for 150%)
|
|
12
|
+
* @param baseRem - Optional custom base size in rem (defaults to DEFAULT_BASE_FONT_SIZE_REM)
|
|
13
|
+
* @returns Font size in rem units as a string (e.g., "6rem")
|
|
14
|
+
*/
|
|
15
|
+
const calculateFontSize = (multiplier, baseRem = defaults_1.DEFAULT_BASE_FONT_SIZE_REM) => {
|
|
16
|
+
return `${baseRem * multiplier}rem`;
|
|
17
|
+
};
|
|
18
|
+
exports.calculateFontSize = calculateFontSize;
|
|
19
|
+
/**
|
|
20
|
+
* Calculate font sizes for multiple copies
|
|
21
|
+
* @param fontSizeMultipliers - Array of font size multipliers for each copy
|
|
22
|
+
* @param baseRem - Optional custom base size in rem
|
|
23
|
+
* @returns Array of font size strings
|
|
24
|
+
*/
|
|
25
|
+
const calculateFontSizes = (fontSizeMultipliers, baseRem = defaults_1.DEFAULT_BASE_FONT_SIZE_REM) => {
|
|
26
|
+
return fontSizeMultipliers.map(multiplier => (0, exports.calculateFontSize)(multiplier, baseRem));
|
|
27
|
+
};
|
|
28
|
+
exports.calculateFontSizes = calculateFontSizes;
|
|
29
|
+
/**
|
|
30
|
+
* Convert font weight name to CSS font-weight value
|
|
31
|
+
* @param weight - Font weight name ('thin', 'normal', or 'bold')
|
|
32
|
+
* @returns CSS font-weight value as string
|
|
33
|
+
*/
|
|
34
|
+
const getFontWeight = (weight) => {
|
|
35
|
+
switch (weight) {
|
|
36
|
+
case 'thin': return '300';
|
|
37
|
+
case 'normal': return '400';
|
|
38
|
+
case 'bold': return '700';
|
|
39
|
+
default: return '400';
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
exports.getFontWeight = getFontWeight;
|
|
43
|
+
/**
|
|
44
|
+
* Get font size multiplier with fallback to default
|
|
45
|
+
* @param multiplier - Font size multiplier or undefined
|
|
46
|
+
* @param defaultMultiplier - Default multiplier to use if undefined (defaults to 1.0)
|
|
47
|
+
* @returns Font size multiplier
|
|
48
|
+
*/
|
|
49
|
+
const getFontSizeMultiplier = (multiplier, defaultMultiplier = 1.0) => {
|
|
50
|
+
return multiplier !== null && multiplier !== void 0 ? multiplier : defaultMultiplier;
|
|
51
|
+
};
|
|
52
|
+
exports.getFontSizeMultiplier = getFontSizeMultiplier;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Auto-positioning utility functions
|
|
3
|
+
* Handles automatic positioning of elements relative to anchor elements
|
|
4
|
+
* Adapted for absolute positioning system (x, y coordinates from center)
|
|
5
|
+
*/
|
|
6
|
+
import { SubstyleConfig, AutoPositioningConfig } from '../types/substyleTypes';
|
|
7
|
+
/**
|
|
8
|
+
* Calculate auto-positioning offset for 'up' direction
|
|
9
|
+
* Target element will be positioned above the anchor with a gap
|
|
10
|
+
* @param gapRem - Gap in rem units
|
|
11
|
+
* @param anchorHeight - Height of anchor element in pixels
|
|
12
|
+
* @param targetHeight - Height of target element in pixels
|
|
13
|
+
* @param anchorHasCenterOrigin - Whether anchor is positioned from center (true) or top-left (false)
|
|
14
|
+
* @returns Offset in pixels (negative value to move up)
|
|
15
|
+
*/
|
|
16
|
+
export declare const calculateUpOffset: (gapRem: number, anchorHeight: number, targetHeight: number, anchorHasCenterOrigin: boolean) => number;
|
|
17
|
+
/**
|
|
18
|
+
* Calculate auto-positioning offset for 'down' direction
|
|
19
|
+
* Target element will be positioned below the anchor with a gap
|
|
20
|
+
* @param gapRem - Gap in rem units
|
|
21
|
+
* @param anchorHeight - Height of anchor element in pixels
|
|
22
|
+
* @param targetHeight - Height of target element in pixels
|
|
23
|
+
* @param anchorHasCenterOrigin - Whether anchor is positioned from center (true) or top-left (false)
|
|
24
|
+
* @returns Offset in pixels (positive value to move down)
|
|
25
|
+
*/
|
|
26
|
+
export declare const calculateDownOffset: (gapRem: number, anchorHeight: number, targetHeight: number, anchorHasCenterOrigin: boolean) => number;
|
|
27
|
+
/**
|
|
28
|
+
* Calculate auto-positioning offset based on direction
|
|
29
|
+
* Works with absolute positioning system where elements have x, y coordinates from center
|
|
30
|
+
* @param config - Substyle configuration
|
|
31
|
+
* @param autoConfig - Auto-positioning configuration
|
|
32
|
+
* @param anchorHeight - Height of anchor element in pixels
|
|
33
|
+
* @param targetHeight - Height of target element in pixels
|
|
34
|
+
* @param anchorHasCenterOrigin - Whether anchor is positioned from center (true) or top-left (false)
|
|
35
|
+
* @returns Offset in pixels (Y-axis only for now)
|
|
36
|
+
*/
|
|
37
|
+
export declare const calculateAutoPositionOffset: (config: SubstyleConfig, autoConfig: AutoPositioningConfig, anchorHeight: number, targetHeight: number, anchorHasCenterOrigin?: boolean) => number;
|
|
38
|
+
//# sourceMappingURL=positioningUtils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"positioningUtils.d.ts","sourceRoot":"","sources":["../../../../src/components/styles/utils/positioningUtils.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,cAAc,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AAG/E;;;;;;;;GAQG;AACH,eAAO,MAAM,iBAAiB,GAAI,QAAQ,MAAM,EAAE,cAAc,MAAM,EAAE,cAAc,MAAM,EAAE,uBAAuB,OAAO,KAAG,MAY9H,CAAC;AAEF;;;;;;;;GAQG;AACH,eAAO,MAAM,mBAAmB,GAAI,QAAQ,MAAM,EAAE,cAAc,MAAM,EAAE,cAAc,MAAM,EAAE,uBAAuB,OAAO,KAAG,MAYhI,CAAC;AAEF;;;;;;;;;GASG;AACH,eAAO,MAAM,2BAA2B,GACtC,QAAQ,cAAc,EACtB,YAAY,qBAAqB,EACjC,cAAc,MAAM,EACpB,cAAc,MAAM,EACpB,wBAAuB,OAAc,KACpC,MAYF,CAAC"}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Auto-positioning utility functions
|
|
4
|
+
* Handles automatic positioning of elements relative to anchor elements
|
|
5
|
+
* Adapted for absolute positioning system (x, y coordinates from center)
|
|
6
|
+
*/
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.calculateAutoPositionOffset = exports.calculateDownOffset = exports.calculateUpOffset = void 0;
|
|
9
|
+
const defaults_1 = require("../../../constants/defaults");
|
|
10
|
+
/**
|
|
11
|
+
* Calculate auto-positioning offset for 'up' direction
|
|
12
|
+
* Target element will be positioned above the anchor with a gap
|
|
13
|
+
* @param gapRem - Gap in rem units
|
|
14
|
+
* @param anchorHeight - Height of anchor element in pixels
|
|
15
|
+
* @param targetHeight - Height of target element in pixels
|
|
16
|
+
* @param anchorHasCenterOrigin - Whether anchor is positioned from center (true) or top-left (false)
|
|
17
|
+
* @returns Offset in pixels (negative value to move up)
|
|
18
|
+
*/
|
|
19
|
+
const calculateUpOffset = (gapRem, anchorHeight, targetHeight, anchorHasCenterOrigin) => {
|
|
20
|
+
const gapPixels = gapRem * defaults_1.REM_TO_PIXELS;
|
|
21
|
+
// Target always has centerOrigin=true (positioned from center)
|
|
22
|
+
const targetOffset = targetHeight / 2;
|
|
23
|
+
if (anchorHasCenterOrigin) {
|
|
24
|
+
// Anchor positioned from center: offset from center to center
|
|
25
|
+
return -((anchorHeight / 2) + gapPixels + targetOffset);
|
|
26
|
+
}
|
|
27
|
+
else {
|
|
28
|
+
// Anchor positioned from top-left: offset from top edge to center of target
|
|
29
|
+
return -(gapPixels + targetOffset);
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
exports.calculateUpOffset = calculateUpOffset;
|
|
33
|
+
/**
|
|
34
|
+
* Calculate auto-positioning offset for 'down' direction
|
|
35
|
+
* Target element will be positioned below the anchor with a gap
|
|
36
|
+
* @param gapRem - Gap in rem units
|
|
37
|
+
* @param anchorHeight - Height of anchor element in pixels
|
|
38
|
+
* @param targetHeight - Height of target element in pixels
|
|
39
|
+
* @param anchorHasCenterOrigin - Whether anchor is positioned from center (true) or top-left (false)
|
|
40
|
+
* @returns Offset in pixels (positive value to move down)
|
|
41
|
+
*/
|
|
42
|
+
const calculateDownOffset = (gapRem, anchorHeight, targetHeight, anchorHasCenterOrigin) => {
|
|
43
|
+
const gapPixels = gapRem * defaults_1.REM_TO_PIXELS;
|
|
44
|
+
// Target always has centerOrigin=true (positioned from center)
|
|
45
|
+
const targetOffset = targetHeight / 2;
|
|
46
|
+
if (anchorHasCenterOrigin) {
|
|
47
|
+
// Anchor positioned from center: offset from center to center
|
|
48
|
+
return (anchorHeight / 2) + gapPixels + targetOffset;
|
|
49
|
+
}
|
|
50
|
+
else {
|
|
51
|
+
// Anchor positioned from top-left: offset from bottom edge to center of target
|
|
52
|
+
return anchorHeight + gapPixels + targetOffset;
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
exports.calculateDownOffset = calculateDownOffset;
|
|
56
|
+
/**
|
|
57
|
+
* Calculate auto-positioning offset based on direction
|
|
58
|
+
* Works with absolute positioning system where elements have x, y coordinates from center
|
|
59
|
+
* @param config - Substyle configuration
|
|
60
|
+
* @param autoConfig - Auto-positioning configuration
|
|
61
|
+
* @param anchorHeight - Height of anchor element in pixels
|
|
62
|
+
* @param targetHeight - Height of target element in pixels
|
|
63
|
+
* @param anchorHasCenterOrigin - Whether anchor is positioned from center (true) or top-left (false)
|
|
64
|
+
* @returns Offset in pixels (Y-axis only for now)
|
|
65
|
+
*/
|
|
66
|
+
const calculateAutoPositionOffset = (config, autoConfig, anchorHeight, targetHeight, anchorHasCenterOrigin = true) => {
|
|
67
|
+
var _a;
|
|
68
|
+
const { direction } = autoConfig;
|
|
69
|
+
const gapRem = (_a = config.gapRem) !== null && _a !== void 0 ? _a : 0;
|
|
70
|
+
if (direction === 'up') {
|
|
71
|
+
return (0, exports.calculateUpOffset)(gapRem, anchorHeight, targetHeight, anchorHasCenterOrigin);
|
|
72
|
+
}
|
|
73
|
+
else if (direction === 'down') {
|
|
74
|
+
return (0, exports.calculateDownOffset)(gapRem, anchorHeight, targetHeight, anchorHasCenterOrigin);
|
|
75
|
+
}
|
|
76
|
+
// Note: left/right directions would need X-axis offset (not implemented yet, only Y-axis)
|
|
77
|
+
return 0;
|
|
78
|
+
};
|
|
79
|
+
exports.calculateAutoPositionOffset = calculateAutoPositionOffset;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared utility functions for substyle configurations
|
|
3
|
+
* Provides common getter and helper functions used across all styles
|
|
4
|
+
*/
|
|
5
|
+
import { SubstyleConfig } from '../types/substyleTypes';
|
|
6
|
+
/**
|
|
7
|
+
* Get configuration for a specific substyle with fallback to default
|
|
8
|
+
* @param configs - Record of substyle configurations
|
|
9
|
+
* @param substyle - Substyle number to retrieve
|
|
10
|
+
* @param defaultSubstyle - Default substyle to use if specified substyle not found (default: 1)
|
|
11
|
+
* @returns SubstyleConfig for the specified substyle
|
|
12
|
+
*/
|
|
13
|
+
export declare const getSubstyleConfig: (configs: Record<number, SubstyleConfig>, substyle: number, defaultSubstyle?: number) => SubstyleConfig;
|
|
14
|
+
//# sourceMappingURL=substyleUtils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"substyleUtils.d.ts","sourceRoot":"","sources":["../../../../src/components/styles/utils/substyleUtils.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAExD;;;;;;GAMG;AACH,eAAO,MAAM,iBAAiB,GAC5B,SAAS,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,EACvC,UAAU,MAAM,EAChB,kBAAiB,MAAU,KAC1B,cAEF,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Shared utility functions for substyle configurations
|
|
4
|
+
* Provides common getter and helper functions used across all styles
|
|
5
|
+
*/
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.getSubstyleConfig = void 0;
|
|
8
|
+
/**
|
|
9
|
+
* Get configuration for a specific substyle with fallback to default
|
|
10
|
+
* @param configs - Record of substyle configurations
|
|
11
|
+
* @param substyle - Substyle number to retrieve
|
|
12
|
+
* @param defaultSubstyle - Default substyle to use if specified substyle not found (default: 1)
|
|
13
|
+
* @returns SubstyleConfig for the specified substyle
|
|
14
|
+
*/
|
|
15
|
+
const getSubstyleConfig = (configs, substyle, defaultSubstyle = 1) => {
|
|
16
|
+
return configs[substyle] || configs[defaultSubstyle];
|
|
17
|
+
};
|
|
18
|
+
exports.getSubstyleConfig = getSubstyleConfig;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Utility functions for CSS transform operations
|
|
3
|
+
* Provides helpers for building transform strings for rotation, translation, etc.
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Build a translate transform string
|
|
7
|
+
* @param x - X translation in pixels
|
|
8
|
+
* @param y - Y translation in pixels
|
|
9
|
+
* @returns CSS transform string
|
|
10
|
+
*/
|
|
11
|
+
export declare const buildTranslateTransform: (x?: number, y?: number) => string;
|
|
12
|
+
/**
|
|
13
|
+
* Build a translateX transform string
|
|
14
|
+
* @param percent - X translation as percentage string (e.g., "-50%")
|
|
15
|
+
* @returns CSS transform string
|
|
16
|
+
*/
|
|
17
|
+
export declare const buildTranslateXTransform: (percent: string) => string;
|
|
18
|
+
/**
|
|
19
|
+
* Build a translateY transform string
|
|
20
|
+
* @param percent - Y translation as percentage string (e.g., "-50%")
|
|
21
|
+
* @returns CSS transform string
|
|
22
|
+
*/
|
|
23
|
+
export declare const buildTranslateYTransform: (percent: string) => string;
|
|
24
|
+
/**
|
|
25
|
+
* Build a rotate transform string
|
|
26
|
+
* @param degrees - Rotation in degrees
|
|
27
|
+
* @returns CSS transform string
|
|
28
|
+
*/
|
|
29
|
+
export declare const buildRotateTransform: (degrees: number) => string;
|
|
30
|
+
/**
|
|
31
|
+
* Combine multiple transform operations into a single transform string
|
|
32
|
+
* @param transforms - Array of transform strings
|
|
33
|
+
* @returns Combined CSS transform string
|
|
34
|
+
*/
|
|
35
|
+
export declare const combineTransforms: (...transforms: string[]) => string;
|
|
36
|
+
//# sourceMappingURL=transformUtils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transformUtils.d.ts","sourceRoot":"","sources":["../../../../src/components/styles/utils/transformUtils.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;GAKG;AACH,eAAO,MAAM,uBAAuB,GAAI,IAAG,MAAU,EAAE,IAAG,MAAU,KAAG,MAEtE,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,wBAAwB,GAAI,SAAS,MAAM,KAAG,MAE1D,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,wBAAwB,GAAI,SAAS,MAAM,KAAG,MAE1D,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,oBAAoB,GAAI,SAAS,MAAM,KAAG,MAEtD,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,iBAAiB,GAAI,GAAG,YAAY,MAAM,EAAE,KAAG,MAE3D,CAAC"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Utility functions for CSS transform operations
|
|
4
|
+
* Provides helpers for building transform strings for rotation, translation, etc.
|
|
5
|
+
*/
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.combineTransforms = exports.buildRotateTransform = exports.buildTranslateYTransform = exports.buildTranslateXTransform = exports.buildTranslateTransform = void 0;
|
|
8
|
+
/**
|
|
9
|
+
* Build a translate transform string
|
|
10
|
+
* @param x - X translation in pixels
|
|
11
|
+
* @param y - Y translation in pixels
|
|
12
|
+
* @returns CSS transform string
|
|
13
|
+
*/
|
|
14
|
+
const buildTranslateTransform = (x = 0, y = 0) => {
|
|
15
|
+
return `translate(${x}px, ${y}px)`;
|
|
16
|
+
};
|
|
17
|
+
exports.buildTranslateTransform = buildTranslateTransform;
|
|
18
|
+
/**
|
|
19
|
+
* Build a translateX transform string
|
|
20
|
+
* @param percent - X translation as percentage string (e.g., "-50%")
|
|
21
|
+
* @returns CSS transform string
|
|
22
|
+
*/
|
|
23
|
+
const buildTranslateXTransform = (percent) => {
|
|
24
|
+
return `translateX(${percent})`;
|
|
25
|
+
};
|
|
26
|
+
exports.buildTranslateXTransform = buildTranslateXTransform;
|
|
27
|
+
/**
|
|
28
|
+
* Build a translateY transform string
|
|
29
|
+
* @param percent - Y translation as percentage string (e.g., "-50%")
|
|
30
|
+
* @returns CSS transform string
|
|
31
|
+
*/
|
|
32
|
+
const buildTranslateYTransform = (percent) => {
|
|
33
|
+
return `translateY(${percent})`;
|
|
34
|
+
};
|
|
35
|
+
exports.buildTranslateYTransform = buildTranslateYTransform;
|
|
36
|
+
/**
|
|
37
|
+
* Build a rotate transform string
|
|
38
|
+
* @param degrees - Rotation in degrees
|
|
39
|
+
* @returns CSS transform string
|
|
40
|
+
*/
|
|
41
|
+
const buildRotateTransform = (degrees) => {
|
|
42
|
+
return `rotate(${degrees}deg)`;
|
|
43
|
+
};
|
|
44
|
+
exports.buildRotateTransform = buildRotateTransform;
|
|
45
|
+
/**
|
|
46
|
+
* Combine multiple transform operations into a single transform string
|
|
47
|
+
* @param transforms - Array of transform strings
|
|
48
|
+
* @returns Combined CSS transform string
|
|
49
|
+
*/
|
|
50
|
+
const combineTransforms = (...transforms) => {
|
|
51
|
+
return transforms.filter(Boolean).join(' ');
|
|
52
|
+
};
|
|
53
|
+
exports.combineTransforms = combineTransforms;
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Recommended character limits for optimal display in banner styles
|
|
3
|
+
* Based on maxLengthThreshold values used in font size calculations
|
|
4
|
+
*/
|
|
5
|
+
export interface StyleCharacterLimits {
|
|
6
|
+
copy1: number;
|
|
7
|
+
copy2?: number;
|
|
8
|
+
copyCount: number;
|
|
9
|
+
}
|
|
10
|
+
export interface BannerConfig {
|
|
11
|
+
copy1: {
|
|
12
|
+
supported: true;
|
|
13
|
+
characterLimit: number;
|
|
14
|
+
isOptional: boolean;
|
|
15
|
+
};
|
|
16
|
+
copy2?: {
|
|
17
|
+
supported: boolean;
|
|
18
|
+
characterLimit?: number;
|
|
19
|
+
isOptional?: boolean;
|
|
20
|
+
};
|
|
21
|
+
fontSize_01: {
|
|
22
|
+
supported: true;
|
|
23
|
+
};
|
|
24
|
+
fontSize_02?: {
|
|
25
|
+
supported: boolean;
|
|
26
|
+
};
|
|
27
|
+
logoUrl: {
|
|
28
|
+
supported: true;
|
|
29
|
+
};
|
|
30
|
+
backgroundImageUrl: {
|
|
31
|
+
supported: true;
|
|
32
|
+
};
|
|
33
|
+
overlayIntensityMultiplier: {
|
|
34
|
+
supported: true;
|
|
35
|
+
};
|
|
36
|
+
shadowIntensityMultiplier: {
|
|
37
|
+
supported: boolean;
|
|
38
|
+
};
|
|
39
|
+
logoSizeMultiplier: {
|
|
40
|
+
supported: true;
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
export interface CharacterLimitsConfig {
|
|
44
|
+
[styleNumber: number]: {
|
|
45
|
+
[substyleNumber: number]: StyleCharacterLimits;
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
export interface BannerConfigMap {
|
|
49
|
+
[styleNumber: number]: {
|
|
50
|
+
[substyleNumber: number]: BannerConfig;
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Recommended character limits for each style and substyle
|
|
55
|
+
* These numbers represent the optimal text length for best visual appearance
|
|
56
|
+
* Updated for 4 styles with 3 substyles each
|
|
57
|
+
*/
|
|
58
|
+
export declare const RECOMMENDED_CHARACTER_LIMITS: CharacterLimitsConfig;
|
|
59
|
+
/**
|
|
60
|
+
* Get recommended character limits for a specific style and substyle
|
|
61
|
+
* @param styleNumber - Banner style number (1-4)
|
|
62
|
+
* @param substyleNumber - Banner substyle number (1-3)
|
|
63
|
+
* @returns Character limits object or null if not found
|
|
64
|
+
*/
|
|
65
|
+
export declare const getCharacterLimits: (styleNumber: number, substyleNumber: number) => StyleCharacterLimits | null;
|
|
66
|
+
/**
|
|
67
|
+
* Complete banner configuration for all style combinations
|
|
68
|
+
* Defines which props each style supports and their character limits
|
|
69
|
+
* Updated for 4 styles with 3 substyles each
|
|
70
|
+
*/
|
|
71
|
+
export declare const BANNER_CONFIGURATIONS: BannerConfigMap;
|
|
72
|
+
/**
|
|
73
|
+
* Get complete banner configuration for a specific style combination
|
|
74
|
+
* @param styleNumber - Banner style number (1-4)
|
|
75
|
+
* @param substyleNumber - Banner substyle number (1-3)
|
|
76
|
+
* @returns Complete banner configuration or null if not found
|
|
77
|
+
*/
|
|
78
|
+
export declare const getBannerConfig: (styleNumber: number, substyleNumber: number) => BannerConfig | null;
|
|
79
|
+
/**
|
|
80
|
+
* Check if text exceeds recommended limits
|
|
81
|
+
* @param text - Text to check
|
|
82
|
+
* @param limit - Character limit
|
|
83
|
+
* @returns true if text exceeds limit
|
|
84
|
+
*/
|
|
85
|
+
export declare const exceedsLimit: (text: string | undefined, limit: number) => boolean;
|
|
86
|
+
/**
|
|
87
|
+
* Get all available style numbers
|
|
88
|
+
* @returns Array of available style numbers
|
|
89
|
+
*/
|
|
90
|
+
export declare const getAvailableStyles: () => number[];
|
|
91
|
+
/**
|
|
92
|
+
* Get all available substyle numbers for a given style
|
|
93
|
+
* @param styleNumber - Banner style number
|
|
94
|
+
* @returns Array of available substyle numbers for that style
|
|
95
|
+
*/
|
|
96
|
+
export declare const getAvailableSubstyles: (styleNumber: number) => number[];
|
|
97
|
+
//# sourceMappingURL=characterLimits.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"characterLimits.d.ts","sourceRoot":"","sources":["../../src/constants/characterLimits.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,WAAW,oBAAoB;IACnC,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE;QAAE,SAAS,EAAE,IAAI,CAAC;QAAC,cAAc,EAAE,MAAM,CAAC;QAAC,UAAU,EAAE,OAAO,CAAA;KAAE,CAAC;IACxE,KAAK,CAAC,EAAE;QAAE,SAAS,EAAE,OAAO,CAAC;QAAC,cAAc,CAAC,EAAE,MAAM,CAAC;QAAC,UAAU,CAAC,EAAE,OAAO,CAAA;KAAE,CAAC;IAC9E,WAAW,EAAE;QAAE,SAAS,EAAE,IAAI,CAAA;KAAE,CAAC;IACjC,WAAW,CAAC,EAAE;QAAE,SAAS,EAAE,OAAO,CAAA;KAAE,CAAC;IACrC,OAAO,EAAE;QAAE,SAAS,EAAE,IAAI,CAAA;KAAE,CAAC;IAC7B,kBAAkB,EAAE;QAAE,SAAS,EAAE,IAAI,CAAA;KAAE,CAAC;IACxC,0BAA0B,EAAE;QAAE,SAAS,EAAE,IAAI,CAAA;KAAE,CAAC;IAChD,yBAAyB,EAAE;QAAE,SAAS,EAAE,OAAO,CAAA;KAAE,CAAC;IAClD,kBAAkB,EAAE;QAAE,SAAS,EAAE,IAAI,CAAA;KAAE,CAAC;CACzC;AAED,MAAM,WAAW,qBAAqB;IACpC,CAAC,WAAW,EAAE,MAAM,GAAG;QACrB,CAAC,cAAc,EAAE,MAAM,GAAG,oBAAoB,CAAC;KAChD,CAAC;CACH;AAED,MAAM,WAAW,eAAe;IAC9B,CAAC,WAAW,EAAE,MAAM,GAAG;QACrB,CAAC,cAAc,EAAE,MAAM,GAAG,YAAY,CAAC;KACxC,CAAC;CACH;AAED;;;;GAIG;AACH,eAAO,MAAM,4BAA4B,EAAE,qBAqB1C,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,kBAAkB,GAC7B,aAAa,MAAM,EACnB,gBAAgB,MAAM,KACrB,oBAAoB,GAAG,IAEzB,CAAC;AA4BF;;;;GAIG;AACH,eAAO,MAAM,qBAAqB,EAAE,eAyBnC,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,eAAe,GAC1B,aAAa,MAAM,EACnB,gBAAgB,MAAM,KACrB,YAAY,GAAG,IAEjB,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,YAAY,GAAI,MAAM,MAAM,GAAG,SAAS,EAAE,OAAO,MAAM,KAAG,OAItE,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,kBAAkB,QAAO,MAAM,EAE3C,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,qBAAqB,GAAI,aAAa,MAAM,KAAG,MAAM,EAIjE,CAAC"}
|