@powerhousedao/design-system 6.2.3-dev.65 → 6.2.3-dev.67
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/{add-local-drive-form.impl-B5rVul7f.js → add-local-drive-form.impl-xsC6R634.js} +3 -3
- package/dist/{add-local-drive-form.impl-B5rVul7f.js.map → add-local-drive-form.impl-xsC6R634.js.map} +1 -1
- package/dist/{add-remote-drive-form.impl-D7zuqHJC.js → add-remote-drive-form.impl-B2DxdWGF.js} +3 -3
- package/dist/{add-remote-drive-form.impl-D7zuqHJC.js.map → add-remote-drive-form.impl-B2DxdWGF.js.map} +1 -1
- package/dist/{address-DsZy0bjk.js → address-DfZqD6IM.js} +2 -2
- package/dist/{address-DsZy0bjk.js.map → address-DfZqD6IM.js.map} +1 -1
- package/dist/{checkbox-DmRYkN10.d.ts → checkbox-BIhO-KB2.d.ts} +2 -2
- package/dist/{checkbox-DmRYkN10.d.ts.map → checkbox-BIhO-KB2.d.ts.map} +1 -1
- package/dist/{combobox.impl-C2oszOl2.js → combobox.impl-EqgAawKJ.js} +2 -2
- package/dist/{combobox.impl-C2oszOl2.js.map → combobox.impl-EqgAawKJ.js.map} +1 -1
- package/dist/connect/components/toast/toast.js +2 -2
- package/dist/connect/index.d.ts +5 -2
- package/dist/connect/index.d.ts.map +1 -1
- package/dist/connect/index.js +9 -9
- package/dist/{content-L3OINRSY.d.ts → content-Ch3oDYCL.d.ts} +2 -2
- package/dist/{content-L3OINRSY.d.ts.map → content-Ch3oDYCL.d.ts.map} +1 -1
- package/dist/{document-timeline.impl-DRmIHFaI.js → document-timeline.impl-CCkyXpt5.js} +2 -2
- package/dist/{document-timeline.impl-DRmIHFaI.js.map → document-timeline.impl-CCkyXpt5.js.map} +1 -1
- package/dist/{drive-settings-form.impl-4yBGaTxe.js → drive-settings-form.impl-Bwam9-CG.js} +3 -3
- package/dist/{drive-settings-form.impl-4yBGaTxe.js.map → drive-settings-form.impl-Bwam9-CG.js.map} +1 -1
- package/dist/{enum-field-CSeQE4Ss.d.ts → enum-field-DsyC0ml7.d.ts} +3 -3
- package/dist/{enum-field-CSeQE4Ss.d.ts.map → enum-field-DsyC0ml7.d.ts.map} +1 -1
- package/dist/{formatted-json-viewer.impl-C198BZt5.js → formatted-json-viewer.impl-DadZ5uvb.js} +2 -2
- package/dist/{formatted-json-viewer.impl-C198BZt5.js.map → formatted-json-viewer.impl-DadZ5uvb.js.map} +1 -1
- package/dist/{icon-CR_tC1gc.js → icon-CHR45tj_.js} +2 -2
- package/dist/{icon-CR_tC1gc.js.map → icon-CHR45tj_.js.map} +1 -1
- package/dist/{icon-components-BZ_bQZmJ.js → icon-components-CJ4I3Y6Y.js} +3 -3
- package/dist/{icon-components-BZ_bQZmJ.js.map → icon-components-CJ4I3Y6Y.js.map} +1 -1
- package/dist/{id-autocomplete-0bhU6VQG.d.ts → id-autocomplete-Cr7p129s.d.ts} +2 -2
- package/dist/id-autocomplete-Cr7p129s.d.ts.map +1 -0
- package/dist/{id-autocomplete-input-container-xg9lrpSK.d.ts → id-autocomplete-input-container-iTw9wYZn.d.ts} +2 -2
- package/dist/{id-autocomplete-input-container-xg9lrpSK.d.ts.map → id-autocomplete-input-container-iTw9wYZn.d.ts.map} +1 -1
- package/dist/{id-autocomplete-list-Da3FbpJ1.d.ts → id-autocomplete-list-BIC3RxOp.d.ts} +2 -2
- package/dist/{id-autocomplete-list-Da3FbpJ1.d.ts.map → id-autocomplete-list-BIC3RxOp.d.ts.map} +1 -1
- package/dist/{id-autocomplete-list-option-D7JgEK6E.d.ts → id-autocomplete-list-option-DlpZer-2.d.ts} +2 -2
- package/dist/{id-autocomplete-list-option-D7JgEK6E.d.ts.map → id-autocomplete-list-option-DlpZer-2.d.ts.map} +1 -1
- package/dist/{index-D99twPFI.d.ts → index-Ck34z7kD.d.ts} +5 -1
- package/dist/index-Ck34z7kD.d.ts.map +1 -0
- package/dist/index-DoZfvvTr.d.ts +3 -0
- package/dist/index-Ds9-qjjC.d.ts +30 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +2 -2
- package/dist/{radio-group-field-Bsf4waat.d.ts → radio-group-field-0-cC_e65.d.ts} +2 -2
- package/dist/{radio-group-field-Bsf4waat.d.ts.map → radio-group-field-0-cC_e65.d.ts.map} +1 -1
- package/dist/{revision-history.impl-uogo6xDI.js → revision-history.impl-CrtSnhXQ.js} +10 -6
- package/dist/revision-history.impl-CrtSnhXQ.js.map +1 -0
- package/dist/{select-field-DbFd1YiC.d.ts → select-field-VZPf666l.d.ts} +2 -2
- package/dist/{select-field-DbFd1YiC.d.ts.map → select-field-VZPf666l.d.ts.map} +1 -1
- package/dist/{selected-content-VMVPoru4.d.ts → selected-content-D6NWiceG.d.ts} +2 -2
- package/dist/{selected-content-VMVPoru4.d.ts.map → selected-content-D6NWiceG.d.ts.map} +1 -1
- package/dist/{splitted-input-diff-BKRMH7vI.d.ts → splitted-input-diff-Bkoi0Odc.d.ts} +2 -2
- package/dist/{splitted-input-diff-BKRMH7vI.d.ts.map → splitted-input-diff-Bkoi0Odc.d.ts.map} +1 -1
- package/dist/{src-B2s8MAp7.js → src-CohvVFnR.js} +17 -7
- package/dist/src-CohvVFnR.js.map +1 -0
- package/dist/style.css +3 -0
- package/dist/{text-field-CtatgqNu.d.ts → text-field-CDYSwanK.d.ts} +3 -3
- package/dist/{text-field-CtatgqNu.d.ts.map → text-field-CDYSwanK.d.ts.map} +1 -1
- package/dist/{text-input-BSxhvnyx.d.ts → text-input-CFRCPYq6.d.ts} +2 -2
- package/dist/{text-input-BSxhvnyx.d.ts.map → text-input-CFRCPYq6.d.ts.map} +1 -1
- package/dist/{text-input-diff-CaZoFDjA.d.ts → text-input-diff-BgJAxPQV.d.ts} +2 -2
- package/dist/{text-input-diff-CaZoFDjA.d.ts.map → text-input-diff-BgJAxPQV.d.ts.map} +1 -1
- package/dist/ui/components/checkbox/checkbox.d.ts +1 -1
- package/dist/ui/components/command/command.js +1 -1
- package/dist/ui/components/enum-field/enum-field.d.ts +1 -1
- package/dist/ui/components/enum-field/types.d.ts +1 -1
- package/dist/ui/components/form-label/form-label.js +1 -1
- package/dist/ui/components/id-autocomplete/id-autocomplete-input-container.d.ts +1 -1
- package/dist/ui/components/id-autocomplete/id-autocomplete-input-container.js +1 -1
- package/dist/ui/components/id-autocomplete/id-autocomplete-list-option.d.ts +1 -1
- package/dist/ui/components/id-autocomplete/id-autocomplete-list-option.js +1 -1
- package/dist/ui/components/id-autocomplete/id-autocomplete-list.d.ts +1 -1
- package/dist/ui/components/id-autocomplete/id-autocomplete.d.ts +1 -1
- package/dist/ui/components/id-autocomplete/types.d.ts +1 -1
- package/dist/ui/components/id-autocomplete/use-id-autocomplete.d.ts +1 -1
- package/dist/ui/components/index.d.ts +17 -17
- package/dist/ui/components/input/splitted-input-diff.d.ts +1 -1
- package/dist/ui/components/input/splitted-input-diff.js +1 -1
- package/dist/ui/components/input/subcomponent/text-diff.d.ts +1 -1
- package/dist/ui/components/radio-group-field/radio-group-field.d.ts +1 -1
- package/dist/ui/components/select-field/content.d.ts +1 -1
- package/dist/ui/components/select-field/content.js +1 -1
- package/dist/ui/components/select-field/select-field.d.ts +1 -1
- package/dist/ui/components/select-field/selected-content.d.ts +1 -1
- package/dist/ui/components/select-field/selected-content.js +1 -1
- package/dist/ui/components/select-field/subcomponents/CommandItemList.d.ts +1 -1
- package/dist/ui/components/select-field/subcomponents/CommandItemList.js +1 -1
- package/dist/ui/components/select-field/use-select-field.d.ts +1 -1
- package/dist/ui/components/sidebar/sidebar.js +1 -1
- package/dist/ui/components/sidebar/subcomponents/sidebar-content-area.js +1 -1
- package/dist/ui/components/sidebar/subcomponents/sidebar-item.js +1 -1
- package/dist/ui/components/text-field/text-field.d.ts +1 -1
- package/dist/ui/components/text-input/text-input-diff.d.ts +1 -1
- package/dist/ui/components/text-input/text-input.d.ts +1 -1
- package/dist/ui/components/types.d.ts +1 -1
- package/dist/ui/components/value-transformer/value-transformer.d.ts +1 -1
- package/dist/ui/components/with-field-validation/with-field-validation.d.ts +1 -1
- package/dist/ui/index.d.ts +18 -18
- package/dist/ui/types.d.ts +1 -1
- package/dist/{use-id-autocomplete-DSRXA4Wt.d.ts → use-id-autocomplete-WH2ROfQn.d.ts} +2 -2
- package/dist/{use-id-autocomplete-DSRXA4Wt.d.ts.map → use-id-autocomplete-WH2ROfQn.d.ts.map} +1 -1
- package/dist/{value-transformer-Dv-10UyC.d.ts → value-transformer-Cg5TEYP2.d.ts} +2 -2
- package/dist/{value-transformer-Dv-10UyC.d.ts.map → value-transformer-Cg5TEYP2.d.ts.map} +1 -1
- package/dist/{with-field-validation-WiD_NFDk.d.ts → with-field-validation-CObZoT4r.d.ts} +2 -2
- package/dist/{with-field-validation-WiD_NFDk.d.ts.map → with-field-validation-CObZoT4r.d.ts.map} +1 -1
- package/package.json +10 -6
- package/tailwind.css +180 -0
- package/vendor.css +3 -0
- package/dist/id-autocomplete-0bhU6VQG.d.ts.map +0 -1
- package/dist/index-D99twPFI.d.ts.map +0 -1
- package/dist/index-D9nAoDks.d.ts +0 -30
- package/dist/index-FfMAMBu7.d.ts +0 -3
- package/dist/revision-history.impl-uogo6xDI.js.map +0 -1
- package/dist/src-B2s8MAp7.js.map +0 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { y as IdAutocompleteProps } from "./index-
|
|
1
|
+
import { y as IdAutocompleteProps } from "./index-Ck34z7kD.js";
|
|
2
2
|
import React from "react";
|
|
3
3
|
//#region src/ui/components/id-autocomplete/id-autocomplete.d.ts
|
|
4
4
|
declare const IdAutocomplete: React.ForwardRefExoticComponent<IdAutocompleteProps & React.RefAttributes<HTMLInputElement>>;
|
|
5
5
|
//#endregion
|
|
6
6
|
export { IdAutocomplete as t };
|
|
7
7
|
export {};
|
|
8
|
-
//# sourceMappingURL=id-autocomplete-
|
|
8
|
+
//# sourceMappingURL=id-autocomplete-Cr7p129s.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"id-autocomplete-Cr7p129s.d.ts","names":[],"sources":["../src/ui/components/id-autocomplete/id-autocomplete.tsx"],"mappings":";;;cAkBM,gBAAc,MAAA,0BAAA,sBAAA,MAAA,cAAA"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { p as InputBaseProps, v as IdAutocompleteOption } from "./index-
|
|
1
|
+
import { p as InputBaseProps, v as IdAutocompleteOption } from "./index-Ck34z7kD.js";
|
|
2
2
|
import React from "react";
|
|
3
3
|
//#region src/ui/components/id-autocomplete/id-autocomplete-input-container.d.ts
|
|
4
4
|
interface IdAutocompleteInputContainerProps extends Omit<InputBaseProps<string>, "defaultValue" | "errors" | "warnings"> {
|
|
@@ -23,4 +23,4 @@ declare const IdAutocompleteInputContainer: React.ForwardRefExoticComponent<IdAu
|
|
|
23
23
|
//#endregion
|
|
24
24
|
export { IdAutocompleteInputContainerProps as n, IdAutocompleteInputContainer as t };
|
|
25
25
|
export {};
|
|
26
|
-
//# sourceMappingURL=id-autocomplete-input-container-
|
|
26
|
+
//# sourceMappingURL=id-autocomplete-input-container-iTw9wYZn.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"id-autocomplete-input-container-
|
|
1
|
+
{"version":3,"file":"id-autocomplete-input-container-iTw9wYZn.d.ts","names":[],"sources":["../src/ui/components/id-autocomplete/id-autocomplete-input-container.tsx"],"mappings":";;;UAaU,0CAA0C,KAClD;EAGA;EACA;EACA,YAAY,GAAG,MAAM,YAAY;EACjC,UAAU,GAAG,MAAM,WAAW;EAC9B,WAAW,GAAG,MAAM,WAAW;EAC/B,iBAAiB;EACjB;EACA,oBAAoB;EACpB,aAAa,GAAG,MAAM,cAAc;EACpC,eAAe,GAAG,MAAM,WAAW;EACnC;EACA;EACA;EACA;EACA,eAAe,GAAG,MAAM,eAAe;EACvC,WAAW,GAAG,MAAM,eAAe;;cAG/B,8BAA4B,MAAA,0BAAA,oCAAA,MAAA,cAAA"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { v as IdAutocompleteOption, y as IdAutocompleteProps } from "./index-
|
|
1
|
+
import { v as IdAutocompleteOption, y as IdAutocompleteProps } from "./index-Ck34z7kD.js";
|
|
2
2
|
import React from "react";
|
|
3
3
|
//#region src/ui/components/id-autocomplete/id-autocomplete-list.d.ts
|
|
4
4
|
interface IdAutocompleteListProps {
|
|
@@ -20,4 +20,4 @@ declare const IdAutocompleteList: React.FC<IdAutocompleteListProps>;
|
|
|
20
20
|
//#endregion
|
|
21
21
|
export { IdAutocompleteListProps as n, IdAutocompleteList as t };
|
|
22
22
|
export {};
|
|
23
|
-
//# sourceMappingURL=id-autocomplete-list-
|
|
23
|
+
//# sourceMappingURL=id-autocomplete-list-BIC3RxOp.d.ts.map
|
package/dist/{id-autocomplete-list-Da3FbpJ1.d.ts.map → id-autocomplete-list-BIC3RxOp.d.ts.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"id-autocomplete-list-
|
|
1
|
+
{"version":3,"file":"id-autocomplete-list-BIC3RxOp.d.ts","names":[],"sources":["../src/ui/components/id-autocomplete/id-autocomplete-list.tsx"],"mappings":";;;UAYU;EACR,SAAS;EACT,iBAAiB,MAAM,UAAU;EACjC;EACA,UAAU;EACV,gBAAgB;EAChB,gBACE,QAAQ,sBACR;IACE;IACA;IACA;IACA,6BAA6B;IAC7B;QAEC,MAAM;EACX,qBAAqB;;cAGjB,oBAAoB,MAAM,GAAG"}
|
package/dist/{id-autocomplete-list-option-D7JgEK6E.d.ts → id-autocomplete-list-option-DlpZer-2.d.ts}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { v as IdAutocompleteOption, y as IdAutocompleteProps } from "./index-
|
|
1
|
+
import { v as IdAutocompleteOption, y as IdAutocompleteProps } from "./index-Ck34z7kD.js";
|
|
2
2
|
import { o as IconName } from "./types-TZijOYrE.js";
|
|
3
3
|
import React from "react";
|
|
4
4
|
//#region src/ui/components/id-autocomplete/id-autocomplete-list-option.d.ts
|
|
@@ -16,4 +16,4 @@ declare const IdAutocompleteListOption: React.FC<IdAutocompleteListOptionProps>;
|
|
|
16
16
|
//#endregion
|
|
17
17
|
export { IdAutocompleteListOptionProps as n, IdAutocompleteListOption as t };
|
|
18
18
|
export {};
|
|
19
|
-
//# sourceMappingURL=id-autocomplete-list-option-
|
|
19
|
+
//# sourceMappingURL=id-autocomplete-list-option-DlpZer-2.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"id-autocomplete-list-option-
|
|
1
|
+
{"version":3,"file":"id-autocomplete-list-option-DlpZer-2.d.ts","names":[],"sources":["../src/ui/components/id-autocomplete/id-autocomplete-list-option.tsx"],"mappings":";;;;KAyEK;EACH,SAAS;EACT;EACA;EACA;EACA,6BAA6B;EAC7B;EACA;EACA,kBAAkB,WAAW,MAAM;IACjC,qBAAqB;cAEnB,0BAA0B,MAAM,GAAG"}
|
|
@@ -89,6 +89,10 @@ interface UsePaginationOptions {
|
|
|
89
89
|
pageRange?: number;
|
|
90
90
|
initialPage?: number;
|
|
91
91
|
itemsPerPage?: number;
|
|
92
|
+
/** Controlled: the current page index, kept by the caller (e.g. in the URL). */
|
|
93
|
+
page?: number;
|
|
94
|
+
/** Controlled: called with the page index to show; required with `page`. */
|
|
95
|
+
onPageChange?: (page: number) => void;
|
|
92
96
|
}
|
|
93
97
|
interface UsePaginationBaseResult {
|
|
94
98
|
pages: PageItem[];
|
|
@@ -342,4 +346,4 @@ type AmountValue = Amount | AmountPercentage | AmountFiat | AmountCrypto | Amoun
|
|
|
342
346
|
//#endregion
|
|
343
347
|
export { PowerhouseButton as $, SidebarFooter as A, UsePaginationOptions as B, SelectProps as C, useEnterAnimation as D, useAnimation as E, PaginationEvent as F, Modal as G, usePagination as H, PaginationPageEvent as I, DropdownMenu as J, Icon as K, PaginationProps as L, SidebarPanel as M, SidebarPanelProps as N, useExitAnimation as O, Pagination as P, DropdownMenuTrigger as Q, PageItem as R, SelectOption as S, useWindowSize as T, PackageAnimation as U, UsePaginationResult as V, PackageAnimationProps as W, DropdownMenuItem as X, DropdownMenuContent as Y, DropdownMenuLabel as Z, WithDifference as _, AmountInputPropsGeneric as a, AppOptions as at, RadioGroupProps as b, Currency as c, INITIAL_SYNC as ct, ErrorMessage as d, SYNCING as dt, PowerhouseButtonProps as et, FieldErrorHandling as f, syncStatuses as ft, ViewMode as g, ValidatorResult as h, AmountFiat as i, SyncStatuses as it, SidebarHeader as j, Sidebar as k, CurrencyTicker as l, MISSING as lt, ValidatorHandler as m, AmountCrypto as n, OptionMetadata as nt, AmountPercentage as o, CONFLICT as ot, InputBaseProps as p, iconComponents as q, AmountCurrency as r, SyncStatus as rt, AmountValue as s, ERROR as st, Amount as t, DriveLocation as tt, DiffMode as u, SUCCESS as ut, IdAutocompleteOption as v, getDimensions as w, SelectBaseProps as x, IdAutocompleteProps as y, UsePaginationBaseResult as z };
|
|
344
348
|
export {};
|
|
345
|
-
//# sourceMappingURL=index-
|
|
349
|
+
//# sourceMappingURL=index-Ck34z7kD.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index-Ck34z7kD.d.ts","names":[],"sources":["../src/connect/constants/syncing.ts","../src/connect/components/types.ts","../src/connect/types.ts","../src/powerhouse/components/button/button.tsx","../src/powerhouse/components/dropdown-menu/dropdown-menu.tsx","../src/powerhouse/components/icon/icon-components.tsx","../src/powerhouse/components/icon/icon.tsx","../src/powerhouse/components/modal/modal.tsx","../src/powerhouse/components/package-animation/package-animation.tsx","../src/powerhouse/hooks/usePagination.ts","../src/powerhouse/components/pagination/pagination.tsx","../src/powerhouse/components/sidebar/sidebar-panel.tsx","../src/powerhouse/components/sidebar/sidebar.tsx","../src/powerhouse/hooks/animation.ts","../src/powerhouse/hooks/useWindowSize.ts","../src/powerhouse/utils/getDimensions.ts","../src/ui/components/enum-field/types.ts","../src/ui/components/id-autocomplete/types.ts","../src/ui/types.ts"],"mappings":";;;;;;cAA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Ae;EAC9B;EACA;EACA,QAAQ,MAAM;EACd;EACA,QAAQ;EACR,eAAe;EACf;EACA;EACA,SAAS;EACT,WAAW;EACX;;UAGe;EACf;EACA;EACA,aAAa,qBAAqB;;UAKnB;EACf;EACA;EACA;EACA;EACA,OAAO,WAAW,MAAM;IAAgB;;;KAG9B;EACV;EACA,OAAO;;KAEG;KACA,iBAAiB;UAEZ;EACf;EACA,MAAM;;UAGS;EACf;EACA,MAAM;;UAGS;EACf;EACA,MAAM;;KAGI;EAEN;EACA,QAAQ;EACR;;EAGA;EACA,QAAQ;EACR;;EAGA;EACA,QAAQ;EACR;EACA;;EAGA;EACA,QAAQ;EACR;;EAGA;EACA,QAAQ;EACR;;KAGM,cACR,SACA,mBACA,aACA,eACA"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import "./button-BYcXvZXr.js";
|
|
2
|
+
import "./checkbox-base-Bm0GPWgm.js";
|
|
3
|
+
import "./checkbox-BIhO-KB2.js";
|
|
4
|
+
import "./command-DHHTsHfH.js";
|
|
5
|
+
import "./radio-group-field-0-cC_e65.js";
|
|
6
|
+
import "./select-field-VZPf666l.js";
|
|
7
|
+
import "./enum-field-DsyC0ml7.js";
|
|
8
|
+
import "./form-Brj5AQNr.js";
|
|
9
|
+
import "./id-autocomplete-input-container-iTw9wYZn.js";
|
|
10
|
+
import "./id-autocomplete-list-option-DlpZer-2.js";
|
|
11
|
+
import "./id-autocomplete-list-BIC3RxOp.js";
|
|
12
|
+
import "./id-autocomplete-Cr7p129s.js";
|
|
13
|
+
import "./use-id-autocomplete-WH2ROfQn.js";
|
|
14
|
+
import "./input-WDvjJFqf.js";
|
|
15
|
+
import "./splitted-input-diff-Bkoi0Odc.js";
|
|
16
|
+
import "./json-viewer-Kg0IBIt-.js";
|
|
17
|
+
import "./popover-TvQxa0RU.js";
|
|
18
|
+
import "./radio-group-CROIwgYz.js";
|
|
19
|
+
import "./radio-CTS4WsNy.js";
|
|
20
|
+
import "./index-D6Zk5OLV.js";
|
|
21
|
+
import "./content-Ch3oDYCL.js";
|
|
22
|
+
import "./selected-content-D6NWiceG.js";
|
|
23
|
+
import "./text-input-CFRCPYq6.js";
|
|
24
|
+
import "./text-field-CDYSwanK.js";
|
|
25
|
+
import "./text-input-diff-BgJAxPQV.js";
|
|
26
|
+
import "./index-C-Tup7Br.js";
|
|
27
|
+
import "./tooltip-B4uQJPUm.js";
|
|
28
|
+
import "./value-transformer-Cg5TEYP2.js";
|
|
29
|
+
import "./with-field-validation-CObZoT4r.js";
|
|
30
|
+
export {};
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $ as PowerhouseButton, A as SidebarFooter, B as UsePaginationOptions, C as SelectProps, D as useEnterAnimation, E as useAnimation, F as PaginationEvent, G as Modal, H as usePagination, I as PaginationPageEvent, J as DropdownMenu, K as Icon, L as PaginationProps, M as SidebarPanel, N as SidebarPanelProps, O as useExitAnimation, P as Pagination, Q as DropdownMenuTrigger, R as PageItem, S as SelectOption, T as useWindowSize, U as PackageAnimation, V as UsePaginationResult, W as PackageAnimationProps, X as DropdownMenuItem, Y as DropdownMenuContent, Z as DropdownMenuLabel, _ as WithDifference, a as AmountInputPropsGeneric, at as AppOptions, b as RadioGroupProps, c as Currency, d as ErrorMessage, et as PowerhouseButtonProps, f as FieldErrorHandling, g as ViewMode, h as ValidatorResult, i as AmountFiat, it as SyncStatuses, j as SidebarHeader, k as Sidebar, l as CurrencyTicker, m as ValidatorHandler, n as AmountCrypto, nt as OptionMetadata, o as AmountPercentage, p as InputBaseProps, q as iconComponents, r as AmountCurrency, rt as SyncStatus, s as AmountValue, t as Amount, tt as DriveLocation, u as DiffMode, v as IdAutocompleteOption, w as getDimensions, x as SelectBaseProps, y as IdAutocompleteProps, z as UsePaginationBaseResult } from "./index-
|
|
1
|
+
import { $ as PowerhouseButton, A as SidebarFooter, B as UsePaginationOptions, C as SelectProps, D as useEnterAnimation, E as useAnimation, F as PaginationEvent, G as Modal, H as usePagination, I as PaginationPageEvent, J as DropdownMenu, K as Icon, L as PaginationProps, M as SidebarPanel, N as SidebarPanelProps, O as useExitAnimation, P as Pagination, Q as DropdownMenuTrigger, R as PageItem, S as SelectOption, T as useWindowSize, U as PackageAnimation, V as UsePaginationResult, W as PackageAnimationProps, X as DropdownMenuItem, Y as DropdownMenuContent, Z as DropdownMenuLabel, _ as WithDifference, a as AmountInputPropsGeneric, at as AppOptions, b as RadioGroupProps, c as Currency, d as ErrorMessage, et as PowerhouseButtonProps, f as FieldErrorHandling, g as ViewMode, h as ValidatorResult, i as AmountFiat, it as SyncStatuses, j as SidebarHeader, k as Sidebar, l as CurrencyTicker, m as ValidatorHandler, n as AmountCrypto, nt as OptionMetadata, o as AmountPercentage, p as InputBaseProps, q as iconComponents, r as AmountCurrency, rt as SyncStatus, s as AmountValue, t as Amount, tt as DriveLocation, u as DiffMode, v as IdAutocompleteOption, w as getDimensions, x as SelectBaseProps, y as IdAutocompleteProps, z as UsePaginationBaseResult } from "./index-Ck34z7kD.js";
|
|
2
2
|
import { a as IconComponentProps, i as Size, n as DivProps, o as IconName, r as DivWithRefProps, s as iconNames, t as Color } from "./types-TZijOYrE.js";
|
|
3
3
|
import { a as TransformerType, c as WeekStartDayNumber, i as TransformerTrigger, n as DatePickerView, o as ValueTransformerFn, r as TransformerObject, s as ValueTransformerProps, t as DateFieldValue } from "./types-CpFPFB1a.js";
|
|
4
4
|
export { type Amount, type AmountCrypto, type AmountCurrency, type AmountFiat, type AmountInputPropsGeneric, type AmountPercentage, type AmountValue, type AppOptions, type Color, type Currency, type CurrencyTicker, type DateFieldValue, type DatePickerView, type DiffMode, type DivProps, type DivWithRefProps, type DriveLocation, DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuLabel, DropdownMenuTrigger, type ErrorMessage, type FieldErrorHandling, Icon, type IconComponentProps, type IconName, type IdAutocompleteOption, type IdAutocompleteProps, type InputBaseProps, Modal, type OptionMetadata, PackageAnimation, PackageAnimationProps, PageItem, Pagination, PaginationEvent, PaginationPageEvent, PaginationProps, PowerhouseButton, PowerhouseButtonProps, type RadioGroupProps, type SelectBaseProps, type SelectOption, type SelectProps, Sidebar, SidebarFooter, SidebarHeader, SidebarPanel, SidebarPanelProps, type Size, type SyncStatus, type SyncStatuses, type TransformerObject, type TransformerTrigger, type TransformerType, UsePaginationBaseResult, UsePaginationOptions, UsePaginationResult, type ValidatorHandler, type ValidatorResult, type ValueTransformerFn, type ValueTransformerProps, type ViewMode, type WeekStartDayNumber, type WithDifference, getDimensions, iconComponents, iconNames, useAnimation, useEnterAnimation, useExitAnimation, usePagination, useWindowSize };
|
package/dist/index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { _ as DropdownMenuItem, a as useExitAnimation, b as PowerhouseButton, c as SidebarHeader, d as PackageAnimation, f as Modal, g as DropdownMenuContent, h as DropdownMenu, i as useEnterAnimation, l as SidebarPanel, m as iconNames, n as usePagination, o as Sidebar, p as iconComponents, r as useAnimation, s as SidebarFooter, t as useWindowSize, u as Pagination, v as DropdownMenuLabel, y as DropdownMenuTrigger } from "./src-
|
|
2
|
-
import { n as getDimensions, t as Icon } from "./icon-
|
|
1
|
+
import { _ as DropdownMenuItem, a as useExitAnimation, b as PowerhouseButton, c as SidebarHeader, d as PackageAnimation, f as Modal, g as DropdownMenuContent, h as DropdownMenu, i as useEnterAnimation, l as SidebarPanel, m as iconNames, n as usePagination, o as Sidebar, p as iconComponents, r as useAnimation, s as SidebarFooter, t as useWindowSize, u as Pagination, v as DropdownMenuLabel, y as DropdownMenuTrigger } from "./src-CohvVFnR.js";
|
|
2
|
+
import { n as getDimensions, t as Icon } from "./icon-CHR45tj_.js";
|
|
3
3
|
export { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuLabel, DropdownMenuTrigger, Icon, Modal, PackageAnimation, Pagination, PowerhouseButton, Sidebar, SidebarFooter, SidebarHeader, SidebarPanel, getDimensions, iconComponents, iconNames, useAnimation, useEnterAnimation, useExitAnimation, usePagination, useWindowSize };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { b as RadioGroupProps, f as FieldErrorHandling, p as InputBaseProps } from "./index-
|
|
1
|
+
import { b as RadioGroupProps, f as FieldErrorHandling, p as InputBaseProps } from "./index-Ck34z7kD.js";
|
|
2
2
|
import { HTMLAttributes } from "react";
|
|
3
3
|
//#region src/ui/components/radio-group-field/radio-group-field.d.ts
|
|
4
4
|
type RadioGroupFieldBaseProps = Omit<HTMLAttributes<HTMLDivElement>, keyof InputBaseProps<string> | keyof FieldErrorHandling | keyof RadioGroupProps | "dir"> & {
|
|
@@ -11,4 +11,4 @@ declare const RadioGroupField: import("react").ForwardRefExoticComponent<Omit<HT
|
|
|
11
11
|
//#endregion
|
|
12
12
|
export { RadioGroupFieldProps as n, RadioGroupField as t };
|
|
13
13
|
export {};
|
|
14
|
-
//# sourceMappingURL=radio-group-field-
|
|
14
|
+
//# sourceMappingURL=radio-group-field-0-cC_e65.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"radio-group-field-
|
|
1
|
+
{"version":3,"file":"radio-group-field-0-cC_e65.d.ts","names":[],"sources":["../src/ui/components/radio-group-field/radio-group-field.tsx"],"mappings":";;;KAUK,2BAA2B,KAC9B,eAAe,uBACP,+BACA,2BACA;EAGR;;KAGU,uBAAuB,2BACjC,yBACA,qBACA;cAkFW,iCAAe,0BAAA,KAAA,eAAA,+BAAA,2BAAA,+BAAA;EAxFpB;IA+FN,yBAAA,qBAAA,kCAAA,cAAA"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { n as usePagination, u as Pagination } from "./src-
|
|
2
|
-
import { t as Icon } from "./icon-
|
|
3
|
-
import { i as ENSAvatar, n as useEns, r as FormattedJsonViewer, t as formatEthAddress } from "./address-
|
|
1
|
+
import { n as usePagination, u as Pagination } from "./src-CohvVFnR.js";
|
|
2
|
+
import { t as Icon } from "./icon-CHR45tj_.js";
|
|
3
|
+
import { i as ENSAvatar, n as useEns, r as FormattedJsonViewer, t as formatEthAddress } from "./address-DfZqD6IM.js";
|
|
4
4
|
import { ConnectSelect, ConnectTooltipProvider } from "./connect/index.js";
|
|
5
5
|
import { memo, useEffect, useMemo, useRef, useState } from "react";
|
|
6
6
|
import { twMerge } from "tailwind-merge";
|
|
@@ -526,7 +526,7 @@ function Timeline(props) {
|
|
|
526
526
|
* the walk completes, then renders the pagination and timeline once.
|
|
527
527
|
*/
|
|
528
528
|
function ScopedRevisionHistory(props) {
|
|
529
|
-
const { documentTitle, documentId, operations, isLoading, hasNextPage, onLoadNextPage, scopes, scope, onScopeChange, onClose, itemsPerPage = 100, documentState, onCopyState, onCopyDocId, error } = props;
|
|
529
|
+
const { documentTitle, documentId, operations, isLoading, hasNextPage, onLoadNextPage, scopes, scope, onScopeChange, onClose, itemsPerPage = 100, documentState, onCopyState, onCopyDocId, error, page, onPageChange } = props;
|
|
530
530
|
useEffect(() => {
|
|
531
531
|
if (!hasNextPage || isLoading || error) return;
|
|
532
532
|
const handle = window.setTimeout(onLoadNextPage, 0);
|
|
@@ -539,7 +539,11 @@ function ScopedRevisionHistory(props) {
|
|
|
539
539
|
]);
|
|
540
540
|
const isWalking = !error && (hasNextPage || isLoading && operations.length === 0);
|
|
541
541
|
const visibleOperations = useMemo(() => isWalking ? [] : garbageCollect(sortOperations([...operations])).sort((a, b) => b.index - a.index), [operations, isWalking]);
|
|
542
|
-
const { pageItems, pages, goToPage, goToNextPage, goToPreviousPage, goToFirstPage, goToLastPage, hiddenNextPages, isNextPageAvailable, isPreviousPageAvailable } = usePagination(visibleOperations, {
|
|
542
|
+
const { pageItems, pages, goToPage, goToNextPage, goToPreviousPage, goToFirstPage, goToLastPage, hiddenNextPages, isNextPageAvailable, isPreviousPageAvailable } = usePagination(visibleOperations, {
|
|
543
|
+
itemsPerPage,
|
|
544
|
+
page: page === void 0 ? void 0 : page - 1,
|
|
545
|
+
onPageChange: onPageChange && ((index) => onPageChange(index + 1))
|
|
546
|
+
});
|
|
543
547
|
function onChangeScope(nextScope) {
|
|
544
548
|
goToFirstPage();
|
|
545
549
|
onScopeChange(nextScope);
|
|
@@ -635,4 +639,4 @@ function RevisionHistory(props) {
|
|
|
635
639
|
//#endregion
|
|
636
640
|
export { RevisionHistory };
|
|
637
641
|
|
|
638
|
-
//# sourceMappingURL=revision-history.impl-
|
|
642
|
+
//# sourceMappingURL=revision-history.impl-CrtSnhXQ.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"revision-history.impl-CrtSnhXQ.js","names":["Icon","Branch","props","branch","Icon","useCopyToClipboard","DocId","props","docId","onCopy","copy","handleCopy","text","then","catch","error","console","Icon","useCopyToClipboard","DocumentState","props","documentState","onCopyState","copy","handleCopy","jsonState","JSON","stringify","then","catch","error","console","ConnectSelect","labelFor","scope","charAt","toUpperCase","slice","Scope","props","scopes","value","onChange","items","map","displayValue","Icon","twMerge","Branch","DocId","DocumentState","Scope","Header","props","title","docId","scope","scopes","onChangeScope","onClose","className","documentState","onCopyState","onCopyDocId","divProps","Anchor","Content","Portal","Root","Trigger","useState","funnel","CodePopover","props","content","trigger","anchor","isOpen","setIsOpen","opener","triggerAt","minQuietPeriodMs","closer","open","cancel","call","close","changedIsOpen","e","preventDefault","top","right","bottom","left","useEns","formatEthAddress","CodePopover","ENSAvatar","FormattedJsonViewer","Address","props","address","chainId","data","ensData","shortenedAddress","avatar_url","undefined","Icon","twMerge","CodePopover","FormattedJsonViewer","Errors","props","errors","hasErrors","length","color","icon","text","content","Icon","CodePopover","FormattedJsonViewer","Operation","props","operationType","operationInput","Icon","CodePopover","FormattedJsonViewer","RevisionNumber","props","operationIndex","eventId","stateHash","revisionNumber","Icon","twMerge","CodePopover","FormattedJsonViewer","Signature","props","signatures","length","VerificationStatus","signatureCount","verifiedSignaturesCount","filter","signature","isVerified","signatureText","verificationStatusText","format","CodePopover","FormattedJsonViewer","Timestamp","props","timestampUtcMs","timestamp","timestampNumber","includes","parseInt","date","Date","shortDate","longDate","timestampFormatted","memo","Address","Errors","Operation","RevisionNumber","Signature","Timestamp","_Revision","props","Revision","Skip","props","operationIndex","skipCount","revisionNumber","skippedRevisions","makeRows","operations","revisionsAndSkips","seenDays","Set","operation","timestampUtcMs","day","split","has","add","push","type","height","operationIndex","index","eventId","id","stateHash","hash","operationType","action","operationInput","input","address","context","signer","user","chainId","signatures","makeSignatures","errors","error","undefined","skip","skipCount","getUniqueDatesInOrder","dates","date","Array","from","sort","a","b","Date","getTime","makeSignatureFromSignatureArray","signatureArray","signerAddress","prevStateHash","signatureBytes","isVerified","signaturesArray","map","Icon","format","Day","props","timestampUtcMs","timestamp","formattedDate","useVirtualizer","useMemo","useRef","Revision","Skip","makeRows","Day","ROW_INSET","DAY_MARKER_PULL","DAY_MARKER_OVERHANG","Timeline","props","operations","maxHeight","rows","parentRef","rowVirtualizer","count","length","getScrollElement","current","estimateSize","i","height","gap","overscan","overflowY","width","position","getTotalSize","marginLeft","getVirtualItems","map","virtualRow","row","index","key","top","left","right","size","transform","start","type","Pagination","usePagination","garbageCollect","sortOperations","useEffect","useMemo","useState","ConnectTooltipProvider","Header","Timeline","ScopedRevisionHistory","props","documentTitle","documentId","operations","isLoading","hasNextPage","onLoadNextPage","scopes","scope","onScopeChange","onClose","itemsPerPage","documentState","onCopyState","onCopyDocId","error","page","onPageChange","handle","window","setTimeout","clearTimeout","isWalking","length","visibleOperations","sort","a","b","index","pageItems","pages","goToPage","goToNextPage","goToPreviousPage","goToFirstPage","goToLastPage","hiddenNextPages","isNextPageAvailable","isPreviousPageAvailable","undefined","onChangeScope","nextScope","showPagination","PaginationComponent","hasOperations","message","LEGACY_SCOPES","noop","LegacyRevisionHistory","globalOperations","localOperations","common","setScope","RevisionHistory"],"sources":["../src/connect/components/revision-history/header/branch.tsx","../src/connect/components/revision-history/header/doc-id.tsx","../src/connect/components/revision-history/header/document-state.tsx","../src/connect/components/revision-history/header/scope.tsx","../src/connect/components/revision-history/header/header.tsx","../src/connect/components/code-popover.tsx","../src/connect/components/revision-history/revision/address.tsx","../src/connect/components/revision-history/revision/errors.tsx","../src/connect/components/revision-history/revision/operation.tsx","../src/connect/components/revision-history/revision/revision-number.tsx","../src/connect/components/revision-history/revision/signature.tsx","../src/connect/components/revision-history/revision/timestamp.tsx","../src/connect/components/revision-history/revision/revision.tsx","../src/connect/components/revision-history/skip/skip.tsx","../src/connect/components/revision-history/utils.ts","../src/connect/components/revision-history/timeline/day.tsx","../src/connect/components/revision-history/timeline/timeline.tsx","../src/connect/components/revision-history/revision-history.impl.tsx"],"sourcesContent":["import { Icon } from \"#design-system\";\n\ntype Props = {\n readonly branch?: string;\n};\nexport function Branch(props: Props) {\n const { branch = \"main\" } = props;\n\n return (\n <button className=\"flex h-8 w-fit items-center gap-1 rounded-lg bg-background pr-2 pl-1 text-xs text-foreground\">\n <Icon name=\"Branch\" />\n <span>BRANCH</span>\n <span className=\"text-foreground\">{branch}</span>\n </button>\n );\n}\n","import { Icon } from \"#design-system\";\nimport { useCopyToClipboard } from \"usehooks-ts\";\n\ntype Props = {\n readonly docId: string;\n readonly onCopy?: () => void;\n};\nexport function DocId(props: Props) {\n const { docId, onCopy } = props;\n const [, copy] = useCopyToClipboard();\n\n function handleCopy(text: string) {\n return () => {\n copy(text)\n .then(() => {\n onCopy?.();\n })\n .catch((error) => {\n console.error(\"Failed to copy!\", error);\n });\n };\n }\n\n return (\n <button\n className=\"flex h-8 w-fit items-center gap-1 rounded-lg bg-background pr-2 pl-1 text-xs text-foreground\"\n onClick={handleCopy(docId)}\n >\n <Icon name=\"Link\" />\n DOC ID\n <span className=\"text-foreground\">{docId}</span>\n </button>\n );\n}\n","import { Icon } from \"#design-system\";\nimport { useCopyToClipboard } from \"usehooks-ts\";\n\nexport type DocumentStateProps = {\n readonly documentState: object;\n readonly onCopyState?: () => void;\n};\n\nexport const DocumentState = (props: DocumentStateProps) => {\n const { documentState, onCopyState } = props;\n const [, copy] = useCopyToClipboard();\n\n function handleCopy() {\n const jsonState = JSON.stringify(documentState, null, 2);\n copy(jsonState)\n .then(() => {\n onCopyState?.();\n })\n .catch((error) => {\n console.error(\"Failed to copy document state!\", error);\n });\n }\n\n return (\n <button\n className=\"rounded-lg bg-background p-1 text-foreground\"\n onClick={handleCopy}\n >\n <Icon name=\"CurlyBrackets\" />\n </button>\n );\n};\n","import { ConnectSelect } from \"../../select/select.js\";\n\ntype Props = {\n readonly scopes: readonly string[];\n readonly value: string;\n readonly onChange: (value: string) => void;\n};\n\nfunction labelFor(scope: string) {\n return `${scope.charAt(0).toUpperCase()}${scope.slice(1)} scope`;\n}\n\nexport function Scope(props: Props) {\n const { scopes, value, onChange } = props;\n const items = scopes.map((scope) => ({\n displayValue: labelFor(scope),\n value: scope,\n }));\n\n return (\n <ConnectSelect\n absolutePositionMenu\n containerClassName=\"z-10 w-fit rounded-lg bg-background text-xs text-muted-foreground\"\n id=\"scope select\"\n itemClassName=\"grid grid-cols-[auto,auto] gap-1 py-2 text-muted-foreground\"\n items={items}\n menuClassName=\"min-w-0 text-muted-foreground\"\n onChange={onChange}\n value={value}\n />\n );\n}\n","import { Icon } from \"#design-system\";\nimport type { ReactNode } from \"react\";\nimport { twMerge } from \"tailwind-merge\";\nimport { Branch } from \"./branch.js\";\nimport { DocId } from \"./doc-id.js\";\nimport { DocumentState } from \"./document-state.js\";\nimport { Scope } from \"./scope.js\";\n\ninterface Props extends Omit<React.HTMLAttributes<HTMLDivElement>, \"title\"> {\n readonly title: ReactNode;\n readonly docId: string;\n readonly scope: string;\n readonly scopes: readonly string[];\n readonly onChangeScope: (scope: string) => void;\n readonly onClose: () => void;\n readonly documentState?: object;\n readonly onCopyState?: () => void;\n readonly onCopyDocId?: () => void;\n}\n\nexport function Header(props: Props) {\n const {\n title,\n docId,\n scope,\n scopes,\n onChangeScope,\n onClose,\n className,\n documentState,\n onCopyState,\n onCopyDocId,\n ...divProps\n } = props;\n return (\n <header\n className={twMerge(\n \"flex items-center justify-between bg-transparent\",\n className,\n )}\n {...divProps}\n >\n <div className=\"flex items-center gap-3\">\n <button\n name=\"close-revision-history\"\n className=\"rounded-lg bg-background p-1 text-foreground shadow-button\"\n onClick={onClose}\n >\n <Icon name=\"VariantArrowLeft\" />\n </button>\n <h1 className=\"text-xs text-foreground\">{title}</h1>\n </div>\n <div className=\"flex items-center gap-2\">\n <DocId docId={docId} onCopy={onCopyDocId} />\n {documentState && (\n <DocumentState\n documentState={documentState}\n onCopyState={onCopyState}\n />\n )}\n <Branch />\n <Scope onChange={onChangeScope} scopes={scopes} value={scope} />\n </div>\n </header>\n );\n}\n","import {\n Anchor,\n Content,\n Portal,\n Root,\n Trigger,\n} from \"@radix-ui/react-popover\";\nimport { useState, type ReactNode } from \"react\";\nimport { funnel } from \"remeda\";\n\n/* A hybrid popover / tooltip component intended for showing data that needs\n to show / hide on hover, while also being able to stay open so that the user can\n interact with its contents.\n\n Uses these rules:\n\n When the user hover's the trigger, show the tooltip / popover.\n Immediately place the content under the user's cursor.\n Then let the responsibility of closing the tooltip / popover be transferred _to the content_.\n When the user leaves _the contents_ or interacts elsewhere, only then close.\n*/\nexport function CodePopover(props: {\n content: ReactNode;\n trigger: ReactNode;\n anchor?: ReactNode;\n}) {\n const { content, trigger, anchor } = props;\n const [isOpen, setIsOpen] = useState(false);\n\n /* debounce calls to open by 300ms */\n const opener = funnel(() => setIsOpen(true), {\n triggerAt: \"start\",\n minQuietPeriodMs: 300,\n });\n\n /* debounce calls to close by 100ms */\n const closer = funnel(() => setIsOpen(false), {\n triggerAt: \"start\",\n minQuietPeriodMs: 100,\n });\n\n /* If we are in the process of closing, cancel that operation.\n Then call the opener.\n */\n function open() {\n closer.cancel();\n opener.call();\n }\n\n /* If we are in the process of opening, cancel that operation.\n Then call the closer.\n */\n function close() {\n opener.cancel();\n closer.call();\n }\n\n return (\n <Root\n /* This component combines internal state with the existing accessibility behaviors from the radix popover */\n open={isOpen}\n onOpenChange={(changedIsOpen) => (changedIsOpen ? open() : close())}\n >\n {/* Trigger only manages opening */}\n <Trigger onMouseEnter={open}>{trigger}</Trigger>\n {!!anchor && <Anchor asChild>{anchor}</Anchor>}\n <Portal>\n <Content\n /* We need to force mount so that the events are fired as expected */\n forceMount\n /* content only manages closing */\n onMouseLeave={close}\n /* Offset the position to ensure that we open under the user's cursor */\n sideOffset={-28}\n /* Do not focus the trigger after closing since that item is not interactive */\n onCloseAutoFocus={(e) => e.preventDefault()}\n /* Set an arbitrarily large bottom collision detection padding so that very long content flows below the fold */\n collisionPadding={{\n top: 24,\n right: 24,\n bottom: -10_000,\n left: 24,\n }}\n className=\"z-50 rounded-lg border border-border bg-popover p-2 text-xs text-popover-foreground shadow-tooltip outline-none\"\n >\n {content}\n </Content>\n </Portal>\n </Root>\n );\n}\n","import { useEns } from \"../../../hooks/use-ens.js\";\nimport { formatEthAddress } from \"../../../utils/address.js\";\nimport { CodePopover } from \"../../code-popover.js\";\nimport { ENSAvatar } from \"../../ens-avatar/ens-avatar.js\";\nimport { FormattedJsonViewer } from \"../../formatted-json-viewer.js\";\n\nexport type AddressProps = {\n readonly address: `0x${string}` | undefined;\n readonly chainId: number | undefined;\n};\n\nexport function Address(props: AddressProps) {\n const { address, chainId } = props;\n const { data: ensData } = useEns(address);\n\n if (!address) return null;\n\n const shortenedAddress = formatEthAddress(address);\n\n return (\n <CodePopover\n content={<FormattedJsonViewer value={{ address }} />}\n trigger={\n <span className=\"flex w-fit cursor-pointer items-center gap-1 rounded-lg bg-muted p-1 text-xs text-muted-foreground\">\n <ENSAvatar\n address={address}\n chainId={chainId}\n avatarUrl={ensData?.avatar_url ?? undefined}\n />\n {shortenedAddress}\n </span>\n }\n />\n );\n}\n","import { Icon } from \"#design-system\";\nimport { twMerge } from \"tailwind-merge\";\nimport { CodePopover } from \"../../code-popover.js\";\nimport { FormattedJsonViewer } from \"../../formatted-json-viewer.js\";\n\nexport type ErrorsProps = {\n readonly errors: string[] | undefined;\n};\n\nexport function Errors(props: ErrorsProps) {\n const { errors } = props;\n\n const hasErrors = !!errors?.length;\n\n const color = hasErrors ? \"text-destructive\" : \"text-success\";\n\n const icon = hasErrors ? (\n <Icon name=\"Exclamation\" size={16} />\n ) : (\n <Icon name=\"Check\" size={16} />\n );\n\n const text = hasErrors ? `Error: ${errors[0]}` : \"No errors\";\n\n const content = (\n <span\n className={twMerge(\n \"flex w-fit items-center rounded-lg border border-border bg-background px-2 py-1 text-xs\",\n color,\n hasErrors && \"cursor-pointer\",\n )}\n >\n {icon}\n <span className={twMerge(\"inline-block max-w-36 truncate\")}>{text}</span>\n </span>\n );\n\n if (hasErrors)\n return (\n <CodePopover\n content={<FormattedJsonViewer value={errors} />}\n trigger={content}\n />\n );\n\n return content;\n}\n","import { Icon } from \"#design-system\";\nimport { CodePopover } from \"../../code-popover.js\";\nimport { FormattedJsonViewer } from \"../../formatted-json-viewer.js\";\nexport type OperationProps = {\n readonly operationType: string;\n readonly operationInput: Record<string, any>;\n};\n\nexport function Operation(props: OperationProps) {\n const { operationType, operationInput } = props;\n return (\n <CodePopover\n content={<FormattedJsonViewer value={operationInput} />}\n trigger={\n <span className=\"flex cursor-pointer items-center gap-2 text-xs text-foreground\">\n {operationType}\n <Icon className=\"text-foreground\" name=\"Braces\" size={16} />\n </span>\n }\n />\n );\n}\n","import { Icon } from \"#design-system\";\nimport { CodePopover } from \"../../code-popover.js\";\nimport { FormattedJsonViewer } from \"../../formatted-json-viewer.js\";\n\nexport type RevisionNumberProps = {\n readonly operationIndex: number;\n readonly eventId: string;\n readonly stateHash: string;\n};\nexport function RevisionNumber(props: RevisionNumberProps) {\n const { operationIndex, eventId, stateHash } = props;\n const revisionNumber = operationIndex + 1;\n\n return (\n <CodePopover\n content={\n <FormattedJsonViewer\n value={{\n revisionNumber,\n eventId,\n stateHash,\n }}\n />\n }\n trigger={\n <span className=\"flex cursor-pointer items-center gap-2 text-xs text-foreground\">\n Revision {revisionNumber}.\n <a>\n <Icon\n className=\"cursor-pointer text-foreground\"\n name=\"Ellipsis\"\n size={14}\n />\n </a>\n </span>\n }\n />\n );\n}\n","import { Icon } from \"#design-system\";\nimport { twMerge } from \"tailwind-merge\";\nimport { CodePopover } from \"../../code-popover.js\";\nimport { FormattedJsonViewer } from \"../../formatted-json-viewer.js\";\nimport type { Signature } from \"../types.js\";\n\nexport type SignatureProps = {\n readonly signatures: Signature[] | undefined;\n};\nexport function Signature(props: SignatureProps) {\n const { signatures } = props;\n\n if (!signatures?.length) return null;\n\n return (\n <CodePopover\n trigger={\n <span className=\"flex w-fit cursor-pointer items-center gap-1 rounded-lg border border-border bg-background px-2 py-1\">\n <VerificationStatus signatures={signatures} />{\" \"}\n <Icon className=\"text-foreground\" name=\"InfoSquare\" size={16} />\n </span>\n }\n content={<FormattedJsonViewer value={signatures} collapsed={1} />}\n />\n );\n}\n\nfunction VerificationStatus(props: SignatureProps) {\n const { signatures } = props;\n\n if (!signatures?.length) return null;\n\n const signatureCount = signatures.length;\n\n const verifiedSignaturesCount = signatures.filter(\n (signature) => signature.isVerified,\n ).length;\n const signatureText = signatureCount === 1 ? \"signature\" : \"signatures\";\n const verificationStatusText = `${verifiedSignaturesCount}/${signatureCount} ${signatureText} verified`;\n\n return (\n <span\n className={twMerge(\n `text-xs`,\n verifiedSignaturesCount === 0\n ? \"text-destructive\"\n : verifiedSignaturesCount === signatureCount\n ? \"text-success\"\n : \"text-warning\",\n )}\n >\n {verificationStatusText}\n </span>\n );\n}\n","import { format } from \"date-fns\";\nimport { CodePopover } from \"../../code-popover.js\";\nimport { FormattedJsonViewer } from \"../../formatted-json-viewer.js\";\n\nexport type TimestampProps = {\n readonly timestampUtcMs: number | string;\n};\n\nexport function Timestamp(props: TimestampProps) {\n const { timestampUtcMs: timestamp } = props;\n\n const timestampNumber =\n typeof timestamp === \"string\" && !timestamp.includes(\"-\")\n ? parseInt(timestamp)\n : timestamp;\n\n const date = new Date(timestampNumber);\n const shortDate = format(date, \"HH:mm 'UTC'\");\n const longDate = format(date, \"eee, dd MMM yyyy HH:mm:ss 'UTC'\");\n\n return (\n <CodePopover\n content={\n <FormattedJsonViewer\n value={{ timestampFormatted: longDate, timestampUtcMs: timestamp }}\n />\n }\n trigger={\n <span className=\"cursor-pointer text-xs text-foreground\">\n committed at {shortDate}\n </span>\n }\n />\n );\n}\n","import { memo } from \"react\";\nimport type { Revision as RevisionProps } from \"../types.js\";\nimport { Address } from \"./address.js\";\nimport { Errors } from \"./errors.js\";\nimport { Operation } from \"./operation.js\";\nimport { RevisionNumber } from \"./revision-number.js\";\nimport { Signature } from \"./signature.js\";\nimport { Timestamp } from \"./timestamp.js\";\n\nexport function _Revision(props: RevisionProps) {\n return (\n <article className=\"flex items-center justify-between rounded-xl border border-border bg-background px-4 py-2\">\n <div className=\"flex items-center gap-2\">\n <RevisionNumber {...props} />\n <Operation {...props} />\n <Address {...props} />\n <Timestamp {...props} />\n </div>\n <div className=\"flex items-center gap-1\">\n <Signature {...props} />\n <Errors {...props} />\n </div>\n </article>\n );\n}\n\nexport const Revision = memo(_Revision);\n","export type SkipProps = {\n readonly operationIndex: number;\n readonly skipCount: number;\n};\n\nexport function Skip(props: SkipProps) {\n const { operationIndex, skipCount } = props;\n const revisionNumber = operationIndex;\n\n const skippedRevisions =\n skipCount === 1\n ? `${revisionNumber}`\n : `${revisionNumber} - ${revisionNumber + 1 - skipCount}`;\n\n return (\n <article className=\"grid grid-cols-[1fr,auto,1fr] items-center py-2\">\n <div className=\"h-px rounded-full bg-muted\" />\n <div className=\"mx-3 text-xs text-foreground\">\n [Skipped Revision {skippedRevisions}]\n </div>\n <div className=\"h-px rounded-full bg-muted\" />\n </article>\n );\n}\n","import type { Operation } from \"@powerhousedao/shared/document-model\";\nimport type { Day, Revision, Signature, Skip } from \"./types.js\";\n\nexport function makeRows(operations: Operation[]) {\n const revisionsAndSkips: (Revision | Skip | Day)[] = [];\n const seenDays = new Set<string>();\n\n for (const operation of operations) {\n if (!operation.timestampUtcMs) continue;\n const day = operation.timestampUtcMs.split(\"T\")[0];\n\n if (!seenDays.has(day)) {\n seenDays.add(day);\n revisionsAndSkips.push({\n type: \"day\",\n height: 32,\n timestampUtcMs: day,\n });\n }\n\n revisionsAndSkips.push({\n type: \"revision\",\n height: 46,\n operationIndex: operation.index,\n eventId: operation.id ?? \"EVENT_ID_NOT_FOUND\",\n stateHash: operation.hash,\n operationType: operation.action.type,\n operationInput: operation.action.input ?? {},\n address: operation.action?.context?.signer?.user.address as\n | `0x${string}`\n | undefined,\n chainId: operation.action?.context?.signer?.user.chainId,\n timestampUtcMs: operation.timestampUtcMs,\n signatures: makeSignatures(\n (operation.action?.context?.signer?.signatures as\n | string[][]\n | undefined) ?? [],\n ),\n errors: operation.error ? [operation.error] : undefined,\n });\n\n if (operation.skip > 0) {\n revisionsAndSkips.push({\n type: \"skip\",\n height: 34,\n operationIndex: operation.index,\n skipCount: operation.skip,\n timestampUtcMs: operation.timestampUtcMs,\n });\n }\n }\n\n return revisionsAndSkips;\n}\n\nexport function getUniqueDatesInOrder(operations: Operation[]) {\n const dates = new Set<string>();\n\n for (const operation of operations) {\n if (!operation.timestampUtcMs) continue;\n const date = operation.timestampUtcMs.split(\"T\")[0];\n dates.add(date);\n }\n\n return Array.from(dates).sort(\n (a, b) => new Date(b).getTime() - new Date(a).getTime(),\n );\n}\n\nfunction makeSignatureFromSignatureArray(signatureArray: string[]): Signature {\n const [signerAddress, hash, prevStateHash, signatureBytes] = signatureArray;\n\n return {\n signerAddress,\n hash,\n prevStateHash,\n signatureBytes,\n isVerified: true,\n };\n}\n\nfunction makeSignatures(signaturesArray: string[][] | undefined) {\n return signaturesArray?.map(makeSignatureFromSignatureArray);\n}\n","import { Icon } from \"#design-system\";\nimport { format } from \"date-fns\";\n\nexport function Day(props: { readonly timestampUtcMs: string }) {\n const { timestampUtcMs: timestamp } = props;\n const formattedDate = format(timestamp, \"MMM dd, yyyy\");\n return (\n <h2 className=\"-ml-6 flex items-center gap-1 bg-background py-2 text-xs text-foreground\">\n <Icon name=\"Ring\" size={16} /> Changes on {formattedDate}\n </h2>\n );\n}\n","import type { Operation } from \"@powerhousedao/shared/document-model\";\nimport { useVirtualizer } from \"@tanstack/react-virtual\";\nimport { useMemo, useRef } from \"react\";\nimport { Revision } from \"../revision/revision.js\";\nimport { Skip } from \"../skip/skip.js\";\nimport { makeRows } from \"../utils.js\";\nimport { Day } from \"./day.js\";\n\n/** How far each row is indented from the timeline's vertical line. */\nconst ROW_INSET = 16;\n\n/**\n * How far the day header is pulled back out again, so its ring sits centred\n * on the line rather than beside it: the `-ml-6` in `Day`.\n */\nconst DAY_MARKER_PULL = 24;\n\n/**\n * How far the line is inset from the scroll container's clip edge -- exactly\n * the amount the day marker hangs past it (24 pulled back from a 16 inset\n * leaves 8 on the wrong side of zero). Without this the ring is sliced in\n * half, since a scrolling box clips on both axes.\n */\nconst DAY_MARKER_OVERHANG = DAY_MARKER_PULL - ROW_INSET;\n\nexport type TimelineProps = {\n readonly operations: readonly Operation[];\n /**\n * Height cap for the scroll area. The virtualizer needs a viewport it can\n * scroll within; any CSS length works, and the default keeps the panel's\n * header and pagination reachable without scrolling past the timeline.\n */\n readonly maxHeight?: number | string;\n};\n\n/**\n * The revision timeline, windowed by row.\n *\n * The scroll element and the content are deliberately two different\n * elements. A virtualizer decides what is visible by comparing its scroll\n * element's viewport against the total content size, so a scroll element\n * sized to the content is a viewport that shows everything at once: it never\n * scrolls, every row is \"visible\", and the whole page renders while still\n * paying the virtualizer's bookkeeping. The outer element here is therefore\n * bounded and scrollable, and the inner sizer carries the full height that\n * the absolutely positioned rows are placed within.\n */\nexport function Timeline(props: TimelineProps) {\n const { operations, maxHeight = \"70vh\" } = props;\n const rows = useMemo(() => makeRows([...operations]), [operations]);\n\n const parentRef = useRef<HTMLDivElement>(null);\n\n const rowVirtualizer = useVirtualizer({\n count: rows.length,\n getScrollElement: () => parentRef.current,\n // Optional chaining, not rows[i].height: a shrinking list re-renders\n // before the virtualizer has re-measured, so this can be asked about an\n // index the new array no longer has.\n estimateSize: (i) => rows[i]?.height ?? 0,\n gap: 8,\n // A few rows either side so scrolling reveals rendered content rather\n // than blank space.\n overscan: 8,\n });\n\n return (\n <div\n data-testid=\"revision-timeline\"\n ref={parentRef}\n style={{\n maxHeight,\n overflowY: \"auto\",\n width: \"100%\",\n position: \"relative\",\n }}\n >\n {/*\n * The vertical line lives here rather than on the scroll container, and\n * is inset by the day marker's overhang. A scroll container clips at its\n * padding box on both axes -- setting overflow-y to auto forces\n * overflow-x from visible to auto -- so anything hanging off the line's\n * left would be cut, which is exactly what the day marker does.\n */}\n <div\n className=\"border-l border-border dark:border-none\"\n style={{\n height: `${rowVirtualizer.getTotalSize()}px`,\n marginLeft: DAY_MARKER_OVERHANG,\n position: \"relative\",\n }}\n >\n {rowVirtualizer.getVirtualItems().map((virtualRow) => {\n const row = rows[virtualRow.index];\n if (!row) return null;\n\n return (\n <div\n key={virtualRow.key}\n style={{\n position: \"absolute\",\n top: 0,\n left: ROW_INSET,\n // `right`, not `width: 100%`: a full-width row offset by\n // ROW_INSET runs that far past the line's right edge, which\n // the same clipping turns into a horizontal scrollbar.\n right: 0,\n height: `${virtualRow.size}px`,\n transform: `translateY(${virtualRow.start}px)`,\n }}\n >\n {row.type === \"revision\" && <Revision {...row} />}\n {row.type === \"skip\" && <Skip {...row} />}\n {row.type === \"day\" && <Day {...row} />}\n </div>\n );\n })}\n </div>\n </div>\n );\n}\n","import { Pagination, usePagination } from \"#design-system\";\nimport type { Operation } from \"@powerhousedao/shared/document-model\";\nimport {\n garbageCollect,\n sortOperations,\n} from \"@powerhousedao/shared/document-model\";\nimport { useEffect, useMemo, useState } from \"react\";\nimport { ConnectTooltipProvider } from \"../tooltip/tooltip.js\";\nimport { Header } from \"./header/header.js\";\nimport { Timeline } from \"./timeline/timeline.js\";\n\ntype CommonProps = {\n readonly documentTitle: string;\n readonly documentId: string;\n readonly onClose: () => void;\n readonly itemsPerPage?: number;\n readonly documentState?: object;\n readonly onCopyState?: () => void;\n readonly onCopyDocId?: () => void;\n /** Controlled: the page shown, from 1; pair with `onPageChange`. */\n readonly page?: number;\n readonly onPageChange?: (page: number) => void;\n};\n\n/** The current, scoped props. */\nexport type RevisionHistoryScopedProps = CommonProps & {\n /** The operations of the selected scope loaded so far, in any order. */\n readonly operations: readonly Operation[];\n /** A page of operations is being fetched. */\n readonly isLoading: boolean;\n /** More operations exist beyond the loaded ones. */\n readonly hasNextPage: boolean;\n /**\n * Called by the component whenever it can take the next page.\n * Must be referentially stable (for example the hook's `fetchNextPage`);\n * an inline arrow re-fires the effect every render.\n */\n readonly onLoadNextPage: () => void;\n /** The scopes offered in the selector, for example the keys of `document.header.revision`. */\n readonly scopes: readonly string[];\n /** The selected scope. */\n readonly scope: string;\n readonly onScopeChange: (scope: string) => void;\n /**\n * The last page failed. Operations loaded so far are still shown, and the\n * walk stops asking for more; there is no retry from inside the component.\n */\n readonly error?: Error;\n};\n\n/**\n * Legacy props: the whole global and local history, toggled inside the\n * component.\n * @deprecated Pass one scope's `operations` with `scopes`/`scope`/`onScopeChange` and the loading props. Removed in the next major.\n */\nexport type RevisionHistoryLegacyProps = CommonProps & {\n readonly globalOperations: readonly Operation[];\n readonly localOperations: readonly Operation[];\n};\n\nexport type RevisionHistoryProps =\n | RevisionHistoryScopedProps\n | RevisionHistoryLegacyProps;\n\n/**\n * The revision history panel. Pages arrive oldest first while the timeline\n * renders newest first, so rendering progressively would show operations in\n * the wrong order until the last page landed and would repaint the whole\n * timeline on every page in between. Instead the component keeps asking for\n * the next page, showing \"Loading operations…\" and a running count, until\n * the walk completes, then renders the pagination and timeline once.\n */\nfunction ScopedRevisionHistory(props: RevisionHistoryScopedProps) {\n const {\n documentTitle,\n documentId,\n operations,\n isLoading,\n hasNextPage,\n onLoadNextPage,\n scopes,\n scope,\n onScopeChange,\n onClose,\n itemsPerPage = 100,\n documentState,\n onCopyState,\n onCopyDocId,\n error,\n page,\n onPageChange,\n } = props;\n\n useEffect(() => {\n if (!hasNextPage || isLoading || error) return;\n // Deferred: the cache's fetch and the useSyncExternalStore-driven render\n // it triggers are both synchronous, so calling onLoadNextPage here\n // directly would chain fetch -> render -> effect -> fetch into one\n // uninterrupted task; setTimeout(0) yields so the status line paints and\n // the close button stays responsive between pages.\n const handle = window.setTimeout(onLoadNextPage, 0);\n return () => window.clearTimeout(handle);\n }, [hasNextPage, isLoading, onLoadNextPage, error]);\n\n // The history is incomplete: still fetching pages, or waiting on the very\n // first one. While true, nothing is rendered but the progress status. A\n // failed page ends the walk instead of latching this forever: we render\n // what loaded and a short failure line rather than spinning with no retry.\n const isWalking =\n !error && (hasNextPage || (isLoading && operations.length === 0));\n\n const visibleOperations = useMemo(\n () =>\n isWalking\n ? []\n : garbageCollect(sortOperations([...operations])).sort(\n (a, b) => b.index - a.index,\n ),\n [operations, isWalking],\n );\n\n const {\n pageItems,\n pages,\n goToPage,\n goToNextPage,\n goToPreviousPage,\n goToFirstPage,\n goToLastPage,\n hiddenNextPages,\n isNextPageAvailable,\n isPreviousPageAvailable,\n } = usePagination(visibleOperations, {\n itemsPerPage,\n page: page === undefined ? undefined : page - 1,\n onPageChange: onPageChange && ((index) => onPageChange(index + 1)),\n });\n\n function onChangeScope(nextScope: string) {\n goToFirstPage();\n onScopeChange(nextScope);\n }\n\n const showPagination = visibleOperations.length > itemsPerPage;\n\n const PaginationComponent = showPagination ? (\n <div className=\"mt-4 flex w-full justify-end\">\n <Pagination\n firstPageLabel=\"First Page\"\n goToFirstPage={goToFirstPage}\n goToLastPage={goToLastPage}\n goToNextPage={goToNextPage}\n goToPage={goToPage}\n goToPreviousPage={goToPreviousPage}\n hiddenNextPages={hiddenNextPages}\n isNextPageAvailable={isNextPageAvailable}\n isPreviousPageAvailable={isPreviousPageAvailable}\n lastPageLabel=\"Last Page\"\n nextPageLabel=\"Next\"\n pages={pages}\n previousPageLabel=\"Previous\"\n />\n </div>\n ) : (\n <hr className=\"h-12 border-none\" />\n );\n\n const hasOperations = visibleOperations.length > 0;\n\n return (\n <ConnectTooltipProvider>\n <div className=\"p-6\">\n <Header\n docId={documentId}\n onChangeScope={onChangeScope}\n onClose={onClose}\n scope={scope}\n scopes={scopes}\n title={documentTitle}\n documentState={documentState}\n onCopyState={onCopyState}\n onCopyDocId={onCopyDocId}\n />\n {isWalking ? (\n <div className=\"mt-4 flex flex-col items-center rounded-md bg-background p-4\">\n <h3 className=\"my-40 text-foreground\">Loading operations…</h3>\n {operations.length > 0 && (\n <p className=\"text-xs text-muted-foreground\">\n {operations.length} loaded so far\n </p>\n )}\n </div>\n ) : (\n <>\n {PaginationComponent}\n <div className=\"mt-4 flex flex-col items-center rounded-md bg-background p-4\">\n {error && (\n <p className=\"mb-2 text-xs text-destructive\">\n Could not load the rest of the history: {error.message}\n </p>\n )}\n {hasOperations ? (\n <div className=\"grid grid-cols-[minmax(min-content,1018px)]\">\n <Timeline operations={pageItems} />\n </div>\n ) : error ? null : (\n <h3 className=\"my-40 text-foreground\">\n This document has no recorded operations yet.\n </h3>\n )}\n </div>\n {PaginationComponent}\n </>\n )}\n </div>\n </ConnectTooltipProvider>\n );\n}\n\nconst LEGACY_SCOPES = [\"global\", \"local\"] as const;\nconst noop = () => {\n /* the legacy form has already loaded the whole history */\n};\n\n/** Toggles between the whole global and local history loaded up front. */\nfunction LegacyRevisionHistory(props: RevisionHistoryLegacyProps) {\n const { globalOperations, localOperations, ...common } = props;\n const [scope, setScope] = useState<string>(\"global\");\n return (\n <ScopedRevisionHistory\n {...common}\n operations={scope === \"local\" ? localOperations : globalOperations}\n isLoading={false}\n hasNextPage={false}\n onLoadNextPage={noop}\n scopes={LEGACY_SCOPES}\n scope={scope}\n onScopeChange={setScope}\n />\n );\n}\n\n/**\n * The revision history panel. Pages arrive oldest first while the timeline\n * renders newest first, so it waits for the whole history to load before\n * rendering the timeline, showing \"Loading operations…\" and a running count\n * in the meantime.\n *\n * Also accepts the deprecated `globalOperations`/`localOperations` pair\n * (see `RevisionHistoryLegacyProps`), toggling between them internally.\n */\nexport function RevisionHistory(props: RevisionHistoryProps) {\n return \"globalOperations\" in props ? (\n <LegacyRevisionHistory {...props} />\n ) : (\n <ScopedRevisionHistory {...props} />\n );\n}\n"],"mappings":";;;;;;;;;;;;;;AAKA,SAAgBC,OAAOC,OAAc;CACnC,MAAM,EAAEC,SAAS,WAAWD;CAE5B,OACE,qBAAC,UAAD;EAAQ,WAAU;EAAlB,UAAA;GACE,oBAAC,MAAD,EAAM,MAAK,SAAQ,CAAA;GACnB,oBAAC,QAAD,EAAA,UAAM,SAAY,CAAA;GAClB,oBAAC,QAAD;IAAM,WAAU;IAAmBC,UAAAA;GAAa,CAAA;EAC1C;;AAEZ;;;ACRA,SAAgBG,MAAMC,OAAc;CAClC,MAAM,EAAEC,OAAOC,WAAWF;CAC1B,MAAM,GAAGG,QAAQL,mBAAmB;CAEpC,SAASM,WAAWC,MAAc;EAChC,aAAa;GACXF,KAAKE,IAAI,CAAC,CACPC,WAAW;IACVJ,SAAS;GACX,CAAC,CAAC,CACDK,OAAOC,UAAU;IAChBC,QAAQD,MAAM,mBAAmBA,KAAK;GACxC,CAAC;EACL;CACF;CAEA,OACE,qBAAC,UAAD;EACE,WAAU;EACV,SAASJ,WAAWH,KAAK;EAF3B,UAAA;GAIE,oBAAC,MAAD,EAAM,MAAK,OAAM,CAAA;GAAA;GAEjB,oBAAC,QAAD;IAAM,WAAU;IAAmBA,UAAAA;GAAY,CAAA;EACzC;;AAEZ;;;ACzBA,MAAaW,iBAAiBC,UAA8B;CAC1D,MAAM,EAAEC,eAAeC,gBAAgBF;CACvC,MAAM,GAAGG,QAAQL,mBAAmB;CAEpC,SAASM,aAAa;EACpB,MAAMC,YAAYC,KAAKC,UAAUN,eAAe,MAAM,CAAC;EACvDE,KAAKE,SAAS,CAAC,CACZG,WAAW;GACVN,cAAc;EAChB,CAAC,CAAC,CACDO,OAAOC,UAAU;GAChBC,QAAQD,MAAM,kCAAkCA,KAAK;EACvD,CAAC;CACL;CAEA,OACE,oBAAC,UAAD;EACE,WAAU;EACV,SAASN;EAET,UAAA,o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gBAAgBF;EAChB,QAAQD;EACDtC;EACP,eAAe4C;CAAS,CAAA;AAG9B;;;;;;;;;;AAWA,SAAgBC,gBAAgBrD,OAA6B;CAC3D,OAAO,sBAAsBA,QAC3B,oBAAC,uBAAD,EAAuB,GAAIA,MAAM,CAAA,IAEjC,oBAAC,uBAAD,EAAuB,GAAIA,MAAM,CAAA;AAErC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { C as SelectProps, S as SelectOption, f as FieldErrorHandling, p as InputBaseProps } from "./index-
|
|
1
|
+
import { C as SelectProps, S as SelectOption, f as FieldErrorHandling, p as InputBaseProps } from "./index-Ck34z7kD.js";
|
|
2
2
|
import React from "react";
|
|
3
3
|
//#region src/ui/components/select-field/select-field.d.ts
|
|
4
4
|
type SelectFieldBaseProps = Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, keyof InputBaseProps<string | string[]> | keyof FieldErrorHandling | keyof SelectProps>;
|
|
@@ -17,4 +17,4 @@ declare const SelectField: React.ForwardRefExoticComponent<SelectFieldBaseProps
|
|
|
17
17
|
//#endregion
|
|
18
18
|
export { SelectFieldProps as n, SelectFieldRaw as r, SelectField as t };
|
|
19
19
|
export {};
|
|
20
|
-
//# sourceMappingURL=select-field-
|
|
20
|
+
//# sourceMappingURL=select-field-VZPf666l.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"select-field-
|
|
1
|
+
{"version":3,"file":"select-field-VZPf666l.d.ts","names":[],"sources":["../src/ui/components/select-field/select-field.tsx"],"mappings":";;;KAgBK,uBAAuB,KAC1B,MAAM,qBAAqB,0BACnB,0CACA,2BACA;KAGE,mBAAmB,uBAC7B,oCACA;EACE,UAAU;EACV,kBAAkB;IAChB,KAAK;cAEE,gBAAc,MAAA,0BAAA,uBAAA,oCAAA;EAJb,UAAA;EACQ,kBAAA;IAwLrB,KAAA,8CAAA,MAAA,cAAA;cAEY,aAAW,MAAA,0BAAA,uBAAA,oCAAA;EA3LV,UAAA;EACQ,kBAAA;IA2LiC,KAAA,8CAAA,MAAA"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { C as SelectProps } from "./index-
|
|
1
|
+
import { C as SelectProps } from "./index-Ck34z7kD.js";
|
|
2
2
|
import React from "react";
|
|
3
3
|
//#region src/ui/components/select-field/selected-content.d.ts
|
|
4
4
|
interface SelectedContentProps {
|
|
@@ -13,4 +13,4 @@ declare const SelectedContent: React.FC<SelectedContentProps>;
|
|
|
13
13
|
//#endregion
|
|
14
14
|
export { SelectedContent as t };
|
|
15
15
|
export {};
|
|
16
|
-
//# sourceMappingURL=selected-content-
|
|
16
|
+
//# sourceMappingURL=selected-content-D6NWiceG.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"selected-content-
|
|
1
|
+
{"version":3,"file":"selected-content-D6NWiceG.d.ts","names":[],"sources":["../src/ui/components/select-field/selected-content.tsx"],"mappings":";;;UAMU;EACR;EACA,SAAS;EACT;EACA;EACA;EACA;;cAGW,iBAAiB,MAAM,GAAG"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { _ as WithDifference } from "./index-
|
|
1
|
+
import { _ as WithDifference } from "./index-Ck34z7kD.js";
|
|
2
2
|
//#region src/ui/components/input/splitted-input-diff.d.ts
|
|
3
3
|
interface SplittedInputDiffProps extends WithDifference<string> {
|
|
4
4
|
value: string;
|
|
@@ -8,4 +8,4 @@ declare const SplittedInputDiff: ({ baseValue, value, viewMode, diffMode, showCo
|
|
|
8
8
|
//#endregion
|
|
9
9
|
export { SplittedInputDiff as t };
|
|
10
10
|
export {};
|
|
11
|
-
//# sourceMappingURL=splitted-input-diff-
|
|
11
|
+
//# sourceMappingURL=splitted-input-diff-Bkoi0Odc.d.ts.map
|
package/dist/{splitted-input-diff-BKRMH7vI.d.ts.map → splitted-input-diff-Bkoi0Odc.d.ts.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"splitted-input-diff-
|
|
1
|
+
{"version":3,"file":"splitted-input-diff-Bkoi0Odc.d.ts","names":[],"sources":["../src/ui/components/input/splitted-input-diff.tsx"],"mappings":";;UAwDU,+BAA+B;EACvC;EACA;;cAGW,sBAAiB,WAAA,OAAA,UAAA,UAAA,gBAM3B,uDAAsB,IAAA"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r as IconByName, t as Icon } from "./icon-
|
|
1
|
+
import { r as IconByName, t as Icon } from "./icon-CHR45tj_.js";
|
|
2
2
|
import { Suspense, forwardRef, useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from "react";
|
|
3
3
|
import { twJoin, twMerge } from "tailwind-merge";
|
|
4
4
|
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -774,9 +774,19 @@ function useAnimation(ref, isActive, onEnd) {
|
|
|
774
774
|
* }} - The pagination object with various functions and properties.
|
|
775
775
|
*/
|
|
776
776
|
function usePagination(items, options) {
|
|
777
|
-
const { itemsPerPage = 20, initialPage = 0, pageRange = 3 } = options || {};
|
|
778
|
-
const [
|
|
777
|
+
const { itemsPerPage = 20, initialPage = 0, pageRange = 3, page, onPageChange } = options || {};
|
|
778
|
+
const [ownPage, setOwnPage] = useState(initialPage);
|
|
779
779
|
const pageCount = Math.ceil(items.length / itemsPerPage);
|
|
780
|
+
const currentPage = page === void 0 ? ownPage : Math.max(0, Math.min(page, Math.max(pageCount - 1, 0)));
|
|
781
|
+
const setCurrentPage = useCallback((next) => {
|
|
782
|
+
const value = typeof next === "function" ? next(currentPage) : next;
|
|
783
|
+
if (page === void 0) setOwnPage(value);
|
|
784
|
+
else onPageChange?.(value);
|
|
785
|
+
}, [
|
|
786
|
+
currentPage,
|
|
787
|
+
page,
|
|
788
|
+
onPageChange
|
|
789
|
+
]);
|
|
780
790
|
const isNextPageAvailable = currentPage < pageCount - 1;
|
|
781
791
|
const isPreviousPageAvailable = currentPage > 0;
|
|
782
792
|
const goToNextPage = useCallback(() => {
|
|
@@ -787,13 +797,13 @@ function usePagination(items, options) {
|
|
|
787
797
|
}, [isPreviousPageAvailable, setCurrentPage]);
|
|
788
798
|
const goToLastPage = useCallback(() => {
|
|
789
799
|
setCurrentPage(pageCount - 1);
|
|
790
|
-
}, [pageCount]);
|
|
800
|
+
}, [pageCount, setCurrentPage]);
|
|
791
801
|
const goToFirstPage = useCallback(() => {
|
|
792
802
|
setCurrentPage(0);
|
|
793
|
-
}, []);
|
|
803
|
+
}, [setCurrentPage]);
|
|
794
804
|
const goToPage = useCallback((page) => {
|
|
795
805
|
if (page >= 0 && page < pageCount) setCurrentPage(page);
|
|
796
|
-
}, [pageCount]);
|
|
806
|
+
}, [pageCount, setCurrentPage]);
|
|
797
807
|
const pageOffset = Math.floor((pageRange - 1) / 2);
|
|
798
808
|
const availableRange = Math.min(pageRange, pageCount);
|
|
799
809
|
const maxStartIndex = Math.max(pageCount - availableRange);
|
|
@@ -853,4 +863,4 @@ const useWindowSize = () => {
|
|
|
853
863
|
//#endregion
|
|
854
864
|
export { DropdownMenuItem as _, useExitAnimation as a, PowerhouseButton as b, SidebarHeader as c, PackageAnimation as d, Modal as f, DropdownMenuContent as g, DropdownMenu as h, useEnterAnimation as i, SidebarPanel as l, iconNames as m, usePagination as n, Sidebar as o, iconComponents as p, useAnimation as r, SidebarFooter as s, useWindowSize as t, Pagination as u, DropdownMenuLabel as v, DropdownMenuTrigger as y };
|
|
855
865
|
|
|
856
|
-
//# sourceMappingURL=src-
|
|
866
|
+
//# sourceMappingURL=src-CohvVFnR.js.map
|