@promptbook/remote-client 0.102.0-12 → 0.102.0-16

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
@@ -20,7 +20,7 @@ const BOOK_LANGUAGE_VERSION = '1.0.0';
20
20
  * @generated
21
21
  * @see https://github.com/webgptorg/promptbook
22
22
  */
23
- const PROMPTBOOK_ENGINE_VERSION = '0.102.0-12';
23
+ const PROMPTBOOK_ENGINE_VERSION = '0.102.0-16';
24
24
  /**
25
25
  * TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
26
26
  * Note: [💞] Ignore a discrepancy between file name and entity name
@@ -557,7 +557,7 @@ class Color {
557
557
  return Color.fromString(CSS_COLORS[color]);
558
558
  // -----
559
559
  }
560
- else if (/^#(?:[0-9a-fA-F]{3}){1,2}$/.test(color)) {
560
+ else if (Color.isHexColorString(color)) {
561
561
  return Color.fromHex(color);
562
562
  // -----
563
563
  }
@@ -816,6 +816,15 @@ class Color {
816
816
  }
817
817
  return true;
818
818
  }
819
+ /**
820
+ * Checks if the given value is a valid hex color string
821
+ *
822
+ * @param value - value to check
823
+ * @returns true if the value is a valid hex color string (e.g., `#009edd`, `#fff`, etc.)
824
+ */
825
+ static isHexColorString(value) {
826
+ return typeof value === 'string' && /^#(?:[0-9a-fA-F]{3}){1,2}$/.test(value);
827
+ }
819
828
  /**
820
829
  * Creates new Color object
821
830
  *