@alphacifer/slidev-addon-theme 0.0.6 → 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.
Files changed (105) hide show
  1. package/README.md +117 -51
  2. package/components/{chevron-card → card/chevron-card}/ChevronCard.vue +2 -2
  3. package/components/{chevron-card → card/chevron-card}/ChevronCardBadge.vue +1 -1
  4. package/components/{chevron-card → card/chevron-card}/ChevronCardContent.vue +1 -1
  5. package/components/{chevron-card → card/chevron-card}/ChevronCardHeading.vue +1 -1
  6. package/components/{horiz-card → card/horiz-card}/HorizCard.vue +2 -2
  7. package/components/{horiz-card → card/horiz-card}/HorizCardBadge.vue +2 -2
  8. package/components/{horiz-card → card/horiz-card}/HorizCardContent.vue +2 -2
  9. package/components/{horiz-card → card/horiz-card}/HorizCardHeading.vue +2 -2
  10. package/components/{horiz-card → card/horiz-card}/HorizCardIcon.vue +2 -2
  11. package/components/{vert-card → card/vert-card}/VertCard.vue +2 -2
  12. package/components/{vert-card → card/vert-card}/VertCardBadge.vue +5 -2
  13. package/components/{vert-card → card/vert-card}/VertCardContent.vue +2 -2
  14. package/components/{vert-card → card/vert-card}/VertCardHeading.vue +2 -2
  15. package/components/{vert-card → card/vert-card}/VertCardIcon.vue +2 -2
  16. package/components/{vert-card → card/vert-card}/VertCardTitle.vue +2 -2
  17. package/components/comparisons/arc-comparison/ArcComparison.vue +654 -0
  18. package/components/comparisons/arc-comparison/ArcComparisonBadge.vue +29 -0
  19. package/components/comparisons/arc-comparison/ArcComparisonContent.vue +29 -0
  20. package/components/comparisons/arc-comparison/ArcComparisonContents.vue +17 -0
  21. package/components/comparisons/arc-comparison/ArcComparisonHeading.vue +29 -0
  22. package/components/comparisons/arc-comparison/ArcComparisonLeft.vue +268 -0
  23. package/components/comparisons/arc-comparison/ArcComparisonOrbit.vue +47 -0
  24. package/components/comparisons/arc-comparison/ArcComparisonRight.vue +271 -0
  25. package/components/comparisons/arc-comparison/ArcComparisonTitle.vue +29 -0
  26. package/components/comparisons/table-comparison/TableComparison.vue +254 -0
  27. package/components/comparisons/table-comparison/TableComparisonCell.vue +88 -0
  28. package/components/comparisons/table-comparison/TableComparisonCol.vue +97 -0
  29. package/components/comparisons/table-comparison/TableComparisonCols.vue +74 -0
  30. package/components/comparisons/table-comparison/TableComparisonRow.vue +92 -0
  31. package/components/comparisons/table-comparison/TableComparisonRows.vue +21 -0
  32. package/components/core/ReflectedTitle.vue +2 -1
  33. package/components/core/arc-orbit/ArcOrbit.vue +468 -0
  34. package/components/{arc-compare/ArcCompareBadge.vue → core/arc-orbit/ArcOrbitBadge.vue} +11 -8
  35. package/components/core/arc-orbit/ArcOrbitCallout.vue +400 -0
  36. package/components/{arc-compare/ArcCompareContent.vue → core/arc-orbit/ArcOrbitContent.vue} +8 -8
  37. package/components/{arc-compare/ArcCompareContents.vue → core/arc-orbit/ArcOrbitContents.vue} +3 -3
  38. package/components/{arc-compare/ArcCompareHeading.vue → core/arc-orbit/ArcOrbitHeading.vue} +11 -8
  39. package/components/core/arc-orbit/ArcOrbitTitle.vue +50 -0
  40. package/components/{thanks → core/thanks}/ThanksOutlineSquare.vue +1 -1
  41. package/components/{thanks → core/thanks}/ThanksSquare.vue +1 -1
  42. package/components/{quad-hub/QuadHub.vue → facets/tetrad/rect-orbit-tetrad/RectOrbitTetrad.vue} +71 -69
  43. package/components/{quad-hub/QuadHubCallout.vue → facets/tetrad/rect-orbit-tetrad/RectOrbitTetradCallout.vue} +45 -43
  44. package/components/{quad-hub/QuadHubCenter.vue → facets/tetrad/rect-orbit-tetrad/RectOrbitTetradCenter.vue} +4 -4
  45. package/components/{quad-hub/QuadHubContent.vue → facets/tetrad/rect-orbit-tetrad/RectOrbitTetradContent.vue} +6 -6
  46. package/components/{quad-hub/QuadHubHeading.vue → facets/tetrad/rect-orbit-tetrad/RectOrbitTetradHeading.vue} +6 -6
  47. package/components/{quad-hub/QuadHubIcon.vue → facets/tetrad/rect-orbit-tetrad/RectOrbitTetradIcon.vue} +6 -6
  48. package/components/{arrow-triad → facets/triad/arrow-triad}/ArrowTriad.vue +3 -3
  49. package/components/{arrow-triad → facets/triad/arrow-triad}/ArrowTriadCallout.vue +1 -1
  50. package/components/{arrow-triad → facets/triad/arrow-triad}/ArrowTriadContent.vue +1 -1
  51. package/components/{arrow-triad → facets/triad/arrow-triad}/ArrowTriadHeading.vue +1 -1
  52. package/components/facets/triad/gear-triad/GearTriad.vue +591 -0
  53. package/components/facets/triad/gear-triad/GearTriadCallout.vue +285 -0
  54. package/components/facets/triad/gear-triad/GearTriadCenter.vue +41 -0
  55. package/components/facets/triad/gear-triad/GearTriadContent.vue +58 -0
  56. package/components/facets/triad/gear-triad/GearTriadContents.vue +111 -0
  57. package/components/facets/triad/gear-triad/GearTriadDescription.vue +38 -0
  58. package/components/facets/triad/gear-triad/GearTriadHeading.vue +38 -0
  59. package/components/facets/triad/gear-triad/GearTriadIcon.vue +157 -0
  60. package/components/{hex-triad → facets/triad/hex-triad}/HexTriad.vue +2 -2
  61. package/components/{hex-triad → facets/triad/hex-triad}/HexTriadBadge.vue +1 -1
  62. package/components/{hex-triad → facets/triad/hex-triad}/HexTriadCallout.vue +1 -1
  63. package/components/{hex-triad → facets/triad/hex-triad}/HexTriadHeading.vue +1 -1
  64. package/components/{arc-arrow-process → process/arc-arrow-process}/ArcArrowProcess.vue +2 -2
  65. package/components/{arc-arrow-process → process/arc-arrow-process}/ArcArrowProcessArrow.vue +1 -1
  66. package/components/{arc-arrow-process → process/arc-arrow-process}/ArcArrowProcessCallout.vue +1 -1
  67. package/components/{arc-arrow-process → process/arc-arrow-process}/ArcArrowProcessContent.vue +1 -1
  68. package/components/{arc-arrow-process → process/arc-arrow-process}/ArcArrowProcessHeading.vue +1 -1
  69. package/package.json +1 -1
  70. package/utils/arcComparison/context.ts +40 -0
  71. package/utils/arcComparison/createArcComparisonGeometry.ts +175 -0
  72. package/utils/arcComparison/index.ts +3 -0
  73. package/utils/{arcCompare/resolveArcCompareItems.ts → arcComparison/resolveArcComparisonItems.ts} +24 -45
  74. package/utils/arcOrbit/context.ts +38 -0
  75. package/utils/{arcCompare/createArcCompareGeometry.ts → arcOrbit/createArcOrbitGeometry.ts} +77 -108
  76. package/utils/arcOrbit/index.ts +3 -0
  77. package/utils/arcOrbit/resolveArcOrbitItems.ts +92 -0
  78. package/utils/gearTriad/context.ts +51 -0
  79. package/utils/gearTriad/createGearTriadGeometry.ts +210 -0
  80. package/utils/gearTriad/index.ts +3 -0
  81. package/utils/gearTriad/resolveGearTriadItems.ts +159 -0
  82. package/utils/rectOrbitTetrad/context.ts +31 -0
  83. package/utils/{quadHub/createQuadHubGeometry.ts → rectOrbitTetrad/createRectOrbitTetradGeometry.ts} +33 -28
  84. package/utils/rectOrbitTetrad/index.ts +3 -0
  85. package/utils/{quadHub/resolveQuadHubItems.ts → rectOrbitTetrad/resolveRectOrbitTetradItems.ts} +25 -25
  86. package/utils/tableComparison/constants.ts +72 -0
  87. package/utils/tableComparison/context.ts +24 -0
  88. package/utils/tableComparison/index.ts +2 -0
  89. package/utils/useDiagramAutoScale.ts +1 -1
  90. package/components/arc-compare/ArcCompare.vue +0 -443
  91. package/components/arc-compare/ArcCompareCallout.vue +0 -386
  92. package/components/arc-compare/ArcCompareLeft.vue +0 -183
  93. package/components/arc-compare/ArcCompareRight.vue +0 -183
  94. package/components/arc-compare/ArcCompareTitle.vue +0 -47
  95. package/utils/arcCompare/context.ts +0 -36
  96. package/utils/arcCompare/index.ts +0 -3
  97. package/utils/quadHub/context.ts +0 -26
  98. package/utils/quadHub/index.ts +0 -3
  99. /package/components/{shifting-heading → core}/TransitionHeading.vue +0 -0
  100. /package/components/{thanks → core/thanks}/ThanksContent.vue +0 -0
  101. /package/components/{arrow-triad → facets/triad/arrow-triad}/ArrowTriadIcon.vue +0 -0
  102. /package/components/{hex-triad → facets/triad/hex-triad}/HexTriadCenterBadge.vue +0 -0
  103. /package/components/{hex-triad → facets/triad/hex-triad}/HexTriadContent.vue +0 -0
  104. /package/components/{hex-triad → facets/triad/hex-triad}/HexTriadLayer.vue +0 -0
  105. /package/components/{arc-arrow-process → process/arc-arrow-process}/ArcArrowProcessIcon.vue +0 -0
