@cellarnode/ui 0.209.2 → 0.210.0

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 (67) hide show
  1. package/dist/agent/confirm-card.d.ts +9 -0
  2. package/dist/agent/confirm-card.d.ts.map +1 -1
  3. package/dist/agent/confirm-card.js +28 -2
  4. package/dist/agent/confirm-card.js.map +1 -1
  5. package/dist/agent/conversation.d.ts +10 -0
  6. package/dist/agent/conversation.d.ts.map +1 -1
  7. package/dist/agent/conversation.js +4 -4
  8. package/dist/agent/conversation.js.map +1 -1
  9. package/dist/agent/index.d.ts +1 -1
  10. package/dist/agent/index.d.ts.map +1 -1
  11. package/dist/agent/index.js.map +1 -1
  12. package/dist/agent/message.d.ts +4 -1
  13. package/dist/agent/message.d.ts.map +1 -1
  14. package/dist/agent/message.js +2 -2
  15. package/dist/agent/message.js.map +1 -1
  16. package/dist/agent/schema.d.ts +25 -0
  17. package/dist/agent/schema.d.ts.map +1 -1
  18. package/dist/agent/schema.js +7 -0
  19. package/dist/agent/schema.js.map +1 -1
  20. package/dist/agent/states.d.ts +24 -1
  21. package/dist/agent/states.d.ts.map +1 -1
  22. package/dist/agent/states.js +35 -6
  23. package/dist/agent/states.js.map +1 -1
  24. package/dist/components/importer-picker-modal.js +5 -5
  25. package/dist/components/importer-picker-modal.js.map +1 -1
  26. package/dist/globe/svg-globe-geo.d.ts +16 -0
  27. package/dist/globe/svg-globe-geo.d.ts.map +1 -0
  28. package/dist/globe/svg-globe-geo.js +48 -0
  29. package/dist/globe/svg-globe-geo.js.map +1 -0
  30. package/dist/globe/svg-globe-map-layer.d.ts +18 -0
  31. package/dist/globe/svg-globe-map-layer.d.ts.map +1 -0
  32. package/dist/globe/svg-globe-map-layer.js +47 -0
  33. package/dist/globe/svg-globe-map-layer.js.map +1 -0
  34. package/dist/globe/svg-globe-pin-layer.d.ts +17 -0
  35. package/dist/globe/svg-globe-pin-layer.d.ts.map +1 -0
  36. package/dist/globe/svg-globe-pin-layer.js +111 -0
  37. package/dist/globe/svg-globe-pin-layer.js.map +1 -0
  38. package/dist/globe/svg-globe-renderer.d.ts +3 -0
  39. package/dist/globe/svg-globe-renderer.d.ts.map +1 -0
  40. package/dist/globe/svg-globe-renderer.js +57 -0
  41. package/dist/globe/svg-globe-renderer.js.map +1 -0
  42. package/dist/globe/svg-globe.css +247 -0
  43. package/dist/globe/svg-globe.d.ts +46 -0
  44. package/dist/globe/svg-globe.d.ts.map +1 -0
  45. package/dist/globe/svg-globe.js +45 -0
  46. package/dist/globe/svg-globe.js.map +1 -0
  47. package/dist/globe/svg.d.ts +9 -0
  48. package/dist/globe/svg.d.ts.map +1 -0
  49. package/dist/globe/svg.js +6 -0
  50. package/dist/globe/svg.js.map +1 -0
  51. package/dist/globe/use-svg-globe-gestures.d.ts +21 -0
  52. package/dist/globe/use-svg-globe-gestures.d.ts.map +1 -0
  53. package/dist/globe/use-svg-globe-gestures.js +190 -0
  54. package/dist/globe/use-svg-globe-gestures.js.map +1 -0
  55. package/dist/globe/use-svg-globe-item-interactions.d.ts +20 -0
  56. package/dist/globe/use-svg-globe-item-interactions.d.ts.map +1 -0
  57. package/dist/globe/use-svg-globe-item-interactions.js +66 -0
  58. package/dist/globe/use-svg-globe-item-interactions.js.map +1 -0
  59. package/dist/globe/use-svg-globe-navigation.d.ts +17 -0
  60. package/dist/globe/use-svg-globe-navigation.d.ts.map +1 -0
  61. package/dist/globe/use-svg-globe-navigation.js +107 -0
  62. package/dist/globe/use-svg-globe-navigation.js.map +1 -0
  63. package/dist/product-editor/product-editor-surface.d.ts.map +1 -1
  64. package/dist/product-editor/product-editor-surface.js +5 -3
  65. package/dist/product-editor/product-editor-surface.js.map +1 -1
  66. package/dist/product-editor/tabs/product-status-tab.js +4 -4
  67. package/package.json +14 -1
