zuljaman-banner-components 1.0.23 → 1.0.24

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 (117) hide show
  1. package/README.md +228 -131
  2. package/dist/components/BannerRenderer/BannerRenderer.d.ts +8 -0
  3. package/dist/components/BannerRenderer/BannerRenderer.d.ts.map +1 -0
  4. package/dist/components/BannerRenderer/BannerRenderer.js +325 -0
  5. package/dist/components/BannerRenderer/components/CopyElement.d.ts +62 -0
  6. package/dist/components/BannerRenderer/components/CopyElement.d.ts.map +1 -0
  7. package/dist/components/BannerRenderer/components/CopyElement.js +220 -0
  8. package/dist/components/BannerRenderer/components/InteractiveLines.d.ts +26 -0
  9. package/dist/components/BannerRenderer/components/InteractiveLines.d.ts.map +1 -0
  10. package/dist/components/BannerRenderer/components/InteractiveLines.js +172 -0
  11. package/dist/components/BannerRenderer/components/LogoElement.d.ts +55 -0
  12. package/dist/components/BannerRenderer/components/LogoElement.d.ts.map +1 -0
  13. package/dist/components/BannerRenderer/components/LogoElement.js +53 -0
  14. package/dist/components/BannerRenderer/components/VisualGuides.d.ts +43 -0
  15. package/dist/components/BannerRenderer/components/VisualGuides.d.ts.map +1 -0
  16. package/dist/components/BannerRenderer/components/VisualGuides.js +110 -0
  17. package/dist/components/BannerRenderer/components/index.d.ts +12 -0
  18. package/dist/components/BannerRenderer/components/index.d.ts.map +1 -0
  19. package/dist/components/BannerRenderer/components/index.js +14 -0
  20. package/dist/components/BannerRenderer/constants.d.ts +15 -0
  21. package/dist/components/BannerRenderer/constants.d.ts.map +1 -0
  22. package/dist/components/BannerRenderer/constants.js +36 -0
  23. package/dist/components/BannerRenderer/hooks/index.d.ts +14 -0
  24. package/dist/components/BannerRenderer/hooks/index.d.ts.map +1 -0
  25. package/dist/components/BannerRenderer/hooks/index.js +16 -0
  26. package/dist/components/BannerRenderer/hooks/useAutoPositioning/debugPositions.d.ts +30 -0
  27. package/dist/components/BannerRenderer/hooks/useAutoPositioning/debugPositions.d.ts.map +1 -0
  28. package/dist/components/BannerRenderer/hooks/useAutoPositioning/debugPositions.js +87 -0
  29. package/dist/components/BannerRenderer/hooks/useAutoPositioning/index.d.ts +13 -0
  30. package/dist/components/BannerRenderer/hooks/useAutoPositioning/index.d.ts.map +1 -0
  31. package/dist/components/BannerRenderer/hooks/useAutoPositioning/index.js +21 -0
  32. package/dist/components/BannerRenderer/hooks/useAutoPositioning/useAnchorEdgeLocking.d.ts +71 -0
  33. package/dist/components/BannerRenderer/hooks/useAutoPositioning/useAnchorEdgeLocking.d.ts.map +1 -0
  34. package/dist/components/BannerRenderer/hooks/useAutoPositioning/useAnchorEdgeLocking.js +151 -0
  35. package/dist/components/BannerRenderer/hooks/useAutoPositioning/useAutoPositioningMain.d.ts +66 -0
  36. package/dist/components/BannerRenderer/hooks/useAutoPositioning/useAutoPositioningMain.d.ts.map +1 -0
  37. package/dist/components/BannerRenderer/hooks/useAutoPositioning/useAutoPositioningMain.js +332 -0
  38. package/dist/components/BannerRenderer/hooks/useAutoPositioning/useChainPositioning.d.ts +61 -0
  39. package/dist/components/BannerRenderer/hooks/useAutoPositioning/useChainPositioning.d.ts.map +1 -0
  40. package/dist/components/BannerRenderer/hooks/useAutoPositioning/useChainPositioning.js +180 -0
  41. package/dist/components/BannerRenderer/hooks/useAutoPositioning/useHeightCompensation.d.ts +60 -0
  42. package/dist/components/BannerRenderer/hooks/useAutoPositioning/useHeightCompensation.d.ts.map +1 -0
  43. package/dist/components/BannerRenderer/hooks/useAutoPositioning/useHeightCompensation.js +178 -0
  44. package/dist/components/BannerRenderer/hooks/useAutoPositioning.d.ts +8 -0
  45. package/dist/components/BannerRenderer/hooks/useAutoPositioning.d.ts.map +1 -0
  46. package/dist/components/BannerRenderer/hooks/useAutoPositioning.js +12 -0
  47. package/dist/components/BannerRenderer/hooks/useDragSnap.d.ts +30 -0
  48. package/dist/components/BannerRenderer/hooks/useDragSnap.d.ts.map +1 -0
  49. package/dist/components/BannerRenderer/hooks/useDragSnap.js +90 -0
  50. package/dist/components/BannerRenderer/hooks/useElementRefs.d.ts +22 -0
  51. package/dist/components/BannerRenderer/hooks/useElementRefs.d.ts.map +1 -0
  52. package/dist/components/BannerRenderer/hooks/useElementRefs.js +70 -0
  53. package/dist/components/BannerRenderer/hooks/useLineDrawing.d.ts +40 -0
  54. package/dist/components/BannerRenderer/hooks/useLineDrawing.d.ts.map +1 -0
  55. package/dist/components/BannerRenderer/hooks/useLineDrawing.js +198 -0
  56. package/dist/components/BannerRenderer/hooks/useProximityDetection.d.ts +43 -0
  57. package/dist/components/BannerRenderer/hooks/useProximityDetection.d.ts.map +1 -0
  58. package/dist/components/BannerRenderer/hooks/useProximityDetection.js +491 -0
  59. package/dist/components/BannerRenderer/index.d.ts +6 -0
  60. package/dist/components/BannerRenderer/index.d.ts.map +1 -0
  61. package/dist/components/BannerRenderer/index.js +8 -0
  62. package/dist/components/{BannerRenderer.d.ts → BannerRenderer/types.d.ts} +29 -8
  63. package/dist/components/BannerRenderer/types.d.ts.map +1 -0
  64. package/dist/components/BannerRenderer/types.js +5 -0
  65. package/dist/components/BannerRenderer/utils/alignmentUtils.d.ts +38 -0
  66. package/dist/components/BannerRenderer/utils/alignmentUtils.d.ts.map +1 -0
  67. package/dist/components/BannerRenderer/utils/alignmentUtils.js +138 -0
  68. package/dist/components/BannerRenderer/utils/elementCheckUtils.d.ts +22 -0
  69. package/dist/components/BannerRenderer/utils/elementCheckUtils.d.ts.map +1 -0
  70. package/dist/components/BannerRenderer/utils/elementCheckUtils.js +37 -0
  71. package/dist/components/BannerRenderer/utils/elementIdUtils.d.ts +25 -0
  72. package/dist/components/BannerRenderer/utils/elementIdUtils.d.ts.map +1 -0
  73. package/dist/components/BannerRenderer/utils/elementIdUtils.js +56 -0
  74. package/dist/components/BannerRenderer/utils/fontUtils.d.ts +12 -0
  75. package/dist/components/BannerRenderer/utils/fontUtils.d.ts.map +1 -0
  76. package/dist/components/BannerRenderer/utils/fontUtils.js +26 -0
  77. package/dist/components/BannerRenderer/utils/graphUtils.d.ts +54 -0
  78. package/dist/components/BannerRenderer/utils/graphUtils.d.ts.map +1 -0
  79. package/dist/components/BannerRenderer/utils/graphUtils.js +138 -0
  80. package/dist/components/BannerRenderer/utils/index.d.ts +12 -0
  81. package/dist/components/BannerRenderer/utils/index.d.ts.map +1 -0
  82. package/dist/components/BannerRenderer/utils/index.js +27 -0
  83. package/dist/components/BannerRenderer/utils/snapUtils.d.ts +38 -0
  84. package/dist/components/BannerRenderer/utils/snapUtils.d.ts.map +1 -0
  85. package/dist/components/BannerRenderer/utils/snapUtils.js +109 -0
  86. package/dist/components/BannerVisor.d.ts.map +1 -1
  87. package/dist/components/BannerVisor.js +8 -1
  88. package/dist/components/index.js +1 -1
  89. package/dist/components/shared/DraggableElement.d.ts +11 -0
  90. package/dist/components/shared/DraggableElement.d.ts.map +1 -1
  91. package/dist/components/shared/DraggableElement.js +47 -51
  92. package/dist/components/styles/Style1/substyleConfig.d.ts.map +1 -1
  93. package/dist/components/styles/Style1/substyleConfig.js +53 -54
  94. package/dist/components/styles/Style2/substyleConfig.js +78 -78
  95. package/dist/components/styles/Style3/substyleConfig.d.ts.map +1 -1
  96. package/dist/components/styles/Style3/substyleConfig.js +40 -37
  97. package/dist/components/styles/Style4/substyleConfig.js +57 -57
  98. package/dist/components/styles/types/substyleTypes.d.ts +32 -15
  99. package/dist/components/styles/types/substyleTypes.d.ts.map +1 -1
  100. package/dist/components/styles/utils/chainValidation.d.ts +41 -0
  101. package/dist/components/styles/utils/chainValidation.d.ts.map +1 -0
  102. package/dist/components/styles/utils/chainValidation.js +148 -0
  103. package/dist/components/styles/utils/positioningUtils.d.ts +207 -11
  104. package/dist/components/styles/utils/positioningUtils.d.ts.map +1 -1
  105. package/dist/components/styles/utils/positioningUtils.js +520 -19
  106. package/dist/constants/characterLimits.d.ts +4 -16
  107. package/dist/constants/characterLimits.d.ts.map +1 -1
  108. package/dist/constants/characterLimits.js +28 -26
  109. package/dist/constants/styleConfigs.js +6 -6
  110. package/dist/styleConfig.d.ts +4 -4
  111. package/dist/styleConfig.d.ts.map +1 -1
  112. package/dist/styleConfig.js +8 -16
  113. package/dist/types.d.ts +42 -0
  114. package/dist/types.d.ts.map +1 -1
  115. package/package.json +1 -1
  116. package/dist/components/BannerRenderer.d.ts.map +0 -1
  117. package/dist/components/BannerRenderer.js +0 -559
