datagrok-tools 4.14.48 → 4.14.49

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.
@@ -21,7 +21,7 @@ let pseudoParams = exports.pseudoParams = /*#__PURE__*/function (pseudoParams) {
21
21
  return pseudoParams;
22
22
  }({});
23
23
  const nonMetaData = ['sidebar', 'editor', 'friendlyName', 'helpUrl', 'help-url', 'condition', 'connection', 'top-menu', 'cache', 'cache.invalidateOn', 'test'];
24
- const decoratorOptionToAnnotation = exports.decoratorOptionToAnnotation = new Map([['initialValue', 'default'], ['helpUrl', 'help-url'], ['topMenu', 'top-menu'], ['metaUrl', 'meta.url'], ['optionsType', 'type'], ['cacheInvalidateOn', 'cache.invalidateOn'], ['scriptHandlerLanguage', 'scriptHandler.language'], ['scriptHandlerExtensions', 'scriptHandler.extensions'], ['scriptHandlerCommentStart', 'scriptHandler.commentStart'], ['scriptHandlerTemplateScript', 'scriptHandler.templateScript'], ['scriptHandlerCodeEditorMode', 'scriptHandler.codeEditorMode'], ['scriptHandlerVectorizationFunction', 'scriptHandler.vectorizationFunction']]);
24
+ const decoratorOptionToAnnotation = exports.decoratorOptionToAnnotation = new Map([['helpUrl', 'help-url'], ['topMenu', 'top-menu'], ['metaUrl', 'meta.url'], ['optionsType', 'type'], ['cacheInvalidateOn', 'cache.invalidateOn'], ['scriptHandlerLanguage', 'scriptHandler.language'], ['scriptHandlerExtensions', 'scriptHandler.extensions'], ['scriptHandlerCommentStart', 'scriptHandler.commentStart'], ['scriptHandlerTemplateScript', 'scriptHandler.templateScript'], ['scriptHandlerCodeEditorMode', 'scriptHandler.codeEditorMode'], ['scriptHandlerVectorizationFunction', 'scriptHandler.vectorizationFunction']]);
25
25
  const dgAnnotationTypes = exports.dgAnnotationTypes = {
26
26
  INT: 'int',
27
27
  BIG_INT: 'bigint',
@@ -186,14 +186,19 @@ function getFuncAnnotation(data, comment = '//', sep = '\n') {
186
186
  const inputOptionsNames = exports.inputOptionsNames = ['semType', 'category', 'optional', 'editor', 'nullable', 'separators', 'choices', 'format', 'min', 'max', 'caption', 'description', 'initialValue', 'viewer', 'units', 'type', 'optionsType', 'step', 'meta.url', 'metaUrl'];
187
187
  function buildStringOfOptions(input) {
188
188
  const optionsInString = [];
189
- for (const [key, value] of Object.entries(input.options ?? {})) {
189
+ const opt = input.options ?? {};
190
+ let defaultValue = '';
191
+ if (opt['initialValue']) defaultValue = ` = ${opt['initialValue']}`;
192
+ for (const [key, value] of Object.entries(opt)) {
193
+ if (key === 'initialValue') continue;
190
194
  let val = value;
191
195
  let option = key;
192
196
  option = decoratorOptionToAnnotation.get(option) ?? option;
193
197
  if (Array.isArray(value)) val = JSON.stringify(value);
194
198
  optionsInString.push(`${option}: ${val}`);
195
199
  }
196
- return `{ ${optionsInString.join('; ')} }`;
200
+ const optString = optionsInString.length > 0 ? `{ ${optionsInString.join('; ')} }` : '';
201
+ return `${defaultValue} ${optString}`;
197
202
  }
198
203
  const reservedDecorators = exports.reservedDecorators = {
199
204
  viewer: {
@@ -10,7 +10,7 @@
10
10
  "@datagrok-libraries/utils": "^4.6.0"
11
11
  },
12
12
  "devDependencies": {
13
- "datagrok-tools": "^4.14.38",
13
+ "datagrok-tools": "^4.14.48",
14
14
  "webpack": "^5.95.0",
15
15
  "webpack-cli": "^5.1.4"
16
16
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "datagrok-tools",
3
- "version": "4.14.48",
3
+ "version": "4.14.49",
4
4
  "description": "Utility to upload and publish packages to Datagrok",
5
5
  "homepage": "https://github.com/datagrok-ai/public/tree/master/tools#readme",
6
6
  "dependencies": {