lucid-extension-sdk 0.0.411 → 0.0.413

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.
@@ -17,7 +17,8 @@ export declare enum SemanticRelationships {
17
17
  Clones = "Clones",
18
18
  IsClonedBy = "Is Cloned By",
19
19
  IsParentOf = "Is Parent Of",
20
- IsChildOf = "Is Child Of"
20
+ IsChildOf = "Is Child Of",
21
+ Unknown = "Unknown"
21
22
  }
22
23
  export declare function getInverseSemanticRelationship(relationship: SemanticRelationships): SemanticRelationships;
23
24
  export declare const isSemanticRelationship: (x: unknown) => x is SemanticRelationships;
@@ -23,6 +23,7 @@ var SemanticRelationships;
23
23
  SemanticRelationships["IsClonedBy"] = "Is Cloned By";
24
24
  SemanticRelationships["IsParentOf"] = "Is Parent Of";
25
25
  SemanticRelationships["IsChildOf"] = "Is Child Of";
26
+ SemanticRelationships["Unknown"] = "Unknown";
26
27
  })(SemanticRelationships || (exports.SemanticRelationships = SemanticRelationships = {}));
27
28
  function getInverseSemanticRelationship(relationship) {
28
29
  switch (relationship) {
@@ -0,0 +1,10 @@
1
+ import { SerializedLucidDictionary } from './serializedfield/serializedfields';
2
+ /**
3
+ * Creates avatar data as a SerializedLucidDictionary.
4
+ * Useful for creating user avatars in extensions built on the Lucid Extension SDK that need to be parsed by Lucid's products.
5
+ *
6
+ * @param icon - The URL for the user's avatar
7
+ * @param userName - Used for tooltip on the avatar
8
+ * @returns A SerializedLucidDictionary with the keys: avatarUrl and userName
9
+ */
10
+ export declare function createLucidUserAvatar(avatarUrl: string, userName: string): SerializedLucidDictionary;
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.createLucidUserAvatar = void 0;
4
+ /**
5
+ * Creates avatar data as a SerializedLucidDictionary.
6
+ * Useful for creating user avatars in extensions built on the Lucid Extension SDK that need to be parsed by Lucid's products.
7
+ *
8
+ * @param icon - The URL for the user's avatar
9
+ * @param userName - Used for tooltip on the avatar
10
+ * @returns A SerializedLucidDictionary with the keys: avatarUrl and userName
11
+ */
12
+ function createLucidUserAvatar(avatarUrl, userName) {
13
+ return {
14
+ dict: {
15
+ avatarUrl: avatarUrl,
16
+ userName: userName,
17
+ },
18
+ };
19
+ }
20
+ exports.createLucidUserAvatar = createLucidUserAvatar;
@@ -93,6 +93,12 @@ export declare const isSerializedLucidCurrency: (subject: unknown) => subject is
93
93
  a: typeof isNumber;
94
94
  t: typeof isString;
95
95
  }>;
96
+ export declare const isSerializedLucidAvatarDataDictionary: (subject: unknown) => subject is import("../../guards").DestructureGuardedTypeObj<{
97
+ dict: (subject: unknown) => subject is import("../../guards").DestructureGuardedTypeObj<{
98
+ avatarUrl: (x: unknown) => x is string | undefined;
99
+ userName: typeof isString;
100
+ }>;
101
+ }>;
96
102
  export declare const isSerializedMillisecondsDateObject: (subject: unknown) => subject is import("../../guards").DestructureGuardedTypeObj<{
97
103
  ms: typeof isNumber;
98
104
  isDateOnly: (x: unknown) => x is boolean | undefined;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
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;
3
+ exports.isSerializedFields = exports.isSerializedJsonFieldType = exports.isSerializedFieldType = exports.isSerializedLucidIconDataDictionary = exports.isSerializedTimeObject = exports.isSerializedLucidDateObject = exports.isSerializedIsoDateObject = exports.isSerializedMillisecondsDateObject = exports.isSerializedLucidAvatarDataDictionary = 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) {
@@ -20,6 +20,12 @@ exports.isSerializedLucidCurrency = (0, validators_1.objectValidator)({
20
20
  'a': checks_1.isNumber,
21
21
  't': checks_1.isString,
22
22
  });
23
+ exports.isSerializedLucidAvatarDataDictionary = (0, validators_1.objectValidator)({
24
+ 'dict': (0, validators_1.objectValidator)({
25
+ 'avatarUrl': (0, validators_1.option)(checks_1.isString),
26
+ 'userName': checks_1.isString,
27
+ }),
28
+ });
23
29
  exports.isSerializedMillisecondsDateObject = (0, validators_1.objectValidator)({
24
30
  'ms': checks_1.isNumber,
25
31
  'isDateOnly': (0, validators_1.option)(checks_1.isBoolean),
@@ -52,7 +58,8 @@ function isSerializedFieldType(value) {
52
58
  (0, exports.isSerializedLucidDateObject)(value) ||
53
59
  (0, exports.isSerializedTimeObject)(value) ||
54
60
  isSerializedColorObjectFieldType(value) ||
55
- (0, exports.isSerializedLucidIconDataDictionary)(value));
61
+ (0, exports.isSerializedLucidIconDataDictionary)(value) ||
62
+ (0, exports.isSerializedLucidAvatarDataDictionary)(value));
56
63
  }
57
64
  exports.isSerializedFieldType = isSerializedFieldType;
58
65
  function isSerializedJsonFieldType(value) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lucid-extension-sdk",
3
- "version": "0.0.411",
3
+ "version": "0.0.413",
4
4
  "description": "Utility classes for writing Lucid Software editor extensions",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",