@@ -18,108 +18,108 @@ exports.STYLE2_SUBSTYLE_CONFIGS = {
18
18
  x: -110, // Centered horizontally (logo left edge offset for centerOrigin: false)
19
19
  y: -486, // 5% from top (54px) = -486px from center
20
20
  },
21
- copy1: {
22
- x: 0, // Centered horizontally
23
- y: 432, // 10% from bottom (108px) = 432px from center
24
- width: 950, // 88% of 1080px
25
- alignment: 'center',
26
- },
27
- copy2: {
28
- x: 259, // 6% from right (65px), centered within 40% width (432px) = 259px from center
29
- y: 432, // Start at same Y as copy1 (will be auto-positioned above)
30
- width: 432, // 40% of 1080px
31
- alignment: 'center',
32
- rotation: 3,
33
- color: '#000000',
34
- bgColor: '#FFFFFF',
35
- hasBg: true,
36
- paddingX: '1.25rem',
37
- paddingY: '1rem',
38
- borderRadius: '0.75rem',
39
- },
21
+ copies: [
22
+ {
23
+ x: 0, // Centered horizontally (copy-0)
24
+ y: 432, // 10% from bottom (108px) = 432px from center
25
+ width: 950, // 88% of 1080px
26
+ alignment: 'center',
27
+ },
28
+ {
29
+ x: 259, // 6% from right (65px), centered within 40% width (432px) = 259px from center (copy-1)
30
+ y: 432, // Same Y as copy-0, auto-positioning calculates offset
31
+ width: 432, // 40% of 1080px
32
+ alignment: 'center',
33
+ rotation: 3,
34
+ color: '#000000',
35
+ bgColor: '#FFFFFF',
36
+ hasBg: true,
37
+ paddingX: '1.25rem',
38
+ paddingY: '1rem',
39
+ borderRadius: '0.75rem',
40
+ },
41
+ ],
40
42
  autoPositioning: true,
