@difizen/libro-sql-cell 0.3.38 → 0.3.40

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.
@@ -8,7 +8,7 @@ export interface SqlDecodedFormatter extends DefaultDecodedFormatter {
8
8
  export declare class FormatterSqlMagicContribution implements FormatterContribution<SqlDecodedFormatter> {
9
9
  formatter: string;
10
10
  formatterOptions?: object;
11
- canHandle: (libroFormatter: string) => 100 | 1;
11
+ canHandle: (libroFormatter: string) => 1 | 100;
12
12
  encode: (source: SqlDecodedFormatter) => {
13
13
  source: string;
14
14
  metadata: {
@@ -1 +1 @@
1
- {"version":3,"file":"libro-sql-cell-view.d.ts","sourceRoot":"","sources":["../src/libro-sql-cell-view.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAC/D,OAAO,KAAK,EAAa,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAEhE,OAAO,KAAK,EACV,eAAe,EAGf,SAAS,EACT,aAAa,EACd,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,WAAW,EACX,YAAY,EAEZ,+BAA+B,EAC/B,gBAAgB,EAIhB,eAAe,EAChB,MAAM,wBAAwB,CAAC;AAChC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AACzD,OAAO,EACL,QAAQ,EAQR,WAAW,EAGZ,MAAM,mBAAmB,CAAC;AAK3B,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,cAAc,CAAC;AACtB,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAC9D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AACnE,OAAO,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AAsHvD,eAAO,MAAM,YAAY,sEA0FxB,CAAC;AAEF,qBAEa,g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EAAE,oBAAoB,EACnD,WAAW,EAAE,WAAW,EACnB,gBAAgB,EAAE,gBAAgB,EACjC,iBAAiB,EAAE,iBAAiB;IAkDxD,WAAW,sBAElB;IAEF,aAAa,CAAC,GAAG,EAAE,GAAG;IAKb,YAAY,SAAU,QAAQ,KAAG,IAAI,CAY5C;IAEF,cAAc,CAAC,KAAK,EAAE,MAAM;IAInB,MAAM,IAAI,SAAS;IASnB,KAAK,WAAY,OAAO,UAU/B;IAEO,cAAc,aAGrB;IAEa,GAAG;IAqElB,KAAK,YACM,cAAc,kBAAkB,CAAC,SAAS,CAAC,oBAClC,cAAc,aAAa,KAAK,GAAG,6CAUrD;IAEF,mBAAmB,aACP,cAAc,aAAa,eACxB,MAAM,KAAK,IAAI,UA6B5B;IAEF,iBAAiB,gDAef;CACH"}
@@ -277,10 +277,14 @@ export var LibroSqlCellView = (_dec = transient(), _dec2 = view('libro-sql-cell-
277
277
  }, _callee2);
278
278
  }));
279
279
  _this.onViewResize = function (size) {
280
- // header 部分高度也放在这部分,用来撑开高度
281
- if (size.height) {
282
- _this.editorAreaHeight = size.height + 36;
280
+ // 只有在编辑器未加载或加载中时才更新 editorAreaHeight
281
+ if (_this.editorStatus === EditorStatus.NOTLOADED || _this.editorStatus === EditorStatus.LOADING) {
282
+ // header 部分高度也放在这部分,用来撑开高度
283
+ if (size.height) {
284
+ _this.editorAreaHeight = size.height + 36;
285
+ }
283
286
  }
287
+ // 编辑器已加载后,高度由 ResizeObserver 等机制自动管理
284
288
  };
285
289
  _this.focus = function (toEdit) {
286
290
  if (toEdit) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@difizen/libro-sql-cell",
3
- "version": "0.3.38",
3
+ "version": "0.3.40",
4
4
  "description": "",
5
5
  "keywords": [
6
6
  "libro",
@@ -32,10 +32,10 @@
32
32
  "src"
33
33
  ],
34
34
  "dependencies": {
35
- "@difizen/libro-code-editor": "^0.3.38",
36
- "@difizen/libro-jupyter": "^0.3.38",
37
- "@difizen/libro-rendermime": "^0.3.38",
38
- "@difizen/libro-common": "^0.3.38",
35
+ "@difizen/libro-code-editor": "^0.3.40",
36
+ "@difizen/libro-jupyter": "^0.3.40",
37
+ "@difizen/libro-rendermime": "^0.3.40",
38
+ "@difizen/libro-common": "^0.3.40",
39
39
  "@ant-design/icons": "^5.1.0",
40
40
  "@difizen/mana-app": "latest",
41
41
  "@difizen/mana-l10n": "latest"
@@ -306,7 +306,6 @@ export class LibroSqlCellView extends LibroEditableExecutableCellView {
306
306
  this.codeEditorManager.getUserEditorConfig(this.model);
307
307
  const codeHeight = countLines(this.model.value) * lineHeight!;
308
308
  const editorPadding = paddingTop + paddingBottom;
309
-
310
309
  const scrollbarHeight = 12;
311
310
 
312
311
  // TODO: 滚动条有条件显示
@@ -391,10 +390,17 @@ export class LibroSqlCellView extends LibroEditableExecutableCellView {
391
390
  }
392
391
 
393
392
  override onViewResize = (size: ViewSize): void => {
394
- // header 部分高度也放在这部分,用来撑开高度
395
- if (size.height) {
396
- this.editorAreaHeight = size.height + 36;
393
+ // 只有在编辑器未加载或加载中时才更新 editorAreaHeight
394
+ if (
395
+ this.editorStatus === EditorStatus.NOTLOADED ||
396
+ this.editorStatus === EditorStatus.LOADING
397
+ ) {
398
+ // 把 header 部分高度也放在这部分,用来撑开高度
399
+ if (size.height) {
400
+ this.editorAreaHeight = size.height + 36;
401
+ }
397
402
  }
403
+ // 编辑器已加载后,高度由 ResizeObserver 等机制自动管理
398
404
  };
399
405
 
400
406
  handleDbChange(value: string) {