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.
Files changed (98) hide show
  1. package/dist/components/BannerRenderer.d.ts +48 -0
  2. package/dist/components/BannerRenderer.d.ts.map +1 -0
  3. package/dist/components/BannerRenderer.js +449 -0
  4. package/dist/components/BannerVisor.d.ts.map +1 -1
  5. package/dist/components/BannerVisor.js +132 -18
  6. package/dist/components/index.d.ts +1 -2
  7. package/dist/components/index.d.ts.map +1 -1
  8. package/dist/components/index.js +4 -2
  9. package/dist/components/shared/DraggableElement.d.ts +31 -0
  10. package/dist/components/shared/DraggableElement.d.ts.map +1 -0
  11. package/dist/components/shared/DraggableElement.js +367 -0
  12. package/dist/components/shared/index.d.ts +7 -0
  13. package/dist/components/shared/index.d.ts.map +1 -0
  14. package/dist/components/shared/index.js +9 -0
  15. package/dist/components/styles/Style1/substyleConfig.d.ts +20 -0
  16. package/dist/components/styles/Style1/substyleConfig.d.ts.map +1 -0
  17. package/dist/components/styles/Style1/substyleConfig.js +105 -0
  18. package/dist/components/styles/Style2/substyleConfig.d.ts +20 -0
  19. package/dist/components/styles/Style2/substyleConfig.d.ts.map +1 -0
  20. package/dist/components/styles/Style2/substyleConfig.js +133 -0
  21. package/dist/components/styles/Style3/substyleConfig.d.ts +20 -0
  22. package/dist/components/styles/Style3/substyleConfig.d.ts.map +1 -0
  23. package/dist/components/styles/Style3/substyleConfig.js +91 -0
  24. package/dist/components/styles/Style4/substyleConfig.d.ts +20 -0
  25. package/dist/components/styles/Style4/substyleConfig.d.ts.map +1 -0
  26. package/dist/components/styles/Style4/substyleConfig.js +112 -0
  27. package/dist/components/styles/types/substyleTypes.d.ts +68 -0
  28. package/dist/components/styles/types/substyleTypes.d.ts.map +1 -0
  29. package/dist/components/styles/types/substyleTypes.js +6 -0
  30. package/dist/components/styles/utils/calculations.d.ts +47 -0
  31. package/dist/components/styles/utils/calculations.d.ts.map +1 -0
  32. package/dist/components/styles/utils/calculations.js +69 -0
  33. package/dist/components/styles/utils/defaultsUtils.d.ts +54 -0
  34. package/dist/components/styles/utils/defaultsUtils.d.ts.map +1 -0
  35. package/dist/components/styles/utils/defaultsUtils.js +83 -0
  36. package/dist/components/styles/utils/fontSizeUtils.d.ts +32 -0
  37. package/dist/components/styles/utils/fontSizeUtils.d.ts.map +1 -0
  38. package/dist/components/styles/utils/fontSizeUtils.js +52 -0
  39. package/dist/components/styles/utils/positioningUtils.d.ts +38 -0
  40. package/dist/components/styles/utils/positioningUtils.d.ts.map +1 -0
  41. package/dist/components/styles/utils/positioningUtils.js +79 -0
  42. package/dist/components/styles/utils/substyleUtils.d.ts +14 -0
  43. package/dist/components/styles/utils/substyleUtils.d.ts.map +1 -0
  44. package/dist/components/styles/utils/substyleUtils.js +18 -0
  45. package/dist/components/styles/utils/transformUtils.d.ts +36 -0
  46. package/dist/components/styles/utils/transformUtils.d.ts.map +1 -0
  47. package/dist/components/styles/utils/transformUtils.js +53 -0
  48. package/dist/constants/characterLimits.d.ts +97 -0
  49. package/dist/constants/characterLimits.d.ts.map +1 -0
  50. package/dist/constants/characterLimits.js +144 -0
  51. package/dist/constants/defaults.d.ts +19 -0
  52. package/dist/constants/defaults.d.ts.map +1 -0
  53. package/dist/constants/defaults.js +27 -0
  54. package/dist/constants/index.d.ts +2 -0
  55. package/dist/constants/index.d.ts.map +1 -1
  56. package/dist/constants/index.js +2 -0
  57. package/dist/constants/styleConfigs.d.ts.map +1 -1
  58. package/dist/constants/styleConfigs.js +13 -7
  59. package/dist/index.d.ts +8 -0
  60. package/dist/index.d.ts.map +1 -1
  61. package/dist/index.js +12 -0
  62. package/dist/styleConfig.d.ts +40 -0
  63. package/dist/styleConfig.d.ts.map +1 -0
  64. package/dist/styleConfig.js +115 -0
  65. package/dist/styles/shadowUtils.js +4 -4
  66. package/dist/types.d.ts +149 -1
  67. package/dist/types.d.ts.map +1 -1
  68. package/package.json +10 -9
  69. package/dist/components/Style1/BannerStyle1.d.ts +0 -19
  70. package/dist/components/Style1/BannerStyle1.d.ts.map +0 -1
  71. package/dist/components/Style1/BannerStyle1.js +0 -27
  72. package/dist/components/Style1/substyles/BannerSubstyle1.d.ts +0 -12
  73. package/dist/components/Style1/substyles/BannerSubstyle1.d.ts.map +0 -1
  74. package/dist/components/Style1/substyles/BannerSubstyle1.js +0 -52
  75. package/dist/components/Style1/substyles/BannerSubstyle2.d.ts +0 -12
  76. package/dist/components/Style1/substyles/BannerSubstyle2.d.ts.map +0 -1
  77. package/dist/components/Style1/substyles/BannerSubstyle2.js +0 -52
  78. package/dist/components/Style1/substyles/BannerSubstyle3.d.ts +0 -12
  79. package/dist/components/Style1/substyles/BannerSubstyle3.d.ts.map +0 -1
  80. package/dist/components/Style1/substyles/BannerSubstyle3.js +0 -61
  81. package/dist/components/Style1/substyles/index.d.ts +0 -7
  82. package/dist/components/Style1/substyles/index.d.ts.map +0 -1
  83. package/dist/components/Style1/substyles/index.js +0 -22
  84. package/dist/components/Style2/BannerStyle2.d.ts +0 -19
  85. package/dist/components/Style2/BannerStyle2.d.ts.map +0 -1
  86. package/dist/components/Style2/BannerStyle2.js +0 -32
  87. package/dist/components/Style2/substyles/BannerSubstyle1.d.ts +0 -12
  88. package/dist/components/Style2/substyles/BannerSubstyle1.d.ts.map +0 -1
  89. package/dist/components/Style2/substyles/BannerSubstyle1.js +0 -35
  90. package/dist/components/Style2/substyles/BannerSubstyle2.d.ts +0 -12
  91. package/dist/components/Style2/substyles/BannerSubstyle2.d.ts.map +0 -1
  92. package/dist/components/Style2/substyles/BannerSubstyle2.js +0 -35
  93. package/dist/components/Style2/substyles/BannerSubstyle3.d.ts +0 -12
  94. package/dist/components/Style2/substyles/BannerSubstyle3.d.ts.map +0 -1
  95. package/dist/components/Style2/substyles/BannerSubstyle3.js +0 -35
  96. package/dist/components/Style2/substyles/index.d.ts +0 -7
  97. package/dist/components/Style2/substyles/index.d.ts.map +0 -1
  98. package/dist/components/Style2/substyles/index.js +0 -22