41
43
  autoPositioningConfig: {
42
- anchorElement: 'copy1',
43
- targetElement: 'copy2',
44
- direction: 'up',
44
+ enabled: true,
45
+ links: [
46
+ { fromElement: 'copy-0', toElement: 'copy-1', direction: 'up' },
47
+ ],
45
48
  },
46
49
  gapRem: 2,
47
- fontSize: {
48
- copy1: 1.0,
49
- copy2: 0.40,
50
- },
50
+ fontSizes: [1.0, 0.40],
51
51
  },
52
52
  2: {
53
53
  logo: {
54
54
  x: -110, // Centered horizontally (logo left edge offset for centerOrigin: false)
55
55
  y: -486,
56
56
  },
57
- copy1: {
58
- x: 0,
59
- y: 432,
60
- width: 950,
61
- alignment: 'center',
62
- },
63
- copy2: {
64
- x: -259, // 6% from left (65px), centered within 40% width (432px) = -259px from center
65
- y: -486, // Start at same Y as logo (will be auto-positioned below)
66
- width: 432,
67
- alignment: 'center',
68
- rotation: -3,
69
- color: '#000000',
70
- bgColor: '#FFFFFF',
71
- hasBg: true,
72
- paddingX: '1.25rem',
73
- paddingY: '1rem',
74
- borderRadius: '0.75rem',
75
- },
57
+ copies: [
58
+ {
59
+ x: 0, // copy-0
60
+ y: 432,
61
+ width: 950,
62
+ alignment: 'center',
63
+ },
64
+ {
65
+ x: -259, // 6% from left (65px), centered within 40% width (432px) = -259px from center (copy-1)
66
+ y: -486, // Same Y as logo, auto-positioning calculates offset
67
+ width: 432,
68
+ alignment: 'center',
69
+ rotation: -3,
70
+ color: '#000000',
71
+ bgColor: '#FFFFFF',
72
+ hasBg: true,
73
+ paddingX: '1.25rem',
74
+ paddingY: '1rem',
75
+ borderRadius: '0.75rem',
76
+ },
77
+ ],
76
78
  autoPositioning: true,
77
79
  autoPositioningConfig: {
78
- anchorElement: 'logo',
79
- targetElement: 'copy2',
80
- direction: 'down',
80
+ enabled: true,
81
+ links: [
82
+ { fromElement: 'logo', toElement: 'copy-1', direction: 'down' },
83
+ ],
81
84
  },
82
85
  gapRem: 2,
83
- fontSize: {
84
- copy1: 1.0,
85
- copy2: 0.40,
86
- },
86
+ fontSizes: [1.0, 0.40],
87
87
  },
