@measured/puck 0.19.0-canary.896a6279 → 0.19.0-canary.8d459e4e
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 +2 -4
- package/dist/chunk-D6ENWNOG.mjs +543 -0
- package/dist/index.css +44 -38
- package/dist/index.d.mts +17 -7
- package/dist/index.d.ts +17 -7
- package/dist/index.js +485 -262
- package/dist/index.mjs +6596 -1623
- package/dist/{resolve-all-data-Cs8PfTrg.d.mts → resolve-all-data-DtB0OZRl.d.mts} +20 -15
- package/dist/{resolve-all-data-Cs8PfTrg.d.ts → resolve-all-data-DtB0OZRl.d.ts} +20 -15
- package/dist/rsc.d.mts +2 -2
- package/dist/rsc.d.ts +2 -2
- package/dist/rsc.js +195 -3703
- package/dist/rsc.mjs +3 -103
- package/package.json +2 -2
- package/dist/chunk-LT6HN46T.mjs +0 -5350
- package/dist/rsc.css +0 -338
package/dist/index.css
CHANGED
@@ -139,6 +139,10 @@
|
|
139
139
|
height: 1px;
|
140
140
|
min-height: 100vh;
|
141
141
|
}
|
142
|
+
[data-puck-entry] {
|
143
|
+
position: relative;
|
144
|
+
z-index: 0;
|
145
|
+
}
|
142
146
|
|
143
147
|
/* css-module:/home/runner/work/puck/puck/packages/core/components/ActionBar/styles.module.css/#css-module-data */
|
144
148
|
._ActionBar_rvadt_1 {
|
@@ -225,10 +229,10 @@
|
|
225
229
|
}
|
226
230
|
|
227
231
|
/* css-module:/home/runner/work/puck/puck/packages/core/components/AutoField/styles.module.css/#css-module-data */
|
228
|
-
.
|
232
|
+
._InputWrapper_4xor1_1 + ._InputWrapper_4xor1_1 {
|
229
233
|
margin-top: 12px;
|
230
234
|
}
|
231
|
-
._Input-
|
235
|
+
._Input-label_4xor1_5 {
|
232
236
|
align-items: center;
|
233
237
|
color: var(--puck-color-grey-04);
|
234
238
|
display: flex;
|
@@ -236,29 +240,30 @@
|
|
236
240
|
font-size: var(--puck-font-size-xxs);
|
237
241
|
font-weight: 600;
|
238
242
|
}
|
239
|
-
._Input-
|
243
|
+
._Input-labelIcon_4xor1_14 {
|
240
244
|
color: var(--puck-color-grey-07);
|
241
245
|
display: flex;
|
242
246
|
margin-inline-end: 4px;
|
243
247
|
padding-inline-start: 4px;
|
244
248
|
}
|
245
|
-
._Input-
|
249
|
+
._Input-disabledIcon_4xor1_21 {
|
246
250
|
color: var(--puck-color-grey-05);
|
247
251
|
margin-inline-start: auto;
|
248
252
|
}
|
249
|
-
._Input-
|
253
|
+
._Input-input_4xor1_26 {
|
250
254
|
background: var(--puck-color-white);
|
251
255
|
border-width: 1px;
|
252
256
|
border-style: solid;
|
253
257
|
border-color: var(--puck-color-grey-09);
|
254
258
|
border-radius: 4px;
|
259
|
+
box-sizing: border-box;
|
255
260
|
font-family: inherit;
|
256
261
|
font-size: 14px;
|
257
262
|
padding: 12px 15px;
|
258
263
|
transition: border-color 50ms ease-in;
|
259
264
|
width: 100%;
|
260
265
|
}
|
261
|
-
select._Input-
|
266
|
+
select._Input-input_4xor1_26 {
|
262
267
|
appearance: none;
|
263
268
|
background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='100' height='100' fill='%23c3c3c3'><polygon points='0,0 100,0 50,50'/></svg>") no-repeat;
|
264
269
|
background-size: 12px;
|
@@ -267,29 +272,29 @@ select._Input-input_g5w3n_26 {
|
|
267
272
|
background-color: var(--puck-color-white);
|
268
273
|
cursor: pointer;
|
269
274
|
}
|
270
|
-
select._Input-
|
275
|
+
select._Input-input_4xor1_26:dir(rtl) {
|
271
276
|
background-position: 12px calc(50% + 3px);
|
272
277
|
}
|
273
278
|
@media (hover: hover) and (pointer: fine) {
|
274
|
-
.
|
275
|
-
.
|
279
|
+
._Input_4xor1_1:has(> input):hover ._Input-input_4xor1_26:not([readonly]),
|
280
|
+
._Input_4xor1_1:has(> textarea):hover ._Input-input_4xor1_26:not([readonly]) {
|
276
281
|
border-color: var(--puck-color-grey-05);
|
277
282
|
transition: none;
|
278
283
|
}
|
279
|
-
.
|
284
|
+
._Input_4xor1_1:has(> select):hover ._Input-input_4xor1_26:not([disabled]) {
|
280
285
|
background-color: var(--puck-color-azure-12);
|
281
286
|
background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='100' height='100' fill='%235a5a5a'><polygon points='0,0 100,0 50,50'/></svg>");
|
282
287
|
border-color: var(--puck-color-grey-05);
|
283
288
|
transition: none;
|
284
289
|
}
|
285
290
|
}
|
286
|
-
._Input-
|
291
|
+
._Input-input_4xor1_26:focus {
|
287
292
|
border-color: var(--puck-color-grey-05);
|
288
293
|
outline: 2px solid var(--puck-color-azure-05);
|
289
294
|
transition: none;
|
290
295
|
}
|
291
|
-
._Input--
|
292
|
-
._Input--
|
296
|
+
._Input--readOnly_4xor1_75 > ._Input-input_4xor1_26,
|
297
|
+
._Input--readOnly_4xor1_75 > select._Input-input_4xor1_26 {
|
293
298
|
background-color: var(--puck-color-grey-11);
|
294
299
|
border-color: var(--puck-color-grey-09);
|
295
300
|
color: var(--puck-color-grey-04);
|
@@ -298,34 +303,34 @@ select._Input-input_g5w3n_26:dir(rtl) {
|
|
298
303
|
outline: 0;
|
299
304
|
transition: none;
|
300
305
|
}
|
301
|
-
._Input-
|
306
|
+
._Input-radioGroupItems_4xor1_86 {
|
302
307
|
display: flex;
|
303
308
|
border: 1px solid var(--puck-color-grey-09);
|
304
309
|
border-radius: 4px;
|
305
310
|
flex-wrap: wrap;
|
306
311
|
}
|
307
|
-
._Input-
|
312
|
+
._Input-radio_4xor1_86 {
|
308
313
|
border-inline-end: 1px solid var(--puck-color-grey-09);
|
309
314
|
flex-grow: 1;
|
310
315
|
}
|
311
|
-
._Input-
|
316
|
+
._Input-radio_4xor1_86:first-of-type {
|
312
317
|
border-bottom-left-radius: 4px;
|
313
318
|
border-top-left-radius: 4px;
|
314
319
|
}
|
315
|
-
._Input-
|
320
|
+
._Input-radio_4xor1_86:first-of-type ._Input-radioInner_4xor1_103 {
|
316
321
|
border-bottom-left-radius: 3px;
|
317
322
|
border-top-left-radius: 3px;
|
318
323
|
}
|
319
|
-
._Input-
|
324
|
+
._Input-radio_4xor1_86:last-of-type {
|
320
325
|
border-bottom-right-radius: 4px;
|
321
326
|
border-inline-end: 0;
|
322
327
|
border-top-right-radius: 4px;
|
323
328
|
}
|
324
|
-
._Input-
|
329
|
+
._Input-radio_4xor1_86:last-of-type ._Input-radioInner_4xor1_103 {
|
325
330
|
border-bottom-right-radius: 3px;
|
326
331
|
border-top-right-radius: 3px;
|
327
332
|
}
|
328
|
-
._Input-
|
333
|
+
._Input-radioInner_4xor1_103 {
|
329
334
|
background-color: var(--puck-color-white);
|
330
335
|
color: var(--puck-color-grey-04);
|
331
336
|
cursor: pointer;
|
@@ -334,32 +339,32 @@ select._Input-input_g5w3n_26:dir(rtl) {
|
|
334
339
|
text-align: center;
|
335
340
|
transition: background-color 50ms ease-in;
|
336
341
|
}
|
337
|
-
._Input-
|
342
|
+
._Input-radio_4xor1_86:has(:focus-visible) {
|
338
343
|
outline: 2px solid var(--puck-color-azure-05);
|
339
344
|
outline-offset: 2px;
|
340
345
|
position: relative;
|
341
346
|
}
|
342
347
|
@media (hover: hover) and (pointer: fine) {
|
343
|
-
._Input-
|
348
|
+
._Input-radioInner_4xor1_103:hover {
|
344
349
|
background-color: var(--puck-color-azure-12);
|
345
350
|
transition: none;
|
346
351
|
}
|
347
352
|
}
|
348
|
-
._Input--
|
353
|
+
._Input--readOnly_4xor1_75 ._Input-radioInner_4xor1_103 {
|
349
354
|
background-color: var(--puck-color-white);
|
350
355
|
color: var(--puck-color-grey-04);
|
351
356
|
cursor: default;
|
352
357
|
}
|
353
|
-
._Input-
|
358
|
+
._Input-radio_4xor1_86 ._Input-radioInput_4xor1_148:checked ~ ._Input-radioInner_4xor1_103 {
|
354
359
|
background-color: var(--puck-color-azure-11);
|
355
360
|
color: var(--puck-color-azure-04);
|
356
361
|
font-weight: 500;
|
357
362
|
}
|
358
|
-
._Input--
|
363
|
+
._Input--readOnly_4xor1_75 ._Input-radioInput_4xor1_148:checked ~ ._Input-radioInner_4xor1_103 {
|
359
364
|
background-color: var(--puck-color-grey-11);
|
360
365
|
color: var(--puck-color-grey-04);
|
361
366
|
}
|
362
|
-
._Input-
|
367
|
+
._Input-radio_4xor1_86 ._Input-radioInput_4xor1_148 {
|
363
368
|
clip: rect(0 0 0 0);
|
364
369
|
clip-path: inset(100%);
|
365
370
|
height: 1px;
|
@@ -368,7 +373,7 @@ select._Input-input_g5w3n_26:dir(rtl) {
|
|
368
373
|
white-space: nowrap;
|
369
374
|
width: 1px;
|
370
375
|
}
|
371
|
-
textarea._Input-
|
376
|
+
textarea._Input-input_4xor1_26 {
|
372
377
|
margin-bottom: -4px;
|
373
378
|
}
|
374
379
|
|
@@ -1146,12 +1151,12 @@ textarea._Input-input_g5w3n_26 {
|
|
1146
1151
|
}
|
1147
1152
|
|
1148
1153
|
/* css-module:/home/runner/work/puck/puck/packages/core/components/DraggableComponent/styles.module.css/#css-module-data */
|
1149
|
-
.
|
1154
|
+
._DraggableComponent_qzbgx_1 {
|
1150
1155
|
position: absolute;
|
1151
1156
|
pointer-events: none;
|
1152
1157
|
--overlay-background: color-mix( in srgb, var(--puck-color-azure-08) 30%, transparent );
|
1153
1158
|
}
|
1154
|
-
._DraggableComponent-
|
1159
|
+
._DraggableComponent-overlay_qzbgx_12 {
|
1155
1160
|
cursor: pointer;
|
1156
1161
|
height: 100%;
|
1157
1162
|
width: 100%;
|
@@ -1163,10 +1168,10 @@ textarea._Input-input_g5w3n_26 {
|
|
1163
1168
|
box-sizing: border-box;
|
1164
1169
|
z-index: 1;
|
1165
1170
|
}
|
1166
|
-
.
|
1171
|
+
._DraggableComponent_qzbgx_1:focus-visible > ._DraggableComponent-overlay_qzbgx_12 {
|
1167
1172
|
outline: 1px solid var(--puck-color-azure-05);
|
1168
1173
|
}
|
1169
|
-
._DraggableComponent-
|
1174
|
+
._DraggableComponent-loadingOverlay_qzbgx_29 {
|
1170
1175
|
background: var(--puck-color-white);
|
1171
1176
|
color: var(--puck-color-grey-03);
|
1172
1177
|
border-radius: 4px;
|
@@ -1181,35 +1186,36 @@ textarea._Input-input_g5w3n_26 {
|
|
1181
1186
|
opacity: 0.8;
|
1182
1187
|
z-index: 1;
|
1183
1188
|
}
|
1184
|
-
._DraggableComponent--
|
1189
|
+
._DraggableComponent--hover_qzbgx_45:not(._DraggableComponent--isLocked_qzbgx_45) > ._DraggableComponent-overlay_qzbgx_12 {
|
1185
1190
|
background: var(--overlay-background);
|
1186
1191
|
}
|
1187
|
-
._DraggableComponent--
|
1192
|
+
._DraggableComponent--hover_qzbgx_45 > ._DraggableComponent-overlay_qzbgx_12 {
|
1188
1193
|
outline: 2px var(--puck-color-azure-09) solid;
|
1189
1194
|
}
|
1190
|
-
._DraggableComponent--
|
1195
|
+
._DraggableComponent--isSelected_qzbgx_54 > ._DraggableComponent-overlay_qzbgx_12 {
|
1191
1196
|
outline-color: var(--puck-color-azure-07);
|
1192
1197
|
}
|
1193
|
-
.
|
1198
|
+
._DraggableComponent_qzbgx_1:has(._DraggableComponent--hover_qzbgx_45 > ._DraggableComponent-overlay_qzbgx_12) > ._DraggableComponent-overlay_qzbgx_12 {
|
1194
1199
|
display: none;
|
1195
1200
|
}
|
1196
|
-
._DraggableComponent-
|
1201
|
+
._DraggableComponent-actionsOverlay_qzbgx_66 {
|
1197
1202
|
position: sticky;
|
1198
1203
|
opacity: 0;
|
1199
1204
|
pointer-events: none;
|
1200
1205
|
z-index: 2;
|
1201
1206
|
}
|
1202
|
-
._DraggableComponent--
|
1207
|
+
._DraggableComponent--isSelected_qzbgx_54 ._DraggableComponent-actionsOverlay_qzbgx_66 {
|
1203
1208
|
opacity: 1;
|
1204
1209
|
pointer-events: auto;
|
1205
1210
|
}
|
1206
|
-
._DraggableComponent-
|
1211
|
+
._DraggableComponent-actions_qzbgx_66 {
|
1207
1212
|
position: absolute;
|
1208
1213
|
width: auto;
|
1209
1214
|
cursor: grab;
|
1210
1215
|
display: flex;
|
1211
1216
|
box-sizing: border-box;
|
1212
1217
|
transform-origin: right top;
|
1218
|
+
min-height: 36px;
|
1213
1219
|
}
|
1214
1220
|
|
1215
1221
|
/* components/DraggableComponent/styles.css */
|
package/dist/index.d.mts
CHANGED
@@ -1,5 +1,5 @@
|
|
1
|
-
import { H as History,
|
2
|
-
export {
|
1
|
+
import { H as History, P as Permissions, C as ComponentData, a as Config, U as UserGenerics, F as Fields, b as PuckAction, R as RootDataWithProps, c as ResolveDataTrigger, d as Plugin, O as Overrides, V as Viewports, I as IframeConfig, e as UiState, f as ComponentConfig, A as AppState, M as Metadata, g as Field, h as FieldProps, D as DropZoneProps, i as Data, j as OnAction, k as InitialHistory, l as RootData, m as Content, n as ItemSelector } from './resolve-all-data-DtB0OZRl.mjs';
|
2
|
+
export { X as Adaptor, Q as ArrayField, v as ArrayState, a8 as AsFieldProps, B as BaseData, G as BaseField, E as ComponentDataMap, $ as CustomField, _ as CustomFieldRender, a5 as DefaultComponentProps, a2 as DefaultRootFieldProps, a4 as DefaultRootProps, a3 as DefaultRootRenderProps, o as Direction, p as DragAxis, Z as ExternalField, Y as ExternalFieldWithAdaptor, aa as ExtractPropsFromConfig, ab as ExtractRootPropsFromConfig, t as FieldRenderFunctions, u as ItemWithId, z as MappedItem, N as NumberField, W as ObjectField, s as OverrideKey, w as PuckComponent, a1 as PuckContext, L as RadioField, x as RootConfig, y as RootDataWithoutProps, K as SelectField, S as Slot, a0 as SlotField, T as TextField, J as TextareaField, q as Viewport, a9 as WithChildren, a6 as WithId, a7 as WithPuckProps, r as overrideKeys, ad as resolveAllData, ac as transformProps } from './resolve-all-data-DtB0OZRl.mjs';
|
3
3
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
4
4
|
import * as react from 'react';
|
5
5
|
import react__default, { ReactNode, SyntheticEvent, ReactElement } from 'react';
|
@@ -246,18 +246,27 @@ declare function Render<UserConfig extends Config = Config, G extends UserGeneri
|
|
246
246
|
metadata?: Metadata;
|
247
247
|
}): react_jsx_runtime.JSX.Element;
|
248
248
|
|
249
|
-
declare function migrate(data: Data): Data;
|
249
|
+
declare function migrate(data: Data, config?: Config): Data;
|
250
|
+
|
251
|
+
type WalkTreeOptions = {
|
252
|
+
parentId: string;
|
253
|
+
propName: string;
|
254
|
+
};
|
255
|
+
declare function walkTree<T extends ComponentData | RootData | G["UserData"], UserConfig extends Config = Config, G extends UserGenerics<UserConfig> = UserGenerics<UserConfig>>(data: T, config: UserConfig, callbackFn: (data: Content, options: WalkTreeOptions) => Content | null | void): T;
|
250
256
|
|
251
257
|
type WithGet<T> = T & {
|
252
258
|
get: () => T;
|
253
259
|
};
|
254
260
|
type UsePuckData<UserConfig extends Config = Config, G extends UserGenerics<UserConfig> = UserGenerics<UserConfig>> = {
|
255
261
|
appState: AppState;
|
256
|
-
config:
|
262
|
+
config: UserConfig;
|
257
263
|
dispatch: AppStore["dispatch"];
|
258
264
|
getPermissions: GetPermissions<UserConfig>;
|
259
265
|
refreshPermissions: RefreshPermissions<UserConfig>;
|
260
266
|
selectedItem: G["UserComponentData"] | null;
|
267
|
+
getItemBySelector: (selector: ItemSelector) => ComponentData | undefined;
|
268
|
+
getItemById: (id: string) => ComponentData | undefined;
|
269
|
+
getSelectorForId: (id: string) => Required<ItemSelector> | undefined;
|
261
270
|
history: {
|
262
271
|
back: HistorySlice["back"];
|
263
272
|
forward: HistorySlice["forward"];
|
@@ -269,7 +278,8 @@ type UsePuckData<UserConfig extends Config = Config, G extends UserGenerics<User
|
|
269
278
|
hasFuture: boolean;
|
270
279
|
};
|
271
280
|
};
|
272
|
-
type
|
281
|
+
type PuckApi<UserConfig extends Config = Config> = UsePuckData<UserConfig>;
|
282
|
+
type UsePuckStore<UserConfig extends Config = Config> = WithGet<PuckApi<UserConfig>>;
|
273
283
|
/**
|
274
284
|
* createUsePuck
|
275
285
|
*
|
@@ -279,7 +289,7 @@ type UsePuckStore<UserConfig extends Config = Config> = WithGet<UsePuckData<User
|
|
279
289
|
*
|
280
290
|
* @returns a typed usePuck function
|
281
291
|
*/
|
282
|
-
declare function createUsePuck<UserConfig extends Config = Config>(): <T =
|
292
|
+
declare function createUsePuck<UserConfig extends Config = Config>(): <T = PuckApi<UserConfig>>(selector: (state: UsePuckStore<UserConfig>) => T) => T;
|
283
293
|
declare function usePuck<UserConfig extends Config = Config>(): UsePuckStore<UserConfig>;
|
284
294
|
|
285
|
-
export { Action, ActionBar, AppState, AutoField, Button, ComponentConfig, ComponentData, Config, Data, Drawer, DropZone, Field, FieldLabel, FieldProps, Fields, Group, History, IconButton, IframeConfig, InitialHistory, Label, Metadata, OnAction, Overrides, Permissions, Plugin, Puck, PuckAction, Render, ResolveDataTrigger, RootDataWithProps, UiState, type UsePuckData, UserGenerics, Viewports, createUsePuck, migrate, renderContext, usePuck };
|
295
|
+
export { Action, ActionBar, AppState, AutoField, Button, ComponentConfig, ComponentData, Config, Content, Data, Drawer, DropZone, Field, FieldLabel, FieldProps, Fields, Group, History, IconButton, IframeConfig, InitialHistory, Label, Metadata, OnAction, Overrides, Permissions, Plugin, Puck, PuckAction, type PuckApi, Render, ResolveDataTrigger, RootData, RootDataWithProps, UiState, type UsePuckData, UserGenerics, Viewports, createUsePuck, migrate, renderContext, usePuck, walkTree };
|
package/dist/index.d.ts
CHANGED
@@ -1,5 +1,5 @@
|
|
1
|
-
import { H as History,
|
2
|
-
export {
|
1
|
+
import { H as History, P as Permissions, C as ComponentData, a as Config, U as UserGenerics, F as Fields, b as PuckAction, R as RootDataWithProps, c as ResolveDataTrigger, d as Plugin, O as Overrides, V as Viewports, I as IframeConfig, e as UiState, f as ComponentConfig, A as AppState, M as Metadata, g as Field, h as FieldProps, D as DropZoneProps, i as Data, j as OnAction, k as InitialHistory, l as RootData, m as Content, n as ItemSelector } from './resolve-all-data-DtB0OZRl.js';
|
2
|
+
export { X as Adaptor, Q as ArrayField, v as ArrayState, a8 as AsFieldProps, B as BaseData, G as BaseField, E as ComponentDataMap, $ as CustomField, _ as CustomFieldRender, a5 as DefaultComponentProps, a2 as DefaultRootFieldProps, a4 as DefaultRootProps, a3 as DefaultRootRenderProps, o as Direction, p as DragAxis, Z as ExternalField, Y as ExternalFieldWithAdaptor, aa as ExtractPropsFromConfig, ab as ExtractRootPropsFromConfig, t as FieldRenderFunctions, u as ItemWithId, z as MappedItem, N as NumberField, W as ObjectField, s as OverrideKey, w as PuckComponent, a1 as PuckContext, L as RadioField, x as RootConfig, y as RootDataWithoutProps, K as SelectField, S as Slot, a0 as SlotField, T as TextField, J as TextareaField, q as Viewport, a9 as WithChildren, a6 as WithId, a7 as WithPuckProps, r as overrideKeys, ad as resolveAllData, ac as transformProps } from './resolve-all-data-DtB0OZRl.js';
|
3
3
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
4
4
|
import * as react from 'react';
|
5
5
|
import react__default, { ReactNode, SyntheticEvent, ReactElement } from 'react';
|
@@ -246,18 +246,27 @@ declare function Render<UserConfig extends Config = Config, G extends UserGeneri
|
|
246
246
|
metadata?: Metadata;
|
247
247
|
}): react_jsx_runtime.JSX.Element;
|
248
248
|
|
249
|
-
declare function migrate(data: Data): Data;
|
249
|
+
declare function migrate(data: Data, config?: Config): Data;
|
250
|
+
|
251
|
+
type WalkTreeOptions = {
|
252
|
+
parentId: string;
|
253
|
+
propName: string;
|
254
|
+
};
|
255
|
+
declare function walkTree<T extends ComponentData | RootData | G["UserData"], UserConfig extends Config = Config, G extends UserGenerics<UserConfig> = UserGenerics<UserConfig>>(data: T, config: UserConfig, callbackFn: (data: Content, options: WalkTreeOptions) => Content | null | void): T;
|
250
256
|
|
251
257
|
type WithGet<T> = T & {
|
252
258
|
get: () => T;
|
253
259
|
};
|
254
260
|
type UsePuckData<UserConfig extends Config = Config, G extends UserGenerics<UserConfig> = UserGenerics<UserConfig>> = {
|
255
261
|
appState: AppState;
|
256
|
-
config:
|
262
|
+
config: UserConfig;
|
257
263
|
dispatch: AppStore["dispatch"];
|
258
264
|
getPermissions: GetPermissions<UserConfig>;
|
259
265
|
refreshPermissions: RefreshPermissions<UserConfig>;
|
260
266
|
selectedItem: G["UserComponentData"] | null;
|
267
|
+
getItemBySelector: (selector: ItemSelector) => ComponentData | undefined;
|
268
|
+
getItemById: (id: string) => ComponentData | undefined;
|
269
|
+
getSelectorForId: (id: string) => Required<ItemSelector> | undefined;
|
261
270
|
history: {
|
262
271
|
back: HistorySlice["back"];
|
263
272
|
forward: HistorySlice["forward"];
|
@@ -269,7 +278,8 @@ type UsePuckData<UserConfig extends Config = Config, G extends UserGenerics<User
|
|
269
278
|
hasFuture: boolean;
|
270
279
|
};
|
271
280
|
};
|
272
|
-
type
|
281
|
+
type PuckApi<UserConfig extends Config = Config> = UsePuckData<UserConfig>;
|
282
|
+
type UsePuckStore<UserConfig extends Config = Config> = WithGet<PuckApi<UserConfig>>;
|
273
283
|
/**
|
274
284
|
* createUsePuck
|
275
285
|
*
|
@@ -279,7 +289,7 @@ type UsePuckStore<UserConfig extends Config = Config> = WithGet<UsePuckData<User
|
|
279
289
|
*
|
280
290
|
* @returns a typed usePuck function
|
281
291
|
*/
|
282
|
-
declare function createUsePuck<UserConfig extends Config = Config>(): <T =
|
292
|
+
declare function createUsePuck<UserConfig extends Config = Config>(): <T = PuckApi<UserConfig>>(selector: (state: UsePuckStore<UserConfig>) => T) => T;
|
283
293
|
declare function usePuck<UserConfig extends Config = Config>(): UsePuckStore<UserConfig>;
|
284
294
|
|
285
|
-
export { Action, ActionBar, AppState, AutoField, Button, ComponentConfig, ComponentData, Config, Data, Drawer, DropZone, Field, FieldLabel, FieldProps, Fields, Group, History, IconButton, IframeConfig, InitialHistory, Label, Metadata, OnAction, Overrides, Permissions, Plugin, Puck, PuckAction, Render, ResolveDataTrigger, RootDataWithProps, UiState, type UsePuckData, UserGenerics, Viewports, createUsePuck, migrate, renderContext, usePuck };
|
295
|
+
export { Action, ActionBar, AppState, AutoField, Button, ComponentConfig, ComponentData, Config, Content, Data, Drawer, DropZone, Field, FieldLabel, FieldProps, Fields, Group, History, IconButton, IframeConfig, InitialHistory, Label, Metadata, OnAction, Overrides, Permissions, Plugin, Puck, PuckAction, type PuckApi, Render, ResolveDataTrigger, RootData, RootDataWithProps, UiState, type UsePuckData, UserGenerics, Viewports, createUsePuck, migrate, renderContext, usePuck, walkTree };
|