@measured/puck 0.20.0-canary.3da831b0 → 0.20.0-canary.93d525c5
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/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +1 -0
- package/dist/index.mjs +1 -0
- package/dist/rsc.d.mts +2 -2
- package/dist/rsc.d.ts +2 -2
- package/dist/{walk-tree-DhtH8sAC.d.mts → walk-tree-BOSl1o0G.d.mts} +12 -25
- package/dist/{walk-tree-DhtH8sAC.d.ts → walk-tree-BOSl1o0G.d.ts} +12 -25
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
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 ItemSelector } from './walk-tree-
|
|
2
|
-
export { _ as Adaptor, Y as ArrayField, t as ArrayState, ab as AsFieldProps, B as BaseData, K as BaseField, G as ComponentDataMap, z as ComponentDataOptionalId, J as Content, a2 as CustomField, a1 as CustomFieldRender, a8 as DefaultComponentProps, a5 as DefaultRootFieldProps, a7 as DefaultRootProps, a6 as DefaultRootRenderProps, m as Direction, n as DragAxis, a0 as ExternalField, $ as ExternalFieldWithAdaptor, ad as ExtractPropsFromConfig, ae as ExtractRootPropsFromConfig, r as FieldRenderFunctions, s as ItemWithId, E as MappedItem, N as NumberField, Z as ObjectField, q as OverrideKey, u as PuckComponent, a4 as PuckContext, X as RadioField, v as RootConfig, y as RootData, x as RootDataWithoutProps, Q as SelectField, S as Slot, a3 as SlotField, T as TextField, L as TextareaField, o as Viewport, ac as WithChildren, a9 as WithId, aa as WithPuckProps, W as WithSlotProps, af as migrate, p as overrideKeys, ah as resolveAllData, ag as transformProps, w as walkTree } from './walk-tree-
|
|
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 ItemSelector } from './walk-tree-BOSl1o0G.mjs';
|
|
2
|
+
export { _ as Adaptor, Y as ArrayField, t as ArrayState, ab as AsFieldProps, B as BaseData, K as BaseField, G as ComponentDataMap, z as ComponentDataOptionalId, J as Content, a2 as CustomField, a1 as CustomFieldRender, a8 as DefaultComponentProps, a5 as DefaultRootFieldProps, a7 as DefaultRootProps, a6 as DefaultRootRenderProps, m as Direction, n as DragAxis, a0 as ExternalField, $ as ExternalFieldWithAdaptor, ad as ExtractPropsFromConfig, ae as ExtractRootPropsFromConfig, r as FieldRenderFunctions, s as ItemWithId, E as MappedItem, N as NumberField, Z as ObjectField, q as OverrideKey, u as PuckComponent, a4 as PuckContext, X as RadioField, v as RootConfig, y as RootData, x as RootDataWithoutProps, Q as SelectField, S as Slot, a3 as SlotField, T as TextField, L as TextareaField, o as Viewport, ac as WithChildren, a9 as WithId, aa as WithPuckProps, W as WithSlotProps, af as migrate, p as overrideKeys, ah as resolveAllData, ag as transformProps, w as walkTree } from './walk-tree-BOSl1o0G.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';
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
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 ItemSelector } from './walk-tree-
|
|
2
|
-
export { _ as Adaptor, Y as ArrayField, t as ArrayState, ab as AsFieldProps, B as BaseData, K as BaseField, G as ComponentDataMap, z as ComponentDataOptionalId, J as Content, a2 as CustomField, a1 as CustomFieldRender, a8 as DefaultComponentProps, a5 as DefaultRootFieldProps, a7 as DefaultRootProps, a6 as DefaultRootRenderProps, m as Direction, n as DragAxis, a0 as ExternalField, $ as ExternalFieldWithAdaptor, ad as ExtractPropsFromConfig, ae as ExtractRootPropsFromConfig, r as FieldRenderFunctions, s as ItemWithId, E as MappedItem, N as NumberField, Z as ObjectField, q as OverrideKey, u as PuckComponent, a4 as PuckContext, X as RadioField, v as RootConfig, y as RootData, x as RootDataWithoutProps, Q as SelectField, S as Slot, a3 as SlotField, T as TextField, L as TextareaField, o as Viewport, ac as WithChildren, a9 as WithId, aa as WithPuckProps, W as WithSlotProps, af as migrate, p as overrideKeys, ah as resolveAllData, ag as transformProps, w as walkTree } from './walk-tree-
|
|
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 ItemSelector } from './walk-tree-BOSl1o0G.js';
|
|
2
|
+
export { _ as Adaptor, Y as ArrayField, t as ArrayState, ab as AsFieldProps, B as BaseData, K as BaseField, G as ComponentDataMap, z as ComponentDataOptionalId, J as Content, a2 as CustomField, a1 as CustomFieldRender, a8 as DefaultComponentProps, a5 as DefaultRootFieldProps, a7 as DefaultRootProps, a6 as DefaultRootRenderProps, m as Direction, n as DragAxis, a0 as ExternalField, $ as ExternalFieldWithAdaptor, ad as ExtractPropsFromConfig, ae as ExtractRootPropsFromConfig, r as FieldRenderFunctions, s as ItemWithId, E as MappedItem, N as NumberField, Z as ObjectField, q as OverrideKey, u as PuckComponent, a4 as PuckContext, X as RadioField, v as RootConfig, y as RootData, x as RootDataWithoutProps, Q as SelectField, S as Slot, a3 as SlotField, T as TextField, L as TextareaField, o as Viewport, ac as WithChildren, a9 as WithId, aa as WithPuckProps, W as WithSlotProps, af as migrate, p as overrideKeys, ah as resolveAllData, ag as transformProps, w as walkTree } from './walk-tree-BOSl1o0G.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';
|
package/dist/index.js
CHANGED
|
@@ -6177,6 +6177,7 @@ var findDeepestCandidate = (position, manager) => {
|
|
|
6177
6177
|
});
|
|
6178
6178
|
filteredCandidates.reverse();
|
|
6179
6179
|
const primaryCandidate = filteredCandidates[0];
|
|
6180
|
+
if (!primaryCandidate) return { zone: null, area: null };
|
|
6180
6181
|
const primaryCandidateData = primaryCandidate.data;
|
|
6181
6182
|
const primaryCandidateIsComponent = "containsActiveZone" in primaryCandidateData;
|
|
6182
6183
|
const zone = getZoneId2(primaryCandidate);
|
package/dist/index.mjs
CHANGED
|
@@ -5286,6 +5286,7 @@ var findDeepestCandidate = (position, manager) => {
|
|
|
5286
5286
|
});
|
|
5287
5287
|
filteredCandidates.reverse();
|
|
5288
5288
|
const primaryCandidate = filteredCandidates[0];
|
|
5289
|
+
if (!primaryCandidate) return { zone: null, area: null };
|
|
5289
5290
|
const primaryCandidateData = primaryCandidate.data;
|
|
5290
5291
|
const primaryCandidateIsComponent = "containsActiveZone" in primaryCandidateData;
|
|
5291
5292
|
const zone = getZoneId(primaryCandidate);
|
package/dist/rsc.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import { a as Config, U as UserGenerics, M as Metadata } from './walk-tree-
|
|
3
|
-
export { af as migrate, ah as resolveAllData, ag as transformProps, w as walkTree } from './walk-tree-
|
|
2
|
+
import { a as Config, U as UserGenerics, M as Metadata } from './walk-tree-BOSl1o0G.mjs';
|
|
3
|
+
export { af as migrate, ah as resolveAllData, ag as transformProps, w as walkTree } from './walk-tree-BOSl1o0G.mjs';
|
|
4
4
|
import 'react';
|
|
5
5
|
|
|
6
6
|
declare function Render<UserConfig extends Config = Config, G extends UserGenerics<UserConfig> = UserGenerics<UserConfig>>({ config, data, metadata, }: {
|
package/dist/rsc.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import { a as Config, U as UserGenerics, M as Metadata } from './walk-tree-
|
|
3
|
-
export { af as migrate, ah as resolveAllData, ag as transformProps, w as walkTree } from './walk-tree-
|
|
2
|
+
import { a as Config, U as UserGenerics, M as Metadata } from './walk-tree-BOSl1o0G.js';
|
|
3
|
+
export { af as migrate, ah as resolveAllData, ag as transformProps, w as walkTree } from './walk-tree-BOSl1o0G.js';
|
|
4
4
|
import 'react';
|
|
5
5
|
|
|
6
6
|
declare function Render<UserConfig extends Config = Config, G extends UserGenerics<UserConfig> = UserGenerics<UserConfig>>({ config, data, metadata, }: {
|
|
@@ -49,11 +49,11 @@ type RadioField = BaseField & {
|
|
|
49
49
|
type: "radio";
|
|
50
50
|
options: FieldOptions;
|
|
51
51
|
};
|
|
52
|
-
type ArrayField<Props extends {
|
|
52
|
+
type ArrayField<Props extends any = {
|
|
53
53
|
[key: string]: any;
|
|
54
|
-
} = {
|
|
54
|
+
}> = Props extends {
|
|
55
55
|
[key: string]: any;
|
|
56
|
-
}
|
|
56
|
+
} ? BaseField & {
|
|
57
57
|
type: "array";
|
|
58
58
|
arrayFields: {
|
|
59
59
|
[SubPropName in keyof Props[0]]: Field<Props[0][SubPropName]>;
|
|
@@ -62,14 +62,12 @@ type ArrayField<Props extends {
|
|
|
62
62
|
getItemSummary?: (item: Props[0], index?: number) => string;
|
|
63
63
|
max?: number;
|
|
64
64
|
min?: number;
|
|
65
|
-
};
|
|
66
|
-
type ObjectField<Props extends {
|
|
67
|
-
[key: string]: any;
|
|
68
|
-
} = {
|
|
65
|
+
} : never;
|
|
66
|
+
type ObjectField<Props extends any = {
|
|
69
67
|
[key: string]: any;
|
|
70
68
|
}> = BaseField & {
|
|
71
69
|
type: "object";
|
|
72
|
-
objectFields:
|
|
70
|
+
objectFields: {
|
|
73
71
|
[SubPropName in keyof Props]: Field<Props[SubPropName]>;
|
|
74
72
|
};
|
|
75
73
|
};
|
|
@@ -78,20 +76,17 @@ type Adaptor<AdaptorParams = {}, TableShape extends Record<string, any> = {}, Pr
|
|
|
78
76
|
fetchList: (adaptorParams?: AdaptorParams) => Promise<TableShape[] | null>;
|
|
79
77
|
mapProp?: (value: TableShape) => PropShape;
|
|
80
78
|
};
|
|
81
|
-
type
|
|
82
|
-
|
|
83
|
-
} = {
|
|
79
|
+
type NotUndefined<T> = T extends undefined ? Record<string, any> : T;
|
|
80
|
+
type ExternalFieldWithAdaptor<Props extends any = {
|
|
84
81
|
[key: string]: any;
|
|
85
82
|
}> = BaseField & {
|
|
86
83
|
type: "external";
|
|
87
84
|
placeholder?: string;
|
|
88
85
|
adaptor: Adaptor<any, any, Props>;
|
|
89
86
|
adaptorParams?: object;
|
|
90
|
-
getItemSummary: (item: Props
|
|
87
|
+
getItemSummary: (item: NotUndefined<Props>, index?: number) => string;
|
|
91
88
|
};
|
|
92
|
-
type ExternalField<Props extends {
|
|
93
|
-
[key: string]: any;
|
|
94
|
-
} = {
|
|
89
|
+
type ExternalField<Props extends any = {
|
|
95
90
|
[key: string]: any;
|
|
96
91
|
}> = BaseField & {
|
|
97
92
|
type: "external";
|
|
@@ -102,7 +97,7 @@ type ExternalField<Props extends {
|
|
|
102
97
|
}) => Promise<any[] | null>;
|
|
103
98
|
mapProp?: (value: any) => Props;
|
|
104
99
|
mapRow?: (value: any) => Record<string, string | number | ReactElement>;
|
|
105
|
-
getItemSummary?: (item: Props
|
|
100
|
+
getItemSummary?: (item: NotUndefined<Props>, index?: number) => string;
|
|
106
101
|
showSearch?: boolean;
|
|
107
102
|
renderFooter?: (props: {
|
|
108
103
|
items: any[];
|
|
@@ -128,15 +123,7 @@ type SlotField = BaseField & {
|
|
|
128
123
|
allow?: string[];
|
|
129
124
|
disallow?: string[];
|
|
130
125
|
};
|
|
131
|
-
type Field<
|
|
132
|
-
[key: string]: any;
|
|
133
|
-
} ? Props : any> | ObjectField<Props extends {
|
|
134
|
-
[key: string]: any;
|
|
135
|
-
} ? Props : any> | ExternalField<Props extends {
|
|
136
|
-
[key: string]: any;
|
|
137
|
-
} ? Props : any> | ExternalFieldWithAdaptor<Props extends {
|
|
138
|
-
[key: string]: any;
|
|
139
|
-
} ? Props : any> | CustomField<Props> | SlotField;
|
|
126
|
+
type Field<ValueType = any> = TextField | NumberField | TextareaField | SelectField | RadioField | ArrayField<ValueType> | ObjectField<ValueType> | ExternalField<ValueType> | ExternalFieldWithAdaptor<ValueType> | CustomField<ValueType> | SlotField;
|
|
140
127
|
type Fields<ComponentProps extends DefaultComponentProps = DefaultComponentProps> = {
|
|
141
128
|
[PropName in keyof Omit<ComponentProps, "editMode">]: Field<ComponentProps[PropName]>;
|
|
142
129
|
};
|
|
@@ -49,11 +49,11 @@ type RadioField = BaseField & {
|
|
|
49
49
|
type: "radio";
|
|
50
50
|
options: FieldOptions;
|
|
51
51
|
};
|
|
52
|
-
type ArrayField<Props extends {
|
|
52
|
+
type ArrayField<Props extends any = {
|
|
53
53
|
[key: string]: any;
|
|
54
|
-
} = {
|
|
54
|
+
}> = Props extends {
|
|
55
55
|
[key: string]: any;
|
|
56
|
-
}
|
|
56
|
+
} ? BaseField & {
|
|
57
57
|
type: "array";
|
|
58
58
|
arrayFields: {
|
|
59
59
|
[SubPropName in keyof Props[0]]: Field<Props[0][SubPropName]>;
|
|
@@ -62,14 +62,12 @@ type ArrayField<Props extends {
|
|
|
62
62
|
getItemSummary?: (item: Props[0], index?: number) => string;
|
|
63
63
|
max?: number;
|
|
64
64
|
min?: number;
|
|
65
|
-
};
|
|
66
|
-
type ObjectField<Props extends {
|
|
67
|
-
[key: string]: any;
|
|
68
|
-
} = {
|
|
65
|
+
} : never;
|
|
66
|
+
type ObjectField<Props extends any = {
|
|
69
67
|
[key: string]: any;
|
|
70
68
|
}> = BaseField & {
|
|
71
69
|
type: "object";
|
|
72
|
-
objectFields:
|
|
70
|
+
objectFields: {
|
|
73
71
|
[SubPropName in keyof Props]: Field<Props[SubPropName]>;
|
|
74
72
|
};
|
|
75
73
|
};
|
|
@@ -78,20 +76,17 @@ type Adaptor<AdaptorParams = {}, TableShape extends Record<string, any> = {}, Pr
|
|
|
78
76
|
fetchList: (adaptorParams?: AdaptorParams) => Promise<TableShape[] | null>;
|
|
79
77
|
mapProp?: (value: TableShape) => PropShape;
|
|
80
78
|
};
|
|
81
|
-
type
|
|
82
|
-
|
|
83
|
-
} = {
|
|
79
|
+
type NotUndefined<T> = T extends undefined ? Record<string, any> : T;
|
|
80
|
+
type ExternalFieldWithAdaptor<Props extends any = {
|
|
84
81
|
[key: string]: any;
|
|
85
82
|
}> = BaseField & {
|
|
86
83
|
type: "external";
|
|
87
84
|
placeholder?: string;
|
|
88
85
|
adaptor: Adaptor<any, any, Props>;
|
|
89
86
|
adaptorParams?: object;
|
|
90
|
-
getItemSummary: (item: Props
|
|
87
|
+
getItemSummary: (item: NotUndefined<Props>, index?: number) => string;
|
|
91
88
|
};
|
|
92
|
-
type ExternalField<Props extends {
|
|
93
|
-
[key: string]: any;
|
|
94
|
-
} = {
|
|
89
|
+
type ExternalField<Props extends any = {
|
|
95
90
|
[key: string]: any;
|
|
96
91
|
}> = BaseField & {
|
|
97
92
|
type: "external";
|
|
@@ -102,7 +97,7 @@ type ExternalField<Props extends {
|
|
|
102
97
|
}) => Promise<any[] | null>;
|
|
103
98
|
mapProp?: (value: any) => Props;
|
|
104
99
|
mapRow?: (value: any) => Record<string, string | number | ReactElement>;
|
|
105
|
-
getItemSummary?: (item: Props
|
|
100
|
+
getItemSummary?: (item: NotUndefined<Props>, index?: number) => string;
|
|
106
101
|
showSearch?: boolean;
|
|
107
102
|
renderFooter?: (props: {
|
|
108
103
|
items: any[];
|
|
@@ -128,15 +123,7 @@ type SlotField = BaseField & {
|
|
|
128
123
|
allow?: string[];
|
|
129
124
|
disallow?: string[];
|
|
130
125
|
};
|
|
131
|
-
type Field<
|
|
132
|
-
[key: string]: any;
|
|
133
|
-
} ? Props : any> | ObjectField<Props extends {
|
|
134
|
-
[key: string]: any;
|
|
135
|
-
} ? Props : any> | ExternalField<Props extends {
|
|
136
|
-
[key: string]: any;
|
|
137
|
-
} ? Props : any> | ExternalFieldWithAdaptor<Props extends {
|
|
138
|
-
[key: string]: any;
|
|
139
|
-
} ? Props : any> | CustomField<Props> | SlotField;
|
|
126
|
+
type Field<ValueType = any> = TextField | NumberField | TextareaField | SelectField | RadioField | ArrayField<ValueType> | ObjectField<ValueType> | ExternalField<ValueType> | ExternalFieldWithAdaptor<ValueType> | CustomField<ValueType> | SlotField;
|
|
140
127
|
type Fields<ComponentProps extends DefaultComponentProps = DefaultComponentProps> = {
|
|
141
128
|
[PropName in keyof Omit<ComponentProps, "editMode">]: Field<ComponentProps[PropName]>;
|
|
142
129
|
};
|
package/package.json
CHANGED