@@ -0,0 +1,144 @@
1
+ "use strict";
2
+ /**
3
+ * Recommended character limits for optimal display in banner styles
4
+ * Based on maxLengthThreshold values used in font size calculations
5
+ */
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+ exports.getAvailableSubstyles = exports.getAvailableStyles = exports.exceedsLimit = exports.getBannerConfig = exports.BANNER_CONFIGURATIONS = exports.getCharacterLimits = exports.RECOMMENDED_CHARACTER_LIMITS = void 0;
8
+ /**
9
+ * Recommended character limits for each style and substyle
10
+ * These numbers represent the optimal text length for best visual appearance
11
+ * Updated for 4 styles with 3 substyles each
12
+ */
13
+ exports.RECOMMENDED_CHARACTER_LIMITS = {
14
+ 1: {
15
+ 1: { copy1: 40, copy2: 40, copyCount: 2 },
16
+ 2: { copy1: 40, copy2: 40, copyCount: 2 },
17
+ 3: { copy1: 40, copy2: 40, copyCount: 2 }
18
+ },
19
+ 2: {
20
+ 1: { copy1: 35, copy2: 35, copyCount: 2 },
21
+ 2: { copy1: 35, copy2: 35, copyCount: 2 },
22
+ 3: { copy1: 35, copy2: 35, copyCount: 2 }
23
+ },
24
+ 3: {
25
+ 1: { copy1: 40, copyCount: 1 },
26
+ 2: { copy1: 40, copyCount: 1 },
27
+ 3: { copy1: 40, copyCount: 1 }
28
+ },
29
+ 4: {
30
+ 1: { copy1: 35, copy2: 35, copyCount: 2 },
31
+ 2: { copy1: 35, copy2: 35, copyCount: 2 },
32
+ 3: { copy1: 35, copy2: 35, copyCount: 2 }
33
+ }
34
+ };
35
+ /**
36
+ * Get recommended character limits for a specific style and substyle
37
+ * @param styleNumber - Banner style number (1-4)
38
+ * @param substyleNumber - Banner substyle number (1-3)
39
+ * @returns Character limits object or null if not found
40
+ */
41
+ const getCharacterLimits = (styleNumber, substyleNumber) => {
42
+ var _a;
43
+ return ((_a = exports.RECOMMENDED_CHARACTER_LIMITS[styleNumber]) === null || _a === void 0 ? void 0 : _a[substyleNumber]) || null;
44
+ };
45
+ exports.getCharacterLimits = getCharacterLimits;
46
+ // Helper to create a single copy1-only config
47
+ const createCopy1OnlyConfig = (characterLimit, isOptional = true) => ({
48
+ copy1: { supported: true, characterLimit, isOptional },
49
+ copy2: { supported: false },
50
+ fontSize_01: { supported: true },
51
+ fontSize_02: { supported: false },
52
+ logoUrl: { supported: true },
53
+ backgroundImageUrl: { supported: true },
54
+ overlayIntensityMultiplier: { supported: true },
55
+ shadowIntensityMultiplier: { supported: false },
56
+ logoSizeMultiplier: { supported: true },
57
+ });
58
+ // Helper to create a dual copy config
59
+ const createDualCopyConfig = (characterLimit) => ({
60
+ copy1: { supported: true, characterLimit, isOptional: true },
61
+ copy2: { supported: true, characterLimit, isOptional: true },
62
+ fontSize_01: { supported: true },
63
+ fontSize_02: { supported: true },
64
+ logoUrl: { supported: true },
65
+ backgroundImageUrl: { supported: true },
66
+ overlayIntensityMultiplier: { supported: true },
67
+ shadowIntensityMultiplier: { supported: true },
68
+ logoSizeMultiplier: { supported: true },
69
+ });
70
+ /**
71
+ * Complete banner configuration for all style combinations
72
+ * Defines which props each style supports and their character limits
73
+ * Updated for 4 styles with 3 substyles each
74
+ */
75
+ exports.BANNER_CONFIGURATIONS = {
76
+ // Style 1: Uses copy1 and copy2 (from old Style1/Substyle1)
77
+ 1: {
78
+ 1: createDualCopyConfig(40),
79
+ 2: createDualCopyConfig(40),
80
+ 3: createDualCopyConfig(40),
81
+ },
82
+ // Style 2: Uses copy1 and copy2 (from old Style1/Substyle2)
83
+ 2: {
84
+ 1: createDualCopyConfig(35),
85
+ 2: createDualCopyConfig(35),
86
+ 3: createDualCopyConfig(35),
87
+ },
88
+ // Style 3: Only copy1 (from old Style2/Substyle1)
89
+ 3: {
90
+ 1: createCopy1OnlyConfig(40),
91
+ 2: createCopy1OnlyConfig(40),
92
+ 3: createCopy1OnlyConfig(40),
93
+ },
94
+ // Style 4: All substyles use dual copy
95
+ 4: {
96
+ 1: createDualCopyConfig(35),
97
+ 2: createDualCopyConfig(35),
98
+ 3: createDualCopyConfig(35),
99
+ },
100
+ };
101
+ /**
102
+ * Get complete banner configuration for a specific style combination
103
+ * @param styleNumber - Banner style number (1-4)
104
+ * @param substyleNumber - Banner substyle number (1-3)
105
+ * @returns Complete banner configuration or null if not found
106
+ */
107
+ const getBannerConfig = (styleNumber, substyleNumber) => {
108
+ var _a;
109
+ return ((_a = exports.BANNER_CONFIGURATIONS[styleNumber]) === null || _a === void 0 ? void 0 : _a[substyleNumber]) || null;
110
+ };
111
+ exports.getBannerConfig = getBannerConfig;
112
+ /**
113
+ * Check if text exceeds recommended limits
114
+ * @param text - Text to check
115
+ * @param limit - Character limit
116
+ * @returns true if text exceeds limit
117
+ */
118
+ const exceedsLimit = (text, limit) => {
119
+ if (!text)
120
+ return false;
121
+ // Count characters excluding spaces (same logic as font calculation)
122
+ return text.replace(/\s/g, "").length > limit;
123
+ };
124
+ exports.exceedsLimit = exceedsLimit;
125
+ /**
126
+ * Get all available style numbers
127
+ * @returns Array of available style numbers
128
+ */
129
+ const getAvailableStyles = () => {
130
+ return Object.keys(exports.BANNER_CONFIGURATIONS).map(Number).sort((a, b) => a - b);
131
+ };
132
+ exports.getAvailableStyles = getAvailableStyles;
133
+ /**
134
+ * Get all available substyle numbers for a given style
135
+ * @param styleNumber - Banner style number
136
+ * @returns Array of available substyle numbers for that style
137
+ */
138
+ const getAvailableSubstyles = (styleNumber) => {
139
+ const styleConfig = exports.BANNER_CONFIGURATIONS[styleNumber];
140
+ if (!styleConfig)
141
+ return [];
142
+ return Object.keys(styleConfig).map(Number).sort((a, b) => a - b);
143
+ };
144
+ exports.getAvailableSubstyles = getAvailableSubstyles;
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Default copy configuration values
3
+ * Used when creating new copies in the playground and other contexts
4
+ */
5
+ export declare const REM_TO_PIXELS = 16;
6
+ export declare const DEFAULT_COPY_FONTSIZE = 1;
7
+ export declare const DEFAULT_COPY_ALIGN: "center";
8
+ export declare const DEFAULT_COPY_FONTWEIGHT: "normal";
9
+ export declare const DEFAULT_COPY_TRANSLATE_X = 0;
10
+ export declare const DEFAULT_COPY_TRANSLATE_Y = 0;
11
+ export declare const DEFAULT_COPY_ROTATION = 0;
12
+ export declare const DEFAULT_BASE_FONT_SIZE_REM = 6;
13
+ export declare const DEFAULT_COPY_TEXT = "Lorem ipsum dolor sit amet, consectetur adipiscing elit";
14
+ export declare const DEFAULT_LOGO_TRANSLATE_X = 0;
15
+ export declare const DEFAULT_LOGO_TRANSLATE_Y = 0;
16
+ export declare const DEFAULT_LOGO_ROTATION = 0;
17
+ export declare const DEFAULT_LOGO_WIDTH: undefined;
18
+ export declare const DEFAULT_LOGO_SIZE_REM = 13.8;
19
+ //# sourceMappingURL=defaults.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"defaults.d.ts","sourceRoot":"","sources":["../../src/constants/defaults.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,eAAO,MAAM,aAAa,KAAK,CAAC;AAGhC,eAAO,MAAM,qBAAqB,IAAM,CAAC;AACzC,eAAO,MAAM,kBAAkB,EAAG,QAAiB,CAAC;AACpD,eAAO,MAAM,uBAAuB,EAAG,QAAiB,CAAC;AACzD,eAAO,MAAM,wBAAwB,IAAI,CAAC;AAC1C,eAAO,MAAM,wBAAwB,IAAI,CAAC;AAC1C,eAAO,MAAM,qBAAqB,IAAI,CAAC;AAGvC,eAAO,MAAM,0BAA0B,IAAM,CAAC;AAG9C,eAAO,MAAM,iBAAiB,4DAA4D,CAAC;AAG3F,eAAO,MAAM,wBAAwB,IAAI,CAAC;AAC1C,eAAO,MAAM,wBAAwB,IAAI,CAAC;AAC1C,eAAO,MAAM,qBAAqB,IAAI,CAAC;AACvC,eAAO,MAAM,kBAAkB,WAAY,CAAC;AAG5C,eAAO,MAAM,qBAAqB,OAAO,CAAC"}
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+ /**
3
+ * Default copy configuration values
4
+ * Used when creating new copies in the playground and other contexts
5
+ */
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+ exports.DEFAULT_LOGO_SIZE_REM = exports.DEFAULT_LOGO_WIDTH = exports.DEFAULT_LOGO_ROTATION = exports.DEFAULT_LOGO_TRANSLATE_Y = exports.DEFAULT_LOGO_TRANSLATE_X = exports.DEFAULT_COPY_TEXT = exports.DEFAULT_BASE_FONT_SIZE_REM = exports.DEFAULT_COPY_ROTATION = exports.DEFAULT_COPY_TRANSLATE_Y = exports.DEFAULT_COPY_TRANSLATE_X = exports.DEFAULT_COPY_FONTWEIGHT = exports.DEFAULT_COPY_ALIGN = exports.DEFAULT_COPY_FONTSIZE = exports.REM_TO_PIXELS = void 0;
8
+ // Conversion constants
9
+ exports.REM_TO_PIXELS = 16; // 1rem = 16px
10
+ // Default copy configuration values
11
+ exports.DEFAULT_COPY_FONTSIZE = 1.0;
12
+ exports.DEFAULT_COPY_ALIGN = 'center';
13
+ exports.DEFAULT_COPY_FONTWEIGHT = 'normal';
14
+ exports.DEFAULT_COPY_TRANSLATE_X = 0;
15
+ exports.DEFAULT_COPY_TRANSLATE_Y = 0;
16
+ exports.DEFAULT_COPY_ROTATION = 0;
17
+ // Base font size in rem - this is the actual size when fontSize multiplier is 1.0
18
+ exports.DEFAULT_BASE_FONT_SIZE_REM = 6.0;
19
+ // Default lorem ipsum text for new copies
20
+ exports.DEFAULT_COPY_TEXT = "Lorem ipsum dolor sit amet, consectetur adipiscing elit";
21
+ // Default logo configuration values
22
+ exports.DEFAULT_LOGO_TRANSLATE_X = 0;
23
+ exports.DEFAULT_LOGO_TRANSLATE_Y = 0;
24
+ exports.DEFAULT_LOGO_ROTATION = 0;
25
+ exports.DEFAULT_LOGO_WIDTH = undefined;
26
+ // Base logo size in rem - used across all styles and substyles
27
+ exports.DEFAULT_LOGO_SIZE_REM = 13.8; // 15% larger than original 12rem
@@ -2,4 +2,6 @@
2
2
  * Constants exports
