element-book 25.6.0 → 25.7.1

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.
@@ -1,3 +1,4 @@
1
+ import { type HTMLTemplateResult } from 'element-vir';
1
2
  import { type BookEntryType } from './book-entry-type.js';
2
3
  /**
3
4
  * Base properties for all book entry types.
@@ -20,6 +21,6 @@ export type BaseBookEntry = {
20
21
  * A description that will be displayed below the entry title. Each item in the array will be a
21
22
  * separate paragraph.
22
23
  */
23
- descriptionParagraphs: ReadonlyArray<string>;
24
+ descriptionParagraphs: ReadonlyArray<string | HTMLTemplateResult>;
24
25
  errors: Error[];
25
26
  };
@@ -1,5 +1,6 @@
1
1
  import { check } from '@augment-vir/assert';
2
2
  import { randomString } from '@augment-vir/common';
3
+ import { convertTemplateToString } from 'element-vir';
3
4
  import { fuzzySearch } from '../../util/fuzzy-search.js';
4
5
  const searchJoin = randomString(32);
5
6
  function createBreadcrumbsSearchKey(breadcrumbs) {
@@ -38,7 +39,14 @@ export function searchFlattenedNodes({ flattenedNodes, searchQuery, }) {
38
39
  const shouldInclude = fuzzySearch({
39
40
  searchIn: [
40
41
  treeNode.entry.title,
41
- ...treeNode.entry.descriptionParagraphs,
42
+ ...treeNode.entry.descriptionParagraphs.map((paragraph) => {
43
+ if (check.isString(paragraph)) {
44
+ return paragraph;
45
+ }
46
+ else {
47
+ return convertTemplateToString(paragraph);
48
+ }
49
+ }),
42
50
  ]
43
51
  .join(' ')
44
52
  .toLowerCase(),
@@ -1,3 +1,4 @@
1
+ import { type HTMLTemplateResult } from 'element-vir';
1
2
  export declare const BookEntryDescription: import("element-vir").DeclarativeElementDefinition<"book-entry-description", {
2
- descriptionParagraphs: ReadonlyArray<string>;
3
+ descriptionParagraphs: ReadonlyArray<string | HTMLTemplateResult>;
3
4
  }, {}, {}, "book-entry-description-", "book-entry-description-", readonly []>;
@@ -23,6 +23,10 @@ export const BookEntryDescription = defineBookElement()({
23
23
  p:first-child {
24
24
  margin-top: 8px;
25
25
  }
26
+
27
+ code {
28
+ font-size: 1.2em;
29
+ }
26
30
  `,
27
31
  render({ inputs }) {
28
32
  return inputs.descriptionParagraphs.map((paragraph) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "element-book",
3
- "version": "25.6.0",
3
+ "version": "25.7.1",
4
4
  "keywords": [
5
5
  "book",
6
6
  "design system",
@@ -48,7 +48,7 @@
48
48
  "lit-css-vars": "^3.0.11",
49
49
  "spa-router-vir": "^5.3.1",
50
50
  "typed-event-target": "^4.1.0",
51
- "vira": "^25.6.0"
51
+ "vira": "^25.7.1"
52
52
  },
53
53
  "devDependencies": {
54
54
  "@augment-vir/test": "^31.20.0",
@@ -57,7 +57,7 @@
57
57
  "@web/test-runner-commands": "^0.9.0",
58
58
  "@web/test-runner-playwright": "^0.11.0",
59
59
  "@web/test-runner-visual-regression": "^0.10.0",
60
- "element-vir": "^25.6.0",
60
+ "element-vir": "^25.7.1",
61
61
  "istanbul-smart-text-reporter": "^1.1.5",
62
62
  "markdown-code-example-inserter": "^3.0.3",
63
63
  "type-fest": "^4.41.0",