@netlisian/softconfig 0.1.2 → 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +50 -0
- package/dist/puck/index.css +69 -39
- package/dist/puck/index.d.mts +116 -82
- package/dist/puck/index.d.ts +116 -82
- package/dist/puck/index.js +128 -60
- package/dist/puck/index.mjs +128 -60
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -61,6 +61,56 @@ import "@netlisian/softconfig/styles.css";
|
|
|
61
61
|
|
|
62
62
|
You can supply custom overrides (action bar, headers, map UI, etc.) through the `overrides` prop. See `src/puck/types/Overrides.ts` for the full surface.
|
|
63
63
|
|
|
64
|
+
## Action Lifecycle Events
|
|
65
|
+
|
|
66
|
+
`SoftConfigProvider` supports `onActions` for lifecycle callbacks:
|
|
67
|
+
|
|
68
|
+
- `build` → when build mode starts
|
|
69
|
+
- `remodel` → when remodel mode starts
|
|
70
|
+
- `complete` → when a build/remodel is finalized
|
|
71
|
+
- `inspect` → when inspect is requested
|
|
72
|
+
- `demolish` → when a soft component is deleted
|
|
73
|
+
- `setDefaultVersion`, `decompose`, `cancel`, `publish`
|
|
74
|
+
|
|
75
|
+
Version-aware payloads are included for build finalization and inspection flows:
|
|
76
|
+
|
|
77
|
+
```ts
|
|
78
|
+
type ActionEventPayload =
|
|
79
|
+
| {
|
|
80
|
+
type: "remodel";
|
|
81
|
+
payload: {
|
|
82
|
+
id: string;
|
|
83
|
+
version?: string;
|
|
84
|
+
softComponent?: VersionedSoftComponent["versions"][string];
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
| {
|
|
88
|
+
type: "complete";
|
|
89
|
+
payload: {
|
|
90
|
+
id: string;
|
|
91
|
+
version: string;
|
|
92
|
+
componentData: Record<string, any>;
|
|
93
|
+
softComponent: VersionedSoftComponent["versions"][string];
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
| {
|
|
97
|
+
type: "inspect";
|
|
98
|
+
payload: {
|
|
99
|
+
id: string;
|
|
100
|
+
version?: string;
|
|
101
|
+
softComponent?: VersionedSoftComponent["versions"][string];
|
|
102
|
+
};
|
|
103
|
+
}
|
|
104
|
+
| {
|
|
105
|
+
type: "demolish";
|
|
106
|
+
payload: {
|
|
107
|
+
id: string;
|
|
108
|
+
};
|
|
109
|
+
};
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
This contract allows downstream consumers (for example, save/sync bridges) to persist using exact version metadata without relying on inferred/default versions.
|
|
113
|
+
|
|
64
114
|
## Development
|
|
65
115
|
|
|
66
116
|
- Build: `pnpm --filter @netlisian/softconfig build`
|
package/dist/puck/index.css
CHANGED
|
@@ -120,7 +120,7 @@
|
|
|
120
120
|
}
|
|
121
121
|
|
|
122
122
|
/* css-module:/media/manual_mount/osamuProjects/netlisian/packages/soft-config/src/puck/overrides/DrawerItem.module.css/#css-module-data */
|
|
123
|
-
.
|
|
123
|
+
._DrawerItem_182aj_1 {
|
|
124
124
|
background: var(--puck-color-white);
|
|
125
125
|
cursor: grab;
|
|
126
126
|
border: 1px solid var(--puck-color-grey-09);
|
|
@@ -132,13 +132,13 @@
|
|
|
132
132
|
transition: background-color 50ms ease-in, color 50ms ease-in;
|
|
133
133
|
display: flex;
|
|
134
134
|
}
|
|
135
|
-
._DrawerItem--
|
|
135
|
+
._DrawerItem--insertDisabled_182aj_14 {
|
|
136
136
|
cursor: not-allowed;
|
|
137
137
|
color: var(--puck-color-grey-5);
|
|
138
138
|
background: var(--puck-color-grey-11);
|
|
139
139
|
pointer-events: none;
|
|
140
140
|
}
|
|
141
|
-
._DrawerItem-
|
|
141
|
+
._DrawerItem-content_182aj_21 {
|
|
142
142
|
flex: 1;
|
|
143
143
|
display: flex;
|
|
144
144
|
flex-direction: column;
|
|
@@ -147,82 +147,85 @@
|
|
|
147
147
|
white-space: nowrap;
|
|
148
148
|
overflow-x: hidden;
|
|
149
149
|
}
|
|
150
|
-
._DrawerItem-
|
|
150
|
+
._DrawerItem-name_182aj_31 {
|
|
151
151
|
font-weight: 400;
|
|
152
152
|
}
|
|
153
|
-
._DrawerItem-
|
|
153
|
+
._DrawerItem-version_182aj_35 {
|
|
154
154
|
font-size: 10px;
|
|
155
155
|
color: var(--puck-color-grey-05);
|
|
156
156
|
}
|
|
157
|
-
._DrawerItem-
|
|
157
|
+
._DrawerItem-actions_182aj_40 {
|
|
158
158
|
display: flex;
|
|
159
159
|
align-items: center;
|
|
160
160
|
gap: 8px;
|
|
161
161
|
}
|
|
162
|
-
._DrawerItem-
|
|
162
|
+
._DrawerItem-settingsButton_182aj_46 {
|
|
163
163
|
opacity: 0;
|
|
164
164
|
transition: opacity 120ms ease;
|
|
165
165
|
color: var(--puck-color-grey-05);
|
|
166
166
|
}
|
|
167
|
-
.
|
|
167
|
+
._DrawerItem_182aj_1:hover ._DrawerItem-settingsButton_182aj_46 {
|
|
168
168
|
opacity: 1;
|
|
169
169
|
}
|
|
170
|
-
._DrawerItem-
|
|
170
|
+
._DrawerItem-grip_182aj_56 {
|
|
171
171
|
color: var(--puck-color-grey-05);
|
|
172
172
|
display: flex;
|
|
173
173
|
align-items: center;
|
|
174
174
|
}
|
|
175
|
-
._DrawerItem-
|
|
175
|
+
._DrawerItem-modal_182aj_63 {
|
|
176
176
|
background: var(--puck-color-white);
|
|
177
177
|
display: flex;
|
|
178
178
|
flex-direction: column;
|
|
179
|
-
height: 100
|
|
179
|
+
height: min(90dvh, 100%);
|
|
180
|
+
min-height: 0;
|
|
180
181
|
}
|
|
181
|
-
._DrawerItem-
|
|
182
|
+
._DrawerItem-modalHeader_182aj_71 {
|
|
182
183
|
padding: 24px 32px;
|
|
183
184
|
border-bottom: 1px solid var(--puck-color-grey-09);
|
|
185
|
+
flex-shrink: 0;
|
|
184
186
|
}
|
|
185
|
-
._DrawerItem-
|
|
187
|
+
._DrawerItem-modalTitle_182aj_77 {
|
|
186
188
|
margin: 0 0 4px 0;
|
|
187
189
|
font-size: 24px;
|
|
188
190
|
font-weight: 600;
|
|
189
191
|
color: var(--puck-color-black);
|
|
190
192
|
}
|
|
191
|
-
._DrawerItem-
|
|
193
|
+
._DrawerItem-modalSubtitle_182aj_84 {
|
|
192
194
|
margin: 0;
|
|
193
195
|
font-size: 14px;
|
|
194
196
|
color: var(--puck-color-grey-04);
|
|
195
197
|
}
|
|
196
|
-
._DrawerItem-
|
|
198
|
+
._DrawerItem-modalBody_182aj_90 {
|
|
197
199
|
flex: 1;
|
|
200
|
+
min-height: 0;
|
|
198
201
|
padding: 32px;
|
|
199
202
|
overflow-y: auto;
|
|
200
203
|
display: flex;
|
|
201
204
|
flex-direction: column;
|
|
202
205
|
gap: 32px;
|
|
203
206
|
}
|
|
204
|
-
._DrawerItem-
|
|
207
|
+
._DrawerItem-section_182aj_100 {
|
|
205
208
|
display: flex;
|
|
206
209
|
flex-direction: column;
|
|
207
210
|
gap: 16px;
|
|
208
211
|
}
|
|
209
|
-
._DrawerItem-
|
|
212
|
+
._DrawerItem-sectionTitle_182aj_106 {
|
|
210
213
|
margin: 0;
|
|
211
214
|
font-size: 16px;
|
|
212
215
|
font-weight: 600;
|
|
213
216
|
color: var(--puck-color-black);
|
|
214
217
|
}
|
|
215
|
-
._DrawerItem-
|
|
218
|
+
._DrawerItem-sectionDescription_182aj_113 {
|
|
216
219
|
margin: 0;
|
|
217
220
|
font-size: 14px;
|
|
218
221
|
color: var(--puck-color-grey-04);
|
|
219
222
|
}
|
|
220
|
-
._DrawerItem-
|
|
223
|
+
._DrawerItem-versionList_182aj_119 {
|
|
221
224
|
display: flex;
|
|
222
225
|
flex-direction: column;
|
|
223
226
|
gap: 8px;
|
|
224
227
|
}
|
|
225
|
-
._DrawerItem-
|
|
228
|
+
._DrawerItem-versionRow_182aj_125 {
|
|
226
229
|
display: flex;
|
|
227
230
|
justify-content: space-between;
|
|
228
231
|
align-items: center;
|
|
@@ -232,26 +235,26 @@
|
|
|
232
235
|
background: var(--puck-color-white);
|
|
233
236
|
transition: all 150ms ease;
|
|
234
237
|
}
|
|
235
|
-
._DrawerItem-versionRow--
|
|
238
|
+
._DrawerItem-versionRow--isDefault_182aj_136 {
|
|
236
239
|
border-color: var(--puck-color-azure-07);
|
|
237
240
|
background: var(--puck-color-azure-10);
|
|
238
241
|
}
|
|
239
|
-
._DrawerItem-versionRow--
|
|
242
|
+
._DrawerItem-versionRow--isMarkedForDeletion_182aj_141 {
|
|
240
243
|
opacity: 0.6;
|
|
241
244
|
background: var(--puck-color-grey-11);
|
|
242
245
|
}
|
|
243
|
-
._DrawerItem-
|
|
246
|
+
._DrawerItem-versionInfo_182aj_146 {
|
|
244
247
|
display: flex;
|
|
245
248
|
align-items: center;
|
|
246
249
|
gap: 12px;
|
|
247
250
|
flex: 1;
|
|
248
251
|
}
|
|
249
|
-
._DrawerItem-
|
|
252
|
+
._DrawerItem-versionNumber_182aj_153 {
|
|
250
253
|
font-size: 14px;
|
|
251
254
|
font-weight: 500;
|
|
252
255
|
color: var(--puck-color-black);
|
|
253
256
|
}
|
|
254
|
-
._DrawerItem-
|
|
257
|
+
._DrawerItem-defaultBadge_182aj_159 {
|
|
255
258
|
font-size: 11px;
|
|
256
259
|
padding: 3px 8px;
|
|
257
260
|
border-radius: 4px;
|
|
@@ -261,7 +264,7 @@
|
|
|
261
264
|
text-transform: uppercase;
|
|
262
265
|
letter-spacing: 0.5px;
|
|
263
266
|
}
|
|
264
|
-
._DrawerItem-
|
|
267
|
+
._DrawerItem-deleteBadge_182aj_170 {
|
|
265
268
|
font-size: 11px;
|
|
266
269
|
padding: 3px 8px;
|
|
267
270
|
border-radius: 4px;
|
|
@@ -271,15 +274,26 @@
|
|
|
271
274
|
text-transform: uppercase;
|
|
272
275
|
letter-spacing: 0.5px;
|
|
273
276
|
}
|
|
274
|
-
._DrawerItem-
|
|
277
|
+
._DrawerItem-versionActions_182aj_181 {
|
|
275
278
|
display: flex;
|
|
276
279
|
gap: 8px;
|
|
277
280
|
align-items: center;
|
|
278
281
|
}
|
|
279
|
-
._DrawerItem-
|
|
282
|
+
._DrawerItem-migrationOptions_182aj_187 {
|
|
280
283
|
width: 100%;
|
|
281
284
|
}
|
|
282
|
-
._DrawerItem-
|
|
285
|
+
._DrawerItem-migrationList_182aj_191 {
|
|
286
|
+
display: flex;
|
|
287
|
+
flex-direction: column;
|
|
288
|
+
gap: 8px;
|
|
289
|
+
max-height: 180px;
|
|
290
|
+
overflow-y: auto;
|
|
291
|
+
padding: 8px;
|
|
292
|
+
border: 1px solid var(--puck-color-grey-09);
|
|
293
|
+
border-radius: 6px;
|
|
294
|
+
background: var(--puck-color-white);
|
|
295
|
+
}
|
|
296
|
+
._DrawerItem-migrationOption_182aj_187 {
|
|
283
297
|
width: 100%;
|
|
284
298
|
padding: 10px 12px;
|
|
285
299
|
border: 1px solid var(--puck-color-grey-09);
|
|
@@ -289,33 +303,48 @@
|
|
|
289
303
|
color: var(--puck-color-black);
|
|
290
304
|
cursor: pointer;
|
|
291
305
|
transition: border-color 150ms ease;
|
|
306
|
+
display: flex;
|
|
307
|
+
align-items: center;
|
|
308
|
+
justify-content: space-between;
|
|
309
|
+
gap: 8px;
|
|
310
|
+
text-align: start;
|
|
292
311
|
}
|
|
293
|
-
._DrawerItem-
|
|
312
|
+
._DrawerItem-migrationOption_182aj_187:hover {
|
|
294
313
|
border-color: var(--puck-color-grey-07);
|
|
295
314
|
}
|
|
296
|
-
._DrawerItem-
|
|
315
|
+
._DrawerItem-migrationOption_182aj_187:focus {
|
|
297
316
|
outline: none;
|
|
298
317
|
border-color: var(--puck-color-azure-07);
|
|
299
318
|
}
|
|
300
|
-
._DrawerItem-
|
|
319
|
+
._DrawerItem-migrationOption--isSelected_182aj_229 {
|
|
320
|
+
border-color: var(--puck-color-azure-07);
|
|
321
|
+
background: var(--puck-color-azure-10);
|
|
322
|
+
}
|
|
323
|
+
._DrawerItem-migrationOptionLabel_182aj_234 {
|
|
324
|
+
white-space: nowrap;
|
|
325
|
+
overflow: hidden;
|
|
326
|
+
text-overflow: ellipsis;
|
|
327
|
+
}
|
|
328
|
+
._DrawerItem-modalFooter_182aj_240 {
|
|
301
329
|
padding: 20px 32px;
|
|
302
330
|
border-top: 1px solid var(--puck-color-grey-09);
|
|
303
331
|
display: flex;
|
|
304
332
|
justify-content: space-between;
|
|
305
333
|
align-items: center;
|
|
306
334
|
background: var(--puck-color-grey-11);
|
|
335
|
+
flex-shrink: 0;
|
|
307
336
|
}
|
|
308
|
-
._DrawerItem-
|
|
337
|
+
._DrawerItem-footerLeft_182aj_250 {
|
|
309
338
|
display: flex;
|
|
310
339
|
gap: 12px;
|
|
311
340
|
}
|
|
312
|
-
._DrawerItem-
|
|
341
|
+
._DrawerItem-footerRight_182aj_255 {
|
|
313
342
|
display: flex;
|
|
314
343
|
gap: 12px;
|
|
315
344
|
}
|
|
316
345
|
|
|
317
346
|
/* css-module:/media/manual_mount/osamuProjects/netlisian/packages/soft-config/src/puck/components/modal/styles.module.css/#css-module-data */
|
|
318
|
-
.
|
|
347
|
+
._Modal_1t9ot_1 {
|
|
319
348
|
background: color-mix(in srgb, var(--puck-color-black) 75%, transparent);
|
|
320
349
|
display: none;
|
|
321
350
|
justify-content: center;
|
|
@@ -325,21 +354,22 @@
|
|
|
325
354
|
left: 0;
|
|
326
355
|
bottom: 0;
|
|
327
356
|
right: 0;
|
|
328
|
-
z-index:
|
|
357
|
+
z-index: 1000;
|
|
329
358
|
padding: 32px;
|
|
330
359
|
}
|
|
331
|
-
._Modal--
|
|
360
|
+
._Modal--isOpen_1t9ot_29 {
|
|
332
361
|
display: flex;
|
|
333
362
|
}
|
|
334
|
-
._Modal-
|
|
363
|
+
._Modal-inner_1t9ot_37 {
|
|
335
364
|
width: 100%;
|
|
336
365
|
max-width: 1024px;
|
|
337
366
|
border-radius: 8px;
|
|
338
|
-
overflow:
|
|
367
|
+
overflow: visible;
|
|
339
368
|
background: var(--puck-color-white);
|
|
340
369
|
display: flex;
|
|
341
370
|
flex-direction: column;
|
|
342
371
|
max-height: 90dvh;
|
|
372
|
+
min-height: 0;
|
|
343
373
|
}
|
|
344
374
|
|
|
345
375
|
/* css-module:/media/manual_mount/osamuProjects/netlisian/packages/soft-config/src/puck/overrides/Drawer.module.css/#css-module-data */
|
package/dist/puck/index.d.mts
CHANGED
|
@@ -1,10 +1,91 @@
|
|
|
1
1
|
import * as zustand from 'zustand';
|
|
2
2
|
import { StoreApi } from 'zustand';
|
|
3
|
-
import
|
|
3
|
+
import * as _measured_puck from '@measured/puck';
|
|
4
|
+
import { DefaultComponentProps, Field, Config, Fields, History, AppState, PuckApi, ComponentData, ComponentConfig, RootData, AsFieldProps, WithChildren, Metadata, ResolveDataTrigger, PuckAction, Data } from '@measured/puck';
|
|
4
5
|
import * as React$1 from 'react';
|
|
5
6
|
import React__default, { ReactNode, ReactElement } from 'react';
|
|
6
7
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
7
8
|
|
|
9
|
+
type BuilderRootConfig = {
|
|
10
|
+
_name: string;
|
|
11
|
+
_category?: string;
|
|
12
|
+
_version?: string;
|
|
13
|
+
_versions?: string[];
|
|
14
|
+
_fields?: {
|
|
15
|
+
name: string;
|
|
16
|
+
type: Field["type"];
|
|
17
|
+
}[];
|
|
18
|
+
_fieldSettings?: {
|
|
19
|
+
[key: string]: any;
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
type BuilderComponentConfig = {
|
|
23
|
+
_slot?: {
|
|
24
|
+
slot: string;
|
|
25
|
+
}[];
|
|
26
|
+
_map?: {
|
|
27
|
+
to: string | string[];
|
|
28
|
+
from: string | string[];
|
|
29
|
+
transform?: (inputs: any[], props: DefaultComponentProps) => any;
|
|
30
|
+
[key: string]: any;
|
|
31
|
+
}[];
|
|
32
|
+
[key: string]: any;
|
|
33
|
+
};
|
|
34
|
+
type BuilderConfig = Config<any, BuilderRootConfig>;
|
|
35
|
+
|
|
36
|
+
type SoftSubComponent = {
|
|
37
|
+
type: string;
|
|
38
|
+
map: BuilderComponentConfig['_map'];
|
|
39
|
+
components: {
|
|
40
|
+
[slot: string]: SoftSubComponent;
|
|
41
|
+
};
|
|
42
|
+
fixedProps?: DefaultComponentProps;
|
|
43
|
+
enabledSlots: {
|
|
44
|
+
slot: string;
|
|
45
|
+
name?: string;
|
|
46
|
+
}[];
|
|
47
|
+
}[];
|
|
48
|
+
type SoftComponent = {
|
|
49
|
+
name: string;
|
|
50
|
+
category?: string;
|
|
51
|
+
fields: Fields;
|
|
52
|
+
fieldSettings?: Record<string, any>;
|
|
53
|
+
defaultProps: DefaultComponentProps;
|
|
54
|
+
components: SoftSubComponent;
|
|
55
|
+
slots: {
|
|
56
|
+
[slot: string]: DefaultComponentProps;
|
|
57
|
+
};
|
|
58
|
+
};
|
|
59
|
+
type VersionedSoftComponent = {
|
|
60
|
+
defaultVersion: string;
|
|
61
|
+
name: string;
|
|
62
|
+
category?: string;
|
|
63
|
+
versions: {
|
|
64
|
+
[version: string]: {
|
|
65
|
+
fields: Fields;
|
|
66
|
+
fieldSettings?: Record<string, any>;
|
|
67
|
+
defaultProps: DefaultComponentProps;
|
|
68
|
+
components: SoftSubComponent;
|
|
69
|
+
slots: {
|
|
70
|
+
[slot: string]: DefaultComponentProps;
|
|
71
|
+
};
|
|
72
|
+
};
|
|
73
|
+
};
|
|
74
|
+
/**
|
|
75
|
+
* Dependencies map: version -> Set of component names this component depends on
|
|
76
|
+
* Automatically inferred from component structure but can be overridden
|
|
77
|
+
*/
|
|
78
|
+
dependencies?: {
|
|
79
|
+
[version: string]: Set<string>;
|
|
80
|
+
};
|
|
81
|
+
};
|
|
82
|
+
type SoftComponents = Record<string, VersionedSoftComponent>;
|
|
83
|
+
|
|
84
|
+
type CompletedComponentResult = {
|
|
85
|
+
id: string;
|
|
86
|
+
version: string;
|
|
87
|
+
softComponent: VersionedSoftComponent["versions"][string];
|
|
88
|
+
};
|
|
8
89
|
type BuildersSlice = {
|
|
9
90
|
/**
|
|
10
91
|
* Build a new soft component based on the selected item in history.
|
|
@@ -61,7 +142,7 @@ type BuildersSlice = {
|
|
|
61
142
|
* - Strip the build settings fields
|
|
62
143
|
* - Apply modified history to puck data.
|
|
63
144
|
*/
|
|
64
|
-
complete: (appState: AppState<any>, setHistories: PuckApi["history"]["setHistories"], getItemBySelector: PuckApi["getItemBySelector"]) =>
|
|
145
|
+
complete: (appState: AppState<any>, setHistories: PuckApi["history"]["setHistories"], getItemBySelector: PuckApi["getItemBySelector"]) => CompletedComponentResult;
|
|
65
146
|
demolish: (componentName: string, data: AppState["data"], puckDispatch: PuckApi["dispatch"]) => void;
|
|
66
147
|
inspect: (componentName: string, puckDispatch: PuckApi["dispatch"]) => void;
|
|
67
148
|
/**
|
|
@@ -86,81 +167,6 @@ type BuildersSlice = {
|
|
|
86
167
|
decompose: (componentData: ComponentData) => ComponentData[];
|
|
87
168
|
};
|
|
88
169
|
|
|
89
|
-
type BuilderRootConfig = {
|
|
90
|
-
_name: string;
|
|
91
|
-
_category?: string;
|
|
92
|
-
_version?: string;
|
|
93
|
-
_versions?: string[];
|
|
94
|
-
_fields?: {
|
|
95
|
-
name: string;
|
|
96
|
-
type: Field["type"];
|
|
97
|
-
}[];
|
|
98
|
-
_fieldSettings?: {
|
|
99
|
-
[key: string]: any;
|
|
100
|
-
};
|
|
101
|
-
};
|
|
102
|
-
type BuilderComponentConfig = {
|
|
103
|
-
_slot?: {
|
|
104
|
-
slot: string;
|
|
105
|
-
}[];
|
|
106
|
-
_map?: {
|
|
107
|
-
to: string | string[];
|
|
108
|
-
from: string | string[];
|
|
109
|
-
transform?: (inputs: any[], props: DefaultComponentProps) => any;
|
|
110
|
-
[key: string]: any;
|
|
111
|
-
}[];
|
|
112
|
-
[key: string]: any;
|
|
113
|
-
};
|
|
114
|
-
type BuilderConfig = Config<any, BuilderRootConfig>;
|
|
115
|
-
|
|
116
|
-
type SoftSubComponent = {
|
|
117
|
-
type: string;
|
|
118
|
-
map: BuilderComponentConfig['_map'];
|
|
119
|
-
components: {
|
|
120
|
-
[slot: string]: SoftSubComponent;
|
|
121
|
-
};
|
|
122
|
-
fixedProps?: DefaultComponentProps;
|
|
123
|
-
enabledSlots: {
|
|
124
|
-
slot: string;
|
|
125
|
-
name?: string;
|
|
126
|
-
}[];
|
|
127
|
-
}[];
|
|
128
|
-
type SoftComponent = {
|
|
129
|
-
name: string;
|
|
130
|
-
category?: string;
|
|
131
|
-
fields: Fields;
|
|
132
|
-
fieldSettings?: Record<string, any>;
|
|
133
|
-
defaultProps: DefaultComponentProps;
|
|
134
|
-
components: SoftSubComponent;
|
|
135
|
-
slots: {
|
|
136
|
-
[slot: string]: DefaultComponentProps;
|
|
137
|
-
};
|
|
138
|
-
};
|
|
139
|
-
type VersionedSoftComponent = {
|
|
140
|
-
defaultVersion: string;
|
|
141
|
-
name: string;
|
|
142
|
-
category?: string;
|
|
143
|
-
versions: {
|
|
144
|
-
[version: string]: {
|
|
145
|
-
fields: Fields;
|
|
146
|
-
fieldSettings?: Record<string, any>;
|
|
147
|
-
defaultProps: DefaultComponentProps;
|
|
148
|
-
components: SoftSubComponent;
|
|
149
|
-
slots: {
|
|
150
|
-
[slot: string]: DefaultComponentProps;
|
|
151
|
-
};
|
|
152
|
-
};
|
|
153
|
-
};
|
|
154
|
-
/**
|
|
155
|
-
* Dependencies map: version -> Set of component names this component depends on
|
|
156
|
-
* Automatically inferred from component structure but can be overridden
|
|
157
|
-
*/
|
|
158
|
-
dependencies?: {
|
|
159
|
-
[version: string]: Set<string>;
|
|
160
|
-
};
|
|
161
|
-
};
|
|
162
|
-
type SoftComponents = Record<string, VersionedSoftComponent>;
|
|
163
|
-
|
|
164
170
|
type ActionEventPayload = {
|
|
165
171
|
type: "build";
|
|
166
172
|
payload: {
|
|
@@ -170,11 +176,14 @@ type ActionEventPayload = {
|
|
|
170
176
|
type: "remodel";
|
|
171
177
|
payload: {
|
|
172
178
|
id: string;
|
|
179
|
+
version?: string;
|
|
180
|
+
softComponent?: VersionedSoftComponent["versions"][string];
|
|
173
181
|
};
|
|
174
182
|
} | {
|
|
175
183
|
type: "complete";
|
|
176
184
|
payload: {
|
|
177
185
|
id: string;
|
|
186
|
+
version: string;
|
|
178
187
|
componentData: Record<string, any>;
|
|
179
188
|
softComponent: VersionedSoftComponent["versions"][string];
|
|
180
189
|
};
|
|
@@ -192,10 +201,19 @@ type ActionEventPayload = {
|
|
|
192
201
|
id: string;
|
|
193
202
|
version: string;
|
|
194
203
|
};
|
|
204
|
+
} | {
|
|
205
|
+
type: "deleteVersion";
|
|
206
|
+
payload: {
|
|
207
|
+
id: string;
|
|
208
|
+
version: string;
|
|
209
|
+
migrateToVersion?: string;
|
|
210
|
+
};
|
|
195
211
|
} | {
|
|
196
212
|
type: "inspect";
|
|
197
213
|
payload: {
|
|
198
214
|
id: string;
|
|
215
|
+
version?: string;
|
|
216
|
+
softComponent?: VersionedSoftComponent["versions"][string];
|
|
199
217
|
};
|
|
200
218
|
} | {
|
|
201
219
|
type: "decompose";
|
|
@@ -367,15 +385,31 @@ declare const useBuild: (name?: string) => {
|
|
|
367
385
|
};
|
|
368
386
|
|
|
369
387
|
declare const useRemodel: () => {
|
|
370
|
-
handleRemodel: (componentName?: string) =>
|
|
388
|
+
handleRemodel: (componentName?: string) => {
|
|
389
|
+
id: string;
|
|
390
|
+
version: string;
|
|
391
|
+
softComponent: {
|
|
392
|
+
fields: _measured_puck.Fields;
|
|
393
|
+
fieldSettings?: Record<string, any>;
|
|
394
|
+
defaultProps: DefaultComponentProps;
|
|
395
|
+
components: SoftSubComponent;
|
|
396
|
+
slots: {
|
|
397
|
+
[slot: string]: DefaultComponentProps;
|
|
398
|
+
};
|
|
399
|
+
};
|
|
400
|
+
} | {
|
|
401
|
+
id: string;
|
|
402
|
+
version: string;
|
|
403
|
+
softComponent?: undefined;
|
|
404
|
+
} | null;
|
|
371
405
|
canRemodel: (componentName?: string) => boolean;
|
|
372
406
|
};
|
|
373
407
|
|
|
374
408
|
declare const useComplete: () => {
|
|
375
|
-
handleComplete: () =>
|
|
409
|
+
handleComplete: () => CompletedComponentResult | null;
|
|
376
410
|
canComplete: boolean;
|
|
377
|
-
newComponent:
|
|
378
|
-
setNewComponent: React$1.Dispatch<React$1.SetStateAction<
|
|
411
|
+
newComponent: CompletedComponentResult | null;
|
|
412
|
+
setNewComponent: React$1.Dispatch<React$1.SetStateAction<CompletedComponentResult | null>>;
|
|
379
413
|
};
|
|
380
414
|
|
|
381
415
|
declare const useCancel: () => {
|
|
@@ -383,7 +417,7 @@ declare const useCancel: () => {
|
|
|
383
417
|
canCancel: boolean;
|
|
384
418
|
};
|
|
385
419
|
|
|
386
|
-
declare const useInspect: (
|
|
420
|
+
declare const useInspect: (component: CompletedComponentResult | null) => void;
|
|
387
421
|
|
|
388
422
|
declare const useDecompose: () => {
|
|
389
423
|
handleDecompose: (componentData?: ComponentData) => void;
|