3
3
  */
4
4
  export * from './styleConfigs';
5
+ export * from './characterLimits';
6
+ export * from './defaults';
5
7
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/constants/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,cAAc,gBAAgB,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"}
@@ -18,3 +18,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
18
18
  };
19
19
  Object.defineProperty(exports, "__esModule", { value: true });
20
20
  __exportStar(require("./styleConfigs"), exports);
21
+ __exportStar(require("./characterLimits"), exports);
22
+ __exportStar(require("./defaults"), exports);
@@ -1 +1 @@
1
- {"version":3,"file":"styleConfigs.d.ts","sourceRoot":"","sources":["../../src/constants/styleConfigs.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAEhD,eAAO,MAAM,kBAAkB,EAAE,MAAM,CAAC,MAAM,EAAE,eAAe,CAa9D,CAAC;AAGF,eAAO,MAAM,oBAAoB,OAAO,CAAC;AACzC,eAAO,MAAM,qBAAqB,OAAO,CAAC;AAG1C,eAAO,MAAM,mBAAmB,OAAO,CAAC;AACxC,eAAO,MAAM,oBAAoB,OAAO,CAAC"}
1
+ {"version":3,"file":"styleConfigs.d.ts","sourceRoot":"","sources":["../../src/constants/styleConfigs.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAEhD,eAAO,MAAM,kBAAkB,EAAE,MAAM,CAAC,MAAM,EAAE,eAAe,CAmB9D,CAAC;AAGF,eAAO,MAAM,oBAAoB,OAAO,CAAC;AACzC,eAAO,MAAM,qBAAqB,OAAO,CAAC;AAG1C,eAAO,MAAM,mBAAmB,OAAO,CAAC;AACxC,eAAO,MAAM,oBAAoB,OAAO,CAAC"}
@@ -7,16 +7,22 @@ Object.defineProperty(exports, "__esModule", { value: true });
7
7
  exports.DEFAULT_STORY_HEIGHT = exports.DEFAULT_STORY_WIDTH = exports.DEFAULT_BANNER_HEIGHT = exports.DEFAULT_BANNER_WIDTH = exports.STYLE_FONT_CONFIGS = void 0;
8
8
  exports.STYLE_FONT_CONFIGS = {
9
9
  1: {
10
- baseSizeRem1: 2.5, // Base size for copy1 in rem
11
- baseSizeRem2: 1.8, // Base size for copy2 in rem
12
- maxLengthThreshold: 30,
13
- reductionFactor: 0.05
10
+ baseSizeRem1: 4.8, // Base size for copy1 in rem (from old Style1/Substyle1)
11
+ baseSizeRem2: 4.8, // Base size for copy2 in rem
12
+ maxLengthThreshold: 40,
13
+ reductionFactor: 0.15
14
14
  },
15
15
  2: {
16
- baseSizeRem1: 2.2, // Base size for copy1 in rem
17
- baseSizeRem2: 1.6, // Base size for copy2 in rem
16
+ baseSizeRem1: 3.8, // Base size for copy1 in rem (from old Style1/Substyle2)
17
+ baseSizeRem2: 4.0, // Base size for copy2 in rem
18
18
  maxLengthThreshold: 35,
19
- reductionFactor: 0.04
19
+ reductionFactor: 0.18
20
+ },
21
+ 3: {
22
+ baseSizeRem1: 3.5, // Base size for copy1 in rem (from old Style2/Substyle1)
23
+ baseSizeRem2: 3.5, // Base size for copy2 in rem
24
+ maxLengthThreshold: 40,
25
+ reductionFactor: 0.15
20
26
  }
21
27
  };
22
28
  // Default banner dimensions
package/dist/index.d.ts CHANGED
@@ -10,4 +10,12 @@ export * from './types';
10
10
  export * from './utils';
11
11
  export * from './styles';
12
12
  export * from './constants';
13
+ export * from './styleConfig';
14
+ export * from './components/styles/Style1/substyleConfig';
15
+ export type { SubstyleConfig as Style2SubstyleConfig } from './components/styles/Style2/substyleConfig';
16
+ export { STYLE2_SUBSTYLE_CONFIGS, getSubstyleConfig as getStyle2SubstyleConfig } from './components/styles/Style2/substyleConfig';
17
+ export type { SubstyleConfig as Style3SubstyleConfig } from './components/styles/Style3/substyleConfig';
18
+ export { STYLE3_SUBSTYLE_CONFIGS, getSubstyleConfig as getStyle3SubstyleConfig } from './components/styles/Style3/substyleConfig';
19
+ export type { SubstyleConfig as Style4SubstyleConfig } from './components/styles/Style4/substyleConfig';
20
+ export { STYLE4_SUBSTYLE_CONFIGS, getSubstyleConfig as getStyle4SubstyleConfig } from './components/styles/Style4/substyleConfig';
13
21
  //# sourceMappingURL=index.d.ts.map
@@ -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"}
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,CAAC;AAE1D,YAAY,EAAE,cAAc,IAAI,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACxG,OAAO,EACL,uBAAuB,EACvB,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;AAEnD,YAAY,EAAE,cAAc,IAAI,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACxG,OAAO,EACL,uBAAuB,EACvB,iBAAiB,IAAI,uBAAuB,EAC7C,MAAM,2CAA2C,CAAC"}
package/dist/index.js CHANGED
@@ -20,6 +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.getStyle4SubstyleConfig = exports.STYLE4_SUBSTYLE_CONFIGS = exports.getStyle3SubstyleConfig = exports.STYLE3_SUBSTYLE_CONFIGS = exports.getStyle2SubstyleConfig = exports.STYLE2_SUBSTYLE_CONFIGS = void 0;
23
24
  // Core components
24
25
  __exportStar(require("./components"), exports);
25
26
  // Platform adapters
@@ -32,3 +33,14 @@ __exportStar(require("./utils"), exports);
32
33
  __exportStar(require("./styles"), exports);
33
34
  // Constants and configurations
34
35
  __exportStar(require("./constants"), exports);
36
+ __exportStar(require("./styleConfig"), exports);
37
+ __exportStar(require("./components/styles/Style1/substyleConfig"), exports);
38
+ var substyleConfig_1 = require("./components/styles/Style2/substyleConfig");
39
+ Object.defineProperty(exports, "STYLE2_SUBSTYLE_CONFIGS", { enumerable: true, get: function () { return substyleConfig_1.STYLE2_SUBSTYLE_CONFIGS; } });
40
+ Object.defineProperty(exports, "getStyle2SubstyleConfig", { enumerable: true, get: function () { return substyleConfig_1.getSubstyleConfig; } });
41
+ var substyleConfig_2 = require("./components/styles/Style3/substyleConfig");
42
+ Object.defineProperty(exports, "STYLE3_SUBSTYLE_CONFIGS", { enumerable: true, get: function () { return substyleConfig_2.STYLE3_SUBSTYLE_CONFIGS; } });
43
+ Object.defineProperty(exports, "getStyle3SubstyleConfig", { enumerable: true, get: function () { return substyleConfig_2.getSubstyleConfig; } });
44
+ var substyleConfig_3 = require("./components/styles/Style4/substyleConfig");
45
+ Object.defineProperty(exports, "STYLE4_SUBSTYLE_CONFIGS", { enumerable: true, get: function () { return substyleConfig_3.STYLE4_SUBSTYLE_CONFIGS; } });
46
+ Object.defineProperty(exports, "getStyle4SubstyleConfig", { enumerable: true, get: function () { return substyleConfig_3.getSubstyleConfig; } });
@@ -0,0 +1,40 @@
1
+ /**
2
+ * Configuration for banner styles including recommended copy amounts and character limits
3
+ */
4
+ /**
5
+ * Shadow configuration for a single shadow effect
6
+ */
7
+ export interface ShadowSettings {
8
+ enabled: boolean;
9
+ size: number;
10
+ intensity: number;
11
+ direction: 'top' | 'bottom' | 'left' | 'right' | 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right';
12
+ }
13
+ /**
14
+ * Complete shadow configuration for a style
15
+ */
16
+ export interface ShadowConfig {
17
+ textShadow: ShadowSettings;
18
+ logoShadow: ShadowSettings;
19
+ }
20
+ export interface StyleConfig {
21
+ recommendedCopyAmount: number;
22
+ maxLengthThreshold: number;
23
+ copy1CharLimit?: number;
24
+ copy2CharLimit?: number;
25
+ copy1FontWeight?: 'thin' | 'normal' | 'bold';
26
+ copy2FontWeight?: 'thin' | 'normal' | 'bold';
27
+ fontFamily?: string;
28
+ shadows?: ShadowConfig;
29
+ noiseEnabled?: boolean;
30
+ }
31
+ /**
32
+ * Style-specific configuration
33
+ * Each style has recommended copy amount and character limits
34
+ */
35
+ export declare const STYLE_CONFIGS: Record<number, StyleConfig>;
36
+ /**
37
+ * Get configuration for a specific style
38
+ */
39
+ export declare const getStyleConfig: (styleNumber: number) => StyleConfig;
40
+ //# sourceMappingURL=styleConfig.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"styleConfig.d.ts","sourceRoot":"","sources":["../src/styleConfig.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,OAAO,EAAE,OAAO,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,KAAK,GAAG,QAAQ,GAAG,MAAM,GAAG,OAAO,GAAG,UAAU,GAAG,WAAW,GAAG,aAAa,GAAG,cAAc,CAAC;CAC5G;AAED;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,UAAU,EAAE,cAAc,CAAC;IAC3B,UAAU,EAAE,cAAc,CAAC;CAC5B;AAED,MAAM,WAAW,WAAW;IAC1B,qBAAqB,EAAE,MAAM,CAAC;IAC9B,kBAAkB,EAAE,MAAM,CAAC;IAC3B,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,eAAe,CAAC,EAAE,MAAM,GAAG,QAAQ,GAAG,MAAM,CAAC;IAC7C,eAAe,CAAC,EAAE,MAAM,GAAG,QAAQ,GAAG,MAAM,CAAC;IAC7C,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,OAAO,CAAC,EAAE,YAAY,CAAC;IACvB,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB;AAED;;;GAGG;AACH,eAAO,MAAM,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,WAAW,CAiGrD,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,cAAc,GAAI,aAAa,MAAM,KAAG,WAEpD,CAAC"}
@@ -0,0 +1,115 @@
1
+ "use strict";
2
+ /**
3
+ * Configuration for banner styles including recommended copy amounts and character limits
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.getStyleConfig = exports.STYLE_CONFIGS = void 0;
7
+ /**
8
+ * Style-specific configuration
9
+ * Each style has recommended copy amount and character limits
10
+ */
11
+ exports.STYLE_CONFIGS = {
12
+ 1: {
13
+ recommendedCopyAmount: 2,
14
+ maxLengthThreshold: 40,
15
+ copy1CharLimit: 40,
16
+ copy2CharLimit: 40,
17
+ copy1FontWeight: 'bold',
18
+ copy2FontWeight: 'normal',
19
+ fontFamily: 'Roboto, sans-serif',
20
+ noiseEnabled: false, // Noise disabled for Style1
21
+ shadows: {
22
+ textShadow: {
23
+ enabled: true,
24
+ size: 70,
25
+ intensity: 0.85,
26
+ direction: 'bottom',
27
+ },
28
+ logoShadow: {
29
+ enabled: true,
30
+ size: 150,
31
+ intensity: 0.375, // 0.75 * 0.5 from original code
32
+ direction: 'top-left',
33
+ },
34
+ },
35
+ },
36
+ 2: {
37
+ recommendedCopyAmount: 2,
38
+ maxLengthThreshold: 35,
39
+ copy1CharLimit: 35,
40
+ copy2CharLimit: 35,
41
+ copy1FontWeight: 'bold',
42
+ copy2FontWeight: 'normal',
43
+ fontFamily: 'Lato, "Lato Fallback", sans-serif',
44
+ noiseEnabled: false, // Noise disabled for Style2
45
+ shadows: {
46
+ textShadow: {
47
+ enabled: true,
48
+ size: 70,
49
+ intensity: 0.60,
50
+ direction: 'bottom',
51
+ },
52
+ logoShadow: {
53
+ enabled: true,
54
+ size: 150,
55
+ intensity: 0.375,
56
+ direction: 'top-left',
57
+ },
58
+ },
59
+ },
60
+ 3: {
61
+ recommendedCopyAmount: 1,
62
+ maxLengthThreshold: 35,
63
+ copy1CharLimit: 35,
64
+ copy2CharLimit: 35,
65
+ copy1FontWeight: 'normal',
66
+ copy2FontWeight: 'normal',
67
+ fontFamily: '"Cormorant Garamond", serif',
68
+ noiseEnabled: true, // Noise enabled for Style3
69
+ shadows: {
70
+ textShadow: {
71
+ enabled: true,
72
+ size: 200,
73
+ intensity: 0.45,
74
+ direction: 'bottom',
75
+ },
76
+ logoShadow: {
77
+ enabled: true,
78
+ size: 150,
79
+ intensity: 0.375,
80
+ direction: 'top-left',
81
+ },
82
+ },
83
+ },
84
+ 4: {
85
+ recommendedCopyAmount: 2,
86
+ maxLengthThreshold: 35,
87
+ copy1CharLimit: 35,
88
+ copy2CharLimit: 35,
89
+ copy1FontWeight: 'bold',
90
+ copy2FontWeight: 'bold',
91
+ fontFamily: '"Cormorant Garamond", serif',
92
+ noiseEnabled: false, // Noise disabled for Style4
93
+ shadows: {
94
+ textShadow: {
95
+ enabled: true,
96
+ size: 200,
97
+ intensity: 0.45,
98
+ direction: 'bottom',
99
+ },
100
+ logoShadow: {
101
+ enabled: true,
102
+ size: 150,
103
+ intensity: 0.375,
104
+ direction: 'top-left',
105
+ },
106
+ },
107
+ },
108
+ };
109
+ /**
110
+ * Get configuration for a specific style
111
+ */
112
+ const getStyleConfig = (styleNumber) => {
113
+ return exports.STYLE_CONFIGS[styleNumber] || exports.STYLE_CONFIGS[1];
114
+ };
115
+ exports.getStyleConfig = getStyleConfig;
@@ -61,7 +61,7 @@ intensity = 0.6, // Default 60% opacity at the edge
61
61
  left: 0,
62
62
  width: size, // Use size for corner dimensions
63
63
  height: size,
64
- background: `radial-gradient(circle at top left, ${rgbaColor}, ${transparent} 70.71%)`, // Fade out by sqrt(2)/2
64
+ background: `radial-gradient(circle at top left, ${rgbaColor}, ${transparent})`, // Smooth fade out
65
65
  };
66
66
  break;
67
67
  case "top-right":
@@ -71,7 +71,7 @@ intensity = 0.6, // Default 60% opacity at the edge
71
71
  right: 0,
72
72
  width: size,
73
73
  height: size,
74
- background: `radial-gradient(circle at top right, ${rgbaColor}, ${transparent} 70.71%)`,
74
+ background: `radial-gradient(circle at top right, ${rgbaColor}, ${transparent})`,
75
75
  };
