@jupyterlab/settingregistry 4.0.0-alpha.15 → 4.0.0-alpha.17

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.
@@ -56,6 +56,13 @@
56
56
  },
57
57
  "additionalProperties": false
58
58
  },
59
+ "jupyter.lab.metadataforms": {
60
+ "items": {
61
+ "$ref": "#/definitions/metadataForm"
62
+ },
63
+ "type": "array",
64
+ "default": []
65
+ },
59
66
  "jupyter.lab.setting-deprecated": {
60
67
  "type": "boolean",
61
68
  "default": false
@@ -295,6 +302,90 @@
295
302
  "required": ["name"],
296
303
  "additionalProperties": false,
297
304
  "type": "object"
305
+ },
306
+ "metadataForm": {
307
+ "type": "object",
308
+ "properties": {
309
+ "id": {
310
+ "type": "string",
311
+ "description": "The section ID"
312
+ },
313
+ "metadataSchema": {
314
+ "type": "object",
315
+ "items": {
316
+ "$ref": "#/definitions/metadataSchema"
317
+ }
318
+ },
319
+ "uiSchema": {
320
+ "type": "object"
321
+ },
322
+ "metadataOptions": {
323
+ "type": "object",
324
+ "items": {
325
+ "$ref": "#/definitions/metadataOptions"
326
+ }
327
+ },
328
+ "label": {
329
+ "type": "string",
330
+ "description": "The section label"
331
+ },
332
+ "rank": {
333
+ "type": "integer",
334
+ "description": "The rank of the section in the right panel"
335
+ },
336
+ "showModified": {
337
+ "type": "boolean",
338
+ "description": "Whether to show modified values from defaults"
339
+ }
340
+ },
341
+ "required": ["id", "metadataSchema"]
342
+ },
343
+ "metadataSchema": {
344
+ "properties": {
345
+ "properties": {
346
+ "type": "object",
347
+ "description": "The property set up by extension",
348
+ "properties": {
349
+ "title": {
350
+ "type": "string"
351
+ },
352
+ "description": {
353
+ "type": "string"
354
+ },
355
+ "type": {
356
+ "type": "string"
357
+ }
358
+ }
359
+ }
360
+ },
361
+ "type": "object",
362
+ "required": ["properties"]
363
+ },
364
+ "metadataOptions": {
365
+ "properties": {
366
+ "customWidget": {
367
+ "type": "string"
368
+ },
369
+ "customField": {
370
+ "type": "string"
371
+ },
372
+ "metadataLevel": {
373
+ "type": "string",
374
+ "enum": ["cell", "notebook"],
375
+ "default": "cell"
376
+ },
377
+ "cellTypes": {
378
+ "type": "array",
379
+ "items": {
380
+ "type": "string",
381
+ "enum": ["code", "markdown", "raw"]
382
+ }
383
+ },
384
+ "writeDefault": {
385
+ "type": "boolean"
386
+ }
387
+ },
388
+ "type": "object"
298
389
  }
299
390
  }
300
391
  }
package/lib/tokens.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ import { CellType } from '@jupyterlab/nbformat';
1
2
  import { IDataConnector } from '@jupyterlab/statedb';
2
3
  import { PartialJSONObject, PartialJSONValue, ReadonlyPartialJSONObject, ReadonlyPartialJSONValue, Token } from '@lumino/coreutils';
3
4
  import { IDisposable } from '@lumino/disposable';
