@measured/puck 0.19.0-canary.020071e → 0.19.0-canary.036267f6
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/chunk-6YBZGVZI.mjs +5265 -0
- package/dist/index.css +28 -17
- package/dist/index.d.mts +104 -105
- package/dist/index.d.ts +104 -105
- package/dist/index.js +1661 -1422
- package/dist/index.mjs +1789 -6403
- package/dist/{resolve-all-data-3XjIPfNh.d.mts → resolve-all-data-Cs8PfTrg.d.mts} +54 -12
- package/dist/{resolve-all-data-3XjIPfNh.d.ts → resolve-all-data-Cs8PfTrg.d.ts} +54 -12
- package/dist/rsc.css +338 -0
- package/dist/rsc.d.mts +2 -2
- package/dist/rsc.d.ts +2 -2
- package/dist/rsc.js +3760 -237
- package/dist/rsc.mjs +52 -53
- package/package.json +3 -3
- package/dist/chunk-7N5DRY4G.mjs +0 -308
@@ -120,6 +120,9 @@ type CustomField<Props extends any = {}> = BaseField & {
|
|
120
120
|
readOnly?: boolean;
|
121
121
|
}) => ReactElement;
|
122
122
|
};
|
123
|
+
type SlotField = BaseField & {
|
124
|
+
type: "slot";
|
125
|
+
};
|
123
126
|
type Field<Props extends any = any> = TextField | NumberField | TextareaField | SelectField | RadioField | ArrayField<Props extends {
|
124
127
|
[key: string]: any;
|
125
128
|
} ? Props : any> | ObjectField<Props extends {
|
@@ -128,7 +131,7 @@ type Field<Props extends any = any> = TextField | NumberField | TextareaField |
|
|
128
131
|
[key: string]: any;
|
129
132
|
} ? Props : any> | ExternalFieldWithAdaptor<Props extends {
|
130
133
|
[key: string]: any;
|
131
|
-
} ? Props : any> | CustomField<Props
|
134
|
+
} ? Props : any> | CustomField<Props> | SlotField;
|
132
135
|
type Fields<ComponentProps extends DefaultComponentProps = DefaultComponentProps> = {
|
133
136
|
[PropName in keyof Omit<ComponentProps, "editMode">]: Field<ComponentProps[PropName]>;
|
134
137
|
};
|
@@ -141,15 +144,20 @@ type FieldProps<F = Field<any>, ValueType = any> = {
|
|
141
144
|
};
|
142
145
|
|
143
146
|
type PuckComponent<Props> = (props: WithId<WithPuckProps<Props>>) => JSX.Element;
|
147
|
+
type ResolveDataTrigger = "insert" | "replace" | "load" | "force";
|
144
148
|
type ComponentConfig<RenderProps extends DefaultComponentProps = DefaultComponentProps, FieldProps extends DefaultComponentProps = RenderProps, DataShape = Omit<ComponentData<FieldProps>, "type">> = {
|
145
|
-
render: PuckComponent<
|
149
|
+
render: PuckComponent<{
|
150
|
+
[PropName in keyof RenderProps]: RenderProps[PropName] extends Slot ? (props?: Omit<DropZoneProps, "zone">) => ReactNode : RenderProps[PropName];
|
151
|
+
}>;
|
146
152
|
label?: string;
|
147
153
|
defaultProps?: FieldProps;
|
148
154
|
fields?: Fields<FieldProps>;
|
149
155
|
permissions?: Partial<Permissions>;
|
150
156
|
inline?: boolean;
|
151
157
|
resolveFields?: (data: DataShape, params: {
|
152
|
-
changed: Partial<Record<keyof FieldProps, boolean
|
158
|
+
changed: Partial<Record<keyof FieldProps, boolean> & {
|
159
|
+
id: string;
|
160
|
+
}>;
|
153
161
|
fields: Fields<FieldProps>;
|
154
162
|
lastFields: Fields<FieldProps>;
|
155
163
|
lastData: DataShape | null;
|
@@ -157,9 +165,12 @@ type ComponentConfig<RenderProps extends DefaultComponentProps = DefaultComponen
|
|
157
165
|
parent: ComponentData | null;
|
158
166
|
}) => Promise<Fields<FieldProps>> | Fields<FieldProps>;
|
159
167
|
resolveData?: (data: DataShape, params: {
|
160
|
-
changed: Partial<Record<keyof FieldProps, boolean
|
168
|
+
changed: Partial<Record<keyof FieldProps, boolean> & {
|
169
|
+
id: string;
|
170
|
+
}>;
|
161
171
|
lastData: DataShape | null;
|
162
172
|
metadata: Metadata;
|
173
|
+
trigger: ResolveDataTrigger;
|
163
174
|
}) => Promise<{
|
164
175
|
props?: Partial<FieldProps>;
|
165
176
|
readOnly?: Partial<Record<keyof FieldProps, boolean>>;
|
@@ -168,13 +179,16 @@ type ComponentConfig<RenderProps extends DefaultComponentProps = DefaultComponen
|
|
168
179
|
readOnly?: Partial<Record<keyof FieldProps, boolean>>;
|
169
180
|
};
|
170
181
|
resolvePermissions?: (data: DataShape, params: {
|
171
|
-
changed: Partial<Record<keyof FieldProps, boolean
|
182
|
+
changed: Partial<Record<keyof FieldProps, boolean> & {
|
183
|
+
id: string;
|
184
|
+
}>;
|
172
185
|
lastPermissions: Partial<Permissions>;
|
173
186
|
permissions: Partial<Permissions>;
|
174
187
|
appState: AppState;
|
175
188
|
lastData: DataShape | null;
|
176
189
|
}) => Promise<Partial<Permissions>> | Partial<Permissions>;
|
177
190
|
};
|
191
|
+
type RootConfig<RootProps extends DefaultComponentProps = any> = Partial<ComponentConfig<WithChildren<RootProps>, AsFieldProps<RootProps>, RootData<AsFieldProps<RootProps>>>>;
|
178
192
|
type Category<ComponentName> = {
|
179
193
|
components?: ComponentName[];
|
180
194
|
title?: string;
|
@@ -188,7 +202,7 @@ type Config<Props extends DefaultComponentProps = DefaultComponentProps, RootPro
|
|
188
202
|
components: {
|
189
203
|
[ComponentName in keyof Props]: Omit<ComponentConfig<Props[ComponentName], Props[ComponentName]>, "type">;
|
190
204
|
};
|
191
|
-
root?:
|
205
|
+
root?: RootConfig<RootProps>;
|
192
206
|
};
|
193
207
|
|
194
208
|
type WithId<Props> = Props & {
|
@@ -204,7 +218,7 @@ type WithChildren<Props> = Props & {
|
|
204
218
|
};
|
205
219
|
type ExtractPropsFromConfig<UserConfig> = UserConfig extends Config<infer P, any, any> ? P : never;
|
206
220
|
type ExtractRootPropsFromConfig<UserConfig> = UserConfig extends Config<any, infer P, any> ? P : never;
|
207
|
-
type UserGenerics<UserConfig extends Config = Config, UserProps extends ExtractPropsFromConfig<UserConfig> = ExtractPropsFromConfig<UserConfig>, UserRootProps extends ExtractRootPropsFromConfig<UserConfig> = ExtractRootPropsFromConfig<UserConfig>, UserData extends Data<UserProps, UserRootProps> | Data = Data<UserProps, UserRootProps>, UserAppState extends
|
221
|
+
type UserGenerics<UserConfig extends Config = Config, UserProps extends ExtractPropsFromConfig<UserConfig> = ExtractPropsFromConfig<UserConfig>, UserRootProps extends ExtractRootPropsFromConfig<UserConfig> = ExtractRootPropsFromConfig<UserConfig>, UserData extends Data<UserProps, UserRootProps> | Data = Data<UserProps, UserRootProps>, UserAppState extends PrivateAppState<UserData> = PrivateAppState<UserData>, UserComponentData extends ComponentData = UserData["content"][0]> = {
|
208
222
|
UserConfig: UserConfig;
|
209
223
|
UserProps: UserProps;
|
210
224
|
UserRootProps: UserRootProps;
|
@@ -300,6 +314,27 @@ type AppState<UserData extends Data = Data> = {
|
|
300
314
|
ui: UiState;
|
301
315
|
};
|
302
316
|
|
317
|
+
type ZoneType = "root" | "dropzone" | "slot";
|
318
|
+
type PuckNodeData = {
|
319
|
+
data: ComponentData;
|
320
|
+
flatData: ComponentData;
|
321
|
+
parentId: string | null;
|
322
|
+
zone: string;
|
323
|
+
path: string[];
|
324
|
+
};
|
325
|
+
type PuckZoneData = {
|
326
|
+
contentIds: string[];
|
327
|
+
type: ZoneType;
|
328
|
+
};
|
329
|
+
type NodeIndex = Record<string, PuckNodeData>;
|
330
|
+
type ZoneIndex = Record<string, PuckZoneData>;
|
331
|
+
type PrivateAppState<UserData extends Data = Data> = AppState<UserData> & {
|
332
|
+
indexes: {
|
333
|
+
nodes: NodeIndex;
|
334
|
+
zones: ZoneIndex;
|
335
|
+
};
|
336
|
+
};
|
337
|
+
|
303
338
|
type RenderFunc<Props extends {
|
304
339
|
[key: string]: any;
|
305
340
|
} = {
|
@@ -406,6 +441,7 @@ type InitialHistoryNoAppend<AS = Partial<AppState>> = {
|
|
406
441
|
appendData?: false;
|
407
442
|
};
|
408
443
|
type InitialHistory<AS = Partial<AppState>> = InitialHistoryAppend<AS> | InitialHistoryNoAppend<AS>;
|
444
|
+
type Slot = Content;
|
409
445
|
|
410
446
|
type InsertAction = {
|
411
447
|
type: "insert";
|
@@ -419,11 +455,17 @@ type DuplicateAction = {
|
|
419
455
|
sourceIndex: number;
|
420
456
|
sourceZone: string;
|
421
457
|
};
|
422
|
-
type ReplaceAction = {
|
458
|
+
type ReplaceAction<UserData extends Data = Data> = {
|
423
459
|
type: "replace";
|
424
460
|
destinationIndex: number;
|
425
461
|
destinationZone: string;
|
426
|
-
data:
|
462
|
+
data: ComponentData;
|
463
|
+
ui?: Partial<AppState<UserData>["ui"]>;
|
464
|
+
};
|
465
|
+
type ReplaceRootAction<UserData extends Data = Data> = {
|
466
|
+
type: "replaceRoot";
|
467
|
+
root: RootData;
|
468
|
+
ui?: Partial<AppState<UserData>["ui"]>;
|
427
469
|
};
|
428
470
|
type ReorderAction = {
|
429
471
|
type: "reorder";
|
@@ -453,7 +495,7 @@ type SetDataAction = {
|
|
453
495
|
};
|
454
496
|
type SetAction<UserData extends Data = Data> = {
|
455
497
|
type: "set";
|
456
|
-
state: Partial<
|
498
|
+
state: Partial<PrivateAppState<UserData>> | ((previous: PrivateAppState<UserData>) => Partial<PrivateAppState<UserData>>);
|
457
499
|
};
|
458
500
|
type RegisterZoneAction = {
|
459
501
|
type: "registerZone";
|
@@ -465,7 +507,7 @@ type UnregisterZoneAction = {
|
|
465
507
|
};
|
466
508
|
type PuckAction = {
|
467
509
|
recordHistory?: boolean;
|
468
|
-
} & (ReorderAction | InsertAction | MoveAction | ReplaceAction | RemoveAction | DuplicateAction | SetAction | SetDataAction | SetUiAction | RegisterZoneAction | UnregisterZoneAction);
|
510
|
+
} & (ReorderAction | InsertAction | MoveAction | ReplaceAction | ReplaceRootAction | RemoveAction | DuplicateAction | SetAction | SetDataAction | SetUiAction | RegisterZoneAction | UnregisterZoneAction);
|
469
511
|
|
470
512
|
type PropTransform<Props extends DefaultComponentProps = DefaultComponentProps, RootProps extends DefaultComponentProps = DefaultRootFieldProps> = Partial<{
|
471
513
|
[ComponentName in keyof Props]: (props: Props[ComponentName] & {
|
@@ -480,4 +522,4 @@ declare function transformProps<Props extends DefaultComponentProps = DefaultCom
|
|
480
522
|
|
481
523
|
declare function resolveAllData<Props extends DefaultComponentProps = DefaultComponentProps, RootProps extends Record<string, any> = DefaultRootFieldProps>(data: Partial<Data>, config: Config, metadata?: Metadata, onResolveStart?: (item: ComponentData) => void, onResolveEnd?: (item: ComponentData) => void): Promise<Data<Props, RootProps>>;
|
482
524
|
|
483
|
-
export { type
|
525
|
+
export { type PuckContext as $, type AppState as A, type BaseData as B, type Config as C, type DropZoneProps as D, type BaseField as E, type Fields as F, type TextareaField as G, type History as H, type IframeConfig as I, type SelectField as J, type RadioField as K, type ArrayField as L, type Metadata as M, type NumberField as N, type Overrides as O, type Permissions as P, type ObjectField as Q, type RootDataWithProps as R, type Slot as S, type TextField as T, type UserGenerics as U, type Viewports as V, type Adaptor as W, type ExternalFieldWithAdaptor as X, type ExternalField as Y, type CustomField as Z, type SlotField as _, type ComponentData as a, type DefaultRootFieldProps as a0, type DefaultRootRenderProps as a1, type DefaultRootProps as a2, type DefaultComponentProps as a3, type WithId as a4, type WithPuckProps as a5, type AsFieldProps as a6, type WithChildren as a7, type ExtractPropsFromConfig as a8, type ExtractRootPropsFromConfig as a9, transformProps as aa, resolveAllData as ab, type PuckAction as b, type ResolveDataTrigger as c, type Plugin as d, type UiState as e, type ComponentConfig as f, type FieldProps as g, type Field as h, type Data as i, type OnAction as j, type InitialHistory as k, type Direction as l, type DragAxis as m, type Viewport as n, overrideKeys as o, type OverrideKey as p, type FieldRenderFunctions as q, type ItemWithId as r, type ArrayState as s, type PuckComponent as t, type RootConfig as u, type RootDataWithoutProps as v, type RootData as w, type MappedItem as x, type ComponentDataMap as y, type Content as z };
|
@@ -120,6 +120,9 @@ type CustomField<Props extends any = {}> = BaseField & {
|
|
120
120
|
readOnly?: boolean;
|
121
121
|
}) => ReactElement;
|
122
122
|
};
|
123
|
+
type SlotField = BaseField & {
|
124
|
+
type: "slot";
|
125
|
+
};
|
123
126
|
type Field<Props extends any = any> = TextField | NumberField | TextareaField | SelectField | RadioField | ArrayField<Props extends {
|
124
127
|
[key: string]: any;
|
125
128
|
} ? Props : any> | ObjectField<Props extends {
|
@@ -128,7 +131,7 @@ type Field<Props extends any = any> = TextField | NumberField | TextareaField |
|
|
128
131
|
[key: string]: any;
|
129
132
|
} ? Props : any> | ExternalFieldWithAdaptor<Props extends {
|
130
133
|
[key: string]: any;
|
131
|
-
} ? Props : any> | CustomField<Props
|
134
|
+
} ? Props : any> | CustomField<Props> | SlotField;
|
132
135
|
type Fields<ComponentProps extends DefaultComponentProps = DefaultComponentProps> = {
|
133
136
|
[PropName in keyof Omit<ComponentProps, "editMode">]: Field<ComponentProps[PropName]>;
|
134
137
|
};
|
@@ -141,15 +144,20 @@ type FieldProps<F = Field<any>, ValueType = any> = {
|
|
141
144
|
};
|
142
145
|
|
143
146
|
type PuckComponent<Props> = (props: WithId<WithPuckProps<Props>>) => JSX.Element;
|
147
|
+
type ResolveDataTrigger = "insert" | "replace" | "load" | "force";
|
144
148
|
type ComponentConfig<RenderProps extends DefaultComponentProps = DefaultComponentProps, FieldProps extends DefaultComponentProps = RenderProps, DataShape = Omit<ComponentData<FieldProps>, "type">> = {
|
145
|
-
render: PuckComponent<
|
149
|
+
render: PuckComponent<{
|
150
|
+
[PropName in keyof RenderProps]: RenderProps[PropName] extends Slot ? (props?: Omit<DropZoneProps, "zone">) => ReactNode : RenderProps[PropName];
|
151
|
+
}>;
|
146
152
|
label?: string;
|
147
153
|
defaultProps?: FieldProps;
|
148
154
|
fields?: Fields<FieldProps>;
|
149
155
|
permissions?: Partial<Permissions>;
|
150
156
|
inline?: boolean;
|
151
157
|
resolveFields?: (data: DataShape, params: {
|
152
|
-
changed: Partial<Record<keyof FieldProps, boolean
|
158
|
+
changed: Partial<Record<keyof FieldProps, boolean> & {
|
159
|
+
id: string;
|
160
|
+
}>;
|
153
161
|
fields: Fields<FieldProps>;
|
154
162
|
lastFields: Fields<FieldProps>;
|
155
163
|
lastData: DataShape | null;
|
@@ -157,9 +165,12 @@ type ComponentConfig<RenderProps extends DefaultComponentProps = DefaultComponen
|
|
157
165
|
parent: ComponentData | null;
|
158
166
|
}) => Promise<Fields<FieldProps>> | Fields<FieldProps>;
|
159
167
|
resolveData?: (data: DataShape, params: {
|
160
|
-
changed: Partial<Record<keyof FieldProps, boolean
|
168
|
+
changed: Partial<Record<keyof FieldProps, boolean> & {
|
169
|
+
id: string;
|
170
|
+
}>;
|
161
171
|
lastData: DataShape | null;
|
162
172
|
metadata: Metadata;
|
173
|
+
trigger: ResolveDataTrigger;
|
163
174
|
}) => Promise<{
|
164
175
|
props?: Partial<FieldProps>;
|
165
176
|
readOnly?: Partial<Record<keyof FieldProps, boolean>>;
|
@@ -168,13 +179,16 @@ type ComponentConfig<RenderProps extends DefaultComponentProps = DefaultComponen
|
|
168
179
|
readOnly?: Partial<Record<keyof FieldProps, boolean>>;
|
169
180
|
};
|
170
181
|
resolvePermissions?: (data: DataShape, params: {
|
171
|
-
changed: Partial<Record<keyof FieldProps, boolean
|
182
|
+
changed: Partial<Record<keyof FieldProps, boolean> & {
|
183
|
+
id: string;
|
184
|
+
}>;
|
172
185
|
lastPermissions: Partial<Permissions>;
|
173
186
|
permissions: Partial<Permissions>;
|
174
187
|
appState: AppState;
|
175
188
|
lastData: DataShape | null;
|
176
189
|
}) => Promise<Partial<Permissions>> | Partial<Permissions>;
|
177
190
|
};
|
191
|
+
type RootConfig<RootProps extends DefaultComponentProps = any> = Partial<ComponentConfig<WithChildren<RootProps>, AsFieldProps<RootProps>, RootData<AsFieldProps<RootProps>>>>;
|
178
192
|
type Category<ComponentName> = {
|
179
193
|
components?: ComponentName[];
|
180
194
|
title?: string;
|
@@ -188,7 +202,7 @@ type Config<Props extends DefaultComponentProps = DefaultComponentProps, RootPro
|
|
188
202
|
components: {
|
189
203
|
[ComponentName in keyof Props]: Omit<ComponentConfig<Props[ComponentName], Props[ComponentName]>, "type">;
|
190
204
|
};
|
191
|
-
root?:
|
205
|
+
root?: RootConfig<RootProps>;
|
192
206
|
};
|
193
207
|
|
194
208
|
type WithId<Props> = Props & {
|
@@ -204,7 +218,7 @@ type WithChildren<Props> = Props & {
|
|
204
218
|
};
|
205
219
|
type ExtractPropsFromConfig<UserConfig> = UserConfig extends Config<infer P, any, any> ? P : never;
|
206
220
|
type ExtractRootPropsFromConfig<UserConfig> = UserConfig extends Config<any, infer P, any> ? P : never;
|
207
|
-
type UserGenerics<UserConfig extends Config = Config, UserProps extends ExtractPropsFromConfig<UserConfig> = ExtractPropsFromConfig<UserConfig>, UserRootProps extends ExtractRootPropsFromConfig<UserConfig> = ExtractRootPropsFromConfig<UserConfig>, UserData extends Data<UserProps, UserRootProps> | Data = Data<UserProps, UserRootProps>, UserAppState extends
|
221
|
+
type UserGenerics<UserConfig extends Config = Config, UserProps extends ExtractPropsFromConfig<UserConfig> = ExtractPropsFromConfig<UserConfig>, UserRootProps extends ExtractRootPropsFromConfig<UserConfig> = ExtractRootPropsFromConfig<UserConfig>, UserData extends Data<UserProps, UserRootProps> | Data = Data<UserProps, UserRootProps>, UserAppState extends PrivateAppState<UserData> = PrivateAppState<UserData>, UserComponentData extends ComponentData = UserData["content"][0]> = {
|
208
222
|
UserConfig: UserConfig;
|
209
223
|
UserProps: UserProps;
|
210
224
|
UserRootProps: UserRootProps;
|
@@ -300,6 +314,27 @@ type AppState<UserData extends Data = Data> = {
|
|
300
314
|
ui: UiState;
|
301
315
|
};
|
302
316
|
|
317
|
+
type ZoneType = "root" | "dropzone" | "slot";
|
318
|
+
type PuckNodeData = {
|
319
|
+
data: ComponentData;
|
320
|
+
flatData: ComponentData;
|
321
|
+
parentId: string | null;
|
322
|
+
zone: string;
|
323
|
+
path: string[];
|
324
|
+
};
|
325
|
+
type PuckZoneData = {
|
326
|
+
contentIds: string[];
|
327
|
+
type: ZoneType;
|
328
|
+
};
|
329
|
+
type NodeIndex = Record<string, PuckNodeData>;
|
330
|
+
type ZoneIndex = Record<string, PuckZoneData>;
|
331
|
+
type PrivateAppState<UserData extends Data = Data> = AppState<UserData> & {
|
332
|
+
indexes: {
|
333
|
+
nodes: NodeIndex;
|
334
|
+
zones: ZoneIndex;
|
335
|
+
};
|
336
|
+
};
|
337
|
+
|
303
338
|
type RenderFunc<Props extends {
|
304
339
|
[key: string]: any;
|
305
340
|
} = {
|
@@ -406,6 +441,7 @@ type InitialHistoryNoAppend<AS = Partial<AppState>> = {
|
|
406
441
|
appendData?: false;
|
407
442
|
};
|
408
443
|
type InitialHistory<AS = Partial<AppState>> = InitialHistoryAppend<AS> | InitialHistoryNoAppend<AS>;
|
444
|
+
type Slot = Content;
|
409
445
|
|
410
446
|
type InsertAction = {
|
411
447
|
type: "insert";
|
@@ -419,11 +455,17 @@ type DuplicateAction = {
|
|
419
455
|
sourceIndex: number;
|
420
456
|
sourceZone: string;
|
421
457
|
};
|
422
|
-
type ReplaceAction = {
|
458
|
+
type ReplaceAction<UserData extends Data = Data> = {
|
423
459
|
type: "replace";
|
424
460
|
destinationIndex: number;
|
425
461
|
destinationZone: string;
|
426
|
-
data:
|
462
|
+
data: ComponentData;
|
463
|
+
ui?: Partial<AppState<UserData>["ui"]>;
|
464
|
+
};
|
465
|
+
type ReplaceRootAction<UserData extends Data = Data> = {
|
466
|
+
type: "replaceRoot";
|
467
|
+
root: RootData;
|
468
|
+
ui?: Partial<AppState<UserData>["ui"]>;
|
427
469
|
};
|
428
470
|
type ReorderAction = {
|
429
471
|
type: "reorder";
|
@@ -453,7 +495,7 @@ type SetDataAction = {
|
|
453
495
|
};
|
454
496
|
type SetAction<UserData extends Data = Data> = {
|
455
497
|
type: "set";
|
456
|
-
state: Partial<
|
498
|
+
state: Partial<PrivateAppState<UserData>> | ((previous: PrivateAppState<UserData>) => Partial<PrivateAppState<UserData>>);
|
457
499
|
};
|
458
500
|
type RegisterZoneAction = {
|
459
501
|
type: "registerZone";
|
@@ -465,7 +507,7 @@ type UnregisterZoneAction = {
|
|
465
507
|
};
|
466
508
|
type PuckAction = {
|
467
509
|
recordHistory?: boolean;
|
468
|
-
} & (ReorderAction | InsertAction | MoveAction | ReplaceAction | RemoveAction | DuplicateAction | SetAction | SetDataAction | SetUiAction | RegisterZoneAction | UnregisterZoneAction);
|
510
|
+
} & (ReorderAction | InsertAction | MoveAction | ReplaceAction | ReplaceRootAction | RemoveAction | DuplicateAction | SetAction | SetDataAction | SetUiAction | RegisterZoneAction | UnregisterZoneAction);
|
469
511
|
|
470
512
|
type PropTransform<Props extends DefaultComponentProps = DefaultComponentProps, RootProps extends DefaultComponentProps = DefaultRootFieldProps> = Partial<{
|
471
513
|
[ComponentName in keyof Props]: (props: Props[ComponentName] & {
|
@@ -480,4 +522,4 @@ declare function transformProps<Props extends DefaultComponentProps = DefaultCom
|
|
480
522
|
|
481
523
|
declare function resolveAllData<Props extends DefaultComponentProps = DefaultComponentProps, RootProps extends Record<string, any> = DefaultRootFieldProps>(data: Partial<Data>, config: Config, metadata?: Metadata, onResolveStart?: (item: ComponentData) => void, onResolveEnd?: (item: ComponentData) => void): Promise<Data<Props, RootProps>>;
|
482
524
|
|
483
|
-
export { type
|
525
|
+
export { type PuckContext as $, type AppState as A, type BaseData as B, type Config as C, type DropZoneProps as D, type BaseField as E, type Fields as F, type TextareaField as G, type History as H, type IframeConfig as I, type SelectField as J, type RadioField as K, type ArrayField as L, type Metadata as M, type NumberField as N, type Overrides as O, type Permissions as P, type ObjectField as Q, type RootDataWithProps as R, type Slot as S, type TextField as T, type UserGenerics as U, type Viewports as V, type Adaptor as W, type ExternalFieldWithAdaptor as X, type ExternalField as Y, type CustomField as Z, type SlotField as _, type ComponentData as a, type DefaultRootFieldProps as a0, type DefaultRootRenderProps as a1, type DefaultRootProps as a2, type DefaultComponentProps as a3, type WithId as a4, type WithPuckProps as a5, type AsFieldProps as a6, type WithChildren as a7, type ExtractPropsFromConfig as a8, type ExtractRootPropsFromConfig as a9, transformProps as aa, resolveAllData as ab, type PuckAction as b, type ResolveDataTrigger as c, type Plugin as d, type UiState as e, type ComponentConfig as f, type FieldProps as g, type Field as h, type Data as i, type OnAction as j, type InitialHistory as k, type Direction as l, type DragAxis as m, type Viewport as n, overrideKeys as o, type OverrideKey as p, type FieldRenderFunctions as q, type ItemWithId as r, type ArrayState as s, type PuckComponent as t, type RootConfig as u, type RootDataWithoutProps as v, type RootData as w, type MappedItem as x, type ComponentDataMap as y, type Content as z };
|
package/dist/rsc.css
ADDED
@@ -0,0 +1,338 @@
|
|
1
|
+
/* css-module:/home/runner/work/puck/puck/packages/core/components/DraggableComponent/styles.module.css/#css-module-data */
|
2
|
+
._DraggableComponent_1ukn8_1 {
|
3
|
+
position: absolute;
|
4
|
+
pointer-events: none;
|
5
|
+
--overlay-background: color-mix( in srgb, var(--puck-color-azure-08) 30%, transparent );
|
6
|
+
}
|
7
|
+
._DraggableComponent-overlay_1ukn8_12 {
|
8
|
+
cursor: pointer;
|
9
|
+
height: 100%;
|
10
|
+
width: 100%;
|
11
|
+
top: 0;
|
12
|
+
outline: 2px var(--puck-color-azure-09) solid;
|
13
|
+
outline-offset: -2px;
|
14
|
+
position: absolute;
|
15
|
+
pointer-events: none;
|
16
|
+
box-sizing: border-box;
|
17
|
+
z-index: 1;
|
18
|
+
}
|
19
|
+
._DraggableComponent_1ukn8_1:focus-visible > ._DraggableComponent-overlay_1ukn8_12 {
|
20
|
+
outline: 1px solid var(--puck-color-azure-05);
|
21
|
+
}
|
22
|
+
._DraggableComponent-loadingOverlay_1ukn8_29 {
|
23
|
+
background: var(--puck-color-white);
|
24
|
+
color: var(--puck-color-grey-03);
|
25
|
+
border-radius: 4px;
|
26
|
+
display: flex;
|
27
|
+
padding: 8px;
|
28
|
+
top: 8px;
|
29
|
+
right: 8px;
|
30
|
+
position: absolute;
|
31
|
+
z-index: 1;
|
32
|
+
pointer-events: all;
|
33
|
+
box-sizing: border-box;
|
34
|
+
opacity: 0.8;
|
35
|
+
z-index: 1;
|
36
|
+
}
|
37
|
+
._DraggableComponent--hover_1ukn8_45:not(._DraggableComponent--isLocked_1ukn8_45) > ._DraggableComponent-overlay_1ukn8_12 {
|
38
|
+
background: var(--overlay-background);
|
39
|
+
}
|
40
|
+
._DraggableComponent--hover_1ukn8_45 > ._DraggableComponent-overlay_1ukn8_12 {
|
41
|
+
outline: 2px var(--puck-color-azure-09) solid;
|
42
|
+
}
|
43
|
+
._DraggableComponent--isSelected_1ukn8_54 > ._DraggableComponent-overlay_1ukn8_12 {
|
44
|
+
outline-color: var(--puck-color-azure-07);
|
45
|
+
}
|
46
|
+
._DraggableComponent_1ukn8_1:has(._DraggableComponent--hover_1ukn8_45 > ._DraggableComponent-overlay_1ukn8_12) > ._DraggableComponent-overlay_1ukn8_12 {
|
47
|
+
display: none;
|
48
|
+
}
|
49
|
+
._DraggableComponent-actionsOverlay_1ukn8_66 {
|
50
|
+
position: sticky;
|
51
|
+
opacity: 0;
|
52
|
+
pointer-events: none;
|
53
|
+
z-index: 2;
|
54
|
+
}
|
55
|
+
._DraggableComponent--isSelected_1ukn8_54 ._DraggableComponent-actionsOverlay_1ukn8_66 {
|
56
|
+
opacity: 1;
|
57
|
+
pointer-events: auto;
|
58
|
+
}
|
59
|
+
._DraggableComponent-actions_1ukn8_66 {
|
60
|
+
position: absolute;
|
61
|
+
width: auto;
|
62
|
+
cursor: grab;
|
63
|
+
display: flex;
|
64
|
+
box-sizing: border-box;
|
65
|
+
transform-origin: right top;
|
66
|
+
}
|
67
|
+
|
68
|
+
/* components/DraggableComponent/styles.css */
|
69
|
+
[data-puck-component] * {
|
70
|
+
pointer-events: none;
|
71
|
+
user-select: none;
|
72
|
+
-webkit-user-select: none;
|
73
|
+
}
|
74
|
+
[data-puck-component] {
|
75
|
+
cursor: grab;
|
76
|
+
pointer-events: auto !important;
|
77
|
+
user-select: none;
|
78
|
+
-webkit-user-select: none;
|
79
|
+
}
|
80
|
+
[data-puck-dropzone] {
|
81
|
+
pointer-events: auto !important;
|
82
|
+
}
|
83
|
+
[data-puck-disabled] {
|
84
|
+
cursor: pointer;
|
85
|
+
}
|
86
|
+
[data-puck-dragging]:not([data-dnd-dragging]) {
|
87
|
+
background: var(--puck-color-azure-06) !important;
|
88
|
+
border: none !important;
|
89
|
+
color: #00000000 !important;
|
90
|
+
opacity: 0.3 !important;
|
91
|
+
outline: none !important;
|
92
|
+
transition: none !important;
|
93
|
+
}
|
94
|
+
[data-puck-dragging]:not([data-dnd-dragging]) *,
|
95
|
+
[data-puck-dragging]:not([data-dnd-dragging])::after,
|
96
|
+
[data-puck-dragging]:not([data-dnd-dragging])::before {
|
97
|
+
opacity: 0 !important;
|
98
|
+
}
|
99
|
+
[data-dnd-dragging][data-puck-component] {
|
100
|
+
pointer-events: none !important;
|
101
|
+
outline: 2px var(--puck-color-azure-09) solid !important;
|
102
|
+
outline-offset: -2px !important;
|
103
|
+
}
|
104
|
+
|
105
|
+
/* css-module:/home/runner/work/puck/puck/packages/core/components/Loader/styles.module.css/#css-module-data */
|
106
|
+
@keyframes _loader-animation_nacdm_1 {
|
107
|
+
0% {
|
108
|
+
transform: rotate(0deg) scale(1);
|
109
|
+
}
|
110
|
+
50% {
|
111
|
+
transform: rotate(180deg) scale(0.8);
|
112
|
+
}
|
113
|
+
100% {
|
114
|
+
transform: rotate(360deg) scale(1);
|
115
|
+
}
|
116
|
+
}
|
117
|
+
._Loader_nacdm_13 {
|
118
|
+
background: transparent;
|
119
|
+
border-radius: 100%;
|
120
|
+
border: 2px solid currentColor;
|
121
|
+
border-bottom-color: transparent;
|
122
|
+
display: inline-block;
|
123
|
+
animation: _loader-animation_nacdm_1 1s 0s infinite linear;
|
124
|
+
animation-fill-mode: both;
|
125
|
+
}
|
126
|
+
|
127
|
+
/* css-module:/home/runner/work/puck/puck/packages/core/components/ActionBar/styles.module.css/#css-module-data */
|
128
|
+
._ActionBar_rvadt_1 {
|
129
|
+
align-items: center;
|
130
|
+
cursor: default;
|
131
|
+
display: flex;
|
132
|
+
width: auto;
|
133
|
+
padding: 4px;
|
134
|
+
padding-inline-start: 0;
|
135
|
+
padding-inline-end: 0;
|
136
|
+
border-top-left-radius: 8px;
|
137
|
+
border-top-right-radius: 8px;
|
138
|
+
border-radius: 8px;
|
139
|
+
background: var(--puck-color-grey-01);
|
140
|
+
color: var(--puck-color-white);
|
141
|
+
font-family: var(--puck-font-family);
|
142
|
+
min-height: 26px;
|
143
|
+
}
|
144
|
+
._ActionBar-label_rvadt_18 {
|
145
|
+
color: var(--puck-color-grey-08);
|
146
|
+
font-size: var(--puck-font-size-xxxs);
|
147
|
+
font-weight: 500;
|
148
|
+
padding-inline-start: 8px;
|
149
|
+
padding-inline-end: 8px;
|
150
|
+
margin-inline-start: 4px;
|
151
|
+
margin-inline-end: 4px;
|
152
|
+
text-overflow: ellipsis;
|
153
|
+
white-space: nowrap;
|
154
|
+
}
|
155
|
+
._ActionBar-action_rvadt_30 + ._ActionBar-label_rvadt_18 {
|
156
|
+
padding-inline-start: 0;
|
157
|
+
}
|
158
|
+
._ActionBar-label_rvadt_18 + ._ActionBar-action_rvadt_30 {
|
159
|
+
margin-inline-start: -4px;
|
160
|
+
}
|
161
|
+
._ActionBar-group_rvadt_38 {
|
162
|
+
align-items: center;
|
163
|
+
border-inline-start: 0.5px solid var(--puck-color-grey-05);
|
164
|
+
display: flex;
|
165
|
+
height: 100%;
|
166
|
+
padding-inline-start: 4px;
|
167
|
+
padding-inline-end: 4px;
|
168
|
+
}
|
169
|
+
._ActionBar-group_rvadt_38:first-of-type {
|
170
|
+
border-inline-start: 0;
|
171
|
+
}
|
172
|
+
._ActionBar-group_rvadt_38:empty {
|
173
|
+
display: none;
|
174
|
+
}
|
175
|
+
._ActionBar-action_rvadt_30 {
|
176
|
+
background: transparent;
|
177
|
+
border: none;
|
178
|
+
color: var(--puck-color-grey-08);
|
179
|
+
cursor: pointer;
|
180
|
+
padding: 6px 8px;
|
181
|
+
margin-inline-start: 4px;
|
182
|
+
margin-inline-end: 4px;
|
183
|
+
border-radius: 4px;
|
184
|
+
overflow: hidden;
|
185
|
+
display: flex;
|
186
|
+
align-items: center;
|
187
|
+
justify-content: center;
|
188
|
+
transition: color 50ms ease-in;
|
189
|
+
}
|
190
|
+
._ActionBar-action_rvadt_30 svg {
|
191
|
+
max-width: none !important;
|
192
|
+
}
|
193
|
+
._ActionBar-action_rvadt_30:focus-visible {
|
194
|
+
outline: 2px solid var(--puck-color-azure-05);
|
195
|
+
outline-offset: -2px;
|
196
|
+
}
|
197
|
+
@media (hover: hover) and (pointer: fine) {
|
198
|
+
._ActionBar-action_rvadt_30:hover {
|
199
|
+
color: var(--puck-color-azure-06);
|
200
|
+
transition: none;
|
201
|
+
}
|
202
|
+
}
|
203
|
+
._ActionBar-action_rvadt_30:active {
|
204
|
+
color: var(--puck-color-azure-07);
|
205
|
+
transition: none;
|
206
|
+
}
|
207
|
+
._ActionBar-group_rvadt_38 * {
|
208
|
+
margin: 0;
|
209
|
+
}
|
210
|
+
|
211
|
+
/* css-module:/home/runner/work/puck/puck/packages/core/components/DropZone/styles.module.css/#css-module-data */
|
212
|
+
._DropZone_3dmev_1 {
|
213
|
+
--resize-animation-ms: 150ms;
|
214
|
+
position: relative;
|
215
|
+
height: 100%;
|
216
|
+
min-height: var(--min-empty-height);
|
217
|
+
outline-offset: -2px;
|
218
|
+
width: 100%;
|
219
|
+
}
|
220
|
+
._DropZone--hasChildren_3dmev_11 {
|
221
|
+
min-height: 0;
|
222
|
+
}
|
223
|
+
._DropZone_3dmev_1:empty {
|
224
|
+
min-height: var(--min-empty-height);
|
225
|
+
}
|
226
|
+
._DropZone_3dmev_1:not(._DropZone--userIsDragging_3dmev_19) {
|
227
|
+
transition: min-height var(--resize-animation-ms) ease-in;
|
228
|
+
}
|
229
|
+
._DropZone--isAreaSelected_3dmev_23,
|
230
|
+
._DropZone--hoveringOverArea_3dmev_24:not(._DropZone--isRootZone_3dmev_24) {
|
231
|
+
background: color-mix(in srgb, var(--puck-color-azure-09) 30%, transparent);
|
232
|
+
outline: 2px dashed var(--puck-color-azure-08);
|
233
|
+
}
|
234
|
+
._DropZone_3dmev_1:empty {
|
235
|
+
background: color-mix(in srgb, var(--puck-color-azure-09) 30%, transparent);
|
236
|
+
outline: 2px dashed var(--puck-color-azure-08);
|
237
|
+
}
|
238
|
+
._DropZone--isDestination_3dmev_34 {
|
239
|
+
outline: 2px dashed var(--puck-color-azure-04) !important;
|
240
|
+
}
|
241
|
+
._DropZone--isDestination_3dmev_34:not(._DropZone--isRootZone_3dmev_24) {
|
242
|
+
background: color-mix(in srgb, var(--puck-color-azure-09) 30%, transparent) !important;
|
243
|
+
}
|
244
|
+
._DropZone-item_3dmev_46 {
|
245
|
+
position: relative;
|
246
|
+
}
|
247
|
+
._DropZone-hitbox_3dmev_50 {
|
248
|
+
position: absolute;
|
249
|
+
bottom: -12px;
|
250
|
+
height: 24px;
|
251
|
+
width: 100%;
|
252
|
+
z-index: 1;
|
253
|
+
}
|
254
|
+
._DropZone--isEnabled_3dmev_58._DropZone--userIsDragging_3dmev_19 {
|
255
|
+
outline: 2px dashed var(--puck-color-azure-06);
|
256
|
+
}
|
257
|
+
._DropZone_3dmev_1 > *:not([data-puck-component]) {
|
258
|
+
opacity: 0;
|
259
|
+
}
|
260
|
+
body:has(._DropZone--isAnimating_3dmev_67:empty) [data-puck-overlay] {
|
261
|
+
opacity: 0 !important;
|
262
|
+
}
|
263
|
+
|
264
|
+
/* css-module:/home/runner/work/puck/puck/packages/core/components/Drawer/styles.module.css/#css-module-data */
|
265
|
+
._Drawer_fkqfo_1 {
|
266
|
+
display: flex;
|
267
|
+
flex-direction: column;
|
268
|
+
font-family: var(--puck-font-family);
|
269
|
+
gap: 12px;
|
270
|
+
}
|
271
|
+
._Drawer-draggable_fkqfo_8 {
|
272
|
+
position: relative;
|
273
|
+
}
|
274
|
+
._Drawer-draggableBg_fkqfo_12 {
|
275
|
+
position: absolute;
|
276
|
+
top: 0;
|
277
|
+
right: 0;
|
278
|
+
bottom: 0;
|
279
|
+
left: 0;
|
280
|
+
pointer-events: none;
|
281
|
+
}
|
282
|
+
._Drawer-draggableFg_fkqfo_21 {
|
283
|
+
z-index: 1;
|
284
|
+
}
|
285
|
+
._DrawerItem-draggable_fkqfo_25 {
|
286
|
+
background: var(--puck-color-white);
|
287
|
+
cursor: grab;
|
288
|
+
padding: 12px;
|
289
|
+
display: flex;
|
290
|
+
border: 1px var(--puck-color-grey-09) solid;
|
291
|
+
border-radius: 4px;
|
292
|
+
font-size: var(--puck-font-size-xxs);
|
293
|
+
justify-content: space-between;
|
294
|
+
align-items: center;
|
295
|
+
transition: background-color 50ms ease-in, color 50ms ease-in;
|
296
|
+
}
|
297
|
+
._DrawerItem--disabled_fkqfo_38 ._DrawerItem-draggable_fkqfo_25 {
|
298
|
+
background: var(--puck-color-grey-11);
|
299
|
+
color: var(--puck-color-grey-05);
|
300
|
+
cursor: not-allowed;
|
301
|
+
}
|
302
|
+
._DrawerItem_fkqfo_25:focus-visible {
|
303
|
+
outline: 0;
|
304
|
+
}
|
305
|
+
._Drawer_fkqfo_1:not(._Drawer--isDraggingFrom_fkqfo_48) ._DrawerItem_fkqfo_25:focus-visible ._DrawerItem-draggable_fkqfo_25 {
|
306
|
+
border-radius: 4px;
|
307
|
+
outline: 2px solid var(--puck-color-azure-05);
|
308
|
+
outline-offset: 2px;
|
309
|
+
}
|
310
|
+
@media (hover: hover) and (pointer: fine) {
|
311
|
+
._Drawer_fkqfo_1:not(._Drawer--isDraggingFrom_fkqfo_48) ._DrawerItem_fkqfo_25:not(._DrawerItem--disabled_fkqfo_38) ._DrawerItem-draggable_fkqfo_25:hover {
|
312
|
+
background-color: var(--puck-color-azure-12);
|
313
|
+
color: var(--puck-color-azure-04);
|
314
|
+
transition: none;
|
315
|
+
}
|
316
|
+
}
|
317
|
+
._DrawerItem-name_fkqfo_66 {
|
318
|
+
overflow-x: hidden;
|
319
|
+
text-overflow: ellipsis;
|
320
|
+
white-space: nowrap;
|
321
|
+
}
|
322
|
+
|
323
|
+
/* css-module:/home/runner/work/puck/puck/packages/core/components/DragIcon/styles.module.css/#css-module-data */
|
324
|
+
._DragIcon_17p8x_1 {
|
325
|
+
color: var(--puck-color-grey-05);
|
326
|
+
cursor: grab;
|
327
|
+
padding: 4px;
|
328
|
+
border-radius: 4px;
|
329
|
+
}
|
330
|
+
._DragIcon--disabled_17p8x_8 {
|
331
|
+
cursor: no-drop;
|
332
|
+
}
|
333
|
+
@media (hover: hover) and (pointer: fine) {
|
334
|
+
._DragIcon_17p8x_1:not(._DragIcon--disabled_17p8x_8):hover {
|
335
|
+
color: var(--puck-color-azure-05);
|
336
|
+
background-color: var(--puck-color-azure-12);
|
337
|
+
}
|
338
|
+
}
|