76
76
  break;
77
77
  case "bottom-left":
@@ -81,7 +81,7 @@ intensity = 0.6, // Default 60% opacity at the edge
81
81
  left: 0,
82
82
  width: size,
83
83
  height: size,
84
- background: `radial-gradient(circle at bottom left, ${rgbaColor}, ${transparent} 70.71%)`,
84
+ background: `radial-gradient(circle at bottom left, ${rgbaColor}, ${transparent})`,
85
85
  };
86
86
  break;
87
87
  case "bottom-right":
@@ -91,7 +91,7 @@ intensity = 0.6, // Default 60% opacity at the edge
91
91
  right: 0,
92
92
  width: size,
93
93
  height: size,
94
- background: `radial-gradient(circle at bottom right, ${rgbaColor}, ${transparent} 70.71%)`,
94
+ background: `radial-gradient(circle at bottom right, ${rgbaColor}, ${transparent})`,
95
95
  };
96
96
  break;
97
97
  case "bottom": // Default case
package/dist/types.d.ts CHANGED
@@ -12,8 +12,27 @@ export interface BannerSubstyleProps {
12
12
  fontSize_01?: string;
13
13
  fontSize_02?: string;
14
14
  logoUrl?: string;
15
+ logoSizeMultiplier?: number;
16
+ overlayIntensityMultiplier?: number;
17
+ shadowIntensityMultiplier?: number;
15
18
  backgroundImageUrl?: string;
16
19
  postType?: PostType | string;
20
+ logoTranslateX?: number;
21
+ logoTranslateY?: number;
22
+ copy1TranslateX?: number;
23
+ copy1TranslateY?: number;
24
+ copy2TranslateX?: number;
25
+ copy2TranslateY?: number;
26
+ logoRotation?: number;
27
+ copy1Rotation?: number;
28
+ copy2Rotation?: number;
29
+ logoWidth?: number;
30
+ copy1Width?: number;
31
+ copy2Width?: number;
32
+ copy1Align?: 'left' | 'center' | 'right';
33
+ copy2Align?: 'left' | 'center' | 'right';
34
+ copy1FontWeight?: 'thin' | 'normal' | 'bold';
35
+ copy2FontWeight?: 'thin' | 'normal' | 'bold';
17
36
  }