@@ -0,0 +1,247 @@
1
+ .cn-svg-globe {
2
+ --svg-globe-light: oklch(0.3 0.045 168);
3
+ --svg-globe-dark: oklch(0.23 0.04 168);
4
+ --svg-globe-demand: oklch(0.82 0.1 150);
5
+ --svg-globe-land: oklch(0.31 0.055 166);
6
+ --svg-globe-outline: oklch(0.23 0.04 168);
7
+ --svg-globe-selected: oklch(0.98 0.01 120);
8
+ --svg-globe-arc: oklch(0.82 0.1 90);
9
+ --svg-globe-offer: oklch(0.78 0.12 225);
10
+ --svg-globe-text: oklch(0.98 0.01 120);
11
+ --svg-globe-muted: oklch(0.68 0.03 160);
12
+ position: relative;
13
+ display: block;
14
+ width: 100%;
15
+ min-width: 0;
16
+ min-height: 15rem;
17
+ overflow: hidden;
18
+ color: var(--svg-globe-text);
19
+ isolation: isolate;
20
+ }
21
+
22
+ .cn-svg-globe__canvas {
23
+ display: block;
24
+ width: 100%;
25
+ height: 100%;
26
+ min-height: 15rem;
27
+ aspect-ratio: 1;
28
+ overflow: visible;
29
+ touch-action: none;
30
+ user-select: none;
31
+ cursor: grab;
32
+ }
33
+
34
+ .cn-svg-globe__canvas:active {
35
+ cursor: grabbing;
36
+ }
37
+
38
+ .cn-svg-globe__sphere {
39
+ stroke: var(--svg-globe-outline);
40
+ stroke-width: 0.75;
41
+ }
42
+
43
+ .cn-svg-globe__graticule {
44
+ fill: none;
45
+ stroke: var(--svg-globe-text);
46
+ stroke-opacity: 0.15;
47
+ stroke-width: 0.55;
48
+ pointer-events: none;
49
+ }
50
+
51
+ .cn-svg-globe__country {
52
+ outline: none;
53
+ transition: fill-opacity 160ms ease, stroke 160ms ease;
54
+ }
55
+
56
+ .cn-svg-globe__country[data-selected="true"] {
57
+ filter: drop-shadow(0 0 2px color-mix(in srgb, var(--svg-globe-selected) 72%, transparent));
58
+ }
59
+
60
+ .cn-svg-globe__country:focus-visible {
61
+ stroke: var(--svg-globe-selected);
62
+ stroke-width: 2.4;
63
+ }
64
+
65
+ .cn-svg-globe__arc {
66
+ fill: none;
67
+ stroke: var(--svg-globe-arc);
68
+ stroke-width: 1.65;
69
+ stroke-dasharray: 4 7;
70
+ stroke-dashoffset: var(--svg-globe-arc-phase, 0px);
71
+ stroke-linecap: round;
72
+ opacity: 0.82;
73
+ pointer-events: none;
74
+ animation: cn-svg-globe-arc-flow 4s linear infinite;
75
+ }
76
+
77
+ .cn-svg-globe__arc[data-arc-kind="offer"] {
78
+ stroke: var(--svg-globe-offer);
79
+ }
80
+
81
+ .cn-svg-globe__pin {
82
+ cursor: pointer;
83
+ outline: none;
84
+ }
85
+
86
+ .cn-svg-globe__pin-leader {
87
+ stroke: var(--svg-globe-demand);
88
+ stroke-opacity: 0.7;
89
+ stroke-width: 1;
90
+ pointer-events: none;
91
+ }
92
+
93
+ .cn-svg-globe__pin-halo {
94
+ fill: var(--svg-globe-demand);
95
+ opacity: 0.18;
96
+ pointer-events: none;
97
+ }
98
+
99
+ .cn-svg-globe__pin-core {
100
+ fill: var(--svg-globe-dark);
101
+ stroke: var(--svg-globe-demand);
102
+ stroke-width: 2;
103
+ }
104
+
105
+ .cn-svg-globe__pin-core[data-selected="true"] {
106
+ stroke: var(--svg-globe-selected);
107
+ stroke-width: 3;
108
+ }
109
+
110
+ .cn-svg-globe__pin text {
111
+ fill: var(--svg-globe-text);
112
+ font: 600 10px/1 ui-sans-serif, system-ui, sans-serif;
113
+ pointer-events: none;
114
+ }
115
+
116
+ .cn-svg-globe__pin:focus-visible .cn-svg-globe__pin-core {
117
+ stroke: var(--svg-globe-selected);
118
+ stroke-width: 3;
119
+ }
120
+
121
+ .cn-svg-globe__home {
122
+ fill: var(--svg-globe-selected);
123
+ stroke: var(--svg-globe-dark);
124
+ stroke-width: 1.5;
125
+ pointer-events: none;
126
+ }
127
+
128
+ .cn-svg-globe__tooltip {
129
+ position: absolute;
130
+ z-index: 1;
131
+ top: 0.75rem;
132
+ left: 50%;
133
+ display: flex;
134
+ max-width: min(85%, 22rem);
135
+ flex-direction: column;
136
+ align-items: center;
137
+ gap: 0.15rem;
138
+ padding: 0.5rem 0.75rem;
139
+ transform: translateX(-50%);
140
+ border: 1px solid color-mix(in srgb, var(--svg-globe-text) 22%, transparent);
141
+ border-radius: 0.65rem;
142
+ background: var(--svg-globe-dark);
143
+ color: var(--svg-globe-text);
144
+ text-align: center;
145
+ font-size: 0.75rem;
146
+ pointer-events: none;
147
+ }
148
+
149
+ .cn-svg-globe__tooltip span {
150
+ color: var(--svg-globe-muted);
151
+ font-size: 0.6875rem;
152
+ }
153
+
154
+ .cn-svg-globe__unavailable {
155
+ display: grid;
156
+ min-height: 15rem;
157
+ place-items: center;
158
+ padding: 1.5rem;
159
+ border: 1px solid color-mix(in srgb, var(--svg-globe-text) 20%, transparent);
160
+ border-radius: 0.75rem;
161
+ background: var(--svg-globe-dark);
162
+ color: var(--svg-globe-text);
163
+ text-align: center;
164
+ }
165
+
166
+ .cn-svg-globe__controls {
167
+ position: absolute;
168
+ right: 0.75rem;
169
+ bottom: 0.75rem;
170
+ display: inline-flex;
171
+ align-items: center;
172
+ gap: 0.2rem;
173
+ padding: 0.2rem;
174
+ border: 1px solid color-mix(in srgb, var(--svg-globe-text) 20%, transparent);
175
+ border-radius: 0.55rem;
176
+ background: var(--svg-globe-dark);
177
+ }
178
+
179
+ .cn-svg-globe__controls button {
180
+ display: grid;
181
+ width: 2.1rem;
182
+ height: 2.1rem;
183
+ place-items: center;
184
+ border: 0;
185
+ border-radius: 0.35rem;
186
+ background: transparent;
187
+ color: var(--svg-globe-text);
188
+ font: 500 1.2rem/1 ui-sans-serif, system-ui, sans-serif;
189
+ cursor: pointer;
190
+ }
191
+
192
+ .cn-svg-globe__controls button:hover:not(:disabled) {
193
+ background: color-mix(in srgb, var(--svg-globe-demand) 16%, transparent);
194
+ }
195
+
196
+ .cn-svg-globe__controls button:focus-visible {
197
+ outline: 2px solid var(--svg-globe-selected);
198
+ outline-offset: 1px;
199
+ }
200
+
201
+ .cn-svg-globe__controls button:disabled {
202
+ color: var(--svg-globe-muted);
203
+ cursor: not-allowed;
204
+ opacity: 0.55;
205
+ }
206
+
207
+ .cn-svg-globe__controls button svg {
208
+ width: 1rem;
209
+ height: 1rem;
210
+ fill: none;
211
+ stroke: currentColor;
212
+ stroke-linecap: round;
213
+ stroke-linejoin: round;
214
+ stroke-width: 1.8;
215
+ }
216
+
217
+ .cn-svg-globe__zoom-value {
218
+ min-width: 2.5rem;
219
+ color: var(--svg-globe-muted);
220
+ text-align: center;
221
+ font-size: 0.6875rem;
222
+ font-variant-numeric: tabular-nums;
223
+ }
224
+
225
+ .cn-svg-globe__sr-only {
226
+ position: absolute;
227
+ width: 1px;
228
+ height: 1px;
229
+ overflow: hidden;
230
+ clip: rect(0, 0, 0, 0);
231
+ white-space: nowrap;
232
+ clip-path: inset(50%);
233
+ }
234
+
235
+ @keyframes cn-svg-globe-arc-flow {
236
+ to {
237
+ stroke-dashoffset: calc(var(--svg-globe-arc-phase, 0px) - 44px);
238
+ }
239
+ }
240
+
241
+ @media (prefers-reduced-motion: reduce) {
242
+ .cn-svg-globe__arc,
243
+ .cn-svg-globe__country {
244
+ animation: none;
245
+ transition: none;
246
+ }
247
+ }
@@ -0,0 +1,46 @@
1
+ import { Component } from "react";
2
+ import type { ReactNode } from "react";
3
+ import type { GlobeArc, GlobeCountryDatum, GlobePoint } from "./globe-types.js";
4
+ export interface SvgGlobeLabels {
5
+ controls?: string;
6
+ unavailable?: string;
7
+ zoomIn?: string;
8
+ zoomOut?: string;
9
+ reset?: string;
10
+ home?: string;
11
+ }
12
+ export interface SvgGlobeProps {
13
+ countryData?: GlobeCountryDatum[];
14
+ points?: GlobePoint[];
15
+ arcs?: GlobeArc[];
16
+ homeCountryCode?: string | null;
17
+ selectedCountryCode?: string | null;
18
+ onCountryClick?: (code: string) => void;
19
+ onReady?: () => void;
20
+ className?: string;
21
+ ariaLabel?: string;
22
+ locale?: string;
23
+ labels?: SvgGlobeLabels;
24
+ }
25
+ interface SvgGlobeErrorBoundaryProps {
26
+ fallback: ReactNode;
27
+ children: ReactNode;
28
+ }
29
+ interface SvgGlobeErrorBoundaryState {
30
+ failed: boolean;
31
+ }
32
+ export declare class SvgGlobeErrorBoundary extends Component<SvgGlobeErrorBoundaryProps, SvgGlobeErrorBoundaryState> {
33
+ state: SvgGlobeErrorBoundaryState;
34
+ static getDerivedStateFromError(): SvgGlobeErrorBoundaryState;
35
+ render(): ReactNode;
36
+ }
37
+ interface SvgGlobeUnavailableProps {
38
+ ariaLabel: string;
39
+ message: string;
40
+ className?: string;
41
+ onReady: () => void;
42
+ }
43
+ export declare function SvgGlobeUnavailable({ ariaLabel, message, className, onReady, }: SvgGlobeUnavailableProps): import("react/jsx-runtime").JSX.Element;
44
+ export declare function SvgGlobe(props: SvgGlobeProps): import("react/jsx-runtime").JSX.Element;
45
+ export default SvgGlobe;
46
+ //# sourceMappingURL=svg-globe.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"svg-globe.d.ts","sourceRoot":"","sources":["../../src/globe/svg-globe.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAA2D,MAAM,OAAO,CAAC;AAC3F,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,OAAO,KAAK,EAAE,QAAQ,EAAE,iBAAiB,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE7E,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,aAAa;IAC5B,WAAW,CAAC,EAAE,iBAAiB,EAAE,CAAC;IAClC,MAAM,CAAC,EAAE,UAAU,EAAE,CAAC;IACtB,IAAI,CAAC,EAAE,QAAQ,EAAE,CAAC;IAClB,eAAe,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,mBAAmB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACpC,cAAc,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACxC,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,cAAc,CAAC;CACzB;AAID,UAAU,0BAA0B;IAClC,QAAQ,EAAE,SAAS,CAAC;IACpB,QAAQ,EAAE,SAAS,CAAC;CACrB;AAED,UAAU,0BAA0B;IAClC,MAAM,EAAE,OAAO,CAAC;CACjB;AAED,qBAAa,qBAAsB,SAAQ,SAAS,CAClD,0BAA0B,EAC1B,0BAA0B,CAC3B;IACC,KAAK,EAAE,0BAA0B,CAAqB;IAEtD,MAAM,CAAC,wBAAwB,IAAI,0BAA0B;IAI7D,MAAM;CAGP;AAED,UAAU,wBAAwB;IAChC,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB;AAED,wBAAgB,mBAAmB,CAAC,EAClC,SAAS,EACT,OAAO,EACP,SAAS,EACT,OAAO,GACR,EAAE,wBAAwB,2CAyB1B;AAED,wBAAgB,QAAQ,CAAC,KAAK,EAAE,aAAa,2CAwC5C;AAED,eAAe,QAAQ,CAAC"}
@@ -0,0 +1,45 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { Component, lazy, Suspense, useCallback, useEffect, useMemo, useRef } from "react";
3
+ import { GlobeLoadingSkeleton } from "./globe-loading-skeleton.js";
4
+ const SvgGlobeRenderer = lazy(() => import("./svg-globe-renderer.js"));
5
+ export class SvgGlobeErrorBoundary extends Component {
6
+ state = { failed: false };
7
+ static getDerivedStateFromError() {
8
+ return { failed: true };
9
+ }
10
+ render() {
11
+ return this.state.failed ? this.props.fallback : this.props.children;
12
+ }
13
+ }
14
+ export function SvgGlobeUnavailable({ ariaLabel, message, className, onReady, }) {
15
+ useEffect(() => {
16
+ let first = 0;
17
+ let second = 0;
18
+ first = requestAnimationFrame(() => {
19
+ second = requestAnimationFrame(onReady);
20
+ });
21
+ return () => {
22
+ cancelAnimationFrame(first);
23
+ cancelAnimationFrame(second);
24
+ };
25
+ }, [onReady]);
26
+ return (_jsx("div", { className: `cn-svg-globe${className ? ` ${className}` : ""}`, children: _jsx("div", { className: "cn-svg-globe__unavailable", role: "status", "aria-label": ariaLabel, "aria-live": "polite", children: message }) }));
27
+ }
28
+ export function SvgGlobe(props) {
29
+ const readyRef = useRef(false);
30
+ const onReadyRef = useRef(props.onReady);
31
+ useEffect(() => {
32
+ onReadyRef.current = props.onReady;
33
+ }, [props.onReady]);
34
+ const notifyReady = useCallback(() => {
35
+ if (readyRef.current)
36
+ return;
37
+ readyRef.current = true;
38
+ onReadyRef.current?.();
39
+ }, []);
40
+ const fallback = useMemo(() => (_jsx(GlobeLoadingSkeleton, { className: props.className, label: props.ariaLabel ?? "Loading market globe" })), [props.ariaLabel, props.className]);
41
+ const unavailable = useMemo(() => (_jsx(SvgGlobeUnavailable, { ariaLabel: props.ariaLabel ?? "Market demand globe", message: props.labels?.unavailable ?? "Globe visualization unavailable", className: props.className, onReady: notifyReady })), [notifyReady, props.ariaLabel, props.className, props.labels?.unavailable]);
42
+ return (_jsx(SvgGlobeErrorBoundary, { fallback: unavailable, children: _jsx(Suspense, { fallback: fallback, children: _jsx(SvgGlobeRenderer, { ...props, onReady: notifyReady }) }) }));
43
+ }
44
+ export default SvgGlobe;
45
+ //# sourceMappingURL=svg-globe.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"svg-globe.js","sourceRoot":"","sources":["../../src/globe/svg-globe.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,EAAE,MAA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AAQ,EAAE,QAAQ,YAC1B,KAAC,gBAAgB,OAAK,KAAK,EAAE,OAAO,EAAE,WAAW,GAAI,GAC5C,GACW,CACzB,CAAC;AACJ,CAAC;AAED,eAAe,QAAQ,CAAC"}
@@ -0,0 +1,9 @@
1
+ export { SvgGlobe } from "./svg-globe.js";
2
+ export type { SvgGlobeLabels, SvgGlobeProps } from "./svg-globe.js";
3
+ export { aggregateCountryNodes, magnitudeArcs } from "./globe-aggregation.js";
4
+ export { countryCoords } from "./country-coords.js";
5
+ export { GlobeDetailPanel } from "./globe-detail-panel.js";
6
+ export type { GlobeDetailPanelProps } from "./globe-detail-panel.js";
7
+ export { GlobeLoadingSkeleton } from "./globe-loading-skeleton.js";
8
+ export type { GlobeArc, GlobeCountryDatum, GlobePoint } from "./globe-types.js";
9
+ //# sourceMappingURL=svg.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"svg.d.ts","sourceRoot":"","sources":["../../src/globe/svg.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,YAAY,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AACjE,OAAO,EAAE,qBAAqB,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAC3E,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACxD,YAAY,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAClE,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAChE,YAAY,EAAE,QAAQ,EAAE,iBAAiB,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC"}
@@ -0,0 +1,6 @@
1
+ export { SvgGlobe } from "./svg-globe.js";
2
+ export { aggregateCountryNodes, magnitudeArcs } from "./globe-aggregation.js";
3
+ export { countryCoords } from "./country-coords.js";
4
+ export { GlobeDetailPanel } from "./globe-detail-panel.js";
5
+ export { GlobeLoadingSkeleton } from "./globe-loading-skeleton.js";
6
+ //# sourceMappingURL=svg.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"svg.js","sourceRoot":"","sources":["../../src/globe/svg.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAEvC,OAAO,EAAE,qBAAqB,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAC3E,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAExD,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC"}
@@ -0,0 +1,21 @@
1
+ import type { PointerEventHandler } from "react";
2
+ import { type ZoomBehavior } from "d3-zoom";
3
+ interface UseSvgGlobeGesturesOptions {
4
+ zoomRef: React.RefObject<ZoomBehavior<SVGSVGElement, unknown> | null>;
5
+ rotationRef: React.RefObject<[number, number]>;
6
+ zoomScale: number;
7
+ setRotation: React.Dispatch<React.SetStateAction<[number, number]>>;
8
+ setHoveredCountry: React.Dispatch<React.SetStateAction<string | null>>;
9
+ setPointerClickSuppressed: (suppressed: boolean) => void;
10
+ cancelRotation: () => void;
11
+ }
12
+ export declare function useSvgGlobeGestures({ zoomRef, rotationRef, zoomScale, setRotation, setHoveredCountry, setPointerClickSuppressed, cancelRotation, }: UseSvgGlobeGesturesOptions): {
13
+ handlers: {
14
+ onPointerDown: PointerEventHandler<SVGSVGElement>;
15
+ onPointerMove: PointerEventHandler<SVGSVGElement>;
16
+ onPointerUp: PointerEventHandler<SVGSVGElement>;
17
+ onPointerCancel: PointerEventHandler<SVGSVGElement>;
18
+ };
19
+ };
20
+ export {};
21
+ //# sourceMappingURL=use-svg-globe-gestures.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-svg-globe-gestures.d.ts","sourceRoot":"","sources":["../../src/globe/use-svg-globe-gestures.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,OAAO,CAAC;AAEjD,OAAO,EAA+B,KAAK,YAAY,EAAE,MAAM,SAAS,CAAC;AAMzE,UAAU,0BAA0B;IAClC,OAAO,EAAE,KAAK,CAAC,SAAS,CAAC,YAAY,CAAC,aAAa,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC,CAAC;IACtE,WAAW,EAAE,KAAK,CAAC,SAAS,CAAC,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;IAC/C,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC;IACpE,iBAAiB,EAAE,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,cAAc,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC,CAAC;IACvE,yBAAyB,EAAE,CAAC,UAAU,EAAE,OAAO,KAAK,IAAI,CAAC;IACzD,cAAc,EAAE,MAAM,IAAI,CAAC;CAC5B;AAWD,wBAAgB,mBAAmB,CAAC,EAClC,OAAO,EACP,WAAW,EACX,SAAS,EACT,WAAW,EACX,iBAAiB,EACjB,yBAAyB,EACzB,cAAc,GACf,EAAE,0BAA0B;;;;;;;EAqL5B"}
@@ -0,0 +1,190 @@
1
+ import { useRef } from "react";
2
+ import { select } from "d3-selection";
3
+ import { zoomIdentity, zoomTransform } from "d3-zoom";
4
+ const SIZE = 520;
5
+ const ZOOM_MIN = 1;
6
+ const ZOOM_MAX = 4;
7
+ function pointInSvg(svg, clientX, clientY) {
8
+ const rect = svg.getBoundingClientRect();
9
+ if (!rect.width || !rect.height)
10
+ return null;
11
+ const scale = Math.min(rect.width / SIZE, rect.height / SIZE);
12
+ const offsetX = (rect.width - SIZE * scale) / 2;
13
+ const offsetY = (rect.height - SIZE * scale) / 2;
14
+ return [(clientX - rect.left - offsetX) / scale, (clientY - rect.top - offsetY) / scale];
15
+ }
16
+ export function useSvgGlobeGestures({ zoomRef, rotationRef, zoomScale, setRotation, setHoveredCountry, setPointerClickSuppressed, cancelRotation, }) {
17
+ const dragRef = useRef(null);
18
+ const touchPointersRef = useRef(new Map());
19
+ const touchModeRef = useRef(null);
20
+ const pinchRef = useRef(null);
21
+ const beginPinch = (svg, ids) => {
22
+ const touches = touchPointersRef.current;
23
+ const first = touches.get(ids[0]);
24
+ const second = touches.get(ids[1]);
25
+ if (!first || !second)
26
+ return;
27
+ const midpoint = [(first.x + second.x) / 2, (first.y + second.y) / 2];
28
+ const point = pointInSvg(svg, midpoint[0], midpoint[1]);
29
+ if (!point)
30
+ return;
31
+ const transform = zoomTransform(svg);
32
+ pinchRef.current = {
33
+ ids,
34
+ distance: Math.max(1, Math.hypot(second.x - first.x, second.y - first.y)),
35
+ anchor: transform.invert(point),
36
+ scale: transform.k,
37
+ };
38
+ };
39
+ const movePinch = (svg) => {
40
+ const gesture = pinchRef.current;
41
+ const behavior = zoomRef.current;
42
+ if (!gesture || !behavior)
43
+ return;
44
+ const first = touchPointersRef.current.get(gesture.ids[0]);
45
+ const second = touchPointersRef.current.get(gesture.ids[1]);
46
+ if (!first || !second)
47
+ return;
48
+ const midpoint = [(first.x + second.x) / 2, (first.y + second.y) / 2];
49
+ const point = pointInSvg(svg, midpoint[0], midpoint[1]);
50
+ if (!point)
51
+ return;
52
+ const distance = Math.hypot(second.x - first.x, second.y - first.y);
53
+ const scale = Math.max(ZOOM_MIN, Math.min(ZOOM_MAX, (gesture.scale * distance) / gesture.distance));
54
+ let next = zoomIdentity
55
+ .translate(point[0] - gesture.anchor[0] * scale, point[1] - gesture.anchor[1] * scale)
56
+ .scale(scale);
57
+ next = behavior.constrain()(next, [
58
+ [0, 0],
59
+ [SIZE, SIZE],
60
+ ], [
61
+ [-SIZE, -SIZE],
62
+ [SIZE * 2, SIZE * 2],
63
+ ]);
64
+ select(svg).call(behavior.transform, next);
65
+ };
66
+ const handlePointerDown = (event) => {
67
+ cancelRotation();
68
+ if (event.pointerType === "touch") {
69
+ const touches = touchPointersRef.current;
70
+ touches.set(event.pointerId, { x: event.clientX, y: event.clientY });
71
+ event.currentTarget.setPointerCapture(event.pointerId);
72
+ if (touches.size === 1) {
73
+ touchModeRef.current = "rotate";
74
+ dragRef.current = {
75
+ pointerId: event.pointerId,
76
+ pointerType: "touch",
77
+ x: event.clientX,
78
+ y: event.clientY,
79
+ rotation: rotationRef.current,
80
+ moved: false,
81
+ };
82
+ }
83
+ else {
84
+ touchModeRef.current = "pinch";
85
+ dragRef.current = null;
86
+ const ids = [...touches.keys()].slice(0, 2);
87
+ beginPinch(event.currentTarget, ids);
88
+ }
89
+ return;
90
+ }
91
+ if (event.button !== 0)
92
+ return;
93
+ dragRef.current = {
94
+ pointerId: event.pointerId,
95
+ pointerType: event.pointerType,
96
+ x: event.clientX,
97
+ y: event.clientY,
98
+ rotation: rotationRef.current,
99
+ moved: false,
100
+ };
101
+ };
102
+ const handlePointerMove = (event) => {
103
+ if (event.pointerType === "touch") {
104
+ const touches = touchPointersRef.current;
105
+ if (!touches.has(event.pointerId))
106
+ return;
107
+ touches.set(event.pointerId, { x: event.clientX, y: event.clientY });
108
+ if (touchModeRef.current === "pinch") {
109
+ movePinch(event.currentTarget);
110
+ return;
111
+ }
112
+ }
113
+ else if (event.buttons === 0 && dragRef.current?.pointerType === "mouse") {
114
+ const drag = dragRef.current;
115
+ if (event.currentTarget.hasPointerCapture(drag.pointerId))
116
+ event.currentTarget.releasePointerCapture(drag.pointerId);
117
+ dragRef.current = null;
118
+ return;
119
+ }
120
+ const drag = dragRef.current;
121
+ if (!drag || drag.pointerId !== event.pointerId)
122
+ return;
123
+ const dx = event.clientX - drag.x;
124
+ const dy = event.clientY - drag.y;
125
+ if (!drag.moved && Math.abs(dx) + Math.abs(dy) <= 5)
126
+ return;
127
+ drag.moved = true;
128
+ if (!event.currentTarget.hasPointerCapture(event.pointerId))
129
+ event.currentTarget.setPointerCapture(event.pointerId);
130
+ setHoveredCountry(null);
131
+ const rect = event.currentTarget.getBoundingClientRect();
132
+ if (!rect.width)
133
+ return;
134
+ const sensitivity = ((SIZE / rect.width) * 0.25) / zoomScale;
135
+ setRotation([
136
+ drag.rotation[0] + dx * sensitivity,
137
+ Math.max(-85, Math.min(85, drag.rotation[1] - dy * sensitivity)),
138
+ ]);
139
+ };
140
+ const handlePointerUp = (event) => {
141
+ const drag = dragRef.current?.pointerId === event.pointerId ? dragRef.current : null;
142
+ if (event.currentTarget.hasPointerCapture(event.pointerId))
143
+ event.currentTarget.releasePointerCapture(event.pointerId);
144
+ if (drag?.moved || (event.pointerType === "touch" && touchModeRef.current === "pinch")) {
145
+ setPointerClickSuppressed(true);
146
+ }
147
+ if (event.pointerType === "touch") {
148
+ const touches = touchPointersRef.current;
149
+ touches.delete(event.pointerId);
150
+ if (touches.size === 0) {
151
+ touchModeRef.current = null;
152
+ pinchRef.current = null;
153
+ dragRef.current = null;
154
+ }
155
+ else if (touchModeRef.current === "pinch") {
156
+ dragRef.current = null;
157
+ const ids = [...touches.keys()].slice(0, 2);
158
+ if (ids.length === 2)
159
+ beginPinch(event.currentTarget, ids);
160
+ else
161
+ pinchRef.current = null;
162
+ }
163
+ else if (drag) {
164
+ dragRef.current = null;
165
+ }
166
+ return;
167
+ }
168
+ if (drag)
169
+ dragRef.current = null;
170
+ };
171
+ const handlePointerCancel = (event) => {
172
+ if (event.pointerType === "touch") {
173
+ touchPointersRef.current.clear();
174
+ touchModeRef.current = null;
175
+ pinchRef.current = null;
176
+ setPointerClickSuppressed(true);
177
+ }
178
+ if (dragRef.current?.pointerId === event.pointerId)
179
+ dragRef.current = null;
180
+ };
181
+ return {
182
+ handlers: {
183
+ onPointerDown: handlePointerDown,
184
+ onPointerMove: handlePointerMove,
185
+ onPointerUp: handlePointerUp,
186
+ onPointerCancel: handlePointerCancel,
187
+ },
188
+ };
189
+ }
190
+ //# sourceMappingURL=use-svg-globe-gestures.js.map
@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face UseSvgGlobeItemInteractionsOptions {
3
+ reset: () => void;
4
+ onCountryClick?: (code: string) => void;
5
+ }
6
+ export declare function useSvgGlobeItemInteractions({ reset, onCountryClick, }: UseSvgGlobeItemInteractionsOptions): {
7
+ hoveredCountry: string | null;
8
+ setHoveredCountry: import("react").Dispatch<import("react").SetStateAction<string | null>>;
9
+ setPointerClickSuppressed: (suppressed: boolean) => void;
10
+ handlers: {
11
+ onKeyDown: KeyboardEventHandler<SVGSVGElement>;
12
+ onClick: MouseEventHandler<SVGSVGElement>;
13
+ onPointerOver: PointerEventHandler<SVGSVGElement>;
14
+ onPointerOut: PointerEventHandler<SVGSVGElement>;
15
+ onFocus: FocusEventHandler<SVGSVGElement>;
16
+ onBlur: FocusEventHandler<SVGSVGElement>;
17
+ };
18
+ };
19
+ export {};
20
+ //# sourceMappingURL=use-svg-globe-item-interactions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-svg-globe-item-interactions.d.ts","sourceRoot":"","sources":["../../src/globe/use-svg-globe-item-interactions.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,iBAAiB,EACjB,oBAAoB,EACpB,iBAAiB,EACjB,mBAAmB,EACpB,MAAM,OAAO,CAAC;AAEf,UAAU,kCAAkC;IAC1C,KAAK,EAAE,MAAM,IAAI,CAAC;IAClB,cAAc,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;CACzC;AAQD,wBAAgB,2BAA2B,CAAC,EAC1C,KAAK,EACL,cAAc,GACf,EAAE,kCAAkC;;;4CA0BY,OAAO;;;;;;;;;EAiCvD"}