@dataloop-ai/components 0.20.82 → 0.20.84

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": "@dataloop-ai/components",
3
- "version": "0.20.82",
3
+ "version": "0.20.84",
4
4
  "exports": {
5
5
  ".": "./index.ts",
6
6
  "./models": "./models.ts",
@@ -848,7 +848,7 @@ export default defineComponent({
848
848
 
849
849
  //#region computed
850
850
  const editorStyle = computed((): SyntaxColorSchema => {
851
- return createColorSchema(colorSchema.value, aliases.value)
851
+ return createColorSchema(colorSchema.value, aliases.value, schema.value)
852
852
  })
853
853
 
854
854
  const defaultIcon = 'icon-dl-stars'
@@ -343,14 +343,30 @@ export function setValueAliases(json: Data, schema: Data) {
343
343
 
344
344
  export function createColorSchema(
345
345
  colorSchema: ColorSchema,
346
- aliases: Alias[]
346
+ aliases: Alias[],
347
+ schema: Data
347
348
  ): SyntaxColorSchema {
348
- const thisFields = []
349
+ const thisFields: string[] = []
349
350
  for (const key in aliases) {
350
- thisFields.push(aliases[key].alias)
351
+ const aliasParts = aliases[key].alias.split('.')
352
+ while (aliasParts.length > 0) {
353
+ thisFields.push(aliasParts.join('.'))
354
+ aliasParts.pop()
355
+ }
356
+ }
357
+
358
+ const addKeysFromSchema = (schema: Data, parentKey?: string) => {
359
+ for (const key in schema) {
360
+ const fullKey = parentKey ? `${parentKey}.${key}` : key
361
+ thisFields.push(fullKey)
362
+ if (typeof schema[key] === 'object') {
363
+ addKeysFromSchema(schema[key], fullKey)
364
+ }
365
+ }
351
366
  }
367
+ addKeysFromSchema(schema)
352
368
 
353
- const thisOperators = []
369
+ const thisOperators: string[] = []
354
370
  for (const key in operators) {
355
371
  thisOperators.push(operators[key])
356
372
  }