@promptbook/javascript 0.111.0-1 → 0.111.0-3
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/esm/index.es.js +1 -1
- package/esm/typings/src/book-components/Chat/Chat/ChatMessageMap.d.ts +17 -0
- package/esm/typings/src/book-components/Chat/utils/citationHelpers.d.ts +38 -0
- package/esm/typings/src/book-components/Chat/utils/citationHelpers.test.d.ts +1 -0
- package/esm/typings/src/book-components/Chat/utils/splitMessageContentIntoSegments.d.ts +41 -0
- package/esm/typings/src/book-components/Chat/utils/splitMessageContentIntoSegments.test.d.ts +1 -0
- package/esm/typings/src/version.d.ts +1 -1
- package/package.json +2 -2
- package/umd/index.umd.js +1 -1
package/esm/index.es.js
CHANGED
|
@@ -18,7 +18,7 @@ const BOOK_LANGUAGE_VERSION = '2.0.0';
|
|
|
18
18
|
* @generated
|
|
19
19
|
* @see https://github.com/webgptorg/promptbook
|
|
20
20
|
*/
|
|
21
|
-
const PROMPTBOOK_ENGINE_VERSION = '0.111.0-
|
|
21
|
+
const PROMPTBOOK_ENGINE_VERSION = '0.111.0-3';
|
|
22
22
|
/**
|
|
23
23
|
* TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
|
|
24
24
|
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import 'leaflet/dist/leaflet.css';
|
|
2
|
+
import type { GeoJsonObject } from 'geojson';
|
|
3
|
+
/**
|
|
4
|
+
* Props for `<ChatMessageMap/>`.
|
|
5
|
+
*
|
|
6
|
+
* @private internal helper of `<ChatMessageItem/>`
|
|
7
|
+
*/
|
|
8
|
+
type ChatMessageMapProps = {
|
|
9
|
+
data: GeoJsonObject;
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* Renders a Leaflet map for GeoJSON data inside the chat bubble.
|
|
13
|
+
*
|
|
14
|
+
* @private internal helper of `<ChatMessageItem/>`
|
|
15
|
+
*/
|
|
16
|
+
export declare function ChatMessageMap({ data }: ChatMessageMapProps): import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
export {};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { ChatParticipant } from '../types/ChatParticipant';
|
|
2
|
+
import type { ParsedCitation } from './parseCitationsFromContent';
|
|
3
|
+
/**
|
|
4
|
+
* Returns whether the provided value is a valid HTTP(S) URL.
|
|
5
|
+
*
|
|
6
|
+
* @param value - Candidate string to inspect.
|
|
7
|
+
* @returns True when the value parses as an HTTP or HTTPS URL.
|
|
8
|
+
* @private utility of `<Chat/>` citation rendering
|
|
9
|
+
*/
|
|
10
|
+
export declare function isCitationUrl(value: string): boolean;
|
|
11
|
+
/**
|
|
12
|
+
* Determines whether a citation should be displayed as a text snippet instead of a file/URL.
|
|
13
|
+
*
|
|
14
|
+
* @param citation - Parsed citation metadata.
|
|
15
|
+
* @returns True when the citation looks like inline text instead of a document or URL.
|
|
16
|
+
* @private utility of `<Chat/>` citation rendering
|
|
17
|
+
*/
|
|
18
|
+
export declare function isPlainTextCitation(citation: ParsedCitation): boolean;
|
|
19
|
+
/**
|
|
20
|
+
* Builds a label that matches the desired chip/modal title for a citation.
|
|
21
|
+
*
|
|
22
|
+
* @param citation - Parsed citation metadata.
|
|
23
|
+
* @returns The friendly label shown on chips and modal headers.
|
|
24
|
+
* @private utility of `<Chat/>` citation rendering
|
|
25
|
+
*/
|
|
26
|
+
export declare function getCitationLabel(citation: ParsedCitation): string;
|
|
27
|
+
/**
|
|
28
|
+
* Resolves the preview URL used inside the citation modal iframe.
|
|
29
|
+
*
|
|
30
|
+
* @param citation - Parsed citation metadata.
|
|
31
|
+
* @param participants - Known chat participants for agent knowledge lookup.
|
|
32
|
+
* @returns URL string suitable for iframe preview or null when unavailable.
|
|
33
|
+
* @private utility of `<Chat/>` citation rendering
|
|
34
|
+
*/
|
|
35
|
+
export declare function resolveCitationPreviewUrl(citation: ParsedCitation, participants: ReadonlyArray<ChatParticipant>): string | null;
|
|
36
|
+
/**
|
|
37
|
+
* TODO: [💞] Spread into multiple files
|
|
38
|
+
*/
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import type { GeoJsonObject } from 'geojson';
|
|
2
|
+
import type { ImagePromptSegment } from './parseImagePrompts';
|
|
3
|
+
/**
|
|
4
|
+
* Segment that represents plain markdown text inside a chat message.
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Segment that represents plain markdown text inside a chat message.
|
|
8
|
+
*
|
|
9
|
+
* @private internal helper of `<ChatMessageItem/>`
|
|
10
|
+
*/
|
|
11
|
+
export type ChatTextSegment = {
|
|
12
|
+
type: 'text';
|
|
13
|
+
content: string;
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* Segment that represents a Leaflet-ready map rendered from GeoJSON data.
|
|
17
|
+
*/
|
|
18
|
+
/**
|
|
19
|
+
* Segment that represents a Leaflet-ready map rendered from GeoJSON data.
|
|
20
|
+
*
|
|
21
|
+
* @private internal helper of `<ChatMessageItem/>`
|
|
22
|
+
*/
|
|
23
|
+
export type ChatMapSegment = {
|
|
24
|
+
type: 'map';
|
|
25
|
+
data: GeoJsonObject;
|
|
26
|
+
};
|
|
27
|
+
/**
|
|
28
|
+
* Composite segment type that covers text, image prompts, and map features.
|
|
29
|
+
*/
|
|
30
|
+
/**
|
|
31
|
+
* Composite segment type that covers text, image prompts, and map features.
|
|
32
|
+
*
|
|
33
|
+
* @private internal helper of `<ChatMessageItem/>`
|
|
34
|
+
*/
|
|
35
|
+
export type ChatMessageContentSegment = ImagePromptSegment | ChatTextSegment | ChatMapSegment;
|
|
36
|
+
/**
|
|
37
|
+
* Splits chat message content into markdown, image prompt, and map segments while preserving their order.
|
|
38
|
+
*
|
|
39
|
+
* @private internal helper of `<ChatMessageItem/>`
|
|
40
|
+
*/
|
|
41
|
+
export declare function splitMessageContentIntoSegments(content: string): ReadonlyArray<ChatMessageContentSegment>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -15,7 +15,7 @@ export declare const BOOK_LANGUAGE_VERSION: string_semantic_version;
|
|
|
15
15
|
export declare const PROMPTBOOK_ENGINE_VERSION: string_promptbook_version;
|
|
16
16
|
/**
|
|
17
17
|
* Represents the version string of the Promptbook engine.
|
|
18
|
-
* It follows semantic versioning (e.g., `0.111.0-
|
|
18
|
+
* It follows semantic versioning (e.g., `0.111.0-2`).
|
|
19
19
|
*
|
|
20
20
|
* @generated
|
|
21
21
|
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@promptbook/javascript",
|
|
3
|
-
"version": "0.111.0-
|
|
3
|
+
"version": "0.111.0-3",
|
|
4
4
|
"description": "Promptbook: Turn your company's scattered knowledge into AI ready books",
|
|
5
5
|
"private": false,
|
|
6
6
|
"sideEffects": false,
|
|
@@ -97,7 +97,7 @@
|
|
|
97
97
|
"module": "./esm/index.es.js",
|
|
98
98
|
"typings": "./esm/typings/src/_packages/javascript.index.d.ts",
|
|
99
99
|
"peerDependencies": {
|
|
100
|
-
"@promptbook/core": "0.111.0-
|
|
100
|
+
"@promptbook/core": "0.111.0-3"
|
|
101
101
|
},
|
|
102
102
|
"dependencies": {
|
|
103
103
|
"crypto": "1.0.1",
|
package/umd/index.umd.js
CHANGED
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
* @generated
|
|
23
23
|
* @see https://github.com/webgptorg/promptbook
|
|
24
24
|
*/
|
|
25
|
-
const PROMPTBOOK_ENGINE_VERSION = '0.111.0-
|
|
25
|
+
const PROMPTBOOK_ENGINE_VERSION = '0.111.0-3';
|
|
26
26
|
/**
|
|
27
27
|
* TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
|
|
28
28
|
* Note: [💞] Ignore a discrepancy between file name and entity name
|