@inkeep/cxkit-primitives 0.5.2 → 0.5.4
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/atoms/link.cjs +1 -1
- package/dist/atoms/link.js +5 -5
- package/dist/components/chat-button.cjs +1 -1
- package/dist/components/chat-button.js +21 -21
- package/dist/components/embedded-chat/use-captcha.cjs +1 -1
- package/dist/components/embedded-chat/use-captcha.d.cts +2 -2
- package/dist/components/embedded-chat/use-captcha.d.ts +2 -2
- package/dist/components/embedded-chat/use-captcha.js +1 -1
- package/dist/components/embedded-chat/use-chat-action.cjs +1 -1
- package/dist/components/embedded-chat/use-chat-action.js +9 -9
- package/dist/components/embedded-chat/use-inkeep-chat.cjs +3 -3
- package/dist/components/embedded-chat/use-inkeep-chat.js +39 -39
- package/dist/components/embedded-chat.cjs +4 -4
- package/dist/components/embedded-chat.d.cts +6 -6
- package/dist/components/embedded-chat.d.ts +6 -6
- package/dist/components/embedded-chat.js +707 -708
- package/dist/components/embedded-search/transform-results.cjs +1 -1
- package/dist/components/embedded-search/transform-results.js +3 -3
- package/dist/components/embedded-search/use-inkeep-search.cjs +1 -1
- package/dist/components/embedded-search/use-inkeep-search.js +36 -36
- package/dist/components/embedded-search.cjs +1 -1
- package/dist/components/embedded-search.js +60 -60
- package/dist/components/intelligent-form/use-inkeep-intelligent-form.cjs +1 -1
- package/dist/components/intelligent-form/use-inkeep-intelligent-form.js +35 -35
- package/dist/components/intelligent-form.cjs +1 -1
- package/dist/components/intelligent-form.d.cts +3 -3
- package/dist/components/intelligent-form.d.ts +3 -3
- package/dist/components/intelligent-form.js +106 -106
- package/dist/components/modal/modal-provider.d.cts +1 -1
- package/dist/components/modal/modal-provider.d.ts +1 -1
- package/dist/components/modal/use-inkeep-modal.cjs +1 -1
- package/dist/components/modal/use-inkeep-modal.d.cts +1 -1
- package/dist/components/modal/use-inkeep-modal.d.ts +1 -1
- package/dist/components/modal/use-inkeep-modal.js +4 -4
- package/dist/components/modal.cjs +1 -1
- package/dist/components/modal.js +5 -5
- package/dist/hooks/use-browser-storage.cjs +1 -1
- package/dist/hooks/use-browser-storage.js +6 -6
- package/dist/providers/base-events-provider.cjs +1 -1
- package/dist/providers/base-events-provider.js +22 -22
- package/dist/providers/chat-events-provider.cjs +1 -1
- package/dist/providers/chat-events-provider.js +46 -39
- package/dist/providers/chat-form-provider.cjs +1 -1
- package/dist/providers/chat-form-provider.js +40 -40
- package/dist/providers/config-provider.cjs +1 -1
- package/dist/providers/config-provider.d.cts +7 -7
- package/dist/providers/config-provider.d.ts +7 -7
- package/dist/providers/config-provider.js +24 -24
- package/dist/providers/feedback-provider.cjs +1 -1
- package/dist/providers/feedback-provider.js +10 -10
- package/dist/providers/root-provider.cjs +1 -1
- package/dist/providers/root-provider.d.cts +1 -1
- package/dist/providers/root-provider.d.ts +1 -1
- package/dist/providers/root-provider.js +2 -2
- package/dist/providers/theme-provider.cjs +1 -1
- package/dist/providers/theme-provider.js +32 -30
- package/dist/providers/user-provider.cjs +1 -1
- package/dist/providers/user-provider.js +14 -14
- package/dist/utils/default-settings.cjs +1 -1
- package/dist/utils/default-settings.d.cts +20 -20
- package/dist/utils/default-settings.d.ts +20 -20
- package/dist/utils/default-settings.js +32 -31
- package/dist/utils/form.cjs +1 -1
- package/dist/utils/form.js +11 -11
- package/package.json +5 -5
|
@@ -1,39 +1,39 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as o } from "react/jsx-runtime";
|
|
3
3
|
import { ikp as t } from "./factory.js";
|
|
4
|
-
import { forwardRef as
|
|
4
|
+
import { forwardRef as f, useRef as C, useEffect as h } from "react";
|
|
5
5
|
import w from "react-textarea-autosize";
|
|
6
6
|
import * as u from "@radix-ui/react-select";
|
|
7
7
|
import * as R from "@radix-ui/react-checkbox";
|
|
8
8
|
import { useIntelligentForm as s } from "./intelligent-form/intelligent-form-provider.js";
|
|
9
|
-
import { IntelligentFormProvider as
|
|
9
|
+
import { IntelligentFormProvider as Ai } from "./intelligent-form/intelligent-form-provider.js";
|
|
10
10
|
import * as v from "@radix-ui/react-scroll-area";
|
|
11
11
|
import { BuiltInIconRenderer as S } from "../atoms/icons/built-in-icon-renderer.js";
|
|
12
12
|
import { maybeRender as b, dataAttr as a } from "../utils/misc.js";
|
|
13
13
|
import { Controller as L } from "react-hook-form";
|
|
14
|
-
import { IntelligentFormFieldProvider as
|
|
15
|
-
import { CheckboxIcon as
|
|
16
|
-
import { useInkeepConfig as
|
|
17
|
-
import { SourceItemProvider as
|
|
14
|
+
import { IntelligentFormFieldProvider as V, useIntelligentFormField as _ } from "../providers/intelligent-form-field-provider.js";
|
|
15
|
+
import { CheckboxIcon as H } from "../atoms/icons/checkbox-icon.js";
|
|
16
|
+
import { useInkeepConfig as x } from "../providers/config-provider.js";
|
|
17
|
+
import { SourceItemProvider as E, useSourceItem as T } from "../providers/source-item-provider.js";
|
|
18
18
|
import { LinkWithQueryParams as D } from "../atoms/link.js";
|
|
19
19
|
import { Markdown as N } from "../atoms/markdown/index.js";
|
|
20
|
-
import { useComposedRefs as
|
|
20
|
+
import { useComposedRefs as I } from "../utils/compose-refs.js";
|
|
21
21
|
import { composeEventHandlers as F } from "../utils/compose-event-handlers.js";
|
|
22
22
|
const q = t("form", {
|
|
23
23
|
_id: "intelligentForm__Root"
|
|
24
|
-
}),
|
|
24
|
+
}), ke = (i) => {
|
|
25
25
|
const { onSubmit: e, ...n } = i, { handleSubmit: r } = s();
|
|
26
26
|
return /* @__PURE__ */ o(q, { onSubmit: F(e, r), ...n });
|
|
27
|
-
},
|
|
27
|
+
}, Ae = t("h2", {
|
|
28
28
|
_id: "intelligentForm__Heading",
|
|
29
29
|
children: "Contact Support"
|
|
30
30
|
}), Le = t("div", {
|
|
31
31
|
_id: "intelligentForm__Content"
|
|
32
|
-
}),
|
|
32
|
+
}), Ve = t(v.Root, {
|
|
33
33
|
_id: "intelligentForm__Content__ScrollArea"
|
|
34
34
|
}), M = t(v.Viewport, {
|
|
35
35
|
_id: "intelligentForm__Content__ScrollAreaViewport"
|
|
36
|
-
}),
|
|
36
|
+
}), He = (i) => {
|
|
37
37
|
const { children: e, ...n } = i;
|
|
38
38
|
return /* @__PURE__ */ o(
|
|
39
39
|
M,
|
|
@@ -45,7 +45,7 @@ const q = t("form", {
|
|
|
45
45
|
...n
|
|
46
46
|
}
|
|
47
47
|
);
|
|
48
|
-
},
|
|
48
|
+
}, Ee = t(
|
|
49
49
|
v.ScrollAreaScrollbar,
|
|
50
50
|
{
|
|
51
51
|
_id: "intelligentForm__Content__ScrollAreaScrollbar"
|
|
@@ -82,46 +82,46 @@ const q = t("form", {
|
|
|
82
82
|
formConfig: { successView: e }
|
|
83
83
|
} = s();
|
|
84
84
|
return /* @__PURE__ */ o(U, { children: e.heading, ...i });
|
|
85
|
-
},
|
|
85
|
+
}, j = t("p", {
|
|
86
86
|
_id: "intelligentForm__SuccessMessage"
|
|
87
87
|
}), Oe = (i) => {
|
|
88
88
|
const {
|
|
89
89
|
formConfig: { successView: e }
|
|
90
90
|
} = s();
|
|
91
|
-
return /* @__PURE__ */ o(
|
|
91
|
+
return /* @__PURE__ */ o(j, { children: e.message, ...i });
|
|
92
92
|
}, Ue = t("div", {
|
|
93
93
|
_id: "intelligentForm__PrimaryForm"
|
|
94
|
-
}),
|
|
94
|
+
}), Q = t("div", {
|
|
95
95
|
_id: "intelligentForm__PrimaryFormFields"
|
|
96
|
-
}),
|
|
96
|
+
}), W = t("p", {
|
|
97
97
|
_id: "intelligentForm__PrimaryForm__Description"
|
|
98
|
-
}),
|
|
98
|
+
}), je = (i) => {
|
|
99
99
|
const {
|
|
100
100
|
formConfig: { primary: e }
|
|
101
101
|
} = s();
|
|
102
|
-
return e.description ? /* @__PURE__ */ o(
|
|
103
|
-
},
|
|
102
|
+
return e.description ? /* @__PURE__ */ o(W, { children: e.description, ...i }) : null;
|
|
103
|
+
}, Qe = (i) => {
|
|
104
104
|
const { children: e, ...n } = i, {
|
|
105
105
|
formConfig: { primary: r }
|
|
106
106
|
} = s();
|
|
107
|
-
return /* @__PURE__ */ o(
|
|
108
|
-
},
|
|
107
|
+
return /* @__PURE__ */ o(Q, { children: b(e, r.fields), ...n });
|
|
108
|
+
}, $ = t("button", {
|
|
109
109
|
_id: "intelligentForm__PrimaryFormSubmit",
|
|
110
110
|
type: "button",
|
|
111
111
|
children: "Next"
|
|
112
|
-
}),
|
|
112
|
+
}), We = (i) => {
|
|
113
113
|
const { onClick: e, ...n } = i, { submittedPrimaryForm: r, handleSubmitPrimaryForm: l } = s();
|
|
114
114
|
return /* @__PURE__ */ o(
|
|
115
|
-
|
|
115
|
+
$,
|
|
116
116
|
{
|
|
117
117
|
"data-submitted": a(r),
|
|
118
118
|
onClick: F(e, l),
|
|
119
119
|
...n
|
|
120
120
|
}
|
|
121
121
|
);
|
|
122
|
-
},
|
|
122
|
+
}, G = t("div", {
|
|
123
123
|
_id: "intelligentForm__Field"
|
|
124
|
-
}),
|
|
124
|
+
}), $e = (i) => {
|
|
125
125
|
const { field: e, autoFocus: n, ...r } = i, { control: l, errors: c } = s();
|
|
126
126
|
return /* @__PURE__ */ o(
|
|
127
127
|
L,
|
|
@@ -129,19 +129,19 @@ const q = t("form", {
|
|
|
129
129
|
name: e.name,
|
|
130
130
|
control: l,
|
|
131
131
|
rules: {
|
|
132
|
-
required: e.
|
|
132
|
+
required: e.isRequired ? `${e.label} is required.` : void 0
|
|
133
133
|
},
|
|
134
134
|
render: ({ field: m }) => {
|
|
135
|
-
const d = m.value !== void 0 || e.inputType === "
|
|
135
|
+
const d = m.value !== void 0 || e.inputType === "file";
|
|
136
136
|
return /* @__PURE__ */ o(
|
|
137
|
-
|
|
137
|
+
V,
|
|
138
138
|
{
|
|
139
139
|
"data-invalid": a(!!c[e.name]),
|
|
140
140
|
field: e,
|
|
141
141
|
fieldProps: m,
|
|
142
142
|
autoFocus: n,
|
|
143
143
|
children: d && /* @__PURE__ */ o(
|
|
144
|
-
|
|
144
|
+
G,
|
|
145
145
|
{
|
|
146
146
|
"data-input-type": e.inputType,
|
|
147
147
|
"data-hidden": a(e.isHidden),
|
|
@@ -153,23 +153,23 @@ const q = t("form", {
|
|
|
153
153
|
}
|
|
154
154
|
}
|
|
155
155
|
);
|
|
156
|
-
},
|
|
156
|
+
}, J = t("label", {
|
|
157
157
|
_id: "intelligentForm__FieldLabel"
|
|
158
|
-
}),
|
|
158
|
+
}), Ge = (i) => {
|
|
159
159
|
const { field: e } = _();
|
|
160
160
|
return /* @__PURE__ */ o(
|
|
161
|
-
|
|
161
|
+
J,
|
|
162
162
|
{
|
|
163
|
-
"data-required": a(e.
|
|
163
|
+
"data-required": a(e.isRequired),
|
|
164
164
|
htmlFor: e.name,
|
|
165
165
|
children: e.label,
|
|
166
166
|
...i
|
|
167
167
|
}
|
|
168
168
|
);
|
|
169
|
-
},
|
|
169
|
+
}, K = t("input", {
|
|
170
170
|
_id: "intelligentForm__FieldText",
|
|
171
171
|
type: "text"
|
|
172
|
-
}),
|
|
172
|
+
}), B = f((i, e) => {
|
|
173
173
|
const {
|
|
174
174
|
field: n,
|
|
175
175
|
error: r,
|
|
@@ -180,14 +180,14 @@ const q = t("form", {
|
|
|
180
180
|
...d
|
|
181
181
|
},
|
|
182
182
|
autoFocus: p
|
|
183
|
-
} = _(), g =
|
|
183
|
+
} = _(), g = I(
|
|
184
184
|
e,
|
|
185
185
|
m
|
|
186
186
|
);
|
|
187
187
|
return /* @__PURE__ */ o(
|
|
188
|
-
|
|
188
|
+
K,
|
|
189
189
|
{
|
|
190
|
-
asChild: n.inputType === "
|
|
190
|
+
asChild: n.inputType === "textarea",
|
|
191
191
|
ref: g,
|
|
192
192
|
id: n.name,
|
|
193
193
|
autoFocus: p,
|
|
@@ -197,28 +197,28 @@ const q = t("form", {
|
|
|
197
197
|
onBlur: F(i.onBlur, c),
|
|
198
198
|
...d,
|
|
199
199
|
...i,
|
|
200
|
-
children: n.inputType === "
|
|
200
|
+
children: n.inputType === "textarea" ? /* @__PURE__ */ o(w, { minRows: 3, maxRows: 10 }) : null
|
|
201
201
|
}
|
|
202
202
|
);
|
|
203
|
-
}),
|
|
203
|
+
}), Je = t(B, {
|
|
204
204
|
_id: "intelligentForm__FieldEmail",
|
|
205
205
|
type: "email"
|
|
206
|
-
}),
|
|
206
|
+
}), X = t("input", {
|
|
207
207
|
_id: "intelligentForm__FieldFile",
|
|
208
208
|
type: "file",
|
|
209
209
|
multiple: !0
|
|
210
|
-
}),
|
|
210
|
+
}), Ke = (i) => {
|
|
211
211
|
const {
|
|
212
212
|
field: e,
|
|
213
213
|
error: n,
|
|
214
214
|
fieldProps: { value: r, onChange: l, onBlur: c, ...m },
|
|
215
215
|
autoFocus: d
|
|
216
|
-
} = _(), { onChange: p, onBlur: g, ...y } = i,
|
|
217
|
-
const
|
|
218
|
-
l(
|
|
216
|
+
} = _(), { onChange: p, onBlur: g, ...y } = i, P = (k) => {
|
|
217
|
+
const A = k.target.files;
|
|
218
|
+
l(A);
|
|
219
219
|
};
|
|
220
220
|
return /* @__PURE__ */ o(
|
|
221
|
-
|
|
221
|
+
X,
|
|
222
222
|
{
|
|
223
223
|
id: e.name,
|
|
224
224
|
autoFocus: d,
|
|
@@ -226,12 +226,12 @@ const q = t("form", {
|
|
|
226
226
|
"data-invalid": a(!!n),
|
|
227
227
|
...y,
|
|
228
228
|
...m,
|
|
229
|
-
onChange: F(p,
|
|
229
|
+
onChange: F(p, P),
|
|
230
230
|
onBlur: F(g, c)
|
|
231
231
|
}
|
|
232
232
|
);
|
|
233
|
-
},
|
|
234
|
-
|
|
233
|
+
}, Xe = t(
|
|
234
|
+
B,
|
|
235
235
|
{
|
|
236
236
|
_id: "intelligentForm__FieldTextArea",
|
|
237
237
|
type: "textarea",
|
|
@@ -256,7 +256,7 @@ const q = t("form", {
|
|
|
256
256
|
);
|
|
257
257
|
}, Ze = t(R.Indicator, {
|
|
258
258
|
_id: "intelligentForm__FieldCheckboxIndicator",
|
|
259
|
-
children: /* @__PURE__ */ o(
|
|
259
|
+
children: /* @__PURE__ */ o(H, {})
|
|
260
260
|
}), Z = t(u.Root, {
|
|
261
261
|
_id: "intelligentForm__FieldSelect"
|
|
262
262
|
}), ei = (i) => {
|
|
@@ -317,14 +317,14 @@ const q = t("form", {
|
|
|
317
317
|
}), te = t("div", {
|
|
318
318
|
_id: "intelligentForm__BotHeading__Name"
|
|
319
319
|
}), Fi = (i) => {
|
|
320
|
-
const { baseSettings: e } =
|
|
321
|
-
formConfig: {
|
|
320
|
+
const { baseSettings: e } = x(), { organizationDisplayName: n } = e ?? {}, {
|
|
321
|
+
formConfig: { aiAssistantName: r }
|
|
322
322
|
} = s();
|
|
323
323
|
return /* @__PURE__ */ o(te, { children: r ?? n, ...i });
|
|
324
324
|
}, ne = t("div", {
|
|
325
325
|
_id: "intelligentForm__Loading"
|
|
326
|
-
}), ui =
|
|
327
|
-
const { loading: n } = s(), r = C(null), l =
|
|
326
|
+
}), ui = f(({ ...i }, e) => {
|
|
327
|
+
const { loading: n } = s(), r = C(null), l = I(e, r);
|
|
328
328
|
return h(() => {
|
|
329
329
|
n && r.current && r.current.scrollIntoView({
|
|
330
330
|
behavior: "smooth",
|
|
@@ -334,8 +334,8 @@ const q = t("form", {
|
|
|
334
334
|
}, [n]), n ? /* @__PURE__ */ o(ne, { ref: l, ...i }) : null;
|
|
335
335
|
}), re = t("div", {
|
|
336
336
|
_id: "intelligentForm__ConfidentResponse"
|
|
337
|
-
}), _i =
|
|
338
|
-
const { aiResponse: n, loading: r } = s(), l = C(null), c =
|
|
337
|
+
}), _i = f(({ ...i }, e) => {
|
|
338
|
+
const { aiResponse: n, loading: r } = s(), l = C(null), c = I(e, l);
|
|
339
339
|
return h(() => {
|
|
340
340
|
!r && n.answerConfidence && l.current && l.current.scrollIntoView({
|
|
341
341
|
behavior: "smooth",
|
|
@@ -371,8 +371,8 @@ const q = t("form", {
|
|
|
371
371
|
children: "Escalate to human"
|
|
372
372
|
}), se = t("div", {
|
|
373
373
|
_id: "intelligentForm__SecondaryForm"
|
|
374
|
-
}),
|
|
375
|
-
const { showSecondaryFields: n } = s(), r = C(null), l =
|
|
374
|
+
}), fi = f(({ ...i }, e) => {
|
|
375
|
+
const { showSecondaryFields: n } = s(), r = C(null), l = I(e, r);
|
|
376
376
|
return h(() => {
|
|
377
377
|
n && r.current && r.current.scrollIntoView({
|
|
378
378
|
behavior: "smooth",
|
|
@@ -382,7 +382,7 @@ const q = t("form", {
|
|
|
382
382
|
}, [n]), n ? /* @__PURE__ */ o(se, { ref: l, ...i }) : null;
|
|
383
383
|
}), ce = t("p", {
|
|
384
384
|
_id: "intelligentForm__SecondaryForm__Description"
|
|
385
|
-
}),
|
|
385
|
+
}), Ii = (i) => {
|
|
386
386
|
const {
|
|
387
387
|
formConfig: { secondary: e },
|
|
388
388
|
aiResponse: { answerConfidence: n }
|
|
@@ -395,7 +395,7 @@ const q = t("form", {
|
|
|
395
395
|
return /* @__PURE__ */ o(ce, { children: r, ...i });
|
|
396
396
|
}, me = t("div", {
|
|
397
397
|
_id: "intelligentForm__SecondaryFormFields"
|
|
398
|
-
}),
|
|
398
|
+
}), Pi = (i) => {
|
|
399
399
|
const { children: e, ...n } = i, {
|
|
400
400
|
formConfig: { secondary: r }
|
|
401
401
|
} = s();
|
|
@@ -419,7 +419,7 @@ const q = t("form", {
|
|
|
419
419
|
}), wi = (i) => {
|
|
420
420
|
const { children: e, ...n } = i, {
|
|
421
421
|
baseSettings: { transformSource: r, organizationDisplayName: l }
|
|
422
|
-
} =
|
|
422
|
+
} = x(), {
|
|
423
423
|
aiResponse: { recordsConsidered: c }
|
|
424
424
|
} = s();
|
|
425
425
|
if (!c) return null;
|
|
@@ -427,14 +427,14 @@ const q = t("form", {
|
|
|
427
427
|
const g = r(p, "intelligentFormSource", {
|
|
428
428
|
organizationDisplayName: l
|
|
429
429
|
});
|
|
430
|
-
return d.some((
|
|
430
|
+
return d.some((P) => P.url === g.url) || d.push(g), d;
|
|
431
431
|
}, []);
|
|
432
432
|
return /* @__PURE__ */ o(ae, { children: b(e, m), ...n });
|
|
433
433
|
}, Fe = t(D, {
|
|
434
434
|
_id: "intelligentForm__Source"
|
|
435
435
|
}), Ri = (i) => {
|
|
436
436
|
const { source: e, ...n } = i;
|
|
437
|
-
return /* @__PURE__ */ o(
|
|
437
|
+
return /* @__PURE__ */ o(E, { source: { ...e, isExternal: !!e.shouldOpenInNewTab }, children: /* @__PURE__ */ o(
|
|
438
438
|
Fe,
|
|
439
439
|
{
|
|
440
440
|
"data-type": e.type,
|
|
@@ -446,13 +446,13 @@ const q = t("form", {
|
|
|
446
446
|
) });
|
|
447
447
|
}, ue = t(S, {
|
|
448
448
|
_id: "intelligentForm__SourceIcon"
|
|
449
|
-
}),
|
|
450
|
-
const { source: e } =
|
|
449
|
+
}), xi = (i) => {
|
|
450
|
+
const { source: e } = T();
|
|
451
451
|
return /* @__PURE__ */ o(ue, { iconSettings: e.icon, "data-type": e.type, ...i });
|
|
452
452
|
}, _e = t("span", {
|
|
453
453
|
_id: "intelligentForm__SourceTitle"
|
|
454
|
-
}),
|
|
455
|
-
const { source: e } =
|
|
454
|
+
}), Ti = (i) => {
|
|
455
|
+
const { source: e } = T();
|
|
456
456
|
return /* @__PURE__ */ o(_e, { "data-type": e.type, children: e.title, ...i });
|
|
457
457
|
};
|
|
458
458
|
export {
|
|
@@ -465,19 +465,19 @@ export {
|
|
|
465
465
|
pi as ConfidentResponseButtonIcon,
|
|
466
466
|
vi as ConfidentResponseButtonLabel,
|
|
467
467
|
Le as Content,
|
|
468
|
-
|
|
468
|
+
Ve as ContentScrollArea,
|
|
469
469
|
Ne as ContentScrollAreaCorner,
|
|
470
|
-
|
|
470
|
+
Ee as ContentScrollAreaScrollbar,
|
|
471
471
|
De as ContentScrollAreaThumb,
|
|
472
|
-
|
|
472
|
+
He as ContentScrollAreaViewport,
|
|
473
473
|
hi as Error,
|
|
474
|
-
|
|
474
|
+
$e as FormField,
|
|
475
475
|
Ye as FormFieldCheckbox,
|
|
476
476
|
Ze as FormFieldCheckboxIndicator,
|
|
477
|
-
|
|
477
|
+
Je as FormFieldEmail,
|
|
478
478
|
mi as FormFieldError,
|
|
479
|
-
|
|
480
|
-
|
|
479
|
+
Ke as FormFieldFile,
|
|
480
|
+
Ge as FormFieldLabel,
|
|
481
481
|
ei as FormFieldSelect,
|
|
482
482
|
ri as FormFieldSelectContent,
|
|
483
483
|
ni as FormFieldSelectIcon,
|
|
@@ -487,9 +487,9 @@ export {
|
|
|
487
487
|
ii as FormFieldSelectTrigger,
|
|
488
488
|
ti as FormFieldSelectValue,
|
|
489
489
|
oi as FormFieldSelectViewport,
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
490
|
+
B as FormFieldText,
|
|
491
|
+
Xe as FormFieldTextArea,
|
|
492
|
+
Ae as Heading,
|
|
493
493
|
di as IntelligentFormPrimitiveBotHeading,
|
|
494
494
|
ai as IntelligentFormPrimitiveBotHeadingIcon,
|
|
495
495
|
Fi as IntelligentFormPrimitiveBotHeadingName,
|
|
@@ -499,19 +499,19 @@ export {
|
|
|
499
499
|
pi as IntelligentFormPrimitiveConfidentResponseButtonIcon,
|
|
500
500
|
vi as IntelligentFormPrimitiveConfidentResponseButtonLabel,
|
|
501
501
|
Le as IntelligentFormPrimitiveContent,
|
|
502
|
-
|
|
502
|
+
Ve as IntelligentFormPrimitiveContentScrollArea,
|
|
503
503
|
Ne as IntelligentFormPrimitiveContentScrollAreaCorner,
|
|
504
|
-
|
|
504
|
+
Ee as IntelligentFormPrimitiveContentScrollAreaScrollbar,
|
|
505
505
|
De as IntelligentFormPrimitiveContentScrollAreaThumb,
|
|
506
|
-
|
|
506
|
+
He as IntelligentFormPrimitiveContentScrollAreaViewport,
|
|
507
507
|
hi as IntelligentFormPrimitiveFormError,
|
|
508
|
-
|
|
508
|
+
$e as IntelligentFormPrimitiveFormField,
|
|
509
509
|
Ye as IntelligentFormPrimitiveFormFieldCheckbox,
|
|
510
510
|
Ze as IntelligentFormPrimitiveFormFieldCheckboxIndicator,
|
|
511
|
-
|
|
511
|
+
Je as IntelligentFormPrimitiveFormFieldEmail,
|
|
512
512
|
mi as IntelligentFormPrimitiveFormFieldError,
|
|
513
|
-
|
|
514
|
-
|
|
513
|
+
Ke as IntelligentFormPrimitiveFormFieldFile,
|
|
514
|
+
Ge as IntelligentFormPrimitiveFormFieldLabel,
|
|
515
515
|
ei as IntelligentFormPrimitiveFormFieldSelect,
|
|
516
516
|
ri as IntelligentFormPrimitiveFormFieldSelectContent,
|
|
517
517
|
ni as IntelligentFormPrimitiveFormFieldSelectIcon,
|
|
@@ -521,22 +521,22 @@ export {
|
|
|
521
521
|
ii as IntelligentFormPrimitiveFormFieldSelectTrigger,
|
|
522
522
|
ti as IntelligentFormPrimitiveFormFieldSelectValue,
|
|
523
523
|
oi as IntelligentFormPrimitiveFormFieldSelectViewport,
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
524
|
+
B as IntelligentFormPrimitiveFormFieldText,
|
|
525
|
+
Xe as IntelligentFormPrimitiveFormFieldTextArea,
|
|
526
|
+
Ae as IntelligentFormPrimitiveHeading,
|
|
527
527
|
ui as IntelligentFormPrimitiveLoading,
|
|
528
528
|
Ue as IntelligentFormPrimitivePrimaryForm,
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
529
|
+
je as IntelligentFormPrimitivePrimaryFormDescription,
|
|
530
|
+
Qe as IntelligentFormPrimitivePrimaryFormFields,
|
|
531
|
+
We as IntelligentFormPrimitivePrimaryFormSubmit,
|
|
532
|
+
ke as IntelligentFormPrimitiveRoot,
|
|
533
|
+
fi as IntelligentFormPrimitiveSecondaryForm,
|
|
534
|
+
Ii as IntelligentFormPrimitiveSecondaryFormDescription,
|
|
535
|
+
Pi as IntelligentFormPrimitiveSecondaryFormFields,
|
|
536
536
|
Ci as IntelligentFormPrimitiveSecondaryFormSubmit,
|
|
537
537
|
Ri as IntelligentFormPrimitiveSource,
|
|
538
|
-
|
|
539
|
-
|
|
538
|
+
xi as IntelligentFormPrimitiveSourceIcon,
|
|
539
|
+
Ti as IntelligentFormPrimitiveSourceTitle,
|
|
540
540
|
bi as IntelligentFormPrimitiveSources,
|
|
541
541
|
yi as IntelligentFormPrimitiveSourcesCaption,
|
|
542
542
|
wi as IntelligentFormPrimitiveSourcesList,
|
|
@@ -546,18 +546,18 @@ export {
|
|
|
546
546
|
Oe as IntelligentFormPrimitiveSuccessMessage,
|
|
547
547
|
ui as Loading,
|
|
548
548
|
Ue as PrimaryForm,
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
549
|
+
je as PrimaryFormDescription,
|
|
550
|
+
Qe as PrimaryFormFields,
|
|
551
|
+
We as PrimaryFormSubmit,
|
|
552
|
+
Ai as Provider,
|
|
553
|
+
ke as Root,
|
|
554
|
+
fi as SecondaryForm,
|
|
555
|
+
Ii as SecondaryFormDescription,
|
|
556
|
+
Pi as SecondaryFormFields,
|
|
557
557
|
Ci as SecondaryFormSubmit,
|
|
558
558
|
Ri as Source,
|
|
559
|
-
|
|
560
|
-
|
|
559
|
+
xi as SourceIcon,
|
|
560
|
+
Ti as SourceTitle,
|
|
561
561
|
bi as Sources,
|
|
562
562
|
yi as SourcesCaption,
|
|
563
563
|
wi as SourcesList,
|
|
@@ -5,7 +5,7 @@ export declare const ModalProvider: React.FC<{
|
|
|
5
5
|
modal: ModalContextValue;
|
|
6
6
|
}>;
|
|
7
7
|
export declare const useModal: () => {
|
|
8
|
-
|
|
8
|
+
isOpen: boolean | undefined;
|
|
9
9
|
openModal: () => void;
|
|
10
10
|
closeModal: () => void;
|
|
11
11
|
handleOpenChange: (newState: boolean) => void;
|
|
@@ -5,7 +5,7 @@ export declare const ModalProvider: React.FC<{
|
|
|
5
5
|
modal: ModalContextValue;
|
|
6
6
|
}>;
|
|
7
7
|
export declare const useModal: () => {
|
|
8
|
-
|
|
8
|
+
isOpen: boolean | undefined;
|
|
9
9
|
openModal: () => void;
|
|
10
10
|
closeModal: () => void;
|
|
11
11
|
handleOpenChange: (newState: boolean) => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react"),p=c=>{const{
|
|
1
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react"),p=c=>{const{isOpen:s,onOpenChange:l,shortcutKey:a}=c??{},e=n.useCallback(o=>{l?.(o)},[l]),r=n.useCallback(o=>{e(o)},[e]),u=n.useCallback(()=>e(!0),[e]),d=n.useCallback(()=>e(!1),[e]);return n.useEffect(()=>{const o=t=>{a&&(t.metaKey||t.ctrlKey)&&t.key.toLowerCase()===a.toLowerCase()&&(t.preventDefault(),t.stopPropagation(),e(!0)),t.key==="Escape"&&s&&(t.preventDefault(),e(!1))};return document.addEventListener("keydown",o),()=>document.removeEventListener("keydown",o)},[a,e,s]),{isOpen:s,openModal:u,closeModal:d,handleOpenChange:r,shortcutKey:a}};exports.useInkeepModal=p;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { InkeepModalSettings } from '@inkeep/cxkit-types';
|
|
2
2
|
export declare const useInkeepModal: (props: InkeepModalSettings | undefined) => {
|
|
3
|
-
|
|
3
|
+
isOpen: boolean | undefined;
|
|
4
4
|
openModal: () => void;
|
|
5
5
|
closeModal: () => void;
|
|
6
6
|
handleOpenChange: (newState: boolean) => void;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { InkeepModalSettings } from '@inkeep/cxkit-types';
|
|
2
2
|
export declare const useInkeepModal: (props: InkeepModalSettings | undefined) => {
|
|
3
|
-
|
|
3
|
+
isOpen: boolean | undefined;
|
|
4
4
|
openModal: () => void;
|
|
5
5
|
closeModal: () => void;
|
|
6
6
|
handleOpenChange: (newState: boolean) => void;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { useCallback as s, useEffect as d } from "react";
|
|
3
|
-
const
|
|
4
|
-
const {
|
|
3
|
+
const i = (c) => {
|
|
4
|
+
const { isOpen: a, onOpenChange: r, shortcutKey: n } = c ?? {}, e = s(
|
|
5
5
|
(t) => {
|
|
6
6
|
r?.(t);
|
|
7
7
|
},
|
|
@@ -18,7 +18,7 @@ const y = (c) => {
|
|
|
18
18
|
};
|
|
19
19
|
return document.addEventListener("keydown", t), () => document.removeEventListener("keydown", t);
|
|
20
20
|
}, [n, e, a]), {
|
|
21
|
-
|
|
21
|
+
isOpen: a,
|
|
22
22
|
openModal: p,
|
|
23
23
|
closeModal: u,
|
|
24
24
|
handleOpenChange: l,
|
|
@@ -26,5 +26,5 @@ const y = (c) => {
|
|
|
26
26
|
};
|
|
27
27
|
};
|
|
28
28
|
export {
|
|
29
|
-
|
|
29
|
+
i as useInkeepModal
|
|
30
30
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),t=require("../atoms/dialog.cjs"),
|
|
1
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),t=require("../atoms/dialog.cjs"),i=require("./factory.cjs"),d=require("../atoms/icons/custom-icon.cjs"),c=require("./modal/use-inkeep-modal.cjs"),s=require("./modal/modal-provider.cjs"),u=require("../utils/compose-event-handlers.cjs"),m=require("../hooks/use-media-query.cjs"),M=require("../utils/misc.cjs"),p=i.ikp(t.Root,{_id:"modal"}),v=e=>{const{onOpenChange:n,config:l,...a}=e,r=c.useInkeepModal(l);return o.jsx(s.ModalProvider,{modal:r,children:o.jsx(p,{open:r.isOpen,onOpenChange:u.composeEventHandlers(n,r.handleOpenChange),...a})})},C=i.ikp(t.Overlay,{_id:"modal__Overlay"}),y=i.ikp(t.Content,{_id:"modal__Content","aria-describedby":void 0}),_=e=>{const n=m.useMediaQuery("(max-width: 768px)");return o.jsx(y,{"data-mobile":M.dataAttr(n),...e})},q=i.ikp(t.Close,{_id:"modal__Close",children:o.jsx(d.CustomIcon,{iconKey:"close"})}),O=e=>s.useModal()?o.jsx(q,{...e}):null;exports.Close=O;exports.Content=_;exports.Modal=v;exports.Overlay=C;
|
package/dist/components/modal.js
CHANGED
|
@@ -15,23 +15,23 @@ const _ = n(d, {
|
|
|
15
15
|
return /* @__PURE__ */ e(C, { modal: r, children: /* @__PURE__ */ e(
|
|
16
16
|
_,
|
|
17
17
|
{
|
|
18
|
-
open: r.
|
|
18
|
+
open: r.isOpen,
|
|
19
19
|
onOpenChange: f(t, r.handleOpenChange),
|
|
20
20
|
...a
|
|
21
21
|
}
|
|
22
22
|
) });
|
|
23
23
|
}, E = n(l, {
|
|
24
24
|
_id: "modal__Overlay"
|
|
25
|
-
}),
|
|
25
|
+
}), O = n(m, {
|
|
26
26
|
_id: "modal__Content",
|
|
27
27
|
"aria-describedby": void 0
|
|
28
28
|
}), H = (o) => {
|
|
29
29
|
const t = u("(max-width: 768px)");
|
|
30
|
-
return /* @__PURE__ */ e(
|
|
31
|
-
},
|
|
30
|
+
return /* @__PURE__ */ e(O, { "data-mobile": v(t), ...o });
|
|
31
|
+
}, h = n(s, {
|
|
32
32
|
_id: "modal__Close",
|
|
33
33
|
children: /* @__PURE__ */ e(c, { iconKey: "close" })
|
|
34
|
-
}), K = (o) => M() ? /* @__PURE__ */ e(
|
|
34
|
+
}), K = (o) => M() ? /* @__PURE__ */ e(h, { ...o }) : null;
|
|
35
35
|
export {
|
|
36
36
|
K as Close,
|
|
37
37
|
H as Content,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const S=require("react"),w=require("../providers/config-provider.cjs"),a="inkeepUsagePreferences",_={hasSwitchModeButtonJiggled:!1,userId:null},k={defaultView:null,inkeepChatSessionId:null},d={..._,...k},f={set(e,o,t,n=365){try{if(e==="cookie"){const s=new Date;t===void 0?(s.setTime(s.getTime()-1),document.cookie=`${a}_${o}=; expires=${s.toUTCString()}; path=/`):(s.setTime(s.getTime()+n*24*60*60*1e3),document.cookie=`${a}_${o}=${t}; expires=${s.toUTCString()}; path=/`)}else typeof sessionStorage<"u"&&sessionStorage.setItem(`${a}_${o}`,t?JSON.stringify(t):"")}catch{return null}},get(e,o){if(e==="cookie"){const t=`${a}_${o}=`,n=document.cookie.split(";");for(const s of n){const i=s.trim();if(i.startsWith(t))return i.substring(t.length)}return null}try{if(typeof sessionStorage<"u"){const t=sessionStorage.getItem(`${a}_${o}`);return t?JSON.parse(t):null}}catch{return null}return null}},I=()=>{const{baseSettings:e,
|
|
1
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const S=require("react"),w=require("../providers/config-provider.cjs"),a="inkeepUsagePreferences",_={hasSwitchModeButtonJiggled:!1,userId:null},k={defaultView:null,inkeepChatSessionId:null},d={..._,...k},f={set(e,o,t,n=365){try{if(e==="cookie"){const s=new Date;t===void 0?(s.setTime(s.getTime()-1),document.cookie=`${a}_${o}=; expires=${s.toUTCString()}; path=/`):(s.setTime(s.getTime()+n*24*60*60*1e3),document.cookie=`${a}_${o}=${t}; expires=${s.toUTCString()}; path=/`)}else typeof sessionStorage<"u"&&sessionStorage.setItem(`${a}_${o}`,t?JSON.stringify(t):"")}catch{return null}},get(e,o){if(e==="cookie"){const t=`${a}_${o}=`,n=document.cookie.split(";");for(const s of n){const i=s.trim();if(i.startsWith(t))return i.substring(t.length)}return null}try{if(typeof sessionStorage<"u"){const t=sessionStorage.getItem(`${a}_${o}`);return t?JSON.parse(t):null}}catch{return null}return null}},I=()=>{const{baseSettings:e,componentType:o}=w.useInkeepConfig(),{optOutAllAnalytics:t,optOutFunctionalCookies:n}=e.privacyPreferences,i=!t&&!n&&p()?"cookie":"sessionStorage",m=`${e.apiKey}-${o}`,u=r=>r in k?`${r}-${m}`:r,y=Object.keys(d).reduce((r,c)=>{const l=u(c),g=f.get(i,l);return{...r,[c]:g}},{...d}),[$,h]=S.useState(y),C=(r,c,l=365)=>{const g=u(r);f.set(i,g,c,l),h(b=>({...b,[r]:c}))};return S.useEffect(()=>{if(n)for(const r of Object.keys(d)){const c=u(r);f.set("cookie",c,null,-1)}},[n]),{browserStorage:$,setBrowserStorage:C}},T=()=>{try{if(typeof localStorage>"u")return!1;const e="__df709c5b-6651-43dc-94e7-d8dc899bf4e8__";return localStorage.setItem(e,"test_value"),localStorage.removeItem(e),!0}catch{return!1}},B=()=>{if(typeof document>"u")return!1;document.cookie="testcookie=true; Path=/; Max-Age=1000";const e=document.cookie.includes("testcookie=true");return document.cookie="testcookie=; Path=/; Max-Age=-1000",e},p=()=>{const e=T(),o=B();return e&&o};exports.passesBrowserStorageChecks=p;exports.useBrowserStorage=I;
|
|
@@ -42,15 +42,15 @@ const a = "inkeepUsagePreferences", w = {
|
|
|
42
42
|
return null;
|
|
43
43
|
}
|
|
44
44
|
}, U = () => {
|
|
45
|
-
const { baseSettings: e,
|
|
45
|
+
const { baseSettings: e, componentType: o } = _(), { optOutAllAnalytics: t, optOutFunctionalCookies: r } = e.privacyPreferences, i = !t && !r && B() ? "cookie" : "sessionStorage", p = `${e.apiKey}-${o}`, u = (n) => n in k ? `${n}-${p}` : n, S = Object.keys(f).reduce(
|
|
46
46
|
(n, c) => {
|
|
47
|
-
const
|
|
47
|
+
const l = u(c), g = d.get(i, l);
|
|
48
48
|
return { ...n, [c]: g };
|
|
49
49
|
},
|
|
50
50
|
{ ...f }
|
|
51
|
-
), [m, y] = C(
|
|
52
|
-
const g =
|
|
53
|
-
d.set(i, g, c,
|
|
51
|
+
), [m, y] = C(S), $ = (n, c, l = 365) => {
|
|
52
|
+
const g = u(n);
|
|
53
|
+
d.set(i, g, c, l), y((h) => ({
|
|
54
54
|
...h,
|
|
55
55
|
[n]: c
|
|
56
56
|
}));
|
|
@@ -58,7 +58,7 @@ const a = "inkeepUsagePreferences", w = {
|
|
|
58
58
|
return b(() => {
|
|
59
59
|
if (r)
|
|
60
60
|
for (const n of Object.keys(f)) {
|
|
61
|
-
const c =
|
|
61
|
+
const c = u(n);
|
|
62
62
|
d.set("cookie", c, null, -1);
|
|
63
63
|
}
|
|
64
64
|
}, [r]), {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const P=require("react/jsx-runtime"),t=require("react"),y=require("../atoms/api/analytics/events.cjs"),B=require("./config-provider.cjs"),b=require("./user-provider.cjs"),p=t.createContext(void 0),f=({children:e})=>{const{baseSettings:s,componentType:n}=B.useInkeepConfig(),{apiKey:o,analyticsApiBaseUrl:r,tags:i,privacyPreferences:d,env:E}=s,{userProperties:c}=b.useUser(),a=t.useMemo(()=>({widgetLibraryVersion:"0.5.4",componentType:n,tags:i}),[n,i]),u=!d.optOutAllAnalytics&&E!=="development",g={logEvent:t.useCallback(async v=>{const m={...a,...v.properties},l={eventName:v.eventName,properties:m,userProperties:c};u&&y.logEvent(l,o,r),s.onEvent?.(l)},[u,s,o,r,c,a])};return P.jsx(p.Provider,{value:g,children:e})},x=()=>{const e=t.useContext(p);if(!e)throw new Error("useBaseEvents must be used within a BaseEventsProvider");return e};exports.BaseEventsProvider=f;exports.useBaseEvents=x;
|