@uipath/ui-widgets-validation-station 1.0.1-beta.7 → 1.0.1
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/README.md +111 -43
- package/dist/bindWcEvents.d.ts +25 -0
- package/dist/bindWcEvents.d.ts.map +1 -0
- package/dist/bindWcEvents.js +59 -0
- package/dist/bindWcEvents.js.map +1 -0
- package/dist/bucketArtifactsUtil.d.ts.map +1 -1
- package/dist/bucketArtifactsUtil.js +8 -1
- package/dist/bucketArtifactsUtil.js.map +1 -1
- package/dist/index.d.ts +9 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +7 -0
- package/dist/index.js.map +1 -1
- package/dist/loadValidationStationWc.d.ts +17 -0
- package/dist/loadValidationStationWc.d.ts.map +1 -1
- package/dist/loadValidationStationWc.js +37 -3
- package/dist/loadValidationStationWc.js.map +1 -1
- package/dist/subcomponents/CompactBusinessRules.d.ts +8 -0
- package/dist/subcomponents/CompactBusinessRules.d.ts.map +1 -0
- package/dist/subcomponents/CompactBusinessRules.js +55 -0
- package/dist/subcomponents/CompactBusinessRules.js.map +1 -0
- package/dist/subcomponents/CompactDocTypeField.d.ts +8 -0
- package/dist/subcomponents/CompactDocTypeField.d.ts.map +1 -0
- package/dist/subcomponents/CompactDocTypeField.js +42 -0
- package/dist/subcomponents/CompactDocTypeField.js.map +1 -0
- package/dist/subcomponents/CompactFieldsForm.d.ts +10 -0
- package/dist/subcomponents/CompactFieldsForm.d.ts.map +1 -0
- package/dist/subcomponents/CompactFieldsForm.js +87 -0
- package/dist/subcomponents/CompactFieldsForm.js.map +1 -0
- package/dist/subcomponents/CompactTableEditor.d.ts +11 -0
- package/dist/subcomponents/CompactTableEditor.d.ts.map +1 -0
- package/dist/subcomponents/CompactTableEditor.js +61 -0
- package/dist/subcomponents/CompactTableEditor.js.map +1 -0
- package/dist/subcomponents/DocumentViewer.d.ts +8 -0
- package/dist/subcomponents/DocumentViewer.d.ts.map +1 -0
- package/dist/subcomponents/DocumentViewer.js +52 -0
- package/dist/subcomponents/DocumentViewer.js.map +1 -0
- package/dist/subcomponents/shared.d.ts +35 -0
- package/dist/subcomponents/shared.d.ts.map +1 -0
- package/dist/subcomponents/shared.js +36 -0
- package/dist/subcomponents/shared.js.map +1 -0
- package/dist/subcomponents/types.d.ts +128 -0
- package/dist/subcomponents/types.d.ts.map +1 -0
- package/dist/subcomponents/types.js +2 -0
- package/dist/subcomponents/types.js.map +1 -0
- package/dist/subcomponents/useWcElement.d.ts +44 -0
- package/dist/subcomponents/useWcElement.d.ts.map +1 -0
- package/dist/subcomponents/useWcElement.js +40 -0
- package/dist/subcomponents/useWcElement.js.map +1 -0
- package/dist/types.d.ts +3 -3
- package/dist/types.d.ts.map +1 -1
- package/dist/useBucketArtifacts.d.ts +11 -3
- package/dist/useBucketArtifacts.d.ts.map +1 -1
- package/dist/useBucketArtifacts.js +15 -35
- package/dist/useBucketArtifacts.js.map +1 -1
- package/dist/useSubcomponentArtifacts.d.ts +44 -0
- package/dist/useSubcomponentArtifacts.d.ts.map +1 -0
- package/dist/useSubcomponentArtifacts.js +87 -0
- package/dist/useSubcomponentArtifacts.js.map +1 -0
- package/dist/useWcReady.d.ts +8 -0
- package/dist/useWcReady.d.ts.map +1 -0
- package/dist/useWcReady.js +23 -0
- package/dist/useWcReady.js.map +1 -0
- package/package.json +5 -4
package/dist/types.d.ts
CHANGED
|
@@ -20,9 +20,9 @@ export declare enum ValidationStationLanguage {
|
|
|
20
20
|
ChineseTraditional = "zh-TW"
|
|
21
21
|
}
|
|
22
22
|
export interface BucketArtifacts {
|
|
23
|
-
taxonomy:
|
|
24
|
-
extractionResult:
|
|
25
|
-
dom:
|
|
23
|
+
taxonomy: DuFramework.DocumentTaxonomy;
|
|
24
|
+
extractionResult: DuFramework.ExtractionResult;
|
|
25
|
+
dom: DuFramework.DocumentEntity;
|
|
26
26
|
text: string | undefined;
|
|
27
27
|
customizationInfo: unknown;
|
|
28
28
|
original: string | undefined;
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,sBAAsB,EACtB,yBAAyB,EACzB,8BAA8B,EAC9B,mBAAmB,EACpB,MAAM,kCAAkC,CAAC;AAC1C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,gCAAgC,CAAC;AAC7D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kDAAkD,CAAC;AACpF,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,4BAA4B,CAAC;AAE1E,YAAY,EACV,sBAAsB,EACtB,yBAAyB,EACzB,uBAAuB,EACvB,8BAA8B,EAC9B,mBAAmB,GACpB,CAAC;AAEF,oBAAY,yBAAyB;IACnC,MAAM,OAAO;IACb,OAAO,OAAO;IACd,OAAO,OAAO;IACd,aAAa,UAAU;IACvB,MAAM,OAAO;IACb,QAAQ,OAAO;IACf,MAAM,OAAO;IACb,UAAU,OAAO;IACjB,gBAAgB,UAAU;IAC1B,QAAQ,OAAO;IACf,OAAO,OAAO;IACd,OAAO,OAAO;IACd,iBAAiB,UAAU;IAC3B,kBAAkB,UAAU;CAC7B;AAED,MAAM,WAAW,eAAe;IAC9B,QAAQ,EAAE,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,sBAAsB,EACtB,yBAAyB,EACzB,8BAA8B,EAC9B,mBAAmB,EACpB,MAAM,kCAAkC,CAAC;AAC1C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,gCAAgC,CAAC;AAC7D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kDAAkD,CAAC;AACpF,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,4BAA4B,CAAC;AAE1E,YAAY,EACV,sBAAsB,EACtB,yBAAyB,EACzB,uBAAuB,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AE,CAAC,MAAM,EAAE,uBAAuB,KAAK,IAAI,CAAC;IAC7D;;;;OAIG;IACH,qBAAqB,CAAC,EAAE,CAAC,MAAM,EAAE,uBAAuB,KAAK,IAAI,CAAC;IAClE;;;;;OAKG;IACH,yBAAyB,CAAC,EAAE,CAAC,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;CAC1E"}
|
|
@@ -1,8 +1,16 @@
|
|
|
1
|
-
import type { DuFramework } from "@uipath/uipath-typescript/document-understanding";
|
|
2
1
|
import type { UiPath } from "@uipath/uipath-typescript/core";
|
|
3
|
-
import type {
|
|
2
|
+
import type { DuFramework } from "@uipath/uipath-typescript/document-understanding";
|
|
3
|
+
/**
|
|
4
|
+
* Fetches the bucket artifacts for a document-validation task.
|
|
5
|
+
*
|
|
6
|
+
* Thin wrapper over {@link useSubcomponentArtifacts}'s self-fetching mode, kept
|
|
7
|
+
* as a focused `(sdk, data, folderId)` signature for the monolithic
|
|
8
|
+
* `ValidationStation` and for composition parents that always fetch once and
|
|
9
|
+
* hand the result to several subcomponents. All fetch/cancel/error logic lives
|
|
10
|
+
* in the shared hook — this only narrows the return to `{ artifacts, error }`.
|
|
11
|
+
*/
|
|
4
12
|
export declare function useBucketArtifacts(sdk: UiPath, data: DuFramework.ContentValidationData, folderId: number | undefined): {
|
|
5
|
-
artifacts: BucketArtifacts | null;
|
|
13
|
+
artifacts: import("./types.js").BucketArtifacts | null;
|
|
6
14
|
error: string | null;
|
|
7
15
|
};
|
|
8
16
|
//# sourceMappingURL=useBucketArtifacts.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useBucketArtifacts.d.ts","sourceRoot":"","sources":["../src/useBucketArtifacts.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"useBucketArtifacts.d.ts","sourceRoot":"","sources":["../src/useBucketArtifacts.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,gCAAgC,CAAC;AAC7D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kDAAkD,CAAC;AAGpF;;;;;;;;GAQG;AACH,wBAAgB,kBAAkB,CAChC,GAAG,EAAE,MAAM,EACX,IAAI,EAAE,WAAW,CAAC,qBAAqB,EACvC,QAAQ,EAAE,MAAM,GAAG,SAAS;;;EAQ7B"}
|
|
@@ -1,39 +1,19 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import { useSubcomponentArtifacts } from "./useSubcomponentArtifacts.js";
|
|
2
|
+
/**
|
|
3
|
+
* Fetches the bucket artifacts for a document-validation task.
|
|
4
|
+
*
|
|
5
|
+
* Thin wrapper over {@link useSubcomponentArtifacts}'s self-fetching mode, kept
|
|
6
|
+
* as a focused `(sdk, data, folderId)` signature for the monolithic
|
|
7
|
+
* `ValidationStation` and for composition parents that always fetch once and
|
|
8
|
+
* hand the result to several subcomponents. All fetch/cancel/error logic lives
|
|
9
|
+
* in the shared hook — this only narrows the return to `{ artifacts, error }`.
|
|
10
|
+
*/
|
|
4
11
|
export function useBucketArtifacts(sdk, data, folderId) {
|
|
5
|
-
const
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
if (resolvedFolderId) {
|
|
11
|
-
let cancelled = false;
|
|
12
|
-
fetchBucketArtifacts(bucketServiceRef.current, data, resolvedFolderId)
|
|
13
|
-
.then((result) => {
|
|
14
|
-
if (!cancelled) {
|
|
15
|
-
setArtifacts(result);
|
|
16
|
-
setError(null);
|
|
17
|
-
}
|
|
18
|
-
})
|
|
19
|
-
.catch((er) => {
|
|
20
|
-
if (!cancelled) {
|
|
21
|
-
setArtifacts(null);
|
|
22
|
-
setError(er instanceof Error ? er.message : String(er));
|
|
23
|
-
}
|
|
24
|
-
});
|
|
25
|
-
return () => {
|
|
26
|
-
cancelled = true;
|
|
27
|
-
};
|
|
28
|
-
}
|
|
29
|
-
}, [data, resolvedFolderId]);
|
|
30
|
-
// Derive error for missing folderId at render time, not inside the effect
|
|
31
|
-
if (!resolvedFolderId) {
|
|
32
|
-
return {
|
|
33
|
-
artifacts: null,
|
|
34
|
-
error: "folderId of Storage bucket is required. Provide it as a prop or ensure data.FolderId is set.",
|
|
35
|
-
};
|
|
36
|
-
}
|
|
12
|
+
const { artifacts, error } = useSubcomponentArtifacts({
|
|
13
|
+
sdk,
|
|
14
|
+
data,
|
|
15
|
+
folderId,
|
|
16
|
+
});
|
|
37
17
|
return { artifacts, error };
|
|
38
18
|
}
|
|
39
19
|
//# sourceMappingURL=useBucketArtifacts.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useBucketArtifacts.js","sourceRoot":"","sources":["../src/useBucketArtifacts.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useBucketArtifacts.js","sourceRoot":"","sources":["../src/useBucketArtifacts.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AAEzE;;;;;;;;GAQG;AACH,MAAM,UAAU,kBAAkB,CAChC,GAAW,EACX,IAAuC,EACvC,QAA4B;IAE5B,MAAM,EAAE,SAAS,EAAE,KAAK,EAAE,GAAG,wBAAwB,CAAC;QACpD,GAAG;QACH,IAAI;QACJ,QAAQ;KACT,CAAC,CAAC;IACH,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;AAC9B,CAAC"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import type { UiPath } from "@uipath/uipath-typescript/core";
|
|
2
|
+
import type { DuFramework } from "@uipath/uipath-typescript/document-understanding";
|
|
3
|
+
import type { BucketArtifacts } from "./types.js";
|
|
4
|
+
/**
|
|
5
|
+
* Data source shared by every subcomponent wrapper. Two mutually-exclusive
|
|
6
|
+
* modes:
|
|
7
|
+
*
|
|
8
|
+
* 1. **Pre-fetched** — pass `artifacts` (and usually `documentId`). No HTTP
|
|
9
|
+
* call is made. This is the composition mode: a parent fetches once and
|
|
10
|
+
* hands the same artifacts to a linked viewer + fields-form + table-editor.
|
|
11
|
+
* 2. **Self-fetching** — pass `sdk` + `data` (+ optional `folderId`). The hook
|
|
12
|
+
* fetches the bucket artifacts itself, exactly like `ValidationStation`.
|
|
13
|
+
*/
|
|
14
|
+
export interface SubcomponentDataSource {
|
|
15
|
+
/** SDK instance — required for self-fetching mode. */
|
|
16
|
+
sdk?: UiPath;
|
|
17
|
+
/** Content-validation descriptor — required for self-fetching mode. */
|
|
18
|
+
data?: DuFramework.ContentValidationData;
|
|
19
|
+
/** Storage-bucket folder id. Falls back to `data.FolderId`. */
|
|
20
|
+
folderId?: number;
|
|
21
|
+
/** Pre-fetched artifacts. When supplied, no fetch is performed. */
|
|
22
|
+
artifacts?: BucketArtifacts;
|
|
23
|
+
/** Document id. Falls back to `data.DocumentId`. */
|
|
24
|
+
documentId?: string;
|
|
25
|
+
}
|
|
26
|
+
export interface ResolvedArtifacts {
|
|
27
|
+
artifacts: BucketArtifacts | null;
|
|
28
|
+
error: string | null;
|
|
29
|
+
documentId: string | undefined;
|
|
30
|
+
/**
|
|
31
|
+
* True when a full self-fetching / persistence context (`sdk` + `data` +
|
|
32
|
+
* resolved folder id) is available — i.e. the fields-form can round-trip
|
|
33
|
+
* submit / save-as-draft through the SDK.
|
|
34
|
+
*/
|
|
35
|
+
canPersist: boolean;
|
|
36
|
+
/** Folder id used for fetch/persist, resolved from the prop or `data.FolderId`. */
|
|
37
|
+
resolvedFolderId: number | undefined;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Resolves the artifacts a subcomponent needs, transparently handling both the
|
|
41
|
+
* pre-fetched and self-fetching modes described on {@link SubcomponentDataSource}.
|
|
42
|
+
*/
|
|
43
|
+
export declare function useSubcomponentArtifacts({ sdk, data, folderId, artifacts: provided, documentId, }: SubcomponentDataSource): ResolvedArtifacts;
|
|
44
|
+
//# sourceMappingURL=useSubcomponentArtifacts.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useSubcomponentArtifacts.d.ts","sourceRoot":"","sources":["../src/useSubcomponentArtifacts.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,gCAAgC,CAAC;AAC7D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kDAAkD,CAAC;AAGpF,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAElD;;;;;;;;;GASG;AACH,MAAM,WAAW,sBAAsB;IACrC,sDAAsD;IACtD,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,uEAAuE;IACvE,IAAI,CAAC,EAAE,WAAW,CAAC,qBAAqB,CAAC;IACzC,+DAA+D;IAC/D,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,mEAAmE;IACnE,SAAS,CAAC,EAAE,eAAe,CAAC;IAC5B,oDAAoD;IACpD,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,iBAAiB;IAChC,SAAS,EAAE,eAAe,GAAG,IAAI,CAAC;IAClC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,UAAU,EAAE,MAAM,GAAG,SAAS,CAAC;IAC/B;;;;OAIG;IACH,UAAU,EAAE,OAAO,CAAC;IACpB,mFAAmF;IACnF,gBAAgB,EAAE,MAAM,GAAG,SAAS,CAAC;CACtC;AAED;;;GAGG;AACH,wBAAgB,wBAAwB,CAAC,EACvC,GAAG,EACH,IAAI,EACJ,QAAQ,EACR,SAAS,EAAE,QAAQ,EACnB,UAAU,GACX,EAAE,sBAAsB,GAAG,iBAAiB,CAyF5C"}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { BucketService } from "@uipath/uipath-typescript/buckets";
|
|
2
|
+
import { useEffect, useRef, useState } from "react";
|
|
3
|
+
import { fetchBucketArtifacts } from "./bucketArtifactsUtil.js";
|
|
4
|
+
/**
|
|
5
|
+
* Resolves the artifacts a subcomponent needs, transparently handling both the
|
|
6
|
+
* pre-fetched and self-fetching modes described on {@link SubcomponentDataSource}.
|
|
7
|
+
*/
|
|
8
|
+
export function useSubcomponentArtifacts({ sdk, data, folderId, artifacts: provided, documentId, }) {
|
|
9
|
+
const [fetched, setFetched] = useState(null);
|
|
10
|
+
const [error, setError] = useState(null);
|
|
11
|
+
const resolvedFolderId = folderId ?? data?.FolderId;
|
|
12
|
+
const resolvedDocumentId = documentId ?? data?.DocumentId;
|
|
13
|
+
const canPersist = !!sdk && !!data && !!resolvedFolderId;
|
|
14
|
+
// Fetch only when the caller did not supply artifacts and a full context is
|
|
15
|
+
// present (the missing-folderId case is surfaced at render).
|
|
16
|
+
const shouldFetch = !provided && canPersist;
|
|
17
|
+
// Keep the latest sdk reachable so each fetch uses the current instance (token
|
|
18
|
+
// refresh / tenant switch) without making sdk identity a fetch trigger.
|
|
19
|
+
const sdkRef = useRef(sdk);
|
|
20
|
+
useEffect(() => {
|
|
21
|
+
sdkRef.current = sdk;
|
|
22
|
+
}, [sdk]);
|
|
23
|
+
useEffect(() => {
|
|
24
|
+
if (!shouldFetch)
|
|
25
|
+
return;
|
|
26
|
+
let cancelled = false;
|
|
27
|
+
// Build the service from the CURRENT sdk on each fetch — caching it in a ref
|
|
28
|
+
// would pin the original sdk's auth/base URL.
|
|
29
|
+
const bucketService = new BucketService(sdkRef.current);
|
|
30
|
+
fetchBucketArtifacts(bucketService, data, resolvedFolderId)
|
|
31
|
+
.then((result) => {
|
|
32
|
+
if (!cancelled) {
|
|
33
|
+
setFetched(result);
|
|
34
|
+
setError(null);
|
|
35
|
+
}
|
|
36
|
+
})
|
|
37
|
+
.catch((er) => {
|
|
38
|
+
if (!cancelled) {
|
|
39
|
+
setFetched(null);
|
|
40
|
+
setError(er instanceof Error ? er.message : String(er));
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
return () => {
|
|
44
|
+
cancelled = true;
|
|
45
|
+
};
|
|
46
|
+
// Keyed on `data` identity (as useBucketArtifacts always has) + folder: the
|
|
47
|
+
// fetch reads the bucket PATH fields off `data`, not just DocumentId, so a
|
|
48
|
+
// new payload with the same DocumentId but different paths must refetch.
|
|
49
|
+
// Callers pass a stable `data` reference (React state) so this does not
|
|
50
|
+
// refetch on unrelated re-renders.
|
|
51
|
+
}, [shouldFetch, data, resolvedFolderId]);
|
|
52
|
+
if (provided) {
|
|
53
|
+
return {
|
|
54
|
+
artifacts: provided,
|
|
55
|
+
error: null,
|
|
56
|
+
documentId: resolvedDocumentId,
|
|
57
|
+
canPersist,
|
|
58
|
+
resolvedFolderId,
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
if (!sdk || !data) {
|
|
62
|
+
return {
|
|
63
|
+
artifacts: null,
|
|
64
|
+
error: "No data source provided. Pass `artifacts` (pre-fetched) or `sdk` + `data` (to fetch).",
|
|
65
|
+
documentId: resolvedDocumentId,
|
|
66
|
+
canPersist,
|
|
67
|
+
resolvedFolderId,
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
if (!resolvedFolderId) {
|
|
71
|
+
return {
|
|
72
|
+
artifacts: null,
|
|
73
|
+
error: "folderId of Storage bucket is required. Provide it as a prop or ensure data.FolderId is set.",
|
|
74
|
+
documentId: resolvedDocumentId,
|
|
75
|
+
canPersist,
|
|
76
|
+
resolvedFolderId,
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
return {
|
|
80
|
+
artifacts: fetched,
|
|
81
|
+
error,
|
|
82
|
+
documentId: resolvedDocumentId,
|
|
83
|
+
canPersist,
|
|
84
|
+
resolvedFolderId,
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
//# sourceMappingURL=useSubcomponentArtifacts.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useSubcomponentArtifacts.js","sourceRoot":"","sources":["../src/useSubcomponentArtifacts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAC;A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EAAE,kBAAkB;QAC9B,UAAU;QACV,gBAAgB;KACjB,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Returns `true` once the custom element for `tag` has been defined by the
|
|
3
|
+
* browser's element registry. All standalone DU elements are registered by the
|
|
4
|
+
* same `main` import (side-effect of importing `loadValidationStationWc`), so
|
|
5
|
+
* this only waits for the requested tag to upgrade.
|
|
6
|
+
*/
|
|
7
|
+
export declare function useWcReady(tag: string): boolean;
|
|
8
|
+
//# sourceMappingURL=useWcReady.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useWcReady.d.ts","sourceRoot":"","sources":["../src/useWcReady.ts"],"names":[],"mappings":"AAGA;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAc/C"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { useEffect, useState } from "react";
|
|
2
|
+
import { waitForWcElementReady } from "./loadValidationStationWc.js";
|
|
3
|
+
/**
|
|
4
|
+
* Returns `true` once the custom element for `tag` has been defined by the
|
|
5
|
+
* browser's element registry. All standalone DU elements are registered by the
|
|
6
|
+
* same `main` import (side-effect of importing `loadValidationStationWc`), so
|
|
7
|
+
* this only waits for the requested tag to upgrade.
|
|
8
|
+
*/
|
|
9
|
+
export function useWcReady(tag) {
|
|
10
|
+
const [ready, setReady] = useState(false);
|
|
11
|
+
useEffect(() => {
|
|
12
|
+
let cancelled = false;
|
|
13
|
+
waitForWcElementReady(tag).then(() => {
|
|
14
|
+
if (!cancelled)
|
|
15
|
+
setReady(true);
|
|
16
|
+
});
|
|
17
|
+
return () => {
|
|
18
|
+
cancelled = true;
|
|
19
|
+
};
|
|
20
|
+
}, [tag]);
|
|
21
|
+
return ready;
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=useWcReady.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useWcReady.js","sourceRoot":"","sources":["../src/useWcReady.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC5C,OAAO,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAC;AAErE;;;;;GAKG;AACH,MAAM,UAAU,UAAU,CAAC,GAAW;IACpC,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAE1C,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,SAAS,GAAG,KAAK,CAAC;QACtB,qBAAqB,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE;YACnC,IAAI,CAAC,SAAS;gBAAE,QAAQ,CAAC,IAAI,CAAC,CAAC;QACjC,CAAC,CAAC,CAAC;QACH,OAAO,GAAG,EAAE;YACV,SAAS,GAAG,IAAI,CAAC;QACnB,CAAC,CAAC;IACJ,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IAEV,OAAO,KAAK,CAAC;AACf,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uipath/ui-widgets-validation-station",
|
|
3
|
-
"version": "1.0.1
|
|
3
|
+
"version": "1.0.1",
|
|
4
4
|
"description": "A React component for UiPath Document Understanding Validation Station.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.esm.js",
|
|
@@ -17,8 +17,9 @@
|
|
|
17
17
|
],
|
|
18
18
|
"scripts": {
|
|
19
19
|
"prepack": "rimraf *.tgz",
|
|
20
|
-
"build": "npm run clean && tsc",
|
|
20
|
+
"build": "npm run clean && tsc -p tsconfig.build.json",
|
|
21
21
|
"clean": "rimraf dist",
|
|
22
|
+
"typecheck": "tsc --noEmit -p tsconfig.json",
|
|
22
23
|
"test": "vitest --run",
|
|
23
24
|
"test:watch": "vitest",
|
|
24
25
|
"test:ui": "vitest --ui",
|
|
@@ -41,7 +42,7 @@
|
|
|
41
42
|
"registry": "https://npm.pkg.github.com"
|
|
42
43
|
},
|
|
43
44
|
"peerDependencies": {
|
|
44
|
-
"@uipath/uipath-typescript": "^1.4.
|
|
45
|
+
"@uipath/uipath-typescript": "^1.4.2",
|
|
45
46
|
"react": "^19.2.0",
|
|
46
47
|
"react-dom": "^19.2.0"
|
|
47
48
|
},
|
|
@@ -66,7 +67,7 @@
|
|
|
66
67
|
},
|
|
67
68
|
"dependencies": {
|
|
68
69
|
"@uipath/apollo-wind": "^0.10.0",
|
|
69
|
-
"@uipath/du-validation-station-wc": "1.0.0-
|
|
70
|
+
"@uipath/du-validation-station-wc": "1.0.0-rc.1",
|
|
70
71
|
"fflate": "^0.8.2"
|
|
71
72
|
}
|
|
72
73
|
}
|