@promptbook/wizard 0.100.0-40 → 0.100.0-41

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 CHANGED
@@ -38,7 +38,7 @@ const BOOK_LANGUAGE_VERSION = '1.0.0';
38
38
  * @generated
39
39
  * @see https://github.com/webgptorg/promptbook
40
40
  */
41
- const PROMPTBOOK_ENGINE_VERSION = '0.100.0-40';
41
+ const PROMPTBOOK_ENGINE_VERSION = '0.100.0-41';
42
42
  /**
43
43
  * TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
44
44
  * Note: [💞] Ignore a discrepancy between file name and entity name
@@ -1,4 +1,14 @@
1
1
  import { BOOK_LANGUAGE_VERSION, PROMPTBOOK_ENGINE_VERSION } from '../version';
2
+ import type { AvatarChipProps } from '../book-components/AvatarProfile/AvatarChip/AvatarChip';
3
+ import { AvatarChip } from '../book-components/AvatarProfile/AvatarChip/AvatarChip';
4
+ import type { AvatarChipFromSource } from '../book-components/AvatarProfile/AvatarChip/AvatarChipFromSource';
5
+ import type { BookEditorProps } from '../book-components/BookEditor/BookEditor';
2
6
  import { BookEditor } from '../book-components/BookEditor/BookEditor';
7
+ import { DEFAULT_BOOK_FONT_CLASS } from '../book-components/BookEditor/config';
3
8
  export { BOOK_LANGUAGE_VERSION, PROMPTBOOK_ENGINE_VERSION };
9
+ export type { AvatarChipProps };
10
+ export { AvatarChip };
11
+ export type { AvatarChipFromSource };
12
+ export type { BookEditorProps };
4
13
  export { BookEditor };
14
+ export { DEFAULT_BOOK_FONT_CLASS };
@@ -11,6 +11,8 @@ import type { KnowledgeChunk } from '../book-2.0/commitments/KNOWLEDGE/types';
11
11
  import type { KnowledgeBase } from '../book-2.0/commitments/KNOWLEDGE/types';
12
12
  import type { RetrievalResult } from '../book-2.0/commitments/KNOWLEDGE/types';
13
13
  import type { RAGConfig } from '../book-2.0/commitments/KNOWLEDGE/types';
14
+ import type { AvatarChipProps } from '../book-components/AvatarProfile/AvatarChip/AvatarChip';
15
+ import type { AvatarChipFromSource } from '../book-components/AvatarProfile/AvatarChip/AvatarChipFromSource';
14
16
  import type { BookEditorProps } from '../book-components/BookEditor/BookEditor';
15
17
  import type { PipelineCollection } from '../collection/PipelineCollection';
16
18
  import type { Command } from '../commands/_common/types/Command';
@@ -330,6 +332,8 @@ export type { KnowledgeChunk };
330
332
  export type { KnowledgeBase };
331
333
  export type { RetrievalResult };
332
334
  export type { RAGConfig };
335
+ export type { AvatarChipProps };
336
+ export type { AvatarChipFromSource };
333
337
  export type { BookEditorProps };
334
338
  export type { PipelineCollection };
335
339
  export type { Command };
@@ -0,0 +1,35 @@
1
+ import type { AgentBasicInformation } from '../../../book-2.0/agent-source/parseAgentSource';
2
+ import type { string_css_class } from '../../../types/typeAliases';
3
+ /**
4
+ * Props of `AvatarChip`
5
+ *
6
+ * @public exported from `@promptbook/components`
7
+ */
8
+ export type AvatarChipProps = {
9
+ /**
10
+ * Avatar to be shown
11
+ */
12
+ readonly avatarBasicInformation: AgentBasicInformation;
13
+ /**
14
+ * Whether this chip is a template avatar
15
+ */
16
+ readonly isTemplate: boolean;
17
+ /**
18
+ * Optional CSS class name which will be added to root <div> element
19
+ */
20
+ readonly className?: string_css_class;
21
+ /**
22
+ * Called when chip is clicked
23
+ */
24
+ readonly onSelect?: (avatar: AgentBasicInformation) => void;
25
+ /**
26
+ * Whether this chip is selected
27
+ */
28
+ readonly isSelected?: boolean;
29
+ };
30
+ /**
31
+ * Shows a chip with avatar's avatar and name
32
+ *
33
+ * @public exported from `@promptbook/components`
34
+ */
35
+ export declare function AvatarChip(props: AvatarChipProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,21 @@
1
+ import type { string_book } from '../../../book-2.0/agent-source/string_book';
2
+ import type { AvatarChipProps } from './AvatarChip';
3
+ /**
4
+ * Props of `AvatarChipFromSource`
5
+ *
6
+ * @public exported from `@promptbook/components`
7
+ */
8
+ export type AvatarChipFromSource = Omit<AvatarChipProps, 'avatarBasicInformation'> & {
9
+ /**
10
+ * Avatar to be shown
11
+ */
12
+ readonly source: string_book;
13
+ };
14
+ /**
15
+ * Shows a chip with avatar's avatar and name based on the avatar source string
16
+ *
17
+ * This component is wrapped around the `<AvatarChip/>`, it just parses the avatar source string into `AvatarBasicInformation` and passes it to the `<AvatarChip/>` component.
18
+ *
19
+ * @public exported from `@promptbook/components`
20
+ */
21
+ export declare function AvatarChipFromSource(props: AvatarChipFromSource): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,2 @@
1
+ export * from './AvatarChip';
2
+ export * from './AvatarChipFromSource';
@@ -1,5 +1,10 @@
1
1
  import type { string_book } from '../../book-2.0/agent-source/string_book';
2
- export interface BookEditorProps {
2
+ /**
3
+ * Props of `BookEditor`
4
+ *
5
+ * @public exported from `@promptbook/components`
6
+ */
7
+ export type BookEditorProps = {
3
8
  /**
4
9
  * Additional CSS classes to apply to the editor container.
5
10
  */
@@ -21,7 +26,7 @@ export interface BookEditorProps {
21
26
  * If true, logs verbose debug info to the console and shows additional visual cues
22
27
  */
23
28
  readonly isVerbose?: boolean;
24
- }
29
+ };
25
30
  /**
26
31
  * Renders a book editor
27
32
  *
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Default font class name for the BookEditor component
3
+ * In Next.js environments, you can override this by importing the font directly
4
+ *
5
+ * @public exported from `@promptbook/components`
6
+ */
7
+ export declare const DEFAULT_BOOK_FONT_CLASS: any;
8
+ /**
9
+ * Note: [💞] Ignore a discrepancy between file name and entity name
10
+ */
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Inject the CSS module rules (derived from imported `styles`) into the provided shadow root.
3
+ * This allows CSS modules (which are normally emitted into the document head) to be
4
+ * available inside the component's shadow DOM.
5
+ *
6
+ * @private within the promptbook components <- TODO: Maybe make promptbook util from this
7
+ */
8
+ export declare function injectCssModuleIntoShadowRoot(shadowRoot: ShadowRoot): void;
9
+ /**
10
+ * TODO: Make some utility functions for working with CSS modules in shadow DOM independent of `BookEditor.module.css`
11
+ */
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Collect matching CSS texts from document stylesheets for a given class.
3
+ * This will skip cross-origin stylesheets (they throw when accessed).
4
+ *
5
+ * @private within the promptbook components <- TODO: Maybe make promptbook util from this
6
+ */
7
+ export declare function collectCssTextsForClass(className: string): string[];
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Escape HTML to safely render user text inside a <pre> with dangerouslySetInnerHTML.
3
+ *
4
+ * @private within the promptbook components <- TODO: Maybe make promptbook util from this
5
+ */
6
+ export declare function escapeHtml(input: string): string;
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Escape text for safe use inside a RegExp pattern.
3
+ *
4
+ * @private within the promptbook components <- TODO: Maybe make promptbook util from this
5
+ */
6
+ export declare function escapeRegex(input: string): string;
@@ -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.100.0-39`).
18
+ * It follows semantic versioning (e.g., `0.100.0-40`).
19
19
  *
20
20
  * @generated
21
21
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@promptbook/wizard",
3
- "version": "0.100.0-40",
3
+ "version": "0.100.0-41",
4
4
  "description": "Promptbook: Run AI apps in plain human language across multiple models and platforms",
5
5
  "private": false,
6
6
  "sideEffects": false,
@@ -95,7 +95,7 @@
95
95
  "module": "./esm/index.es.js",
96
96
  "typings": "./esm/typings/src/_packages/wizard.index.d.ts",
97
97
  "peerDependencies": {
98
- "@promptbook/core": "0.100.0-40"
98
+ "@promptbook/core": "0.100.0-41"
99
99
  },
100
100
  "dependencies": {
101
101
  "@ai-sdk/deepseek": "0.1.6",
package/umd/index.umd.js CHANGED
@@ -49,7 +49,7 @@
49
49
  * @generated
50
50
  * @see https://github.com/webgptorg/promptbook
51
51
  */
52
- const PROMPTBOOK_ENGINE_VERSION = '0.100.0-40';
52
+ const PROMPTBOOK_ENGINE_VERSION = '0.100.0-41';
53
53
  /**
54
54
  * TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
55
55
  * Note: [💞] Ignore a discrepancy between file name and entity name