88
88
  3: {
89
89
  logo: {
90
90
  x: -110, // Centered horizontally (logo left edge offset for centerOrigin: false)
91
91
  y: -486,
92
92
  },
93
- copy1: {
94
- x: 0,
95
- y: 432,
96
- width: 950,
97
- alignment: 'center',
98
- },
99
- copy2: {
100
- x: 259, // 6% from right (65px), centered within 40% width (432px) = 259px from center
101
- y: -486, // Start at same Y as logo (will be auto-positioned below)
102
- width: 432,
103
- alignment: 'center',
104
- rotation: 3,
105
- color: '#000000',
106
- bgColor: '#FFFFFF',
107
- hasBg: true,
108
- paddingX: '1.25rem',
109
- paddingY: '1rem',
110
- borderRadius: '0.75rem',
111
- },
93
+ copies: [
94
+ {
95
+ x: 0, // copy-0
96
+ y: 432,
97
+ width: 950,
98
+ alignment: 'center',
99
+ },
100
+ {
101
+ x: 259, // 6% from right (65px), centered within 40% width (432px) = 259px from center (copy-1)
102
+ y: -486, // Same Y as logo, auto-positioning calculates offset
103
+ width: 432,
104
+ alignment: 'center',
105
+ rotation: 3,
106
+ color: '#000000',
107
+ bgColor: '#FFFFFF',
108
+ hasBg: true,
109
+ paddingX: '1.25rem',
110
+ paddingY: '1rem',
111
+ borderRadius: '0.75rem',
112
+ },
113
+ ],
112
114
  autoPositioning: true,
113
115
  autoPositioningConfig: {
114
- anchorElement: 'logo',
115
- targetElement: 'copy2',
116
- direction: 'down',
116
+ enabled: true,
117
+ links: [
118
+ { fromElement: 'logo', toElement: 'copy-1', direction: 'down' },
119
+ ],
117
120
  },
118
121
  gapRem: 2,
119
- fontSize: {
120
- copy1: 1.0,
121
- copy2: 0.40,
122
- },
122
+ fontSizes: [1.0, 0.40],
123
123
  },
124
124
  };