@@ -358,6 +359,10 @@ export declare namespace ISettingRegistry {
358
359
  * The JupyterLab shortcuts that are created by a plugin's schema.
359
360
  */
360
361
  'jupyter.lab.shortcuts'?: IShortcut[];
362
+ /**
363
+ * The JupyterLab metadata-form schema
364
+ */
365
+ 'jupyter.lab.metadataforms'?: IMetadataForm[];
361
366
  /**
362
367
  * The root schema is always an object.
363
368
  */
@@ -502,6 +507,104 @@ export declare namespace ISettingRegistry {
502
507
  */
503
508
  selector: string;
504
509
  }
510
+ /**
511
+ * An interface describing the metadata form.
512
+ */
513
+ interface IMetadataForm extends PartialJSONObject {
514
+ /**
515
+ * The section unique ID.
516
+ */
517
+ id: string;
518
+ /**
519
+ * The metadata schema.
520
+ *
521
+ * ## Notes:
522
+ * To change to type @rjsf/utils -> RJSFSchema when upgrading rjsf to v5.
523
+ */
524
+ metadataSchema: IMetadataSchema;
525
+ /**
526
+ * The ui schema as used by react-JSON-schema-form.
527
+ *
528
+ * ## Notes:
529
+ * To change to type @rjsf/utils -> UiSchema when upgrading rjsf to v5.
530
+ */
531
+ uiSchema?: {
532
+ [metadataKey: string]: PartialJSONObject;
533
+ };
534
+ /**
535
+ * The jupyter properties.
536
+ */
537
+ metadataOptions?: {
538
+ [metadataKey: string]: IMetadataOptions;
539
+ };
540
+ /**
541
+ * The section label.
542
+ */
543
+ label?: string;
544
+ /**
545
+ * The section rank in notebooktools panel.
546
+ */
547
+ rank?: number;
548
+ /**
549
+ * Whether to show the modified field from default value.
550
+ */
551
+ showModified?: boolean;
552
+ /**
553
+ * Keep the plugin at origin of the metadata form.
554
+ */
555
+ _origin?: string;
556
+ }
557
+ /**
558
+ * The metadata schema as defined in JSON schema.
559
+ *
560
+ * ## Notes:
561
+ * To remove in favour of @rjsf/utils -> RJSFSchema when upgrading rjsf to v5.
562
+ */
563
+ interface IMetadataSchema extends PartialJSONObject {
564
+ /**
565
+ * The type of data (should be object at first level).
566
+ */
567
+ type: string;
568
+ /**
569
+ * The properties as defined in JSON schema, and interpretable by react-JSON-schema-form.
570
+ */
571
+ properties: {
572
+ [option: string]: any;
573
+ };
574
+ /**
575
+ * The required fields.
576
+ */
577
+ required?: string[];
578
+ /**
579
+ * Support for allOf feature of JSON schema (useful for if/then/else).
580
+ */
581
+ allOf?: Array<PartialJSONObject>;
582
+ }
583
+ /**
584
+ * Options to customize the widget, the field and the relevant metadata.
585
+ */
586
+ interface IMetadataOptions extends PartialJSONObject {
587
+ /**
588
+ * Name of a custom react widget registered.
589
+ */
590
+ customWidget?: string;
591
+ /**
592
+ * Name of a custom react field registered.
593
+ */
594
+ customField?: string;
595
+ /**
596
+ * Metadata applied to notebook or cell.
597
+ */
598
+ metadataLevel?: 'cell' | 'notebook';
599
+ /**
600
+ * Cells which should have this metadata.
601
+ */
602
+ cellTypes?: CellType[];
603
+ /**
604
+ * Whether to avoid writing default value in metadata.
605
+ */
606
+ writeDefault?: boolean;
607
+ }
505
608
  /**
506
609
  * An interface describing a toolbar item.
507
610
  */
package/lib/tokens.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"tokens.js","sourceRoot":"","sources":["../src/tokens.ts"],"names":[],"mappings":"AAAA;;;+EAG+E;AAG/E,OAAO,EAKL,KAAK,EACN,MAAM,mBAAmB,CAAC;AAK3B;;GAEG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,IAAI,KAAK,CACvC,wCAAwC,CACzC,CAAC"}
1
+ {"version":3,"file":"tokens.js","sourceRoot":"","sources":["../src/tokens.ts"],"names":[],"mappings":"AAAA;;;+EAG+E;AAI/E,OAAO,EAKL,KAAK,EACN,MAAM,mBAAmB,CAAC;AAK3B;;GAEG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,IAAI,KAAK,CACvC,wCAAwC,CACzC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jupyterlab/settingregistry",
3
- "version": "4.0.0-alpha.15",
3
+ "version": "4.0.0-alpha.17",
4
4
  "description": "Settings registry for Jupyterlab",
5
5
  "homepage": "https://github.com/jupyterlab/jupyterlab",
6
6
  "bugs": {
@@ -35,7 +35,8 @@
35
35
  "watch": "tsc -b --watch"
36
36
  },
37
37
  "dependencies": {
38
- "@jupyterlab/statedb": "^4.0.0-alpha.15",
38
+ "@jupyterlab/nbformat": "^4.0.0-alpha.17",
39
+ "@jupyterlab/statedb": "^4.0.0-alpha.17",
39
40
  "@lumino/commands": "^2.0.0-alpha.6",
40
41
  "@lumino/coreutils": "^2.0.0-alpha.6",
41
42
  "@lumino/disposable": "^2.0.0-alpha.6",
@@ -44,12 +45,10 @@
44
45
  "json5": "^2.1.1"
45
46
  },
46
47
  "devDependencies": {
47
- "@jupyterlab/testutils": "^4.0.0-alpha.15",
48
- "@types/jest": "^26.0.10",
48
+ "@jupyterlab/testing": "^4.0.0-alpha.17",
49
+ "@types/jest": "^29.2.0",
49
50
  "@types/json5": "^0.0.30",
50
- "jest": "^26.4.2",
51
51
  "rimraf": "~3.0.0",
52
- "ts-jest": "^26.3.0",
53
52
  "typescript": "~4.7.3"
54
53
  },
55
54
  "publishConfig": {