@alphacifer/slidev-addon-theme 0.0.7 → 0.0.9
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 +186 -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/components/pyramid/circular-pyramid/CircularPyramid.vue +871 -0
- package/components/pyramid/circular-pyramid/CircularPyramidStack.vue +375 -0
- package/components/pyramid/circular-pyramid/CircularPyramidStackContent.vue +208 -0
- package/components/pyramid/circular-pyramid/CircularPyramidStackTitle.vue +138 -0
- package/components/pyramid/square-pyramid/SquarePyramid.vue +876 -0
- package/components/pyramid/square-pyramid/SquarePyramidStack.vue +366 -0
- package/components/pyramid/square-pyramid/SquarePyramidStackContent.vue +204 -0
- package/components/pyramid/square-pyramid/SquarePyramidStackTitle.vue +134 -0
- package/package.json +2 -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/pyramid/circular-pyramid/context.ts +46 -0
- package/utils/pyramid/circular-pyramid/createCircularPyramidGeometry.ts +143 -0
- package/utils/pyramid/circular-pyramid/index.ts +3 -0
- package/utils/pyramid/circular-pyramid/types.ts +34 -0
- package/utils/pyramid/index.ts +3 -0
- package/utils/pyramid/shared/colors.ts +92 -0
- package/utils/pyramid/shared/connector.ts +111 -0
- package/utils/pyramid/shared/constants.ts +8 -0
- package/utils/pyramid/shared/index.ts +5 -0
- package/utils/pyramid/shared/stacking.ts +76 -0
- package/utils/pyramid/shared/types.ts +36 -0
- package/utils/pyramid/square-pyramid/context.ts +46 -0
- package/utils/pyramid/square-pyramid/createSquarePyramidGeometry.ts +265 -0
- package/utils/pyramid/square-pyramid/index.ts +3 -0
- package/utils/pyramid/square-pyramid/types.ts +39 -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 +7 -9
- 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,400 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import {
|
|
3
|
+
computed,
|
|
4
|
+
Fragment,
|
|
5
|
+
inject,
|
|
6
|
+
onUnmounted,
|
|
7
|
+
provide,
|
|
8
|
+
useSlots,
|
|
9
|
+
type VNode,
|
|
10
|
+
} from 'vue';
|
|
11
|
+
|
|
12
|
+
import {
|
|
13
|
+
ARC_ORBIT_CALLOUT_KEY,
|
|
14
|
+
ARC_ORBIT_ROOT_KEY,
|
|
15
|
+
DEFAULT_ARC_ORBIT_COLOR,
|
|
16
|
+
DEFAULT_ARC_ORBIT_ITEMS,
|
|
17
|
+
type IArcOrbitItem,
|
|
18
|
+
type IResolvedArcOrbitItem,
|
|
19
|
+
type TArcOrbitPosition,
|
|
20
|
+
} from '../../../utils/arcOrbit';
|
|
21
|
+
import { useMergedUnoAttrs } from '../../../utils/useMergedUnoAttrs';
|
|
22
|
+
import ArcOrbitBadge from './ArcOrbitBadge.vue';
|
|
23
|
+
import ArcOrbitContent from './ArcOrbitContent.vue';
|
|
24
|
+
import ArcOrbitHeading from './ArcOrbitHeading.vue';
|
|
25
|
+
|
|
26
|
+
defineOptions({
|
|
27
|
+
inheritAttrs: false,
|
|
28
|
+
name: 'ArcOrbitCallout',
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
export interface IArcOrbitCalloutProps {
|
|
32
|
+
readonly position?: TArcOrbitPosition;
|
|
33
|
+
readonly index?: number;
|
|
34
|
+
readonly id?: string | number;
|
|
35
|
+
readonly title?: string;
|
|
36
|
+
readonly description?: string;
|
|
37
|
+
readonly color?: string;
|
|
38
|
+
readonly textColor?: string;
|
|
39
|
+
readonly textGap?: number;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
const props = withDefaults(defineProps<IArcOrbitCalloutProps>(), {
|
|
43
|
+
position: undefined,
|
|
44
|
+
index: undefined,
|
|
45
|
+
id: undefined,
|
|
46
|
+
title: undefined,
|
|
47
|
+
description: undefined,
|
|
48
|
+
color: undefined,
|
|
49
|
+
textColor: undefined,
|
|
50
|
+
textGap: undefined,
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
interface INamedComponent {
|
|
54
|
+
readonly name?: string;
|
|
55
|
+
readonly __name?: string;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
function hasComponentName(type: unknown, name: string): boolean {
|
|
59
|
+
if (typeof type === 'object' && type !== null) {
|
|
60
|
+
const comp = type as INamedComponent;
|
|
61
|
+
|
|
62
|
+
return comp.name === name || comp.__name === name;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
if (typeof type === 'function') {
|
|
66
|
+
return (type as { name?: string }).name === name;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
return false;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
const rootContext = inject(ARC_ORBIT_ROOT_KEY, undefined);
|
|
73
|
+
|
|
74
|
+
const resolvedPosition = computed<TArcOrbitPosition>(() => {
|
|
75
|
+
return props.position ?? rootContext?.position.value ?? 'left';
|
|
76
|
+
});
|
|
77
|
+
|
|
78
|
+
const isRight = computed(() => resolvedPosition.value === 'right');
|
|
79
|
+
|
|
80
|
+
const calloutToken = Symbol();
|
|
81
|
+
const dynamicIndex = rootContext?.registerCallout(calloutToken);
|
|
82
|
+
|
|
83
|
+
onUnmounted(() => {
|
|
84
|
+
rootContext?.unregisterCallout?.(calloutToken);
|
|
85
|
+
});
|
|
86
|
+
|
|
87
|
+
const resolvedIndex = computed<number>(() => {
|
|
88
|
+
if (props.index !== undefined) {
|
|
89
|
+
return Number(props.index);
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
if (dynamicIndex !== undefined) {
|
|
93
|
+
const val =
|
|
94
|
+
typeof dynamicIndex === 'number' ? dynamicIndex : dynamicIndex.value;
|
|
95
|
+
if (val >= 0) {
|
|
96
|
+
return val;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
return 0;
|
|
101
|
+
});
|
|
102
|
+
|
|
103
|
+
const activeItem = computed<IResolvedArcOrbitItem>(() => {
|
|
104
|
+
const customItems = rootContext?.items?.value;
|
|
105
|
+
const customItem = customItems?.[resolvedIndex.value];
|
|
106
|
+
const defaultItem =
|
|
107
|
+
DEFAULT_ARC_ORBIT_ITEMS[resolvedIndex.value] ??
|
|
108
|
+
DEFAULT_ARC_ORBIT_ITEMS[DEFAULT_ARC_ORBIT_ITEMS.length - 1] ??
|
|
109
|
+
DEFAULT_ARC_ORBIT_ITEMS[0];
|
|
110
|
+
|
|
111
|
+
const defaultColor = rootContext?.color.value ?? DEFAULT_ARC_ORBIT_COLOR;
|
|
112
|
+
|
|
113
|
+
const id = props.id ?? customItem?.id ?? defaultItem.id;
|
|
114
|
+
const title = props.title ?? customItem?.title ?? defaultItem.title;
|
|
115
|
+
const description =
|
|
116
|
+
props.description ?? customItem?.description ?? defaultItem.description;
|
|
117
|
+
const color =
|
|
118
|
+
props.color ?? customItem?.color ?? defaultColor ?? defaultItem.color;
|
|
119
|
+
const textColor =
|
|
120
|
+
props.textColor ?? customItem?.textColor ?? defaultItem.textColor;
|
|
121
|
+
|
|
122
|
+
return {
|
|
123
|
+
id,
|
|
124
|
+
title,
|
|
125
|
+
description,
|
|
126
|
+
color,
|
|
127
|
+
textColor,
|
|
128
|
+
};
|
|
129
|
+
});
|
|
130
|
+
|
|
131
|
+
const calloutColor = computed(() => {
|
|
132
|
+
return (
|
|
133
|
+
props.color ??
|
|
134
|
+
rootContext?.color.value ??
|
|
135
|
+
activeItem.value.color ??
|
|
136
|
+
DEFAULT_ARC_ORBIT_COLOR
|
|
137
|
+
);
|
|
138
|
+
});
|
|
139
|
+
|
|
140
|
+
provide(ARC_ORBIT_CALLOUT_KEY, {
|
|
141
|
+
item: activeItem,
|
|
142
|
+
position: resolvedPosition.value,
|
|
143
|
+
index: resolvedIndex.value,
|
|
144
|
+
color: calloutColor,
|
|
145
|
+
});
|
|
146
|
+
|
|
147
|
+
const slots = useSlots();
|
|
148
|
+
|
|
149
|
+
function isSignificantNode(node: VNode): boolean {
|
|
150
|
+
if (typeof node.type === 'symbol') {
|
|
151
|
+
if (typeof node.children === 'string' && !node.children.trim()) {
|
|
152
|
+
return false;
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
if (typeof node.children === 'string' && !node.children.trim()) {
|
|
157
|
+
return false;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
return true;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
function flattenVNodes(nodes: VNode[]): VNode[] {
|
|
164
|
+
const result: VNode[] = [];
|
|
165
|
+
|
|
166
|
+
for (const node of nodes) {
|
|
167
|
+
if (node.type === Fragment && Array.isArray(node.children)) {
|
|
168
|
+
result.push(...flattenVNodes(node.children as VNode[]));
|
|
169
|
+
} else if (isSignificantNode(node)) {
|
|
170
|
+
result.push(node);
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
return result;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
function isBadgeNode(node: VNode): boolean {
|
|
178
|
+
return (
|
|
179
|
+
hasComponentName(node.type, 'ArcOrbitBadge') ||
|
|
180
|
+
hasComponentName(node.type, 'ArcComparisonBadge') ||
|
|
181
|
+
node.type === ArcOrbitBadge
|
|
182
|
+
);
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
function isHeadingNode(node: VNode): boolean {
|
|
186
|
+
return (
|
|
187
|
+
hasComponentName(node.type, 'ArcOrbitHeading') ||
|
|
188
|
+
hasComponentName(node.type, 'ArcComparisonHeading') ||
|
|
189
|
+
node.type === ArcOrbitHeading
|
|
190
|
+
);
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
function isContentNode(node: VNode): boolean {
|
|
194
|
+
return (
|
|
195
|
+
hasComponentName(node.type, 'ArcOrbitContent') ||
|
|
196
|
+
hasComponentName(node.type, 'ArcComparisonContent') ||
|
|
197
|
+
node.type === ArcOrbitContent
|
|
198
|
+
);
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
const defaultNodes = computed(() => {
|
|
202
|
+
if (!slots.default) {
|
|
203
|
+
return [];
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
return flattenVNodes(slots.default());
|
|
207
|
+
});
|
|
208
|
+
|
|
209
|
+
const badgeNode = computed(() => defaultNodes.value.find(isBadgeNode));
|
|
210
|
+
const headingNode = computed(() => defaultNodes.value.find(isHeadingNode));
|
|
211
|
+
const contentNode = computed(() => defaultNodes.value.find(isContentNode));
|
|
212
|
+
const otherNodes = computed(() => {
|
|
213
|
+
return defaultNodes.value.filter((node) => {
|
|
214
|
+
return !isBadgeNode(node) && !isHeadingNode(node) && !isContentNode(node);
|
|
215
|
+
});
|
|
216
|
+
});
|
|
217
|
+
|
|
218
|
+
const animation = computed(() => rootContext?.animation?.value ?? true);
|
|
219
|
+
|
|
220
|
+
const positionStyle = computed(() => {
|
|
221
|
+
const right = isRight.value;
|
|
222
|
+
const calloutGeo = rootContext?.geo.value.callouts[resolvedIndex.value];
|
|
223
|
+
|
|
224
|
+
if (calloutGeo) {
|
|
225
|
+
if (right) {
|
|
226
|
+
return {
|
|
227
|
+
position: 'absolute' as const,
|
|
228
|
+
right: `${calloutGeo.badgeOffset}px`,
|
|
229
|
+
top: `${calloutGeo.top}px`,
|
|
230
|
+
width: `${calloutGeo.width}px`,
|
|
231
|
+
zIndex: 10,
|
|
232
|
+
};
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
return {
|
|
236
|
+
position: 'absolute' as const,
|
|
237
|
+
left: `${calloutGeo.badgeOffset}px`,
|
|
238
|
+
top: `${calloutGeo.top}px`,
|
|
239
|
+
width: `${calloutGeo.width}px`,
|
|
240
|
+
zIndex: 10,
|
|
241
|
+
};
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
const idx = Math.min(Math.max(resolvedIndex.value, 0), 2);
|
|
245
|
+
const offset = idx === 1 ? 184 : 134;
|
|
246
|
+
const topY = idx === 0 ? 66 : idx === 1 ? 214 : 362;
|
|
247
|
+
const w = idx === 1 ? 260 : 310;
|
|
248
|
+
|
|
249
|
+
if (right) {
|
|
250
|
+
return {
|
|
251
|
+
position: 'absolute' as const,
|
|
252
|
+
right: `${offset}px`,
|
|
253
|
+
top: `${topY}px`,
|
|
254
|
+
width: `${w}px`,
|
|
255
|
+
zIndex: 10,
|
|
256
|
+
};
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
return {
|
|
260
|
+
position: 'absolute' as const,
|
|
261
|
+
left: `${offset}px`,
|
|
262
|
+
top: `${topY}px`,
|
|
263
|
+
width: `${w}px`,
|
|
264
|
+
zIndex: 10,
|
|
265
|
+
};
|
|
266
|
+
});
|
|
267
|
+
|
|
268
|
+
const textStyle = computed(() => {
|
|
269
|
+
const calloutGeo = rootContext?.geo.value.callouts[resolvedIndex.value];
|
|
270
|
+
const gap = props.textGap ?? calloutGeo?.textGap ?? 28;
|
|
271
|
+
const width = calloutGeo?.textWidth ?? 215;
|
|
272
|
+
|
|
273
|
+
if (isRight.value) {
|
|
274
|
+
return {
|
|
275
|
+
marginRight: `${gap}px`,
|
|
276
|
+
width: `${width}px`,
|
|
277
|
+
};
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
return {
|
|
281
|
+
marginLeft: `${gap}px`,
|
|
282
|
+
width: `${width}px`,
|
|
283
|
+
};
|
|
284
|
+
});
|
|
285
|
+
|
|
286
|
+
const { className, forwardedAttrs } = useMergedUnoAttrs(
|
|
287
|
+
'alpha-arc-orbit-callout absolute flex items-start select-none z-10 transition-all duration-300 pointer-events-auto',
|
|
288
|
+
);
|
|
289
|
+
</script>
|
|
290
|
+
|
|
291
|
+
<template>
|
|
292
|
+
<div
|
|
293
|
+
v-bind="forwardedAttrs()"
|
|
294
|
+
:class="[
|
|
295
|
+
className(),
|
|
296
|
+
isRight ? 'justify-end text-right' : 'justify-start text-left',
|
|
297
|
+
`alpha-arc-orbit-callout--${resolvedPosition}-${resolvedIndex}`,
|
|
298
|
+
{ 'alpha-arc-orbit-callout--animated': animation },
|
|
299
|
+
]"
|
|
300
|
+
:style="positionStyle"
|
|
301
|
+
>
|
|
302
|
+
<!-- Left position: [Badge] [Heading + Content] -->
|
|
303
|
+
<template v-if="!isRight">
|
|
304
|
+
<component :is="badgeNode" v-if="badgeNode" />
|
|
305
|
+
<ArcOrbitBadge v-else />
|
|
306
|
+
<div
|
|
307
|
+
class="flex flex-col items-start text-left min-w-0 pt-0.5"
|
|
308
|
+
:style="textStyle"
|
|
309
|
+
>
|
|
310
|
+
<component :is="headingNode" v-if="headingNode" />
|
|
311
|
+
<ArcOrbitHeading v-else />
|
|
312
|
+
<component :is="contentNode" v-if="contentNode" />
|
|
313
|
+
<ArcOrbitContent v-else />
|
|
314
|
+
<component :is="node" v-for="(node, i) in otherNodes" :key="i" />
|
|
315
|
+
</div>
|
|
316
|
+
</template>
|
|
317
|
+
<!-- Right position: [Heading + Content] [Badge] -->
|
|
318
|
+
<template v-else>
|
|
319
|
+
<div
|
|
320
|
+
class="flex flex-col items-end text-right min-w-0 pt-0.5"
|
|
321
|
+
:style="textStyle"
|
|
322
|
+
>
|
|
323
|
+
<component :is="headingNode" v-if="headingNode" />
|
|
324
|
+
<ArcOrbitHeading v-else />
|
|
325
|
+
<component :is="contentNode" v-if="contentNode" />
|
|
326
|
+
<ArcOrbitContent v-else />
|
|
327
|
+
<component :is="node" v-for="(node, i) in otherNodes" :key="i" />
|
|
328
|
+
</div>
|
|
329
|
+
<component :is="badgeNode" v-if="badgeNode" />
|
|
330
|
+
<ArcOrbitBadge v-else />
|
|
331
|
+
</template>
|
|
332
|
+
</div>
|
|
333
|
+
</template>
|
|
334
|
+
|
|
335
|
+
<style scoped>
|
|
336
|
+
.alpha-arc-orbit-callout :deep(p),
|
|
337
|
+
.alpha-arc-orbit-callout :deep(h1),
|
|
338
|
+
.alpha-arc-orbit-callout :deep(h2),
|
|
339
|
+
.alpha-arc-orbit-callout :deep(h3),
|
|
340
|
+
.alpha-arc-orbit-callout :deep(h4),
|
|
341
|
+
.alpha-arc-orbit-callout :deep(h5),
|
|
342
|
+
.alpha-arc-orbit-callout :deep(h6) {
|
|
343
|
+
margin: 0;
|
|
344
|
+
padding: 0;
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
.alpha-arc-orbit-callout--animated.alpha-arc-orbit-callout--left-0 {
|
|
348
|
+
animation: arc-orbit-fade-left 450ms cubic-bezier(0.16, 1, 0.3, 1) calc(var(--arc-orbit-start-delay, 0ms) + 120ms) both;
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
.alpha-arc-orbit-callout--animated.alpha-arc-orbit-callout--left-1 {
|
|
352
|
+
animation: arc-orbit-fade-left 450ms cubic-bezier(0.16, 1, 0.3, 1) calc(var(--arc-orbit-start-delay, 0ms) + 200ms) both;
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
.alpha-arc-orbit-callout--animated.alpha-arc-orbit-callout--left-2 {
|
|
356
|
+
animation: arc-orbit-fade-left 450ms cubic-bezier(0.16, 1, 0.3, 1) calc(var(--arc-orbit-start-delay, 0ms) + 280ms) both;
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
.alpha-arc-orbit-callout--animated.alpha-arc-orbit-callout--left-3 {
|
|
360
|
+
animation: arc-orbit-fade-left 450ms cubic-bezier(0.16, 1, 0.3, 1) calc(var(--arc-orbit-start-delay, 0ms) + 360ms) both;
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
.alpha-arc-orbit-callout--animated.alpha-arc-orbit-callout--right-0 {
|
|
364
|
+
animation: arc-orbit-fade-right 450ms cubic-bezier(0.16, 1, 0.3, 1) calc(var(--arc-orbit-start-delay, 0ms) + 120ms) both;
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
.alpha-arc-orbit-callout--animated.alpha-arc-orbit-callout--right-1 {
|
|
368
|
+
animation: arc-orbit-fade-right 450ms cubic-bezier(0.16, 1, 0.3, 1) calc(var(--arc-orbit-start-delay, 0ms) + 200ms) both;
|
|
369
|
+
}
|
|
370
|
+
|
|
371
|
+
.alpha-arc-orbit-callout--animated.alpha-arc-orbit-callout--right-2 {
|
|
372
|
+
animation: arc-orbit-fade-right 450ms cubic-bezier(0.16, 1, 0.3, 1) calc(var(--arc-orbit-start-delay, 0ms) + 280ms) both;
|
|
373
|
+
}
|
|
374
|
+
|
|
375
|
+
.alpha-arc-orbit-callout--animated.alpha-arc-orbit-callout--right-3 {
|
|
376
|
+
animation: arc-orbit-fade-right 450ms cubic-bezier(0.16, 1, 0.3, 1) calc(var(--arc-orbit-start-delay, 0ms) + 360ms) both;
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
@keyframes arc-orbit-fade-left {
|
|
380
|
+
0% {
|
|
381
|
+
opacity: 0;
|
|
382
|
+
transform: translateX(-14px);
|
|
383
|
+
}
|
|
384
|
+
100% {
|
|
385
|
+
opacity: 1;
|
|
386
|
+
transform: translateX(0);
|
|
387
|
+
}
|
|
388
|
+
}
|
|
389
|
+
|
|
390
|
+
@keyframes arc-orbit-fade-right {
|
|
391
|
+
0% {
|
|
392
|
+
opacity: 0;
|
|
393
|
+
transform: translateX(14px);
|
|
394
|
+
}
|
|
395
|
+
100% {
|
|
396
|
+
opacity: 1;
|
|
397
|
+
transform: translateX(0);
|
|
398
|
+
}
|
|
399
|
+
}
|
|
400
|
+
</style>
|
|
@@ -2,25 +2,25 @@
|
|
|
2
2
|
import { computed, inject } from 'vue';
|
|
3
3
|
|
|
4
4
|
import {
|
|
5
|
-
|
|
5
|
+
ARC_ORBIT_CALLOUT_KEY,
|
|
6
6
|
DEFAULT_LOREM_TEXT,
|
|
7
|
-
} from '
|
|
8
|
-
import { useMergedUnoAttrs } from '
|
|
7
|
+
} from '../../../utils/arcOrbit';
|
|
8
|
+
import { useMergedUnoAttrs } from '../../../utils/useMergedUnoAttrs';
|
|
9
9
|
|
|
10
10
|
defineOptions({
|
|
11
11
|
inheritAttrs: false,
|
|
12
|
-
name: '
|
|
12
|
+
name: 'ArcOrbitContent',
|
|
13
13
|
});
|
|
14
14
|
|
|
15
|
-
export interface
|
|
15
|
+
export interface IArcOrbitContentProps {
|
|
16
16
|
readonly color?: string;
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
-
const props = withDefaults(defineProps<
|
|
19
|
+
const props = withDefaults(defineProps<IArcOrbitContentProps>(), {
|
|
20
20
|
color: undefined,
|
|
21
21
|
});
|
|
22
22
|
|
|
23
|
-
const calloutContext = inject(
|
|
23
|
+
const calloutContext = inject(ARC_ORBIT_CALLOUT_KEY, undefined);
|
|
24
24
|
|
|
25
25
|
const contentColor = computed(() => {
|
|
26
26
|
return props.color ?? calloutContext?.item.value.textColor ?? undefined;
|
|
@@ -37,7 +37,7 @@ const contentStyle = computed(() => {
|
|
|
37
37
|
});
|
|
38
38
|
|
|
39
39
|
const { className, forwardedAttrs } = useMergedUnoAttrs(
|
|
40
|
-
'alpha-arc-
|
|
40
|
+
'alpha-arc-orbit-content font-sans text-[0.78rem] leading-[1.3] text-slate-600 dark:text-slate-300 opacity-90',
|
|
41
41
|
);
|
|
42
42
|
</script>
|
|
43
43
|
|
package/components/{arc-compare/ArcCompareContents.vue → core/arc-orbit/ArcOrbitContents.vue}
RENAMED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import { useMergedUnoAttrs } from '
|
|
2
|
+
import { useMergedUnoAttrs } from '../../../utils/useMergedUnoAttrs';
|
|
3
3
|
|
|
4
4
|
defineOptions({
|
|
5
5
|
inheritAttrs: false,
|
|
6
|
-
name: '
|
|
6
|
+
name: 'ArcOrbitContents',
|
|
7
7
|
});
|
|
8
8
|
|
|
9
9
|
const { className, forwardedAttrs } = useMergedUnoAttrs(
|
|
10
|
-
'alpha-arc-
|
|
10
|
+
'alpha-arc-orbit-contents absolute inset-0 w-full h-full pointer-events-none',
|
|
11
11
|
);
|
|
12
12
|
</script>
|
|
13
13
|
|
|
@@ -1,30 +1,33 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import { computed, inject } from 'vue';
|
|
3
3
|
|
|
4
|
-
import {
|
|
5
|
-
|
|
4
|
+
import {
|
|
5
|
+
ARC_ORBIT_CALLOUT_KEY,
|
|
6
|
+
DEFAULT_ARC_ORBIT_COLOR,
|
|
7
|
+
} from '../../../utils/arcOrbit';
|
|
8
|
+
import { useMergedUnoAttrs } from '../../../utils/useMergedUnoAttrs';
|
|
6
9
|
|
|
7
10
|
defineOptions({
|
|
8
11
|
inheritAttrs: false,
|
|
9
|
-
name: '
|
|
12
|
+
name: 'ArcOrbitHeading',
|
|
10
13
|
});
|
|
11
14
|
|
|
12
|
-
export interface
|
|
15
|
+
export interface IArcOrbitHeadingProps {
|
|
13
16
|
readonly color?: string;
|
|
14
17
|
}
|
|
15
18
|
|
|
16
|
-
const props = withDefaults(defineProps<
|
|
19
|
+
const props = withDefaults(defineProps<IArcOrbitHeadingProps>(), {
|
|
17
20
|
color: undefined,
|
|
18
21
|
});
|
|
19
22
|
|
|
20
|
-
const calloutContext = inject(
|
|
23
|
+
const calloutContext = inject(ARC_ORBIT_CALLOUT_KEY, undefined);
|
|
21
24
|
|
|
22
25
|
const headingColor = computed(() => {
|
|
23
26
|
return (
|
|
24
27
|
props.color ??
|
|
25
28
|
calloutContext?.item.value.color ??
|
|
26
29
|
calloutContext?.color.value ??
|
|
27
|
-
|
|
30
|
+
DEFAULT_ARC_ORBIT_COLOR
|
|
28
31
|
);
|
|
29
32
|
});
|
|
30
33
|
|
|
@@ -37,7 +40,7 @@ const headingStyle = computed(() => {
|
|
|
37
40
|
});
|
|
38
41
|
|
|
39
42
|
const { className, forwardedAttrs } = useMergedUnoAttrs(
|
|
40
|
-
'alpha-arc-
|
|
43
|
+
'alpha-arc-orbit-heading font-bold text-[1.05rem] leading-tight mb-0.5 tracking-tight',
|
|
41
44
|
);
|
|
42
45
|
</script>
|
|
43
46
|
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { computed, inject } from 'vue';
|
|
3
|
+
|
|
4
|
+
import {
|
|
5
|
+
ARC_ORBIT_ROOT_KEY,
|
|
6
|
+
DEFAULT_ARC_ORBIT_COLOR,
|
|
7
|
+
} from '../../../utils/arcOrbit';
|
|
8
|
+
import { useMergedUnoAttrs } from '../../../utils/useMergedUnoAttrs';
|
|
9
|
+
|
|
10
|
+
defineOptions({
|
|
11
|
+
inheritAttrs: false,
|
|
12
|
+
name: 'ArcOrbitTitle',
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
export interface IArcOrbitTitleProps {
|
|
16
|
+
readonly color?: string;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
const props = withDefaults(defineProps<IArcOrbitTitleProps>(), {
|
|
20
|
+
color: undefined,
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
const rootContext = inject(ARC_ORBIT_ROOT_KEY, undefined);
|
|
24
|
+
|
|
25
|
+
const titleColor = computed(() => {
|
|
26
|
+
return props.color ?? rootContext?.color.value ?? DEFAULT_ARC_ORBIT_COLOR;
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
const titleStyle = computed(() => {
|
|
30
|
+
return {
|
|
31
|
+
color: titleColor.value,
|
|
32
|
+
fontFamily:
|
|
33
|
+
'ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',
|
|
34
|
+
};
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
const { className, forwardedAttrs } = useMergedUnoAttrs(
|
|
38
|
+
'alpha-arc-orbit-title font-bold text-center px-2 leading-tight flex items-center justify-center select-none text-[1.125rem] tracking-tight whitespace-pre-line',
|
|
39
|
+
);
|
|
40
|
+
</script>
|
|
41
|
+
|
|
42
|
+
<template>
|
|
43
|
+
<div
|
|
44
|
+
v-bind="forwardedAttrs()"
|
|
45
|
+
:class="className()"
|
|
46
|
+
:style="titleStyle"
|
|
47
|
+
>
|
|
48
|
+
<slot>{{ rootContext?.title.value ?? 'Add Topic\nTitle' }}</slot>
|
|
49
|
+
</div>
|
|
50
|
+
</template>
|