sheet-widget 0.1.1 → 0.1.3
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/dist/index.d.mts +16 -1
- package/dist/index.d.ts +16 -1
- package/dist/index.js +39 -2
- package/dist/index.mjs +36 -1
- package/package.json +2 -2
package/dist/index.d.mts
CHANGED
|
@@ -3,4 +3,19 @@ declare function WidgetNode({ id, data }: {
|
|
|
3
3
|
data: any;
|
|
4
4
|
}): any;
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
declare class WidgetNodeErrorBoundary {
|
|
7
|
+
static getDerivedStateFromError(error: any): {
|
|
8
|
+
hasError: boolean;
|
|
9
|
+
error: any;
|
|
10
|
+
};
|
|
11
|
+
constructor(props: any);
|
|
12
|
+
state: {
|
|
13
|
+
hasError: boolean;
|
|
14
|
+
error: any;
|
|
15
|
+
};
|
|
16
|
+
componentDidCatch(error: any, errorInfo: any): void;
|
|
17
|
+
render(): any;
|
|
18
|
+
}
|
|
19
|
+
declare function WidgetNodeSafe(props: any): any;
|
|
20
|
+
|
|
21
|
+
export { WidgetNode, WidgetNodeErrorBoundary, WidgetNodeSafe };
|
package/dist/index.d.ts
CHANGED
|
@@ -3,4 +3,19 @@ declare function WidgetNode({ id, data }: {
|
|
|
3
3
|
data: any;
|
|
4
4
|
}): any;
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
declare class WidgetNodeErrorBoundary {
|
|
7
|
+
static getDerivedStateFromError(error: any): {
|
|
8
|
+
hasError: boolean;
|
|
9
|
+
error: any;
|
|
10
|
+
};
|
|
11
|
+
constructor(props: any);
|
|
12
|
+
state: {
|
|
13
|
+
hasError: boolean;
|
|
14
|
+
error: any;
|
|
15
|
+
};
|
|
16
|
+
componentDidCatch(error: any, errorInfo: any): void;
|
|
17
|
+
render(): any;
|
|
18
|
+
}
|
|
19
|
+
declare function WidgetNodeSafe(props: any): any;
|
|
20
|
+
|
|
21
|
+
export { WidgetNode, WidgetNodeErrorBoundary, WidgetNodeSafe };
|
package/dist/index.js
CHANGED
|
@@ -8121,7 +8121,9 @@ var require_tiny_emitter = __commonJS({
|
|
|
8121
8121
|
// src/index.js
|
|
8122
8122
|
var index_exports = {};
|
|
8123
8123
|
__export(index_exports, {
|
|
8124
|
-
WidgetNode: () => WidgetNode_default
|
|
8124
|
+
WidgetNode: () => WidgetNode_default,
|
|
8125
|
+
WidgetNodeErrorBoundary: () => WidgetNodeErrorBoundary,
|
|
8126
|
+
WidgetNodeSafe: () => WidgetNodeSafe
|
|
8125
8127
|
});
|
|
8126
8128
|
module.exports = __toCommonJS(index_exports);
|
|
8127
8129
|
var import_handsontable_full_min = require("handsontable/dist/handsontable.full.min.css");
|
|
@@ -37359,9 +37361,44 @@ function WidgetNode({ id, data }) {
|
|
|
37359
37361
|
] });
|
|
37360
37362
|
}
|
|
37361
37363
|
var WidgetNode_default = WidgetNode;
|
|
37364
|
+
|
|
37365
|
+
// src/WidgetNodeSafe.js
|
|
37366
|
+
var import_react5 = __toESM(require("react"));
|
|
37367
|
+
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
37368
|
+
var WidgetNodeErrorBoundary = class extends import_react5.default.Component {
|
|
37369
|
+
constructor(props) {
|
|
37370
|
+
super(props);
|
|
37371
|
+
this.state = { hasError: false, error: null };
|
|
37372
|
+
}
|
|
37373
|
+
static getDerivedStateFromError(error) {
|
|
37374
|
+
return { hasError: true, error };
|
|
37375
|
+
}
|
|
37376
|
+
componentDidCatch(error, errorInfo) {
|
|
37377
|
+
if (this.props.onError) {
|
|
37378
|
+
this.props.onError(error, errorInfo);
|
|
37379
|
+
return;
|
|
37380
|
+
}
|
|
37381
|
+
console.warn("WidgetNode crashed and was caught by ErrorBoundary.", error, errorInfo);
|
|
37382
|
+
}
|
|
37383
|
+
render() {
|
|
37384
|
+
if (this.state.hasError) {
|
|
37385
|
+
if (this.props.fallback) {
|
|
37386
|
+
return this.props.fallback;
|
|
37387
|
+
}
|
|
37388
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { style: { padding: "12px", border: "1px solid #fca5a5", borderRadius: "8px" }, children: [
|
|
37389
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("strong", { children: "\u041E\u0448\u0438\u0431\u043A\u0430 \u0432\u0438\u0434\u0436\u0435\u0442\u0430." }),
|
|
37390
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { style: { marginTop: "6px", fontSize: "12px", color: "#991b1b" }, children: "\u041F\u0440\u043E\u0432\u0435\u0440\u044C\u0442\u0435, \u0447\u0442\u043E WidgetNode \u0440\u0435\u043D\u0434\u0435\u0440\u0438\u0442\u0441\u044F \u0432\u043D\u0443\u0442\u0440\u0438 ReactFlowProvider." })
|
|
37391
|
+
] });
|
|
37392
|
+
}
|
|
37393
|
+
return this.props.children;
|
|
37394
|
+
}
|
|
37395
|
+
};
|
|
37396
|
+
var WidgetNodeSafe = (props) => /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(WidgetNodeErrorBoundary, { children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(WidgetNode_default, { ...props }) });
|
|
37362
37397
|
// Annotate the CommonJS export names for ESM import in node:
|
|
37363
37398
|
0 && (module.exports = {
|
|
37364
|
-
WidgetNode
|
|
37399
|
+
WidgetNode,
|
|
37400
|
+
WidgetNodeErrorBoundary,
|
|
37401
|
+
WidgetNodeSafe
|
|
37365
37402
|
});
|
|
37366
37403
|
/*! Bundled license information:
|
|
37367
37404
|
|
package/dist/index.mjs
CHANGED
|
@@ -37353,8 +37353,43 @@ function WidgetNode({ id, data }) {
|
|
|
37353
37353
|
] });
|
|
37354
37354
|
}
|
|
37355
37355
|
var WidgetNode_default = WidgetNode;
|
|
37356
|
+
|
|
37357
|
+
// src/WidgetNodeSafe.js
|
|
37358
|
+
import React3 from "react";
|
|
37359
|
+
import { jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
37360
|
+
var WidgetNodeErrorBoundary = class extends React3.Component {
|
|
37361
|
+
constructor(props) {
|
|
37362
|
+
super(props);
|
|
37363
|
+
this.state = { hasError: false, error: null };
|
|
37364
|
+
}
|
|
37365
|
+
static getDerivedStateFromError(error) {
|
|
37366
|
+
return { hasError: true, error };
|
|
37367
|
+
}
|
|
37368
|
+
componentDidCatch(error, errorInfo) {
|
|
37369
|
+
if (this.props.onError) {
|
|
37370
|
+
this.props.onError(error, errorInfo);
|
|
37371
|
+
return;
|
|
37372
|
+
}
|
|
37373
|
+
console.warn("WidgetNode crashed and was caught by ErrorBoundary.", error, errorInfo);
|
|
37374
|
+
}
|
|
37375
|
+
render() {
|
|
37376
|
+
if (this.state.hasError) {
|
|
37377
|
+
if (this.props.fallback) {
|
|
37378
|
+
return this.props.fallback;
|
|
37379
|
+
}
|
|
37380
|
+
return /* @__PURE__ */ jsxs3("div", { style: { padding: "12px", border: "1px solid #fca5a5", borderRadius: "8px" }, children: [
|
|
37381
|
+
/* @__PURE__ */ jsx3("strong", { children: "\u041E\u0448\u0438\u0431\u043A\u0430 \u0432\u0438\u0434\u0436\u0435\u0442\u0430." }),
|
|
37382
|
+
/* @__PURE__ */ jsx3("div", { style: { marginTop: "6px", fontSize: "12px", color: "#991b1b" }, children: "\u041F\u0440\u043E\u0432\u0435\u0440\u044C\u0442\u0435, \u0447\u0442\u043E WidgetNode \u0440\u0435\u043D\u0434\u0435\u0440\u0438\u0442\u0441\u044F \u0432\u043D\u0443\u0442\u0440\u0438 ReactFlowProvider." })
|
|
37383
|
+
] });
|
|
37384
|
+
}
|
|
37385
|
+
return this.props.children;
|
|
37386
|
+
}
|
|
37387
|
+
};
|
|
37388
|
+
var WidgetNodeSafe = (props) => /* @__PURE__ */ jsx3(WidgetNodeErrorBoundary, { children: /* @__PURE__ */ jsx3(WidgetNode_default, { ...props }) });
|
|
37356
37389
|
export {
|
|
37357
|
-
WidgetNode_default as WidgetNode
|
|
37390
|
+
WidgetNode_default as WidgetNode,
|
|
37391
|
+
WidgetNodeErrorBoundary,
|
|
37392
|
+
WidgetNodeSafe
|
|
37358
37393
|
};
|
|
37359
37394
|
/*! Bundled license information:
|
|
37360
37395
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "sheet-widget",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.3",
|
|
4
4
|
"private": false,
|
|
5
5
|
"files": ["dist"],
|
|
6
6
|
"main": "dist/index.cjs",
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"xlsx-js-style": "^1.2.0"
|
|
17
17
|
},
|
|
18
18
|
"peerDependencies": {
|
|
19
|
-
"@xyflow/react": "^12.
|
|
19
|
+
"@xyflow/react": "^12.10.0",
|
|
20
20
|
"react": "^19.2.1",
|
|
21
21
|
"react-dom": "^19.2.1"
|
|
22
22
|
},
|