125
125
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"substyleConfig.d.ts","sourceRoot":"","sources":["../../../../src/components/styles/Style3/substyleConfig.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAIxD,YAAY,EAAE,cAAc,EAAE,CAAC;AAE/B;;;;;GAKG;AACH,eAAO,MAAM,uBAAuB,EAAE,MAAM,CAAC,MAAM,EAAE,cAAc,CAmElE,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,iBAAiB,GAAI,UAAU,MAAM,KAAG,cAEpD,CAAC"}
1
+ {"version":3,"file":"substyleConfig.d.ts","sourceRoot":"","sources":["../../../../src/components/styles/Style3/substyleConfig.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAIxD,YAAY,EAAE,cAAc,EAAE,CAAC;AAE/B;;;;;GAKG;AACH,eAAO,MAAM,uBAAuB,EAAE,MAAM,CAAC,MAAM,EAAE,cAAc,CAsElE,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,iBAAiB,GAAI,UAAU,MAAM,KAAG,cAEpD,CAAC"}
@@ -15,69 +15,72 @@ const substyleUtils_1 = require("../utils/substyleUtils");
15
15
  exports.STYLE3_SUBSTYLE_CONFIGS = {
16
16
  1: {
17
17
  logo: {
18
- x: 14, // Centered with copy1 (124 - logoWidth/2)
18
+ x: 14, // Centered with copy-0 (124 - logoWidth/2)
19
19
  y: -216, // 30% from top (324px) = -216px from center
20
20
  },
21
- copy1: {
22
- x: 124, // 6% from right, centered within 65% width = 124px from center
23
- y: -216, // Start at same Y as logo (will be auto-positioned below)
24
- width: 702, // 65% of 1080px
25
- alignment: 'center',
26
- },
21
+ copies: [
22
+ {
23
+ x: 124, // 6% from right, centered within 65% width = 124px from center (copy-0)
24
+ y: -216, // Same Y as logo, auto-positioning calculates offset
25
+ width: 702, // 65% of 1080px
26
+ alignment: 'center',
27
+ },
28
+ ],
27
29
  autoPositioning: true,
28
30
  autoPositioningConfig: {
29
- anchorElement: 'logo',
30
- targetElement: 'copy1',
31
- direction: 'down',
31
+ enabled: true,
32
+ links: [
33
+ { fromElement: 'logo', toElement: 'copy-0', direction: 'down' },
34
+ ],
32
35
  },
33
36
  gapRem: 1.5,
34
- fontSize: {
35
- copy1: 0.60,
36
- },
37
+ fontSizes: [0.60],
37
38
  },
38
39
  2: {
39
40
  logo: {
40
41
  x: -110, // Centered horizontally (logo left edge offset for centerOrigin: false)
41
42
  y: 380, // 15% from bottom (162px) = 378px from center
42
43
  },
43
- copy1: {
44
- x: 0, // Centered horizontally
45
- y: 380, // Start at same Y as logo (will be auto-positioned above)
46
- width: 702, // 65% of 1080px
47
- alignment: 'center',
48
- },
44
+ copies: [
45
+ {
46
+ x: 0, // Centered horizontally (copy-0)
47
+ y: 380, // Same Y as logo, auto-positioning calculates offset
48
+ width: 702, // 65% of 1080px
49
+ alignment: 'center',
50
+ },
51
+ ],
49
52
  autoPositioning: true,
50
53
  autoPositioningConfig: {
51
- anchorElement: 'logo',
52
- targetElement: 'copy1',
53
- direction: 'up',
54
+ enabled: true,
55
+ links: [
56
+ { fromElement: 'logo', toElement: 'copy-0', direction: 'up' },
57
+ ],
54
58
  },
55
59
  gapRem: 1.5,
56
- fontSize: {
57
- copy1: 0.60,
58
- },
60
+ fontSizes: [0.60],
59
61
  },
60
62
  3: {
61
63
  logo: {
62
64
  x: 254, // 6% from right edge, logo left edge = 254px from center
63
65
  y: 380, // 15% from bottom (162px) = 378px from center
64
66
  },
65
- copy1: {
66
- x: 313, // 6% from right, centered within 30% width = 313px from center
67
- y: 380, // Start at same Y as logo (will be auto-positioned above)
68
- width: 324, // 30% of 1080px
69
- alignment: 'left',
70
- },
67
+ copies: [
68
+ {
69
+ x: 313, // 6% from right, centered within 30% width = 313px from center (copy-0)
70
+ y: 380, // Same Y as logo, auto-positioning calculates offset
71
+ width: 324, // 30% of 1080px
72
+ alignment: 'left',
73
+ },
74
+ ],
71
75
  autoPositioning: true,
72
76
  autoPositioningConfig: {
73
- anchorElement: 'logo',
74
- targetElement: 'copy1',
75
- direction: 'up',
77
+ enabled: true,
78
+ links: [
79
+ { fromElement: 'logo', toElement: 'copy-0', direction: 'up' },
80
+ ],
76
81
  },
77
82
  gapRem: 1.5,
78
- fontSize: {
79
- copy1: 0.60,
80
- },
83
+ fontSizes: [0.60],
81
84
  },
82
85
  };
83
86
  /**
@@ -18,87 +18,87 @@ exports.STYLE4_SUBSTYLE_CONFIGS = {
18
18
  x: -110, // Centered horizontally (logo left edge offset for centerOrigin: false)
19
19
  y: 380, // 15% from bottom (162px) = 378px from center
20
20
  },
21
- copy1: {
22
- x: 0, // Centered horizontally
23
- y: -486, // Start at same Y as copy2 (will be auto-positioned below)
24
- width: 972, // 90% of 1080px
25
- alignment: 'center',
26
- },
27
- copy2: {
28
- x: 0, // Centered horizontally
29
- y: -486, // 5% from top (54px) = -486px from center
30
- width: 950, // 88% of 1080px
31
- alignment: 'center',
32
- },
21
+ copies: [
22
+ {
23
+ x: 0, // Centered horizontally (copy-0)
24
+ y: -486, // Same Y as copy-1, auto-positioning calculates offset
25
+ width: 972, // 90% of 1080px
26
+ alignment: 'center',
27
+ },
28
+ {
29
+ x: 0, // Centered horizontally (copy-1)
30
+ y: -486, // 5% from top (54px) = -486px from center
31
+ width: 950, // 88% of 1080px
32
+ alignment: 'center',
33
+ },
34
+ ],
33
35
  autoPositioning: true,
34
36
  autoPositioningConfig: {
35
- anchorElement: 'copy2',
36
- targetElement: 'copy1',
37
- direction: 'down',
37
+ enabled: true,
38
+ links: [
39
+ { fromElement: 'copy-1', toElement: 'copy-0', direction: 'down' },
40
+ ],
38
41
  },
39
42
  gapRem: 0.15,
40
- fontSize: {
41
- copy1: 1.6,
42
- copy2: 0.60,
43
- },
43
+ fontSizes: [1.6, 0.60],
44
44
  },
45
45
  2: {
46
46
  logo: {
47
47
  x: -110, // Centered horizontally (logo left edge offset for centerOrigin: false)
48
48
  y: 380, // 15% from bottom (162px) = 378px from center
49
49
  },
50
- copy1: {
51
- x: 0, // Centered horizontally
52
- y: -136, // 37.4% from top (404px) = -136px from center
53
- width: 972, // 90% of 1080px
54
- alignment: 'center',
55
- },
56
- copy2: {
57
- x: 0, // Centered horizontally
58
- y: -136, // Start at same Y as copy1 (will be auto-positioned below)
59
- width: 950, // 88% of 1080px
60
- alignment: 'center',
61
- },
50
+ copies: [
51
+ {
52
+ x: 0, // Centered horizontally (copy-0)
53
+ y: -136, // 37.4% from top (404px) = -136px from center
54
+ width: 972, // 90% of 1080px
55
+ alignment: 'center',
56
+ },
57
+ {
58
+ x: 0, // Centered horizontally (copy-1)
59
+ y: -136, // Same Y as copy-0, auto-positioning calculates offset
60
+ width: 950, // 88% of 1080px
61
+ alignment: 'center',
62
+ },
63
+ ],
62
64
  autoPositioning: true,
63
65
  autoPositioningConfig: {
64
- anchorElement: 'copy1',
65
- targetElement: 'copy2',
66
- direction: 'down',
66
+ enabled: true,
67
+ links: [
68
+ { fromElement: 'copy-0', toElement: 'copy-1', direction: 'down' },
69
+ ],
67
70
  },
68
71
  gapRem: 1,
69
- fontSize: {
70
- copy1: 1.75,
71
- copy2: 0.60,
72
- },
72
+ fontSizes: [1.75, 0.60],
73
73
  },
74
74
  3: {
75
75
  logo: {
76
76
  x: -110, // Centered horizontally (logo left edge offset for centerOrigin: false)
77
77
  y: 380, // 15% from bottom (162px) = 378px from center
78
78
  },
79
- copy1: {
80
- x: 0, // Centered horizontally
81
- y: -281, // 24% from top (259px) = -281px from center
82
- width: 972, // 90% of 1080px
83
- alignment: 'center',
84
- },
85
- copy2: {
86
- x: 0, // Centered horizontally
87
- y: -281, // Start at same Y as copy1 (will be auto-positioned below)
88
- width: 950, // 88% of 1080px
89
- alignment: 'center',
90
- },
79
+ copies: [
80
+ {
81
+ x: 0, // Centered horizontally (copy-0)
82
+ y: -281, // 24% from top (259px) = -281px from center
83
+ width: 972, // 90% of 1080px
84
+ alignment: 'center',
85
+ },
86
+ {
87
+ x: 0, // Centered horizontally (copy-1)
88
+ y: -281, // Same Y as copy-0, auto-positioning calculates offset
89
+ width: 950, // 88% of 1080px
90
+ alignment: 'center',
91
+ },
92
+ ],
91
93
  autoPositioning: true,
92
94
  autoPositioningConfig: {
93
- anchorElement: 'copy1',
94
- targetElement: 'copy2',
95
- direction: 'down',
95
+ enabled: true,
96
+ links: [
97
+ { fromElement: 'copy-0', toElement: 'copy-1', direction: 'down' },
98
+ ],
96
99
  },
97
100
  gapRem: 1,
98
- fontSize: {
99
- copy1: 1.75,
100
- copy2: 0.60,
101
- },
101
+ fontSizes: [1.75, 0.60],
102
102
  },
103
103
  };
104
104
  /**
@@ -27,23 +27,39 @@ export interface CopyElementConfig {
27
27
  borderRadius?: string;
28
28
  }
29
29
  /**
30
- * Auto-positioning configuration
31
- * Defines how one element should be positioned relative to another
30
+ * Single link in the auto-positioning chain
31
+ * Defines a positioning relationship between two elements
32
+ * Element names use format: 'logo', 'copy-N' where N is the styleSlot (e.g., 'copy-0', 'copy-1', 'copy-2')
33
+ * Note: styleSlot 0 is the first copy, styleSlot 1 is the second copy, etc.
32
34
  */
33
- export interface AutoPositioningConfig {
34
- /** Element that serves as the reference point (stays in place) */
35
- anchorElement: 'logo' | 'copy1' | 'copy2';
36
- /** Element that will be positioned relative to the anchor (moves) */
37
- targetElement: 'copy1' | 'copy2';
38
- /** Direction from anchor to target */
35
+ export interface AutoPositioningLink {
36
+ /** Element that serves as the reference point for this link */
37
+ fromElement: string;
38
+ /** Element that will be positioned relative to fromElement */
39
+ toElement: string;
40
+ /** Direction from fromElement to toElement */
39
41
  direction: 'up' | 'down' | 'left' | 'right';
42
+ /** Optional: Custom gap for this specific link (overrides global gapRem) */
43
+ gapRem?: number;
40
44
  }
41
45
  /**
42
- * Font size configuration for copies
46
+ * Auto-positioning configuration (chain-based approach)
47
+ * Supports multiple elements in a chain (e.g., anchor → target1 → target2)
48
+ *
49
+ * Example for 3-element chain:
50
+ * {
51
+ * enabled: true,
52
+ * links: [
53
+ * { fromElement: 'copy-0', toElement: 'copy-1', direction: 'up' },
54
+ * { fromElement: 'copy-1', toElement: 'copy-2', direction: 'up' },
55
+ * ]
56
+ * }
43
57
  */
44
- export interface FontSizeConfig {
45
- copy1: number;
46
- copy2?: number;
58
+ export interface AutoPositioningConfig {
59
+ /** Whether auto-positioning is enabled for this chain */
60
+ enabled?: boolean;
61
+ /** Array of positioning links that define the chain */
62
+ links: AutoPositioningLink[];
47
63
  }
48
64
  /**
49
65
  * Complete substyle configuration
@@ -51,15 +67,16 @@ export interface FontSizeConfig {
51
67
  */
52
68
  export interface SubstyleConfig {
53
69
  logo: LogoConfig;
54
- copy1: CopyElementConfig;
55
- copy2?: CopyElementConfig;
70
+ /** Array of copy configurations (index 0 = first copy, index 1 = second copy, etc.) */
71
+ copies: CopyElementConfig[];
56
72
  /** Enable automatic positioning of elements relative to each other */
57
73
  autoPositioning?: boolean;
58
74
  /** Configuration for automatic positioning (anchor, target, direction) */
59
75
  autoPositioningConfig?: AutoPositioningConfig;
60
76
  /** Gap in rem units between auto-positioned elements */
61
77
  gapRem?: number;
62
- fontSize: FontSizeConfig;
78
+ /** Font size multipliers per copy (index matches copies array) */
79
+ fontSizes?: number[];
63
80
  }
64
81
  /**
65
82
  * Collection of substyle configurations indexed by substyle number
@@ -1 +1 @@
1
- {"version":3,"file":"substyleTypes.d.ts","sourceRoot":"","sources":["../../../../src/components/styles/types/substyleTypes.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,GAAG,QAAQ,GAAG,OAAO,CAAC;IACvC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,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,MAAM,WAAW,qBAAqB;IACpC,kEAAkE;IAClE,aAAa,EAAE,MAAM,GAAG,OAAO,GAAG,OAAO,CAAC;IAC1C,qEAAqE;IACrE,aAAa,EAAE,OAAO,GAAG,OAAO,CAAC;IACjC,sCAAsC;IACtC,SAAS,EAAE,IAAI,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC;CAC7C;AAED;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;;GAGG;AACH,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,UAAU,CAAC;IACjB,KAAK,EAAE,iBAAiB,CAAC;IACzB,KAAK,CAAC,EAAE,iBAAiB,CAAC;IAC1B,sEAAsE;IACtE,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,0EAA0E;IAC1E,qBAAqB,CAAC,EAAE,qBAAqB,CAAC;IAC9C,wDAAwD;IACxD,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,cAAc,CAAC;CAC1B;AAED;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC"}
1
+ {"version":3,"file":"substyleTypes.d.ts","sourceRoot":"","sources":["../../../../src/components/styles/types/substyleTypes.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,GAAG,QAAQ,GAAG,OAAO,CAAC;IACvC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,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;;;;;GAKG;AACH,MAAM,WAAW,mBAAmB;IAClC,+DAA+D;IAC/D,WAAW,EAAE,MAAM,CAAC;IACpB,8DAA8D;IAC9D,SAAS,EAAE,MAAM,CAAC;IAClB,8CAA8C;IAC9C,SAAS,EAAE,IAAI,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC;IAC5C,4EAA4E;IAC5E,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED;;;;;;;;;;;;GAYG;AACH,MAAM,WAAW,qBAAqB;IACpC,yDAAyD;IACzD,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,uDAAuD;IACvD,KAAK,EAAE,mBAAmB,EAAE,CAAC;CAC9B;AAED;;;GAGG;AACH,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,UAAU,CAAC;IACjB,uFAAuF;IACvF,MAAM,EAAE,iBAAiB,EAAE,CAAC;IAC5B,sEAAsE;IACtE,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,0EAA0E;IAC1E,qBAAqB,CAAC,EAAE,qBAAqB,CAAC;IAC9C,wDAAwD;IACxD,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,kEAAkE;IAClE,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;CACtB;AAED;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC"}
@@ -0,0 +1,41 @@
1
+ /**
2
+ * Chain validation utilities for auto-positioning
3
+ * Provides validation, graph building, and topological sorting for positioning chains
4
+ */
5
+ import { AutoPositioningLink } from '../types/substyleTypes';
6
+ export interface ValidationResult {
7
+ valid: boolean;
8
+ error?: string;
9
+ }
10
+ /**
11
+ * Build a dependency graph from positioning links
12
+ * Returns a Map where key = element ID, value = array of dependent element IDs
13
+ */
14
+ export declare function buildDependencyGraph(links: AutoPositioningLink[]): Map<string, string[]>;
15
+ /**
16
+ * Validate chain configuration for errors
17
+ * Checks for:
18
+ * - Circular dependencies
19
+ * - Empty links array
20
+ * - Duplicate links
21
+ */
22
+ export declare function validateChainConfiguration(links: AutoPositioningLink[]): ValidationResult;
23
+ /**
24
+ * Perform topological sort on the dependency graph
25
+ * Returns elements in calculation order (roots first, then dependencies)
26
+ */
27
+ export declare function topologicalSort(graph: Map<string, string[]>): string[];
28
+ /**
29
+ * Find elements that have no incoming links (root/anchor elements)
30
+ */
31
+ export declare function findRootElements(links: AutoPositioningLink[]): string[];
32
+ /**
33
+ * Find the incoming link for a given element (the link where element is the "to")
34
+ */
35
+ export declare function findIncomingLink(links: AutoPositioningLink[], elementId: string): AutoPositioningLink | undefined;
36
+ /**
37
+ * Find orphaned elements after links are removed
38
+ * Returns elements that are referenced in remaining copies but not in any link
39
+ */
40
+ export declare function findOrphanedElements(links: AutoPositioningLink[], allElementIds: string[]): string[];
41
+ //# sourceMappingURL=chainValidation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"chainValidation.d.ts","sourceRoot":"","sources":["../../../../src/components/styles/utils/chainValidation.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAE7D,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,OAAO,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,mBAAmB,EAAE,GAAG,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAiBxF;AA6BD;;;;;;GAMG;AACH,wBAAgB,0BAA0B,CAAC,KAAK,EAAE,mBAAmB,EAAE,GAAG,gBAAgB,CAoCzF;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,GAAG,MAAM,EAAE,CAwBtE;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,mBAAmB,EAAE,GAAG,MAAM,EAAE,CAYvE;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAC9B,KAAK,EAAE,mBAAmB,EAAE,EAC5B,SAAS,EAAE,MAAM,GAChB,mBAAmB,GAAG,SAAS,CAEjC;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAClC,KAAK,EAAE,mBAAmB,EAAE,EAC5B,aAAa,EAAE,MAAM,EAAE,GACtB,MAAM,EAAE,CASV"}