@alphacifer/slidev-addon-theme 0.0.10 → 0.0.12

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 (227) hide show
  1. package/README.md +134 -76
  2. package/components/card/chevron-card/ChevronCard.vue +44 -32
  3. package/components/card/chevron-card/ChevronCardBadge.vue +14 -8
  4. package/components/card/chevron-card/ChevronCardContent.vue +15 -13
  5. package/components/card/chevron-card/style.css +12 -0
  6. package/components/card/{horiz-card/HorizCard.vue → horizontal-card/HorizontalCard.vue} +78 -85
  7. package/components/card/{horiz-card/HorizCardBadge.vue → horizontal-card/HorizontalCardBadge.vue} +15 -10
  8. package/components/card/{horiz-card/HorizCardContent.vue → horizontal-card/HorizontalCardContent.vue} +11 -11
  9. package/components/card/{horiz-card/HorizCardIcon.vue → horizontal-card/HorizontalCardIcon.vue} +24 -38
  10. package/components/card/horizontal-card/style.css +17 -0
  11. package/components/card/{vert-card/VertCard.vue → vertical-card/VerticalCard.vue} +80 -103
  12. package/components/card/{vert-card/VertCardBadge.vue → vertical-card/VerticalCardBadge.vue} +15 -10
  13. package/components/card/{vert-card/VertCardContent.vue → vertical-card/VerticalCardContent.vue} +13 -12
  14. package/components/card/{vert-card/VertCardIcon.vue → vertical-card/VerticalCardIcon.vue} +15 -33
  15. package/components/card/vertical-card/style.css +19 -0
  16. package/components/comparisons/arc-comparison/ArcComparison.vue +376 -80
  17. package/components/comparisons/arc-comparison/ArcComparisonBadge.vue +9 -4
  18. package/components/comparisons/arc-comparison/ArcComparisonContent.vue +9 -4
  19. package/components/comparisons/arc-comparison/ArcComparisonHeading.vue +9 -4
  20. package/components/comparisons/arc-comparison/ArcComparisonLeft.vue +39 -63
  21. package/components/comparisons/arc-comparison/ArcComparisonOrbit.vue +9 -8
  22. package/components/comparisons/arc-comparison/ArcComparisonRight.vue +39 -63
  23. package/components/comparisons/arc-comparison/style.css +27 -0
  24. package/components/comparisons/table-comparison/TableComparison.vue +8 -90
  25. package/components/comparisons/table-comparison/TableComparisonCell.vue +22 -20
  26. package/components/comparisons/table-comparison/{TableComparisonCol.vue → TableComparisonColumn.vue} +16 -14
  27. package/components/comparisons/table-comparison/{TableComparisonCols.vue → TableComparisonColumns.vue} +5 -8
  28. package/components/comparisons/table-comparison/TableComparisonRow.vue +10 -14
  29. package/components/comparisons/table-comparison/TableComparisonRows.vue +1 -4
  30. package/components/comparisons/table-comparison/style.css +15 -0
  31. package/components/core/Date.vue +2 -5
  32. package/components/core/MetaList.vue +50 -0
  33. package/components/core/QnA.vue +1 -1
  34. package/components/core/Quote.vue +3 -6
  35. package/components/core/ReflectedTitle.vue +2 -6
  36. package/components/core/Speaker.vue +6 -11
  37. package/components/core/TransitionHeading.vue +2 -5
  38. package/components/core/arc-orbit/ArcOrbit.vue +65 -84
  39. package/components/core/arc-orbit/ArcOrbitBadge.vue +9 -11
  40. package/components/core/arc-orbit/ArcOrbitCallout.vue +19 -23
  41. package/components/core/arc-orbit/ArcOrbitContent.vue +6 -12
  42. package/components/core/arc-orbit/ArcOrbitHeading.vue +13 -11
  43. package/components/core/arc-orbit/style.css +20 -0
  44. package/components/core/style.css +9 -0
  45. package/components/core/thanks/{ThanksContent.vue → SquareThanks.vue} +36 -31
  46. package/components/core/thanks/SquareThanksContent.vue +87 -0
  47. package/components/core/thanks/ThanksOutlineSquare.vue +2 -5
  48. package/components/core/thanks/ThanksSquare.vue +2 -5
  49. package/components/core/thanks/style.css +30 -0
  50. package/components/defense-in-depth/{arc-did/ArcDiD.vue → arc-defense-in-depth/ArcDefenseInDepth.vue} +167 -97
  51. package/components/defense-in-depth/arc-defense-in-depth/ArcDefenseInDepthLayer.vue +240 -0
  52. package/components/defense-in-depth/{arc-did/ArcDiDLayerTitle.vue → arc-defense-in-depth/ArcDefenseInDepthLayerHeading.vue} +27 -29
  53. package/components/defense-in-depth/{arc-did/ArcDiDLayerPart.vue → arc-defense-in-depth/ArcDefenseInDepthLayerPart.vue} +91 -39
  54. package/components/defense-in-depth/{arc-did/ArcDiDLayerSector.vue → arc-defense-in-depth/ArcDefenseInDepthLayerSector.vue} +37 -23
  55. package/components/defense-in-depth/arc-defense-in-depth/style.css +38 -0
  56. package/components/facets/tetrad/{rect-orbit-tetrad/RectOrbitTetrad.vue → rectangle-orbit-tetrad/RectangleOrbitTetrad.vue} +66 -63
  57. package/components/facets/tetrad/{rect-orbit-tetrad/RectOrbitTetradCallout.vue → rectangle-orbit-tetrad/RectangleOrbitTetradCallout.vue} +58 -46
  58. package/components/facets/tetrad/rectangle-orbit-tetrad/RectangleOrbitTetradCenter.vue +54 -0
  59. package/components/facets/tetrad/rectangle-orbit-tetrad/RectangleOrbitTetradContent.vue +44 -0
  60. package/components/facets/tetrad/rectangle-orbit-tetrad/RectangleOrbitTetradHeading.vue +27 -0
  61. package/components/facets/tetrad/{rect-orbit-tetrad/RectOrbitTetradIcon.vue → rectangle-orbit-tetrad/RectangleOrbitTetradIcon.vue} +23 -13
  62. package/components/facets/tetrad/rectangle-orbit-tetrad/style.css +22 -0
  63. package/components/facets/triad/arrow-triad/ArrowTriad.vue +99 -109
  64. package/components/facets/triad/arrow-triad/ArrowTriadCallout.vue +31 -59
  65. package/components/facets/triad/arrow-triad/ArrowTriadContent.vue +18 -13
  66. package/components/facets/triad/arrow-triad/ArrowTriadHeading.vue +20 -13
  67. package/components/facets/triad/arrow-triad/ArrowTriadIcon.vue +14 -9
  68. package/components/facets/triad/arrow-triad/style.css +15 -0
  69. package/components/facets/triad/gear-triad/GearTriad.vue +73 -64
  70. package/components/facets/triad/gear-triad/GearTriadCallout.vue +58 -53
  71. package/components/facets/triad/gear-triad/GearTriadCenter.vue +9 -4
  72. package/components/facets/triad/gear-triad/GearTriadContent.vue +21 -36
  73. package/components/facets/triad/gear-triad/GearTriadDetail.vue +92 -0
  74. package/components/facets/triad/gear-triad/GearTriadDetails.vue +169 -0
  75. package/components/facets/triad/gear-triad/GearTriadDetailsContent.vue +18 -0
  76. package/components/facets/triad/gear-triad/GearTriadDetailsHeading.vue +60 -0
  77. package/components/facets/triad/gear-triad/GearTriadHeading.vue +19 -13
  78. package/components/facets/triad/gear-triad/GearTriadIcon.vue +22 -9
  79. package/components/facets/triad/gear-triad/style.css +26 -0
  80. package/components/facets/triad/{hex-triad/HexTriad.vue → hexagon-triad/HexagonTriad.vue} +81 -63
  81. package/components/facets/triad/{hex-triad/HexTriadBadge.vue → hexagon-triad/HexagonTriadBadge.vue} +38 -12
  82. package/components/facets/triad/{hex-triad/HexTriadCallout.vue → hexagon-triad/HexagonTriadCallout.vue} +35 -31
  83. package/components/facets/triad/hexagon-triad/HexagonTriadCenterBadge.vue +74 -0
  84. package/components/facets/triad/hexagon-triad/HexagonTriadContent.vue +34 -0
  85. package/components/facets/triad/hexagon-triad/HexagonTriadHeading.vue +44 -0
  86. package/components/facets/triad/{hex-triad/HexTriadLayer.vue → hexagon-triad/HexagonTriadLayer.vue} +12 -4
  87. package/components/facets/triad/hexagon-triad/style.css +22 -0
  88. package/components/process/arc-arrow-process/ArcArrowProcess.vue +13 -35
  89. package/components/process/arc-arrow-process/ArcArrowProcessArrow.vue +20 -21
  90. package/components/process/arc-arrow-process/ArcArrowProcessCallout.vue +30 -71
  91. package/components/process/arc-arrow-process/ArcArrowProcessContent.vue +18 -13
  92. package/components/process/arc-arrow-process/ArcArrowProcessHeading.vue +18 -18
  93. package/components/process/arc-arrow-process/ArcArrowProcessIcon.vue +23 -11
  94. package/components/process/arc-arrow-process/style.css +20 -0
  95. package/components/pyramid/circular-pyramid/CircularPyramid.vue +269 -170
  96. package/components/pyramid/circular-pyramid/CircularPyramidStack.vue +70 -52
  97. package/components/pyramid/circular-pyramid/CircularPyramidStackContent.vue +47 -37
  98. package/components/pyramid/circular-pyramid/{CircularPyramidStackTitle.vue → CircularPyramidStackHeading.vue} +49 -45
  99. package/components/pyramid/circular-pyramid/style.css +26 -0
  100. package/components/pyramid/square-pyramid/SquarePyramid.vue +191 -62
  101. package/components/pyramid/square-pyramid/SquarePyramidStack.vue +74 -49
  102. package/components/pyramid/square-pyramid/SquarePyramidStackContent.vue +47 -33
  103. package/components/pyramid/square-pyramid/{SquarePyramidStackTitle.vue → SquarePyramidStackHeading.vue} +49 -41
  104. package/components/pyramid/square-pyramid/style.css +48 -0
  105. package/components/style.css +35 -0
  106. package/layouts/core/arc-toc.vue +40 -45
  107. package/layouts/core/bg-center.vue +7 -6
  108. package/layouts/core/references.vue +84 -0
  109. package/layouts/core/style.css +47 -0
  110. package/layouts/shifting-heading/shifting-intro.vue +4 -13
  111. package/layouts/thanks/thanks.vue +5 -5
  112. package/package.json +7 -5
  113. package/style.css +17 -0
  114. package/uno.config.ts +1 -0
  115. package/utils/activateOnKeyboard.ts +14 -0
  116. package/utils/{chevronCard → card/chevron-card}/context.ts +1 -1
  117. package/utils/card/chevron-card/index.ts +1 -0
  118. package/utils/card/horizontal-card/context.ts +12 -0
  119. package/utils/{horizCard/createHorizCardGeometry.ts → card/horizontal-card/createHorizontalCardGeometry.ts} +10 -45
  120. package/utils/card/horizontal-card/index.ts +2 -0
  121. package/utils/card/vertical-card/context.ts +19 -0
  122. package/utils/{vertCard/createVertCardGeometry.ts → card/vertical-card/createVerticalCardGeometry.ts} +9 -130
  123. package/utils/card/vertical-card/index.ts +2 -0
  124. package/utils/colors.ts +93 -0
  125. package/utils/{arcComparison → comparisons/arc-comparison}/context.ts +0 -11
  126. package/utils/{arcComparison → comparisons/arc-comparison}/createArcComparisonGeometry.ts +1 -1
  127. package/utils/comparisons/arc-comparison/resolveArcComparisonItems.ts +33 -0
  128. package/utils/comparisons/table-comparison/constants.ts +47 -0
  129. package/utils/{tableComparison → comparisons/table-comparison}/context.ts +2 -2
  130. package/utils/{arcOrbit → core/arc-orbit}/resolveArcOrbitItems.ts +11 -15
  131. package/utils/{defenseInDepth/arcDid → defense-in-depth/arc-defense-in-depth}/context.ts +34 -31
  132. package/utils/{defenseInDepth/arcDid/createArcDiDGeometry.ts → defense-in-depth/arc-defense-in-depth/createArcDefenseInDepthGeometry.ts} +69 -39
  133. package/utils/{defenseInDepth/arcDid → defense-in-depth/arc-defense-in-depth}/types.ts +39 -35
  134. package/utils/defense-in-depth/shared/colors.ts +51 -0
  135. package/utils/defense-in-depth/shared/constants.ts +22 -0
  136. package/utils/{defenseInDepth → defense-in-depth}/shared/types.ts +0 -5
  137. package/utils/facets/tetrad/rectangle-orbit-tetrad/context.ts +31 -0
  138. package/utils/{rectOrbitTetrad/createRectOrbitTetradGeometry.ts → facets/tetrad/rectangle-orbit-tetrad/createRectangleOrbitTetradGeometry.ts} +5 -104
  139. package/utils/facets/tetrad/rectangle-orbit-tetrad/index.ts +3 -0
  140. package/utils/{rectOrbitTetrad/resolveRectOrbitTetradItems.ts → facets/tetrad/rectangle-orbit-tetrad/resolveRectangleOrbitTetradItems.ts} +41 -49
  141. package/utils/{arrowTriad → facets/triad/arrow-triad}/resolveArrowTriadItems.ts +27 -28
  142. package/utils/{gearTriad → facets/triad/gear-triad}/context.ts +5 -5
  143. package/utils/{gearTriad → facets/triad/gear-triad}/createGearTriadGeometry.ts +2 -0
  144. package/utils/{gearTriad → facets/triad/gear-triad}/resolveGearTriadItems.ts +23 -24
  145. package/utils/facets/triad/hexagon-triad/context.ts +25 -0
  146. package/utils/{hexTriad/createHexTriadGeometry.ts → facets/triad/hexagon-triad/createHexagonTriadGeometry.ts} +11 -27
  147. package/utils/facets/triad/hexagon-triad/index.ts +3 -0
  148. package/utils/facets/triad/hexagon-triad/resolveHexagonTriadItems.ts +60 -0
  149. package/utils/{shiftingHeading → layouts/shifting-heading}/collectShiftingIntroNodes.ts +1 -0
  150. package/utils/layouts/table-of-contents/calculateTocCenterAlignmentOffset.ts +17 -0
  151. package/utils/{tableOfContents → layouts/table-of-contents}/calculateTocMarkerPositions.ts +0 -12
  152. package/utils/{tableOfContents → layouts/table-of-contents}/createTocConnectorPath.ts +11 -5
  153. package/utils/{mergeUno → merge-uno}/classifyVisual.ts +1 -1
  154. package/utils/{mergeUno → merge-uno}/collectClassNames.ts +9 -3
  155. package/utils/process/arc-arrow-process/resolveArcArrowProcessItems.ts +180 -0
  156. package/utils/pyramid/circular-pyramid/context.ts +1 -4
  157. package/utils/pyramid/circular-pyramid/createCircularPyramidGeometry.ts +6 -10
  158. package/utils/pyramid/shared/colors.ts +33 -83
  159. package/utils/pyramid/shared/constants.ts +2 -2
  160. package/utils/pyramid/shared/types.ts +0 -5
  161. package/utils/pyramid/square-pyramid/context.ts +1 -4
  162. package/utils/pyramid/square-pyramid/createSquarePyramidGeometry.ts +6 -10
  163. package/utils/useDiagramAutoScale.ts +8 -6
  164. package/utils/useMergedUnoAttrs.ts +9 -5
  165. package/components/card/chevron-card/ChevronCardHeading.vue +0 -39
  166. package/components/card/horiz-card/HorizCardHeading.vue +0 -47
  167. package/components/card/vert-card/VertCardHeading.vue +0 -68
  168. package/components/card/vert-card/VertCardTitle.vue +0 -76
  169. package/components/comparisons/arc-comparison/ArcComparisonContents.vue +0 -17
  170. package/components/comparisons/arc-comparison/ArcComparisonTitle.vue +0 -29
  171. package/components/core/arc-orbit/ArcOrbitContents.vue +0 -18
  172. package/components/core/arc-orbit/ArcOrbitTitle.vue +0 -50
  173. package/components/defense-in-depth/arc-did/ArcDiDLayer.vue +0 -321
  174. package/components/defense-in-depth/arc-did/ArcDiDLayerParts.vue +0 -11
  175. package/components/facets/tetrad/rect-orbit-tetrad/RectOrbitTetradCenter.vue +0 -53
  176. package/components/facets/tetrad/rect-orbit-tetrad/RectOrbitTetradContent.vue +0 -39
  177. package/components/facets/tetrad/rect-orbit-tetrad/RectOrbitTetradHeading.vue +0 -44
  178. package/components/facets/triad/gear-triad/GearTriadContents.vue +0 -111
  179. package/components/facets/triad/gear-triad/GearTriadDescription.vue +0 -38
  180. package/components/facets/triad/hex-triad/HexTriadCenterBadge.vue +0 -51
  181. package/components/facets/triad/hex-triad/HexTriadContent.vue +0 -20
  182. package/components/facets/triad/hex-triad/HexTriadHeading.vue +0 -28
  183. package/layouts/core/table-of-contents.vue +0 -30
  184. package/utils/arcArrowProcess/resolveArcArrowProcessItems.ts +0 -189
  185. package/utils/arcComparison/resolveArcComparisonItems.ts +0 -102
  186. package/utils/chevronCard/createChevronCardGeometry.ts +0 -48
  187. package/utils/chevronCard/index.ts +0 -2
  188. package/utils/defenseInDepth/arcDid/index.ts +0 -3
  189. package/utils/defenseInDepth/index.ts +0 -2
  190. package/utils/defenseInDepth/shared/colors.ts +0 -121
  191. package/utils/defenseInDepth/shared/constants.ts +0 -14
  192. package/utils/defenseInDepth/shared/index.ts +0 -3
  193. package/utils/hexTriad/context.ts +0 -25
  194. package/utils/hexTriad/index.ts +0 -3
  195. package/utils/hexTriad/resolveHexTriadItems.ts +0 -63
  196. package/utils/horizCard/context.ts +0 -13
  197. package/utils/horizCard/index.ts +0 -2
  198. package/utils/pyramid/index.ts +0 -3
  199. package/utils/rectOrbitTetrad/context.ts +0 -31
  200. package/utils/rectOrbitTetrad/index.ts +0 -3
  201. package/utils/tableComparison/constants.ts +0 -72
  202. package/utils/tableOfContents/calculateTocCenterAlignmentOffset.ts +0 -11
  203. package/utils/vertCard/context.ts +0 -18
  204. package/utils/vertCard/index.ts +0 -2
  205. package/utils/{arcComparison → comparisons/arc-comparison}/index.ts +0 -0
  206. package/utils/{tableComparison → comparisons/table-comparison}/index.ts +0 -0
  207. package/utils/{arcOrbit → core/arc-orbit}/context.ts +0 -0
  208. package/utils/{arcOrbit → core/arc-orbit}/createArcOrbitGeometry.ts +0 -0
  209. package/utils/{arcOrbit → core/arc-orbit}/index.ts +0 -0
  210. package/utils/{arrowTriad → facets/triad/arrow-triad}/context.ts +0 -0
  211. package/utils/{arrowTriad → facets/triad/arrow-triad}/createArrowTriadGeometry.ts +0 -0
  212. package/utils/{arrowTriad → facets/triad/arrow-triad}/index.ts +0 -0
  213. package/utils/{gearTriad → facets/triad/gear-triad}/index.ts +0 -0
  214. package/utils/{tableOfContents → layouts/table-of-contents}/calculateUniformTocArticleWidth.ts +0 -0
  215. package/utils/{tableOfContents → layouts/table-of-contents}/createTocArcPath.ts +0 -0
  216. package/utils/{tableOfContents → layouts/table-of-contents}/index.ts +0 -0
  217. package/utils/{mergeUno → merge-uno}/classifyLayout.ts +0 -0
  218. package/utils/{mergeUno → merge-uno}/classifySimple.ts +0 -0
  219. package/utils/{mergeUno → merge-uno}/classifyTypography.ts +0 -0
  220. package/utils/{mergeUno → merge-uno}/classifyUtility.ts +0 -0
  221. package/utils/{mergeUno → merge-uno}/index.ts +0 -0
  222. package/utils/{mergeUno → merge-uno}/mergeClassValues.ts +0 -0
  223. package/utils/{mergeUno → merge-uno}/splitVariantScope.ts +1 -1
  224. package/utils/{mergeUno → merge-uno}/types.ts +0 -0
  225. package/utils/{arcArrowProcess → process/arc-arrow-process}/context.ts +1 -1
  226. /package/utils/{arcArrowProcess → process/arc-arrow-process}/createArcArrowProcessGeometry.ts +0 -0
  227. /package/utils/{arcArrowProcess → process/arc-arrow-process}/index.ts +0 -0