@@ -1,183 +0,0 @@
1
- <script setup lang="ts">
2
- import {
3
- computed,
4
- Fragment,
5
- inject,
6
- onBeforeUpdate,
7
- provide,
8
- ref,
9
- useSlots,
10
- type VNode,
11
- } from 'vue';
12
-
13
- import {
14
- ARC_COMPARE_ROOT_KEY,
15
- ARC_COMPARE_SIDE_KEY,
16
- DEFAULT_RIGHT_COLOR,
17
- } from '../../utils/arcCompare';
18
- import { useMergedUnoAttrs } from '../../utils/useMergedUnoAttrs';
19
- import ArcCompareCallout from './ArcCompareCallout.vue';
20
- import ArcCompareContents from './ArcCompareContents.vue';
21
- import ArcCompareTitle from './ArcCompareTitle.vue';
22
-
23
- defineOptions({
24
- inheritAttrs: false,
25
- name: 'ArcCompareRight',
26
- });
27
-
28
- export interface IArcCompareRightProps {
29
- readonly color?: string;
30
- readonly title?: string;
31
- readonly count?: number;
32
- }
33
-
34
- const props = withDefaults(defineProps<IArcCompareRightProps>(), {
35
- color: DEFAULT_RIGHT_COLOR,
36
- title: undefined,
37
- count: undefined,
38
- });
39
-
40
- const rootContext = inject(ARC_COMPARE_ROOT_KEY, undefined);
41
-
42
- const slots = useSlots();
43
-
44
- interface INamedComponent {
45
- readonly name?: string;
46
- readonly __name?: string;
47
- }
48
-
49
- function hasComponentName(type: unknown, name: string): boolean {
50
- if (typeof type === 'object' && type !== null) {
51
- const comp = type as INamedComponent;
52
-
53
- return comp.name === name || comp.__name === name;
54
- }
55
-
56
- if (typeof type === 'function') {
57
- return (type as { name?: string }).name === name;
58
- }
59
-
60
- return false;
61
- }
62
-
63
- let calloutCounter = 0;
64
- onBeforeUpdate(() => {
65
- calloutCounter = 0;
66
- });
67
-
68
- const sideColor = computed(() => {
69
- return props.color ?? DEFAULT_RIGHT_COLOR;
70
- });
71
-
72
- const resolvedCount = computed(() => {
73
- return props.count ?? rootContext?.pointsCount.value ?? 3;
74
- });
75
-
76
- const currentTitle = ref<string>(props.title ?? 'Add Project\nName');
77
-
78
- provide(ARC_COMPARE_SIDE_KEY, {
79
- side: 'right',
80
- color: sideColor,
81
- title: computed(() => currentTitle.value),
82
- setTitle: (val: string) => {
83
- currentTitle.value = val;
84
- },
85
- registerCallout: () => {
86
- return calloutCounter++;
87
- },
88
- count: resolvedCount,
89
- });
90
-
91
- function isSignificantNode(node: VNode): boolean {
92
- if (typeof node.type === 'symbol') {
93
- if (typeof node.children === 'string' && !node.children.trim()) {
94
- return false;
95
- }
96
- }
97
-
98
- if (typeof node.children === 'string' && !node.children.trim()) {
99
- return false;
100
- }
101
-
102
- return true;
103
- }
104
-
105
- function flattenVNodes(nodes: VNode[]): VNode[] {
106
- const result: VNode[] = [];
107
-
108
- for (const node of nodes) {
109
- if (node.type === Fragment && Array.isArray(node.children)) {
110
- result.push(...flattenVNodes(node.children as VNode[]));
111
- } else if (isSignificantNode(node)) {
112
- result.push(node);
113
- }
114
- }
115
-
116
- return result;
117
- }
118
-
119
- function isTitleNode(node: VNode): boolean {
120
- return (
121
- hasComponentName(node.type, 'ArcCompareTitle') ||
122
- node.type === ArcCompareTitle
123
- );
124
- }
125
-
126
- const defaultNodes = computed(() => {
127
- if (!slots.default) {
128
- return [];
129
- }
130
-
131
- return flattenVNodes(slots.default());
132
- });
133
-
134
- const titleNode = computed(() => {
135
- return defaultNodes.value.find(isTitleNode);
136
- });
137
-
138
- const bodyNodes = computed(() => {
139
- return defaultNodes.value.filter((node) => !isTitleNode(node));
140
- });
141
-
142
- const hubStyle = computed(() => {
143
- const hubR = rootContext?.geo.value.right.hubRadius ?? 170;
144
- const centerY = rootContext?.geo.value.centerY ?? 240;
145
-
146
- return {
147
- top: `${centerY - hubR}px`,
148
- width: `${hubR}px`,
149
- height: `${hubR * 2}px`,
150
- };
151
- });
152
-
153
- const { className, forwardedAttrs } = useMergedUnoAttrs(
154
- 'alpha-arc-compare-right absolute inset-0 w-full h-full pointer-events-none',
155
- );
156
- </script>
157
-
158
- <template>
159
- <div v-bind="forwardedAttrs()" :class="className()">
160
- <!-- Right Hub Title Display -->
161
- <div
162
- class="alpha-arc-compare__hub-title alpha-arc-compare__hub-title--right absolute right-0 flex items-center justify-center z-10 pointer-events-auto"
163
- :style="hubStyle"
164
- >
165
- <component :is="titleNode" v-if="titleNode" />
166
- <ArcCompareTitle v-else-if="props.title">
167
- {{ props.title }}
168
- </ArcCompareTitle>
169
- <ArcCompareTitle v-else />
170
- </div>
171
- <!-- Contents & Callouts -->
172
- <template v-if="bodyNodes.length > 0">
173
- <component :is="node" v-for="(node, i) in bodyNodes" :key="i" />
174
- </template>
175
- <ArcCompareContents v-else>
176
- <ArcCompareCallout
177
- v-for="idx in resolvedCount"
178
- :key="idx"
179
- :index="idx - 1"
180
- />
181
- </ArcCompareContents>
182
- </div>
183
- </template>
@@ -1,47 +0,0 @@
1
- <script setup lang="ts">
2
- import { computed, inject } from 'vue';
3
-
4
- import { ARC_COMPARE_SIDE_KEY } from '../../utils/arcCompare';
5
- import { useMergedUnoAttrs } from '../../utils/useMergedUnoAttrs';
6
-
7
- defineOptions({
8
- inheritAttrs: false,
9
- name: 'ArcCompareTitle',
10
- });
11
-
12
- export interface IArcCompareTitleProps {
13
- readonly color?: string;
14
- }
15
-
16
- const props = withDefaults(defineProps<IArcCompareTitleProps>(), {
17
- color: undefined,
18
- });
19
-
20
- const sideContext = inject(ARC_COMPARE_SIDE_KEY, undefined);
21
-
22
- const titleColor = computed(() => {
23
- return props.color ?? sideContext?.color.value ?? '#e87a36';
24
- });
25
-
26
- const titleStyle = computed(() => {
27
- return {
28
- color: titleColor.value,
29
- fontFamily:
30
- 'ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',
31
- };
32
- });
33
-
34
- const { className, forwardedAttrs } = useMergedUnoAttrs(
35
- 'alpha-arc-compare-title font-bold text-center px-2 leading-tight flex items-center justify-center select-none text-[1.125rem] tracking-tight',
36
- );
37
- </script>
38
-
39
- <template>
40
- <div
41
- v-bind="forwardedAttrs()"
42
- :class="className()"
43
- :style="titleStyle"
44
- >
45
- <slot>Add Project<br />Name</slot>
46
- </div>
47
- </template>
@@ -1,36 +0,0 @@
1
- import type { ComputedRef, InjectionKey } from 'vue';
2
-
3
- import type { IArcCompareGeometry } from './createArcCompareGeometry';
4
- import type { IResolvedArcCompareItem } from './resolveArcCompareItems';
5
-
6
- export interface IArcCompareRootContext {
7
- readonly animation: ComputedRef<boolean>;
8
- readonly startDelay: ComputedRef<number>;
9
- readonly pointsCount: ComputedRef<number>;
10
- readonly geo: ComputedRef<IArcCompareGeometry>;
11
- }
12
-
13
- export interface IArcCompareSideContext {
14
- readonly side: 'left' | 'right';
15
- readonly color: ComputedRef<string>;
16
- readonly title: ComputedRef<string>;
17
- readonly setTitle: (title: string) => void;
18
- readonly registerCallout: () => number;
19
- readonly count: ComputedRef<number>;
20
- }
21
-
22
- export interface IArcCompareCalloutContext {
23
- readonly side: 'left' | 'right';
24
- readonly index: number;
25
- readonly color: ComputedRef<string>;
26
- readonly item: ComputedRef<IResolvedArcCompareItem>;
27
- }
28
-
29
- export const ARC_COMPARE_ROOT_KEY: InjectionKey<IArcCompareRootContext> =
30
- Symbol('ARC_COMPARE_ROOT_KEY');
31
-
32
- export const ARC_COMPARE_SIDE_KEY: InjectionKey<IArcCompareSideContext> =
33
- Symbol('ARC_COMPARE_SIDE_KEY');
34
-
35
- export const ARC_COMPARE_CALLOUT_KEY: InjectionKey<IArcCompareCalloutContext> =
36
- Symbol('ARC_COMPARE_CALLOUT_KEY');
@@ -1,3 +0,0 @@
1
- export * from './context';
2
- export * from './createArcCompareGeometry';
3
- export * from './resolveArcCompareItems';
@@ -1,26 +0,0 @@
1
- import type { ComputedRef, InjectionKey } from 'vue';
2
-
3
- import type { IQuadHubItem, IResolvedQuadHubItem } from './resolveQuadHubItems';
4
-
5
- export interface IQuadHubRegistration {
6
- readonly index: number;
7
- readonly item: ComputedRef<IResolvedQuadHubItem>;
8
- readonly setCustomBadge?: (text: string | number) => void;
9
- }
10
-
11
- export interface IQuadHubRootContext {
12
- readonly animation?: ComputedRef<boolean>;
13
- readonly registerCallout: (props?: IQuadHubItem) => IQuadHubRegistration;
14
- readonly items: ComputedRef<readonly IResolvedQuadHubItem[]>;
15
- }
16
-
17
- export interface IQuadHubCalloutContext {
18
- readonly index: number;
19
- readonly item: ComputedRef<IResolvedQuadHubItem>;
20
- }
21
-
22
- export const QUAD_HUB_ROOT_KEY: InjectionKey<IQuadHubRootContext> =
23
- Symbol('QUAD_HUB_ROOT_KEY');
24
-
25
- export const QUAD_HUB_CALLOUT_KEY: InjectionKey<IQuadHubCalloutContext> =
26
- Symbol('QUAD_HUB_CALLOUT_KEY');
@@ -1,3 +0,0 @@
1
- export * from './context';
2
- export * from './createQuadHubGeometry';
3
- export * from './resolveQuadHubItems';