lucid-package 0.0.53 → 0.0.55

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-package",
3
- "version": "0.0.53",
3
+ "version": "0.0.55",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "bin": {
@@ -33,6 +33,7 @@ const defaultNameMap = new Map([
33
33
  ['strokeWidth', 'LineWidth'],
34
34
  ['opacity', 'Opacity'],
35
35
  ['rotation', 'Rotation'],
36
+ ['aspectRatio', 'AspectRatio'],
36
37
  ]);
37
38
  //Produce JSON equivalent to the document service's
38
39
  // /shapeLibraries/:name/shapes endpoint
@@ -42,7 +43,7 @@ async function getShapeListJson(name, packagePath, port = 9901) {
42
43
  const manifest = hjson.parse(rawManifest.toString());
43
44
  const usedNames = new Set(manifest['shapes'].map((shape) => shape['key']).filter((key) => key !== undefined));
44
45
  return JSON.stringify(await Promise.all(manifest['shapes'].map(async (shapeManifest, index) => {
45
- var _a, _b;
46
+ var _a, _b, _c, _d;
46
47
  const rawShapeData = await fs.readFile(packagePath + `/shapelibraries/${name}/shapes/${shapeManifest['shape']}.shape`);
47
48
  const shapeData = hjson.parse(rawShapeData.toString());
48
49
  let shapeName = shapeManifest['key'];
@@ -71,6 +72,7 @@ async function getShapeListJson(name, packagePath, port = 9901) {
71
72
  'lcszVersion': '1',
72
73
  'name': shapeName,
73
74
  'i18n': {},
75
+ 'locked': shapeManifest['locked'],
74
76
  'sourcePackage': {
75
77
  'packageId': (_a = packageManifest['id']) !== null && _a !== void 0 ? _a : '__local__',
76
78
  'version': packageManifest['version'],
@@ -114,6 +116,10 @@ async function getShapeListJson(name, packagePath, port = 9901) {
114
116
  properties[outName] = shapeManifest['defaults'][key];
115
117
  }
116
118
  }
119
+ if (((_c = shapeManifest['locked']) === null || _c === void 0 ? void 0 : _c.includes('aspectRatio')) && !properties['AspectRatio']) {
120
+ properties['AspectRatio'] =
121
+ (_d = shapeManifest['defaults']['width'] / shapeManifest['defaults']['height']) !== null && _d !== void 0 ? _d : 1;
122
+ }
117
123
  return {
118
124
  'class': 'CustomBlock',
119
125
  'created': new Date().toISOString(),