@@ -0,0 +1,47 @@
1
+ export const DEFAULT_COL_COLORS: readonly string[] = [
2
+ 'var(--alpha-table-comparison-col-1-background)',
3
+ 'var(--alpha-table-comparison-col-2-background)',
4
+ 'var(--alpha-table-comparison-col-3-background)',
5
+ 'var(--alpha-table-comparison-col-4-background)',
6
+ 'var(--alpha-table-comparison-col-5-background)',
7
+ ];
8
+
9
+ export const DEFAULT_ROW_HEADER_COLOR = 'var(--alpha-table-comparison-row-bg)';
10
+ export const DEFAULT_ROW_HEADER_TEXT_COLOR =
11
+ 'var(--alpha-table-comparison-row)';
12
+ export const DEFAULT_COL_HEADER_TEXT_COLOR =
13
+ 'var(--alpha-table-comparison-col)';
14
+ export const DEFAULT_CELL_BG = 'var(--alpha-table-comparison-cell-bg)';
15
+ export const DEFAULT_CELL_COLOR = 'var(--alpha-table-comparison-cell)';
16
+ export const DEFAULT_BORDER_RADIUS = '8px';
17
+ export const DEFAULT_SPACING = '6px';
18
+ export const DEFAULT_ROW_HEADER_WIDTH = '160px';
19
+
20
+ /**
21
+ * Resolves a dimension input (number or string) into a CSS-ready unit string.
22
+ */
23
+ export function resolveDimension(
24
+ value: number | string | undefined,
25
+ defaultUnit = 'px',
26
+ ): string | undefined {
27
+ if (value === undefined || value === null) {
28
+ return undefined;
29
+ }
30
+
31
+ if (typeof value === 'number') {
32
+ return `${value}${defaultUnit}`;
33
+ }
34
+
35
+ const trimmed = value.trim();
36
+
37
+ if (!trimmed) {
38
+ return undefined;
39
+ }
40
+
41
+ // If already contains unit or percentage or calc/var, return as is
42
+ if (/^[+-]?\d+(\.\d+)?$/.test(trimmed)) {
43
+ return `${trimmed}${defaultUnit}`;
44
+ }
45
+
46
+ return trimmed;
47
+ }
@@ -13,12 +13,12 @@ export interface ITableComparisonContext {
13
13
  readonly animation: ComputedRef<boolean>;
14
14
  }
