@promptbook/core 0.112.0-24 → 0.112.0-26
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 +5 -13
- package/esm/index.es.js.map +1 -1
- package/esm/src/book-components/_common/MenuHoisting/MenuHoistingContext.d.ts +47 -0
- package/esm/src/version.d.ts +1 -1
- package/package.json +1 -1
- package/umd/index.umd.js +5 -13
- package/umd/index.umd.js.map +1 -1
- package/umd/src/book-components/_common/MenuHoisting/MenuHoistingContext.d.ts +47 -0
- package/umd/src/version.d.ts +1 -1
|
@@ -26,6 +26,45 @@ export type HoistedMenuItem = {
|
|
|
26
26
|
*/
|
|
27
27
|
isActive?: boolean;
|
|
28
28
|
};
|
|
29
|
+
/**
|
|
30
|
+
* Shared actions provided to hoisted mobile menu-section renderers.
|
|
31
|
+
*
|
|
32
|
+
* @private mechanism inside Promptbook
|
|
33
|
+
*/
|
|
34
|
+
export type HoistedMobileMenuSectionRenderOptions = {
|
|
35
|
+
/**
|
|
36
|
+
* Closes the owning mobile header menu.
|
|
37
|
+
*/
|
|
38
|
+
readonly closeMenu: () => void;
|
|
39
|
+
};
|
|
40
|
+
/**
|
|
41
|
+
* Mobile-only section hoisted into the shared application menu.
|
|
42
|
+
*
|
|
43
|
+
* @private mechanism inside Promptbook
|
|
44
|
+
*/
|
|
45
|
+
export type HoistedMobileMenuSection = {
|
|
46
|
+
/**
|
|
47
|
+
* Stable identifier used to preserve section open state.
|
|
48
|
+
*/
|
|
49
|
+
readonly key: string;
|
|
50
|
+
/**
|
|
51
|
+
* Visible section label rendered by the mobile menu.
|
|
52
|
+
*/
|
|
53
|
+
readonly label: ReactNode;
|
|
54
|
+
/**
|
|
55
|
+
* Whether the section should start expanded whenever the menu opens.
|
|
56
|
+
*/
|
|
57
|
+
readonly isDefaultOpen?: boolean;
|
|
58
|
+
/**
|
|
59
|
+
* Lazily renders section content inside the mobile header menu.
|
|
60
|
+
*/
|
|
61
|
+
readonly renderContent: (options: HoistedMobileMenuSectionRenderOptions) => ReactNode;
|
|
62
|
+
};
|
|
63
|
+
/**
|
|
64
|
+
* Value exposed through the shared menu-hoisting context.
|
|
65
|
+
*
|
|
66
|
+
* @private mechanism inside Promptbook
|
|
67
|
+
*/
|
|
29
68
|
type MenuHoistingContextType = {
|
|
30
69
|
/**
|
|
31
70
|
* The currently hoisted menu items
|
|
@@ -35,6 +74,14 @@ type MenuHoistingContextType = {
|
|
|
35
74
|
* Set the hoisted menu items
|
|
36
75
|
*/
|
|
37
76
|
setMenu: (items: HoistedMenuItem[]) => void;
|
|
77
|
+
/**
|
|
78
|
+
* Mobile-only sections hoisted into the shared application menu.
|
|
79
|
+
*/
|
|
80
|
+
mobileMenuSections: HoistedMobileMenuSection[];
|
|
81
|
+
/**
|
|
82
|
+
* Sets the mobile-only hoisted menu sections.
|
|
83
|
+
*/
|
|
84
|
+
setMobileMenuSections: (sections: HoistedMobileMenuSection[]) => void;
|
|
38
85
|
};
|
|
39
86
|
/**
|
|
40
87
|
* Provider for menu hoisting
|
package/esm/src/version.d.ts
CHANGED
|
@@ -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.112.0-
|
|
18
|
+
* It follows semantic versioning (e.g., `0.112.0-25`).
|
|
19
19
|
*
|
|
20
20
|
* @generated
|
|
21
21
|
*/
|
package/package.json
CHANGED
package/umd/index.umd.js
CHANGED
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
* @generated
|
|
28
28
|
* @see https://github.com/webgptorg/promptbook
|
|
29
29
|
*/
|
|
30
|
-
const PROMPTBOOK_ENGINE_VERSION = '0.112.0-
|
|
30
|
+
const PROMPTBOOK_ENGINE_VERSION = '0.112.0-26';
|
|
31
31
|
/**
|
|
32
32
|
* TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
|
|
33
33
|
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
@@ -11301,10 +11301,10 @@
|
|
|
11301
11301
|
if (!trimmedContent) {
|
|
11302
11302
|
return requirements;
|
|
11303
11303
|
}
|
|
11304
|
-
//
|
|
11304
|
+
// Add goal to the system message
|
|
11305
11305
|
const goalSection = `Goal: ${trimmedContent}`;
|
|
11306
|
-
|
|
11307
|
-
return this.
|
|
11306
|
+
const requirementsWithGoal = this.appendToSystemMessage(requirements, goalSection, '\n\n');
|
|
11307
|
+
return this.appendToPromptSuffix(requirementsWithGoal, goalSection);
|
|
11308
11308
|
}
|
|
11309
11309
|
}
|
|
11310
11310
|
/**
|
|
@@ -14336,15 +14336,7 @@
|
|
|
14336
14336
|
// Add rule to the system message
|
|
14337
14337
|
const ruleSection = `Rule: ${trimmedContent}`;
|
|
14338
14338
|
const requirementsWithRule = this.appendToSystemMessage(requirements, ruleSection, '\n\n');
|
|
14339
|
-
|
|
14340
|
-
.split(/\r?\n/)
|
|
14341
|
-
.map((line) => line.trim())
|
|
14342
|
-
.filter(Boolean)
|
|
14343
|
-
.map((line) => `- ${line}`);
|
|
14344
|
-
if (ruleLines.length === 0) {
|
|
14345
|
-
return requirementsWithRule;
|
|
14346
|
-
}
|
|
14347
|
-
return this.appendToPromptSuffix(requirementsWithRule, ruleLines.join('\n'));
|
|
14339
|
+
return this.appendToPromptSuffix(requirementsWithRule, ruleSection);
|
|
14348
14340
|
}
|
|
14349
14341
|
}
|
|
14350
14342
|
/**
|