@declarion/react 0.52.0 → 0.53.0
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-lib/{DraggableChildrenTable-CJCjc_cd.js → DraggableChildrenTable-BQZTvZaU.js} +35 -35
- package/dist-lib/{Grid-DUjbQg3r.js → Grid-B9Tiytbd.js} +28 -28
- package/dist-lib/{LayoutRenderer-DbdxC-Bq.js → LayoutRenderer-D_v9OD_A.js} +920 -922
- package/dist-lib/{ListCardsBody-C8ofksQb.js → ListCardsBody-dRnXsQ7A.js} +14 -14
- package/dist-lib/{MarkdownRenderer-B9_5fwuE.js → MarkdownRenderer-BCyrsLrd.js} +10 -10
- package/dist-lib/{record-documents-key-8fdm7C10.js → RecordIdBadge-CGxPR-8q.js} +1 -4
- package/dist-lib/{RefreshControl-C-8UCyau.js → RefreshControl-CV8nGACW.js} +120 -122
- package/dist-lib/{SmartDetailPage.impl-DWjNQ052.js → SmartDetailPage.impl-DWprVNMb.js} +376 -377
- package/dist-lib/{SmartListPage.impl-yKBK7a8b.js → SmartListPage.impl-BwWURGwa.js} +1098 -1099
- package/dist-lib/{SmartRecordListPage.impl-DRpU_DOC.js → SmartRecordListPage.impl-BKKBShAg.js} +183 -183
- package/dist-lib/{SortHeaderMenu-CbihbEGd.js → SortHeaderMenu-pgi4sxMs.js} +1 -1
- package/dist-lib/{action-dispatch-C28UhXXA.js → action-dispatch-DlHTYag7.js} +382 -382
- package/dist-lib/api/events.d.ts +27 -5
- package/dist-lib/{cardProjection-Bp_ZPLUE.js → cardProjection-C7Orz841.js} +146 -204
- package/dist-lib/components/pages/DocumentsMenu.d.ts +1 -1
- package/dist-lib/components/pages/RecordDocumentsPanel.d.ts +2 -2
- package/dist-lib/components/pages/list/useListQuery.d.ts +6 -1
- package/dist-lib/components/shared/RefreshControl.d.ts +7 -1
- package/dist-lib/components/shared/useOwnRefresh.d.ts +9 -0
- package/dist-lib/{field-classification-CeYJlsNq.js → field-classification-EY8CFF3P.js} +301 -320
- package/dist-lib/{format-count-C3N-WxEy.js → format-count-BHkaDr9V.js} +245 -245
- package/dist-lib/hooks/useMutations.d.ts +1 -1
- package/dist-lib/hooks/useSSE.d.ts +24 -4
- package/dist-lib/index.js +1541 -1832
- package/dist-lib/lib/document-templates.d.ts +1 -1
- package/dist-lib/lib/realtime-reconcile.d.ts +43 -0
- package/dist-lib/{peekDraftStore-D3sowXga.js → peekDraftStore-1pIajluX.js} +36 -36
- package/dist-lib/{registry-p6CejATt.js → registry-C5ug25M8.js} +507 -507
- package/dist-lib/stores/realtime.d.ts +20 -0
- package/dist-lib/testing.js +35 -35
- package/dist-lib/{useCurrentScreen-74x5yJNb.js → useCurrentScreen-BdnZq8vZ.js} +2504 -1557
- package/dist-lib/{useListQuery-D75bgLLz.js → useListQuery-BxgrPZIB.js} +13 -10
- package/dist-lib/{useProperties-C5fZp12D.js → useProperties-Bhi9Wn5O.js} +25 -25
- package/dist-lib/useTabSearchMirror-Dl5x0xKu.js +177 -0
- package/dist-lib/{value-DKekzcjz.js → value-Rp-5W3o8.js} +25 -25
- package/package.json +7 -7
- package/dist-lib/useTabSearchMirror-D_wzoYRz.js +0 -406
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { _ as i, y as a } from "./useTabSearchMirror-D_wzoYRz.js";
|
|
1
|
+
import { C as e, St as t, T as n, bt as r, xt as i } from "./useCurrentScreen-BdnZq8vZ.js";
|
|
2
|
+
import { g as a } from "./field-classification-EY8CFF3P.js";
|
|
4
3
|
import { useCallback as o, useEffect as s, useMemo as c, useState as l } from "react";
|
|
5
4
|
import { useQueryClient as u } from "@tanstack/react-query";
|
|
6
5
|
//#region src/components/pages/list/useListQuery.ts
|
|
@@ -27,8 +26,8 @@ function f(s) {
|
|
|
27
26
|
screen: m?.fixed_filters ? h : void 0,
|
|
28
27
|
preview: !0,
|
|
29
28
|
limit: _
|
|
30
|
-
}, A = d?.list_pagination === "cursor", j = t(f, O, !A), M =
|
|
31
|
-
r(
|
|
29
|
+
}, A = d?.list_pagination === "cursor", j = t(f, O, !A), M = i(f, O, T && !A), N = n(f, k, A);
|
|
30
|
+
a(r(f, O), !A), a(e(f, k), A);
|
|
32
31
|
let P = A ? N.isLoading : j.isLoading, F = c(() => A ? N.rows : j.data?.data ?? [], [
|
|
33
32
|
A,
|
|
34
33
|
N.rows,
|
|
@@ -39,15 +38,19 @@ function f(s) {
|
|
|
39
38
|
A,
|
|
40
39
|
I,
|
|
41
40
|
_
|
|
42
|
-
]), R = p(P, E), z = o(() => {
|
|
43
|
-
f && l.cancelQueries({
|
|
41
|
+
]), R = p(P, E), z = A ? e(f, k) : r(f, O), B = o(async () => {
|
|
42
|
+
f && (await l.cancelQueries({
|
|
43
|
+
queryKey: z,
|
|
44
|
+
exact: !0
|
|
45
|
+
}), await (A ? N.refetch() : j.refetch()));
|
|
44
46
|
}, [
|
|
45
47
|
f,
|
|
46
48
|
l,
|
|
49
|
+
z,
|
|
47
50
|
A,
|
|
48
51
|
N,
|
|
49
52
|
j
|
|
50
|
-
]),
|
|
53
|
+
]), V = o(() => {
|
|
51
54
|
N.fetchNextPage();
|
|
52
55
|
}, [N]);
|
|
53
56
|
return {
|
|
@@ -59,7 +62,7 @@ function f(s) {
|
|
|
59
62
|
isError: A ? N.isError : j.isError,
|
|
60
63
|
error: A ? N.error : j.error,
|
|
61
64
|
isLoadingStale: R,
|
|
62
|
-
retry:
|
|
65
|
+
retry: B,
|
|
63
66
|
countTotal: I,
|
|
64
67
|
countStrategy: A ? N.countMode : M.data?.meta?.count_mode,
|
|
65
68
|
countLoading: A ? N.isLoading : M.isLoading,
|
|
@@ -67,7 +70,7 @@ function f(s) {
|
|
|
67
70
|
totalPages: L,
|
|
68
71
|
hasMorePages: A ? N.hasMore : j.data?.meta?.has_more ?? (L !== void 0 && g < L),
|
|
69
72
|
isCursor: A,
|
|
70
|
-
fetchNextPage:
|
|
73
|
+
fetchNextPage: V,
|
|
71
74
|
isFetchingNextPage: N.isFetchingNextPage
|
|
72
75
|
};
|
|
73
76
|
}
|
|
@@ -1,39 +1,39 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Mt as e, Yt as t } from "./useCurrentScreen-BdnZq8vZ.js";
|
|
2
2
|
import { useMutation as n, useQueryClient as r } from "@tanstack/react-query";
|
|
3
3
|
//#region src/api/status.ts
|
|
4
|
-
async function i(
|
|
4
|
+
async function i(e, n, r, i, a) {
|
|
5
5
|
let o = {
|
|
6
6
|
status_group_code: r,
|
|
7
7
|
status_code: i
|
|
8
8
|
};
|
|
9
9
|
a != null && (o.note = a);
|
|
10
|
-
let s = (await
|
|
10
|
+
let s = (await t(`${e}.__update`, {
|
|
11
11
|
object_ids: [n],
|
|
12
|
-
entity:
|
|
12
|
+
entity: e,
|
|
13
13
|
fields: { $statuses: [o] }
|
|
14
14
|
})).result?.rows?.[0]?.$statuses ?? [];
|
|
15
15
|
return s.find((e) => e.group_code === r) ?? s[0];
|
|
16
16
|
}
|
|
17
17
|
//#endregion
|
|
18
18
|
//#region src/hooks/useObjectStatus.ts
|
|
19
|
-
function a(
|
|
19
|
+
function a(t, a) {
|
|
20
20
|
let o = r();
|
|
21
21
|
return n({
|
|
22
|
-
mutationFn: ({ groupCode:
|
|
22
|
+
mutationFn: ({ groupCode: e, statusCode: n, note: r }) => i(t, a, e, n, r),
|
|
23
23
|
onSuccess: () => {
|
|
24
|
-
o.invalidateQueries({ queryKey: ["entity-item",
|
|
24
|
+
o.invalidateQueries({ queryKey: ["entity-item", t] });
|
|
25
25
|
},
|
|
26
|
-
onError: (
|
|
27
|
-
|
|
26
|
+
onError: (t) => {
|
|
27
|
+
e.error(t.message);
|
|
28
28
|
}
|
|
29
29
|
});
|
|
30
30
|
}
|
|
31
31
|
//#endregion
|
|
32
32
|
//#region src/api/properties.ts
|
|
33
|
-
async function o(
|
|
34
|
-
let a = (await
|
|
33
|
+
async function o(e, n, r, i) {
|
|
34
|
+
let a = (await t(`${e}.__update`, {
|
|
35
35
|
object_ids: [n],
|
|
36
|
-
entity:
|
|
36
|
+
entity: e,
|
|
37
37
|
fields: { $properties: [{
|
|
38
38
|
property_code: r,
|
|
39
39
|
value: i
|
|
@@ -41,10 +41,10 @@ async function o(t, n, r, i) {
|
|
|
41
41
|
})).result?.rows?.[0]?.$properties ?? [];
|
|
42
42
|
return a.find((e) => e.property_code === r) ?? a[0];
|
|
43
43
|
}
|
|
44
|
-
async function s(
|
|
45
|
-
await
|
|
44
|
+
async function s(e, n, r) {
|
|
45
|
+
await t(`${e}.__update`, {
|
|
46
46
|
object_ids: [n],
|
|
47
|
-
entity:
|
|
47
|
+
entity: e,
|
|
48
48
|
fields: { $properties: [{
|
|
49
49
|
property_code: r,
|
|
50
50
|
value: null
|
|
@@ -53,27 +53,27 @@ async function s(t, n, r) {
|
|
|
53
53
|
}
|
|
54
54
|
//#endregion
|
|
55
55
|
//#region src/hooks/useProperties.ts
|
|
56
|
-
function c(
|
|
56
|
+
function c(t, i) {
|
|
57
57
|
let a = r();
|
|
58
58
|
return n({
|
|
59
|
-
mutationFn: ({ propertyCode:
|
|
59
|
+
mutationFn: ({ propertyCode: e, value: n }) => o(t, i, e, n),
|
|
60
60
|
onSuccess: () => {
|
|
61
|
-
a.invalidateQueries({ queryKey: ["entity-item",
|
|
61
|
+
a.invalidateQueries({ queryKey: ["entity-item", t] });
|
|
62
62
|
},
|
|
63
|
-
onError: (
|
|
64
|
-
|
|
63
|
+
onError: (t) => {
|
|
64
|
+
e.error(t.message);
|
|
65
65
|
}
|
|
66
66
|
});
|
|
67
67
|
}
|
|
68
|
-
function l(
|
|
68
|
+
function l(t, i) {
|
|
69
69
|
let a = r();
|
|
70
70
|
return n({
|
|
71
|
-
mutationFn: (
|
|
71
|
+
mutationFn: (e) => s(t, i, e),
|
|
72
72
|
onSuccess: () => {
|
|
73
|
-
a.invalidateQueries({ queryKey: ["entity-item",
|
|
73
|
+
a.invalidateQueries({ queryKey: ["entity-item", t] });
|
|
74
74
|
},
|
|
75
|
-
onError: (
|
|
76
|
-
|
|
75
|
+
onError: (t) => {
|
|
76
|
+
e.error(t.message);
|
|
77
77
|
}
|
|
78
78
|
});
|
|
79
79
|
}
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
import { Ht as e, Zn as t, lr as n } from "./useCurrentScreen-BdnZq8vZ.js";
|
|
2
|
+
import { M as r } from "./field-classification-EY8CFF3P.js";
|
|
3
|
+
import { useEffect as i, useLayoutEffect as a } from "react";
|
|
4
|
+
import { useSearchParams as o } from "react-router";
|
|
5
|
+
//#region src/lib/filters.ts
|
|
6
|
+
var s = /* @__PURE__ */ new Set([
|
|
7
|
+
"is_empty",
|
|
8
|
+
"is_not_empty",
|
|
9
|
+
"today",
|
|
10
|
+
"this_week",
|
|
11
|
+
"this_month",
|
|
12
|
+
"last_7_days",
|
|
13
|
+
"last_30_days",
|
|
14
|
+
"last_hour",
|
|
15
|
+
"last_24_hours"
|
|
16
|
+
]), c = /* @__PURE__ */ new Set(["in", "not_in"]), l = {
|
|
17
|
+
eq: "is",
|
|
18
|
+
not_eq: "is not",
|
|
19
|
+
gt: ">",
|
|
20
|
+
gte: ">=",
|
|
21
|
+
lt: "<",
|
|
22
|
+
lte: "<=",
|
|
23
|
+
in: "is any of",
|
|
24
|
+
not_in: "is none of",
|
|
25
|
+
between: "between",
|
|
26
|
+
contains: "contains",
|
|
27
|
+
starts_with: "starts with",
|
|
28
|
+
is_empty: "is empty",
|
|
29
|
+
is_not_empty: "is not empty",
|
|
30
|
+
today: "today",
|
|
31
|
+
this_week: "this week",
|
|
32
|
+
this_month: "this month",
|
|
33
|
+
last_7_days: "last 7 days",
|
|
34
|
+
last_30_days: "last 30 days",
|
|
35
|
+
last_hour: "last hour",
|
|
36
|
+
last_24_hours: "last 24 hours"
|
|
37
|
+
};
|
|
38
|
+
function u(e) {
|
|
39
|
+
let t = e.get("filters");
|
|
40
|
+
if (t == null || t === "") return {
|
|
41
|
+
filters: [],
|
|
42
|
+
error: null
|
|
43
|
+
};
|
|
44
|
+
try {
|
|
45
|
+
return {
|
|
46
|
+
filters: d(e),
|
|
47
|
+
error: null
|
|
48
|
+
};
|
|
49
|
+
} catch (e) {
|
|
50
|
+
return {
|
|
51
|
+
filters: [],
|
|
52
|
+
error: e instanceof Error ? e.message : "The filters URL value is invalid."
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
function d(e) {
|
|
57
|
+
let t = e.get("filters");
|
|
58
|
+
if (t == null || t === "") return [];
|
|
59
|
+
let n;
|
|
60
|
+
try {
|
|
61
|
+
n = JSON.parse(t);
|
|
62
|
+
} catch {
|
|
63
|
+
throw Error("The filters URL value is not valid JSON.");
|
|
64
|
+
}
|
|
65
|
+
if (!Array.isArray(n) || !n.every(y)) throw Error("The filters URL value is not a valid filter tree.");
|
|
66
|
+
return n;
|
|
67
|
+
}
|
|
68
|
+
function f(e, t) {
|
|
69
|
+
e.length === 0 ? t.delete("filters") : t.set("filters", JSON.stringify(e));
|
|
70
|
+
}
|
|
71
|
+
function p(e) {
|
|
72
|
+
return e.some((e) => !e || typeof e != "object" ? !1 : e.or != null || e.and != null && p(e.and));
|
|
73
|
+
}
|
|
74
|
+
function m(e) {
|
|
75
|
+
let t = [];
|
|
76
|
+
for (let n of e) !n || typeof n != "object" || (n.field && n.op && t.push(n), n.or && t.push(...m(n.or)), n.and && t.push(...m(n.and)));
|
|
77
|
+
return t;
|
|
78
|
+
}
|
|
79
|
+
function h(e) {
|
|
80
|
+
return m(e).length;
|
|
81
|
+
}
|
|
82
|
+
function g(e, t) {
|
|
83
|
+
if (!e.field || !e.op) return "";
|
|
84
|
+
let r = l[e.op] || e.op;
|
|
85
|
+
if (s.has(e.op)) return `${r}`;
|
|
86
|
+
let i = e.field, a = (e) => {
|
|
87
|
+
if (t) {
|
|
88
|
+
let n = t(i, e);
|
|
89
|
+
return n.label != null && (n.status === "special" || n.status === "resolved") ? n.label : n.raw;
|
|
90
|
+
}
|
|
91
|
+
return n(e);
|
|
92
|
+
};
|
|
93
|
+
return `${r} ${Array.isArray(e.value) ? e.value.map(a).join(", ") : a(e.value)}`;
|
|
94
|
+
}
|
|
95
|
+
function _(e, t) {
|
|
96
|
+
return {
|
|
97
|
+
field: e,
|
|
98
|
+
op: "eq",
|
|
99
|
+
value: t
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
function v(e, t) {
|
|
103
|
+
let n = [];
|
|
104
|
+
for (let r of e) if (!(!r || typeof r != "object") && r.field !== t) {
|
|
105
|
+
if (r.or) {
|
|
106
|
+
let e = v(r.or, t);
|
|
107
|
+
e.length > 0 && n.push({
|
|
108
|
+
...r,
|
|
109
|
+
or: e
|
|
110
|
+
});
|
|
111
|
+
continue;
|
|
112
|
+
}
|
|
113
|
+
if (r.and) {
|
|
114
|
+
let e = v(r.and, t);
|
|
115
|
+
e.length > 0 && n.push({
|
|
116
|
+
...r,
|
|
117
|
+
and: e
|
|
118
|
+
});
|
|
119
|
+
continue;
|
|
120
|
+
}
|
|
121
|
+
n.push(r);
|
|
122
|
+
}
|
|
123
|
+
return n;
|
|
124
|
+
}
|
|
125
|
+
function y(e) {
|
|
126
|
+
if (typeof e != "object" || !e || Array.isArray(e)) return !1;
|
|
127
|
+
let t = e, n = Object.prototype.hasOwnProperty.call(t, "field"), r = Object.prototype.hasOwnProperty.call(t, "op"), i = Object.prototype.hasOwnProperty.call(t, "value"), a = Object.prototype.hasOwnProperty.call(t, "or"), o = Object.prototype.hasOwnProperty.call(t, "and");
|
|
128
|
+
if (a && o) return !1;
|
|
129
|
+
if (a || o) {
|
|
130
|
+
if (n || r || i) return !1;
|
|
131
|
+
let e = a ? t.or : t.and;
|
|
132
|
+
return Array.isArray(e) && e.length > 0 && e.every(y);
|
|
133
|
+
}
|
|
134
|
+
if (!(n && r && typeof t.field == "string" && t.field.length > 0 && typeof t.op == "string" && b.has(t.op))) return !1;
|
|
135
|
+
let c = t.op;
|
|
136
|
+
return s.has(c) ? !i || t.value === null : i && t.value !== null;
|
|
137
|
+
}
|
|
138
|
+
var b = new Set(Object.keys(l));
|
|
139
|
+
//#endregion
|
|
140
|
+
//#region src/hooks/useRegisterScreenTab.ts
|
|
141
|
+
function x(t, n, a, o) {
|
|
142
|
+
let s = e();
|
|
143
|
+
i(() => {
|
|
144
|
+
!t || s.enabled || r.getState().openTab({
|
|
145
|
+
pathname: t,
|
|
146
|
+
search: o,
|
|
147
|
+
title: n,
|
|
148
|
+
icon: a,
|
|
149
|
+
closable: !0
|
|
150
|
+
});
|
|
151
|
+
}, [
|
|
152
|
+
t,
|
|
153
|
+
n,
|
|
154
|
+
a,
|
|
155
|
+
s.enabled
|
|
156
|
+
]);
|
|
157
|
+
}
|
|
158
|
+
function S(e, n, r) {
|
|
159
|
+
let i = e?.route, a = n ? t(e?.display?.name) || t(n.display.name_plural) : "", o = e?.display?.icon || n?.display.icon;
|
|
160
|
+
x(n ? i : void 0, a, o, r);
|
|
161
|
+
}
|
|
162
|
+
//#endregion
|
|
163
|
+
//#region src/hooks/useTabSearchMirror.ts
|
|
164
|
+
function C(t) {
|
|
165
|
+
let n = e(), [i] = o();
|
|
166
|
+
a(() => {
|
|
167
|
+
if (!t || n.enabled) return;
|
|
168
|
+
let e = r.getState(), a = e.findTabByPathname(t);
|
|
169
|
+
a && e.updateTabSearch(a.id, i.toString());
|
|
170
|
+
}, [
|
|
171
|
+
i,
|
|
172
|
+
t,
|
|
173
|
+
n.enabled
|
|
174
|
+
]);
|
|
175
|
+
}
|
|
176
|
+
//#endregion
|
|
177
|
+
export { s as a, _ as c, p as d, u as f, f as h, c as i, m as l, v as m, S as n, l as o, d as p, x as r, h as s, C as t, g as u };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { En as e, On as t, Tn as n, zn as r } from "./useCurrentScreen-BdnZq8vZ.js";
|
|
2
2
|
import { useCallback as i, useEffect as a, useRef as o, useState as s } from "react";
|
|
3
3
|
//#region src/embed/file-src.ts
|
|
4
4
|
var c = "/api/files";
|
|
@@ -29,17 +29,17 @@ function f(e, t) {
|
|
|
29
29
|
function p(e) {
|
|
30
30
|
return `${e}${e.includes("?") ? "&" : "?"}disposition=attachment`;
|
|
31
31
|
}
|
|
32
|
-
async function m(
|
|
33
|
-
let a = await
|
|
32
|
+
async function m(t, i) {
|
|
33
|
+
let a = await n(), o = await fetch(t, f(a, i));
|
|
34
34
|
if (o.status !== 401) return o;
|
|
35
|
-
await
|
|
36
|
-
let s = await
|
|
37
|
-
return fetch(
|
|
38
|
-
}
|
|
39
|
-
async function h(e,
|
|
40
|
-
if (!
|
|
41
|
-
let i = await m(u(e,
|
|
42
|
-
if (i.status === 202 && typeof
|
|
35
|
+
await r(o), e();
|
|
36
|
+
let s = await n();
|
|
37
|
+
return fetch(t, f(s, i));
|
|
38
|
+
}
|
|
39
|
+
async function h(e, n, r) {
|
|
40
|
+
if (!t()) throw Error("resolveEmbedFileSrc called outside embed token mode");
|
|
41
|
+
let i = await m(u(e, n), r);
|
|
42
|
+
if (i.status === 202 && typeof n == "object") throw new d(e, n.derivation);
|
|
43
43
|
if (!i.ok) throw Error(`embed file url request failed: ${i.status} ${i.statusText}`);
|
|
44
44
|
let a = await i.json();
|
|
45
45
|
if (!l(a)) throw Error("embed file url response is malformed");
|
|
@@ -48,7 +48,7 @@ async function h(e, t, n) {
|
|
|
48
48
|
kind: "direct"
|
|
49
49
|
};
|
|
50
50
|
if (!a.url.startsWith("/api/files/")) throw Error(`embed file proxy: refusing non-files-route URL ${JSON.stringify(a.url)}`);
|
|
51
|
-
let o = await m(
|
|
51
|
+
let o = await m(n === "download" ? p(a.url) : a.url, r);
|
|
52
52
|
if (!o.ok) throw Error(`embed file proxy fetch failed: ${o.status} ${o.statusText}`);
|
|
53
53
|
let s = await o.blob();
|
|
54
54
|
return {
|
|
@@ -148,25 +148,25 @@ function A(e) {
|
|
|
148
148
|
function j(e) {
|
|
149
149
|
return e.startsWith("derivation:") ? { derivation: e.slice(11) } : e === "download" ? "download" : "preview";
|
|
150
150
|
}
|
|
151
|
-
function M(e,
|
|
152
|
-
let i = A(
|
|
151
|
+
function M(e, n, r) {
|
|
152
|
+
let i = A(n), [o, c] = s(() => t() ? void 0 : r);
|
|
153
153
|
return a(() => {
|
|
154
|
-
|
|
155
|
-
}, [
|
|
156
|
-
if (!
|
|
154
|
+
t() || c(r);
|
|
155
|
+
}, [r]), a(() => {
|
|
156
|
+
if (!t()) return;
|
|
157
157
|
if (!e) {
|
|
158
158
|
c(void 0);
|
|
159
159
|
return;
|
|
160
160
|
}
|
|
161
|
-
let
|
|
161
|
+
let n = null, r = !1, a = new AbortController();
|
|
162
162
|
return c(void 0), h(e, j(i), a.signal).then((e) => {
|
|
163
|
-
if (
|
|
163
|
+
if (r) {
|
|
164
164
|
e.kind === "blob" && URL.revokeObjectURL(e.url);
|
|
165
165
|
return;
|
|
166
166
|
}
|
|
167
|
-
e.kind === "blob" && (
|
|
167
|
+
e.kind === "blob" && (n = e.url), c(e.url);
|
|
168
168
|
}).catch((e) => {
|
|
169
|
-
if (!
|
|
169
|
+
if (!r) {
|
|
170
170
|
if (e instanceof d) {
|
|
171
171
|
c(void 0);
|
|
172
172
|
return;
|
|
@@ -174,7 +174,7 @@ function M(e, t, n) {
|
|
|
174
174
|
e instanceof DOMException && e.name === "AbortError" || (console.error("[declarion-embed] file src resolution failed:", e), c(void 0));
|
|
175
175
|
}
|
|
176
176
|
}), () => {
|
|
177
|
-
|
|
177
|
+
r = !0, a.abort(), n && URL.revokeObjectURL(n);
|
|
178
178
|
};
|
|
179
179
|
}, [e, i]), o;
|
|
180
180
|
}
|
|
@@ -183,12 +183,12 @@ function N() {
|
|
|
183
183
|
return a(() => () => {
|
|
184
184
|
for (let t of e.current) URL.revokeObjectURL(t);
|
|
185
185
|
e.current = [];
|
|
186
|
-
}, []), { open: i((
|
|
187
|
-
if (!
|
|
186
|
+
}, []), { open: i((n, r, i) => {
|
|
187
|
+
if (!t()) {
|
|
188
188
|
i && window.open(i, "_blank", "noopener");
|
|
189
189
|
return;
|
|
190
190
|
}
|
|
191
|
-
|
|
191
|
+
n && h(n, r).then((t) => {
|
|
192
192
|
t.kind === "blob" && e.current.push(t.url), window.open(t.url, "_blank", "noopener");
|
|
193
193
|
}).catch((e) => {
|
|
194
194
|
e instanceof d || console.error("[declarion-embed] file open failed:", e);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@declarion/react",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.53.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"description": "React SDK for Declarion, the schema-driven business apps platform.",
|
|
@@ -65,17 +65,17 @@
|
|
|
65
65
|
"@radix-ui/react-select": "^2.3.7",
|
|
66
66
|
"@radix-ui/react-separator": "^1.1.15",
|
|
67
67
|
"@radix-ui/react-slot": "^1.3.3",
|
|
68
|
-
"@tanstack/react-query": "^5.102.
|
|
69
|
-
"@tanstack/react-table": "^9.
|
|
68
|
+
"@tanstack/react-query": "^5.102.8",
|
|
69
|
+
"@tanstack/react-table": "^9.2.4",
|
|
70
70
|
"@tanstack/react-virtual": "^3.14.10",
|
|
71
71
|
"class-variance-authority": "^0.7.1",
|
|
72
72
|
"clsx": "^2.1.1",
|
|
73
73
|
"date-fns": "^4.4.0",
|
|
74
|
-
"lucide-react": "^1.
|
|
74
|
+
"lucide-react": "^1.35.0",
|
|
75
75
|
"mdast-util-to-string": "^4.0.0",
|
|
76
76
|
"monaco-editor": "^0.56.0",
|
|
77
77
|
"react-markdown": "^10.1.0",
|
|
78
|
-
"react-router": "^8.3.
|
|
78
|
+
"react-router": "^8.3.1",
|
|
79
79
|
"react-textarea-autosize": "^8.5.9",
|
|
80
80
|
"recharts": "^3.10.1",
|
|
81
81
|
"remark-breaks": "^4.0.0",
|
|
@@ -93,11 +93,11 @@
|
|
|
93
93
|
"@tailwindcss/vite": "^4.3.3",
|
|
94
94
|
"@testing-library/dom": "^10.4.1",
|
|
95
95
|
"@testing-library/jest-dom": "^7.0.1",
|
|
96
|
-
"@testing-library/react": "^16.3.
|
|
96
|
+
"@testing-library/react": "^16.3.3",
|
|
97
97
|
"@testing-library/user-event": "^14.6.6",
|
|
98
98
|
"@types/react": "^19.2.18",
|
|
99
99
|
"@types/react-dom": "^19.2.5",
|
|
100
|
-
"@vitejs/plugin-react": "^6.1.
|
|
100
|
+
"@vitejs/plugin-react": "^6.1.1",
|
|
101
101
|
"@vitest/coverage-v8": "^4.1.11",
|
|
102
102
|
"axe-core": "^4.13.0",
|
|
103
103
|
"eslint": "^10.9.1",
|