@promptbook/components 0.112.0-18 → 0.112.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 CHANGED
@@ -23,7 +23,6 @@ import colors from 'colors';
23
23
  import { Agent as Agent$1, setDefaultOpenAIClient, setDefaultOpenAIKey, fileSearchTool, tool, run } from '@openai/agents';
24
24
  import Bottleneck from 'bottleneck';
25
25
  import OpenAI from 'openai';
26
- import 'leaflet/dist/leaflet.css';
27
26
  import QRCode from 'qrcode';
28
27
 
29
28
  // ⚠️ WARNING: This code has been generated so that any manual changes will be overwritten
@@ -40,7 +39,7 @@ const BOOK_LANGUAGE_VERSION = '2.0.0';
40
39
  * @generated
41
40
  * @see https://github.com/webgptorg/promptbook
42
41
  */
43
- const PROMPTBOOK_ENGINE_VERSION = '0.112.0-18';
42
+ const PROMPTBOOK_ENGINE_VERSION = '0.112.0-20';
44
43
  /**
45
44
  * TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
46
45
  * Note: [💞] Ignore a discrepancy between file name and entity name
@@ -38872,6 +38871,31 @@ var css_248z$1 = ".ChatMessageMap-module_mapContainer__OBOgP{aspect-ratio:1/1;ba
38872
38871
  var styles$1 = {"mapContainer":"ChatMessageMap-module_mapContainer__OBOgP","mapSurface":"ChatMessageMap-module_mapSurface__E713z","poiMarkerIcon":"ChatMessageMap-module_poiMarkerIcon__LPNik","poiMarkerPulse":"ChatMessageMap-module_poiMarkerPulse__5flBS","poiPulse":"ChatMessageMap-module_poiPulse__O5mLt","poiMarkerInitial":"ChatMessageMap-module_poiMarkerInitial__HfA6H","mapTooltip":"ChatMessageMap-module_mapTooltip__p4sIO","mapControls":"ChatMessageMap-module_mapControls__2VZT6","mapControlButton":"ChatMessageMap-module_mapControlButton__q5pgF","mapModalBackdrop":"ChatMessageMap-module_mapModalBackdrop__uC0ud","mapModalContent":"ChatMessageMap-module_mapModalContent__XaQyP","mapModalHeader":"ChatMessageMap-module_mapModalHeader__RRj5V","mapModalCloseButton":"ChatMessageMap-module_mapModalCloseButton__vUs1S","mapModalBody":"ChatMessageMap-module_mapModalBody__T4vO-","mapModalSurface":"ChatMessageMap-module_mapModalSurface__FWJgn"};
38873
38872
  styleInject(css_248z$1);
38874
38873
 
38874
+ /**
38875
+ * ID of the injected `<link>` element for Leaflet's CSS.
38876
+ *
38877
+ * @private internal helper of `<ChatMessageMap/>`
38878
+ */
38879
+ const LEAFLET_CSS_LINK_ID = 'chat-message-map-leaflet-css';
38880
+ /**
38881
+ * Ensures the Leaflet stylesheet is loaded exactly once by injecting a `<link>` element into the `<head>`.
38882
+ *
38883
+ * @private internal helper of `<ChatMessageMap/>`
38884
+ */
38885
+ function ensureLeafletCssLoaded() {
38886
+ if (typeof document === 'undefined') {
38887
+ return;
38888
+ }
38889
+ if (document.getElementById(LEAFLET_CSS_LINK_ID)) {
38890
+ return;
38891
+ }
38892
+ const link = document.createElement('link');
38893
+ link.id = LEAFLET_CSS_LINK_ID;
38894
+ link.rel = 'stylesheet';
38895
+ link.href = 'https://unpkg.com/leaflet@1.9.4/dist/leaflet.css';
38896
+ link.crossOrigin = '';
38897
+ document.head.appendChild(link);
38898
+ }
38875
38899
  /**
38876
38900
  * Identifier used when rendering the OpenStreetMap tile layer.
38877
38901
  *
@@ -39104,7 +39128,8 @@ function useLeafletGeoJsonMap(containerRef, data, enabled) {
39104
39128
  let isDisposed = false;
39105
39129
  let disposeMap;
39106
39130
  void (async () => {
39107
- const leafletModule = await import('leaflet');
39131
+ ensureLeafletCssLoaded();
39132
+ const leafletModule = await import(/* webpackChunkName: "leaflet" */ 'leaflet');
39108
39133
  const leaflet = ('default' in leafletModule ? leafletModule.default : leafletModule);
39109
39134
  if (isDisposed) {
39110
39135
  return;