@difizen/libro-core 0.3.50 → 0.3.52

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.
@@ -41,21 +41,16 @@ export declare class LibroCellView extends BaseView implements CellView {
41
41
  toJSON(): LibroCell;
42
42
  toJSONWithoutId: () => {
43
43
  [x: string]: import("@difizen/libro-common").PartialJSONValue | undefined;
44
- metadata: Partial<import("./libro-cell-protocol.js").LibroCellMetadata>;
45
- cell_type: string;
44
+ id?: string | undefined;
45
+ cell_type: "raw";
46
+ metadata: Partial<import("@difizen/libro-common").IRawCellMetadata>;
47
+ attachments?: import("@difizen/libro-common").IAttachments | undefined;
46
48
  source: import("@difizen/libro-common").MultilineString;
47
49
  } | {
48
50
  [x: string]: import("@difizen/libro-common").PartialJSONValue | undefined;
49
51
  cell_type: string;
50
52
  source: import("@difizen/libro-common").MultilineString;
51
53
  metadata: Partial<import("@difizen/libro-common").ICellMetadata>;
52
- } | {
53
- [x: string]: import("@difizen/libro-common").PartialJSONValue | undefined;
54
- id?: string | undefined;
55
- cell_type: "raw";
56
- metadata: Partial<import("@difizen/libro-common").IRawCellMetadata>;
57
- attachments?: import("@difizen/libro-common").IAttachments | undefined;
58
- source: import("@difizen/libro-common").MultilineString;
59
54
  } | {
60
55
  [x: string]: import("@difizen/libro-common").PartialJSONValue | undefined;
61
56
  id?: string | undefined;
@@ -71,6 +66,11 @@ export declare class LibroCellView extends BaseView implements CellView {
71
66
  outputs: import("@difizen/libro-common").IOutput[];
72
67
  execution_count: import("@difizen/libro-common").ExecutionCount;
73
68
  source: import("@difizen/libro-common").MultilineString;
69
+ } | {
70
+ [x: string]: import("@difizen/libro-common").PartialJSONValue | undefined;
71
+ metadata: Partial<import("./libro-cell-protocol.js").LibroCellMetadata>;
72
+ cell_type: string;
73
+ source: import("@difizen/libro-common").MultilineString;
74
74
  };
75
75
  }
76
76
  //# sourceMappingURL=libro-cell-view.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"libro-context-key.d.ts","sourceRoot":"","sources":["../src/libro-context-key.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAItD,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAElD,qBACa,eAAe;IAC1B,SAAS,CAAC,QAAQ,CAAC,iBAAiB,EAAE,iBAAiB,CAAC;IACxD,SAAS,CAAC,QAAQ,CAAC,YAAY,EAAE,YAAY,CAAC;IAC9C,SAAS,CAAC,wBAAwB,CAAC,EAAE,UAAU,CAAC;IAChD,kBAAkB,UAAQ;IAC1B,SAAS,CAAC,aAAa,UAAS;IAChC,MAAM,EAAE,WAAW,CAAC,OAAO,CAAC,CAAC;IAC7B,KAAK,EAAE,WAAW,CAAC,OAAO,CAAC,CAAC;IAC5B,WAAW,EAAE,WAAW,CAAC,OAAO,CAAC,CAAC;gBAGL,iBAAiB,EAAE,iBAAiB,EACzC,YAAY,EAAE,YAAY;IASlD,kBAAkB,aAGhB;IAEF,iBAAiB,aAGf;IAEF,SAAS,CAAC,WAAW;IAarB,SAAS,CAAC,UAAU;IAUpB,SAAS,CAAC,gBAAgB;IAO1B,SAAS,CAAC,cAAc,aAQtB;CACH;AACD;;GAEG;AACH,eAAO,MAAM,eAAe,wBAAkB,CAAC"}
1
+ {"version":3,"file":"libro-context-key.d.ts","sourceRoot":"","sources":["../src/libro-context-key.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAItD,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAElD,qBACa,eAAe;IAC1B,SAAS,CAAC,QAAQ,CAAC,iBAAiB,EAAE,iBAAiB,CAAC;IACxD,SAAS,CAAC,QAAQ,CAAC,YAAY,EAAE,YAAY,CAAC;IAC9C,SAAS,CAAC,wBAAwB,CAAC,EAAE,UAAU,CAAC;IAChD,kBAAkB,UAAQ;IAC1B,SAAS,CAAC,aAAa,UAAS;IAChC,MAAM,EAAE,WAAW,CAAC,OAAO,CAAC,CAAC;IAC7B,KAAK,EAAE,WAAW,CAAC,OAAO,CAAC,CAAC;IAC5B,WAAW,EAAE,WAAW,CAAC,OAAO,CAAC,CAAC;gBAGL,iBAAiB,EAAE,iBAAiB,EACzC,YAAY,EAAE,YAAY;IASlD,kBAAkB,aAGhB;IAEF,iBAAiB,aAGf;IAEF,SAAS,CAAC,WAAW;IAarB,SAAS,CAAC,UAAU;IAapB,SAAS,CAAC,gBAAgB;IAO1B,SAAS,CAAC,cAAc,aActB;CACH;AACD;;GAEG;AACH,eAAO,MAAM,eAAe,wBAAkB,CAAC"}
@@ -27,14 +27,16 @@ export var LibroContextKey = (_dec = singleton(), _dec(_class = /*#__PURE__*/fun
27
27
  };
28
28
  this.enableCommandMode = function () {
29
29
  _this.commandModeEnabled = true;
30
- _this.commandMode.set(_this.isCommandMode);
30
+ _this.commandMode.set(_this.isCommandMode && !!_this.libroService.focus);
31
31
  };
32
32
  this.listenToActive = function () {
33
33
  var active = _this.libroService.active;
34
34
  if (active) {
35
+ _this.isCommandMode = !!active.model.commandMode;
36
+ _this.commandMode.set(_this.isCommandMode && _this.commandModeEnabled && !!_this.libroService.focus);
35
37
  _this.toDisposeOnActiveChanged = active.model.onCommandModeChanged(function () {
36
38
  _this.isCommandMode = !!active.model.commandMode;
37
- _this.commandMode.set(_this.isCommandMode && _this.commandModeEnabled);
39
+ _this.commandMode.set(_this.isCommandMode && _this.commandModeEnabled && !!_this.libroService.focus);
38
40
  });
39
41
  }
40
42
  };
@@ -65,6 +67,7 @@ export var LibroContextKey = (_dec = singleton(), _dec(_class = /*#__PURE__*/fun
65
67
  var _this3 = this;
66
68
  this.libroService.onFocusChanged(function () {
67
69
  _this3.focus.set(!!_this3.libroService.focus);
70
+ _this3.commandMode.set(_this3.isCommandMode && _this3.commandModeEnabled && !!_this3.libroService.focus);
68
71
  });
69
72
  this.focus = this.contextKeyService.createKey(LibroContextKeys.focus, !!this.libroService.focus);
70
73
  }
@@ -72,7 +75,7 @@ export var LibroContextKey = (_dec = singleton(), _dec(_class = /*#__PURE__*/fun
72
75
  key: "setupCommandMode",
73
76
  value: function setupCommandMode() {
74
77
  var _this$libroService$ac;
75
- this.commandMode = this.contextKeyService.createKey(LibroContextKeys.commandMode, !!((_this$libroService$ac = this.libroService.active) !== null && _this$libroService$ac !== void 0 && _this$libroService$ac.model.commandMode));
78
+ this.commandMode = this.contextKeyService.createKey(LibroContextKeys.commandMode, !!((_this$libroService$ac = this.libroService.active) !== null && _this$libroService$ac !== void 0 && _this$libroService$ac.model.commandMode) && !!this.libroService.focus);
76
79
  this.listenToActive();
77
80
  }
78
81
  }]);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@difizen/libro-core",
3
- "version": "0.3.50",
3
+ "version": "0.3.52",
4
4
  "description": "",
5
5
  "keywords": [
6
6
  "libro",
@@ -34,10 +34,10 @@
34
34
  ],
35
35
  "dependencies": {
36
36
  "@ant-design/icons": "^5.1.0",
37
- "@difizen/libro-code-editor": "^0.3.50",
38
- "@difizen/libro-common": "^0.3.50",
39
- "@difizen/libro-shared-model": "^0.3.50",
40
- "@difizen/libro-virtualized": "^0.3.50",
37
+ "@difizen/libro-code-editor": "^0.3.52",
38
+ "@difizen/libro-common": "^0.3.52",
39
+ "@difizen/libro-shared-model": "^0.3.52",
40
+ "@difizen/libro-virtualized": "^0.3.52",
41
41
  "@difizen/mana-app": "latest",
42
42
  "@difizen/mana-l10n": "latest",
43
43
  "@difizen/mana-react": "latest",
@@ -35,7 +35,7 @@ export class LibroContextKey {
35
35
 
36
36
  enableCommandMode = () => {
37
37
  this.commandModeEnabled = true;
38
- this.commandMode.set(this.isCommandMode);
38
+ this.commandMode.set(this.isCommandMode && !!this.libroService.focus);
39
39
  };
40
40
 
41
41
  protected setupActive() {
@@ -54,6 +54,9 @@ export class LibroContextKey {
54
54
  protected setupFocus() {
55
55
  this.libroService.onFocusChanged(() => {
56
56
  this.focus.set(!!this.libroService.focus);
57
+ this.commandMode.set(
58
+ this.isCommandMode && this.commandModeEnabled && !!this.libroService.focus,
59
+ );
57
60
  });
58
61
  this.focus = this.contextKeyService.createKey<boolean>(
59
62
  LibroContextKeys.focus,
@@ -64,16 +67,22 @@ export class LibroContextKey {
64
67
  protected setupCommandMode() {
65
68
  this.commandMode = this.contextKeyService.createKey<boolean>(
66
69
  LibroContextKeys.commandMode,
67
- !!this.libroService.active?.model.commandMode,
70
+ !!this.libroService.active?.model.commandMode && !!this.libroService.focus,
68
71
  );
69
72
  this.listenToActive();
70
73
  }
71
74
  protected listenToActive = () => {
72
75
  const active = this.libroService.active;
73
76
  if (active) {
77
+ this.isCommandMode = !!active.model.commandMode;
78
+ this.commandMode.set(
79
+ this.isCommandMode && this.commandModeEnabled && !!this.libroService.focus,
80
+ );
74
81
  this.toDisposeOnActiveChanged = active.model.onCommandModeChanged(() => {
75
82
  this.isCommandMode = !!active.model.commandMode;
76
- this.commandMode.set(this.isCommandMode && this.commandModeEnabled);
83
+ this.commandMode.set(
84
+ this.isCommandMode && this.commandModeEnabled && !!this.libroService.focus,
85
+ );
77
86
  });
78
87
  }
79
88
  };