impact-nova 2.2.8 → 2.3.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.
- package/dist/components/data/ag-grid-react/ag-grid-header-dom.js +6 -8
- package/dist/components/data/ag-grid-react/ag-grid-tooltip-overflow.d.ts +1 -1
- package/dist/components/data/ag-grid-react/ag-grid-tooltip-overflow.js +25 -13
- package/dist/components/data/ag-grid-react/headers/custom-header.js +1 -1
- package/dist/components/data/ag-grid-react/headers/custom-inner-header-group.js +7 -7
- package/dist/components/data/ag-grid-react/headers/utils/filter-utils.js +9 -9
- package/dist/components/data/ag-grid-react/strip-column-min-width-constraints.d.ts +3 -0
- package/dist/components/data/data-table/data-table.d.ts +1 -1
- package/dist/components/data/data-table/data-table.js +41 -39
- package/dist/components/data/data-table/data-table.types.d.ts +1 -1
- package/dist/components/data-display/calendar/calendar-day-picker-components.js +69 -56
- package/dist/components/data-display/calendar/calendar-padding-week.utils.d.ts +5 -0
- package/dist/components/data-display/calendar/calendar-padding-week.utils.js +6 -0
- package/dist/components/data-display/calendar/calendar.types.d.ts +1 -1
- package/dist/components/flows/filter-panel/filter-panel.js +101 -94
- package/dist/components/flows/guidance/adapters/ag-grid-adapter.d.ts +13 -0
- package/dist/components/flows/guidance/adapters/ag-grid-adapter.js +30 -0
- package/dist/components/flows/guidance/adapters/ag-grid.d.ts +2 -0
- package/dist/components/flows/guidance/adapters/ag-grid.js +6 -0
- package/dist/components/flows/guidance/adapters/dialog.d.ts +1 -0
- package/dist/components/flows/guidance/adapters/dialog.js +5 -0
- package/dist/components/flows/guidance/adapters/overlay-adapter.d.ts +5 -0
- package/dist/components/flows/guidance/adapters/overlay-adapter.js +21 -0
- package/dist/components/flows/guidance/engine.d.ts +1 -0
- package/dist/components/flows/guidance/engine.js +36 -0
- package/dist/components/flows/guidance/guidance-context.d.ts +29 -0
- package/dist/components/flows/guidance/guidance-context.js +35 -0
- package/dist/components/flows/guidance/guidance-error-boundary.d.ts +16 -0
- package/dist/components/flows/guidance/guidance-error-boundary.js +49 -0
- package/dist/components/flows/guidance/guidance-layer.d.ts +2 -0
- package/dist/components/flows/guidance/guidance-layer.js +71 -0
- package/dist/components/flows/guidance/guidance-provider.d.ts +3 -0
- package/dist/components/flows/guidance/guidance-provider.js +58 -0
- package/dist/components/flows/guidance/guidance-target.d.ts +7 -0
- package/dist/components/flows/guidance/guidance-target.js +27 -0
- package/dist/components/flows/guidance/guidance.types.d.ts +1 -0
- package/dist/components/flows/guidance/help-center/filter-help-center-guides.d.ts +7 -0
- package/dist/components/flows/guidance/help-center/filter-help-center-guides.js +11 -0
- package/dist/components/flows/guidance/help-center/guide-catalog.d.ts +3 -0
- package/dist/components/flows/guidance/help-center/guide-catalog.js +118 -0
- package/dist/components/flows/guidance/help-center/help-center-header.d.ts +3 -0
- package/dist/components/flows/guidance/help-center/help-center-header.js +43 -0
- package/dist/components/flows/guidance/help-center/help-center.constants.d.ts +5 -0
- package/dist/components/flows/guidance/help-center/help-center.constants.js +7 -0
- package/dist/components/flows/guidance/help-center/help-center.d.ts +10 -0
- package/dist/components/flows/guidance/help-center/help-center.js +95 -0
- package/dist/components/flows/guidance/help-center/help-center.story-helpers.d.ts +10 -0
- package/dist/components/flows/guidance/help-center/help-center.types.d.ts +39 -0
- package/dist/components/flows/guidance/help-center.d.ts +6 -0
- package/dist/components/flows/guidance/help-center.js +19 -0
- package/dist/components/flows/guidance/hooks/use-guidance.d.ts +19 -0
- package/dist/components/flows/guidance/hooks/use-guidance.js +50 -0
- package/dist/components/flows/guidance/hooks/use-help-center.d.ts +24 -0
- package/dist/components/flows/guidance/hooks/use-help-center.js +67 -0
- package/dist/components/flows/guidance/hooks/useGuidanceOverlayGeometry.d.ts +2 -0
- package/dist/components/flows/guidance/hooks/useGuidanceOverlayGeometry.js +30 -0
- package/dist/components/flows/guidance/index.d.ts +18 -0
- package/dist/components/flows/guidance/index.js +48 -0
- package/dist/components/flows/guidance/renderers/announcement-renderer.d.ts +3 -0
- package/dist/components/flows/guidance/renderers/announcement-renderer.js +40 -0
- package/dist/components/flows/guidance/renderers/coach-mark-renderer.d.ts +2 -0
- package/dist/components/flows/guidance/renderers/coach-mark-renderer.js +14 -0
- package/dist/components/flows/guidance/renderers/guidance-card-shared.d.ts +42 -0
- package/dist/components/flows/guidance/renderers/guidance-card-shared.js +213 -0
- package/dist/components/flows/guidance/renderers/guidance-renderer-shared.d.ts +48 -0
- package/dist/components/flows/guidance/renderers/guidance-renderer-shared.js +254 -0
- package/dist/components/flows/guidance/renderers/guidance-tour-overlay.d.ts +11 -0
- package/dist/components/flows/guidance/renderers/guidance-tour-overlay.js +217 -0
- package/dist/components/flows/guidance/renderers/renderer-registry.d.ts +6 -0
- package/dist/components/flows/guidance/renderers/renderer-registry.js +19 -0
- package/dist/components/flows/guidance/renderers/spotlight-renderer.d.ts +2 -0
- package/dist/components/flows/guidance/renderers/spotlight-renderer.js +14 -0
- package/dist/components/flows/guidance/renderers.d.ts +4 -0
- package/dist/components/flows/guidance/renderers.js +11 -0
- package/dist/components/flows/guidance/target.d.ts +3 -0
- package/dist/components/flows/guidance/target.js +6 -0
- package/dist/components/flows/guidance/triggers.d.ts +2 -0
- package/dist/components/flows/guidance/triggers.js +16 -0
- package/dist/components/flows/guidance/use-guidance-target.d.ts +5 -0
- package/dist/components/flows/guidance/use-guidance-target.js +16 -0
- package/dist/components/flows/guidance/utils/motion-settle.d.ts +2 -0
- package/dist/components/flows/guidance/utils/motion-settle.js +17 -0
- package/dist/components/forms/combobox/combobox.js +185 -160
- package/dist/components/forms/combobox/combobox.types.d.ts +2 -0
- package/dist/i18n/defaultMessages.d.ts +13 -0
- package/dist/i18n/defaultMessages.js +23 -11
- package/dist/i18n/index.d.ts +1 -1
- package/dist/i18n/locales/de.js +12 -0
- package/dist/i18n/locales/es.js +12 -0
- package/dist/i18n/locales/hi.js +12 -0
- package/dist/i18n/locales/kn.js +12 -0
- package/dist/impact-nova-components.css +52 -10
- package/dist/impact-nova.css +1 -1
- package/dist/lib/guidance/analytics/analytics-adapter.d.ts +16 -0
- package/dist/lib/guidance/analytics/analytics-adapter.js +50 -0
- package/dist/lib/guidance/engine/guidance-engine.d.ts +74 -0
- package/dist/lib/guidance/engine/guidance-engine.js +384 -0
- package/dist/lib/guidance/engine/guide-registry.d.ts +21 -0
- package/dist/lib/guidance/engine/guide-registry.js +71 -0
- package/dist/lib/guidance/engine/manifest-validator.d.ts +4 -0
- package/dist/lib/guidance/engine/manifest-validator.js +102 -0
- package/dist/lib/guidance/engine/step-navigation.d.ts +5 -0
- package/dist/lib/guidance/engine/step-navigation.js +35 -0
- package/dist/lib/guidance/index.d.ts +12 -0
- package/dist/lib/guidance/storage/storage-adapter.d.ts +10 -0
- package/dist/lib/guidance/storage/storage-adapter.js +51 -0
- package/dist/lib/guidance/storage/storage-keys.d.ts +10 -0
- package/dist/lib/guidance/storage/storage-keys.js +23 -0
- package/dist/lib/guidance/targets/ref-registry.d.ts +12 -0
- package/dist/lib/guidance/targets/ref-registry.js +65 -0
- package/dist/lib/guidance/targets/target-resolver.d.ts +13 -0
- package/dist/lib/guidance/targets/target-resolver.js +85 -0
- package/dist/lib/guidance/triggers/built-in-triggers.d.ts +14 -0
- package/dist/lib/guidance/triggers/built-in-triggers.js +88 -0
- package/dist/lib/guidance/triggers/trigger-registry.d.ts +9 -0
- package/dist/lib/guidance/triggers/trigger-registry.js +44 -0
- package/dist/lib/guidance/types/guidance.types.d.ts +181 -0
- package/dist/lib/overflow/is-line-clamp-text-clipped.d.ts +2 -0
- package/dist/lib/overflow/is-line-clamp-text-clipped.js +33 -0
- package/dist/lib/overflow/is-text-overflowing.d.ts +1 -0
- package/dist/lib/overflow/is-text-overflowing.js +8 -3
- package/dist/llms/rules/installation.js +1 -1
- package/dist/llms/rules/requirements.js +1 -1
- package/package.json +51 -22
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { jsx as n, jsxs as l } from "react/jsx-runtime";
|
|
2
|
+
import * as i from "react";
|
|
3
|
+
import { useSyncExternalStore as g } from "react";
|
|
4
|
+
import { createGuidanceEngine as d, GuidanceContext as m } from "./guidance-context.js";
|
|
5
|
+
import { GuidanceDebugPanel as f, GuidanceErrorBoundary as G } from "./guidance-error-boundary.js";
|
|
6
|
+
import { GuidanceLayer as b } from "./guidance-layer.js";
|
|
7
|
+
import { registerRendererPlugins as x } from "./renderers/renderer-registry.js";
|
|
8
|
+
function p({
|
|
9
|
+
children: s,
|
|
10
|
+
...t
|
|
11
|
+
}) {
|
|
12
|
+
const [r] = i.useState(() => d(t));
|
|
13
|
+
i.useEffect(() => {
|
|
14
|
+
x();
|
|
15
|
+
for (const e of t.plugins ?? [])
|
|
16
|
+
e.evaluate && r.triggers.register(e), e.resolve && r.resolver.registerAdapter(e);
|
|
17
|
+
}, [r, t.plugins]);
|
|
18
|
+
const o = i.useMemo(
|
|
19
|
+
() => ({
|
|
20
|
+
engine: r,
|
|
21
|
+
debug: t.debug ?? !1,
|
|
22
|
+
locale: t.locale ?? "en",
|
|
23
|
+
registerGuide: (e, c) => {
|
|
24
|
+
r.registerGuide(e, c);
|
|
25
|
+
},
|
|
26
|
+
unregisterGuide: (e) => {
|
|
27
|
+
r.unregisterGuide(e);
|
|
28
|
+
},
|
|
29
|
+
unregisterRouteScope: (e) => {
|
|
30
|
+
r.unregisterRouteScope(e);
|
|
31
|
+
}
|
|
32
|
+
}),
|
|
33
|
+
[r, t.debug, t.locale]
|
|
34
|
+
), u = g(
|
|
35
|
+
(e) => r.subscribe(e),
|
|
36
|
+
() => r.state.status,
|
|
37
|
+
() => "idle"
|
|
38
|
+
), a = u === "active" || u === "blocked" || u === "evaluating";
|
|
39
|
+
return /* @__PURE__ */ n(m.Provider, { value: o, children: /* @__PURE__ */ l("div", { "data-component": "guidance", className: "contents", children: [
|
|
40
|
+
s,
|
|
41
|
+
t.debug ? /* @__PURE__ */ n(f, {}) : null,
|
|
42
|
+
a ? /* @__PURE__ */ n(
|
|
43
|
+
G,
|
|
44
|
+
{
|
|
45
|
+
onError: (e) => {
|
|
46
|
+
r.reportError({
|
|
47
|
+
code: "render_error",
|
|
48
|
+
message: e.message
|
|
49
|
+
});
|
|
50
|
+
},
|
|
51
|
+
children: /* @__PURE__ */ n(b, {})
|
|
52
|
+
}
|
|
53
|
+
) : null
|
|
54
|
+
] }) });
|
|
55
|
+
}
|
|
56
|
+
export {
|
|
57
|
+
p as GuidanceProvider
|
|
58
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { jsx as u } from "react/jsx-runtime";
|
|
2
|
+
import * as i from "react";
|
|
3
|
+
import { useGuidanceContext as c } from "./guidance-context.js";
|
|
4
|
+
function m({
|
|
5
|
+
targetId: e,
|
|
6
|
+
scope: t,
|
|
7
|
+
children: o
|
|
8
|
+
}) {
|
|
9
|
+
const { engine: n } = c(), r = i.useRef(null);
|
|
10
|
+
return i.useEffect(() => {
|
|
11
|
+
const a = r.current;
|
|
12
|
+
if (a)
|
|
13
|
+
return n.targets.register(e, a, t);
|
|
14
|
+
}, [n, e, t]), /* @__PURE__ */ u(
|
|
15
|
+
"span",
|
|
16
|
+
{
|
|
17
|
+
ref: r,
|
|
18
|
+
"data-guidance-target": e,
|
|
19
|
+
"data-component": "guidance-target",
|
|
20
|
+
className: "inline-flex",
|
|
21
|
+
children: o
|
|
22
|
+
}
|
|
23
|
+
);
|
|
24
|
+
}
|
|
25
|
+
export {
|
|
26
|
+
m as GuidanceTarget
|
|
27
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type { GuidanceContextValue, GuidanceProviderProps, } from './guidance-context';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { GuideManifest } from '../../../../lib/guidance';
|
|
2
|
+
export interface FilterHelpCenterGuidesOptions {
|
|
3
|
+
categoryValue: string;
|
|
4
|
+
searchQuery: string;
|
|
5
|
+
allCategoryValue?: string;
|
|
6
|
+
}
|
|
7
|
+
export declare function filterHelpCenterGuides(guides: GuideManifest[], options: FilterHelpCenterGuidesOptions): GuideManifest[];
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { HELP_CENTER_ALL_CATEGORY_VALUE as u } from "./help-center.constants.js";
|
|
2
|
+
function y(o, e) {
|
|
3
|
+
const l = e.allCategoryValue ?? u, r = e.categoryValue === l ? null : e.categoryValue, t = e.searchQuery.trim().toLowerCase();
|
|
4
|
+
return o.filter((a) => {
|
|
5
|
+
const c = a.metadata.category ?? "general", s = !r || c === r, n = !t || a.metadata.title?.toLowerCase().includes(t) || a.metadata.description?.toLowerCase().includes(t) || a.id.toLowerCase().includes(t);
|
|
6
|
+
return s && n;
|
|
7
|
+
});
|
|
8
|
+
}
|
|
9
|
+
export {
|
|
10
|
+
y as filterHelpCenterGuides
|
|
11
|
+
};
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import { jsx as e, jsxs as o } from "react/jsx-runtime";
|
|
2
|
+
import * as f from "react";
|
|
3
|
+
import { useVirtualizer as x } from "@tanstack/react-virtual";
|
|
4
|
+
import { Button as g } from "../../../primitives/button/button.js";
|
|
5
|
+
import { cn as u } from "../../../../lib/utils.js";
|
|
6
|
+
import { GUIDE_LIST_VIRTUALIZATION_THRESHOLD as b, GUIDE_LIST_ROW_GAP as N, GUIDE_CARD_ESTIMATE_HEIGHT as v } from "./help-center.constants.js";
|
|
7
|
+
/* empty css */
|
|
8
|
+
function R({
|
|
9
|
+
guides: t,
|
|
10
|
+
onLaunchGuide: r,
|
|
11
|
+
replayLabel: n = "Replay",
|
|
12
|
+
emptyStateMessage: i = "No guides match your search.",
|
|
13
|
+
getStepCountLabel: d = (a) => `${a} steps`,
|
|
14
|
+
className: m
|
|
15
|
+
}) {
|
|
16
|
+
const a = f.useRef(null), p = t.length >= b, c = x({
|
|
17
|
+
count: p ? t.length : 0,
|
|
18
|
+
getScrollElement: () => a.current,
|
|
19
|
+
estimateSize: () => v,
|
|
20
|
+
gap: N,
|
|
21
|
+
overscan: 5
|
|
22
|
+
});
|
|
23
|
+
return t.length ? /* @__PURE__ */ e(
|
|
24
|
+
"div",
|
|
25
|
+
{
|
|
26
|
+
ref: a,
|
|
27
|
+
className: u(
|
|
28
|
+
"guidance-help-center-scroll min-h-0 flex-1 overflow-y-auto px-4 pb-3 pt-3",
|
|
29
|
+
m
|
|
30
|
+
),
|
|
31
|
+
"data-component": "guidance-help-center-scroll",
|
|
32
|
+
children: p ? /* @__PURE__ */ e(
|
|
33
|
+
"div",
|
|
34
|
+
{
|
|
35
|
+
className: "relative w-full",
|
|
36
|
+
"data-component": "guidance-guide-catalog",
|
|
37
|
+
style: { height: c.getTotalSize() },
|
|
38
|
+
children: c.getVirtualItems().map((l) => {
|
|
39
|
+
const s = t[l.index];
|
|
40
|
+
return s ? /* @__PURE__ */ e(
|
|
41
|
+
"div",
|
|
42
|
+
{
|
|
43
|
+
ref: c.measureElement,
|
|
44
|
+
"data-index": l.index,
|
|
45
|
+
className: "absolute left-0 top-0 w-full",
|
|
46
|
+
style: { transform: `translateY(${l.start}px)` },
|
|
47
|
+
children: /* @__PURE__ */ e(
|
|
48
|
+
h,
|
|
49
|
+
{
|
|
50
|
+
guide: s,
|
|
51
|
+
onLaunchGuide: r,
|
|
52
|
+
replayLabel: n,
|
|
53
|
+
getStepCountLabel: d
|
|
54
|
+
}
|
|
55
|
+
)
|
|
56
|
+
},
|
|
57
|
+
s.id
|
|
58
|
+
) : null;
|
|
59
|
+
})
|
|
60
|
+
}
|
|
61
|
+
) : /* @__PURE__ */ e(
|
|
62
|
+
"ul",
|
|
63
|
+
{
|
|
64
|
+
className: "flex flex-col gap-2",
|
|
65
|
+
"data-component": "guidance-guide-catalog",
|
|
66
|
+
children: t.map((l) => /* @__PURE__ */ e("li", { children: /* @__PURE__ */ e(
|
|
67
|
+
h,
|
|
68
|
+
{
|
|
69
|
+
guide: l,
|
|
70
|
+
onLaunchGuide: r,
|
|
71
|
+
replayLabel: n,
|
|
72
|
+
getStepCountLabel: d
|
|
73
|
+
}
|
|
74
|
+
) }, l.id))
|
|
75
|
+
}
|
|
76
|
+
)
|
|
77
|
+
}
|
|
78
|
+
) : /* @__PURE__ */ e(
|
|
79
|
+
"div",
|
|
80
|
+
{
|
|
81
|
+
className: u(
|
|
82
|
+
"guidance-help-center-scroll min-h-0 flex-1 overflow-y-auto px-4 pb-3 pt-3",
|
|
83
|
+
m
|
|
84
|
+
),
|
|
85
|
+
"data-component": "guidance-help-center-scroll",
|
|
86
|
+
children: /* @__PURE__ */ e("p", { className: "rounded-lg border border-dashed border-border-subtle px-4 py-8 text-center text-sm text-content-secondary", children: i })
|
|
87
|
+
}
|
|
88
|
+
);
|
|
89
|
+
}
|
|
90
|
+
function h({
|
|
91
|
+
guide: t,
|
|
92
|
+
onLaunchGuide: r,
|
|
93
|
+
replayLabel: n,
|
|
94
|
+
getStepCountLabel: i
|
|
95
|
+
}) {
|
|
96
|
+
return /* @__PURE__ */ e("article", { className: "rounded-lg border border-border-subtle bg-canvas-elevated px-3 py-2.5", children: /* @__PURE__ */ o("div", { className: "flex items-start justify-between gap-3", children: [
|
|
97
|
+
/* @__PURE__ */ o("div", { className: "min-w-0 flex-1", children: [
|
|
98
|
+
/* @__PURE__ */ o("div", { className: "flex min-w-0 items-center gap-2", children: [
|
|
99
|
+
/* @__PURE__ */ e("h3", { className: "truncate text-sm font-semibold text-content-primary", children: t.metadata.title ?? t.id }),
|
|
100
|
+
/* @__PURE__ */ e("span", { className: "shrink-0 rounded-full bg-brand-tint px-2 py-0.5 text-[11px] font-medium leading-none text-brand", children: i(t.steps.length) })
|
|
101
|
+
] }),
|
|
102
|
+
t.metadata.description ? /* @__PURE__ */ e("p", { className: "mt-1 line-clamp-2 text-xs leading-relaxed text-content-secondary", children: t.metadata.description }) : null
|
|
103
|
+
] }),
|
|
104
|
+
/* @__PURE__ */ e(
|
|
105
|
+
g,
|
|
106
|
+
{
|
|
107
|
+
variant: "outline",
|
|
108
|
+
size: "sm",
|
|
109
|
+
className: "shrink-0",
|
|
110
|
+
onClick: () => r(t.id),
|
|
111
|
+
children: n
|
|
112
|
+
}
|
|
113
|
+
)
|
|
114
|
+
] }) });
|
|
115
|
+
}
|
|
116
|
+
export {
|
|
117
|
+
R as GuideCatalog
|
|
118
|
+
};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { jsxs as n, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import "react";
|
|
3
|
+
import { SheetTitle as s, SheetClose as c } from "../../../feedback/sheet/sheet.js";
|
|
4
|
+
import { Button as l } from "../../../primitives/button/button.js";
|
|
5
|
+
import { Cross as m } from "impact-nova-icons";
|
|
6
|
+
import { useImpactNovaI18n as p } from "../../../../i18n/use-impact-nova-i18n.js";
|
|
7
|
+
import { cn as d } from "../../../../lib/utils.js";
|
|
8
|
+
function C({
|
|
9
|
+
title: o,
|
|
10
|
+
children: a,
|
|
11
|
+
className: i
|
|
12
|
+
}) {
|
|
13
|
+
const { t: r } = p(), t = o ?? r("helpCenter.title");
|
|
14
|
+
return /* @__PURE__ */ n(
|
|
15
|
+
"div",
|
|
16
|
+
{
|
|
17
|
+
"data-component": "guidance-help-center-header",
|
|
18
|
+
className: d(
|
|
19
|
+
"flex shrink-0 items-center justify-between gap-3 border-b bg-canvas-elevated px-4 py-[9px]",
|
|
20
|
+
i
|
|
21
|
+
),
|
|
22
|
+
children: [
|
|
23
|
+
typeof t == "string" ? /* @__PURE__ */ e(s, { className: "shrink-0 text-lg font-bold text-content", children: t }) : t,
|
|
24
|
+
/* @__PURE__ */ n("div", { className: "flex items-center gap-2", children: [
|
|
25
|
+
a,
|
|
26
|
+
/* @__PURE__ */ e(c, { asChild: !0, children: /* @__PURE__ */ e(
|
|
27
|
+
l,
|
|
28
|
+
{
|
|
29
|
+
variant: "secondary",
|
|
30
|
+
size: "icon",
|
|
31
|
+
"aria-label": r("aria.close"),
|
|
32
|
+
"data-component": "guidance-help-center-close",
|
|
33
|
+
children: /* @__PURE__ */ e(m, { className: "!h-3 !w-3" })
|
|
34
|
+
}
|
|
35
|
+
) })
|
|
36
|
+
] })
|
|
37
|
+
]
|
|
38
|
+
}
|
|
39
|
+
);
|
|
40
|
+
}
|
|
41
|
+
export {
|
|
42
|
+
C as HelpCenterHeader
|
|
43
|
+
};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export declare const HELP_CENTER_ALL_CATEGORY_VALUE = "all";
|
|
2
|
+
export declare const GUIDE_CARD_ESTIMATE_HEIGHT = 72;
|
|
3
|
+
export declare const GUIDE_LIST_ROW_GAP = 8;
|
|
4
|
+
/** Below this count, a simple list is rendered instead of windowing. */
|
|
5
|
+
export declare const GUIDE_LIST_VIRTUALIZATION_THRESHOLD = 12;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { HelpCenterBodyProps, HelpCenterCategoryTabsProps, HelpCenterContentProps, HelpCenterFooterProps, HelpCenterProps } from './help-center.types';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
export declare function HelpCenter({ open, onOpenChange, children, className, }: HelpCenterProps): React.ReactElement;
|
|
4
|
+
export declare function HelpCenterContent({ children, className, }: HelpCenterContentProps): React.ReactElement;
|
|
5
|
+
export declare function HelpCenterCategoryTabs({ categories, allCategoryLabel, className, }: HelpCenterCategoryTabsProps): React.ReactElement;
|
|
6
|
+
export declare function HelpCenterBody({ children, className, }: HelpCenterBodyProps): React.ReactElement;
|
|
7
|
+
export declare function HelpCenterFooter({ children, className, }: HelpCenterFooterProps): React.ReactElement;
|
|
8
|
+
export { HelpCenterHeader } from './help-center-header';
|
|
9
|
+
export { GuideCatalog } from './guide-catalog';
|
|
10
|
+
export type { GuideCatalogProps } from './help-center.types';
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import { jsx as n, jsxs as s } from "react/jsx-runtime";
|
|
2
|
+
import "react";
|
|
3
|
+
import { Sheet as m, SheetContent as d, SheetDescription as h, SheetBody as f, SheetFooter as u } from "../../../feedback/sheet/sheet.js";
|
|
4
|
+
import { TabsList as x, TabsTrigger as c } from "../../../primitives/tabs/tabs.js";
|
|
5
|
+
import { useImpactNovaI18n as p } from "../../../../i18n/use-impact-nova-i18n.js";
|
|
6
|
+
import { cn as r } from "../../../../lib/utils.js";
|
|
7
|
+
import { HELP_CENTER_ALL_CATEGORY_VALUE as v } from "./help-center.constants.js";
|
|
8
|
+
function L({
|
|
9
|
+
open: e,
|
|
10
|
+
onOpenChange: t,
|
|
11
|
+
children: l,
|
|
12
|
+
className: o
|
|
13
|
+
}) {
|
|
14
|
+
const { t: a } = p();
|
|
15
|
+
return /* @__PURE__ */ n(m, { open: e, onOpenChange: t, children: /* @__PURE__ */ s(
|
|
16
|
+
d,
|
|
17
|
+
{
|
|
18
|
+
"data-component": "guidance-help-center",
|
|
19
|
+
side: "right",
|
|
20
|
+
className: r(
|
|
21
|
+
"w-full max-w-xl overflow-hidden sm:max-w-2xl",
|
|
22
|
+
o
|
|
23
|
+
),
|
|
24
|
+
children: [
|
|
25
|
+
/* @__PURE__ */ n(h, { className: "sr-only", children: a("helpCenter.description") }),
|
|
26
|
+
l
|
|
27
|
+
]
|
|
28
|
+
}
|
|
29
|
+
) });
|
|
30
|
+
}
|
|
31
|
+
function T({
|
|
32
|
+
children: e,
|
|
33
|
+
className: t
|
|
34
|
+
}) {
|
|
35
|
+
return /* @__PURE__ */ n(
|
|
36
|
+
"div",
|
|
37
|
+
{
|
|
38
|
+
"data-component": "guidance-help-center-content",
|
|
39
|
+
className: r("flex h-full min-h-0 flex-col bg-canvas-elevated", t),
|
|
40
|
+
children: e
|
|
41
|
+
}
|
|
42
|
+
);
|
|
43
|
+
}
|
|
44
|
+
function E({
|
|
45
|
+
categories: e,
|
|
46
|
+
allCategoryLabel: t,
|
|
47
|
+
className: l
|
|
48
|
+
}) {
|
|
49
|
+
const { t: o } = p(), a = t ?? o("helpCenter.allCategory");
|
|
50
|
+
return /* @__PURE__ */ n(
|
|
51
|
+
"div",
|
|
52
|
+
{
|
|
53
|
+
"data-component": "guidance-help-center-toolbar",
|
|
54
|
+
className: r(
|
|
55
|
+
"guidance-help-center-toolbar relative z-10 shrink-0 bg-canvas-elevated px-4 pb-3 pt-3",
|
|
56
|
+
l
|
|
57
|
+
),
|
|
58
|
+
children: /* @__PURE__ */ s(x, { className: "h-auto w-full max-w-full flex-nowrap justify-start gap-1 overflow-x-auto p-1", children: [
|
|
59
|
+
/* @__PURE__ */ n(c, { value: v, children: a }),
|
|
60
|
+
e.map((i) => /* @__PURE__ */ n(c, { value: i.id, children: i.label }, i.id))
|
|
61
|
+
] })
|
|
62
|
+
}
|
|
63
|
+
);
|
|
64
|
+
}
|
|
65
|
+
function S({
|
|
66
|
+
children: e,
|
|
67
|
+
className: t
|
|
68
|
+
}) {
|
|
69
|
+
return /* @__PURE__ */ n(
|
|
70
|
+
f,
|
|
71
|
+
{
|
|
72
|
+
className: r("flex min-h-0 flex-1 flex-col overflow-hidden p-0", t),
|
|
73
|
+
children: e
|
|
74
|
+
}
|
|
75
|
+
);
|
|
76
|
+
}
|
|
77
|
+
function j({
|
|
78
|
+
children: e,
|
|
79
|
+
className: t
|
|
80
|
+
}) {
|
|
81
|
+
return /* @__PURE__ */ n(
|
|
82
|
+
u,
|
|
83
|
+
{
|
|
84
|
+
className: r("shrink-0 justify-start border-t px-4 py-2.5", t),
|
|
85
|
+
children: e
|
|
86
|
+
}
|
|
87
|
+
);
|
|
88
|
+
}
|
|
89
|
+
export {
|
|
90
|
+
L as HelpCenter,
|
|
91
|
+
S as HelpCenterBody,
|
|
92
|
+
E as HelpCenterCategoryTabs,
|
|
93
|
+
T as HelpCenterContent,
|
|
94
|
+
j as HelpCenterFooter
|
|
95
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { GuideManifest } from '../../../../lib/guidance';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
export declare const helpCenterDemoGuideManifests: GuideManifest[];
|
|
4
|
+
export interface HelpCenterComposedProps {
|
|
5
|
+
open: boolean;
|
|
6
|
+
onOpenChange: (open: boolean) => void;
|
|
7
|
+
supportTicketUrl?: string;
|
|
8
|
+
supportTicketLabel?: string;
|
|
9
|
+
}
|
|
10
|
+
export declare function HelpCenterComposed({ open, onOpenChange, supportTicketUrl, supportTicketLabel, }: HelpCenterComposedProps): React.ReactElement;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { GuideManifest } from '../../../../lib/guidance';
|
|
2
|
+
import { HelpCenterCategory } from '../hooks/use-help-center';
|
|
3
|
+
import type * as React from 'react';
|
|
4
|
+
export interface HelpCenterProps {
|
|
5
|
+
open: boolean;
|
|
6
|
+
onOpenChange: (open: boolean) => void;
|
|
7
|
+
children: React.ReactNode;
|
|
8
|
+
className?: string;
|
|
9
|
+
}
|
|
10
|
+
export interface HelpCenterContentProps {
|
|
11
|
+
children: React.ReactNode;
|
|
12
|
+
className?: string;
|
|
13
|
+
}
|
|
14
|
+
export interface HelpCenterHeaderProps {
|
|
15
|
+
title?: React.ReactNode;
|
|
16
|
+
children?: React.ReactNode;
|
|
17
|
+
className?: string;
|
|
18
|
+
}
|
|
19
|
+
export interface HelpCenterCategoryTabsProps {
|
|
20
|
+
categories: HelpCenterCategory[];
|
|
21
|
+
allCategoryLabel?: string;
|
|
22
|
+
className?: string;
|
|
23
|
+
}
|
|
24
|
+
export interface HelpCenterBodyProps {
|
|
25
|
+
children: React.ReactNode;
|
|
26
|
+
className?: string;
|
|
27
|
+
}
|
|
28
|
+
export interface HelpCenterFooterProps {
|
|
29
|
+
children?: React.ReactNode;
|
|
30
|
+
className?: string;
|
|
31
|
+
}
|
|
32
|
+
export interface GuideCatalogProps {
|
|
33
|
+
guides: GuideManifest[];
|
|
34
|
+
onLaunchGuide: (guideId: string) => void;
|
|
35
|
+
replayLabel?: string;
|
|
36
|
+
emptyStateMessage?: string;
|
|
37
|
+
getStepCountLabel?: (stepCount: number) => string;
|
|
38
|
+
className?: string;
|
|
39
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { HelpCenter, HelpCenterContent, HelpCenterHeader, HelpCenterCategoryTabs, HelpCenterBody, HelpCenterFooter, GuideCatalog, } from './help-center/help-center';
|
|
2
|
+
export { filterHelpCenterGuides } from './help-center/filter-help-center-guides';
|
|
3
|
+
export { HELP_CENTER_ALL_CATEGORY_VALUE } from './help-center/help-center.constants';
|
|
4
|
+
export { useHelpCenter, formatHelpCenterCategoryLabel } from './hooks/use-help-center';
|
|
5
|
+
export type { HelpCenterProps, HelpCenterContentProps, HelpCenterHeaderProps, HelpCenterCategoryTabsProps, HelpCenterBodyProps, HelpCenterFooterProps, GuideCatalogProps, } from './help-center/help-center.types';
|
|
6
|
+
export type { HelpCenterCategory } from './hooks/use-help-center';
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { HelpCenter as t, HelpCenterBody as o, HelpCenterCategoryTabs as p, HelpCenterContent as C, HelpCenterFooter as l } from "./help-center/help-center.js";
|
|
2
|
+
import { filterHelpCenterGuides as H } from "./help-center/filter-help-center-guides.js";
|
|
3
|
+
import { HELP_CENTER_ALL_CATEGORY_VALUE as f } from "./help-center/help-center.constants.js";
|
|
4
|
+
import { formatHelpCenterCategoryLabel as x, useHelpCenter as E } from "./hooks/use-help-center.js";
|
|
5
|
+
import { GuideCatalog as d } from "./help-center/guide-catalog.js";
|
|
6
|
+
import { HelpCenterHeader as g } from "./help-center/help-center-header.js";
|
|
7
|
+
export {
|
|
8
|
+
d as GuideCatalog,
|
|
9
|
+
f as HELP_CENTER_ALL_CATEGORY_VALUE,
|
|
10
|
+
t as HelpCenter,
|
|
11
|
+
o as HelpCenterBody,
|
|
12
|
+
p as HelpCenterCategoryTabs,
|
|
13
|
+
C as HelpCenterContent,
|
|
14
|
+
l as HelpCenterFooter,
|
|
15
|
+
g as HelpCenterHeader,
|
|
16
|
+
H as filterHelpCenterGuides,
|
|
17
|
+
x as formatHelpCenterCategoryLabel,
|
|
18
|
+
E as useHelpCenter
|
|
19
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { GuideManifest } from '../../../../lib/guidance';
|
|
2
|
+
export declare function useGuidance(): {
|
|
3
|
+
status: import('../../../../lib/guidance').GuidanceSessionStatus;
|
|
4
|
+
activeGuide: GuideManifest | undefined;
|
|
5
|
+
queue: number | null | undefined;
|
|
6
|
+
start: (guideId: string) => Promise<void>;
|
|
7
|
+
dismiss: (mode?: "session" | "forever" | "snoozed") => Promise<void>;
|
|
8
|
+
snooze: (guideId?: string) => Promise<void>;
|
|
9
|
+
replay: (guideId: string) => Promise<void>;
|
|
10
|
+
emit: (eventName: string) => void;
|
|
11
|
+
grantConsent: () => void;
|
|
12
|
+
preview: (guideId: string) => Promise<void>;
|
|
13
|
+
};
|
|
14
|
+
export declare function useGuideManifest(manifests: GuideManifest[], routeScope: string): void;
|
|
15
|
+
export declare function useGuidanceEvents(): {
|
|
16
|
+
onGuideStart: (handler: (guideId: string) => void) => import('../../../../lib/guidance').Unsubscribe;
|
|
17
|
+
onGuideEnd: (handler: (guideId: string, reason?: string) => void) => import('../../../../lib/guidance').Unsubscribe;
|
|
18
|
+
onStepChange: (handler: (guideId: string, stepId: string) => void) => import('../../../../lib/guidance').Unsubscribe;
|
|
19
|
+
};
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import * as r from "react";
|
|
2
|
+
import { useSyncExternalStore as a } from "react";
|
|
3
|
+
import { useGuidanceContext as o } from "../guidance-context.js";
|
|
4
|
+
function g() {
|
|
5
|
+
const { engine: t } = o(), n = a(
|
|
6
|
+
(e) => t.subscribe(e),
|
|
7
|
+
() => t.state,
|
|
8
|
+
() => ({ status: "idle" })
|
|
9
|
+
), s = n.guideId ? t.registry.get(n.guideId) : void 0;
|
|
10
|
+
return {
|
|
11
|
+
status: n.status,
|
|
12
|
+
activeGuide: s,
|
|
13
|
+
queue: n.status === "queued" ? n.position : null,
|
|
14
|
+
start: (e) => t.start(e, { manual: !0 }),
|
|
15
|
+
dismiss: (e) => t.dismiss(e),
|
|
16
|
+
snooze: (e) => t.snooze(e),
|
|
17
|
+
replay: (e) => t.replay(e),
|
|
18
|
+
emit: (e) => t.emitCustomEvent(e),
|
|
19
|
+
grantConsent: () => t.grantConsent(),
|
|
20
|
+
preview: (e) => t.replay(e)
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
function m(t, n) {
|
|
24
|
+
const { registerGuide: s, unregisterRouteScope: e } = o(), u = t.map((i) => `${i.id}@${i.version}`).join("|");
|
|
25
|
+
r.useEffect(() => {
|
|
26
|
+
for (const i of t)
|
|
27
|
+
s(i, n);
|
|
28
|
+
return () => {
|
|
29
|
+
e(n);
|
|
30
|
+
};
|
|
31
|
+
}, [n, u, s, e]);
|
|
32
|
+
}
|
|
33
|
+
function f() {
|
|
34
|
+
const { engine: t } = o();
|
|
35
|
+
return {
|
|
36
|
+
onGuideStart: (n) => t.on("guideStart", ({ guideId: s }) => n(s)),
|
|
37
|
+
onGuideEnd: (n) => t.on(
|
|
38
|
+
"guideEnd",
|
|
39
|
+
({ guideId: s, reason: e }) => n(s, e)
|
|
40
|
+
),
|
|
41
|
+
onStepChange: (n) => t.on("stepChange", ({ guideId: s, stepId: e }) => {
|
|
42
|
+
e && n(s, e);
|
|
43
|
+
})
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
export {
|
|
47
|
+
g as useGuidance,
|
|
48
|
+
f as useGuidanceEvents,
|
|
49
|
+
m as useGuideManifest
|
|
50
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { GuideManifest } from '../../../../lib/guidance';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
export interface HelpCenterCategory {
|
|
4
|
+
id: string;
|
|
5
|
+
label: string;
|
|
6
|
+
}
|
|
7
|
+
export declare function formatHelpCenterCategoryLabel(categoryId: string): string;
|
|
8
|
+
export declare function useHelpCenter(options?: {
|
|
9
|
+
enabled?: boolean;
|
|
10
|
+
onOpenChange?: (open: boolean) => void;
|
|
11
|
+
getCategoryLabel?: (categoryId: string) => string;
|
|
12
|
+
}): {
|
|
13
|
+
isOpen: boolean;
|
|
14
|
+
open: () => void;
|
|
15
|
+
close: () => void;
|
|
16
|
+
guides: GuideManifest[];
|
|
17
|
+
allGuides: GuideManifest[];
|
|
18
|
+
categories: HelpCenterCategory[];
|
|
19
|
+
searchQuery: string;
|
|
20
|
+
search: (query: string) => void;
|
|
21
|
+
selectedCategory: string | null;
|
|
22
|
+
setSelectedCategory: React.Dispatch<React.SetStateAction<string | null>>;
|
|
23
|
+
launchGuide: (guideId: string) => void;
|
|
24
|
+
};
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import * as e from "react";
|
|
2
|
+
import { useSyncExternalStore as E } from "react";
|
|
3
|
+
import { useGuidanceContext as G } from "../guidance-context.js";
|
|
4
|
+
import { filterHelpCenterGuides as M } from "../help-center/filter-help-center-guides.js";
|
|
5
|
+
import { HELP_CENTER_ALL_CATEGORY_VALUE as O } from "../help-center/help-center.constants.js";
|
|
6
|
+
function _(o) {
|
|
7
|
+
return o.split(/[-_]/).map((r) => r.charAt(0).toUpperCase() + r.slice(1)).join(" ");
|
|
8
|
+
}
|
|
9
|
+
function x(o) {
|
|
10
|
+
const r = o?.enabled ?? !0, i = o?.onOpenChange, g = o?.getCategoryLabel ?? _, { engine: s } = G(), [y, p] = e.useState(!1), [c, C] = e.useState(""), [l, d] = e.useState(
|
|
11
|
+
null
|
|
12
|
+
), f = E(
|
|
13
|
+
(t) => r ? s.registry.subscribe(t) : () => {
|
|
14
|
+
},
|
|
15
|
+
() => r ? s.registry.getVersion() : 0,
|
|
16
|
+
() => 0
|
|
17
|
+
), a = e.useMemo(
|
|
18
|
+
() => r ? s.registry.getAll() : [],
|
|
19
|
+
// ponytail: guideRegistryVersion is the registry publish signal for useSyncExternalStore
|
|
20
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps -- intentional invalidation key
|
|
21
|
+
[r, s, f]
|
|
22
|
+
), m = e.useMemo(() => {
|
|
23
|
+
const t = /* @__PURE__ */ new Map();
|
|
24
|
+
for (const u of a) {
|
|
25
|
+
const n = u.metadata.category ?? "general";
|
|
26
|
+
t.set(n, g(n));
|
|
27
|
+
}
|
|
28
|
+
return Array.from(t.entries()).map(([u, n]) => ({
|
|
29
|
+
id: u,
|
|
30
|
+
label: n
|
|
31
|
+
}));
|
|
32
|
+
}, [a, g]), b = e.useMemo(
|
|
33
|
+
() => M(a, {
|
|
34
|
+
categoryValue: l ?? O,
|
|
35
|
+
searchQuery: c
|
|
36
|
+
}),
|
|
37
|
+
[a, c, l]
|
|
38
|
+
), h = e.useCallback(() => {
|
|
39
|
+
p(!0);
|
|
40
|
+
}, []), L = e.useCallback(() => {
|
|
41
|
+
p(!1);
|
|
42
|
+
}, []), S = e.useCallback((t) => {
|
|
43
|
+
C(t);
|
|
44
|
+
}, []), A = e.useCallback(
|
|
45
|
+
(t) => {
|
|
46
|
+
i?.(!1), s.replay(t);
|
|
47
|
+
},
|
|
48
|
+
[s, i]
|
|
49
|
+
);
|
|
50
|
+
return {
|
|
51
|
+
isOpen: y,
|
|
52
|
+
open: h,
|
|
53
|
+
close: L,
|
|
54
|
+
guides: b,
|
|
55
|
+
allGuides: a,
|
|
56
|
+
categories: m,
|
|
57
|
+
searchQuery: c,
|
|
58
|
+
search: S,
|
|
59
|
+
selectedCategory: l,
|
|
60
|
+
setSelectedCategory: d,
|
|
61
|
+
launchGuide: A
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
export {
|
|
65
|
+
_ as formatHelpCenterCategoryLabel,
|
|
66
|
+
x as useHelpCenter
|
|
67
|
+
};
|