@alphacifer/slidev-addon-theme 0.0.7 → 0.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +106 -76
- package/components/{chevron-card → card/chevron-card}/ChevronCard.vue +2 -2
- package/components/{chevron-card → card/chevron-card}/ChevronCardBadge.vue +1 -1
- package/components/{chevron-card → card/chevron-card}/ChevronCardContent.vue +1 -1
- package/components/{chevron-card → card/chevron-card}/ChevronCardHeading.vue +1 -1
- package/components/{horiz-card → card/horiz-card}/HorizCard.vue +2 -2
- package/components/{horiz-card → card/horiz-card}/HorizCardBadge.vue +2 -2
- package/components/{horiz-card → card/horiz-card}/HorizCardContent.vue +2 -2
- package/components/{horiz-card → card/horiz-card}/HorizCardHeading.vue +2 -2
- package/components/{horiz-card → card/horiz-card}/HorizCardIcon.vue +2 -2
- package/components/{vert-card → card/vert-card}/VertCard.vue +2 -2
- package/components/{vert-card → card/vert-card}/VertCardBadge.vue +5 -2
- package/components/{vert-card → card/vert-card}/VertCardContent.vue +2 -2
- package/components/{vert-card → card/vert-card}/VertCardHeading.vue +2 -2
- package/components/{vert-card → card/vert-card}/VertCardIcon.vue +2 -2
- package/components/{vert-card → card/vert-card}/VertCardTitle.vue +2 -2
- package/components/comparisons/arc-comparison/ArcComparison.vue +654 -0
- package/components/comparisons/arc-comparison/ArcComparisonBadge.vue +29 -0
- package/components/comparisons/arc-comparison/ArcComparisonContent.vue +29 -0
- package/components/comparisons/arc-comparison/ArcComparisonContents.vue +17 -0
- package/components/comparisons/arc-comparison/ArcComparisonHeading.vue +29 -0
- package/components/comparisons/arc-comparison/ArcComparisonLeft.vue +268 -0
- package/components/comparisons/arc-comparison/ArcComparisonOrbit.vue +47 -0
- package/components/comparisons/arc-comparison/ArcComparisonRight.vue +271 -0
- package/components/comparisons/arc-comparison/ArcComparisonTitle.vue +29 -0
- package/components/{comparison-table/ComparisonTable.vue → comparisons/table-comparison/TableComparison.vue} +37 -27
- package/components/{comparison-table/ComparisonTableCell.vue → comparisons/table-comparison/TableComparisonCell.vue} +8 -8
- package/components/{comparison-table/ComparisonTableCol.vue → comparisons/table-comparison/TableComparisonCol.vue} +10 -10
- package/components/{comparison-table/ComparisonTableCols.vue → comparisons/table-comparison/TableComparisonCols.vue} +11 -11
- package/components/{comparison-table/ComparisonTableRow.vue → comparisons/table-comparison/TableComparisonRow.vue} +9 -9
- package/components/{comparison-table/ComparisonTableRows.vue → comparisons/table-comparison/TableComparisonRows.vue} +3 -3
- package/components/core/ReflectedTitle.vue +2 -1
- package/components/core/arc-orbit/ArcOrbit.vue +468 -0
- package/components/{arc-compare/ArcCompareBadge.vue → core/arc-orbit/ArcOrbitBadge.vue} +11 -8
- package/components/core/arc-orbit/ArcOrbitCallout.vue +400 -0
- package/components/{arc-compare/ArcCompareContent.vue → core/arc-orbit/ArcOrbitContent.vue} +8 -8
- package/components/{arc-compare/ArcCompareContents.vue → core/arc-orbit/ArcOrbitContents.vue} +3 -3
- package/components/{arc-compare/ArcCompareHeading.vue → core/arc-orbit/ArcOrbitHeading.vue} +11 -8
- package/components/core/arc-orbit/ArcOrbitTitle.vue +50 -0
- package/components/{thanks → core/thanks}/ThanksOutlineSquare.vue +1 -1
- package/components/{thanks → core/thanks}/ThanksSquare.vue +1 -1
- package/components/{quad-hub/QuadHub.vue → facets/tetrad/rect-orbit-tetrad/RectOrbitTetrad.vue} +71 -69
- package/components/{quad-hub/QuadHubCallout.vue → facets/tetrad/rect-orbit-tetrad/RectOrbitTetradCallout.vue} +45 -43
- package/components/{quad-hub/QuadHubCenter.vue → facets/tetrad/rect-orbit-tetrad/RectOrbitTetradCenter.vue} +4 -4
- package/components/{quad-hub/QuadHubContent.vue → facets/tetrad/rect-orbit-tetrad/RectOrbitTetradContent.vue} +6 -6
- package/components/{quad-hub/QuadHubHeading.vue → facets/tetrad/rect-orbit-tetrad/RectOrbitTetradHeading.vue} +6 -6
- package/components/{quad-hub/QuadHubIcon.vue → facets/tetrad/rect-orbit-tetrad/RectOrbitTetradIcon.vue} +6 -6
- package/components/{arrow-triad → facets/triad/arrow-triad}/ArrowTriad.vue +3 -3
- package/components/{arrow-triad → facets/triad/arrow-triad}/ArrowTriadCallout.vue +1 -1
- package/components/{arrow-triad → facets/triad/arrow-triad}/ArrowTriadContent.vue +1 -1
- package/components/{arrow-triad → facets/triad/arrow-triad}/ArrowTriadHeading.vue +1 -1
- package/components/facets/triad/gear-triad/GearTriad.vue +591 -0
- package/components/facets/triad/gear-triad/GearTriadCallout.vue +285 -0
- package/components/facets/triad/gear-triad/GearTriadCenter.vue +41 -0
- package/components/facets/triad/gear-triad/GearTriadContent.vue +58 -0
- package/components/facets/triad/gear-triad/GearTriadContents.vue +111 -0
- package/components/facets/triad/gear-triad/GearTriadDescription.vue +38 -0
- package/components/facets/triad/gear-triad/GearTriadHeading.vue +38 -0
- package/components/facets/triad/gear-triad/GearTriadIcon.vue +157 -0
- package/components/{hex-triad → facets/triad/hex-triad}/HexTriad.vue +2 -2
- package/components/{hex-triad → facets/triad/hex-triad}/HexTriadBadge.vue +1 -1
- package/components/{hex-triad → facets/triad/hex-triad}/HexTriadCallout.vue +1 -1
- package/components/{hex-triad → facets/triad/hex-triad}/HexTriadHeading.vue +1 -1
- package/components/{arc-arrow-process → process/arc-arrow-process}/ArcArrowProcess.vue +2 -2
- package/components/{arc-arrow-process → process/arc-arrow-process}/ArcArrowProcessArrow.vue +1 -1
- package/components/{arc-arrow-process → process/arc-arrow-process}/ArcArrowProcessCallout.vue +1 -1
- package/components/{arc-arrow-process → process/arc-arrow-process}/ArcArrowProcessContent.vue +1 -1
- package/components/{arc-arrow-process → process/arc-arrow-process}/ArcArrowProcessHeading.vue +1 -1
- package/package.json +1 -1
- package/utils/arcComparison/context.ts +40 -0
- package/utils/arcComparison/createArcComparisonGeometry.ts +175 -0
- package/utils/arcComparison/index.ts +3 -0
- package/utils/{arcCompare/resolveArcCompareItems.ts → arcComparison/resolveArcComparisonItems.ts} +24 -45
- package/utils/arcOrbit/context.ts +38 -0
- package/utils/{arcCompare/createArcCompareGeometry.ts → arcOrbit/createArcOrbitGeometry.ts} +77 -108
- package/utils/arcOrbit/index.ts +3 -0
- package/utils/arcOrbit/resolveArcOrbitItems.ts +92 -0
- package/utils/gearTriad/context.ts +51 -0
- package/utils/gearTriad/createGearTriadGeometry.ts +210 -0
- package/utils/gearTriad/index.ts +3 -0
- package/utils/gearTriad/resolveGearTriadItems.ts +159 -0
- package/utils/rectOrbitTetrad/context.ts +31 -0
- package/utils/{quadHub/createQuadHubGeometry.ts → rectOrbitTetrad/createRectOrbitTetradGeometry.ts} +33 -28
- package/utils/rectOrbitTetrad/index.ts +3 -0
- package/utils/{quadHub/resolveQuadHubItems.ts → rectOrbitTetrad/resolveRectOrbitTetradItems.ts} +25 -25
- package/utils/{comparisonTable → tableComparison}/context.ts +6 -6
- package/utils/useDiagramAutoScale.ts +1 -1
- package/components/arc-compare/ArcCompare.vue +0 -443
- package/components/arc-compare/ArcCompareCallout.vue +0 -386
- package/components/arc-compare/ArcCompareLeft.vue +0 -183
- package/components/arc-compare/ArcCompareRight.vue +0 -183
- package/components/arc-compare/ArcCompareTitle.vue +0 -47
- package/utils/arcCompare/context.ts +0 -36
- package/utils/arcCompare/index.ts +0 -3
- package/utils/quadHub/context.ts +0 -26
- package/utils/quadHub/index.ts +0 -3
- /package/components/{shifting-heading → core}/TransitionHeading.vue +0 -0
- /package/components/{thanks → core/thanks}/ThanksContent.vue +0 -0
- /package/components/{arrow-triad → facets/triad/arrow-triad}/ArrowTriadIcon.vue +0 -0
- /package/components/{hex-triad → facets/triad/hex-triad}/HexTriadCenterBadge.vue +0 -0
- /package/components/{hex-triad → facets/triad/hex-triad}/HexTriadContent.vue +0 -0
- /package/components/{hex-triad → facets/triad/hex-triad}/HexTriadLayer.vue +0 -0
- /package/components/{arc-arrow-process → process/arc-arrow-process}/ArcArrowProcessIcon.vue +0 -0
- /package/utils/{comparisonTable → tableComparison}/constants.ts +0 -0
- /package/utils/{comparisonTable → tableComparison}/index.ts +0 -0
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
export type TGearTriadIcon =
|
|
2
|
+
| 'document'
|
|
3
|
+
| 'file'
|
|
4
|
+
| 'file-text'
|
|
5
|
+
| 'shield'
|
|
6
|
+
| 'shield-star'
|
|
7
|
+
| 'archive'
|
|
8
|
+
| 'box'
|
|
9
|
+
| 'package'
|
|
10
|
+
| 'gear'
|
|
11
|
+
| 'settings'
|
|
12
|
+
| string
|
|
13
|
+
| object
|
|
14
|
+
| false;
|
|
15
|
+
|
|
16
|
+
export interface IGearTriadItem {
|
|
17
|
+
readonly id?: string | number;
|
|
18
|
+
readonly color?: string;
|
|
19
|
+
readonly depthColor?: string;
|
|
20
|
+
readonly title?: string;
|
|
21
|
+
readonly description?: string;
|
|
22
|
+
readonly icon?: TGearTriadIcon;
|
|
23
|
+
readonly cardBg?: string;
|
|
24
|
+
readonly textColor?: string;
|
|
25
|
+
readonly titleColor?: string;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export interface IResolvedGearTriadItem {
|
|
29
|
+
readonly id: string | number;
|
|
30
|
+
readonly color: string;
|
|
31
|
+
readonly depthColor: string;
|
|
32
|
+
readonly title: string;
|
|
33
|
+
readonly description: string;
|
|
34
|
+
readonly icon?: TGearTriadIcon;
|
|
35
|
+
readonly cardBg?: string;
|
|
36
|
+
readonly textColor: string;
|
|
37
|
+
readonly titleColor: string;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
const DEFAULT_LOREM =
|
|
41
|
+
'There are many variations of passages of Lorem Ipsum available, but the majority have suffered alteration.';
|
|
42
|
+
|
|
43
|
+
const defaultItem0: IResolvedGearTriadItem = {
|
|
44
|
+
id: '01',
|
|
45
|
+
color: '#1fb5b5',
|
|
46
|
+
depthColor: '#126e7a',
|
|
47
|
+
title: 'Option 1',
|
|
48
|
+
description: DEFAULT_LOREM,
|
|
49
|
+
icon: undefined,
|
|
50
|
+
cardBg: undefined,
|
|
51
|
+
textColor: '#64748b',
|
|
52
|
+
titleColor: '#0f172a',
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
const defaultItem1: IResolvedGearTriadItem = {
|
|
56
|
+
id: '02',
|
|
57
|
+
color: '#f38942',
|
|
58
|
+
depthColor: '#aa521d',
|
|
59
|
+
title: 'Option 2',
|
|
60
|
+
description: DEFAULT_LOREM,
|
|
61
|
+
icon: undefined,
|
|
62
|
+
cardBg: undefined,
|
|
63
|
+
textColor: '#64748b',
|
|
64
|
+
titleColor: '#0f172a',
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
const defaultItem2: IResolvedGearTriadItem = {
|
|
68
|
+
id: '03',
|
|
69
|
+
color: '#f05367',
|
|
70
|
+
depthColor: '#a82c3c',
|
|
71
|
+
title: 'Option 3',
|
|
72
|
+
description: DEFAULT_LOREM,
|
|
73
|
+
icon: undefined,
|
|
74
|
+
cardBg: undefined,
|
|
75
|
+
textColor: '#64748b',
|
|
76
|
+
titleColor: '#0f172a',
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
export const DEFAULT_GEAR_TRIAD_ITEMS: readonly [
|
|
80
|
+
IResolvedGearTriadItem,
|
|
81
|
+
IResolvedGearTriadItem,
|
|
82
|
+
IResolvedGearTriadItem,
|
|
83
|
+
] = [defaultItem0, defaultItem1, defaultItem2];
|
|
84
|
+
|
|
85
|
+
export const GEAR_TRIAD_BASE_COLOR = '#11455c';
|
|
86
|
+
|
|
87
|
+
export function getDefaultGearTriadItem(index: number): IResolvedGearTriadItem {
|
|
88
|
+
const safe = Math.abs(index) % 3;
|
|
89
|
+
|
|
90
|
+
if (safe === 1) {
|
|
91
|
+
return defaultItem1;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
if (safe === 2) {
|
|
95
|
+
return defaultItem2;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
return defaultItem0;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
export function resolveSingleGearTriadItem(
|
|
102
|
+
item: IGearTriadItem | undefined,
|
|
103
|
+
fallbackIndex = 0,
|
|
104
|
+
): IResolvedGearTriadItem {
|
|
105
|
+
const fallback = getDefaultGearTriadItem(fallbackIndex);
|
|
106
|
+
|
|
107
|
+
if (!item) {
|
|
108
|
+
return fallback;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
return {
|
|
112
|
+
id: item.id ?? fallback.id,
|
|
113
|
+
color: item.color ?? fallback.color,
|
|
114
|
+
depthColor: item.depthColor ?? fallback.depthColor,
|
|
115
|
+
title: item.title ?? fallback.title,
|
|
116
|
+
description: item.description ?? fallback.description,
|
|
117
|
+
icon: item.icon !== undefined ? item.icon : fallback.icon,
|
|
118
|
+
cardBg: item.cardBg !== undefined ? item.cardBg : fallback.cardBg,
|
|
119
|
+
textColor: item.textColor ?? fallback.textColor,
|
|
120
|
+
titleColor: item.titleColor ?? fallback.titleColor,
|
|
121
|
+
};
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
export function resolveGearTriadItems(
|
|
125
|
+
items?: readonly IGearTriadItem[],
|
|
126
|
+
icons?: readonly (TGearTriadIcon | undefined)[],
|
|
127
|
+
): readonly [
|
|
128
|
+
IResolvedGearTriadItem,
|
|
129
|
+
IResolvedGearTriadItem,
|
|
130
|
+
IResolvedGearTriadItem,
|
|
131
|
+
] {
|
|
132
|
+
const item0 = items?.[0];
|
|
133
|
+
const item1 = items?.[1];
|
|
134
|
+
const item2 = items?.[2];
|
|
135
|
+
|
|
136
|
+
const merged0 = item0
|
|
137
|
+
? { icon: item0.icon ?? icons?.[0], ...item0 }
|
|
138
|
+
: icons?.[0] !== undefined
|
|
139
|
+
? { icon: icons[0] }
|
|
140
|
+
: undefined;
|
|
141
|
+
|
|
142
|
+
const merged1 = item1
|
|
143
|
+
? { icon: item1.icon ?? icons?.[1], ...item1 }
|
|
144
|
+
: icons?.[1] !== undefined
|
|
145
|
+
? { icon: icons[1] }
|
|
146
|
+
: undefined;
|
|
147
|
+
|
|
148
|
+
const merged2 = item2
|
|
149
|
+
? { icon: item2.icon ?? icons?.[2], ...item2 }
|
|
150
|
+
: icons?.[2] !== undefined
|
|
151
|
+
? { icon: icons[2] }
|
|
152
|
+
: undefined;
|
|
153
|
+
|
|
154
|
+
return [
|
|
155
|
+
resolveSingleGearTriadItem(merged0, 0),
|
|
156
|
+
resolveSingleGearTriadItem(merged1, 1),
|
|
157
|
+
resolveSingleGearTriadItem(merged2, 2),
|
|
158
|
+
];
|
|
159
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { ComputedRef, InjectionKey } from 'vue';
|
|
2
|
+
|
|
3
|
+
import type {
|
|
4
|
+
IRectOrbitTetradItem,
|
|
5
|
+
IResolvedRectOrbitTetradItem,
|
|
6
|
+
} from './resolveRectOrbitTetradItems';
|
|
7
|
+
|
|
8
|
+
export interface IRectOrbitTetradRegistration {
|
|
9
|
+
readonly index: number;
|
|
10
|
+
readonly item: ComputedRef<IResolvedRectOrbitTetradItem>;
|
|
11
|
+
readonly setCustomBadge?: (text: string | number) => void;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export interface IRectOrbitTetradRootContext {
|
|
15
|
+
readonly animation?: ComputedRef<boolean>;
|
|
16
|
+
readonly registerCallout: (
|
|
17
|
+
props?: IRectOrbitTetradItem,
|
|
18
|
+
) => IRectOrbitTetradRegistration;
|
|
19
|
+
readonly items: ComputedRef<readonly IResolvedRectOrbitTetradItem[]>;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export interface IRectOrbitTetradCalloutContext {
|
|
23
|
+
readonly index: number;
|
|
24
|
+
readonly item: ComputedRef<IResolvedRectOrbitTetradItem>;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export const RECT_ORBIT_TETRAD_ROOT_KEY: InjectionKey<IRectOrbitTetradRootContext> =
|
|
28
|
+
Symbol('RECT_ORBIT_TETRAD_ROOT_KEY');
|
|
29
|
+
|
|
30
|
+
export const RECT_ORBIT_TETRAD_CALLOUT_KEY: InjectionKey<IRectOrbitTetradCalloutContext> =
|
|
31
|
+
Symbol('RECT_ORBIT_TETRAD_CALLOUT_KEY');
|
package/utils/{quadHub/createQuadHubGeometry.ts → rectOrbitTetrad/createRectOrbitTetradGeometry.ts}
RENAMED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
export interface
|
|
1
|
+
export interface IRectOrbitPoint {
|
|
2
2
|
readonly x: number;
|
|
3
3
|
readonly y: number;
|
|
4
4
|
}
|
|
5
5
|
|
|
6
|
-
export interface
|
|
6
|
+
export interface IRectOrbitBox {
|
|
7
7
|
readonly x: number;
|
|
8
8
|
readonly y: number;
|
|
9
9
|
readonly rx: number;
|
|
@@ -11,26 +11,31 @@ export interface IQuadBox {
|
|
|
11
11
|
readonly height: number;
|
|
12
12
|
}
|
|
13
13
|
|
|
14
|
-
export interface
|
|
14
|
+
export interface IRectOrbitTetradCoordinates {
|
|
15
15
|
readonly centerX: number;
|
|
16
16
|
readonly centerY: number;
|
|
17
17
|
readonly arcPaths: readonly [string, string, string, string];
|
|
18
18
|
readonly arcRadius: number;
|
|
19
19
|
readonly hubRadius: number;
|
|
20
|
-
readonly quadrants: readonly [
|
|
20
|
+
readonly quadrants: readonly [
|
|
21
|
+
IRectOrbitBox,
|
|
22
|
+
IRectOrbitBox,
|
|
23
|
+
IRectOrbitBox,
|
|
24
|
+
IRectOrbitBox,
|
|
25
|
+
];
|
|
21
26
|
readonly viewBoxSize: number;
|
|
22
27
|
readonly iconPositions: readonly [
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
28
|
+
IRectOrbitPoint,
|
|
29
|
+
IRectOrbitPoint,
|
|
30
|
+
IRectOrbitPoint,
|
|
31
|
+
IRectOrbitPoint,
|
|
27
32
|
];
|
|
28
33
|
readonly arcBorderWidth: number;
|
|
29
34
|
readonly numberPositions: readonly [
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
35
|
+
IRectOrbitPoint,
|
|
36
|
+
IRectOrbitPoint,
|
|
37
|
+
IRectOrbitPoint,
|
|
38
|
+
IRectOrbitPoint,
|
|
34
39
|
];
|
|
35
40
|
}
|
|
36
41
|
|
|
@@ -54,7 +59,7 @@ function createArcPath(
|
|
|
54
59
|
return `M ${x1} ${y1} A ${radius} ${radius} 0 ${largeArcFlag} 1 ${x2} ${y2}`;
|
|
55
60
|
}
|
|
56
61
|
|
|
57
|
-
export interface
|
|
62
|
+
export interface ICalculateRectOrbitTetradCoordinatesParams {
|
|
58
63
|
readonly gap?: number;
|
|
59
64
|
readonly width?: number;
|
|
60
65
|
readonly height?: number;
|
|
@@ -69,14 +74,14 @@ export interface ICalculateQuadHubCoordinatesParams {
|
|
|
69
74
|
}
|
|
70
75
|
|
|
71
76
|
/**
|
|
72
|
-
* Calculates geometric coordinates for the
|
|
77
|
+
* Calculates geometric coordinates for the RectOrbitTetrad layout.
|
|
73
78
|
* Indices (Clockwise starting Top-Left):
|
|
74
79
|
* 0: Top-Left (01)
|
|
75
80
|
* 1: Top-Right (02)
|
|
76
81
|
* 2: Bottom-Right (03)
|
|
77
82
|
* 3: Bottom-Left (04)
|
|
78
83
|
*/
|
|
79
|
-
export function
|
|
84
|
+
export function calculateRectOrbitTetradCoordinates({
|
|
80
85
|
gap = 14,
|
|
81
86
|
width = 136,
|
|
82
87
|
height = 150,
|
|
@@ -88,14 +93,14 @@ export function calculateQuadHubCoordinates({
|
|
|
88
93
|
iconPaddingX = 30,
|
|
89
94
|
iconPaddingY = 32,
|
|
90
95
|
arcBorderWidth = 5,
|
|
91
|
-
}:
|
|
96
|
+
}: ICalculateRectOrbitTetradCoordinatesParams = {}): IRectOrbitTetradCoordinates {
|
|
92
97
|
const centerX = viewBoxSize / 2;
|
|
93
98
|
const centerY = viewBoxSize / 2;
|
|
94
99
|
const halfGap = gap / 2;
|
|
95
100
|
|
|
96
101
|
// Quadrants:
|
|
97
102
|
// 0: Top-Left (1)
|
|
98
|
-
const q0:
|
|
103
|
+
const q0: IRectOrbitBox = {
|
|
99
104
|
x: centerX - halfGap - width,
|
|
100
105
|
y: centerY - halfGap - height,
|
|
101
106
|
rx: cornerRadius,
|
|
@@ -104,7 +109,7 @@ export function calculateQuadHubCoordinates({
|
|
|
104
109
|
};
|
|
105
110
|
|
|
106
111
|
// 1: Top-Right (2)
|
|
107
|
-
const q1:
|
|
112
|
+
const q1: IRectOrbitBox = {
|
|
108
113
|
x: centerX + halfGap,
|
|
109
114
|
y: centerY - halfGap - height,
|
|
110
115
|
rx: cornerRadius,
|
|
@@ -113,7 +118,7 @@ export function calculateQuadHubCoordinates({
|
|
|
113
118
|
};
|
|
114
119
|
|
|
115
120
|
// 2: Bottom-Right (3)
|
|
116
|
-
const q2:
|
|
121
|
+
const q2: IRectOrbitBox = {
|
|
117
122
|
x: centerX + halfGap,
|
|
118
123
|
y: centerY + halfGap,
|
|
119
124
|
rx: cornerRadius,
|
|
@@ -122,7 +127,7 @@ export function calculateQuadHubCoordinates({
|
|
|
122
127
|
};
|
|
123
128
|
|
|
124
129
|
// 3: Bottom-Left (4)
|
|
125
|
-
const q3:
|
|
130
|
+
const q3: IRectOrbitBox = {
|
|
126
131
|
x: centerX - halfGap - width,
|
|
127
132
|
y: centerY + halfGap,
|
|
128
133
|
rx: cornerRadius,
|
|
@@ -137,44 +142,44 @@ export function calculateQuadHubCoordinates({
|
|
|
137
142
|
const offsetY = Number((numberRadius * Math.sin(rad)).toFixed(2));
|
|
138
143
|
|
|
139
144
|
// 0: Top-Left (1)
|
|
140
|
-
const num0:
|
|
145
|
+
const num0: IRectOrbitPoint = {
|
|
141
146
|
x: centerX - offsetX,
|
|
142
147
|
y: centerY - offsetY,
|
|
143
148
|
};
|
|
144
149
|
// 1: Top-Right (2)
|
|
145
|
-
const num1:
|
|
150
|
+
const num1: IRectOrbitPoint = {
|
|
146
151
|
x: centerX + offsetX,
|
|
147
152
|
y: centerY - offsetY,
|
|
148
153
|
};
|
|
149
154
|
// 2: Bottom-Right (3)
|
|
150
|
-
const num2:
|
|
155
|
+
const num2: IRectOrbitPoint = {
|
|
151
156
|
x: centerX + offsetX,
|
|
152
157
|
y: centerY + offsetY,
|
|
153
158
|
};
|
|
154
159
|
// 3: Bottom-Left (4)
|
|
155
|
-
const num3:
|
|
160
|
+
const num3: IRectOrbitPoint = {
|
|
156
161
|
x: centerX - offsetX,
|
|
157
162
|
y: centerY + offsetY,
|
|
158
163
|
};
|
|
159
164
|
|
|
160
165
|
// Icon positions (in outer corner of each block)
|
|
161
166
|
// 0: Top-Left (1)
|
|
162
|
-
const icon0:
|
|
167
|
+
const icon0: IRectOrbitPoint = {
|
|
163
168
|
x: q0.x + iconPaddingX,
|
|
164
169
|
y: q0.y + iconPaddingY,
|
|
165
170
|
};
|
|
166
171
|
// 1: Top-Right (2)
|
|
167
|
-
const icon1:
|
|
172
|
+
const icon1: IRectOrbitPoint = {
|
|
168
173
|
x: q1.x + q1.width - iconPaddingX,
|
|
169
174
|
y: q1.y + iconPaddingY,
|
|
170
175
|
};
|
|
171
176
|
// 2: Bottom-Right (3)
|
|
172
|
-
const icon2:
|
|
177
|
+
const icon2: IRectOrbitPoint = {
|
|
173
178
|
x: q2.x + q2.width - iconPaddingX,
|
|
174
179
|
y: q2.y + q2.height - iconPaddingY,
|
|
175
180
|
};
|
|
176
181
|
// 3: Bottom-Left (4)
|
|
177
|
-
const icon3:
|
|
182
|
+
const icon3: IRectOrbitPoint = {
|
|
178
183
|
x: q3.x + iconPaddingX,
|
|
179
184
|
y: q3.y + q3.height - iconPaddingY,
|
|
180
185
|
};
|
package/utils/{quadHub/resolveQuadHubItems.ts → rectOrbitTetrad/resolveRectOrbitTetradItems.ts}
RENAMED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { lightenColor } from './
|
|
1
|
+
import { lightenColor } from './createRectOrbitTetradGeometry';
|
|
2
2
|
|
|
3
|
-
export type
|
|
3
|
+
export type TRectOrbitTetradIcon = string | object | boolean;
|
|
4
4
|
|
|
5
|
-
export interface
|
|
5
|
+
export interface IRectOrbitTetradItem {
|
|
6
6
|
readonly id?: string | number;
|
|
7
7
|
/**
|
|
8
8
|
* Optional icon: icon class (e.g. 'i-lucide-user'), component object,
|
|
9
9
|
* built-in name ('user' | 'academic' | 'briefcase' | 'target'), or false to hide.
|
|
10
10
|
*/
|
|
11
|
-
readonly icon?:
|
|
11
|
+
readonly icon?: TRectOrbitTetradIcon;
|
|
12
12
|
readonly color?: string;
|
|
13
13
|
readonly cardBg?: string;
|
|
14
14
|
readonly arcColor?: string;
|
|
@@ -19,7 +19,7 @@ export interface IQuadHubItem {
|
|
|
19
19
|
readonly arcBorderRatio?: number;
|
|
20
20
|
}
|
|
21
21
|
|
|
22
|
-
export interface
|
|
22
|
+
export interface IResolvedRectOrbitTetradItem extends IRectOrbitTetradItem {
|
|
23
23
|
readonly id: string | number;
|
|
24
24
|
readonly color: string;
|
|
25
25
|
readonly cardBg: string;
|
|
@@ -29,11 +29,11 @@ export interface IResolvedQuadHubItem extends IQuadHubItem {
|
|
|
29
29
|
readonly arcBorderColor: string;
|
|
30
30
|
}
|
|
31
31
|
|
|
32
|
-
export const
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
32
|
+
export const DEFAULT_RECT_ORBIT_TETRAD_ITEMS: readonly [
|
|
33
|
+
IResolvedRectOrbitTetradItem,
|
|
34
|
+
IResolvedRectOrbitTetradItem,
|
|
35
|
+
IResolvedRectOrbitTetradItem,
|
|
36
|
+
IResolvedRectOrbitTetradItem,
|
|
37
37
|
] = [
|
|
38
38
|
// 0: Top-Left (01) - Golden Orange
|
|
39
39
|
{
|
|
@@ -118,11 +118,11 @@ export const DEFAULT_QUAD_HUB_ITEMS: readonly [
|
|
|
118
118
|
] as const;
|
|
119
119
|
|
|
120
120
|
export function resolveSingleItem(
|
|
121
|
-
defaultItem:
|
|
122
|
-
userItem?:
|
|
121
|
+
defaultItem: IResolvedRectOrbitTetradItem,
|
|
122
|
+
userItem?: IRectOrbitTetradItem,
|
|
123
123
|
defaultArcRatio = 0.55,
|
|
124
124
|
defaultArcBorderRatio = 0.8,
|
|
125
|
-
):
|
|
125
|
+
): IResolvedRectOrbitTetradItem {
|
|
126
126
|
const merged = {
|
|
127
127
|
...defaultItem,
|
|
128
128
|
...(userItem ?? {}),
|
|
@@ -169,43 +169,43 @@ export function resolveSingleItem(
|
|
|
169
169
|
};
|
|
170
170
|
}
|
|
171
171
|
|
|
172
|
-
export interface
|
|
173
|
-
readonly items?: readonly
|
|
172
|
+
export interface IResolveRectOrbitTetradItemsParams {
|
|
173
|
+
readonly items?: readonly IRectOrbitTetradItem[];
|
|
174
174
|
readonly arcRatio?: number;
|
|
175
175
|
readonly arcBorderRatio?: number;
|
|
176
176
|
}
|
|
177
177
|
|
|
178
|
-
export function
|
|
178
|
+
export function resolveRectOrbitTetradItems({
|
|
179
179
|
items = [],
|
|
180
180
|
arcRatio = 0.55,
|
|
181
181
|
arcBorderRatio = 0.8,
|
|
182
|
-
}:
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
182
|
+
}: IResolveRectOrbitTetradItemsParams = {}): readonly [
|
|
183
|
+
IResolvedRectOrbitTetradItem,
|
|
184
|
+
IResolvedRectOrbitTetradItem,
|
|
185
|
+
IResolvedRectOrbitTetradItem,
|
|
186
|
+
IResolvedRectOrbitTetradItem,
|
|
187
187
|
] {
|
|
188
188
|
return [
|
|
189
189
|
resolveSingleItem(
|
|
190
|
-
|
|
190
|
+
DEFAULT_RECT_ORBIT_TETRAD_ITEMS[0],
|
|
191
191
|
items[0],
|
|
192
192
|
arcRatio,
|
|
193
193
|
arcBorderRatio,
|
|
194
194
|
),
|
|
195
195
|
resolveSingleItem(
|
|
196
|
-
|
|
196
|
+
DEFAULT_RECT_ORBIT_TETRAD_ITEMS[1],
|
|
197
197
|
items[1],
|
|
198
198
|
arcRatio,
|
|
199
199
|
arcBorderRatio,
|
|
200
200
|
),
|
|
201
201
|
resolveSingleItem(
|
|
202
|
-
|
|
202
|
+
DEFAULT_RECT_ORBIT_TETRAD_ITEMS[2],
|
|
203
203
|
items[2],
|
|
204
204
|
arcRatio,
|
|
205
205
|
arcBorderRatio,
|
|
206
206
|
),
|
|
207
207
|
resolveSingleItem(
|
|
208
|
-
|
|
208
|
+
DEFAULT_RECT_ORBIT_TETRAD_ITEMS[3],
|
|
209
209
|
items[3],
|
|
210
210
|
arcRatio,
|
|
211
211
|
arcBorderRatio,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ComputedRef, InjectionKey } from 'vue';
|
|
2
2
|
|
|
3
|
-
export interface
|
|
3
|
+
export interface ITableComparisonContext {
|
|
4
4
|
readonly cellBg: ComputedRef<string>;
|
|
5
5
|
readonly cellColor: ComputedRef<string>;
|
|
6
6
|
readonly rowHeaderColor: ComputedRef<string>;
|
|
@@ -13,12 +13,12 @@ export interface IComparisonTableContext {
|
|
|
13
13
|
readonly animation: ComputedRef<boolean>;
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
-
export interface
|
|
16
|
+
export interface ITableComparisonColsContext {
|
|
17
17
|
readonly registerCol: () => number;
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
-
export const
|
|
21
|
-
Symbol('
|
|
20
|
+
export const TABLE_COMPARISON_KEY: InjectionKey<ITableComparisonContext> =
|
|
21
|
+
Symbol('TABLE_COMPARISON_KEY');
|
|
22
22
|
|
|
23
|
-
export const
|
|
24
|
-
Symbol('
|
|
23
|
+
export const TABLE_COMPARISON_COLS_KEY: InjectionKey<ITableComparisonColsContext> =
|
|
24
|
+
Symbol('TABLE_COMPARISON_COLS_KEY');
|
|
@@ -43,7 +43,7 @@ function resolveValue<T>(val: Ref<T> | (() => T) | undefined, fallback: T): T {
|
|
|
43
43
|
|
|
44
44
|
/**
|
|
45
45
|
* Automatically computes a scale factor (via CSS transform: scale)
|
|
46
|
-
* so that diagram components (ArrowTriad,
|
|
46
|
+
* so that diagram components (ArrowTriad, RectOrbitTetrad, ArcArrowProcess, etc.)
|
|
47
47
|
* fit comfortably inside the available slide canvas without clipping or overlaying pagination.
|
|
48
48
|
*/
|
|
49
49
|
export function useDiagramAutoScale(
|