@powerhousedao/vetra 6.0.0-dev.249 → 6.0.0-dev.250
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/app-module-Bbj7PI-S.js +94 -0
- package/dist/app-module-Bbj7PI-S.js.map +1 -0
- package/dist/connect-CTIucT0o.js +6 -0
- package/dist/connect-CTIucT0o.js.map +1 -0
- package/dist/document-editor-DS-bZMKx.js +93 -0
- package/dist/document-editor-DS-bZMKx.js.map +1 -0
- package/dist/document-models/app-module/index.d.ts +349 -2
- package/dist/document-models/app-module/index.d.ts.map +1 -0
- package/dist/document-models/app-module/index.js +3 -2
- package/dist/document-models/document-editor/index.d.ts +325 -2
- package/dist/document-models/document-editor/index.d.ts.map +1 -0
- package/dist/document-models/document-editor/index.js +3 -2
- package/dist/document-models/index.d.ts +6 -29
- package/dist/document-models/index.js +6 -2
- package/dist/document-models/processor-module/index.d.ts +357 -2
- package/dist/document-models/processor-module/index.d.ts.map +1 -0
- package/dist/document-models/processor-module/index.js +3 -2
- package/dist/document-models/subgraph-module/index.d.ts +296 -2
- package/dist/document-models/subgraph-module/index.d.ts.map +1 -0
- package/dist/document-models/subgraph-module/index.js +3 -2
- package/dist/document-models/vetra-package/index.d.ts +386 -2
- package/dist/document-models/vetra-package/index.d.ts.map +1 -0
- package/dist/document-models/vetra-package/index.js +3 -2
- package/dist/{editor-DqkJ0B4G.js → editor-BSQfwcdz.js} +5 -4
- package/dist/{editor-DqkJ0B4G.js.map → editor-BSQfwcdz.js.map} +1 -1
- package/dist/{editor-CGNcK2z0.js → editor-Bku8e2dr.js} +5 -5
- package/dist/{editor-CGNcK2z0.js.map → editor-Bku8e2dr.js.map} +1 -1
- package/dist/{editor-ddcGG42r.js → editor-CbtrPBTP.js} +5 -4
- package/dist/{editor-ddcGG42r.js.map → editor-CbtrPBTP.js.map} +1 -1
- package/dist/{editor-D4FHn5u4.js → editor-D70FYIwV.js} +2 -2
- package/dist/{editor-D4FHn5u4.js.map → editor-D70FYIwV.js.map} +1 -1
- package/dist/{editor-CdzYJozI.js → editor-Dtg8STyT.js} +5 -5
- package/dist/{editor-CdzYJozI.js.map → editor-Dtg8STyT.js.map} +1 -1
- package/dist/{editor-CgkzQJ4g.js → editor-SfVorwsP.js} +6 -6
- package/dist/{editor-CgkzQJ4g.js.map → editor-SfVorwsP.js.map} +1 -1
- package/dist/editors/hooks/index.js +1 -1
- package/dist/editors/index.d.ts +13 -12
- package/dist/editors/index.d.ts.map +1 -1
- package/dist/editors/index.js +2 -2
- package/dist/{codegen-PnsnCMkw.js → factory-CweZppg6.js} +51 -3
- package/dist/factory-CweZppg6.js.map +1 -0
- package/dist/factory-D8ZDOMP3.js +79 -0
- package/dist/factory-D8ZDOMP3.js.map +1 -0
- package/dist/{hooks-Vx4YtE1e.js → hooks-Xexr33XS.js} +1 -1
- package/dist/{hooks-Vx4YtE1e.js.map → hooks-Xexr33XS.js.map} +1 -1
- package/dist/index.d.ts +7 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +13 -5
- package/dist/index.js.map +1 -1
- package/dist/{processor-module-CkuQiq7B.js → module-BWlCj_0C.js} +159 -204
- package/dist/module-BWlCj_0C.js.map +1 -0
- package/dist/{subgraph-module-CU_-umq2.js → module-BoGgbKmO.js} +111 -153
- package/dist/module-BoGgbKmO.js.map +1 -0
- package/dist/module-BoX1rWiq.d.ts +6 -0
- package/dist/module-BoX1rWiq.d.ts.map +1 -0
- package/dist/module-CG6K37P8.d.ts +6 -0
- package/dist/module-CG6K37P8.d.ts.map +1 -0
- package/dist/{app-module-BbhoykB5.js → module-CTPfENDU.js} +149 -189
- package/dist/module-CTPfENDU.js.map +1 -0
- package/dist/{module-BW12i5H3.js → module-CXIFrq-R.js} +15 -11
- package/dist/module-CXIFrq-R.js.map +1 -0
- package/dist/{vetra-package-VqptqKzx.js → module-CZLiUtDI.js} +186 -236
- package/dist/module-CZLiUtDI.js.map +1 -0
- package/dist/module-Cr-9knz_.d.ts +6 -0
- package/dist/module-Cr-9knz_.d.ts.map +1 -0
- package/dist/{document-editor-CHM7Pu4m.js → module-D0SK3Nds.js} +137 -180
- package/dist/module-D0SK3Nds.js.map +1 -0
- package/dist/module-DhhQLYnQ.d.ts +6 -0
- package/dist/module-DhhQLYnQ.d.ts.map +1 -0
- package/dist/module-J-kGIl1E.d.ts +6 -0
- package/dist/module-J-kGIl1E.d.ts.map +1 -0
- package/dist/powerhouse.manifest.d.ts +8 -5
- package/dist/powerhouse.manifest.d.ts.map +1 -1
- package/dist/powerhouse.manifest.js +19 -12
- package/dist/processor-module-D0lRrrpW.js +95 -0
- package/dist/processor-module-D0lRrrpW.js.map +1 -0
- package/dist/processors/codegen/index.d.ts +21322 -2
- package/dist/processors/codegen/index.d.ts.map +1 -0
- package/dist/processors/codegen/index.js +2 -2
- package/dist/processors/index.d.ts +4 -15
- package/dist/processors/index.d.ts.map +1 -1
- package/dist/processors/index.js +8 -81
- package/dist/processors/index.js.map +1 -1
- package/dist/processors/vetra-read-model/index.d.ts +18599 -2
- package/dist/processors/vetra-read-model/index.d.ts.map +1 -0
- package/dist/processors/vetra-read-model/index.js +2 -54
- package/dist/subgraph-module-B3ipwOza.js +92 -0
- package/dist/subgraph-module-B3ipwOza.js.map +1 -0
- package/dist/switchboard-JOTFVXuj.js +8 -0
- package/dist/switchboard-JOTFVXuj.js.map +1 -0
- package/dist/{useVetraDocument-DF0teXXM.js → useVetraDocument-DoAwvHVi.js} +1 -1
- package/dist/{useVetraDocument-DF0teXXM.js.map → useVetraDocument-DoAwvHVi.js.map} +1 -1
- package/dist/vetra-package-YNLxEA-U.js +100 -0
- package/dist/vetra-package-YNLxEA-U.js.map +1 -0
- package/package.json +9 -8
- package/dist/app-module-BbhoykB5.js.map +0 -1
- package/dist/codegen-PnsnCMkw.js.map +0 -1
- package/dist/document-editor-CHM7Pu4m.js.map +0 -1
- package/dist/document-models/index.d.ts.map +0 -1
- package/dist/editor-Bsu4yikl.js +0 -2
- package/dist/index-CHfOF-Et.d.ts +0 -363
- package/dist/index-CHfOF-Et.d.ts.map +0 -1
- package/dist/index-CL_CHW_Z.d.ts +0 -330
- package/dist/index-CL_CHW_Z.d.ts.map +0 -1
- package/dist/index-C_kUPMNf.d.ts +0 -298
- package/dist/index-C_kUPMNf.d.ts.map +0 -1
- package/dist/index-CxWUNzph.d.ts +0 -21319
- package/dist/index-CxWUNzph.d.ts.map +0 -1
- package/dist/index-Ofk3NYAC.d.ts +0 -18596
- package/dist/index-Ofk3NYAC.d.ts.map +0 -1
- package/dist/index-Qr_rU6VS.d.ts +0 -271
- package/dist/index-Qr_rU6VS.d.ts.map +0 -1
- package/dist/index-cBMMID-w.d.ts +0 -323
- package/dist/index-cBMMID-w.d.ts.map +0 -1
- package/dist/module-BW12i5H3.js.map +0 -1
- package/dist/module-XCoMwFat.js +0 -59
- package/dist/module-XCoMwFat.js.map +0 -1
- package/dist/processor-module-CkuQiq7B.js.map +0 -1
- package/dist/processors/vetra-read-model/index.js.map +0 -1
- package/dist/subgraph-module-CU_-umq2.js.map +0 -1
- package/dist/vetra-package-VqptqKzx.js.map +0 -1
|
@@ -1,2 +1,386 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { t as VetraPackage } from "../../module-J-kGIl1E.js";
|
|
2
|
+
import * as document_model0 from "document-model";
|
|
3
|
+
import { Action, DocumentModelGlobalState, DocumentModelUtils, PHAuthState, PHBaseState, PHDocument as PHDocument$1, PHDocumentController, PHDocumentState, Reducer, SignalDispatch, UpgradeManifest } from "document-model";
|
|
4
|
+
import * as z$1 from "zod";
|
|
5
|
+
import { z } from "zod";
|
|
6
|
+
import { DocumentDispatch } from "@powerhousedao/reactor-browser";
|
|
7
|
+
|
|
8
|
+
//#region document-models/vetra-package/upgrades/versions.d.ts
|
|
9
|
+
declare const supportedVersions: readonly [1];
|
|
10
|
+
declare const latestVersion: 1;
|
|
11
|
+
//#endregion
|
|
12
|
+
//#region document-models/vetra-package/upgrades/upgrade-manifest.d.ts
|
|
13
|
+
declare const vetraPackageUpgradeManifest: UpgradeManifest<typeof supportedVersions>;
|
|
14
|
+
//#endregion
|
|
15
|
+
//#region document-models/vetra-package/v1/actions.d.ts
|
|
16
|
+
/** Actions for the VetraPackage document model */
|
|
17
|
+
declare const actions: any;
|
|
18
|
+
//#endregion
|
|
19
|
+
//#region document-models/vetra-package/v1/gen/schema/types.d.ts
|
|
20
|
+
type Maybe<T> = T | null | undefined;
|
|
21
|
+
type InputMaybe<T> = T | null | undefined;
|
|
22
|
+
type Exact<T extends {
|
|
23
|
+
[key: string]: unknown;
|
|
24
|
+
}> = { [K in keyof T]: T[K] };
|
|
25
|
+
type MakeOptional<T, K extends keyof T> = Omit<T, K> & { [SubKey in K]?: Maybe<T[SubKey]> };
|
|
26
|
+
type MakeMaybe<T, K extends keyof T> = Omit<T, K> & { [SubKey in K]: Maybe<T[SubKey]> };
|
|
27
|
+
type MakeEmpty<T extends {
|
|
28
|
+
[key: string]: unknown;
|
|
29
|
+
}, K extends keyof T> = { [_ in K]?: never };
|
|
30
|
+
type Incremental<T> = T | { [P in keyof T]?: P extends " $fragmentName" | "__typename" ? T[P] : never };
|
|
31
|
+
/** All built-in and custom scalars, mapped to their actual values */
|
|
32
|
+
type Scalars = {
|
|
33
|
+
ID: {
|
|
34
|
+
input: string;
|
|
35
|
+
output: string;
|
|
36
|
+
};
|
|
37
|
+
String: {
|
|
38
|
+
input: string;
|
|
39
|
+
output: string;
|
|
40
|
+
};
|
|
41
|
+
Boolean: {
|
|
42
|
+
input: boolean;
|
|
43
|
+
output: boolean;
|
|
44
|
+
};
|
|
45
|
+
Int: {
|
|
46
|
+
input: number;
|
|
47
|
+
output: number;
|
|
48
|
+
};
|
|
49
|
+
Float: {
|
|
50
|
+
input: number;
|
|
51
|
+
output: number;
|
|
52
|
+
};
|
|
53
|
+
Address: {
|
|
54
|
+
input: `${string}:0x${string}`;
|
|
55
|
+
output: `${string}:0x${string}`;
|
|
56
|
+
};
|
|
57
|
+
Amount: {
|
|
58
|
+
input: {
|
|
59
|
+
unit?: string;
|
|
60
|
+
value?: number;
|
|
61
|
+
};
|
|
62
|
+
output: {
|
|
63
|
+
unit?: string;
|
|
64
|
+
value?: number;
|
|
65
|
+
};
|
|
66
|
+
};
|
|
67
|
+
Amount_Crypto: {
|
|
68
|
+
input: {
|
|
69
|
+
unit: string;
|
|
70
|
+
value: string;
|
|
71
|
+
};
|
|
72
|
+
output: {
|
|
73
|
+
unit: string;
|
|
74
|
+
value: string;
|
|
75
|
+
};
|
|
76
|
+
};
|
|
77
|
+
Amount_Currency: {
|
|
78
|
+
input: {
|
|
79
|
+
unit: string;
|
|
80
|
+
value: string;
|
|
81
|
+
};
|
|
82
|
+
output: {
|
|
83
|
+
unit: string;
|
|
84
|
+
value: string;
|
|
85
|
+
};
|
|
86
|
+
};
|
|
87
|
+
Amount_Fiat: {
|
|
88
|
+
input: {
|
|
89
|
+
unit: string;
|
|
90
|
+
value: number;
|
|
91
|
+
};
|
|
92
|
+
output: {
|
|
93
|
+
unit: string;
|
|
94
|
+
value: number;
|
|
95
|
+
};
|
|
96
|
+
};
|
|
97
|
+
Amount_Money: {
|
|
98
|
+
input: number;
|
|
99
|
+
output: number;
|
|
100
|
+
};
|
|
101
|
+
Amount_Percentage: {
|
|
102
|
+
input: number;
|
|
103
|
+
output: number;
|
|
104
|
+
};
|
|
105
|
+
Amount_Tokens: {
|
|
106
|
+
input: number;
|
|
107
|
+
output: number;
|
|
108
|
+
};
|
|
109
|
+
Attachment: {
|
|
110
|
+
input: string;
|
|
111
|
+
output: string;
|
|
112
|
+
};
|
|
113
|
+
Currency: {
|
|
114
|
+
input: string;
|
|
115
|
+
output: string;
|
|
116
|
+
};
|
|
117
|
+
Date: {
|
|
118
|
+
input: string;
|
|
119
|
+
output: string;
|
|
120
|
+
};
|
|
121
|
+
DateTime: {
|
|
122
|
+
input: string;
|
|
123
|
+
output: string;
|
|
124
|
+
};
|
|
125
|
+
EmailAddress: {
|
|
126
|
+
input: string;
|
|
127
|
+
output: string;
|
|
128
|
+
};
|
|
129
|
+
EthereumAddress: {
|
|
130
|
+
input: string;
|
|
131
|
+
output: string;
|
|
132
|
+
};
|
|
133
|
+
OID: {
|
|
134
|
+
input: string;
|
|
135
|
+
output: string;
|
|
136
|
+
};
|
|
137
|
+
OLabel: {
|
|
138
|
+
input: string;
|
|
139
|
+
output: string;
|
|
140
|
+
};
|
|
141
|
+
PHID: {
|
|
142
|
+
input: string;
|
|
143
|
+
output: string;
|
|
144
|
+
};
|
|
145
|
+
URL: {
|
|
146
|
+
input: string;
|
|
147
|
+
output: string;
|
|
148
|
+
};
|
|
149
|
+
Unknown: {
|
|
150
|
+
input: unknown;
|
|
151
|
+
output: unknown;
|
|
152
|
+
};
|
|
153
|
+
Upload: {
|
|
154
|
+
input: File;
|
|
155
|
+
output: File;
|
|
156
|
+
};
|
|
157
|
+
};
|
|
158
|
+
type AddPackageKeywordInput = {
|
|
159
|
+
id: Scalars["String"]["input"];
|
|
160
|
+
label: Scalars["String"]["input"];
|
|
161
|
+
};
|
|
162
|
+
/** Author/maintainer of the Vetra Package. */
|
|
163
|
+
type Author = {
|
|
164
|
+
/** Display name of the author or organization. */name: Maybe<Scalars["String"]["output"]>; /** Author's website URL. */
|
|
165
|
+
website: Maybe<Scalars["URL"]["output"]>;
|
|
166
|
+
};
|
|
167
|
+
/** A single search keyword attached to the package. */
|
|
168
|
+
type Keyword = {
|
|
169
|
+
/** Stable identifier for the keyword entry; used to remove it. */id: Scalars["OID"]["output"]; /** Display label for the keyword (e.g. 'invoicing', 'defi'). */
|
|
170
|
+
label: Scalars["String"]["output"];
|
|
171
|
+
};
|
|
172
|
+
type RemovePackageKeywordInput = {
|
|
173
|
+
id: Scalars["String"]["input"];
|
|
174
|
+
};
|
|
175
|
+
type SetPackageAuthorInput = {
|
|
176
|
+
name?: InputMaybe<Scalars["OID"]["input"]>;
|
|
177
|
+
website?: InputMaybe<Scalars["URL"]["input"]>;
|
|
178
|
+
};
|
|
179
|
+
type SetPackageAuthorNameInput = {
|
|
180
|
+
name: Scalars["String"]["input"];
|
|
181
|
+
};
|
|
182
|
+
type SetPackageAuthorWebsiteInput = {
|
|
183
|
+
website: Scalars["URL"]["input"];
|
|
184
|
+
};
|
|
185
|
+
type SetPackageCategoryInput = {
|
|
186
|
+
category: Scalars["String"]["input"];
|
|
187
|
+
};
|
|
188
|
+
type SetPackageDescriptionInput = {
|
|
189
|
+
description: Scalars["String"]["input"];
|
|
190
|
+
};
|
|
191
|
+
type SetPackageGithubUrlInput = {
|
|
192
|
+
url: Scalars["URL"]["input"];
|
|
193
|
+
};
|
|
194
|
+
type SetPackageNameInput = {
|
|
195
|
+
name: Scalars["String"]["input"];
|
|
196
|
+
};
|
|
197
|
+
type SetPackageNpmUrlInput = {
|
|
198
|
+
url: Scalars["URL"]["input"];
|
|
199
|
+
};
|
|
200
|
+
/**
|
|
201
|
+
* Package metadata used to publish a Vetra Reactor Package to npm and surface
|
|
202
|
+
* it inside Connect/Switchboard. All fields are optional so a package can be
|
|
203
|
+
* created empty and filled in incrementally during development.
|
|
204
|
+
*/
|
|
205
|
+
type VetraPackageState = {
|
|
206
|
+
/** Author/maintainer information surfaced in the published package metadata. */author: Author; /** Free-form category label used to group packages in directories (e.g. 'Finance', 'Productivity'). */
|
|
207
|
+
category: Maybe<Scalars["String"]["output"]>; /** One-paragraph summary of what the package provides. Shown on package listing pages. */
|
|
208
|
+
description: Maybe<Scalars["String"]["output"]>; /** Public source code URL (typically a GitHub repository). */
|
|
209
|
+
githubUrl: Maybe<Scalars["URL"]["output"]>; /** Search keywords associated with the package. Each keyword has a stable id so it can be removed individually. */
|
|
210
|
+
keywords: Array<Keyword>; /** Human-readable package name (e.g. 'Pizza Plaza'). Distinct from the npm package id. */
|
|
211
|
+
name: Maybe<Scalars["String"]["output"]>; /** Published npm package URL. Set once the package has been released. */
|
|
212
|
+
npmUrl: Maybe<Scalars["URL"]["output"]>;
|
|
213
|
+
};
|
|
214
|
+
//#endregion
|
|
215
|
+
//#region document-models/vetra-package/v1/gen/types.d.ts
|
|
216
|
+
type VetraPackageLocalState = Record<PropertyKey, never>;
|
|
217
|
+
type VetraPackagePHState = PHBaseState & {
|
|
218
|
+
global: VetraPackageState;
|
|
219
|
+
local: VetraPackageLocalState;
|
|
220
|
+
};
|
|
221
|
+
type VetraPackageDocument = PHDocument$1<VetraPackagePHState>;
|
|
222
|
+
//#endregion
|
|
223
|
+
//#region document-models/vetra-package/v1/gen/base-operations/actions.d.ts
|
|
224
|
+
type SetPackageNameAction = Action & {
|
|
225
|
+
type: "SET_PACKAGE_NAME";
|
|
226
|
+
input: SetPackageNameInput;
|
|
227
|
+
};
|
|
228
|
+
type SetPackageDescriptionAction = Action & {
|
|
229
|
+
type: "SET_PACKAGE_DESCRIPTION";
|
|
230
|
+
input: SetPackageDescriptionInput;
|
|
231
|
+
};
|
|
232
|
+
type SetPackageCategoryAction = Action & {
|
|
233
|
+
type: "SET_PACKAGE_CATEGORY";
|
|
234
|
+
input: SetPackageCategoryInput;
|
|
235
|
+
};
|
|
236
|
+
type SetPackageAuthorAction = Action & {
|
|
237
|
+
type: "SET_PACKAGE_AUTHOR";
|
|
238
|
+
input: SetPackageAuthorInput;
|
|
239
|
+
};
|
|
240
|
+
type SetPackageAuthorNameAction = Action & {
|
|
241
|
+
type: "SET_PACKAGE_AUTHOR_NAME";
|
|
242
|
+
input: SetPackageAuthorNameInput;
|
|
243
|
+
};
|
|
244
|
+
type SetPackageAuthorWebsiteAction = Action & {
|
|
245
|
+
type: "SET_PACKAGE_AUTHOR_WEBSITE";
|
|
246
|
+
input: SetPackageAuthorWebsiteInput;
|
|
247
|
+
};
|
|
248
|
+
type AddPackageKeywordAction = Action & {
|
|
249
|
+
type: "ADD_PACKAGE_KEYWORD";
|
|
250
|
+
input: AddPackageKeywordInput;
|
|
251
|
+
};
|
|
252
|
+
type RemovePackageKeywordAction = Action & {
|
|
253
|
+
type: "REMOVE_PACKAGE_KEYWORD";
|
|
254
|
+
input: RemovePackageKeywordInput;
|
|
255
|
+
};
|
|
256
|
+
type SetPackageGithubUrlAction = Action & {
|
|
257
|
+
type: "SET_PACKAGE_GITHUB_URL";
|
|
258
|
+
input: SetPackageGithubUrlInput;
|
|
259
|
+
};
|
|
260
|
+
type SetPackageNpmUrlAction = Action & {
|
|
261
|
+
type: "SET_PACKAGE_NPM_URL";
|
|
262
|
+
input: SetPackageNpmUrlInput;
|
|
263
|
+
};
|
|
264
|
+
type VetraPackageBaseOperationsAction = SetPackageNameAction | SetPackageDescriptionAction | SetPackageCategoryAction | SetPackageAuthorAction | SetPackageAuthorNameAction | SetPackageAuthorWebsiteAction | AddPackageKeywordAction | RemovePackageKeywordAction | SetPackageGithubUrlAction | SetPackageNpmUrlAction;
|
|
265
|
+
//#endregion
|
|
266
|
+
//#region document-models/vetra-package/v1/gen/actions.d.ts
|
|
267
|
+
type VetraPackageAction = VetraPackageBaseOperationsAction;
|
|
268
|
+
//#endregion
|
|
269
|
+
//#region document-models/vetra-package/v1/gen/base-operations/operations.d.ts
|
|
270
|
+
interface VetraPackageBaseOperationsOperations {
|
|
271
|
+
setPackageNameOperation: (state: VetraPackageState, action: SetPackageNameAction, dispatch?: SignalDispatch) => void;
|
|
272
|
+
setPackageDescriptionOperation: (state: VetraPackageState, action: SetPackageDescriptionAction, dispatch?: SignalDispatch) => void;
|
|
273
|
+
setPackageCategoryOperation: (state: VetraPackageState, action: SetPackageCategoryAction, dispatch?: SignalDispatch) => void;
|
|
274
|
+
setPackageAuthorOperation: (state: VetraPackageState, action: SetPackageAuthorAction, dispatch?: SignalDispatch) => void;
|
|
275
|
+
setPackageAuthorNameOperation: (state: VetraPackageState, action: SetPackageAuthorNameAction, dispatch?: SignalDispatch) => void;
|
|
276
|
+
setPackageAuthorWebsiteOperation: (state: VetraPackageState, action: SetPackageAuthorWebsiteAction, dispatch?: SignalDispatch) => void;
|
|
277
|
+
addPackageKeywordOperation: (state: VetraPackageState, action: AddPackageKeywordAction, dispatch?: SignalDispatch) => void;
|
|
278
|
+
removePackageKeywordOperation: (state: VetraPackageState, action: RemovePackageKeywordAction, dispatch?: SignalDispatch) => void;
|
|
279
|
+
setPackageGithubUrlOperation: (state: VetraPackageState, action: SetPackageGithubUrlAction, dispatch?: SignalDispatch) => void;
|
|
280
|
+
setPackageNpmUrlOperation: (state: VetraPackageState, action: SetPackageNpmUrlAction, dispatch?: SignalDispatch) => void;
|
|
281
|
+
}
|
|
282
|
+
//#endregion
|
|
283
|
+
//#region document-models/vetra-package/v1/gen/controller.d.ts
|
|
284
|
+
declare const VetraPackageController: new (initialDocument?: PHDocument<TState>) => PHDocumentController<any> & document_model0.ActionMap<any, PHDocumentController<any>>;
|
|
285
|
+
declare namespace creators_d_exports {
|
|
286
|
+
export { addPackageKeyword, removePackageKeyword, setPackageAuthor, setPackageAuthorName, setPackageAuthorWebsite, setPackageCategory, setPackageDescription, setPackageGithubUrl, setPackageName, setPackageNpmUrl };
|
|
287
|
+
}
|
|
288
|
+
declare const setPackageName: (input: SetPackageNameInput) => any;
|
|
289
|
+
declare const setPackageDescription: (input: SetPackageDescriptionInput) => any;
|
|
290
|
+
declare const setPackageCategory: (input: SetPackageCategoryInput) => any;
|
|
291
|
+
declare const setPackageAuthor: (input: SetPackageAuthorInput) => any;
|
|
292
|
+
declare const setPackageAuthorName: (input: SetPackageAuthorNameInput) => any;
|
|
293
|
+
declare const setPackageAuthorWebsite: (input: SetPackageAuthorWebsiteInput) => any;
|
|
294
|
+
declare const addPackageKeyword: (input: AddPackageKeywordInput) => any;
|
|
295
|
+
declare const removePackageKeyword: (input: RemovePackageKeywordInput) => any;
|
|
296
|
+
declare const setPackageGithubUrl: (input: SetPackageGithubUrlInput) => any;
|
|
297
|
+
declare const setPackageNpmUrl: (input: SetPackageNpmUrlInput) => any;
|
|
298
|
+
//#endregion
|
|
299
|
+
//#region document-models/vetra-package/v1/gen/document-model.d.ts
|
|
300
|
+
declare const documentModel: DocumentModelGlobalState;
|
|
301
|
+
//#endregion
|
|
302
|
+
//#region document-models/vetra-package/v1/gen/document-schema.d.ts
|
|
303
|
+
/** Schema for validating the header object of a VetraPackage document */
|
|
304
|
+
declare const VetraPackageDocumentHeaderSchema: any;
|
|
305
|
+
/** Schema for validating the state object of a VetraPackage document */
|
|
306
|
+
declare const VetraPackagePHStateSchema: any;
|
|
307
|
+
declare const VetraPackageDocumentSchema: z.ZodObject<{
|
|
308
|
+
header: any;
|
|
309
|
+
state: any;
|
|
310
|
+
initialState: any;
|
|
311
|
+
}, z.core.$strip>;
|
|
312
|
+
/** Simple helper function to check if a state object is a VetraPackage document state object */
|
|
313
|
+
declare function isVetraPackageState(state: unknown): state is VetraPackagePHState;
|
|
314
|
+
/** Simple helper function to assert that a document state object is a VetraPackage document state object */
|
|
315
|
+
declare function assertIsVetraPackageState(state: unknown): asserts state is VetraPackagePHState;
|
|
316
|
+
/** Simple helper function to check if a document is a VetraPackage document */
|
|
317
|
+
declare function isVetraPackageDocument(document: unknown): document is VetraPackageDocument;
|
|
318
|
+
/** Simple helper function to assert that a document is a VetraPackage document */
|
|
319
|
+
declare function assertIsVetraPackageDocument(document: unknown): asserts document is VetraPackageDocument;
|
|
320
|
+
//#endregion
|
|
321
|
+
//#region document-models/vetra-package/v1/gen/document-type.d.ts
|
|
322
|
+
/**
|
|
323
|
+
* WARNING: DO NOT EDIT
|
|
324
|
+
* This file is auto-generated and updated by codegen
|
|
325
|
+
*/
|
|
326
|
+
declare const vetraPackageDocumentType = "powerhouse/package";
|
|
327
|
+
//#endregion
|
|
328
|
+
//#region document-models/vetra-package/v1/gen/ph-factories.d.ts
|
|
329
|
+
declare function defaultGlobalState(): VetraPackageState;
|
|
330
|
+
declare function defaultLocalState(): VetraPackageLocalState;
|
|
331
|
+
declare function defaultPHState(): VetraPackagePHState;
|
|
332
|
+
declare function createState(baseState?: Partial<PHBaseState>, globalState?: Partial<VetraPackageState>, localState?: Partial<VetraPackageLocalState>): VetraPackagePHState;
|
|
333
|
+
/**
|
|
334
|
+
* Creates a VetraPackageDocument with custom global and local state
|
|
335
|
+
* This properly handles the PHBaseState requirements while allowing
|
|
336
|
+
* document-specific state to be set.
|
|
337
|
+
*/
|
|
338
|
+
declare function createVetraPackageDocument(state?: Partial<{
|
|
339
|
+
auth?: Partial<PHAuthState>;
|
|
340
|
+
document?: Partial<PHDocumentState>;
|
|
341
|
+
global?: Partial<VetraPackageState>;
|
|
342
|
+
local?: Partial<VetraPackageLocalState>;
|
|
343
|
+
}>): VetraPackageDocument;
|
|
344
|
+
//#endregion
|
|
345
|
+
//#region document-models/vetra-package/v1/gen/reducer.d.ts
|
|
346
|
+
declare const reducer: Reducer<VetraPackagePHState>;
|
|
347
|
+
//#endregion
|
|
348
|
+
//#region document-models/vetra-package/v1/gen/schema/zod.d.ts
|
|
349
|
+
type Properties<T> = Required<{ [K in keyof T]: z$1.ZodType<T[K]> }>;
|
|
350
|
+
type definedNonNullAny = {};
|
|
351
|
+
declare const isDefinedNonNullAny: (v: any) => v is definedNonNullAny;
|
|
352
|
+
declare const definedNonNullAnySchema: z$1.ZodAny & z$1.ZodType<definedNonNullAny, any, z$1.core.$ZodTypeInternals<definedNonNullAny, any>>;
|
|
353
|
+
declare function AddPackageKeywordInputSchema(): z$1.ZodObject<Properties<AddPackageKeywordInput>>;
|
|
354
|
+
declare function AuthorSchema(): z$1.ZodObject<Properties<Author>>;
|
|
355
|
+
declare function KeywordSchema(): z$1.ZodObject<Properties<Keyword>>;
|
|
356
|
+
declare function RemovePackageKeywordInputSchema(): z$1.ZodObject<Properties<RemovePackageKeywordInput>>;
|
|
357
|
+
declare function SetPackageAuthorInputSchema(): z$1.ZodObject<Properties<SetPackageAuthorInput>>;
|
|
358
|
+
declare function SetPackageAuthorNameInputSchema(): z$1.ZodObject<Properties<SetPackageAuthorNameInput>>;
|
|
359
|
+
declare function SetPackageAuthorWebsiteInputSchema(): z$1.ZodObject<Properties<SetPackageAuthorWebsiteInput>>;
|
|
360
|
+
declare function SetPackageCategoryInputSchema(): z$1.ZodObject<Properties<SetPackageCategoryInput>>;
|
|
361
|
+
declare function SetPackageDescriptionInputSchema(): z$1.ZodObject<Properties<SetPackageDescriptionInput>>;
|
|
362
|
+
declare function SetPackageGithubUrlInputSchema(): z$1.ZodObject<Properties<SetPackageGithubUrlInput>>;
|
|
363
|
+
declare function SetPackageNameInputSchema(): z$1.ZodObject<Properties<SetPackageNameInput>>;
|
|
364
|
+
declare function SetPackageNpmUrlInputSchema(): z$1.ZodObject<Properties<SetPackageNpmUrlInput>>;
|
|
365
|
+
declare function VetraPackageStateSchema(): z$1.ZodObject<Properties<VetraPackageState>>;
|
|
366
|
+
//#endregion
|
|
367
|
+
//#region document-models/vetra-package/v1/gen/utils.d.ts
|
|
368
|
+
declare const initialGlobalState: VetraPackageState;
|
|
369
|
+
declare const initialLocalState: VetraPackageLocalState;
|
|
370
|
+
//#endregion
|
|
371
|
+
//#region document-models/vetra-package/v1/hooks.d.ts
|
|
372
|
+
/** Hook to get a VetraPackage document by its id */
|
|
373
|
+
declare function useVetraPackageDocumentById(documentId: string | null | undefined): [VetraPackageDocument, DocumentDispatch<VetraPackageAction>] | [undefined, undefined];
|
|
374
|
+
/** Hook to get the selected VetraPackage document */
|
|
375
|
+
declare function useSelectedVetraPackageDocument(): [VetraPackageDocument, DocumentDispatch<VetraPackageAction>];
|
|
376
|
+
/** Hook to get all VetraPackage documents in the selected drive */
|
|
377
|
+
declare function useVetraPackageDocumentsInSelectedDrive(): PHDocument<any>[] | undefined;
|
|
378
|
+
/** Hook to get all VetraPackage documents in the selected folder */
|
|
379
|
+
declare function useVetraPackageDocumentsInSelectedFolder(): PHDocument<any>[] | undefined;
|
|
380
|
+
//#endregion
|
|
381
|
+
//#region document-models/vetra-package/v1/utils.d.ts
|
|
382
|
+
/** Utils for the VetraPackage document model */
|
|
383
|
+
declare const utils: DocumentModelUtils<VetraPackagePHState>;
|
|
384
|
+
//#endregion
|
|
385
|
+
export { AddPackageKeywordAction, AddPackageKeywordInput, AddPackageKeywordInputSchema, Author, AuthorSchema, Exact, Incremental, InputMaybe, Keyword, KeywordSchema, MakeEmpty, MakeMaybe, MakeOptional, Maybe, RemovePackageKeywordAction, RemovePackageKeywordInput, RemovePackageKeywordInputSchema, Scalars, SetPackageAuthorAction, SetPackageAuthorInput, SetPackageAuthorInputSchema, SetPackageAuthorNameAction, SetPackageAuthorNameInput, SetPackageAuthorNameInputSchema, SetPackageAuthorWebsiteAction, SetPackageAuthorWebsiteInput, SetPackageAuthorWebsiteInputSchema, SetPackageCategoryAction, SetPackageCategoryInput, SetPackageCategoryInputSchema, SetPackageDescriptionAction, SetPackageDescriptionInput, SetPackageDescriptionInputSchema, SetPackageGithubUrlAction, SetPackageGithubUrlInput, SetPackageGithubUrlInputSchema, SetPackageNameAction, SetPackageNameInput, SetPackageNameInputSchema, SetPackageNpmUrlAction, SetPackageNpmUrlInput, SetPackageNpmUrlInputSchema, VetraPackage, type VetraPackageAction, VetraPackageBaseOperationsAction, VetraPackageBaseOperationsOperations, VetraPackageController, type VetraPackageDocument, VetraPackageDocumentHeaderSchema, VetraPackageDocumentSchema, type VetraPackageState as VetraPackageGlobalState, VetraPackageState, type VetraPackageLocalState, type VetraPackagePHState, VetraPackagePHStateSchema, VetraPackageStateSchema, actions, addPackageKeyword, assertIsVetraPackageDocument, assertIsVetraPackageState, createState, createVetraPackageDocument, defaultGlobalState, defaultLocalState, defaultPHState, definedNonNullAnySchema, documentModel, initialGlobalState, initialLocalState, isDefinedNonNullAny, isVetraPackageDocument, isVetraPackageState, latestVersion, reducer, removePackageKeyword, setPackageAuthor, setPackageAuthorName, setPackageAuthorWebsite, setPackageCategory, setPackageDescription, setPackageGithubUrl, setPackageName, setPackageNpmUrl, supportedVersions, useSelectedVetraPackageDocument, useVetraPackageDocumentById, useVetraPackageDocumentsInSelectedDrive, useVetraPackageDocumentsInSelectedFolder, utils, creators_d_exports as vetraPackageBaseOperationsActions, vetraPackageDocumentType, vetraPackageUpgradeManifest };
|
|
386
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":[],"sources":["../../../document-models/vetra-package/upgrades/versions.ts","../../../document-models/vetra-package/upgrades/upgrade-manifest.ts","../../../document-models/vetra-package/v1/actions.ts","../../../document-models/vetra-package/v1/gen/schema/types.ts","../../../document-models/vetra-package/v1/gen/types.ts","../../../document-models/vetra-package/v1/gen/base-operations/actions.ts","../../../document-models/vetra-package/v1/gen/actions.ts","../../../document-models/vetra-package/v1/gen/base-operations/operations.ts","../../../document-models/vetra-package/v1/gen/controller.ts","../../../document-models/vetra-package/v1/gen/base-operations/creators.ts","../../../document-models/vetra-package/v1/gen/document-model.ts","../../../document-models/vetra-package/v1/gen/document-schema.ts","../../../document-models/vetra-package/v1/gen/document-type.ts","../../../document-models/vetra-package/v1/gen/ph-factories.ts","../../../document-models/vetra-package/v1/gen/reducer.ts","../../../document-models/vetra-package/v1/gen/schema/zod.ts","../../../document-models/vetra-package/v1/gen/utils.ts","../../../document-models/vetra-package/v1/hooks.ts","../../../document-models/vetra-package/v1/utils.ts"],"mappings":";;;;;;;;cAAa,iBAAA;AAAA,cAEA,aAAA;;;cCKA,2BAAA,EAA6B,eAAA,QACjC,iBAAA;;;;cCCI,OAAA;;;KCTD,KAAA,MAAW,CAAA;AAAA,KACX,UAAA,MAAgB,CAAA;AAAA,KAChB,KAAA;EAAA,CAAmB,GAAA;AAAA,mBACjB,CAAA,GAAI,CAAA,CAAE,CAAA;AAAA,KAER,YAAA,oBAAgC,CAAA,IAAK,IAAA,CAAK,CAAA,EAAG,CAAA,iBAC5C,CAAA,IAAK,KAAA,CAAM,CAAA,CAAE,MAAA;AAAA,KAEd,SAAA,oBAA6B,CAAA,IAAK,IAAA,CAAK,CAAA,EAAG,CAAA,iBACzC,CAAA,GAAI,KAAA,CAAM,CAAA,CAAE,MAAA;AAAA,KAEb,SAAA;EAAA,CACG,GAAA;AAAA,m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jBhB,2BAAA,CACd,UAAA,+BAEG,oBAAA,EAAsB,gBAAA,CAAiB,kBAAA;;iBAQ5B,+BAAA,CAAA,IACd,oBAAA,EACA,gBAAA,CAAiB,kBAAA;;iBASH,uCAAA,CAAA,GAAuC,UAAA;;iBAMvC,wCAAA,CAAA,GAAwC,UAAA;;;;cCvC3C,KAAA,EAAO,kBAAA,CAAmB,mBAAA"}
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
import { A as
|
|
2
|
-
|
|
1
|
+
import { A as KeywordSchema, B as VetraPackageStateSchema, C as setPackageCategory, D as setPackageNpmUrl, E as setPackageName, F as SetPackageCategoryInputSchema, H as isDefinedNonNullAny, I as SetPackageDescriptionInputSchema, L as SetPackageGithubUrlInputSchema, M as SetPackageAuthorInputSchema, N as SetPackageAuthorNameInputSchema, O as AddPackageKeywordInputSchema, P as SetPackageAuthorWebsiteInputSchema, R as SetPackageNameInputSchema, S as setPackageAuthorWebsite, T as setPackageGithubUrl, V as definedNonNullAnySchema, _ as addPackageKeyword, b as setPackageAuthor, c as VetraPackagePHStateSchema, d as isVetraPackageDocument, f as isVetraPackageState, g as actions, h as documentModel, i as initialLocalState, j as RemovePackageKeywordInputSchema, k as AuthorSchema, l as assertIsVetraPackageDocument, m as reducer, n as utils, o as VetraPackageDocumentHeaderSchema, p as vetraPackageDocumentType, r as initialGlobalState, s as VetraPackageDocumentSchema, t as VetraPackage, u as assertIsVetraPackageState, v as creators_exports, w as setPackageDescription, x as setPackageAuthorName, y as removePackageKeyword, z as SetPackageNpmUrlInputSchema } from "../../module-CZLiUtDI.js";
|
|
2
|
+
import { a as useVetraPackageDocumentById, c as createState, d as defaultLocalState, f as defaultPHState, i as useSelectedVetraPackageDocument, l as createVetraPackageDocument, n as latestVersion, o as useVetraPackageDocumentsInSelectedDrive, p as VetraPackageController, r as supportedVersions, s as useVetraPackageDocumentsInSelectedFolder, t as vetraPackageUpgradeManifest, u as defaultGlobalState } from "../../vetra-package-YNLxEA-U.js";
|
|
3
|
+
export { AddPackageKeywordInputSchema, AuthorSchema, KeywordSchema, RemovePackageKeywordInputSchema, SetPackageAuthorInputSchema, SetPackageAuthorNameInputSchema, SetPackageAuthorWebsiteInputSchema, SetPackageCategoryInputSchema, SetPackageDescriptionInputSchema, SetPackageGithubUrlInputSchema, SetPackageNameInputSchema, SetPackageNpmUrlInputSchema, VetraPackage, VetraPackageController, VetraPackageDocumentHeaderSchema, VetraPackageDocumentSchema, VetraPackagePHStateSchema, VetraPackageStateSchema, actions, addPackageKeyword, assertIsVetraPackageDocument, assertIsVetraPackageState, createState, createVetraPackageDocument, defaultGlobalState, defaultLocalState, defaultPHState, definedNonNullAnySchema, documentModel, initialGlobalState, initialLocalState, isDefinedNonNullAny, isVetraPackageDocument, isVetraPackageState, latestVersion, reducer, removePackageKeyword, setPackageAuthor, setPackageAuthorName, setPackageAuthorWebsite, setPackageCategory, setPackageDescription, setPackageGithubUrl, setPackageName, setPackageNpmUrl, supportedVersions, useSelectedVetraPackageDocument, useVetraPackageDocumentById, useVetraPackageDocumentsInSelectedDrive, useVetraPackageDocumentsInSelectedFolder, utils, creators_exports as vetraPackageBaseOperationsActions, vetraPackageDocumentType, vetraPackageUpgradeManifest };
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { _ as addDocumentType, b as setEditorName, x as setEditorStatus, y as removeDocumentType } from "./module-D0SK3Nds.js";
|
|
2
|
+
import { s as useSelectedDocumentEditorDocument } from "./document-editor-DS-bZMKx.js";
|
|
3
3
|
import { StatusPill } from "./editors/components/index.js";
|
|
4
|
+
import { n as useAvailableDocumentTypes, t as useDebounce } from "./hooks-Xexr33XS.js";
|
|
4
5
|
import { useSetPHDocumentEditorConfig } from "@powerhousedao/reactor-browser";
|
|
5
6
|
import { Suspense, useCallback, useEffect, useState } from "react";
|
|
6
|
-
import { DocumentToolbar } from "@powerhousedao/design-system/connect";
|
|
7
7
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
8
|
+
import { DocumentToolbar } from "@powerhousedao/design-system/connect";
|
|
8
9
|
//#region editors/document-editor/components/DocumentEditorForm.tsx
|
|
9
10
|
function DocumentTypeSelectUI(props) {
|
|
10
11
|
return /* @__PURE__ */ jsxs("select", {
|
|
@@ -170,4 +171,4 @@ function Editor() {
|
|
|
170
171
|
//#endregion
|
|
171
172
|
export { Editor as default };
|
|
172
173
|
|
|
173
|
-
//# sourceMappingURL=editor-
|
|
174
|
+
//# sourceMappingURL=editor-BSQfwcdz.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"editor-DqkJ0B4G.js","names":[],"sources":["../editors/document-editor/components/DocumentEditorForm.tsx","../editors/document-editor/config.ts","../editors/document-editor/editor.tsx"],"sourcesContent":["import { Suspense, useEffect, useState } from \"react\";\nimport type {\n AddDocumentTypeInput,\n DocumentTypeItem,\n RemoveDocumentTypeInput,\n} from \"../../../document-models/document-editor/index.js\";\nimport { StatusPill } from \"../../components/index.js\";\nimport { useAvailableDocumentTypes, useDebounce } from \"../../hooks/index.js\";\n\nexport interface DocumentEditorFormProps {\n editorName?: string;\n documentTypes?: DocumentTypeItem[];\n status?: string;\n onEditorNameChange?: (name: string) => void;\n onAddDocumentType?: (input: AddDocumentTypeInput) => void;\n onRemoveDocumentType?: (input: RemoveDocumentTypeInput) => void;\n onConfirm?: () => void;\n}\n\nfunction DocumentTypeSelectUI(\n props: React.SelectHTMLAttributes<HTMLSelectElement>,\n) {\n return (\n <select\n id=\"supported-document-types\"\n className=\"w-full rounded-md border border-gray-300 px-3 py-2 focus:border-transparent focus:ring-2 focus:ring-blue-500 focus:outline-none\"\n {...props}\n >\n <option value=\"\">Select a document type</option>\n {props.children}\n </select>\n );\n}\n\nfunction DocumentTypeSelect({\n documentTypes,\n setDocumentTypes,\n onAddDocumentType,\n onRemoveDocumentType,\n}: {\n setDocumentTypes: (documentTypes: DocumentTypeItem[]) => void;\n} & Pick<\n DocumentEditorFormProps,\n \"documentTypes\" | \"onAddDocumentType\" | \"onRemoveDocumentType\"\n>) {\n // Get available document types from the hook (vetra drive only for document editor)\n const availableDocumentTypes = useAvailableDocumentTypes(true);\n const [selectedDocumentType, setSelectedDocumentType] = useState(\"\");\n\n return (\n <DocumentTypeSelectUI\n value={selectedDocumentType}\n onChange={(e) => {\n const selectedValue = e.target.value;\n if (selectedValue) {\n // Remove existing document type if any\n\n const existingType = documentTypes?.at(0);\n if (existingType) {\n onRemoveDocumentType?.({ id: existingType.id });\n }\n\n // Add the new document type\n const newTypeInput: AddDocumentTypeInput = {\n id: Date.now().toString(), // Generate a unique ID\n documentType: selectedValue,\n };\n const newType: DocumentTypeItem = {\n id: newTypeInput.id,\n documentType: newTypeInput.documentType,\n };\n setDocumentTypes([newType]); // Replace with single item array\n onAddDocumentType?.(newTypeInput);\n }\n setSelectedDocumentType(\"\");\n }}\n >\n {availableDocumentTypes.map((docType) => (\n <option key={docType} value={docType}>\n {docType}\n </option>\n ))}\n </DocumentTypeSelectUI>\n );\n}\n\nexport const DocumentEditorForm: React.FC<DocumentEditorFormProps> = ({\n editorName: initialEditorName = \"\",\n documentTypes: initialDocumentTypes = [],\n status = \"DRAFT\",\n onEditorNameChange,\n onAddDocumentType,\n onRemoveDocumentType,\n onConfirm,\n}) => {\n const [editorName, setEditorName] = useState(initialEditorName);\n const [documentTypes, setDocumentTypes] =\n useState<DocumentTypeItem[]>(initialDocumentTypes);\n const [isConfirmed, setIsConfirmed] = useState(false);\n\n // Use the debounce hook for name changes\n useDebounce(editorName, onEditorNameChange, 300);\n\n // Update local state when initial values change\n useEffect(() => {\n // eslint-disable-next-line react-hooks/set-state-in-effect\n setEditorName(initialEditorName);\n }, [initialEditorName]);\n\n useEffect(() => {\n // eslint-disable-next-line react-hooks/set-state-in-effect\n setDocumentTypes(initialDocumentTypes);\n }, [initialDocumentTypes]);\n\n // Reset confirmation state if status changes back to DRAFT\n useEffect(() => {\n if (status === \"DRAFT\") {\n // eslint-disable-next-line react-hooks/set-state-in-effect\n setIsConfirmed(false);\n }\n }, [status]);\n\n // Check if form should be read-only\n const isReadOnly = isConfirmed || status === \"CONFIRMED\";\n\n const handleConfirm = () => {\n if (editorName.trim() && documentTypes.length > 0) {\n setIsConfirmed(true); // Immediate UI update\n onConfirm?.();\n }\n };\n\n return (\n <div className=\"space-y-6 p-6\">\n <div className=\"flex items-center justify-between\">\n <h2 className=\"text-lg font-medium text-gray-900\">\n Editor Configuration\n </h2>\n <StatusPill\n status={status === \"CONFIRMED\" ? \"confirmed\" : \"draft\"}\n label={status === \"CONFIRMED\" ? \"Confirmed\" : \"Draft\"}\n />\n </div>\n\n {/* Editor Name Field */}\n <div>\n <label\n htmlFor=\"editor-name\"\n className=\"mb-2 block text-sm font-medium text-gray-700\"\n >\n Editor Name\n </label>\n <input\n id=\"editor-name\"\n type=\"text\"\n value={editorName}\n onChange={(e) => setEditorName(e.target.value)}\n disabled={isReadOnly}\n className={`w-full rounded-md border border-gray-300 px-3 py-2 focus:border-transparent focus:ring-2 focus:ring-blue-500 focus:outline-none ${\n isReadOnly ? \"cursor-not-allowed bg-gray-100\" : \"\"\n }`}\n />\n </div>\n\n {/* Supported Document Types Field */}\n <div>\n <label\n htmlFor=\"supported-document-types\"\n className=\"mb-2 block text-sm font-medium text-gray-700\"\n >\n Supported Document Types\n </label>\n <div className=\"space-y-2\">\n {!isReadOnly && (\n <Suspense fallback={<DocumentTypeSelectUI />}>\n <DocumentTypeSelect\n documentTypes={documentTypes}\n setDocumentTypes={setDocumentTypes}\n onAddDocumentType={onAddDocumentType}\n onRemoveDocumentType={onRemoveDocumentType}\n />\n </Suspense>\n )}\n <div className=\"space-y-1\">\n {documentTypes.map((type) => (\n <div key={type.id} className=\"flex items-center py-1\">\n <span className=\"text-sm text-gray-700\">\n {type.documentType}\n </span>\n {!isReadOnly && (\n <button\n onClick={() => {\n setDocumentTypes([]);\n onRemoveDocumentType?.({ id: type.id });\n }}\n className=\"ml-2 text-gray-400 hover:text-gray-600 focus:outline-none\"\n >\n ×\n </button>\n )}\n </div>\n ))}\n </div>\n </div>\n </div>\n\n {/* Confirm Button - only show if not in read-only mode */}\n {!isReadOnly && (\n <div>\n <button\n onClick={handleConfirm}\n disabled={!editorName.trim() || documentTypes.length === 0}\n className=\"rounded-md bg-blue-600 px-4 py-2 text-white hover:bg-blue-700 focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 focus:outline-none disabled:cursor-not-allowed disabled:bg-gray-300\"\n >\n Confirm\n </button>\n </div>\n )}\n </div>\n );\n};\n","import type { PHDocumentEditorConfig } from \"@powerhousedao/reactor-browser\";\n\nexport const editorConfig: PHDocumentEditorConfig = {\n isExternalControlsEnabled: false,\n};\n","import { DocumentToolbar } from \"@powerhousedao/design-system/connect\";\nimport { useSetPHDocumentEditorConfig } from \"@powerhousedao/reactor-browser\";\nimport { useCallback } from \"react\";\nimport { useSelectedDocumentEditorDocument } from \"../../document-models/document-editor/hooks.js\";\nimport {\n addDocumentType,\n removeDocumentType,\n setEditorName,\n setEditorStatus,\n type AddDocumentTypeInput,\n type RemoveDocumentTypeInput,\n} from \"../../document-models/document-editor/index.js\";\nimport { DocumentEditorForm } from \"./components/DocumentEditorForm.js\";\nimport { editorConfig } from \"./config.js\";\n\nexport default function Editor() {\n useSetPHDocumentEditorConfig(editorConfig);\n const [document, dispatch] = useSelectedDocumentEditorDocument();\n\n const onEditorNameChange = useCallback(\n (name: string) => {\n if (!document.state.global.name && !name) return;\n if (name === document.state.global.name) return;\n\n dispatch(setEditorName({ name }));\n },\n [document.state.global.name, dispatch],\n );\n\n const onAddDocumentType = useCallback(\n (input: AddDocumentTypeInput) => {\n dispatch(addDocumentType(input));\n },\n [dispatch],\n );\n\n const onRemoveDocumentType = useCallback(\n (input: RemoveDocumentTypeInput) => {\n dispatch(removeDocumentType(input));\n },\n [dispatch],\n );\n\n const onConfirm = useCallback(() => {\n dispatch(setEditorStatus({ status: \"CONFIRMED\" }));\n }, [dispatch]);\n\n return (\n <div className=\"bg-gray-50 p-6\">\n <DocumentToolbar />\n <DocumentEditorForm\n status={document.state.global.status}\n editorName={document.state.global.name ?? \"\"}\n documentTypes={document.state.global.documentTypes}\n onEditorNameChange={onEditorNameChange}\n onAddDocumentType={onAddDocumentType}\n onRemoveDocumentType={onRemoveDocumentType}\n onConfirm={onConfirm}\n />\n </div>\n );\n}\n"],"mappings":";;;;;;;;AAmBA,SAAS,qBACP,OACA;AACA,QACE,qBAAC,UAAD;EACE,IAAG;EACH,WAAU;EACV,GAAI;YAHN,CAKE,oBAAC,UAAD;GAAQ,OAAM;aAAG;GAA+B,CAAA,EAC/C,MAAM,SACA;;;AAIb,SAAS,mBAAmB,EAC1B,eACA,kBACA,mBACA,wBAMC;CAED,MAAM,yBAAyB,0BAA0B,KAAK;CAC9D,MAAM,CAAC,sBAAsB,2BAA2B,SAAS,GAAG;AAEpE,QACE,oBAAC,sBAAD;EACE,OAAO;EACP,WAAW,MAAM;GACf,MAAM,gBAAgB,EAAE,OAAO;AAC/B,OAAI,eAAe;IAGjB,MAAM,eAAe,eAAe,GAAG,EAAE;AACzC,QAAI,aACF,wBAAuB,EAAE,IAAI,aAAa,IAAI,CAAC;IAIjD,MAAM,eAAqC;KACzC,IAAI,KAAK,KAAK,CAAC,UAAU;KACzB,cAAc;KACf;AAKD,qBAAiB,CAJiB;KAChC,IAAI,aAAa;KACjB,cAAc,aAAa;KAC5B,CACyB,CAAC;AAC3B,wBAAoB,aAAa;;AAEnC,2BAAwB,GAAG;;YAG5B,uBAAuB,KAAK,YAC3B,oBAAC,UAAD;GAAsB,OAAO;aAC1B;GACM,EAFI,QAEJ,CACT;EACmB,CAAA;;AAI3B,MAAa,sBAAyD,EACpE,YAAY,oBAAoB,IAChC,eAAe,uBAAuB,EAAE,EACxC,SAAS,SACT,oBACA,mBACA,sBACA,gBACI;CACJ,MAAM,CAAC,YAAY,iBAAiB,SAAS,kBAAkB;CAC/D,MAAM,CAAC,eAAe,oBACpB,SAA6B,qBAAqB;CACpD,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GAC1C,eAAe,SAAS,MAAM,OAAO;GACjB;GACD;GACG;GACX;GACX,CAAA,CACE"}
|
|
1
|
+
{"version":3,"file":"editor-BSQfwcdz.js","names":[],"sources":["../editors/document-editor/components/DocumentEditorForm.tsx","../editors/document-editor/config.ts","../editors/document-editor/editor.tsx"],"sourcesContent":["import { Suspense, useEffect, useState } from \"react\";\nimport type {\n AddDocumentTypeInput,\n DocumentTypeItem,\n RemoveDocumentTypeInput,\n} from \"../../../document-models/document-editor/index.js\";\nimport { StatusPill } from \"../../components/index.js\";\nimport { useAvailableDocumentTypes, useDebounce } from \"../../hooks/index.js\";\n\nexport interface DocumentEditorFormProps {\n editorName?: string;\n documentTypes?: DocumentTypeItem[];\n status?: string;\n onEditorNameChange?: (name: string) => void;\n onAddDocumentType?: (input: AddDocumentTypeInput) => void;\n onRemoveDocumentType?: (input: RemoveDocumentTypeInput) => void;\n onConfirm?: () => void;\n}\n\nfunction DocumentTypeSelectUI(\n props: React.SelectHTMLAttributes<HTMLSelectElement>,\n) {\n return (\n <select\n id=\"supported-document-types\"\n className=\"w-full rounded-md border border-gray-300 px-3 py-2 focus:border-transparent focus:ring-2 focus:ring-blue-500 focus:outline-none\"\n {...props}\n >\n <option value=\"\">Select a document type</option>\n {props.children}\n </select>\n );\n}\n\nfunction DocumentTypeSelect({\n documentTypes,\n setDocumentTypes,\n onAddDocumentType,\n onRemoveDocumentType,\n}: {\n setDocumentTypes: (documentTypes: DocumentTypeItem[]) => void;\n} & Pick<\n DocumentEditorFormProps,\n \"documentTypes\" | \"onAddDocumentType\" | \"onRemoveDocumentType\"\n>) {\n // Get available document types from the hook (vetra drive only for document editor)\n const availableDocumentTypes = useAvailableDocumentTypes(true);\n const [selectedDocumentType, setSelectedDocumentType] = useState(\"\");\n\n return (\n <DocumentTypeSelectUI\n value={selectedDocumentType}\n onChange={(e) => {\n const selectedValue = e.target.value;\n if (selectedValue) {\n // Remove existing document type if any\n\n const existingType = documentTypes?.at(0);\n if (existingType) {\n onRemoveDocumentType?.({ id: existingType.id });\n }\n\n // Add the new document type\n const newTypeInput: AddDocumentTypeInput = {\n id: Date.now().toString(), // Generate a unique ID\n documentType: selectedValue,\n };\n const newType: DocumentTypeItem = {\n id: newTypeInput.id,\n documentType: newTypeInput.documentType,\n };\n setDocumentTypes([newType]); // Replace with single item array\n onAddDocumentType?.(newTypeInput);\n }\n setSelectedDocumentType(\"\");\n }}\n >\n {availableDocumentTypes.map((docType) => (\n <option key={docType} value={docType}>\n {docType}\n </option>\n ))}\n </DocumentTypeSelectUI>\n );\n}\n\nexport const DocumentEditorForm: React.FC<DocumentEditorFormProps> = ({\n editorName: initialEditorName = \"\",\n documentTypes: initialDocumentTypes = [],\n status = \"DRAFT\",\n onEditorNameChange,\n onAddDocumentType,\n onRemoveDocumentType,\n onConfirm,\n}) => {\n const [editorName, setEditorName] = useState(initialEditorName);\n const [documentTypes, setDocumentTypes] =\n useState<DocumentTypeItem[]>(initialDocumentTypes);\n const [isConfirmed, setIsConfirmed] = useState(false);\n\n // Use the debounce hook for name changes\n useDebounce(editorName, onEditorNameChange, 300);\n\n // Update local state when initial values change\n useEffect(() => {\n // eslint-disable-next-line react-hooks/set-state-in-effect\n setEditorName(initialEditorName);\n }, [initialEditorName]);\n\n useEffect(() => {\n // eslint-disable-next-line react-hooks/set-state-in-effect\n setDocumentTypes(initialDocumentTypes);\n }, [initialDocumentTypes]);\n\n // Reset confirmation state if status changes back to DRAFT\n useEffect(() => {\n if (status === \"DRAFT\") {\n // eslint-disable-next-line react-hooks/set-state-in-effect\n setIsConfirmed(false);\n }\n }, [status]);\n\n // Check if form should be read-only\n const isReadOnly = isConfirmed || status === \"CONFIRMED\";\n\n const handleConfirm = () => {\n if (editorName.trim() && documentTypes.length > 0) {\n setIsConfirmed(true); // Immediate UI update\n onConfirm?.();\n }\n };\n\n return (\n <div className=\"space-y-6 p-6\">\n <div className=\"flex items-center justify-between\">\n <h2 className=\"text-lg font-medium text-gray-900\">\n Editor Configuration\n </h2>\n <StatusPill\n status={status === \"CONFIRMED\" ? \"confirmed\" : \"draft\"}\n label={status === \"CONFIRMED\" ? \"Confirmed\" : \"Draft\"}\n />\n </div>\n\n {/* Editor Name Field */}\n <div>\n <label\n htmlFor=\"editor-name\"\n className=\"mb-2 block text-sm font-medium text-gray-700\"\n >\n Editor Name\n </label>\n <input\n id=\"editor-name\"\n type=\"text\"\n value={editorName}\n onChange={(e) => setEditorName(e.target.value)}\n disabled={isReadOnly}\n className={`w-full rounded-md border border-gray-300 px-3 py-2 focus:border-transparent focus:ring-2 focus:ring-blue-500 focus:outline-none ${\n isReadOnly ? \"cursor-not-allowed bg-gray-100\" : \"\"\n }`}\n />\n </div>\n\n {/* Supported Document Types Field */}\n <div>\n <label\n htmlFor=\"supported-document-types\"\n className=\"mb-2 block text-sm font-medium text-gray-700\"\n >\n Supported Document Types\n </label>\n <div className=\"space-y-2\">\n {!isReadOnly && (\n <Suspense fallback={<DocumentTypeSelectUI />}>\n <DocumentTypeSelect\n documentTypes={documentTypes}\n setDocumentTypes={setDocumentTypes}\n onAddDocumentType={onAddDocumentType}\n onRemoveDocumentType={onRemoveDocumentType}\n />\n </Suspense>\n )}\n <div className=\"space-y-1\">\n {documentTypes.map((type) => (\n <div key={type.id} className=\"flex items-center py-1\">\n <span className=\"text-sm text-gray-700\">\n {type.documentType}\n </span>\n {!isReadOnly && (\n <button\n onClick={() => {\n setDocumentTypes([]);\n onRemoveDocumentType?.({ id: type.id });\n }}\n className=\"ml-2 text-gray-400 hover:text-gray-600 focus:outline-none\"\n >\n ×\n </button>\n )}\n </div>\n ))}\n </div>\n </div>\n </div>\n\n {/* Confirm Button - only show if not in read-only mode */}\n {!isReadOnly && (\n <div>\n <button\n onClick={handleConfirm}\n disabled={!editorName.trim() || documentTypes.length === 0}\n className=\"rounded-md bg-blue-600 px-4 py-2 text-white hover:bg-blue-700 focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 focus:outline-none disabled:cursor-not-allowed disabled:bg-gray-300\"\n >\n Confirm\n </button>\n </div>\n )}\n </div>\n );\n};\n","import type { PHDocumentEditorConfig } from \"@powerhousedao/reactor-browser\";\n\nexport const editorConfig: PHDocumentEditorConfig = {\n isExternalControlsEnabled: false,\n};\n","import { DocumentToolbar } from \"@powerhousedao/design-system/connect\";\nimport { useSetPHDocumentEditorConfig } from \"@powerhousedao/reactor-browser\";\nimport { useCallback } from \"react\";\nimport { useSelectedDocumentEditorDocument } from \"../../document-models/document-editor/index.js\";\nimport {\n addDocumentType,\n removeDocumentType,\n setEditorName,\n setEditorStatus,\n type AddDocumentTypeInput,\n type RemoveDocumentTypeInput,\n} from \"../../document-models/document-editor/index.js\";\nimport { DocumentEditorForm } from \"./components/DocumentEditorForm.js\";\nimport { editorConfig } from \"./config.js\";\n\nexport default function Editor() {\n useSetPHDocumentEditorConfig(editorConfig);\n const [document, dispatch] = useSelectedDocumentEditorDocument();\n\n const onEditorNameChange = useCallback(\n (name: string) => {\n if (!document.state.global.name && !name) return;\n if (name === document.state.global.name) return;\n\n dispatch(setEditorName({ name }));\n },\n [document.state.global.name, dispatch],\n );\n\n const onAddDocumentType = useCallback(\n (input: AddDocumentTypeInput) => {\n dispatch(addDocumentType(input));\n },\n [dispatch],\n );\n\n const onRemoveDocumentType = useCallback(\n (input: RemoveDocumentTypeInput) => {\n dispatch(removeDocumentType(input));\n },\n [dispatch],\n );\n\n const onConfirm = useCallback(() => {\n dispatch(setEditorStatus({ status: \"CONFIRMED\" }));\n }, [dispatch]);\n\n return (\n <div className=\"bg-gray-50 p-6\">\n <DocumentToolbar />\n <DocumentEditorForm\n status={document.state.global.status}\n editorName={document.state.global.name ?? \"\"}\n documentTypes={document.state.global.documentTypes}\n onEditorNameChange={onEditorNameChange}\n onAddDocumentType={onAddDocumentType}\n onRemoveDocumentType={onRemoveDocumentType}\n onConfirm={onConfirm}\n />\n </div>\n );\n}\n"],"mappings":";;;;;;;;;AAmBA,SAAS,qBACP,OACA;AACA,QACE,qBAAC,UAAD;EAC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A,oBAAC,OAAD,EAAA,UACE,oBAAC,UAAD;IACE,SAAS;IACT,UAAU,CAAC,WAAW,MAAM,IAAI,cAAc,WAAW;IACzD,WAAU;cACX;IAEQ,CAAA,EACL,CAAA;GAEJ;;;;;ACxNV,MAAa,eAAuC,EAClD,2BAA2B,OAC5B;;;ACWD,SAAwB,SAAS;AAC/B,8BAA6B,aAAa;CAC1C,MAAM,CAAC,UAAU,YAAY,mCAAmC;CAEhE,MAAM,qBAAqB,aACxB,SAAiB;AAChB,MAAI,CAAC,SAAS,MAAM,OAAO,QAAQ,CAAC,KAAM;AAC1C,MAAI,SAAS,SAAS,MAAM,OAAO,KAAM;AAEzC,WAAS,cAAc,EAAE,MAAM,CAAC,CAAC;IAEnC,CAAC,SAAS,MAAM,OAAO,MAAM,SAAS,CACvC;CAED,MAAM,oBAAoB,aACvB,UAAgC;AAC/B,WAAS,gBAAgB,MAAM,CAAC;IAElC,CAAC,SAAS,CACX;CAED,MAAM,uBAAuB,aAC1B,UAAmC;AAClC,WAAS,mBAAmB,MAAM,CAAC;IAErC,CAAC,SAAS,CACX;CAED,MAAM,YAAY,kBAAkB;AAClC,WAAS,gBAAgB,EAAE,QAAQ,aAAa,CAAC,CAAC;IACjD,CAAC,SAAS,CAAC;AAEd,QACE,qBAAC,OAAD;EAAK,WAAU;YAAf,CACE,oBAAC,iBAAD,EAAmB,CAAA,EACnB,oBAAC,oBAAD;GACE,QAAQ,SAAS,MAAM,OAAO;GAC9B,YAAY,SAAS,MAAM,OAAO,QAAQ;GAC1C,eAAe,SAAS,MAAM,OAAO;GACjB;GACD;GACG;GACX;GACX,CAAA,CACE"}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { n as useSelectedProcessorModuleDocument } from "./useVetraDocument-DF0teXXM.js";
|
|
3
|
-
import { n as useAvailableDocumentTypes, t as useDebounce } from "./hooks-Vx4YtE1e.js";
|
|
1
|
+
import { C as setProcessorStatus, S as setProcessorName, _ as addDocumentType, b as removeDocumentType, v as addProcessorApp, w as setProcessorType, x as removeProcessorApp } from "./module-BWlCj_0C.js";
|
|
4
2
|
import { StatusPill } from "./editors/components/index.js";
|
|
3
|
+
import { n as useAvailableDocumentTypes, t as useDebounce } from "./hooks-Xexr33XS.js";
|
|
4
|
+
import { n as useSelectedProcessorModuleDocument } from "./useVetraDocument-DoAwvHVi.js";
|
|
5
5
|
import { useSetPHDocumentEditorConfig } from "@powerhousedao/reactor-browser";
|
|
6
6
|
import { PROCESSOR_APPS } from "@powerhousedao/shared/processors";
|
|
7
7
|
import { useCallback, useEffect, useState } from "react";
|
|
8
|
-
import { DocumentToolbar } from "@powerhousedao/design-system/connect";
|
|
9
8
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
9
|
+
import { DocumentToolbar } from "@powerhousedao/design-system/connect";
|
|
10
10
|
//#region editors/processor-editor/components/ProcessorEditorForm.tsx
|
|
11
11
|
const ProcessorEditorForm = ({ processorName: initialProcessorName = "", processorType: initialProcessorType = "", documentTypes: initialDocumentTypes = [], processorApps: initialProcessorApps = [], status = "DRAFT", onNameChange, onTypeChange, onAddDocumentType, onRemoveDocumentType, onAddProcessorApp, onRemoveProcessorApp, onConfirm }) => {
|
|
12
12
|
const [processorName, setProcessorName] = useState(initialProcessorName);
|
|
@@ -239,4 +239,4 @@ function Editor() {
|
|
|
239
239
|
//#endregion
|
|
240
240
|
export { Editor as default };
|
|
241
241
|
|
|
242
|
-
//# sourceMappingURL=editor-
|
|
242
|
+
//# sourceMappingURL=editor-Bku8e2dr.js.map
|