@openframe-org/criteria-set-protocol 2.2.9 → 2.2.10
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/dist/v1/utils.d.ts +15 -5
- package/dist/v1/utils.js +9 -2
- package/package.json +1 -1
package/dist/v1/utils.d.ts
CHANGED
|
@@ -1,9 +1,15 @@
|
|
|
1
|
-
import { Color, CriteriaTree, CriteriaTreeElement, Theme, Criterion, Task, TaskGroup, TaskItem,
|
|
2
|
-
interface
|
|
3
|
-
(options: ThemeOptions, element: Pick<Theme, "title" | "code">): string;
|
|
4
|
-
(options: CriterionOptions, element: Pick<Criterion, "title" | "code">): string;
|
|
1
|
+
import { Color, CriteriaTree, CriteriaTreeElement, Theme, Criterion, Task, TaskGroup, TaskItem, TaskOptions } from "./types";
|
|
2
|
+
interface ApplyTextFormattingPlaceholdersForThemeFunction {
|
|
5
3
|
(options: TaskOptions, element: Pick<Task, "title" | "code">): string;
|
|
6
4
|
}
|
|
5
|
+
interface ApplyTextFormattingPlaceholdersForCriterionFunction {
|
|
6
|
+
(options: TaskOptions, element: Pick<Task, "title" | "code">): string;
|
|
7
|
+
}
|
|
8
|
+
interface ApplyTextFormattingPlaceholdersForTaskFunction {
|
|
9
|
+
(options: TaskOptions, element: Pick<Task, "title" | "code">): string;
|
|
10
|
+
}
|
|
11
|
+
interface ApplyTextFormattingPlaceholdersFunction extends ApplyTextFormattingPlaceholdersForThemeFunction, ApplyTextFormattingPlaceholdersForCriterionFunction, ApplyTextFormattingPlaceholdersForTaskFunction {
|
|
12
|
+
}
|
|
7
13
|
export declare const isTheme: (element: CriteriaTreeElement) => element is Theme;
|
|
8
14
|
export declare const isCriterion: (element: CriteriaTreeElement) => element is Criterion;
|
|
9
15
|
export declare const isTaskGroup: (element: CriteriaTreeElement) => element is TaskGroup;
|
|
@@ -22,7 +28,11 @@ export declare const findInTree: (tree: CriteriaTree, code: string) => CriteriaT
|
|
|
22
28
|
*/
|
|
23
29
|
export declare const applyBreadcrumbTextFormattingPlaceholders: ApplyTextFormattingPlaceholdersFunction;
|
|
24
30
|
/**
|
|
25
|
-
* Apply the text formatting used in
|
|
31
|
+
* Apply the text formatting used in the document tree
|
|
26
32
|
*/
|
|
27
33
|
export declare const applyDocumentTreeFolderTextFormattingPlaceholders: ApplyTextFormattingPlaceholdersFunction;
|
|
34
|
+
/**
|
|
35
|
+
* Apply the text formatting used in the criteria tree
|
|
36
|
+
*/
|
|
37
|
+
export declare const applyCriteriaTreeElementTextFormatFormattingPlaceholders: Exclude<ApplyTextFormattingPlaceholdersFunction, 'ApplyTextFormattingPlaceholdersForThemeFunction'>;
|
|
28
38
|
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
|
|
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