lucid-extension-sdk 0.0.117 → 0.0.119

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lucid-extension-sdk",
3
- "version": "0.0.117",
3
+ "version": "0.0.119",
4
4
  "description": "Utility classes for writing Lucid Software editor extensions",
5
5
  "main": "sdk/index.js",
6
6
  "types": "sdk/index.d.ts",
@@ -644,6 +644,7 @@ export declare type CreateCollectionQuery = {
644
644
  'f': CreateCollectionFieldDefinition[];
645
645
  /** Field(s) to use as the primary key of this collection */
646
646
  'p': string[];
647
+ 'fl'?: Record<string, string> | undefined;
647
648
  };
648
649
  export declare type CreateCollectionResult = string;
649
650
  export declare type CreateDataSourceQuery = {
@@ -1,9 +1,18 @@
1
1
  export declare type SerializedFieldType = number | boolean | string | null | SerializedLucidDateObject | SerializedColorObjectFieldType | SerializedLucidDictionary | SerializedLucidCurrency | undefined | Array<SerializedFieldType>;
2
- export declare type SerializedLucidDictionary = {
2
+ export declare type SerializedJsonFieldType = number | boolean | string | null | undefined | Array<SerializedJsonFieldType> | {
3
+ [index: string]: SerializedJsonFieldType;
4
+ };
5
+ export declare type JSONSerializedLucidDictionary = {
6
+ 'js': {
7
+ [index: string]: SerializedJsonFieldType;
8
+ };
9
+ };
10
+ export declare type NestedSerializedLucidDictionary = {
3
11
  'dict': {
4
12
  [index: string]: SerializedFieldType;
5
13
  };
6
14
  };
15
+ export declare type SerializedLucidDictionary = NestedSerializedLucidDictionary | JSONSerializedLucidDictionary;
7
16
  export declare type SerializedLucidCurrency = {
8
17
  'a': number;
9
18
  't': string;
@@ -52,8 +61,21 @@ export declare type SerializedColorObjectFieldType = {
52
61
  'color': SerializedColorObject;
53
62
  };
54
63
  export declare function isSerializedColorObjectFieldType(value: any): value is SerializedColorObjectFieldType;
64
+ /** a dictionary type that has full type support */
65
+ export declare const isNestedSerializedLucidDictionary: (subject: unknown) => subject is import("../../guards").DestructureGuardedTypeObj<{
66
+ dict: (x: unknown) => x is {
67
+ [key: string]: SerializedFieldType;
68
+ };
69
+ }>;
70
+ /** a dictionary type that only supports raw js, primarily used when external data could be arbritrary js */
71
+ export declare const isJsonSerializedLucidDictionary: (subject: unknown) => subject is import("../../guards").DestructureGuardedTypeObj<{
72
+ js: (x: unknown) => x is {
73
+ [key: string]: SerializedJsonFieldType;
74
+ };
75
+ }>;
55
76
  export declare function isSerializedLucidDictionary(value: any): value is SerializedLucidDictionary;
56
77
  export declare function isSerializedLucidCurrency(value: any): value is SerializedLucidCurrency;
57
78
  export declare function isSerializedLucidDateObject(value: any): value is SerializedLucidDateObject;
58
79
  export declare function isSerializedFieldType(value: any): value is SerializedFieldType;
80
+ export declare function isSerializedJsonFieldType(value: any): value is SerializedJsonFieldType;
59
81
  export declare function isSerializedFields(value: unknown): value is SerializedFields;
@@ -1,13 +1,18 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.isSerializedFields = exports.isSerializedFieldType = exports.isSerializedLucidDateObject = exports.isSerializedLucidCurrency = exports.isSerializedLucidDictionary = exports.isSerializedColorObjectFieldType = void 0;
3
+ exports.isSerializedFields = exports.isSerializedJsonFieldType = exports.isSerializedFieldType = exports.isSerializedLucidDateObject = exports.isSerializedLucidCurrency = exports.isSerializedLucidDictionary = exports.isJsonSerializedLucidDictionary = exports.isNestedSerializedLucidDictionary = exports.isSerializedColorObjectFieldType = void 0;
4
4
  const checks_1 = require("../../checks");
5
+ const validators_1 = require("../../validators/validators");
5
6
  function isSerializedColorObjectFieldType(value) {
6
7
  return (0, checks_1.isObject)(value) && (0, checks_1.isObject)(value['color']);
7
8
  }
8
9
  exports.isSerializedColorObjectFieldType = isSerializedColorObjectFieldType;
10
+ /** a dictionary type that has full type support */
11
+ exports.isNestedSerializedLucidDictionary = (0, validators_1.strictObjectValidator)({ 'dict': (0, validators_1.mapValidator)(isSerializedFieldType) });
12
+ /** a dictionary type that only supports raw js, primarily used when external data could be arbritrary js */
13
+ exports.isJsonSerializedLucidDictionary = (0, validators_1.strictObjectValidator)({ 'js': (0, validators_1.mapValidator)(isSerializedJsonFieldType) });
9
14
  function isSerializedLucidDictionary(value) {
10
- return (0, checks_1.isObject)(value) && (0, checks_1.isObject)(value['dict']) && Object.values(value['dict']).every(isSerializedFieldType);
15
+ return (0, exports.isNestedSerializedLucidDictionary)(value) || (0, exports.isJsonSerializedLucidDictionary)(value);
11
16
  }
12
17
  exports.isSerializedLucidDictionary = isSerializedLucidDictionary;
13
18
  function isSerializedLucidCurrency(value) {
@@ -33,6 +38,15 @@ function isSerializedFieldType(value) {
33
38
  isSerializedColorObjectFieldType(value));
34
39
  }
35
40
  exports.isSerializedFieldType = isSerializedFieldType;
41
+ function isSerializedJsonFieldType(value) {
42
+ return (value == null ||
43
+ (0, checks_1.isNumber)(value) ||
44
+ (0, checks_1.isString)(value) ||
45
+ (0, checks_1.isBoolean)(value) ||
46
+ ((0, checks_1.isArray)(value) && value.every(isSerializedJsonFieldType)) ||
47
+ ((0, checks_1.isObject)(value) && Object.values(value).every(isSerializedJsonFieldType)));
48
+ }
49
+ exports.isSerializedJsonFieldType = isSerializedJsonFieldType;
36
50
  function isSerializedFields(value) {
37
51
  return (0, checks_1.isObject)(value) && Object.values(value).every(isSerializedFieldType);
38
52
  }
@@ -39,6 +39,7 @@ class DataSourceProxy extends propertystoreproxy_1.PropertyStoreProxy {
39
39
  return { 'n': field.name, 't': (0, fieldtypedefinition_1.serializeFieldTypeDefinition)(field.type) };
40
40
  }),
41
41
  'p': schema.primaryKey,
42
+ 'fl': schema.fieldLabels,
42
43
  }), this.client);
43
44
  }
44
45
  /**
@@ -11,5 +11,6 @@ export declare enum DocumentElementType {
11
11
  Rule = "Rule",
12
12
  DocumentFormula = "Formula",
13
13
  TaskCardFieldsConfig = "TaskCardFieldsConfig",
14
- GeneratorView = "GeneratorView"
14
+ GeneratorView = "GeneratorView",
15
+ ShapeStylePreset = "ShapeStylePreset"
15
16
  }
@@ -16,4 +16,5 @@ var DocumentElementType;
16
16
  DocumentElementType["DocumentFormula"] = "Formula";
17
17
  DocumentElementType["TaskCardFieldsConfig"] = "TaskCardFieldsConfig";
18
18
  DocumentElementType["GeneratorView"] = "GeneratorView";
19
+ DocumentElementType["ShapeStylePreset"] = "ShapeStylePreset";
19
20
  })(DocumentElementType = exports.DocumentElementType || (exports.DocumentElementType = {}));