18
37
  /**
19
38
  * Post type enumeration for different banner formats
@@ -77,18 +96,104 @@ export interface PostImage {
77
96
  bannerSubstyle?: number;
78
97
  logoUrl?: string;
79
98
  }
99
+ /**
100
+ * Copy configuration for individual text elements
101
+ */
102
+ export interface CopyConfig {
103
+ id: string;
104
+ styleSlot?: number;
105
+ text: string;
106
+ fontSize?: number;
107
+ align?: 'left' | 'center' | 'right';
108
+ fontWeight?: 'thin' | 'normal' | 'bold';
109
+ fontFamily?: string;
110
+ color?: string;
111
+ bgColor?: string;
112
+ hasBg?: boolean;
113
+ paddingX?: string;
114
+ paddingY?: string;
115
+ borderRadius?: string;
116
+ translateX?: number;
117
+ translateY?: number;
118
+ rotation?: number;
119
+ width?: number;
120
+ underline?: boolean;
121
+ italic?: boolean;
122
+ textBold?: boolean;
123
+ hidden?: boolean;
124
+ }
80
125
  /**
81
126
  * Banner visor component props
82
127
  */
83
128
  export interface BannerVisorProps {
84
129
  postType: PostType;
85
- bannerStyle: number;
130
+ bannerStyle?: number;
86
131
  bannerSubstyle: number;
132
+ bannerSubSubstyle?: number;
133
+ copies?: CopyConfig[];
134
+ draggableMode?: boolean;
135
+ disableAutoPositioning?: boolean;
136
+ useAbsolutePositioning?: boolean;
137
+ onCopyPositionChange?: (copyIndex: number, position: {
138
+ x: number;
139
+ y: number;
140
+ }) => void;
141
+ onCopyRotationChange?: (copyIndex: number, rotation: number) => void;
142
+ onCopyWidthChange?: (copyIndex: number, width: number) => void;
143
+ onLogoPositionChange?: (position: {
144
+ x: number;
145
+ y: number;
146
+ }) => void;
147
+ onLogoRotationChange?: (rotation: number) => void;
148
+ onLogoWidthChange?: (width: number) => void;
87
149
  copy1?: string;
88
150
  copy2?: string;
151
+ copy1FontSizeMultiplier?: number;
152
+ copy2FontSizeMultiplier?: number;
153
+ copy1TranslateX?: number;
154
+ copy1TranslateY?: number;
155
+ copy2TranslateX?: number;
156
+ copy2TranslateY?: number;
157
+ copy1Rotation?: number;
158
+ copy2Rotation?: number;
159
+ copy1Width?: number;
160
+ copy2Width?: number;
161
+ copy1Align?: 'left' | 'center' | 'right';
162
+ copy2Align?: 'left' | 'center' | 'right';
163
+ copy1FontWeight?: 'thin' | 'normal' | 'bold';
164
+ copy2FontWeight?: 'thin' | 'normal' | 'bold';
165
+ onCopy1PositionChange?: (position: {
166
+ x: number;
167
+ y: number;
168
+ }) => void;
169
+ onCopy2PositionChange?: (position: {
170
+ x: number;
171
+ y: number;
172
+ }) => void;
173
+ onCopy1RotationChange?: (rotation: number) => void;
174
+ onCopy2RotationChange?: (rotation: number) => void;
175
+ onCopy1WidthChange?: (width: number) => void;
176
+ onCopy2WidthChange?: (width: number) => void;
89
177
  logoUrl?: string;
90
178
  backgroundImageUrl?: string;
91
179
  sizeMultiplier?: number;
180
+ fontSizeMultiplier?: number;
181
+ logoSizeMultiplier?: number;
182
+ overlayIntensityMultiplier?: number;
183
+ shadowIntensityMultiplier?: number;
184
+ logoTranslateX?: number;
185
+ logoTranslateY?: number;
186
+ logoRotation?: number;
187
+ logoWidth?: number;
188
+ textShadowEnabled?: boolean;
189
+ textShadowSize?: number;
190
+ textShadowIntensity?: number;
191
+ logoShadowEnabled?: boolean;
192
+ logoShadowSize?: number;
193
+ logoShadowIntensity?: number;
194
+ noiseEnabled?: boolean;
195
+ noiseIntensity?: number;
196
+ fontFamily?: string;
92
197
  }
