@measured/puck 0.16.0-canary.39e7f40 → 0.16.0-canary.464aa1e
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/actions-CBAJO1CV.d.mts +425 -0
- package/dist/actions-CBAJO1CV.d.ts +425 -0
- package/dist/chunk-LM7YWFFF.mjs +114 -0
- package/dist/index.css +120 -87
- package/dist/index.d.mts +245 -0
- package/dist/index.d.ts +93 -197
- package/dist/index.js +1048 -29746
- package/dist/index.mjs +5923 -0
- package/dist/rsc.d.mts +10 -0
- package/dist/rsc.d.ts +1 -1
- package/dist/rsc.js +3 -2
- package/dist/rsc.mjs +80 -0
- package/package.json +17 -9
- package/dist/Config-041c35a2.d.ts +0 -262
@@ -0,0 +1,425 @@
|
|
1
|
+
import { CSSProperties, ReactElement, ReactNode } from 'react';
|
2
|
+
|
3
|
+
type ItemSelector = {
|
4
|
+
index: number;
|
5
|
+
zone?: string;
|
6
|
+
};
|
7
|
+
|
8
|
+
type DropZoneProps = {
|
9
|
+
zone: string;
|
10
|
+
allow?: string[];
|
11
|
+
disallow?: string[];
|
12
|
+
style?: CSSProperties;
|
13
|
+
};
|
14
|
+
|
15
|
+
type FieldOption = {
|
16
|
+
label: string;
|
17
|
+
value: string | number | boolean;
|
18
|
+
};
|
19
|
+
type FieldOptions = Array<FieldOption> | ReadonlyArray<FieldOption>;
|
20
|
+
type BaseField = {
|
21
|
+
label?: string;
|
22
|
+
};
|
23
|
+
type TextField = BaseField & {
|
24
|
+
type: "text";
|
25
|
+
};
|
26
|
+
type NumberField = BaseField & {
|
27
|
+
type: "number";
|
28
|
+
min?: number;
|
29
|
+
max?: number;
|
30
|
+
};
|
31
|
+
type TextareaField = BaseField & {
|
32
|
+
type: "textarea";
|
33
|
+
};
|
34
|
+
type SelectField = BaseField & {
|
35
|
+
type: "select";
|
36
|
+
options: FieldOptions;
|
37
|
+
};
|
38
|
+
type RadioField = BaseField & {
|
39
|
+
type: "radio";
|
40
|
+
options: FieldOptions;
|
41
|
+
};
|
42
|
+
type ArrayField<Props extends {
|
43
|
+
[key: string]: any;
|
44
|
+
} = {
|
45
|
+
[key: string]: any;
|
46
|
+
}> = BaseField & {
|
47
|
+
type: "array";
|
48
|
+
arrayFields: {
|
49
|
+
[SubPropName in keyof Props[0]]: Field<Props[0][SubPropName]>;
|
50
|
+
};
|
51
|
+
defaultItemProps?: Props[0];
|
52
|
+
getItemSummary?: (item: Props[0], index?: number) => string;
|
53
|
+
max?: number;
|
54
|
+
min?: number;
|
55
|
+
};
|
56
|
+
type ObjectField<Props extends {
|
57
|
+
[key: string]: any;
|
58
|
+
} = {
|
59
|
+
[key: string]: any;
|
60
|
+
}> = BaseField & {
|
61
|
+
type: "object";
|
62
|
+
objectFields: Props extends any[] ? never : {
|
63
|
+
[SubPropName in keyof Props]: Field<Props[SubPropName]>;
|
64
|
+
};
|
65
|
+
};
|
66
|
+
type Adaptor<AdaptorParams = {}, TableShape extends Record<string, any> = {}, PropShape = TableShape> = {
|
67
|
+
name: string;
|
68
|
+
fetchList: (adaptorParams?: AdaptorParams) => Promise<TableShape[] | null>;
|
69
|
+
mapProp?: (value: TableShape) => PropShape;
|
70
|
+
};
|
71
|
+
type ExternalFieldWithAdaptor<Props extends {
|
72
|
+
[key: string]: any;
|
73
|
+
} = {
|
74
|
+
[key: string]: any;
|
75
|
+
}> = BaseField & {
|
76
|
+
type: "external";
|
77
|
+
placeholder?: string;
|
78
|
+
adaptor: Adaptor<any, any, Props>;
|
79
|
+
adaptorParams?: object;
|
80
|
+
getItemSummary: (item: Props, index?: number) => string;
|
81
|
+
};
|
82
|
+
type ExternalField<Props extends {
|
83
|
+
[key: string]: any;
|
84
|
+
} = {
|
85
|
+
[key: string]: any;
|
86
|
+
}> = BaseField & {
|
87
|
+
type: "external";
|
88
|
+
placeholder?: string;
|
89
|
+
fetchList: (params: {
|
90
|
+
query: string;
|
91
|
+
filters: Record<string, any>;
|
92
|
+
}) => Promise<any[] | null>;
|
93
|
+
mapProp?: (value: any) => Props;
|
94
|
+
mapRow?: (value: any) => Record<string, string | number>;
|
95
|
+
getItemSummary?: (item: Props, index?: number) => string;
|
96
|
+
showSearch?: boolean;
|
97
|
+
initialQuery?: string;
|
98
|
+
filterFields?: Record<string, Field>;
|
99
|
+
initialFilters?: Record<string, any>;
|
100
|
+
};
|
101
|
+
type CustomField<Props extends any = {}> = BaseField & {
|
102
|
+
type: "custom";
|
103
|
+
render: (props: {
|
104
|
+
field: CustomField<Props>;
|
105
|
+
name: string;
|
106
|
+
id: string;
|
107
|
+
value: Props;
|
108
|
+
onChange: (value: Props) => void;
|
109
|
+
readOnly?: boolean;
|
110
|
+
}) => ReactElement;
|
111
|
+
};
|
112
|
+
type Field<Props extends any = any> = TextField | NumberField | TextareaField | SelectField | RadioField | ArrayField<Props extends {
|
113
|
+
[key: string]: any;
|
114
|
+
} ? Props : any> | ObjectField<Props extends {
|
115
|
+
[key: string]: any;
|
116
|
+
} ? Props : any> | ExternalField<Props extends {
|
117
|
+
[key: string]: any;
|
118
|
+
} ? Props : any> | ExternalFieldWithAdaptor<Props extends {
|
119
|
+
[key: string]: any;
|
120
|
+
} ? Props : any> | CustomField<Props>;
|
121
|
+
type Fields<ComponentProps extends DefaultComponentProps = DefaultComponentProps> = {
|
122
|
+
[PropName in keyof Omit<ComponentProps, "editMode">]: Field<ComponentProps[PropName]>;
|
123
|
+
};
|
124
|
+
type FieldProps<ValueType = any, F = Field<any>> = {
|
125
|
+
field: F;
|
126
|
+
value: ValueType;
|
127
|
+
id?: string;
|
128
|
+
onChange: (value: ValueType, uiState?: Partial<UiState>) => void;
|
129
|
+
readOnly?: boolean;
|
130
|
+
};
|
131
|
+
|
132
|
+
type PuckComponent<Props> = (props: WithId<WithPuckProps<Props>>) => JSX.Element;
|
133
|
+
type ComponentConfig<RenderProps extends DefaultComponentProps = DefaultComponentProps, FieldProps extends DefaultComponentProps = RenderProps, DataShape = Omit<ComponentData<FieldProps>, "type">> = {
|
134
|
+
render: PuckComponent<RenderProps>;
|
135
|
+
label?: string;
|
136
|
+
defaultProps?: FieldProps;
|
137
|
+
fields?: Fields<FieldProps>;
|
138
|
+
permissions?: Partial<Permissions>;
|
139
|
+
resolveFields?: (data: DataShape, params: {
|
140
|
+
changed: Partial<Record<keyof FieldProps, boolean>>;
|
141
|
+
fields: Fields<FieldProps>;
|
142
|
+
lastFields: Fields<FieldProps>;
|
143
|
+
lastData: DataShape;
|
144
|
+
appState: AppState;
|
145
|
+
}) => Promise<Fields<FieldProps>> | Fields<FieldProps>;
|
146
|
+
resolveData?: (data: DataShape, params: {
|
147
|
+
changed: Partial<Record<keyof FieldProps, boolean>>;
|
148
|
+
lastData: DataShape;
|
149
|
+
}) => Promise<{
|
150
|
+
props?: Partial<FieldProps>;
|
151
|
+
readOnly?: Partial<Record<keyof FieldProps, boolean>>;
|
152
|
+
}> | {
|
153
|
+
props?: Partial<FieldProps>;
|
154
|
+
readOnly?: Partial<Record<keyof FieldProps, boolean>>;
|
155
|
+
};
|
156
|
+
resolvePermissions?: (data: DataShape, params: {
|
157
|
+
changed: Partial<Record<keyof FieldProps, boolean>>;
|
158
|
+
lastPermissions: Partial<Permissions> | undefined;
|
159
|
+
initialPermissions: Partial<Permissions>;
|
160
|
+
appState: AppState;
|
161
|
+
}) => Partial<Permissions>;
|
162
|
+
};
|
163
|
+
type Category<ComponentName> = {
|
164
|
+
components?: ComponentName[];
|
165
|
+
title?: string;
|
166
|
+
visible?: boolean;
|
167
|
+
defaultExpanded?: boolean;
|
168
|
+
};
|
169
|
+
type Config<Props extends DefaultComponentProps = DefaultComponentProps, RootProps extends DefaultComponentProps = any, CategoryName extends string = string> = {
|
170
|
+
categories?: Record<CategoryName, Category<keyof Props>> & {
|
171
|
+
other?: Category<keyof Props>;
|
172
|
+
};
|
173
|
+
components: {
|
174
|
+
[ComponentName in keyof Props]: Omit<ComponentConfig<Props[ComponentName], Props[ComponentName]>, "type">;
|
175
|
+
};
|
176
|
+
root?: Partial<ComponentConfig<DefaultRootRenderProps<RootProps>, AsFieldProps<RootProps>, RootData>>;
|
177
|
+
};
|
178
|
+
|
179
|
+
type WithId<Props> = Props & {
|
180
|
+
id: string;
|
181
|
+
};
|
182
|
+
type WithPuckProps<Props> = Props & {
|
183
|
+
puck: PuckContext;
|
184
|
+
editMode?: boolean;
|
185
|
+
};
|
186
|
+
type AsFieldProps<Props> = Omit<Props, "children" | "puck" | "editMode">;
|
187
|
+
type WithChildren<Props> = Props & {
|
188
|
+
children: ReactNode;
|
189
|
+
};
|
190
|
+
type ExtractPropsFromConfig<UserConfig> = UserConfig extends Config<infer P, any, any> ? P : never;
|
191
|
+
type ExtractRootPropsFromConfig<UserConfig> = UserConfig extends Config<any, infer P, any> ? P : never;
|
192
|
+
|
193
|
+
type PuckContext = {
|
194
|
+
renderDropZone: React.FC<DropZoneProps>;
|
195
|
+
isEditing: boolean;
|
196
|
+
};
|
197
|
+
type DefaultRootFieldProps = {
|
198
|
+
title?: string;
|
199
|
+
};
|
200
|
+
type DefaultRootRenderProps<Props extends DefaultComponentProps = DefaultRootFieldProps> = WithPuckProps<WithChildren<Props>>;
|
201
|
+
type DefaultRootProps = DefaultRootRenderProps;
|
202
|
+
type DefaultComponentProps = {
|
203
|
+
[key: string]: any;
|
204
|
+
};
|
205
|
+
|
206
|
+
type BaseData<Props extends {
|
207
|
+
[key: string]: any;
|
208
|
+
} = {
|
209
|
+
[key: string]: any;
|
210
|
+
}> = {
|
211
|
+
readOnly?: Partial<Record<keyof Props, boolean>>;
|
212
|
+
};
|
213
|
+
type RootDataWithProps<Props extends DefaultComponentProps = DefaultRootFieldProps> = BaseData<Props> & {
|
214
|
+
props: Props;
|
215
|
+
};
|
216
|
+
type RootDataWithoutProps<Props extends DefaultComponentProps = DefaultRootFieldProps> = Props;
|
217
|
+
type RootData<Props extends DefaultComponentProps = DefaultRootFieldProps> = Partial<RootDataWithProps<AsFieldProps<Props>>> & Partial<RootDataWithoutProps<Props>>;
|
218
|
+
type ComponentData<Props extends DefaultComponentProps = DefaultComponentProps, Name = string> = {
|
219
|
+
type: Name;
|
220
|
+
props: WithId<Props>;
|
221
|
+
} & BaseData<Props>;
|
222
|
+
type MappedItem = ComponentData;
|
223
|
+
type ComponentDataMap<Props extends Record<string, DefaultComponentProps> = DefaultComponentProps> = {
|
224
|
+
[K in keyof Props]: ComponentData<Props[K], K extends string ? K : never>;
|
225
|
+
}[keyof Props];
|
226
|
+
type Content<PropsMap extends {
|
227
|
+
[key: string]: any;
|
228
|
+
} = {
|
229
|
+
[key: string]: any;
|
230
|
+
}> = ComponentDataMap<PropsMap>[];
|
231
|
+
type Data<Props extends DefaultComponentProps = DefaultComponentProps, RootProps extends DefaultComponentProps = DefaultRootFieldProps> = {
|
232
|
+
root: RootData<RootProps>;
|
233
|
+
content: Content<Props>;
|
234
|
+
zones?: Record<string, Content<Props>>;
|
235
|
+
};
|
236
|
+
|
237
|
+
type ItemWithId = {
|
238
|
+
_arrayId: string;
|
239
|
+
_originalIndex: number;
|
240
|
+
};
|
241
|
+
type ArrayState = {
|
242
|
+
items: ItemWithId[];
|
243
|
+
openId: string;
|
244
|
+
};
|
245
|
+
type UiState = {
|
246
|
+
leftSideBarVisible: boolean;
|
247
|
+
rightSideBarVisible: boolean;
|
248
|
+
itemSelector: ItemSelector | null;
|
249
|
+
arrayState: Record<string, ArrayState | undefined>;
|
250
|
+
componentList: Record<string, {
|
251
|
+
components?: string[];
|
252
|
+
title?: string;
|
253
|
+
visible?: boolean;
|
254
|
+
expanded?: boolean;
|
255
|
+
}>;
|
256
|
+
isDragging: boolean;
|
257
|
+
viewports: {
|
258
|
+
current: {
|
259
|
+
width: number;
|
260
|
+
height: number | "auto";
|
261
|
+
};
|
262
|
+
controlsVisible: boolean;
|
263
|
+
options: Viewport[];
|
264
|
+
};
|
265
|
+
};
|
266
|
+
type AppState<UserData extends Data = Data> = {
|
267
|
+
data: UserData;
|
268
|
+
ui: UiState;
|
269
|
+
};
|
270
|
+
|
271
|
+
type RenderFunc<Props extends {
|
272
|
+
[key: string]: any;
|
273
|
+
} = {
|
274
|
+
children: ReactNode;
|
275
|
+
}> = (props: Props) => ReactElement;
|
276
|
+
declare const overrideKeys: readonly ["header", "headerActions", "fields", "fieldLabel", "components", "componentItem", "outline", "puck", "preview"];
|
277
|
+
type OverrideKey = (typeof overrideKeys)[number];
|
278
|
+
type OverridesGeneric<Shape extends {
|
279
|
+
[key in OverrideKey]: any;
|
280
|
+
}> = Shape;
|
281
|
+
type Overrides = OverridesGeneric<{
|
282
|
+
fieldTypes: Partial<FieldRenderFunctions>;
|
283
|
+
header: RenderFunc<{
|
284
|
+
actions: ReactNode;
|
285
|
+
children: ReactNode;
|
286
|
+
}>;
|
287
|
+
actionBar: RenderFunc<{
|
288
|
+
label?: string;
|
289
|
+
children: ReactNode;
|
290
|
+
}>;
|
291
|
+
headerActions: RenderFunc<{
|
292
|
+
children: ReactNode;
|
293
|
+
}>;
|
294
|
+
preview: RenderFunc;
|
295
|
+
fields: RenderFunc<{
|
296
|
+
children: ReactNode;
|
297
|
+
isLoading: boolean;
|
298
|
+
itemSelector?: ItemSelector | null;
|
299
|
+
}>;
|
300
|
+
fieldLabel: RenderFunc<{
|
301
|
+
children?: ReactNode;
|
302
|
+
icon?: ReactNode;
|
303
|
+
label: string;
|
304
|
+
el?: "label" | "div";
|
305
|
+
readOnly?: boolean;
|
306
|
+
className?: string;
|
307
|
+
}>;
|
308
|
+
components: RenderFunc;
|
309
|
+
componentItem: RenderFunc<{
|
310
|
+
children: ReactNode;
|
311
|
+
name: string;
|
312
|
+
}>;
|
313
|
+
iframe: RenderFunc<{
|
314
|
+
children: ReactNode;
|
315
|
+
document?: Document;
|
316
|
+
}>;
|
317
|
+
outline: RenderFunc;
|
318
|
+
puck: RenderFunc;
|
319
|
+
}>;
|
320
|
+
type FieldRenderFunctions = Omit<{
|
321
|
+
[Type in Field["type"]]: React.FunctionComponent<FieldProps<Extract<Field, {
|
322
|
+
type: Type;
|
323
|
+
}>> & {
|
324
|
+
children: ReactNode;
|
325
|
+
name: string;
|
326
|
+
}>;
|
327
|
+
}, "custom"> & {
|
328
|
+
[key: string]: React.FunctionComponent<FieldProps<any> & {
|
329
|
+
children: ReactNode;
|
330
|
+
name: string;
|
331
|
+
}>;
|
332
|
+
};
|
333
|
+
|
334
|
+
type iconTypes = "Smartphone" | "Monitor" | "Tablet";
|
335
|
+
type Viewport = {
|
336
|
+
width: number;
|
337
|
+
height?: number | "auto";
|
338
|
+
label?: string;
|
339
|
+
icon?: iconTypes | ReactNode;
|
340
|
+
};
|
341
|
+
type Viewports = Viewport[];
|
342
|
+
|
343
|
+
type Permissions = {
|
344
|
+
drag: boolean;
|
345
|
+
duplicate: boolean;
|
346
|
+
delete: boolean;
|
347
|
+
edit: boolean;
|
348
|
+
insert: boolean;
|
349
|
+
} & Record<string, boolean>;
|
350
|
+
type IframeConfig = {
|
351
|
+
enabled?: boolean;
|
352
|
+
};
|
353
|
+
type OnAction<UserData extends Data = Data> = (action: PuckAction, appState: AppState<UserData>, prevAppState: AppState<UserData>) => void;
|
354
|
+
type Plugin = {
|
355
|
+
overrides: Partial<Overrides>;
|
356
|
+
};
|
357
|
+
type History<D = any> = {
|
358
|
+
data: D;
|
359
|
+
};
|
360
|
+
type InitialHistory<AS = AppState> = {
|
361
|
+
histories: History<AS>[];
|
362
|
+
index: number;
|
363
|
+
};
|
364
|
+
|
365
|
+
type InsertAction = {
|
366
|
+
type: "insert";
|
367
|
+
componentType: string;
|
368
|
+
destinationIndex: number;
|
369
|
+
destinationZone: string;
|
370
|
+
id?: string;
|
371
|
+
};
|
372
|
+
type DuplicateAction = {
|
373
|
+
type: "duplicate";
|
374
|
+
sourceIndex: number;
|
375
|
+
sourceZone: string;
|
376
|
+
};
|
377
|
+
type ReplaceAction = {
|
378
|
+
type: "replace";
|
379
|
+
destinationIndex: number;
|
380
|
+
destinationZone: string;
|
381
|
+
data: any;
|
382
|
+
};
|
383
|
+
type ReorderAction = {
|
384
|
+
type: "reorder";
|
385
|
+
sourceIndex: number;
|
386
|
+
destinationIndex: number;
|
387
|
+
destinationZone: string;
|
388
|
+
};
|
389
|
+
type MoveAction = {
|
390
|
+
type: "move";
|
391
|
+
sourceIndex: number;
|
392
|
+
sourceZone: string;
|
393
|
+
destinationIndex: number;
|
394
|
+
destinationZone: string;
|
395
|
+
};
|
396
|
+
type RemoveAction = {
|
397
|
+
type: "remove";
|
398
|
+
index: number;
|
399
|
+
zone: string;
|
400
|
+
};
|
401
|
+
type SetUiAction = {
|
402
|
+
type: "setUi";
|
403
|
+
ui: Partial<UiState> | ((previous: UiState) => Partial<UiState>);
|
404
|
+
};
|
405
|
+
type SetDataAction = {
|
406
|
+
type: "setData";
|
407
|
+
data: Partial<Data> | ((previous: Data) => Partial<Data>);
|
408
|
+
};
|
409
|
+
type SetAction<UserData extends Data = Data> = {
|
410
|
+
type: "set";
|
411
|
+
state: Partial<AppState<UserData>> | ((previous: AppState<UserData>) => Partial<AppState<UserData>>);
|
412
|
+
};
|
413
|
+
type RegisterZoneAction = {
|
414
|
+
type: "registerZone";
|
415
|
+
zone: string;
|
416
|
+
};
|
417
|
+
type UnregisterZoneAction = {
|
418
|
+
type: "unregisterZone";
|
419
|
+
zone: string;
|
420
|
+
};
|
421
|
+
type PuckAction = {
|
422
|
+
recordHistory?: boolean;
|
423
|
+
} & (ReorderAction | InsertAction | MoveAction | ReplaceAction | RemoveAction | DuplicateAction | SetAction | SetDataAction | SetUiAction | RegisterZoneAction | UnregisterZoneAction);
|
424
|
+
|
425
|
+
export { type WithId as $, type AppState as A, type BaseData as B, type Config as C, type Data as D, type ExtractPropsFromConfig as E, type Field as F, type ArrayField as G, type History as H, type ItemSelector as I, type ObjectField as J, type Adaptor as K, type ExternalFieldWithAdaptor as L, type MappedItem as M, type NumberField as N, type OnAction as O, type PuckAction as P, type ExternalField as Q, type RootDataWithProps as R, type SelectField as S, type TextField as T, type UiState as U, type Viewports as V, type CustomField as W, type Fields as X, type PuckContext as Y, type DefaultRootRenderProps as Z, type DefaultRootProps as _, type FieldProps as a, type WithPuckProps as a0, type AsFieldProps as a1, type WithChildren as a2, type DropZoneProps as b, type ExtractRootPropsFromConfig as c, type Permissions as d, type Plugin as e, type Overrides as f, type IframeConfig as g, type InitialHistory as h, type DefaultComponentProps as i, type DefaultRootFieldProps as j, type ComponentData as k, type Viewport as l, type OverrideKey as m, type FieldRenderFunctions as n, overrideKeys as o, type ItemWithId as p, type ArrayState as q, type PuckComponent as r, type ComponentConfig as s, type RootDataWithoutProps as t, type RootData as u, type ComponentDataMap as v, type Content as w, type BaseField as x, type TextareaField as y, type RadioField as z };
|
@@ -0,0 +1,114 @@
|
|
1
|
+
var __create = Object.create;
|
2
|
+
var __defProp = Object.defineProperty;
|
3
|
+
var __defProps = Object.defineProperties;
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
5
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
6
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
7
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
8
|
+
var __getProtoOf = Object.getPrototypeOf;
|
9
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
10
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
11
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
12
|
+
var __spreadValues = (a, b) => {
|
13
|
+
for (var prop in b || (b = {}))
|
14
|
+
if (__hasOwnProp.call(b, prop))
|
15
|
+
__defNormalProp(a, prop, b[prop]);
|
16
|
+
if (__getOwnPropSymbols)
|
17
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
18
|
+
if (__propIsEnum.call(b, prop))
|
19
|
+
__defNormalProp(a, prop, b[prop]);
|
20
|
+
}
|
21
|
+
return a;
|
22
|
+
};
|
23
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
24
|
+
var __objRest = (source, exclude) => {
|
25
|
+
var target = {};
|
26
|
+
for (var prop in source)
|
27
|
+
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
28
|
+
target[prop] = source[prop];
|
29
|
+
if (source != null && __getOwnPropSymbols)
|
30
|
+
for (var prop of __getOwnPropSymbols(source)) {
|
31
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
32
|
+
target[prop] = source[prop];
|
33
|
+
}
|
34
|
+
return target;
|
35
|
+
};
|
36
|
+
var __esm = (fn, res) => function __init() {
|
37
|
+
return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
|
38
|
+
};
|
39
|
+
var __commonJS = (cb, mod) => function __require() {
|
40
|
+
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
41
|
+
};
|
42
|
+
var __copyProps = (to, from, except, desc) => {
|
43
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
44
|
+
for (let key of __getOwnPropNames(from))
|
45
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
46
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
47
|
+
}
|
48
|
+
return to;
|
49
|
+
};
|
50
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
51
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
52
|
+
// file that has been converted to a CommonJS file using a Babel-
|
53
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
54
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
55
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
56
|
+
mod
|
57
|
+
));
|
58
|
+
var __async = (__this, __arguments, generator) => {
|
59
|
+
return new Promise((resolve, reject) => {
|
60
|
+
var fulfilled = (value) => {
|
61
|
+
try {
|
62
|
+
step(generator.next(value));
|
63
|
+
} catch (e) {
|
64
|
+
reject(e);
|
65
|
+
}
|
66
|
+
};
|
67
|
+
var rejected = (value) => {
|
68
|
+
try {
|
69
|
+
step(generator.throw(value));
|
70
|
+
} catch (e) {
|
71
|
+
reject(e);
|
72
|
+
}
|
73
|
+
};
|
74
|
+
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
75
|
+
step((generator = generator.apply(__this, __arguments)).next());
|
76
|
+
});
|
77
|
+
};
|
78
|
+
|
79
|
+
// ../tsup-config/react-import.js
|
80
|
+
import React from "react";
|
81
|
+
var init_react_import = __esm({
|
82
|
+
"../tsup-config/react-import.js"() {
|
83
|
+
"use strict";
|
84
|
+
}
|
85
|
+
});
|
86
|
+
|
87
|
+
// lib/root-droppable-id.ts
|
88
|
+
init_react_import();
|
89
|
+
var rootDroppableId = "default-zone";
|
90
|
+
|
91
|
+
// lib/setup-zone.ts
|
92
|
+
init_react_import();
|
93
|
+
var setupZone = (data, zoneKey) => {
|
94
|
+
if (zoneKey === rootDroppableId) {
|
95
|
+
return data;
|
96
|
+
}
|
97
|
+
const newData = __spreadProps(__spreadValues({}, data), {
|
98
|
+
zones: data.zones || {}
|
99
|
+
});
|
100
|
+
newData.zones[zoneKey] = newData.zones[zoneKey] || [];
|
101
|
+
return newData;
|
102
|
+
};
|
103
|
+
|
104
|
+
export {
|
105
|
+
__spreadValues,
|
106
|
+
__spreadProps,
|
107
|
+
__objRest,
|
108
|
+
__commonJS,
|
109
|
+
__toESM,
|
110
|
+
__async,
|
111
|
+
init_react_import,
|
112
|
+
rootDroppableId,
|
113
|
+
setupZone
|
114
|
+
};
|