15
15
 
16
- export interface ITableComparisonColsContext {
16
+ export interface ITableComparisonColumnsContext {
17
17
  readonly registerCol: () => number;
18
18
  }
19
19
 
20
20
  export const TABLE_COMPARISON_KEY: InjectionKey<ITableComparisonContext> =
21
21
  Symbol('TABLE_COMPARISON_KEY');
22
22
 
23
- export const TABLE_COMPARISON_COLS_KEY: InjectionKey<ITableComparisonColsContext> =
23
+ export const TABLE_COMPARISON_COLS_KEY: InjectionKey<ITableComparisonColumnsContext> =
24
24
  Symbol('TABLE_COMPARISON_COLS_KEY');
@@ -14,10 +14,7 @@ export interface IResolvedArcOrbitItem {
14
14
  readonly textColor?: string;
15
15
  }
16
16
 
17
- export const DEFAULT_ARC_ORBIT_COLOR = '#ea580c';
18
-
19
- export const DEFAULT_LOREM_TEXT =
20
- 'Lorem ipsum dolor sit amet, constitutor adipiscing elit. Nam vulputate augue vel ligula.';
17
+ export const DEFAULT_ARC_ORBIT_COLOR = 'var(--alpha-arc-orbit-accent)';
21
18
 
22
19
  export const DEFAULT_ARC_ORBIT_ITEMS: readonly [
23
20
  IResolvedArcOrbitItem,
@@ -27,26 +24,26 @@ export const DEFAULT_ARC_ORBIT_ITEMS: readonly [
27
24
  ] = [
28
25
  {
29
26
  id: '01',
30
- title: 'Add Text Here',
31
- description: DEFAULT_LOREM_TEXT,
27
+ title: '',
28
+ description: '',
32
29
  color: DEFAULT_ARC_ORBIT_COLOR,
33
30
  },
34
31
  {
35
32
  id: '02',
36
- title: 'Add Text Here',
37
- description: DEFAULT_LOREM_TEXT,
33
+ title: '',
34
+ description: '',
38
35
  color: DEFAULT_ARC_ORBIT_COLOR,
39
36
  },
40
37
  {
41
38
  id: '03',
42
- title: 'Add Text Here',
43
- description: DEFAULT_LOREM_TEXT,
39
+ title: '',
40
+ description: '',
44
41
  color: DEFAULT_ARC_ORBIT_COLOR,
45
42
  },
46
43
  {
47
44
  id: '04',
48
- title: 'Add Text Here',
49
- description: DEFAULT_LOREM_TEXT,
45
+ title: '',
46
+ description: '',
50
47
  color: DEFAULT_ARC_ORBIT_COLOR,
51
48
  },
52
49
  ];
@@ -73,9 +70,8 @@ export function resolveArcOrbitItems(
73
70
  ? custom.id
74
71
  : (defaultItem?.id ?? String(i + 1).padStart(2, '0'));
75
72
 
76
- const title = custom?.title ?? defaultItem?.title ?? 'Add Text Here';
77
- const description =
78
- custom?.description ?? defaultItem?.description ?? DEFAULT_LOREM_TEXT;
73
+ const title = custom?.title ?? defaultItem?.title ?? '';
74
+ const description = custom?.description ?? defaultItem?.description ?? '';
79
75
  const color = custom?.color ?? defaultColor;
80
76
  const textColor = custom?.textColor ?? defaultItem?.textColor;
81
77
 
@@ -1,35 +1,38 @@
1
1
  import type { ComputedRef, InjectionKey, Ref } from 'vue';
2
2
 
3
3
  import type {
4
- IArcDiDGeometry,
5
- IArcDiDLayerGeometry,
6
- IArcDiDPartItem,
7
- IArcDiDSectorGeometry,
8
- IArcDiDSectorItem,
9
- TArcDiDOrder,
4
+ IArcDefenseInDepthGeometry,
5
+ IArcDefenseInDepthLayerGeometry,
6
+ IArcDefenseInDepthPartItem,
7
+ IArcDefenseInDepthSectorGeometry,
8
+ IArcDefenseInDepthSectorItem,
9
+ TArcDefenseInDepthOrder,
10
+ TArcDefenseInDepthOrientation,
10
11
  } from './types';
11
12
 
12
- export interface IArcDiDRegisteredSectorData {
13
- readonly parts?: readonly IArcDiDPartItem[];
13
+ export interface IArcDefenseInDepthRegisteredSectorData {
14
+ readonly parts?: readonly IArcDefenseInDepthPartItem[];
14
15
  readonly split?: boolean;
15
16
  readonly angle?: number;
16
17
  readonly span?: number;
17
18
  readonly color?: string;
18
19
  readonly index?: number;
19
- readonly rotate?: boolean | number | 'tangent' | 'auto';
20
- readonly skew?: boolean | number | string;
20
+ readonly rotate?: TArcDefenseInDepthOrientation;
21
+ readonly skew?: TArcDefenseInDepthOrientation;
21
22
  }
22
23
 
23
- export interface IArcDiDRegisteredLayerData {
24
+ export interface IArcDefenseInDepthRegisteredLayerData {
24
25
  readonly title?: string;
25
26
  readonly color?: string;
26
- readonly parts?: readonly IArcDiDPartItem[];
27
- readonly sectors?: readonly IArcDiDSectorItem[];
27
+ readonly parts?: readonly IArcDefenseInDepthPartItem[];
28
+ readonly sectors?: readonly IArcDefenseInDepthSectorItem[];
28
29
  readonly index?: number;
30
+ readonly titleAngleSpan?: number;
31
+ readonly titleWidth?: number;
29
32
  }
30
33
 
31
- export interface IArcDiDRootContext {
32
- readonly geo: ComputedRef<IArcDiDGeometry>;
34
+ export interface IArcDefenseInDepthRootContext {
35
+ readonly geo: ComputedRef<IArcDefenseInDepthGeometry>;
33
36
  readonly count: ComputedRef<number>;
34
37
  readonly activeIndex: Ref<number> | ComputedRef<number>;
35
38
  readonly setActiveIndex: (index: number) => void;
@@ -45,39 +48,37 @@ export interface IArcDiDRootContext {
45
48
  ) => boolean;
46
49
  readonly color: ComputedRef<string>;
47
50
  readonly colors: ComputedRef<readonly string[] | undefined>;
48
- readonly order: ComputedRef<TArcDiDOrder>;
51
+ readonly order: ComputedRef<TArcDefenseInDepthOrder>;
49
52
  readonly animation: ComputedRef<boolean>;
50
53
  readonly interactive: ComputedRef<boolean>;
51
54
  readonly startDelay: ComputedRef<number>;
52
55
  readonly getLayerColor: (index: number) => string;
53
56
  readonly registerLayer: (
54
57
  token?: symbol,
55
- dataRef?: ComputedRef<IArcDiDRegisteredLayerData | undefined>,
58
+ dataRef?: ComputedRef<IArcDefenseInDepthRegisteredLayerData | undefined>,
56
59
  ) => {
57
60
  index: ComputedRef<number>;
58
61
  unregister: () => void;
59
62
  };
60
63
  }
61
64
 
62
- export interface IArcDiDSectorContext {
65
+ export interface IArcDefenseInDepthSectorContext {
63
66
  readonly sectorIndex: ComputedRef<number>;
64
- readonly sectorGeo: ComputedRef<IArcDiDSectorGeometry | undefined>;
65
- readonly rotate?: ComputedRef<
66
- boolean | number | 'tangent' | 'auto' | undefined
67
- >;
68
- readonly skew?: ComputedRef<boolean | number | string | undefined>;
67
+ readonly sectorGeo: ComputedRef<IArcDefenseInDepthSectorGeometry | undefined>;
68
+ readonly rotate?: ComputedRef<TArcDefenseInDepthOrientation | undefined>;
69
+ readonly skew?: ComputedRef<TArcDefenseInDepthOrientation | undefined>;
69
70
  readonly registerPart: (
70
71
  token?: symbol,
71
- partDataRef?: ComputedRef<IArcDiDPartItem | undefined>,
72
+ partDataRef?: ComputedRef<IArcDefenseInDepthPartItem | undefined>,
72
73
  ) => {
73
74
  index: ComputedRef<number>;
74
75
  unregister: () => void;
75
76
  };
76
77
  }
77
78
 
78
- export interface IArcDiDLayerContext {
79
+ export interface IArcDefenseInDepthLayerContext {
79
80
  readonly layerIndex: ComputedRef<number>;
80
- readonly layerGeo: ComputedRef<IArcDiDLayerGeometry | undefined>;
81
+ readonly layerGeo: ComputedRef<IArcDefenseInDepthLayerGeometry | undefined>;
81
82
  readonly isActive: ComputedRef<boolean>;
82
83
  readonly color: ComputedRef<string>;
83
84
  readonly textColor?: ComputedRef<string | undefined>;
@@ -86,25 +87,27 @@ export interface IArcDiDLayerContext {
86
87
  readonly partsCount: ComputedRef<number>;
87
88
  readonly registerPart: (
88
89
  token?: symbol,
89
- partDataRef?: ComputedRef<IArcDiDPartItem | undefined>,
90
+ partDataRef?: ComputedRef<IArcDefenseInDepthPartItem | undefined>,
90
91
  ) => {
91
92
  index: ComputedRef<number>;
92
93
  unregister: () => void;
93
94
  };
94
95
  readonly registerSector: (
95
96
  token?: symbol,
96
- sectorDataRef?: ComputedRef<IArcDiDRegisteredSectorData | undefined>,
97
+ sectorDataRef?: ComputedRef<
98
+ IArcDefenseInDepthRegisteredSectorData | undefined
99
+ >,
97
100
  ) => {
98
101
  index: ComputedRef<number>;
99
102
  unregister: () => void;
100
103
  };
101
104
  }
102
105
 
103
- export const ARC_DID_ROOT_KEY: InjectionKey<IArcDiDRootContext> =
106
+ export const ARC_DID_ROOT_KEY: InjectionKey<IArcDefenseInDepthRootContext> =
104
107
  Symbol('ARC_DID_ROOT_KEY');
105
108
 
106
- export const ARC_DID_LAYER_KEY: InjectionKey<IArcDiDLayerContext> =
109
+ export const ARC_DID_LAYER_KEY: InjectionKey<IArcDefenseInDepthLayerContext> =
107
110
  Symbol('ARC_DID_LAYER_KEY');
108
111
 
109
- export const ARC_DID_SECTOR_KEY: InjectionKey<IArcDiDSectorContext> =
112
+ export const ARC_DID_SECTOR_KEY: InjectionKey<IArcDefenseInDepthSectorContext> =
110
113
  Symbol('ARC_DID_SECTOR_KEY');
@@ -1,15 +1,15 @@
1
1
  import type {
2
- IArcDiDDecorativeArc,
3
- IArcDiDGeometry,
4
- IArcDiDLayerGeometry,
5
- IArcDiDLayerItem,
6
- IArcDiDPartGeometry,
7
- IArcDiDPartItem,
8
- IArcDiDPoint,
9
- IArcDiDSectorGeometry,
10
- IArcDiDSectorItem,
11
- ICreateArcDiDOptions,
12
- TArcDiDOrder,
2
+ IArcDefenseInDepthDecorativeArc,
3
+ IArcDefenseInDepthGeometry,
4
+ IArcDefenseInDepthLayerGeometry,
5
+ IArcDefenseInDepthLayerItem,
6
+ IArcDefenseInDepthPartGeometry,
7
+ IArcDefenseInDepthPartItem,
8
+ IArcDefenseInDepthPoint,
9
+ IArcDefenseInDepthSectorGeometry,
10
+ IArcDefenseInDepthSectorItem,
11
+ ICreateArcDefenseInDepthOptions,
12
+ TArcDefenseInDepthOrder,
13
13
  } from './types';
14
14
 
15
15
  export function round(val: number, decimals = 2): number {
@@ -22,7 +22,7 @@ export function polarToCartesian(
22
22
  cy: number,
23
23
  radius: number,
24
24
  angleInDegrees: number,
25
- ): IArcDiDPoint {
25
+ ): IArcDefenseInDepthPoint {
26
26
  const angleInRadians = (angleInDegrees * Math.PI) / 180;
27
27
  return {
28
28
  x: round(cx + radius * Math.cos(angleInRadians)),
@@ -68,19 +68,21 @@ export function describeArcBand(
68
68
  ].join(' ');
69
69
  }
70
70
 
71
- export interface IArcDiDSectorInfo {
71
+ export interface IArcDefenseInDepthSectorInfo {
72
72
  readonly startAngle: number;
73
73
  readonly endAngle: number;
74
74
  readonly midAngle: number;
75
75
  }
76
76
 
77
- export interface IArcDiDTitleAngles {
77
+ export interface IArcDefenseInDepthTitleAngles {
78
78
  readonly halfSpan: number;
79
79
  readonly titleLeft: number;
80
80
  readonly titleRight: number;
81
81
  }
82
82
 
83
- export function calculateTitleAngles(titleAngleSpan = 40): IArcDiDTitleAngles {
83
+ function calculateTitleAngles(
84
+ titleAngleSpan = 40,
85
+ ): IArcDefenseInDepthTitleAngles {
84
86
  const halfSpan = round(titleAngleSpan / 2, 2);
85
87
  const titleLeft = round(90 + halfSpan, 1);
86
88
  const titleRight = round(90 - halfSpan, 1);
@@ -92,7 +94,10 @@ function resolveSpansDistribution(
92
94
  totalSpan: number,
93
95
  inputSpans?: readonly (number | undefined)[],
94
96
  ): number[] {
95
- if (count <= 0) return [];
97
+ if (count <= 0) {
98
+ return [];
99
+ }
100
+
96
101
  if (
97
102
  !inputSpans ||
98
103
  inputSpans.length === 0 ||
@@ -106,6 +111,7 @@ function resolveSpansDistribution(
106
111
 
107
112
  for (let i = 0; i < count; i++) {
108
113
  const s = inputSpans[i];
114
+
109
115
  if (s !== undefined && s > 0) {
110
116
  specifiedSum += s;
111
117
  } else {
@@ -116,8 +122,10 @@ function resolveSpansDistribution(
116
122
  if (unspecifiedCount > 0) {
117
123
  const remaining = Math.max(0, totalSpan - specifiedSum);
118
124
  const perUnspecified = remaining / unspecifiedCount;
125
+
119
126
  return Array.from({ length: count }, (_, i) => {
120
127
  const s = inputSpans[i];
128
+
121
129
  return s !== undefined && s > 0 ? s : perUnspecified;
122
130
  });
123
131
  }
@@ -127,17 +135,18 @@ function resolveSpansDistribution(
127
135
  const headSpans = inputSpans.slice(0, count - 1).map((s) => s ?? 0);
128
136
  const headSum = headSpans.reduce((a, b) => a + b, 0);
129
137
  const lastSpan = Math.max(0, totalSpan - headSum);
138
+
130
139
  return [...headSpans, round(lastSpan, 2)];
131
140
  }
132
141
 
133
142
  return [totalSpan];
134
143
  }
135
144
 
136
- export function calculatePartSectors(
145
+ function calculatePartSectors(
137
146
  partCount: number,
138
147
  titleAngleSpan = 40,
139
148
  sectorSpans?: readonly (number | undefined)[],
140
- ): IArcDiDSectorInfo[] {
149
+ ): IArcDefenseInDepthSectorInfo[] {
141
150
  if (partCount <= 0) {
142
151
  return [];
143
152
  }
@@ -174,10 +183,11 @@ export function calculatePartSectors(
174
183
  rightSpansInput,
175
184
  );
176
185
 
177
- const sectors: IArcDiDSectorInfo[] = [];
186
+ const sectors: IArcDefenseInDepthSectorInfo[] = [];
178
187
 
179
188
  // Left sectors: 180 down to titleLeft
180
189
  let currentLeft = 180;
190
+
181
191
  for (let i = 0; i < leftCount; i++) {
182
192
  const span = leftAllocatedSpans[i] ?? totalLeftSpan / leftCount;
183
193
  const start = currentLeft;
@@ -192,6 +202,7 @@ export function calculatePartSectors(
192
202
 
193
203
  // Right sectors: titleRight down to 0
194
204
  let currentRight = titleRight;
205
+
195
206
  for (let j = 0; j < rightCount; j++) {
196
207
  const span = rightAllocatedSpans[j] ?? totalRightSpan / rightCount;
197
208
  const start = currentRight;
@@ -214,7 +225,7 @@ export function calculatePartAngles(
214
225
  return calculatePartSectors(partCount, titleAngleSpan).map((s) => s.midAngle);
215
226
  }
216
227
 
217
- export function resolveLayerTitleSpan(
228
+ function resolveLayerTitleSpan(
218
229
  midRadius: number,
219
230
  layerTitleAngleSpan?: number,
220
231
  globalTitleAngleSpan?: number,
@@ -223,10 +234,13 @@ export function resolveLayerTitleSpan(
223
234
  if (layerTitleAngleSpan !== undefined) {
224
235
  return Math.max(10, Math.min(80, layerTitleAngleSpan));
225
236
  }
237
+
226
238
  if (globalTitleAngleSpan !== undefined) {
227
239
  return Math.max(10, Math.min(80, globalTitleAngleSpan));
228
240
  }
241
+
229
242
  const computedAngle = (titleWidth / Math.max(1, midRadius)) * (180 / Math.PI);
243
+
230
244
  return Math.max(18, Math.min(50, round(computedAngle, 1)));
231
245
  }
232
246
 
@@ -235,13 +249,13 @@ export function createDecorativeArcs(
235
249
  _cy?: number,
236
250
  _outerRadius?: number,
237
251
  _innerRadius?: number,
238
- ): readonly IArcDiDDecorativeArc[] {
252
+ ): readonly IArcDefenseInDepthDecorativeArc[] {
239
253
  return [];
240
254
  }
241
255
 
242
- export function createArcDiDGeometry(
243
- options: ICreateArcDiDOptions = {},
244
- ): IArcDiDGeometry {
256
+ export function createArcDefenseInDepthGeometry(
257
+ options: ICreateArcDefenseInDepthOptions = {},
258
+ ): IArcDefenseInDepthGeometry {
245
259
  const viewBoxWidth = options.viewBoxWidth ?? 900;
246
260
  const viewBoxHeight = options.viewBoxHeight ?? 460;
247
261
  const cx = options.cx ?? round(viewBoxWidth / 2);
@@ -256,16 +270,17 @@ export function createArcDiDGeometry(
256
270
  const count = Math.max(0, Math.min(rawCount, 6));
257
271
 
258
272
  const gap = options.gap !== undefined ? Math.max(0, options.gap) : 0;
259
- const order: TArcDiDOrder = options.order ?? 'outer-to-inner';
273
+ const order: TArcDefenseInDepthOrder = options.order ?? 'outer-to-inner';
260
274
 
261
275
  const totalSpan = outerRadius - innerRadius;
262
276
  const totalGaps = count > 1 ? (count - 1) * gap : 0;
263
277
  const layerThickness =
264
278
  count > 0 ? Math.max(10, (totalSpan - totalGaps) / count) : 0;
265
279
 
266
- const layersData: readonly IArcDiDLayerItem[] = options.layers ?? [];
280
+ const layersData: readonly IArcDefenseInDepthLayerItem[] =
281
+ options.layers ?? [];
267
282
 
268
- const layers: IArcDiDLayerGeometry[] = [];
283
+ const layers: IArcDefenseInDepthLayerGeometry[] = [];
269
284
 
270
285
  if (count > 0) {
271
286
  for (let i = 0; i < count; i++) {
@@ -286,14 +301,18 @@ export function createArcDiDGeometry(
286
301
  const path = describeArcBand(cx, cy, rIn, rOut, 180, 0);
287
302
 
288
303
  const layerItem = layersData[i];
289
- let rawSectors: readonly IArcDiDSectorItem[] = [];
304
+ let rawSectors: readonly IArcDefenseInDepthSectorItem[] = [];
290
305
 
291
306
  if (layerItem?.sectors && layerItem.sectors.length > 0) {
292
307
  rawSectors = layerItem.sectors.map((s) => {
293
308
  if (Array.isArray(s)) {
294
- return { parts: s, split: false };
309
+ return {
310
+ parts: s,
311
+ split: false,
312
+ };
295
313
  }
296
- return s as IArcDiDSectorItem;
314
+
315
+ return s as IArcDefenseInDepthSectorItem;
297
316
  });
298
317
  } else if (layerItem?.parts && layerItem.parts.length > 0) {
299
318
  rawSectors = layerItem.parts.map((p) => {
@@ -303,9 +322,13 @@ export function createArcDiDGeometry(
303
322
  'parts' in p &&
304
323
  Array.isArray((p as { parts: unknown }).parts)
305
324
  ) {
306
- return p as IArcDiDSectorItem;
325
+ return p as IArcDefenseInDepthSectorItem;
307
326
  }
308
- return { parts: [p], split: false };
327
+
328
+ return {
329
+ parts: [p],
330
+ split: false,
331
+ };
309
332
  });
310
333
  }
311
334
 
@@ -335,8 +358,8 @@ export function createArcDiDGeometry(
335
358
  rawSectorSpans,
336
359
  );
337
360
 
338
- const sectors: IArcDiDSectorGeometry[] = [];
339
- const parts: IArcDiDPartGeometry[] = [];
361
+ const sectors: IArcDefenseInDepthSectorGeometry[] = [];
362
+ const parts: IArcDefenseInDepthPartGeometry[] = [];
340
363
 
341
364
  for (let s = 0; s < sectorCount; s++) {
342
365
  const sectorItem = rawSectors[s];
@@ -370,6 +393,7 @@ export function createArcDiDGeometry(
370
393
  numParts > 0 ? layerThickness / numParts : layerThickness;
371
394
 
372
395
  const dividerPaths: string[] = [];
396
+
373
397
  if (isSplit && numParts > 1) {
374
398
  for (let d = 1; d < numParts; d++) {
375
399
  const dividerRadius = round(rOut - d * trackThickness, 2);
@@ -379,16 +403,21 @@ export function createArcDiDGeometry(
379
403
  }
380
404
  }
381
405
 
382
- const sectorParts: IArcDiDPartGeometry[] = [];
406
+ const sectorParts: IArcDefenseInDepthPartGeometry[] = [];
383
407
 
384
408
  for (let p = 0; p < numParts; p++) {
385
409
  const rawPart = rawSectorParts[p];
386
- const partItem: IArcDiDPartItem =
410
+ const partItem: IArcDefenseInDepthPartItem =
387
411
  typeof rawPart === 'string'
388
- ? { label: rawPart }
389
- : (rawPart ?? { label: '' });
412
+ ? {
413
+ label: rawPart,
414
+ }
415
+ : (rawPart ?? {
416
+ label: '',
417
+ });
390
418
 
391
419
  let trackIndex = p;
420
+
392
421
  if (partItem.position === 'top') {
393
422
  trackIndex = 0;
394
423
  } else if (partItem.position === 'bottom') {
@@ -458,6 +487,7 @@ export function createArcDiDGeometry(
458
487
 
459
488
  const tangentAngle = round(90 - partAngle, 1);
460
489
  let rotationAngle: number | undefined;
490
+
461
491
  if (typeof effectiveRotate === 'number') {
462
492
  rotationAngle = effectiveRotate;
463
493
  } else if (
@@ -486,7 +516,7 @@ export function createArcDiDGeometry(
486
516
  : Number.parseInt(partItem.maxWidth, 10)
487
517
  : defaultMaxContentWidth;
488
518
 
489
- const partGeo: IArcDiDPartGeometry = {
519
+ const partGeo: IArcDefenseInDepthPartGeometry = {
490
520
  index: parts.length,
491
521
  sectorIndex: s,
492
522
  trackIndex,