@promptbook/remote-client 0.103.0-18 → 0.103.0-20
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 +9 -7
- package/esm/index.es.js.map +1 -1
- package/esm/typings/src/_packages/components.index.d.ts +2 -0
- package/esm/typings/src/_packages/core.index.d.ts +4 -0
- package/esm/typings/src/book-2.0/agent-source/padBook.d.ts +16 -0
- package/esm/typings/src/book-components/BookEditor/BookEditor.d.ts +26 -7
- package/esm/typings/src/types/typeAliases.d.ts +1 -1
- package/esm/typings/src/version.d.ts +1 -1
- package/package.json +2 -2
- package/umd/index.umd.js +9 -7
- package/umd/index.umd.js.map +1 -1
- package/esm/typings/src/book-2.0/agent-source/padBookContent.d.ts +0 -10
|
@@ -7,6 +7,7 @@ import type { AvatarProfileProps } from '../book-components/AvatarProfile/Avatar
|
|
|
7
7
|
import { AvatarProfile } from '../book-components/AvatarProfile/AvatarProfile/AvatarProfile';
|
|
8
8
|
import type { AvatarProfileFromSourceProps } from '../book-components/AvatarProfile/AvatarProfile/AvatarProfileFromSource';
|
|
9
9
|
import { AvatarProfileFromSource } from '../book-components/AvatarProfile/AvatarProfile/AvatarProfileFromSource';
|
|
10
|
+
import { DEFAULT_BOOK_EDITOR_HEIGHT } from '../book-components/BookEditor/BookEditor';
|
|
10
11
|
import type { BookEditorProps } from '../book-components/BookEditor/BookEditor';
|
|
11
12
|
import { BookEditor } from '../book-components/BookEditor/BookEditor';
|
|
12
13
|
import { DEFAULT_BOOK_FONT_CLASS } from '../book-components/BookEditor/config';
|
|
@@ -61,6 +62,7 @@ export type { AvatarProfileProps };
|
|
|
61
62
|
export { AvatarProfile };
|
|
62
63
|
export type { AvatarProfileFromSourceProps };
|
|
63
64
|
export { AvatarProfileFromSource };
|
|
65
|
+
export { DEFAULT_BOOK_EDITOR_HEIGHT };
|
|
64
66
|
export type { BookEditorProps };
|
|
65
67
|
export { BookEditor };
|
|
66
68
|
export { DEFAULT_BOOK_FONT_CLASS };
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { BOOK_LANGUAGE_VERSION, PROMPTBOOK_ENGINE_VERSION } from '../version';
|
|
2
2
|
import { createAgentModelRequirements } from '../book-2.0/agent-source/createAgentModelRequirements';
|
|
3
3
|
import { createAgentModelRequirementsWithCommitments } from '../book-2.0/agent-source/createAgentModelRequirementsWithCommitments';
|
|
4
|
+
import { PADDING_LINES } from '../book-2.0/agent-source/padBook';
|
|
5
|
+
import { padBook } from '../book-2.0/agent-source/padBook';
|
|
4
6
|
import { parseAgentSource } from '../book-2.0/agent-source/parseAgentSource';
|
|
5
7
|
import { parseParameters } from '../book-2.0/agent-source/parseParameters';
|
|
6
8
|
import { isValidBook } from '../book-2.0/agent-source/string_book';
|
|
@@ -177,6 +179,8 @@ import { REMOTE_SERVER_URLS } from '../../servers';
|
|
|
177
179
|
export { BOOK_LANGUAGE_VERSION, PROMPTBOOK_ENGINE_VERSION };
|
|
178
180
|
export { createAgentModelRequirements };
|
|
179
181
|
export { createAgentModelRequirementsWithCommitments };
|
|
182
|
+
export { PADDING_LINES };
|
|
183
|
+
export { padBook };
|
|
180
184
|
export { parseAgentSource };
|
|
181
185
|
export { parseParameters };
|
|
182
186
|
export { isValidBook };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { string_book } from './string_book';
|
|
2
|
+
/**
|
|
3
|
+
* Number of padding lines to add at the end of the book content
|
|
4
|
+
*
|
|
5
|
+
* @public exported from `@promptbook/core`
|
|
6
|
+
*/
|
|
7
|
+
export declare const PADDING_LINES = 11;
|
|
8
|
+
/**
|
|
9
|
+
* A function that adds padding to the book content
|
|
10
|
+
*
|
|
11
|
+
* @public exported from `@promptbook/core`
|
|
12
|
+
*/
|
|
13
|
+
export declare function padBook(content: string_book): string_book;
|
|
14
|
+
/**
|
|
15
|
+
* TODO: [🧠] Maybe export
|
|
16
|
+
*/
|
|
@@ -1,7 +1,15 @@
|
|
|
1
1
|
import type { CSSProperties } from 'react';
|
|
2
2
|
import type { Promisable } from 'type-fest';
|
|
3
|
-
import type
|
|
4
|
-
import type { string_knowledge_source_content } from '../../types/typeAliases';
|
|
3
|
+
import { type string_book } from '../../book-2.0/agent-source/string_book';
|
|
4
|
+
import type { number_percent, number_positive, string_css_value, string_knowledge_source_content } from '../../types/typeAliases';
|
|
5
|
+
/**
|
|
6
|
+
* Default height of the book editor
|
|
7
|
+
*
|
|
8
|
+
* Note: This height is computed based on the number of lines in the default book + padding multiplied by an estimated line height.
|
|
9
|
+
*
|
|
10
|
+
* @public exported from `@promptbook/components`
|
|
11
|
+
*/
|
|
12
|
+
export declare const DEFAULT_BOOK_EDITOR_HEIGHT: number;
|
|
5
13
|
/**
|
|
6
14
|
* Props of `BookEditor`
|
|
7
15
|
*
|
|
@@ -20,6 +28,22 @@ export type BookEditorProps = {
|
|
|
20
28
|
* Optional CSS style which will be added to root <div/> element
|
|
21
29
|
*/
|
|
22
30
|
readonly style?: CSSProperties;
|
|
31
|
+
/**
|
|
32
|
+
* Height of the `BookEditor` component
|
|
33
|
+
*
|
|
34
|
+
* - You can use any valid CSS value, e.g., `500px`, `100%`, `50vh`, etc.
|
|
35
|
+
* - If not set, the default height is `DEFAULT_BOOK_EDITOR_HEIGHT`.
|
|
36
|
+
* - If set to `null`, the height should be controlled entirely via `className` or `style`, otherwise the editor will have zero height.
|
|
37
|
+
*
|
|
38
|
+
* @default `DEFAULT_BOOK_EDITOR_HEIGHT`
|
|
39
|
+
*/
|
|
40
|
+
readonly height?: string_css_value | null;
|
|
41
|
+
/**
|
|
42
|
+
* Zoom level of the editor
|
|
43
|
+
*
|
|
44
|
+
* @default 1 (100%)
|
|
45
|
+
*/
|
|
46
|
+
readonly zoom?: number_percent & number_positive;
|
|
23
47
|
/**
|
|
24
48
|
* The book which is being edited.
|
|
25
49
|
*/
|
|
@@ -40,11 +64,6 @@ export type BookEditorProps = {
|
|
|
40
64
|
* If true, disables border radius making the editor have sharp corners
|
|
41
65
|
*/
|
|
42
66
|
readonly isBorderRadiusDisabled?: boolean;
|
|
43
|
-
/**
|
|
44
|
-
* If true, shows the footer with book title and version information.
|
|
45
|
-
* By default, the footer is hidden.
|
|
46
|
-
*/
|
|
47
|
-
readonly isFooterShown?: boolean;
|
|
48
67
|
/**
|
|
49
68
|
* If true, the editor is in read-only mode
|
|
50
69
|
*
|
|
@@ -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.103.0-
|
|
18
|
+
* It follows semantic versioning (e.g., `0.103.0-19`).
|
|
19
19
|
*
|
|
20
20
|
* @generated
|
|
21
21
|
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@promptbook/remote-client",
|
|
3
|
-
"version": "0.103.0-
|
|
3
|
+
"version": "0.103.0-20",
|
|
4
4
|
"description": "Promptbook: Turn your company's scattered knowledge into AI ready books",
|
|
5
5
|
"private": false,
|
|
6
6
|
"sideEffects": false,
|
|
@@ -100,7 +100,7 @@
|
|
|
100
100
|
"module": "./esm/index.es.js",
|
|
101
101
|
"typings": "./esm/typings/src/_packages/remote-client.index.d.ts",
|
|
102
102
|
"peerDependencies": {
|
|
103
|
-
"@promptbook/core": "0.103.0-
|
|
103
|
+
"@promptbook/core": "0.103.0-20"
|
|
104
104
|
},
|
|
105
105
|
"dependencies": {
|
|
106
106
|
"crypto": "1.0.1",
|
package/umd/index.umd.js
CHANGED
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
* @generated
|
|
24
24
|
* @see https://github.com/webgptorg/promptbook
|
|
25
25
|
*/
|
|
26
|
-
const PROMPTBOOK_ENGINE_VERSION = '0.103.0-
|
|
26
|
+
const PROMPTBOOK_ENGINE_VERSION = '0.103.0-20';
|
|
27
27
|
/**
|
|
28
28
|
* TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
|
|
29
29
|
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
@@ -1231,7 +1231,7 @@
|
|
|
1231
1231
|
*/
|
|
1232
1232
|
({
|
|
1233
1233
|
TITLE: Color.fromHex('#244EA8'),
|
|
1234
|
-
LINE: Color.fromHex('#
|
|
1234
|
+
LINE: Color.fromHex('#eeeeee'),
|
|
1235
1235
|
COMMITMENT: Color.fromHex('#DA0F78'),
|
|
1236
1236
|
PARAMETER: Color.fromHex('#8e44ad'),
|
|
1237
1237
|
});
|
|
@@ -5580,15 +5580,17 @@
|
|
|
5580
5580
|
// <- TODO: [🏥] DRY
|
|
5581
5581
|
|
|
5582
5582
|
/**
|
|
5583
|
-
*
|
|
5583
|
+
* Number of padding lines to add at the end of the book content
|
|
5584
|
+
*
|
|
5585
|
+
* @public exported from `@promptbook/core`
|
|
5584
5586
|
*/
|
|
5585
|
-
const PADDING_LINES =
|
|
5587
|
+
const PADDING_LINES = 11;
|
|
5586
5588
|
/**
|
|
5587
5589
|
* A function that adds padding to the book content
|
|
5588
5590
|
*
|
|
5589
|
-
* @
|
|
5591
|
+
* @public exported from `@promptbook/core`
|
|
5590
5592
|
*/
|
|
5591
|
-
function
|
|
5593
|
+
function padBook(content) {
|
|
5592
5594
|
if (!content) {
|
|
5593
5595
|
return '\n'.repeat(PADDING_LINES);
|
|
5594
5596
|
}
|
|
@@ -5697,7 +5699,7 @@
|
|
|
5697
5699
|
${returnStatement}
|
|
5698
5700
|
`));
|
|
5699
5701
|
// <- TODO: Maybe use book` notation
|
|
5700
|
-
return
|
|
5702
|
+
return padBook(pipelineString);
|
|
5701
5703
|
}
|
|
5702
5704
|
/**
|
|
5703
5705
|
* TODO: Unit test
|