jupyter-specta 0.4.0 → 0.4.2

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.
@@ -1,3 +1,4 @@
1
1
  import '@jupyterlab/logconsole';
2
2
  import '@jupyterlab/console';
3
3
  import '@jupyterlite/apputils';
4
+ import 'mock-socket';
@@ -1,3 +1,4 @@
1
1
  import '@jupyterlab/logconsole';
2
2
  import '@jupyterlab/console';
3
3
  import '@jupyterlite/apputils';
4
+ import 'mock-socket';
@@ -78,6 +78,9 @@ export class AppModel {
78
78
  switch (cellModel.type) {
79
79
  case 'code': {
80
80
  let sourceCell;
81
+ cellModel.sharedModel.transact(() => {
82
+ cellModel.clearExecution();
83
+ }, false);
81
84
  if (cellConfig.showSource) {
82
85
  sourceCell = new CodeCell({
83
86
  model: cellModel,
package/lib/tool.d.ts CHANGED
@@ -23,7 +23,7 @@ export declare function createFileBrowser(options: {
23
23
  urlFactory: ISpectaUrlFactory | null;
24
24
  }): any;
25
25
  export declare function hideAppLoadingIndicator(): void;
26
- export declare function mergeObjects(...objects: Record<string, any>[]): Record<string, any>;
26
+ export declare function mergeObjects(lowerPriority: Record<string, any>, higherPriority: Record<string, any>): Record<string, any>;
27
27
  export declare function getSpectaAssetUrl(path: string): string;
28
28
  export declare function isSpectaApp(): boolean;
29
29
  export declare function readSpectaConfig({ nbMetadata, nbPath }: {
package/lib/tool.js CHANGED
@@ -91,17 +91,31 @@ export function hideAppLoadingIndicator() {
91
91
  }, 1000);
92
92
  }
93
93
  }
94
- export function mergeObjects(...objects) {
95
- const result = {};
96
- for (const obj of objects) {
97
- for (const [key, value] of Object.entries(obj)) {
98
- if (value !== null && value !== undefined) {
99
- result[key] = value;
94
+ export function mergeObjects(lowerPriority, higherPriority) {
95
+ const result = Object.assign({}, lowerPriority);
96
+ for (const key of Object.keys(higherPriority)) {
97
+ const highVal = higherPriority[key];
98
+ const lowVal = lowerPriority[key];
99
+ // If higher is null or undefined, keep lower if it exists
100
+ if (highVal === null || highVal === undefined) {
101
+ if (lowVal !== null && lowVal !== undefined) {
102
+ result[key] = lowVal;
100
103
  }
104
+ continue;
101
105
  }
106
+ // Deep merge plain objects
107
+ if (isPlainObject(lowVal) && isPlainObject(highVal)) {
108
+ result[key] = mergeObjects(lowVal, highVal);
109
+ continue;
110
+ }
111
+ // Otherwise, higher priority wins
112
+ result[key] = highVal;
102
113
  }
103
114
  return result;
104
115
  }
116
+ function isPlainObject(value) {
117
+ return value !== null && typeof value === 'object' && !Array.isArray(value);
118
+ }
105
119
  export function getSpectaAssetUrl(path) {
106
120
  const labExtension = PageConfig.getOption('fullLabextensionsUrl');
107
121
  const url = URLExt.join(labExtension, 'jupyter-specta', 'static', path);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jupyter-specta",
3
- "version": "0.4.0",
3
+ "version": "0.4.2",
4
4
  "description": "",
5
5
  "keywords": [],
6
6
  "homepage": "https://github.com/trungleduc/specta",
@@ -88,11 +88,12 @@
88
88
  "@jupyterlab/translation-extension": "^4.5.0",
89
89
  "@jupyterlab/ui-components": "^4.5.0",
90
90
  "@jupyterlab/ui-components-extension": "^4.5.0",
91
- "@jupyterlite/application": "^0.7.0",
92
- "@jupyterlite/application-extension": "^0.7.0",
93
- "@jupyterlite/apputils": "^0.7.0",
94
- "@jupyterlite/iframe-extension": "^0.7.0",
95
- "@jupyterlite/services-extension": "^0.7.0",
91
+ "@jupyterlite/application": "^0.7.1",
92
+ "@jupyterlite/application-extension": "^0.7.1",
93
+ "@jupyterlite/apputils": "^0.7.1",
94
+ "@jupyterlite/iframe-extension": "^0.7.1",
95
+ "@jupyterlite/services-extension": "^0.7.1",
96
+ "@jupyterlite/apputils-extension": "0.7.1",
96
97
  "@lumino/algorithm": "^2.0.0",
97
98
  "@lumino/application": "^2.0.0",
98
99
  "@lumino/commands": "^2.0.0",
@@ -110,6 +111,7 @@
110
111
  "@lumino/widgets": "^2.0.0",
111
112
  "@types/reveal.js": "^5.2.0",
112
113
  "@voila-dashboards/voila": "^0.5.5",
114
+ "mock-socket": "^9.3.1",
113
115
  "react": "^18.3.0",
114
116
  "react-dom": "^18.3.0",
115
117
  "reveal.js": "^5.2.1"
package/style/base.css CHANGED
@@ -92,7 +92,7 @@
92
92
  gap: 10px;
93
93
  align-items: center;
94
94
  justify-content: space-between;
95
- padding: 0 1rem;
95
+ padding: 0;
96
96
  position: relative;
97
97
  }
98
98