93
198
  /**
94
199
  * Platform adapter interface
@@ -96,4 +201,47 @@ export interface BannerVisorProps {
96
201
  export interface PlatformAdapter {
97
202
  ImageComponent: React.ComponentType<ImageProps>;
98
203
  }
204
+ /**
205
+ * Custom style substyle configuration
206
+ */
207
+ export interface CustomSubstyleConfig {
208
+ copies: CopyConfig[];
209
+ logoUrl?: string;
210
+ backgroundImageUrl?: string;
211
+ logoSizeMultiplier: number;
212
+ effectIntensityMultiplier: number;
213
+ textShadowEnabled: boolean;
214
+ textShadowSize: number;
215
+ textShadowIntensity: number;
216
+ logoShadowEnabled: boolean;
217
+ logoShadowSize: number;
218
+ logoShadowIntensity: number;
219
+ noiseEnabled: boolean;
220
+ noiseIntensity: number;
221
+ logoTranslateX: number;
222
+ logoTranslateY: number;
223
+ logoRotation: number;
224
+ logoWidth?: number;
225
+ fontFamily?: string;
226
+ baseBannerStyle: number;
227
+ baseBannerSubstyle: number;
228
+ }
229
+ /**
230
+ * Custom style with multiple substyles
231
+ */
232
+ export interface CustomStyle {
233
+ id: string;
234
+ name: string;
235
+ substyles: Record<number, CustomSubstyleConfig>;
236
+ recommendedCopyAmount: number;
237
+ maxCharacterLength: number;
238
+ createdAt: string;
239
+ updatedAt: string;
240
+ }
241
+ /**
242
+ * Collection of custom styles stored in localStorage
243
+ */
244
+ export interface CustomStylesCollection {
245
+ [styleName: string]: CustomStyle;
246
+ }
99
247
  //# sourceMappingURL=types.d.ts.map