@puckeditor/plugin-emotion-cache 0.23.0-canary.fb9392de → 0.24.0-canary.03e660bb

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) The Puck Contributors.
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/dist/index.d.mts CHANGED
@@ -1,4 +1,4 @@
1
- import { ReactElement, CSSProperties, ReactNode, ElementType, Ref, JSX } from 'react';
1
+ import { ElementType, CSSProperties, Ref, ComponentPropsWithoutRef, ReactElement, ReactNode, JSX } from 'react';
2
2
  import { EditorStateSnapshot, Editor, Extensions } from '@tiptap/react';
3
3
  import { BlockquoteOptions } from '@tiptap/extension-blockquote';
4
4
  import { BoldOptions } from '@tiptap/extension-bold';
@@ -20,6 +20,62 @@ type ItemSelector = {
20
20
  zone?: string;
21
21
  };
22
22
 
23
+ /**
24
+ * Props consumed by Puck internally that are shared between DropZones and slots.
25
+ */
26
+ type DropZoneSharedProps<ComponentType extends ElementType = "div"> = {
27
+ allow?: string[];
28
+ disallow?: string[];
29
+ style?: CSSProperties;
30
+ minEmptyHeight?: CSSProperties["minHeight"] | number;
31
+ className?: string;
32
+ collisionAxis?: DragAxis;
33
+ ref?: Ref<any>;
34
+ as?: ComponentType;
35
+ };
36
+ /**
37
+ * All props consumed by Puck for a DropZone component. `zone` lives here only.
38
+ *
39
+ * On slots `zone` is injected internally, so slots use {@link SlotProps} instead.
40
+ */
41
+ type DropZoneOwnProps<ComponentType extends ElementType = "div"> = DropZoneSharedProps<ComponentType> & {
42
+ zone: string;
43
+ };
44
+ /**
45
+ * Unsupported additional props that are never forwarded to `as`.
46
+ *
47
+ * Omitted from the public types AND stripped at runtime.
48
+ */
49
+ type NonForwardableProps = {
50
+ children?: unknown;
51
+ dangerouslySetInnerHTML?: unknown;
52
+ };
53
+ /**
54
+ * Keys internally consumed by Puck and never forwarded to `as`.
55
+ */
56
+ type ConsumedPropKey = keyof DropZoneOwnProps | "as" | "content" | "config" | "metadata" | "fieldTransforms";
57
+ /**
58
+ * Additional props forwarded to the element or component provided via `as`,
59
+ * typed against it.
60
+ *
61
+ * Puck-internal/unsupported props are stripped so they don't leak onto the DOM.
62
+ */
63
+ type ForwardedProps<ComponentType extends ElementType> = Omit<ComponentPropsWithoutRef<ComponentType>, ConsumedPropKey | keyof NonForwardableProps>;
64
+ /**
65
+ * Props for a `DropZone` component.
66
+ *
67
+ * Any additional props not consumed by Puck are forwarded to the element or
68
+ * component provided via `as` (defaulting to a `div`), typed against it.
69
+ */
70
+ type DropZoneProps<ComponentType extends ElementType = "div"> = DropZoneOwnProps<ComponentType> & ForwardedProps<ComponentType>;
71
+ /**
72
+ * Props for a `slot` render component.
73
+ *
74
+ * Any additional props not consumed by Puck are forwarded to the element or
75
+ * component provided via `as` (defaulting to a `div`), typed against it.
76
+ */
77
+ type SlotProps<ComponentType extends ElementType = "div"> = DropZoneSharedProps<ComponentType> & ForwardedProps<ComponentType>;
78
+
23
79
  declare const defaultEditorState: (ctx: EditorStateSnapshot, readOnly: boolean) => {
24
80
  isAlignLeft?: undefined;
25
81
  canAlignLeft?: undefined;
@@ -216,6 +272,10 @@ interface RadioField extends BaseField {
216
272
  type: "radio";
217
273
  options: FieldOptions;
218
274
  }
275
+ interface CheckboxField extends BaseField {
276
+ type: "checkbox";
277
+ options: FieldOptions;
278
+ }
219
279
  interface RichtextField<UserSelector extends RichTextSelector = RichTextSelector> extends BaseField {
220
280
  type: "richtext";
221
281
  contentEditable?: boolean;
@@ -258,6 +318,7 @@ interface ObjectField<Props extends any = {
258
318
  [key: string]: any;
259
319
  }, UserField extends {} = {}> extends BaseField {
260
320
  type: "object";
321
+ expandable?: boolean;
261
322
  objectFields: {
262
323
  [SubPropName in keyof Props]: UserField extends {
263
324
  type: PropertyKey;
@@ -322,7 +383,7 @@ interface SlotField extends BaseField {
322
383
  allow?: string[];
323
384
  disallow?: string[];
324
385
  }
325
- type Field<ValueType = any, UserField extends {} = {}> = TextField | RichtextField | NumberField | TextareaField | SelectField | RadioField | ArrayField<ValueType extends {
386
+ type Field<ValueType = any, UserField extends {} = {}> = TextField | RichtextField | NumberField | TextareaField | SelectField | RadioField | CheckboxField | ArrayField<ValueType extends {
326
387
  [key: string]: any;
327
388
  }[] ? ValueType : never, UserField> | ObjectField<ValueType, UserField> | ExternalField<ValueType> | ExternalFieldWithAdaptor<ValueType> | CustomField<ValueType> | SlotField;
328
389
  type Fields<ComponentProps extends DefaultComponentProps = DefaultComponentProps, UserField extends {} = {}> = {
@@ -338,20 +399,11 @@ type FieldProps<F = Field<any>, ValueType = any> = {
338
399
  readOnly?: boolean;
339
400
  };
340
401
 
341
- type DropZoneProps = {
342
- zone: string;
343
- allow?: string[];
344
- disallow?: string[];
345
- style?: CSSProperties;
346
- minEmptyHeight?: CSSProperties["minHeight"] | number;
347
- className?: string;
348
- collisionAxis?: DragAxis;
349
- as?: ElementType;
350
- ref?: Ref<any>;
351
- };
352
-
353
402
  type PuckContext = {
354
- renderDropZone: (props: DropZoneProps) => React.ReactNode;
403
+ /**
404
+ * @deprecated Use {@link https://puckeditor.com/docs/api-reference/fields/slot Slots} instead.
405
+ */
406
+ renderDropZone: <ComponentType extends ElementType = "div">(props: DropZoneProps<ComponentType>) => React.ReactNode;
355
407
  metadata: Metadata;
356
408
  isEditing: boolean;
357
409
  dragRef: ((element: Element | null) => void) | null;
@@ -359,6 +411,12 @@ type PuckContext = {
359
411
  type DefaultRootFieldProps = {
360
412
  title?: string;
361
413
  };
414
+ /**
415
+ * Merge the default root field props into user-provided root props, letting
416
+ * the user's props take precedence. Using a plain intersection would turn an
417
+ * overridden `title` (e.g. `number`) into `never` (`number & string`).
418
+ */
419
+ type WithDefaultRootFieldProps<RootProps> = RootProps & Omit<DefaultRootFieldProps, keyof RootProps>;
362
420
  type DefaultComponentProps = {
363
421
  [key: string]: any;
364
422
  };
@@ -378,7 +436,7 @@ type UserGenerics<UserConfig extends Config = Config, UserParams extends Extract
378
436
  UserConfig: UserConfig;
379
437
  UserParams: UserParams;
380
438
  UserProps: UserParams["props"];
381
- UserRootProps: UserParams["rootProps"] & DefaultRootFieldProps;
439
+ UserRootProps: WithDefaultRootFieldProps<UserParams["rootProps"]>;
382
440
  UserData: UserData;
383
441
  UserAppState: UserAppState;
384
442
  UserPublicAppState: UserPublicAppState;
@@ -391,7 +449,7 @@ type ExtractField<UserField extends {
391
449
  type: T;
392
450
  }>;
393
451
 
394
- type SlotComponent = (props?: Omit<DropZoneProps, "zone">) => ReactNode;
452
+ type SlotComponent = <ComponentType extends ElementType = "div">(props?: SlotProps<ComponentType>) => ReactNode;
395
453
  type PuckComponent<Props> = (props: WithId<WithPuckProps<{
396
454
  [K in keyof Props]: WithDeepSlots<Props[K], SlotComponent>;
397
455
  }>>) => JSX.Element;
@@ -407,6 +465,9 @@ UserField extends BaseField = {}> = {
407
465
  label?: string;
408
466
  defaultProps?: FieldProps;
409
467
  fields?: Fields<FieldProps, UserField>;
468
+ renderFields?: RenderFunc<{
469
+ fields: Partial<Record<keyof FieldProps, ReactNode>>;
470
+ }>;
410
471
  permissions?: Partial<Permissions>;
411
472
  inline?: boolean;
412
473
  resolveFields?: (data: DataShape, params: {
@@ -462,7 +523,7 @@ type DefaultComponents = Record<string, any>;
462
523
  type Config<PropsOrParams extends LeftOrExactRight<PropsOrParams, DefaultComponents, ConfigParams> = DefaultComponents | ConfigParams, RootProps extends DefaultComponentProps = any, CategoryName extends string = string> = PropsOrParams extends ConfigParams<infer ParamComponents, infer ParamRoot, infer ParamCategoryName, never> ? ConfigInternal<ParamComponents, ParamRoot, ParamCategoryName[number]> : PropsOrParams extends ConfigParams<infer ParamComponents, infer ParamRoot, infer ParamCategoryName, infer ParamFields> ? ConfigInternal<ParamComponents, ParamRoot, ParamCategoryName[number], ParamFields[keyof ParamFields] & BaseField> : PropsOrParams extends ConfigParams<infer ParamComponents, infer ParamRoot, infer ParamCategoryName, any> ? ConfigInternal<ParamComponents, ParamRoot, ParamCategoryName[number], {}> : ConfigInternal<PropsOrParams, RootProps, CategoryName>;
463
524
  type ExtractConfigParams<UserConfig extends ConfigInternal> = UserConfig extends ConfigInternal<infer PropsOrParams, infer RootProps, infer CategoryName, infer UserField> ? {
464
525
  props: PropsOrParams;
465
- rootProps: RootProps & DefaultRootFieldProps;
526
+ rootProps: WithDefaultRootFieldProps<RootProps>;
466
527
  categoryNames: CategoryName;
467
528
  field: UserField extends {
468
529
  type: string;
@@ -545,6 +606,8 @@ type UiState = {
545
606
  expanded?: boolean;
546
607
  }>;
547
608
  isDragging: boolean;
609
+ /** Outline items whose children are shown, keyed by item id */
610
+ itemExpanded?: Record<string, boolean>;
548
611
  viewports: {
549
612
  current: {
550
613
  width: number | "100%";
@@ -553,6 +616,7 @@ type UiState = {
553
616
  controlsVisible: boolean;
554
617
  options: Viewport[];
555
618
  };
619
+ expandedFieldGroups: Record<string, boolean>;
556
620
  field: {
557
621
  focus?: string | null;
558
622
  metadata?: Record<string, any>;
@@ -655,10 +719,12 @@ type Overrides<UserConfig extends Config = Config> = OverridesGeneric<{
655
719
  children: ReactNode;
656
720
  isLoading: boolean;
657
721
  itemSelector?: ItemSelector | null;
722
+ fields: Partial<Record<string, ReactNode>>;
658
723
  }>;
659
724
  fieldLabel: RenderFunc<{
660
725
  children?: ReactNode;
661
726
  icon?: ReactNode;
727
+ endIcon?: ReactNode;
662
728
  label: string;
663
729
  el?: "label" | "div";
664
730
  readOnly?: boolean;
@@ -690,12 +756,12 @@ type Overrides<UserConfig extends Config = Config> = OverridesGeneric<{
690
756
  }>;
691
757
  type FieldRenderFunctions<UserConfig extends Config = Config, G extends UserGenerics<UserConfig> = UserGenerics<UserConfig>, UserField extends {
692
758
  type: string;
693
- } = Field | G["UserField"]> = Omit<{
759
+ } = Field | G["UserField"]> = {
694
760
  [Type in UserField["type"]]: React.FunctionComponent<FieldProps<ExtractField<UserField, Type>, any> & {
695
761
  children: ReactNode;
696
762
  name: string;
697
- }>;
698
- }, "custom">;
763
+ }> | null;
764
+ };
699
765
 
700
766
  type DragAxis = "dynamic" | "y" | "x";
701
767
 
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { ReactElement, CSSProperties, ReactNode, ElementType, Ref, JSX } from 'react';
1
+ import { ElementType, CSSProperties, Ref, ComponentPropsWithoutRef, ReactElement, ReactNode, JSX } from 'react';
2
2
  import { EditorStateSnapshot, Editor, Extensions } from '@tiptap/react';
3
3
  import { BlockquoteOptions } from '@tiptap/extension-blockquote';
4
4
  import { BoldOptions } from '@tiptap/extension-bold';
@@ -20,6 +20,62 @@ type ItemSelector = {
20
20
  zone?: string;
21
21
  };
22
22
 
23
+ /**
24
+ * Props consumed by Puck internally that are shared between DropZones and slots.
25
+ */
26
+ type DropZoneSharedProps<ComponentType extends ElementType = "div"> = {
27
+ allow?: string[];
28
+ disallow?: string[];
29
+ style?: CSSProperties;
30
+ minEmptyHeight?: CSSProperties["minHeight"] | number;
31
+ className?: string;
32
+ collisionAxis?: DragAxis;
33
+ ref?: Ref<any>;
34
+ as?: ComponentType;
35
+ };
36
+ /**
37
+ * All props consumed by Puck for a DropZone component. `zone` lives here only.
38
+ *
39
+ * On slots `zone` is injected internally, so slots use {@link SlotProps} instead.
40
+ */
41
+ type DropZoneOwnProps<ComponentType extends ElementType = "div"> = DropZoneSharedProps<ComponentType> & {
42
+ zone: string;
43
+ };
44
+ /**
45
+ * Unsupported additional props that are never forwarded to `as`.
46
+ *
47
+ * Omitted from the public types AND stripped at runtime.
48
+ */
49
+ type NonForwardableProps = {
50
+ children?: unknown;
51
+ dangerouslySetInnerHTML?: unknown;
52
+ };
53
+ /**
54
+ * Keys internally consumed by Puck and never forwarded to `as`.
55
+ */
56
+ type ConsumedPropKey = keyof DropZoneOwnProps | "as" | "content" | "config" | "metadata" | "fieldTransforms";
57
+ /**
58
+ * Additional props forwarded to the element or component provided via `as`,
59
+ * typed against it.
60
+ *
61
+ * Puck-internal/unsupported props are stripped so they don't leak onto the DOM.
62
+ */
63
+ type ForwardedProps<ComponentType extends ElementType> = Omit<ComponentPropsWithoutRef<ComponentType>, ConsumedPropKey | keyof NonForwardableProps>;
64
+ /**
65
+ * Props for a `DropZone` component.
66
+ *
67
+ * Any additional props not consumed by Puck are forwarded to the element or
68
+ * component provided via `as` (defaulting to a `div`), typed against it.
69
+ */
70
+ type DropZoneProps<ComponentType extends ElementType = "div"> = DropZoneOwnProps<ComponentType> & ForwardedProps<ComponentType>;
71
+ /**
72
+ * Props for a `slot` render component.
73
+ *
74
+ * Any additional props not consumed by Puck are forwarded to the element or
75
+ * component provided via `as` (defaulting to a `div`), typed against it.
76
+ */
77
+ type SlotProps<ComponentType extends ElementType = "div"> = DropZoneSharedProps<ComponentType> & ForwardedProps<ComponentType>;
78
+
23
79
  declare const defaultEditorState: (ctx: EditorStateSnapshot, readOnly: boolean) => {
24
80
  isAlignLeft?: undefined;
25
81
  canAlignLeft?: undefined;
@@ -216,6 +272,10 @@ interface RadioField extends BaseField {
216
272
  type: "radio";
217
273
  options: FieldOptions;
218
274
  }
275
+ interface CheckboxField extends BaseField {
276
+ type: "checkbox";
277
+ options: FieldOptions;
278
+ }
219
279
  interface RichtextField<UserSelector extends RichTextSelector = RichTextSelector> extends BaseField {
220
280
  type: "richtext";
221
281
  contentEditable?: boolean;
@@ -258,6 +318,7 @@ interface ObjectField<Props extends any = {
258
318
  [key: string]: any;
259
319
  }, UserField extends {} = {}> extends BaseField {
260
320
  type: "object";
321
+ expandable?: boolean;
261
322
  objectFields: {
262
323
  [SubPropName in keyof Props]: UserField extends {
263
324
  type: PropertyKey;
@@ -322,7 +383,7 @@ interface SlotField extends BaseField {
322
383
  allow?: string[];
323
384
  disallow?: string[];
324
385
  }
325
- type Field<ValueType = any, UserField extends {} = {}> = TextField | RichtextField | NumberField | TextareaField | SelectField | RadioField | ArrayField<ValueType extends {
386
+ type Field<ValueType = any, UserField extends {} = {}> = TextField | RichtextField | NumberField | TextareaField | SelectField | RadioField | CheckboxField | ArrayField<ValueType extends {
326
387
  [key: string]: any;
327
388
  }[] ? ValueType : never, UserField> | ObjectField<ValueType, UserField> | ExternalField<ValueType> | ExternalFieldWithAdaptor<ValueType> | CustomField<ValueType> | SlotField;
328
389
  type Fields<ComponentProps extends DefaultComponentProps = DefaultComponentProps, UserField extends {} = {}> = {
@@ -338,20 +399,11 @@ type FieldProps<F = Field<any>, ValueType = any> = {
338
399
  readOnly?: boolean;
339
400
  };
340
401
 
341
- type DropZoneProps = {
342
- zone: string;
343
- allow?: string[];
344
- disallow?: string[];
345
- style?: CSSProperties;
346
- minEmptyHeight?: CSSProperties["minHeight"] | number;
347
- className?: string;
348
- collisionAxis?: DragAxis;
349
- as?: ElementType;
350
- ref?: Ref<any>;
351
- };
352
-
353
402
  type PuckContext = {
354
- renderDropZone: (props: DropZoneProps) => React.ReactNode;
403
+ /**
404
+ * @deprecated Use {@link https://puckeditor.com/docs/api-reference/fields/slot Slots} instead.
405
+ */
406
+ renderDropZone: <ComponentType extends ElementType = "div">(props: DropZoneProps<ComponentType>) => React.ReactNode;
355
407
  metadata: Metadata;
356
408
  isEditing: boolean;
357
409
  dragRef: ((element: Element | null) => void) | null;
@@ -359,6 +411,12 @@ type PuckContext = {
359
411
  type DefaultRootFieldProps = {
360
412
  title?: string;
361
413
  };
414
+ /**
415
+ * Merge the default root field props into user-provided root props, letting
416
+ * the user's props take precedence. Using a plain intersection would turn an
417
+ * overridden `title` (e.g. `number`) into `never` (`number & string`).
418
+ */
419
+ type WithDefaultRootFieldProps<RootProps> = RootProps & Omit<DefaultRootFieldProps, keyof RootProps>;
362
420
  type DefaultComponentProps = {
363
421
  [key: string]: any;
364
422
  };
@@ -378,7 +436,7 @@ type UserGenerics<UserConfig extends Config = Config, UserParams extends Extract
378
436
  UserConfig: UserConfig;
379
437
  UserParams: UserParams;
380
438
  UserProps: UserParams["props"];
381
- UserRootProps: UserParams["rootProps"] & DefaultRootFieldProps;
439
+ UserRootProps: WithDefaultRootFieldProps<UserParams["rootProps"]>;
382
440
  UserData: UserData;
383
441
  UserAppState: UserAppState;
384
442
  UserPublicAppState: UserPublicAppState;
@@ -391,7 +449,7 @@ type ExtractField<UserField extends {
391
449
  type: T;
392
450
  }>;
393
451
 
394
- type SlotComponent = (props?: Omit<DropZoneProps, "zone">) => ReactNode;
452
+ type SlotComponent = <ComponentType extends ElementType = "div">(props?: SlotProps<ComponentType>) => ReactNode;
395
453
  type PuckComponent<Props> = (props: WithId<WithPuckProps<{
396
454
  [K in keyof Props]: WithDeepSlots<Props[K], SlotComponent>;
397
455
  }>>) => JSX.Element;
@@ -407,6 +465,9 @@ UserField extends BaseField = {}> = {
407
465
  label?: string;
408
466
  defaultProps?: FieldProps;
409
467
  fields?: Fields<FieldProps, UserField>;
468
+ renderFields?: RenderFunc<{
469
+ fields: Partial<Record<keyof FieldProps, ReactNode>>;
470
+ }>;
410
471
  permissions?: Partial<Permissions>;
411
472
  inline?: boolean;
412
473
  resolveFields?: (data: DataShape, params: {
@@ -462,7 +523,7 @@ type DefaultComponents = Record<string, any>;
462
523
  type Config<PropsOrParams extends LeftOrExactRight<PropsOrParams, DefaultComponents, ConfigParams> = DefaultComponents | ConfigParams, RootProps extends DefaultComponentProps = any, CategoryName extends string = string> = PropsOrParams extends ConfigParams<infer ParamComponents, infer ParamRoot, infer ParamCategoryName, never> ? ConfigInternal<ParamComponents, ParamRoot, ParamCategoryName[number]> : PropsOrParams extends ConfigParams<infer ParamComponents, infer ParamRoot, infer ParamCategoryName, infer ParamFields> ? ConfigInternal<ParamComponents, ParamRoot, ParamCategoryName[number], ParamFields[keyof ParamFields] & BaseField> : PropsOrParams extends ConfigParams<infer ParamComponents, infer ParamRoot, infer ParamCategoryName, any> ? ConfigInternal<ParamComponents, ParamRoot, ParamCategoryName[number], {}> : ConfigInternal<PropsOrParams, RootProps, CategoryName>;
463
524
  type ExtractConfigParams<UserConfig extends ConfigInternal> = UserConfig extends ConfigInternal<infer PropsOrParams, infer RootProps, infer CategoryName, infer UserField> ? {
464
525
  props: PropsOrParams;
465
- rootProps: RootProps & DefaultRootFieldProps;
526
+ rootProps: WithDefaultRootFieldProps<RootProps>;
466
527
  categoryNames: CategoryName;
467
528
  field: UserField extends {
468
529
  type: string;
@@ -545,6 +606,8 @@ type UiState = {
545
606
  expanded?: boolean;
546
607
  }>;
547
608
  isDragging: boolean;
609
+ /** Outline items whose children are shown, keyed by item id */
610
+ itemExpanded?: Record<string, boolean>;
548
611
  viewports: {
549
612
  current: {
550
613
  width: number | "100%";
@@ -553,6 +616,7 @@ type UiState = {
553
616
  controlsVisible: boolean;
554
617
  options: Viewport[];
555
618
  };
619
+ expandedFieldGroups: Record<string, boolean>;
556
620
  field: {
557
621
  focus?: string | null;
558
622
  metadata?: Record<string, any>;
@@ -655,10 +719,12 @@ type Overrides<UserConfig extends Config = Config> = OverridesGeneric<{
655
719
  children: ReactNode;
656
720
  isLoading: boolean;
657
721
  itemSelector?: ItemSelector | null;
722
+ fields: Partial<Record<string, ReactNode>>;
658
723
  }>;
659
724
  fieldLabel: RenderFunc<{
660
725
  children?: ReactNode;
661
726
  icon?: ReactNode;
727
+ endIcon?: ReactNode;
662
728
  label: string;
663
729
  el?: "label" | "div";
664
730
  readOnly?: boolean;
@@ -690,12 +756,12 @@ type Overrides<UserConfig extends Config = Config> = OverridesGeneric<{
690
756
  }>;
691
757
  type FieldRenderFunctions<UserConfig extends Config = Config, G extends UserGenerics<UserConfig> = UserGenerics<UserConfig>, UserField extends {
692
758
  type: string;
693
- } = Field | G["UserField"]> = Omit<{
759
+ } = Field | G["UserField"]> = {
694
760
  [Type in UserField["type"]]: React.FunctionComponent<FieldProps<ExtractField<UserField, Type>, any> & {
695
761
  children: ReactNode;
696
762
  name: string;
697
- }>;
698
- }, "custom">;
763
+ }> | null;
764
+ };
699
765
 
700
766
  type DragAxis = "dynamic" | "y" | "x";
701
767
 
package/dist/index.js CHANGED
@@ -40,7 +40,7 @@ var import_react = __toESM(require("react"));
40
40
  // index.tsx
41
41
  var import_react2 = require("react");
42
42
 
43
- // ../../node_modules/@emotion/sheet/dist/emotion-sheet.esm.js
43
+ // ../../node_modules/.pnpm/@emotion+sheet@1.4.0/node_modules/@emotion/sheet/dist/emotion-sheet.esm.js
44
44
  var isDevelopment = false;
45
45
  function sheetForTag(tag) {
46
46
  if (tag.sheet) {
@@ -123,7 +123,7 @@ var StyleSheet = /* @__PURE__ */ (function() {
123
123
  return StyleSheet2;
124
124
  })();
125
125
 
126
- // ../../node_modules/stylis/src/Enum.js
126
+ // ../../node_modules/.pnpm/stylis@4.2.0/node_modules/stylis/src/Enum.js
127
127
  var MS = "-ms-";
128
128
  var MOZ = "-moz-";
129
129
  var WEBKIT = "-webkit-";
@@ -134,7 +134,7 @@ var IMPORT = "@import";
134
134
  var KEYFRAMES = "@keyframes";
135
135
  var LAYER = "@layer";
136
136
 
137
- // ../../node_modules/stylis/src/Utility.js
137
+ // ../../node_modules/.pnpm/stylis@4.2.0/node_modules/stylis/src/Utility.js
138
138
  var abs = Math.abs;
139
139
  var from = String.fromCharCode;
140
140
  var assign = Object.assign;
@@ -172,7 +172,7 @@ function combine(array, callback) {
172
172
  return array.map(callback).join("");
173
173
  }
174
174
 
175
- // ../../node_modules/stylis/src/Tokenizer.js
175
+ // ../../node_modules/.pnpm/stylis@4.2.0/node_modules/stylis/src/Tokenizer.js
176
176
  var line = 1;
177
177
  var column = 1;
178
178
  var length = 0;
@@ -308,7 +308,7 @@ function identifier(index) {
308
308
  return slice(index, position);
309
309
  }
310
310
 
311
- // ../../node_modules/stylis/src/Parser.js
311
+ // ../../node_modules/.pnpm/stylis@4.2.0/node_modules/stylis/src/Parser.js
312
312
  function compile(value) {
313
313
  return dealloc(parse("", null, null, null, [""], value = alloc(value), 0, [0], value));
314
314
  }
@@ -457,7 +457,7 @@ function declaration(value, root, parent, length2) {
457
457
  return node(value, root, parent, DECLARATION, substr(value, 0, length2), substr(value, length2 + 1, -1), length2);
458
458
  }
459
459
 
460
- // ../../node_modules/stylis/src/Serializer.js
460
+ // ../../node_modules/.pnpm/stylis@4.2.0/node_modules/stylis/src/Serializer.js
461
461
  function serialize(children, callback) {
462
462
  var output = "";
463
463
  var length2 = sizeof(children);
@@ -482,7 +482,7 @@ function stringify(element, index, children, callback) {
482
482
  return strlen(children = serialize(element.children, callback)) ? element.return = element.value + "{" + children + "}" : "";
483
483
  }
484
484
 
485
- // ../../node_modules/stylis/src/Middleware.js
485
+ // ../../node_modules/.pnpm/stylis@4.2.0/node_modules/stylis/src/Middleware.js
486
486
  function middleware(collection) {
487
487
  var length2 = sizeof(collection);
488
488
  return function(element, index, children, callback) {
@@ -501,7 +501,7 @@ function rulesheet(callback) {
501
501
  };
502
502
  }
503
503
 
504
- // ../../node_modules/@emotion/weak-memoize/dist/emotion-weak-memoize.esm.js
504
+ // ../../node_modules/.pnpm/@emotion+weak-memoize@0.4.0/node_modules/@emotion/weak-memoize/dist/emotion-weak-memoize.esm.js
505
505
  var weakMemoize = function weakMemoize2(func) {
506
506
  var cache = /* @__PURE__ */ new WeakMap();
507
507
  return function(arg) {
@@ -514,7 +514,7 @@ var weakMemoize = function weakMemoize2(func) {
514
514
  };
515
515
  };
516
516
 
517
- // ../../node_modules/@emotion/memoize/dist/emotion-memoize.esm.js
517
+ // ../../node_modules/.pnpm/@emotion+memoize@0.9.0/node_modules/@emotion/memoize/dist/emotion-memoize.esm.js
518
518
  function memoize(fn) {
519
519
  var cache = /* @__PURE__ */ Object.create(null);
520
520
  return function(arg) {
@@ -523,7 +523,7 @@ function memoize(fn) {
523
523
  };
524
524
  }
525
525
 
526
- // ../../node_modules/@emotion/cache/dist/emotion-cache.esm.js
526
+ // ../../node_modules/.pnpm/@emotion+cache@11.14.0/node_modules/@emotion/cache/dist/emotion-cache.esm.js
527
527
  var isBrowser = typeof document !== "undefined";
528
528
  var identifierWithPointTracking = function identifierWithPointTracking2(begin, points, index) {
529
529
  var previous = 0;
package/dist/index.mjs CHANGED
@@ -4,7 +4,7 @@ import React from "react";
4
4
  // index.tsx
5
5
  import { useEffect, useState } from "react";
6
6
 
7
- // ../../node_modules/@emotion/sheet/dist/emotion-sheet.esm.js
7
+ // ../../node_modules/.pnpm/@emotion+sheet@1.4.0/node_modules/@emotion/sheet/dist/emotion-sheet.esm.js
8
8
  var isDevelopment = false;
9
9
  function sheetForTag(tag) {
10
10
  if (tag.sheet) {
@@ -87,7 +87,7 @@ var StyleSheet = /* @__PURE__ */ (function() {
87
87
  return StyleSheet2;
88
88
  })();
89
89
 
90
- // ../../node_modules/stylis/src/Enum.js
90
+ // ../../node_modules/.pnpm/stylis@4.2.0/node_modules/stylis/src/Enum.js
91
91
  var MS = "-ms-";
92
92
  var MOZ = "-moz-";
93
93
  var WEBKIT = "-webkit-";
@@ -98,7 +98,7 @@ var IMPORT = "@import";
98
98
  var KEYFRAMES = "@keyframes";
99
99
  var LAYER = "@layer";
100
100
 
101
- // ../../node_modules/stylis/src/Utility.js
101
+ // ../../node_modules/.pnpm/stylis@4.2.0/node_modules/stylis/src/Utility.js
102
102
  var abs = Math.abs;
103
103
  var from = String.fromCharCode;
104
104
  var assign = Object.assign;
@@ -136,7 +136,7 @@ function combine(array, callback) {
136
136
  return array.map(callback).join("");
137
137
  }
138
138
 
139
- // ../../node_modules/stylis/src/Tokenizer.js
139
+ // ../../node_modules/.pnpm/stylis@4.2.0/node_modules/stylis/src/Tokenizer.js
140
140
  var line = 1;
141
141
  var column = 1;
142
142
  var length = 0;
@@ -272,7 +272,7 @@ function identifier(index) {
272
272
  return slice(index, position);
273
273
  }
274
274
 
275
- // ../../node_modules/stylis/src/Parser.js
275
+ // ../../node_modules/.pnpm/stylis@4.2.0/node_modules/stylis/src/Parser.js
276
276
  function compile(value) {
277
277
  return dealloc(parse("", null, null, null, [""], value = alloc(value), 0, [0], value));
278
278
  }
@@ -421,7 +421,7 @@ function declaration(value, root, parent, length2) {
421
421
  return node(value, root, parent, DECLARATION, substr(value, 0, length2), substr(value, length2 + 1, -1), length2);
422
422
  }
423
423
 
424
- // ../../node_modules/stylis/src/Serializer.js
424
+ // ../../node_modules/.pnpm/stylis@4.2.0/node_modules/stylis/src/Serializer.js
425
425
  function serialize(children, callback) {
426
426
  var output = "";
427
427
  var length2 = sizeof(children);
@@ -446,7 +446,7 @@ function stringify(element, index, children, callback) {
446
446
  return strlen(children = serialize(element.children, callback)) ? element.return = element.value + "{" + children + "}" : "";
447
447
  }
448
448
 
449
- // ../../node_modules/stylis/src/Middleware.js
449
+ // ../../node_modules/.pnpm/stylis@4.2.0/node_modules/stylis/src/Middleware.js
450
450
  function middleware(collection) {
451
451
  var length2 = sizeof(collection);
452
452
  return function(element, index, children, callback) {
@@ -465,7 +465,7 @@ function rulesheet(callback) {
465
465
  };
466
466
  }
467
467
 
468
- // ../../node_modules/@emotion/weak-memoize/dist/emotion-weak-memoize.esm.js
468
+ // ../../node_modules/.pnpm/@emotion+weak-memoize@0.4.0/node_modules/@emotion/weak-memoize/dist/emotion-weak-memoize.esm.js
469
469
  var weakMemoize = function weakMemoize2(func) {
470
470
  var cache = /* @__PURE__ */ new WeakMap();
471
471
  return function(arg) {
@@ -478,7 +478,7 @@ var weakMemoize = function weakMemoize2(func) {
478
478
  };
479
479
  };
480
480
 
481
- // ../../node_modules/@emotion/memoize/dist/emotion-memoize.esm.js
481
+ // ../../node_modules/.pnpm/@emotion+memoize@0.9.0/node_modules/@emotion/memoize/dist/emotion-memoize.esm.js
482
482
  function memoize(fn) {
483
483
  var cache = /* @__PURE__ */ Object.create(null);
484
484
  return function(arg) {
@@ -487,7 +487,7 @@ function memoize(fn) {
487
487
  };
488
488
  }
489
489
 
490
- // ../../node_modules/@emotion/cache/dist/emotion-cache.esm.js
490
+ // ../../node_modules/.pnpm/@emotion+cache@11.14.0/node_modules/@emotion/cache/dist/emotion-cache.esm.js
491
491
  var isBrowser = typeof document !== "undefined";
492
492
  var identifierWithPointTracking = function identifierWithPointTracking2(begin, points, index) {
493
493
  var previous = 0;
package/package.json CHANGED
@@ -1,8 +1,11 @@
1
1
  {
2
2
  "name": "@puckeditor/plugin-emotion-cache",
3
- "version": "0.23.0-canary.fb9392de",
3
+ "version": "0.24.0-canary.03e660bb",
4
4
  "author": "Chris Villa <chris@puckeditor.com>",
5
- "repository": "puckeditor/puck",
5
+ "repository": {
6
+ "type": "git",
7
+ "url": "puckeditor/puck"
8
+ },
6
9
  "bugs": "https://github.com/puckeditor/puck/issues",
7
10
  "homepage": "https://puckeditor.com",
8
11
  "private": false,
@@ -14,29 +17,28 @@
14
17
  "types": "./dist/index.d.ts"
15
18
  },
16
19
  "license": "MIT",
17
- "scripts": {
18
- "lint": "eslint \"**/*.ts*\"",
19
- "build": "rm -rf dist && tsup index.tsx",
20
- "prepare": "yarn build"
21
- },
22
20
  "files": [
23
21
  "dist"
24
22
  ],
25
23
  "devDependencies": {
26
24
  "@emotion/react": "^11.13.3",
27
- "@puckeditor/core": "^0.23.0-canary.fb9392de",
25
+ "@puckeditor/core": "^0.24.0-canary.03e660bb",
28
26
  "@types/minimatch": "3.0.5",
29
27
  "@types/react": "^19.2.7",
30
28
  "@types/react-dom": "^19.0.2",
31
29
  "eslint": "^9.0.0",
32
- "eslint-config-custom": "*",
33
- "tsconfig": "*",
30
+ "eslint-config-custom": "0.0.0",
31
+ "tsconfig": "0.0.0",
34
32
  "tsup": "^8.2.4",
35
- "tsup-config": "*",
33
+ "tsup-config": "0.0.0",
36
34
  "typescript": "^5.5.4"
37
35
  },
38
36
  "peerDependencies": {
39
37
  "@emotion/react": "^11.0.0",
40
38
  "react": "^17.0.0 || ^18.0.0 || ^19.0.0"
39
+ },
40
+ "scripts": {
41
+ "lint": "eslint \"**/*.ts*\"",
42
+ "build": "rm -rf dist && tsup index.tsx"
41
43
  }
42
- }
44
+ }