@promptbook/components 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.
@@ -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
@@ -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-23`).
18
+ * It follows semantic versioning (e.g., `0.112.0-25`).
19
19
  *
20
20
  * @generated
21
21
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@promptbook/components",
3
- "version": "0.112.0-24",
3
+ "version": "0.112.0-26",
4
4
  "description": "Promptbook: Turn your company's scattered knowledge into AI ready books",
5
5
  "private": false,
6
6
  "sideEffects": false,
package/umd/index.umd.js CHANGED
@@ -30,7 +30,7 @@
30
30
  * @generated
31
31
  * @see https://github.com/webgptorg/promptbook
32
32
  */
33
- const PROMPTBOOK_ENGINE_VERSION = '0.112.0-24';
33
+ const PROMPTBOOK_ENGINE_VERSION = '0.112.0-26';
34
34
  /**
35
35
  * TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
36
36
  * Note: [💞] Ignore a discrepancy between file name and entity name
@@ -7283,10 +7283,10 @@
7283
7283
  if (!trimmedContent) {
7284
7284
  return requirements;
7285
7285
  }
7286
- // Create goal section for system message
7286
+ // Add goal to the system message
7287
7287
  const goalSection = `Goal: ${trimmedContent}`;
7288
- // Goals are important directives, so we add them prominently to the system message
7289
- return this.appendToSystemMessage(requirements, goalSection, '\n\n');
7288
+ const requirementsWithGoal = this.appendToSystemMessage(requirements, goalSection, '\n\n');
7289
+ return this.appendToPromptSuffix(requirementsWithGoal, goalSection);
7290
7290
  }
7291
7291
  }
7292
7292
  /**
@@ -10233,15 +10233,7 @@
10233
10233
  // Add rule to the system message
10234
10234
  const ruleSection = `Rule: ${trimmedContent}`;
10235
10235
  const requirementsWithRule = this.appendToSystemMessage(requirements, ruleSection, '\n\n');
10236
- const ruleLines = trimmedContent
10237
- .split(/\r?\n/)
10238
- .map((line) => line.trim())
10239
- .filter(Boolean)
10240
- .map((line) => `- ${line}`);
10241
- if (ruleLines.length === 0) {
10242
- return requirementsWithRule;
10243
- }
10244
- return this.appendToPromptSuffix(requirementsWithRule, ruleLines.join('\n'));
10236
+ return this.appendToPromptSuffix(requirementsWithRule, ruleSection);
10245
10237
  }
10246
10238
  }
10247
10239
  /**
@@ -21051,7 +21043,9 @@
21051
21043
  function ArrowIcon({ direction, size = 24, className }) {
21052
21044
  const normalizedDirection = normalizeArrowDirection(direction);
21053
21045
  const rotationDegrees = ARROW_ROTATION_BY_DIRECTION[normalizedDirection];
21054
- return (jsxRuntime.jsx("svg", { width: size, height: size, viewBox: "0 0 24 24", fill: "currentColor", "aria-hidden": "true", className: classNames('shrink-0', className), children: jsxRuntime.jsx("g", { transform: `rotate(${rotationDegrees} 12 12)`, children: jsxRuntime.jsx("path", { d: "M7 5.5L18.5 12L7 18.5V5.5Z" }) }) }));
21046
+ return (jsxRuntime.jsx("svg", { width: size, height: size, viewBox: "0 0 24 24",
21047
+ // fill="currentColor"
21048
+ fill: "currentColor", "aria-hidden": "true", className: classNames('shrink-0', className), children: jsxRuntime.jsx("g", { transform: `rotate(${rotationDegrees} 12 12)`, children: jsxRuntime.jsx("path", { d: "M7 5.5L18.5 12L7 18.5V5.5Z" }) }) }));
21055
21049
  }
21056
21050
 
21057
21051
  /**