lucid-extension-sdk 0.0.384 → 0.0.385
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.
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { SerializedLucidDictionary } from './serializedfield/serializedfields';
|
|
2
|
+
/**
|
|
3
|
+
* Creates icon data as a SerializedLucidDictionary.
|
|
4
|
+
* Useful for creating icons in extensions built on the Lucid Extension SDK that need to be parsed by Lucid's products.
|
|
5
|
+
*
|
|
6
|
+
* @param icon - The URL or SVG data for the icon
|
|
7
|
+
* @param ariaLabel - The accessible label for the icon
|
|
8
|
+
* @param tooltipLabel - Optional tooltip text
|
|
9
|
+
* @returns A SerializedLucidDictionary with the keys: icon, ariaLabel, and tooltipLabel (if provided)
|
|
10
|
+
*/
|
|
11
|
+
export declare function createLucidIconData(icon: string, ariaLabel: string, tooltipLabel?: string): SerializedLucidDictionary;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createLucidIconData = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Creates icon data as a SerializedLucidDictionary.
|
|
6
|
+
* Useful for creating icons in extensions built on the Lucid Extension SDK that need to be parsed by Lucid's products.
|
|
7
|
+
*
|
|
8
|
+
* @param icon - The URL or SVG data for the icon
|
|
9
|
+
* @param ariaLabel - The accessible label for the icon
|
|
10
|
+
* @param tooltipLabel - Optional tooltip text
|
|
11
|
+
* @returns A SerializedLucidDictionary with the keys: icon, ariaLabel, and tooltipLabel (if provided)
|
|
12
|
+
*/
|
|
13
|
+
function createLucidIconData(icon, ariaLabel, tooltipLabel) {
|
|
14
|
+
return {
|
|
15
|
+
['dict']: Object.assign({ ['icon']: icon, ['ariaLabel']: ariaLabel }, (tooltipLabel ? { ['tooltipLabel']: tooltipLabel } : {})),
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
exports.createLucidIconData = createLucidIconData;
|
|
@@ -113,6 +113,13 @@ export declare const isSerializedTimeObject: (subject: unknown) => subject is im
|
|
|
113
113
|
minutes: (x: unknown) => x is number | undefined;
|
|
114
114
|
seconds: (x: unknown) => x is number | undefined;
|
|
115
115
|
}>;
|
|
116
|
+
export declare const isSerializedLucidIconDataDictionary: (subject: unknown) => subject is import("../../guards").DestructureGuardedTypeObj<{
|
|
117
|
+
dict: (subject: unknown) => subject is import("../../guards").DestructureGuardedTypeObj<{
|
|
118
|
+
icon: typeof isString;
|
|
119
|
+
ariaLabel: typeof isString;
|
|
120
|
+
tooltipLabel: (x: unknown) => x is string | undefined;
|
|
121
|
+
}>;
|
|
122
|
+
}>;
|
|
116
123
|
export declare function isSerializedFieldType(value: any): value is SerializedFieldType;
|
|
117
124
|
export declare function isSerializedJsonFieldType(value: any): value is SerializedJsonFieldType;
|
|
118
125
|
export declare const isSerializedFields: (x: unknown) => x is Record<string | number, SerializedFieldType>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isSerializedFields = exports.isSerializedJsonFieldType = exports.isSerializedFieldType = exports.isSerializedTimeObject = exports.isSerializedLucidDateObject = exports.isSerializedIsoDateObject = exports.isSerializedMillisecondsDateObject = exports.isSerializedLucidCurrency = exports.isSerializedLucidDictionary = exports.isJsonSerializedLucidDictionary = exports.isNestedSerializedLucidDictionary = exports.isSerializedColorObjectFieldType = void 0;
|
|
3
|
+
exports.isSerializedFields = exports.isSerializedJsonFieldType = exports.isSerializedFieldType = exports.isSerializedLucidIconDataDictionary = exports.isSerializedTimeObject = exports.isSerializedLucidDateObject = exports.isSerializedIsoDateObject = exports.isSerializedMillisecondsDateObject = exports.isSerializedLucidCurrency = exports.isSerializedLucidDictionary = exports.isJsonSerializedLucidDictionary = exports.isNestedSerializedLucidDictionary = exports.isSerializedColorObjectFieldType = void 0;
|
|
4
4
|
const checks_1 = require("../../checks");
|
|
5
5
|
const validators_1 = require("../../validators/validators");
|
|
6
6
|
function isSerializedColorObjectFieldType(value) {
|
|
@@ -34,6 +34,13 @@ exports.isSerializedTimeObject = (0, validators_1.objectValidator)({
|
|
|
34
34
|
'minutes': (0, validators_1.option)(checks_1.isNumber),
|
|
35
35
|
'seconds': (0, validators_1.option)(checks_1.isNumber),
|
|
36
36
|
});
|
|
37
|
+
exports.isSerializedLucidIconDataDictionary = (0, validators_1.objectValidator)({
|
|
38
|
+
'dict': (0, validators_1.objectValidator)({
|
|
39
|
+
'icon': checks_1.isString,
|
|
40
|
+
'ariaLabel': checks_1.isString,
|
|
41
|
+
'tooltipLabel': (0, validators_1.option)(checks_1.isString),
|
|
42
|
+
}),
|
|
43
|
+
});
|
|
37
44
|
function isSerializedFieldType(value) {
|
|
38
45
|
return (value == null ||
|
|
39
46
|
(0, checks_1.isNumber)(value) ||
|
|
@@ -44,7 +51,8 @@ function isSerializedFieldType(value) {
|
|
|
44
51
|
((0, checks_1.isArray)(value) && value.every(isSerializedFieldType)) ||
|
|
45
52
|
(0, exports.isSerializedLucidDateObject)(value) ||
|
|
46
53
|
(0, exports.isSerializedTimeObject)(value) ||
|
|
47
|
-
isSerializedColorObjectFieldType(value)
|
|
54
|
+
isSerializedColorObjectFieldType(value) ||
|
|
55
|
+
(0, exports.isSerializedLucidIconDataDictionary)(value));
|
|
48
56
|
}
|
|
49
57
|
exports.isSerializedFieldType = isSerializedFieldType;
|
|
50
58
|
function isSerializedJsonFieldType(value) {
|