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
|
@@ -5,7 +5,7 @@ import { createCompoundPart as C } from "../../../lib/primitives/create-compound
|
|
|
5
5
|
import { cn as o } from "../../../lib/utils.js";
|
|
6
6
|
import { MultiColorFilter as F, Cross as P, InfoBadge as u } from "impact-nova-icons";
|
|
7
7
|
import { Button as D } from "../../primitives/button/button.js";
|
|
8
|
-
import { Tooltip as
|
|
8
|
+
import { Tooltip as c, TooltipTrigger as f, TooltipContent as h } from "../../feedback/tooltip/tooltip.js";
|
|
9
9
|
import { Kbd as S } from "../../primitives/kbd/kbd.js";
|
|
10
10
|
import { OverflowTooltip as j } from "../../feedback/tooltip/overflow-tooltip.js";
|
|
11
11
|
import { useImpactNovaI18n as v } from "../../../i18n/use-impact-nova-i18n.js";
|
|
@@ -16,7 +16,7 @@ const O = ({
|
|
|
16
16
|
children: n,
|
|
17
17
|
className: l
|
|
18
18
|
}) => {
|
|
19
|
-
const { t:
|
|
19
|
+
const { t: d } = v();
|
|
20
20
|
return /* @__PURE__ */ a(
|
|
21
21
|
"div",
|
|
22
22
|
{
|
|
@@ -45,7 +45,7 @@ const O = ({
|
|
|
45
45
|
variant: "secondary",
|
|
46
46
|
size: "icon",
|
|
47
47
|
tabIndex: -1,
|
|
48
|
-
"aria-label":
|
|
48
|
+
"aria-label": d("aria.close"),
|
|
49
49
|
"data-component": "filter-panel-close",
|
|
50
50
|
children: /* @__PURE__ */ e(P, { className: "h-3 w-3" })
|
|
51
51
|
}
|
|
@@ -58,7 +58,7 @@ const O = ({
|
|
|
58
58
|
open: i,
|
|
59
59
|
onOpenChange: n,
|
|
60
60
|
title: l = "Filter panel",
|
|
61
|
-
children:
|
|
61
|
+
children: d,
|
|
62
62
|
header: s,
|
|
63
63
|
sidebar: p,
|
|
64
64
|
className: m,
|
|
@@ -86,7 +86,7 @@ const O = ({
|
|
|
86
86
|
s || /* @__PURE__ */ e(O, { title: l }),
|
|
87
87
|
/* @__PURE__ */ a("div", { className: "flex flex-1 overflow-hidden", children: [
|
|
88
88
|
p,
|
|
89
|
-
/* @__PURE__ */ e("div", { className: "flex flex-col flex-1 overflow-hidden", children:
|
|
89
|
+
/* @__PURE__ */ e("div", { className: "flex flex-col flex-1 overflow-hidden", children: d })
|
|
90
90
|
] })
|
|
91
91
|
] })
|
|
92
92
|
]
|
|
@@ -95,7 +95,7 @@ const O = ({
|
|
|
95
95
|
items: i,
|
|
96
96
|
activeTab: n,
|
|
97
97
|
onTabChange: l,
|
|
98
|
-
className:
|
|
98
|
+
className: d
|
|
99
99
|
}) => {
|
|
100
100
|
const { t: s } = v(), p = I(), m = (t) => {
|
|
101
101
|
t !== n && p(), l(t);
|
|
@@ -106,97 +106,104 @@ const O = ({
|
|
|
106
106
|
"data-component": "filter-panel-sidebar",
|
|
107
107
|
className: o(
|
|
108
108
|
"flex w-[200px] shrink-0 flex-col border-r bg-navigation-canvas",
|
|
109
|
-
|
|
109
|
+
d
|
|
110
110
|
),
|
|
111
|
-
children: /* @__PURE__ */ e(
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
"
|
|
133
|
-
{
|
|
134
|
-
className: o(
|
|
135
|
-
"shrink-0",
|
|
136
|
-
r ? "text-brand" : "text-content-secondary"
|
|
137
|
-
),
|
|
138
|
-
children: t.icon
|
|
139
|
-
}
|
|
111
|
+
children: /* @__PURE__ */ e(
|
|
112
|
+
"div",
|
|
113
|
+
{
|
|
114
|
+
"data-component": "filter-panel-sidebar-nav",
|
|
115
|
+
className: "flex max-h-full min-h-0 flex-col gap-1 overflow-y-auto py-2",
|
|
116
|
+
children: i.map((t) => {
|
|
117
|
+
const r = n === t.id;
|
|
118
|
+
return /* @__PURE__ */ a(b.Fragment, { children: [
|
|
119
|
+
t.separator && /* @__PURE__ */ e("div", { className: "my-2 h-px bg-stroke-hairline" }),
|
|
120
|
+
/* @__PURE__ */ a(
|
|
121
|
+
"button",
|
|
122
|
+
{
|
|
123
|
+
type: "button",
|
|
124
|
+
autoFocus: r,
|
|
125
|
+
onClick: () => m(t.id),
|
|
126
|
+
"data-component": "filter-panel-sidebar-item",
|
|
127
|
+
"data-active": r ? "true" : "false",
|
|
128
|
+
"data-tab": t.id,
|
|
129
|
+
"data-shortcut-id": t.shortcutId,
|
|
130
|
+
className: o(
|
|
131
|
+
"group flex items-center justify-between px-3 py-[6px] mx-2 rounded-lg text-left text-sm font-medium transition-colors",
|
|
132
|
+
r ? "bg-canvas-accent text-brand" : "text-content-secondary hover:bg-canvas-accent"
|
|
140
133
|
),
|
|
141
|
-
|
|
142
|
-
/* @__PURE__ */
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
134
|
+
children: [
|
|
135
|
+
/* @__PURE__ */ a("div", { className: "flex items-center gap-2 min-w-0 flex-1", children: [
|
|
136
|
+
/* @__PURE__ */ e(
|
|
137
|
+
"span",
|
|
138
|
+
{
|
|
139
|
+
className: o(
|
|
140
|
+
"shrink-0",
|
|
141
|
+
r ? "text-brand" : "text-content-secondary"
|
|
142
|
+
),
|
|
143
|
+
children: t.icon
|
|
144
|
+
}
|
|
145
|
+
),
|
|
146
|
+
/* @__PURE__ */ a("div", { className: "flex items-center gap-1 min-w-0", children: [
|
|
147
|
+
/* @__PURE__ */ e(
|
|
148
|
+
j,
|
|
149
|
+
{
|
|
150
|
+
triggerClassName: "truncate font-['Manrope'] block min-w-0",
|
|
151
|
+
content: t.tooltipKeybinding ? /* @__PURE__ */ a("span", { className: "flex items-center gap-2", children: [
|
|
152
|
+
t.label,
|
|
153
|
+
" ",
|
|
154
|
+
/* @__PURE__ */ e(
|
|
155
|
+
S,
|
|
156
|
+
{
|
|
157
|
+
keybinding: t.tooltipKeybinding,
|
|
158
|
+
size: "sm"
|
|
159
|
+
}
|
|
160
|
+
)
|
|
161
|
+
] }) : t.label,
|
|
162
|
+
side: "right",
|
|
163
|
+
variant: "tertiary",
|
|
164
|
+
children: t.label
|
|
165
|
+
}
|
|
173
166
|
),
|
|
174
|
-
children:
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
/* @__PURE__ */
|
|
178
|
-
t.
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
167
|
+
t.isRequired && /* @__PURE__ */ e("span", { className: "shrink-0 text-danger", children: "*" })
|
|
168
|
+
] })
|
|
169
|
+
] }),
|
|
170
|
+
/* @__PURE__ */ a("div", { className: "flex items-center gap-1 shrink-0 ml-1", children: [
|
|
171
|
+
t.count !== void 0 && t.count > 0 && /* @__PURE__ */ a(c, { children: [
|
|
172
|
+
/* @__PURE__ */ e(f, { asChild: !0, children: /* @__PURE__ */ e(
|
|
173
|
+
"span",
|
|
174
|
+
{
|
|
175
|
+
className: o(
|
|
176
|
+
"inline-flex h-5 min-w-5 items-center justify-center rounded-full px-1.5 text-[11px] font-medium tabular-nums leading-none shrink-0",
|
|
177
|
+
r ? "bg-canvas-elevated text-brand border border-stroke-subtle" : "bg-brand-tint border border-stroke-subtle"
|
|
178
|
+
),
|
|
179
|
+
children: t.count
|
|
180
|
+
}
|
|
181
|
+
) }),
|
|
182
|
+
/* @__PURE__ */ e(h, { variant: "tertiary", side: "top", children: s(
|
|
183
|
+
t.countBadgeContext === "savedFiltersTotal" ? "filterPanel.savedFiltersAvailableCount" : "filterPanel.filtersAppliedCount",
|
|
184
|
+
{ count: t.count }
|
|
185
|
+
) })
|
|
186
|
+
] }),
|
|
187
|
+
t.hasError && /* @__PURE__ */ a(c, { children: [
|
|
188
|
+
/* @__PURE__ */ e(f, { asChild: !0, children: /* @__PURE__ */ e(u, { className: "h-5 w-5 shrink-0 text-danger" }) }),
|
|
189
|
+
/* @__PURE__ */ e(h, { variant: "tertiary", children: s("filterPanel.tabContainsErrors") })
|
|
190
|
+
] }),
|
|
191
|
+
t.hasWarning && /* @__PURE__ */ a(c, { children: [
|
|
192
|
+
/* @__PURE__ */ e(f, { asChild: !0, children: /* @__PURE__ */ e(u, { className: "h-5 w-5 shrink-0 text-warning" }) }),
|
|
193
|
+
/* @__PURE__ */ e(h, { variant: "tertiary", children: s("filterPanel.tabHasWarnings") })
|
|
194
|
+
] }),
|
|
195
|
+
t.hasInfo && /* @__PURE__ */ a(c, { children: [
|
|
196
|
+
/* @__PURE__ */ e(f, { asChild: !0, children: /* @__PURE__ */ e(u, { className: "h-5 w-5 shrink-0 text-content-icon" }) }),
|
|
197
|
+
/* @__PURE__ */ e(h, { variant: "tertiary", children: s("filterPanel.additionalInfoAvailable") })
|
|
198
|
+
] })
|
|
199
|
+
] })
|
|
200
|
+
]
|
|
201
|
+
}
|
|
202
|
+
)
|
|
203
|
+
] }, t.id);
|
|
204
|
+
})
|
|
205
|
+
}
|
|
206
|
+
)
|
|
200
207
|
}
|
|
201
208
|
);
|
|
202
209
|
}, Q = C("filter-panel", {
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { GuidancePlugin } from '../../../../lib/guidance';
|
|
2
|
+
export interface AgGridTargetConfig {
|
|
3
|
+
gridApi: {
|
|
4
|
+
ensureIndexVisible: (rowIndex: number, position?: string) => void;
|
|
5
|
+
};
|
|
6
|
+
rowIndex?: number;
|
|
7
|
+
columnId?: string;
|
|
8
|
+
}
|
|
9
|
+
export declare function createAgGridTargetAdapter(): GuidancePlugin<AgGridTargetConfig>;
|
|
10
|
+
export declare function createAgGridReadyTriggerPlugin(): GuidancePlugin<{
|
|
11
|
+
gridId: string;
|
|
12
|
+
}>;
|
|
13
|
+
export declare function emitAgGridReady(emit: (eventName: string) => void, gridId: string): void;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
function a() {
|
|
2
|
+
return {
|
|
3
|
+
type: "adapter.ag-grid",
|
|
4
|
+
resolve: (r, e) => {
|
|
5
|
+
if (e.rowIndex !== void 0 && e.gridApi.ensureIndexVisible(e.rowIndex, "middle"), typeof document > "u")
|
|
6
|
+
return null;
|
|
7
|
+
const d = e.columnId ? `[col-id="${e.columnId}"]` : `[data-guidance-target="${r.targetDescriptor.targetId}"]`, t = document.querySelector(d);
|
|
8
|
+
return {
|
|
9
|
+
targetId: r.targetDescriptor.targetId,
|
|
10
|
+
element: t,
|
|
11
|
+
rect: t?.getBoundingClientRect() ?? null,
|
|
12
|
+
source: "adapter"
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
function i() {
|
|
18
|
+
return {
|
|
19
|
+
type: "trigger.ag-grid-ready",
|
|
20
|
+
evaluate: (r, e) => r.customEvents.has(`ag-grid.ready.${e.gridId}`)
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
function n(r, e) {
|
|
24
|
+
r(`ag-grid.ready.${e}`);
|
|
25
|
+
}
|
|
26
|
+
export {
|
|
27
|
+
i as createAgGridReadyTriggerPlugin,
|
|
28
|
+
a as createAgGridTargetAdapter,
|
|
29
|
+
n as emitAgGridReady
|
|
30
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { createDialogOpenedTriggerPlugin, getOverlayScopeRoot, } from './overlay-adapter';
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
function t() {
|
|
2
|
+
if (typeof document > "u")
|
|
3
|
+
return null;
|
|
4
|
+
const e = document.querySelectorAll(
|
|
5
|
+
'[role="dialog"][data-state="open"], [role="alertdialog"][data-state="open"], [data-component="sheet-content"][data-state="open"]'
|
|
6
|
+
);
|
|
7
|
+
return e.length ? e[e.length - 1] : null;
|
|
8
|
+
}
|
|
9
|
+
function n() {
|
|
10
|
+
return {
|
|
11
|
+
type: "trigger.dialog-opened",
|
|
12
|
+
evaluate: () => t() !== null
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
function o() {
|
|
16
|
+
return t();
|
|
17
|
+
}
|
|
18
|
+
export {
|
|
19
|
+
n as createDialogOpenedTriggerPlugin,
|
|
20
|
+
o as getOverlayScopeRoot
|
|
21
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '../../../lib/guidance';
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { GuidanceEngine as t } from "../../../lib/guidance/engine/guidance-engine.js";
|
|
2
|
+
import { GuideRegistry as i } from "../../../lib/guidance/engine/guide-registry.js";
|
|
3
|
+
import { sanitizeGuideManifest as d, validateGuideManifest as g } from "../../../lib/guidance/engine/manifest-validator.js";
|
|
4
|
+
import { getNextStepId as l, getStepById as p, resolveLocalizedStepContent as s } from "../../../lib/guidance/engine/step-navigation.js";
|
|
5
|
+
import { TriggerPluginRegistry as f } from "../../../lib/guidance/triggers/trigger-registry.js";
|
|
6
|
+
import { registerBuiltInTriggerPlugins as m } from "../../../lib/guidance/triggers/built-in-triggers.js";
|
|
7
|
+
import { LocalStorageGuidanceAdapter as x, defaultGuidanceStorageAdapter as G } from "../../../lib/guidance/storage/storage-adapter.js";
|
|
8
|
+
import { buildCampaignStorageKey as A, buildGuidanceStorageKey as R, buildSessionStatsKey as T } from "../../../lib/guidance/storage/storage-keys.js";
|
|
9
|
+
import { NoopGuidanceAnalyticsAdapter as v, SamplingGuidanceAnalyticsAdapter as I, defaultGuidanceAnalyticsAdapter as K } from "../../../lib/guidance/analytics/analytics-adapter.js";
|
|
10
|
+
import { GuidanceTargetRefRegistry as z, globalGuidanceTargetRefRegistry as B } from "../../../lib/guidance/targets/ref-registry.js";
|
|
11
|
+
import { TargetResolver as F, resolveTargetSynchronously as L, waitForTargetResolved as M, waitForTargetVisible as N } from "../../../lib/guidance/targets/target-resolver.js";
|
|
12
|
+
export {
|
|
13
|
+
t as GuidanceEngine,
|
|
14
|
+
z as GuidanceTargetRefRegistry,
|
|
15
|
+
i as GuideRegistry,
|
|
16
|
+
x as LocalStorageGuidanceAdapter,
|
|
17
|
+
v as NoopGuidanceAnalyticsAdapter,
|
|
18
|
+
I as SamplingGuidanceAnalyticsAdapter,
|
|
19
|
+
F as TargetResolver,
|
|
20
|
+
f as TriggerPluginRegistry,
|
|
21
|
+
A as buildCampaignStorageKey,
|
|
22
|
+
R as buildGuidanceStorageKey,
|
|
23
|
+
T as buildSessionStatsKey,
|
|
24
|
+
K as defaultGuidanceAnalyticsAdapter,
|
|
25
|
+
G as defaultGuidanceStorageAdapter,
|
|
26
|
+
l as getNextStepId,
|
|
27
|
+
p as getStepById,
|
|
28
|
+
B as globalGuidanceTargetRefRegistry,
|
|
29
|
+
m as registerBuiltInTriggerPlugins,
|
|
30
|
+
s as resolveLocalizedStepContent,
|
|
31
|
+
L as resolveTargetSynchronously,
|
|
32
|
+
d as sanitizeGuideManifest,
|
|
33
|
+
g as validateGuideManifest,
|
|
34
|
+
M as waitForTargetResolved,
|
|
35
|
+
N as waitForTargetVisible
|
|
36
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { GuidanceAnalyticsAdapter, GuidanceErrorReporter, GuidancePlugin, GuidanceStorageAdapter, GuideManifest, GuidanceEngine } from '../../../lib/guidance';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
export interface GuidanceProviderProps {
|
|
4
|
+
children: React.ReactNode;
|
|
5
|
+
storage: GuidanceStorageAdapter;
|
|
6
|
+
analytics?: GuidanceAnalyticsAdapter;
|
|
7
|
+
plugins?: GuidancePlugin[];
|
|
8
|
+
locale?: string;
|
|
9
|
+
tenantId?: string;
|
|
10
|
+
appVersion?: string;
|
|
11
|
+
consentRequired?: boolean;
|
|
12
|
+
maxGuidesPerSession?: number;
|
|
13
|
+
cooldownBetweenGuides?: number;
|
|
14
|
+
debug?: boolean;
|
|
15
|
+
errorReporter?: GuidanceErrorReporter;
|
|
16
|
+
mfeBridge?: boolean;
|
|
17
|
+
}
|
|
18
|
+
export interface GuidanceContextValue {
|
|
19
|
+
engine: GuidanceEngine;
|
|
20
|
+
debug: boolean;
|
|
21
|
+
locale: string;
|
|
22
|
+
registerGuide: (manifest: GuideManifest, routeScope?: string) => void;
|
|
23
|
+
unregisterGuide: (guideId: string) => void;
|
|
24
|
+
unregisterRouteScope: (routeScope: string) => void;
|
|
25
|
+
}
|
|
26
|
+
export declare const GuidanceContext: React.Context<GuidanceContextValue | null>;
|
|
27
|
+
export declare function useGuidanceContext(): GuidanceContextValue;
|
|
28
|
+
export type GuidanceEngineProviderConfig = Omit<GuidanceProviderProps, 'children'>;
|
|
29
|
+
export declare function createGuidanceEngine(props: GuidanceEngineProviderConfig): GuidanceEngine;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import * as i from "react";
|
|
2
|
+
import { GuidanceEngine as o } from "../../../lib/guidance/engine/guidance-engine.js";
|
|
3
|
+
const a = i.createContext(
|
|
4
|
+
null
|
|
5
|
+
);
|
|
6
|
+
function c() {
|
|
7
|
+
const e = i.useContext(a);
|
|
8
|
+
if (!e)
|
|
9
|
+
throw new Error("useGuidanceContext must be used within GuidanceProvider");
|
|
10
|
+
return e;
|
|
11
|
+
}
|
|
12
|
+
function s(e) {
|
|
13
|
+
const r = {
|
|
14
|
+
tenantId: e.tenantId ?? "default",
|
|
15
|
+
locale: e.locale ?? "en",
|
|
16
|
+
appVersion: e.appVersion ?? "0.0.0",
|
|
17
|
+
maxGuidesPerSession: e.maxGuidesPerSession ?? 3,
|
|
18
|
+
cooldownBetweenGuides: e.cooldownBetweenGuides ?? 3e4,
|
|
19
|
+
maxConcurrentGuides: 1,
|
|
20
|
+
consentRequired: e.consentRequired ?? !1,
|
|
21
|
+
debug: e.debug ?? !1,
|
|
22
|
+
storage: e.storage,
|
|
23
|
+
analytics: e.analytics ?? { track: () => {
|
|
24
|
+
} },
|
|
25
|
+
errorReporter: e.errorReporter
|
|
26
|
+
}, t = new o(r);
|
|
27
|
+
for (const n of e.plugins ?? [])
|
|
28
|
+
n.evaluate && t.triggers.register(n), n.resolve && t.resolver.registerAdapter(n);
|
|
29
|
+
return t;
|
|
30
|
+
}
|
|
31
|
+
export {
|
|
32
|
+
a as GuidanceContext,
|
|
33
|
+
s as createGuidanceEngine,
|
|
34
|
+
c as useGuidanceContext
|
|
35
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
interface GuidanceErrorBoundaryProps {
|
|
3
|
+
children: React.ReactNode;
|
|
4
|
+
onError?: (error: Error) => void;
|
|
5
|
+
}
|
|
6
|
+
interface GuidanceErrorBoundaryState {
|
|
7
|
+
hasError: boolean;
|
|
8
|
+
}
|
|
9
|
+
export declare class GuidanceErrorBoundary extends React.Component<GuidanceErrorBoundaryProps, GuidanceErrorBoundaryState> {
|
|
10
|
+
constructor(props: GuidanceErrorBoundaryProps);
|
|
11
|
+
static getDerivedStateFromError(): GuidanceErrorBoundaryState;
|
|
12
|
+
componentDidCatch(error: Error): void;
|
|
13
|
+
render(): React.ReactNode;
|
|
14
|
+
}
|
|
15
|
+
export declare function GuidanceDebugPanel(): React.ReactElement | null;
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { jsxs as t, jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import * as a from "react";
|
|
3
|
+
import { useGuidanceContext as d } from "./guidance-context.js";
|
|
4
|
+
class u extends a.Component {
|
|
5
|
+
constructor(e) {
|
|
6
|
+
super(e), this.state = { hasError: !1 };
|
|
7
|
+
}
|
|
8
|
+
static getDerivedStateFromError() {
|
|
9
|
+
return { hasError: !0 };
|
|
10
|
+
}
|
|
11
|
+
componentDidCatch(e) {
|
|
12
|
+
this.props.onError?.(e);
|
|
13
|
+
}
|
|
14
|
+
render() {
|
|
15
|
+
return this.state.hasError ? null : this.props.children;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
function l() {
|
|
19
|
+
const { engine: r, debug: e } = d();
|
|
20
|
+
if (!e)
|
|
21
|
+
return null;
|
|
22
|
+
const s = r.registry.getAll(), n = r.state;
|
|
23
|
+
return /* @__PURE__ */ t(
|
|
24
|
+
"div",
|
|
25
|
+
{
|
|
26
|
+
"data-component": "guidance-debug-panel",
|
|
27
|
+
className: "fixed bottom-4 right-4 z-[9999] max-w-sm rounded-md border border-border-default bg-surface-elevated p-3 text-xs shadow-lg",
|
|
28
|
+
children: [
|
|
29
|
+
/* @__PURE__ */ o("div", { className: "font-semibold text-content-primary", children: "Guidance Debug" }),
|
|
30
|
+
/* @__PURE__ */ t("div", { className: "mt-1 text-content-secondary", children: [
|
|
31
|
+
"Status: ",
|
|
32
|
+
n.status
|
|
33
|
+
] }),
|
|
34
|
+
/* @__PURE__ */ t("div", { className: "mt-1 text-content-secondary", children: [
|
|
35
|
+
"Registered guides: ",
|
|
36
|
+
s.length
|
|
37
|
+
] }),
|
|
38
|
+
n.guideId ? /* @__PURE__ */ t("div", { className: "mt-1 text-content-secondary", children: [
|
|
39
|
+
"Active: ",
|
|
40
|
+
n.guideId
|
|
41
|
+
] }) : null
|
|
42
|
+
]
|
|
43
|
+
}
|
|
44
|
+
);
|
|
45
|
+
}
|
|
46
|
+
export {
|
|
47
|
+
l as GuidanceDebugPanel,
|
|
48
|
+
u as GuidanceErrorBoundary
|
|
49
|
+
};
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { jsxs as i, jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import * as s from "react";
|
|
3
|
+
import { useSyncExternalStore as d } from "react";
|
|
4
|
+
import { useGuidanceContext as m } from "./guidance-context.js";
|
|
5
|
+
import { SpotlightRenderer as p } from "./renderers/spotlight-renderer.js";
|
|
6
|
+
import { CoachMarkRenderer as f } from "./renderers/coach-mark-renderer.js";
|
|
7
|
+
import { AnnouncementRenderer as b } from "./renderers/announcement-renderer.js";
|
|
8
|
+
import { endTourScrollSnapshot as h } from "./renderers/guidance-renderer-shared.js";
|
|
9
|
+
import { Button as l } from "../../primitives/button/button.js";
|
|
10
|
+
function k(e, n) {
|
|
11
|
+
const r = {
|
|
12
|
+
instruction: e,
|
|
13
|
+
...n
|
|
14
|
+
};
|
|
15
|
+
switch (e.renderer) {
|
|
16
|
+
case "spotlight":
|
|
17
|
+
return /* @__PURE__ */ t(p, { ...r });
|
|
18
|
+
case "coach-mark":
|
|
19
|
+
return /* @__PURE__ */ t(f, { ...r });
|
|
20
|
+
case "announcement":
|
|
21
|
+
return /* @__PURE__ */ t(b, { ...r });
|
|
22
|
+
default:
|
|
23
|
+
return null;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
function G() {
|
|
27
|
+
const { engine: e } = m();
|
|
28
|
+
s.useEffect(() => e.on("guideEnd", () => {
|
|
29
|
+
h();
|
|
30
|
+
}), [e]);
|
|
31
|
+
const n = d(
|
|
32
|
+
(o) => e.subscribe(o),
|
|
33
|
+
() => e.state,
|
|
34
|
+
() => ({ status: "idle" })
|
|
35
|
+
), r = d(
|
|
36
|
+
(o) => e.subscribe(o),
|
|
37
|
+
() => e.getRenderInstruction(),
|
|
38
|
+
() => null
|
|
39
|
+
), a = s.useCallback(() => {
|
|
40
|
+
e.advanceStep();
|
|
41
|
+
}, [e]), u = s.useCallback(() => {
|
|
42
|
+
e.skipStep();
|
|
43
|
+
}, [e]), c = s.useCallback(() => {
|
|
44
|
+
e.dismiss("session");
|
|
45
|
+
}, [e]);
|
|
46
|
+
return n.status === "blocked" ? /* @__PURE__ */ i(
|
|
47
|
+
"div",
|
|
48
|
+
{
|
|
49
|
+
"data-component": "guidance-blocked",
|
|
50
|
+
className: "fixed bottom-4 left-1/2 z-50 -translate-x-1/2 rounded-md border border-border-default bg-surface-elevated px-4 py-3 shadow-lg",
|
|
51
|
+
role: "status",
|
|
52
|
+
children: [
|
|
53
|
+
/* @__PURE__ */ i("p", { className: "text-sm text-content-secondary", children: [
|
|
54
|
+
"Guide step is blocked: ",
|
|
55
|
+
n.reason
|
|
56
|
+
] }),
|
|
57
|
+
/* @__PURE__ */ i("div", { className: "mt-2 flex gap-2", children: [
|
|
58
|
+
/* @__PURE__ */ t(l, { size: "sm", onClick: a, children: "Retry" }),
|
|
59
|
+
/* @__PURE__ */ t(l, { variant: "secondary", size: "sm", onClick: c, children: "Dismiss" })
|
|
60
|
+
] })
|
|
61
|
+
]
|
|
62
|
+
}
|
|
63
|
+
) : r ? k(r, {
|
|
64
|
+
onNext: a,
|
|
65
|
+
onSkip: u,
|
|
66
|
+
onDismiss: c
|
|
67
|
+
}) : null;
|
|
68
|
+
}
|
|
69
|
+
export {
|
|
70
|
+
G as GuidanceLayer
|
|
71
|
+
};
|