@inkeep/cxkit-primitives 0.5.10 → 0.5.11
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/embedded-chat.cjs +3 -3
- package/dist/components/embedded-chat.js +720 -718
- package/dist/components/embedded-search/transform-results.cjs +1 -1
- package/dist/components/embedded-search/transform-results.js +27 -26
- package/dist/components/intelligent-form.cjs +1 -1
- package/dist/components/intelligent-form.js +239 -237
- package/dist/providers/base-events-provider.cjs +1 -1
- package/dist/providers/base-events-provider.js +1 -1
- package/dist/utils/default-settings.cjs +1 -1
- package/dist/utils/default-settings.d.cts +1 -2
- package/dist/utils/default-settings.d.ts +1 -2
- package/dist/utils/default-settings.js +10 -12
- package/dist/utils/transform-source/breadcrumbs.cjs +1 -1
- package/dist/utils/transform-source/breadcrumbs.js +18 -11
- package/dist/utils/transform-source/index.cjs +1 -1
- package/dist/utils/transform-source/index.js +22 -19
- package/package.json +4 -4
- package/dist/utils/transform-source/index.d.cts +0 -2
- package/dist/utils/transform-source/index.d.ts +0 -2
|
@@ -1 +1 @@
|
|
|
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.
|
|
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.11",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;
|
|
@@ -7,7 +7,7 @@ import { useUser as b } from "./user-provider.js";
|
|
|
7
7
|
const m = x(void 0), U = ({ children: e }) => {
|
|
8
8
|
const { baseSettings: t, componentType: o } = C(), { apiKey: n, analyticsApiBaseUrl: s, tags: r, privacyPreferences: u, env: l } = t, { userProperties: i } = b(), a = d(
|
|
9
9
|
() => ({
|
|
10
|
-
widgetLibraryVersion: "0.5.
|
|
10
|
+
widgetLibraryVersion: "0.5.11",
|
|
11
11
|
componentType: o,
|
|
12
12
|
tags: r
|
|
13
13
|
}),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("@inkeep/cxkit-theme"),t=require("./
|
|
1
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("@inkeep/cxkit-theme"),t=require("./tools/links-schema.cjs"),s={model:"inkeep-qa-expert",placeholder:"How do I get started?",aiAssistantName:void 0,shouldOpenLinksInNewTab:!0,disclaimerSettings:{isEnabled:!1,label:"Usage policy"},isShareButtonVisible:!1,isViewOnly:!1,exampleQuestionsLabel:"Example questions",exampleQuestions:[],isFirstExampleQuestionHighlighted:!0,isCopyChatButtonVisible:!1,getHelpOptions:[],workflowsHeader:"Workflows",workflows:[],toolbarButtonLabels:{clear:"Clear",share:"Share",getHelp:"Get help",stop:"Stop",copyChat:"Copy"},prompts:[],tools:[{type:"function",function:{name:"provideLinks",description:"Provides links",parameters:t.linksSchema}}],onToolCall:l=>{}},a={env:"production",apiKey:"",aiApiBaseUrl:"https://api.inkeep.com",analyticsApiBaseUrl:"https://api.io.inkeep.com",shouldBypassCaptcha:!1,privacyPreferences:{optOutAnalyticalCookies:!1,optOutAllAnalytics:!1,optOutFunctionalCookies:!1},tags:[],userProperties:{},primaryBrandColor:e.DEFAULT_PRIMARY_BRAND_COLOR,theme:{varsClassName:"inkeep-widget-vars",...e.theme}},i={shouldOpenLinksInNewTab:!1,maxResults:40,defaultQuery:"",debounceTimeMs:0,tabs:["All","Publications","PDFs","GitHub","Forums","Discord","Slack","StackOverflow"],searchQueryParamKey:"q",placeholder:"Search for anything..."};exports.defaultInkeepAIChatSettings=s;exports.defaultInkeepBaseSettings=a;exports.defaultInkeepSearchSettings=i;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { InkeepBaseSettings
|
|
1
|
+
import { InkeepBaseSettings } from '@inkeep/cxkit-types';
|
|
2
2
|
export declare const defaultInkeepAIChatSettings: {
|
|
3
3
|
model: "inkeep-qa-expert";
|
|
4
4
|
placeholder: string;
|
|
@@ -234,7 +234,6 @@ export declare const defaultInkeepBaseSettings: {
|
|
|
234
234
|
};
|
|
235
235
|
varsClassName: string;
|
|
236
236
|
};
|
|
237
|
-
transformSource: TransformSource;
|
|
238
237
|
};
|
|
239
238
|
export declare const defaultInkeepSearchSettings: {
|
|
240
239
|
shouldOpenLinksInNewTab: false;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { InkeepBaseSettings
|
|
1
|
+
import { InkeepBaseSettings } from '@inkeep/cxkit-types';
|
|
2
2
|
export declare const defaultInkeepAIChatSettings: {
|
|
3
3
|
model: "inkeep-qa-expert";
|
|
4
4
|
placeholder: string;
|
|
@@ -234,7 +234,6 @@ export declare const defaultInkeepBaseSettings: {
|
|
|
234
234
|
};
|
|
235
235
|
varsClassName: string;
|
|
236
236
|
};
|
|
237
|
-
transformSource: TransformSource;
|
|
238
237
|
};
|
|
239
238
|
export declare const defaultInkeepSearchSettings: {
|
|
240
239
|
shouldOpenLinksInNewTab: false;
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { theme as e, DEFAULT_PRIMARY_BRAND_COLOR as s } from "@inkeep/cxkit-theme";
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
const n = {
|
|
3
|
+
import { linksSchema as t } from "./tools/links-schema.js";
|
|
4
|
+
const i = {
|
|
6
5
|
model: "inkeep-qa-expert",
|
|
7
6
|
placeholder: "How do I get started?",
|
|
8
7
|
aiAssistantName: void 0,
|
|
@@ -34,14 +33,14 @@ const n = {
|
|
|
34
33
|
function: {
|
|
35
34
|
name: "provideLinks",
|
|
36
35
|
description: "Provides links",
|
|
37
|
-
parameters:
|
|
36
|
+
parameters: t
|
|
38
37
|
}
|
|
39
38
|
}
|
|
40
39
|
],
|
|
41
40
|
// biome-ignore lint/suspicious/noExplicitAny: <explanation>
|
|
42
|
-
onToolCall: (
|
|
41
|
+
onToolCall: (a) => {
|
|
43
42
|
}
|
|
44
|
-
},
|
|
43
|
+
}, n = {
|
|
45
44
|
env: "production",
|
|
46
45
|
apiKey: "",
|
|
47
46
|
aiApiBaseUrl: "https://api.inkeep.com",
|
|
@@ -61,9 +60,8 @@ const n = {
|
|
|
61
60
|
theme: {
|
|
62
61
|
varsClassName: "inkeep-widget-vars",
|
|
63
62
|
...e
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
}, u = {
|
|
63
|
+
}
|
|
64
|
+
}, r = {
|
|
67
65
|
shouldOpenLinksInNewTab: !1,
|
|
68
66
|
maxResults: 40,
|
|
69
67
|
defaultQuery: "",
|
|
@@ -73,7 +71,7 @@ const n = {
|
|
|
73
71
|
placeholder: "Search for anything..."
|
|
74
72
|
};
|
|
75
73
|
export {
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
74
|
+
i as defaultInkeepAIChatSettings,
|
|
75
|
+
n as defaultInkeepBaseSettings,
|
|
76
|
+
r as defaultInkeepSearchSettings
|
|
79
77
|
};
|
|
@@ -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 o=require("./utils/standardize-organization-display-name.cjs"),i=require("./utils/strip-branding-keywords.cjs"),d=require("./utils/standardize-suffixes.cjs"),c=require("./utils/standardize-common-words.cjs"),u=(r,a)=>{if(r.type!=="documentation")return[];const t=a?.organizationDisplayName;return(r.breadcrumbs?.length?r.breadcrumbs:l(r.url)).map(s=>{let e=s;return t&&(e=o.standardizeOrganizationDisplayName(s,t),e=i.stripBrandingKeywords(e,t)),e=d.standardizeSuffixes(e),e=c.transformCommonWords(e),e})??[]},m=r=>r.split(/[-_]/).map(t=>t.charAt(0).toUpperCase()+t.slice(1).toLowerCase()).join(" ");function l(r){try{return new URL(r).pathname.split("/").filter(n=>n.length>0).slice(0,-1).map(m)}catch(a){return console.error("Invalid URL:",a),[]}}exports.getBreadcrumbs=u;
|
|
@@ -1,16 +1,23 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { standardizeOrganizationDisplayName as
|
|
3
|
-
import { stripBrandingKeywords as
|
|
2
|
+
import { standardizeOrganizationDisplayName as s } from "./utils/standardize-organization-display-name.js";
|
|
3
|
+
import { stripBrandingKeywords as i } from "./utils/strip-branding-keywords.js";
|
|
4
4
|
import { standardizeSuffixes as m } from "./utils/standardize-suffixes.js";
|
|
5
|
-
import { transformCommonWords as
|
|
6
|
-
const
|
|
7
|
-
if (
|
|
8
|
-
const
|
|
9
|
-
return
|
|
10
|
-
let
|
|
11
|
-
return
|
|
5
|
+
import { transformCommonWords as c } from "./utils/standardize-common-words.js";
|
|
6
|
+
const g = (r, a) => {
|
|
7
|
+
if (r.type !== "documentation") return [];
|
|
8
|
+
const e = a?.organizationDisplayName;
|
|
9
|
+
return (r.breadcrumbs?.length ? r.breadcrumbs : d(r.url)).map((o) => {
|
|
10
|
+
let t = o;
|
|
11
|
+
return e && (t = s(o, e), t = i(t, e)), t = m(t), t = c(t), t;
|
|
12
12
|
}) ?? [];
|
|
13
|
-
};
|
|
13
|
+
}, p = (r) => r.split(/[-_]/).map((e) => e.charAt(0).toUpperCase() + e.slice(1).toLowerCase()).join(" ");
|
|
14
|
+
function d(r) {
|
|
15
|
+
try {
|
|
16
|
+
return new URL(r).pathname.split("/").filter((n) => n.length > 0).slice(0, -1).map(p);
|
|
17
|
+
} catch (a) {
|
|
18
|
+
return console.error("Invalid URL:", a), [];
|
|
19
|
+
}
|
|
20
|
+
}
|
|
14
21
|
export {
|
|
15
|
-
|
|
22
|
+
g as getBreadcrumbs
|
|
16
23
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const b=require("./breadcrumbs.cjs"),c=require("./description.cjs"),d=require("./icon.cjs"),l=require("./tabs.cjs"),u=require("./title.cjs"),p=(e,n,r)=>{const{transformSource:a,...o}=r,i=b.getBreadcrumbs(e,r),s=l.getTabs(e,r),t=a?.({...e,breadcrumbs:i,tabs:s},n,o)??{};return{id:t?.id??e.id,title:t?.title??u.getTitle(e,r),description:t?.description??c.getDescription(e,n),breadcrumbs:t?.breadcrumbs??i,icon:t?.icon??d.getIcon(e),tabs:t?.tabs??s,url:t?.url??e.url,tag:t?.tag??e.tag,type:t?.type??e.type,shouldOpenInNewTab:t?.shouldOpenInNewTab??void 0,appendToUrl:t?.appendToUrl??void 0}};exports.transformInkeepSource=p;
|
|
@@ -1,21 +1,24 @@
|
|
|
1
|
-
import { getBreadcrumbs as
|
|
2
|
-
import { getDescription as
|
|
3
|
-
import { getIcon as
|
|
4
|
-
import { getTabs as
|
|
5
|
-
import { getTitle as
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
1
|
+
import { getBreadcrumbs as d } from "./breadcrumbs.js";
|
|
2
|
+
import { getDescription as p } from "./description.js";
|
|
3
|
+
import { getIcon as b } from "./icon.js";
|
|
4
|
+
import { getTabs as s } from "./tabs.js";
|
|
5
|
+
import { getTitle as l } from "./title.js";
|
|
6
|
+
const h = (r, n, e) => {
|
|
7
|
+
const { transformSource: a, ...m } = e, i = d(r, e), o = s(r, e), t = a?.({ ...r, breadcrumbs: i, tabs: o }, n, m) ?? {};
|
|
8
|
+
return {
|
|
9
|
+
id: t?.id ?? r.id,
|
|
10
|
+
title: t?.title ?? l(r, e),
|
|
11
|
+
description: t?.description ?? p(r, n),
|
|
12
|
+
breadcrumbs: t?.breadcrumbs ?? i,
|
|
13
|
+
icon: t?.icon ?? b(r),
|
|
14
|
+
tabs: t?.tabs ?? o,
|
|
15
|
+
url: t?.url ?? r.url,
|
|
16
|
+
tag: t?.tag ?? r.tag,
|
|
17
|
+
type: t?.type ?? r.type,
|
|
18
|
+
shouldOpenInNewTab: t?.shouldOpenInNewTab ?? void 0,
|
|
19
|
+
appendToUrl: t?.appendToUrl ?? void 0
|
|
20
|
+
};
|
|
21
|
+
};
|
|
19
22
|
export {
|
|
20
|
-
|
|
23
|
+
h as transformInkeepSource
|
|
21
24
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@inkeep/cxkit-primitives",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.11",
|
|
4
4
|
"description": "",
|
|
5
5
|
"license": "Inkeep, Inc. Customer License (IICL) v1.1",
|
|
6
6
|
"homepage": "",
|
|
@@ -54,9 +54,9 @@
|
|
|
54
54
|
"react-textarea-autosize": "8.5.7",
|
|
55
55
|
"rehype-raw": "7.0.0",
|
|
56
56
|
"unist-util-visit": "^5.0.0",
|
|
57
|
-
"@inkeep/cxkit-color-mode": "0.5.
|
|
58
|
-
"@inkeep/cxkit-theme": "0.5.
|
|
59
|
-
"@inkeep/cxkit-types": "0.5.
|
|
57
|
+
"@inkeep/cxkit-color-mode": "0.5.11",
|
|
58
|
+
"@inkeep/cxkit-theme": "0.5.11",
|
|
59
|
+
"@inkeep/cxkit-types": "0.5.11"
|
|
60
60
|
},
|
|
61
61
|
"devDependencies": {
|
|
62
62
|
"@biomejs/biome": "1.9.4",
|