@openframe-org/criteria-set-protocol 2.2.9 → 2.2.11

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,9 +1,19 @@
1
1
  import { Color, CriteriaTree, CriteriaTreeElement, Theme, Criterion, Task, TaskGroup, TaskItem, ThemeOptions, CriterionOptions, TaskOptions } from "./types";
2
- interface ApplyTextFormattingPlaceholdersFunction {
3
- (options: ThemeOptions, element: Pick<Theme, "title" | "code">): string;
4
- (options: CriterionOptions, element: Pick<Criterion, "title" | "code">): string;
2
+ interface ApplyTextFormattingPlaceholdersForThemeFunction {
3
+ (options: ThemeOptions, element: Pick<Task, "title" | "code">): string;
4
+ }
5
+ interface ApplyTextFormattingPlaceholdersForCriterionFunction {
6
+ (options: CriterionOptions, element: Pick<Task, "title" | "code">): string;
7
+ }
8
+ interface ApplyTextFormattingPlaceholdersForTaskFunction {
5
9
  (options: TaskOptions, element: Pick<Task, "title" | "code">): string;
6
10
  }
11
+ interface ApplyBreadcrumbTextFormattingPlaceholdersFunction extends ApplyTextFormattingPlaceholdersForThemeFunction, ApplyTextFormattingPlaceholdersForCriterionFunction, ApplyTextFormattingPlaceholdersForTaskFunction {
12
+ }
13
+ interface ApplyDocumentTreeFolderTextFormattingPlaceholdersFunction extends ApplyTextFormattingPlaceholdersForThemeFunction, ApplyTextFormattingPlaceholdersForCriterionFunction, ApplyTextFormattingPlaceholdersForTaskFunction {
14
+ }
15
+ interface ApplyCriteriaTreeElementTextFormatFormattingPlaceholdersFunction extends ApplyTextFormattingPlaceholdersForCriterionFunction, ApplyTextFormattingPlaceholdersForTaskFunction {
16
+ }
7
17
  export declare const isTheme: (element: CriteriaTreeElement) => element is Theme;
8
18
  export declare const isCriterion: (element: CriteriaTreeElement) => element is Criterion;
9
19
  export declare const isTaskGroup: (element: CriteriaTreeElement) => element is TaskGroup;
@@ -20,9 +30,13 @@ export declare const findInTree: (tree: CriteriaTree, code: string) => CriteriaT
20
30
  /**
21
31
  * Apply the text formatting used in document tree folder naming
22
32
  */
23
- export declare const applyBreadcrumbTextFormattingPlaceholders: ApplyTextFormattingPlaceholdersFunction;
33
+ export declare const applyBreadcrumbTextFormattingPlaceholders: ApplyBreadcrumbTextFormattingPlaceholdersFunction;
34
+ /**
35
+ * Apply the text formatting used in the document tree
36
+ */
37
+ export declare const applyDocumentTreeFolderTextFormattingPlaceholders: ApplyDocumentTreeFolderTextFormattingPlaceholdersFunction;
24
38
  /**
25
- * Apply the text formatting used in breadcrumb naming
39
+ * Apply the text formatting used in the criteria tree
26
40
  */
27
- export declare const applyDocumentTreeFolderTextFormattingPlaceholders: ApplyTextFormattingPlaceholdersFunction;
41
+ export declare const applyCriteriaTreeElementTextFormatFormattingPlaceholders: ApplyCriteriaTreeElementTextFormatFormattingPlaceholdersFunction;
28
42
  export {};
package/dist/v1/utils.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.applyDocumentTreeFolderTextFormattingPlaceholders = exports.applyBreadcrumbTextFormattingPlaceholders = exports.findInTree = exports.toColorHexString = exports.isTaskItem = exports.isTask = exports.isTaskGroup = exports.isCriterion = exports.isTheme = void 0;
3
+ exports.applyCriteriaTreeElementTextFormatFormattingPlaceholders = exports.applyDocumentTreeFolderTextFormattingPlaceholders = exports.applyBreadcrumbTextFormattingPlaceholders = exports.findInTree = exports.toColorHexString = exports.isTaskItem = exports.isTask = exports.isTaskGroup = exports.isCriterion = exports.isTheme = void 0;
4
4
  const isTheme = (element) => element.type === "theme";
5
5
  exports.isTheme = isTheme;
6
6
  const isCriterion = (element) => element.type === "criterion";
@@ -50,9 +50,16 @@ const applyBreadcrumbTextFormattingPlaceholders = ({ breadcrumbTextFormat }, { t
50
50
  .replace(/:title:/g, title);
51
51
  exports.applyBreadcrumbTextFormattingPlaceholders = applyBreadcrumbTextFormattingPlaceholders;
52
52
  /**
53
- * Apply the text formatting used in breadcrumb naming
53
+ * Apply the text formatting used in the document tree
54
54
  */
55
55
  const applyDocumentTreeFolderTextFormattingPlaceholders = ({ documentTreeFolderTextFormat }, { title, code }) => (documentTreeFolderTextFormat !== null && documentTreeFolderTextFormat !== void 0 ? documentTreeFolderTextFormat : ":code:")
56
56
  .replace(/:code:/g, code)
57
57
  .replace(/:title:/g, title);
58
58
  exports.applyDocumentTreeFolderTextFormattingPlaceholders = applyDocumentTreeFolderTextFormattingPlaceholders;
59
+ /**
60
+ * Apply the text formatting used in the criteria tree
61
+ */
62
+ const applyCriteriaTreeElementTextFormatFormattingPlaceholders = ({ criteriaTreeElementTextFormat }, { title, code }) => (criteriaTreeElementTextFormat !== null && criteriaTreeElementTextFormat !== void 0 ? criteriaTreeElementTextFormat : ":code:")
63
+ .replace(/:code:/g, code)
64
+ .replace(/:title:/g, title);
65
+ exports.applyCriteriaTreeElementTextFormatFormattingPlaceholders = applyCriteriaTreeElementTextFormatFormattingPlaceholders;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openframe-org/criteria-set-protocol",
3
- "version": "2.2.9",
3
+ "version": "2.2.11",
4
4
  "description": "A protocol and tools for defining and working with criteria sets",
5
5
  "private": false,
6
6
  "author": "Andrés Angulo <aa@openframe.org>",