@puckeditor/core 0.24.0-canary.8bebc7ab → 0.24.0-canary.8e792e2d
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +34 -1
- package/dist/{Editor-LJSLIQQP.mjs → Editor-QKVNUOPH.mjs} +8 -8
- package/dist/{Editor-CSDMK75G.css → Editor-T7TKW6NT.css} +16 -24
- package/dist/{Render-H3USS5FU.mjs → Render-KIF7JWS4.mjs} +1 -1
- package/dist/{actions-D_nE8NdE.d.mts → actions-DzP_zhsF.d.mts} +4 -21
- package/dist/{actions-D_nE8NdE.d.ts → actions-DzP_zhsF.d.ts} +4 -21
- package/dist/{chunk-ZOLLDKZQ.mjs → chunk-2CNEFIQP.mjs} +1 -4
- package/dist/{chunk-5L3MP6BU.mjs → chunk-CKY5CKSU.mjs} +7 -7
- package/dist/{chunk-OGTX6PQW.mjs → chunk-EHTFXUBU.mjs} +1 -1
- package/dist/{chunk-HCKVNDLU.mjs → chunk-ELZ5SBY3.mjs} +1373 -2424
- package/dist/{chunk-ZO7CHPM6.mjs → chunk-NBTE2AWP.mjs} +1 -1
- package/dist/{chunk-UIJZMSVU.mjs → chunk-PFNS3HDM.mjs} +3 -3
- package/dist/{chunk-M6VGZJMS.mjs → chunk-PJDBGMYG.mjs} +1 -1
- package/dist/{chunk-3GJJSXCL.mjs → chunk-XAJK3MOG.mjs} +51 -84
- package/dist/{chunk-FWBFOZBF.mjs → chunk-XTIXX7I3.mjs} +135 -185
- package/dist/{chunk-XMN55NON.mjs → chunk-ZRAERXB4.mjs} +2 -3
- package/dist/{full-H4FZ3HN3.mjs → full-3BPAMA2C.mjs} +6 -6
- package/dist/{full-F3CBWTKQ.css → full-AAZK6KLI.css} +16 -24
- package/dist/{index-GchMd1Kw.d.ts → index-Cv-eVWCd.d.ts} +1 -2
- package/dist/{index-BSR01WBw.d.mts → index-poi3aTIz.d.mts} +1 -2
- package/dist/index.css +96 -328
- package/dist/index.d.mts +8 -59
- package/dist/index.d.ts +8 -59
- package/dist/index.js +3198 -4338
- package/dist/index.mjs +9 -17
- package/dist/internal.d.mts +2 -2
- package/dist/internal.d.ts +2 -2
- package/dist/{loaded-UDM5EYPG.css → loaded-CA3Q7UHH.css} +16 -24
- package/dist/{loaded-WFQRY2XL.mjs → loaded-IRK2RWX3.mjs} +3 -3
- package/dist/{loaded-P5HN7RJY.mjs → loaded-OZ2F7R6I.mjs} +3 -3
- package/dist/{loaded-PFIA543C.mjs → loaded-TUHXN2Y2.mjs} +3 -3
- package/dist/no-external.css +96 -328
- package/dist/no-external.d.mts +4 -4
- package/dist/no-external.d.ts +4 -4
- package/dist/no-external.js +3198 -4338
- package/dist/no-external.mjs +9 -17
- package/dist/rsc.d.mts +3 -4
- package/dist/rsc.d.ts +3 -4
- package/dist/rsc.js +68 -137
- package/dist/rsc.mjs +20 -50
- package/dist/{walk-tree-YaheG6K6.d.ts → walk-tree-Bu3IHwm_.d.ts} +1 -1
- package/dist/{walk-tree-CTTFe0Gt.d.mts → walk-tree-iWDqHBcM.d.mts} +1 -1
- package/package.json +4 -3
- package/CHANGELOG.md +0 -1209
package/README.md
CHANGED
|
@@ -82,6 +82,34 @@ export function Page() {
|
|
|
82
82
|
}
|
|
83
83
|
```
|
|
84
84
|
|
|
85
|
+
## CLI
|
|
86
|
+
|
|
87
|
+
Set up Puck and Puck Cloud in a new or existing Next.js, React Router, TanStack Start, vinext, Vite or Astro app, or a Hono or Express server. Built for coding agents, friendly for humans:
|
|
88
|
+
|
|
89
|
+
```sh
|
|
90
|
+
npx @puckeditor/cli init
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
See the [CLI docs](https://puckeditor.com/docs/cli) for agent usage.
|
|
94
|
+
|
|
95
|
+
## For agents
|
|
96
|
+
|
|
97
|
+
Puck is built to be set up and used by coding agents as well as people. The CLI sets up Puck without prompting, and ships with the docs for its release, so agents can read the docs for the version a project uses:
|
|
98
|
+
|
|
99
|
+
```sh
|
|
100
|
+
npx @puckeditor/cli init --yes --json
|
|
101
|
+
npx @puckeditor/cli docs find "dynamic fields"
|
|
102
|
+
npx @puckeditor/cli docs cat api-reference/fields/text
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
Agents with skill support can install the [Puck skill](https://github.com/puckeditor/skills):
|
|
106
|
+
|
|
107
|
+
```sh
|
|
108
|
+
npx skills add puckeditor/skills --skill puck
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
The latest docs are indexed at [llms.txt](https://puckeditor.com/llms.txt), and any page is available as markdown by adding `.md` to its URL.
|
|
112
|
+
|
|
85
113
|
## Recipes
|
|
86
114
|
|
|
87
115
|
Use `create-puck-app` to quickly spin up a a pre-configured app based on our provided [recipes](https://github.com/puckeditor/puck/tree/main/recipes):
|
|
@@ -93,7 +121,12 @@ npx create-puck-app my-app
|
|
|
93
121
|
Available recipes include:
|
|
94
122
|
|
|
95
123
|
- [**next**](https://github.com/puckeditor/puck/tree/main/recipes/next): Next.js example, using App Router and static page generation
|
|
96
|
-
- [**react-router**](https://github.com/puckeditor/puck/tree/main/recipes/react-router): React Router
|
|
124
|
+
- [**react-router**](https://github.com/puckeditor/puck/tree/main/recipes/react-router): React Router v8 app example, using dynamic routes to create pages at any level
|
|
125
|
+
- [**tanstack-start**](https://github.com/puckeditor/puck/tree/main/recipes/tanstack-start): [TanStack Start](https://tanstack.com/start) example, using a splat route and server functions to create pages at any level
|
|
126
|
+
- [**hono**](https://github.com/puckeditor/puck/tree/main/recipes/hono) and [**express**](https://github.com/puckeditor/puck/tree/main/recipes/express): Hono and Express servers exposing a pages API, and Puck AI in the `-ai` variants, for an editor in another app
|
|
127
|
+
- [**astro**](https://github.com/puckeditor/puck/tree/main/recipes/astro): Astro example, rendering Puck pages on the server with the Node adapter
|
|
128
|
+
- [**vite**](https://github.com/puckeditor/puck/tree/main/recipes/vite): Vite React app example, with a small Hono server for pages
|
|
129
|
+
- [**vinext**](https://github.com/puckeditor/puck/tree/main/recipes/vinext): [vinext](https://github.com/cloudflare/vinext) example, running the Next.js App Router on Vite
|
|
97
130
|
|
|
98
131
|
## Community
|
|
99
132
|
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
import {
|
|
2
2
|
PuckRichText
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-2CNEFIQP.mjs";
|
|
4
4
|
import {
|
|
5
5
|
EditorInner,
|
|
6
6
|
LoadedRichTextMenu
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-PFNS3HDM.mjs";
|
|
8
8
|
import "./chunk-H635BA2V.mjs";
|
|
9
|
-
import "./chunk-
|
|
10
|
-
import "./chunk-
|
|
11
|
-
import "./chunk-
|
|
12
|
-
import "./chunk-
|
|
9
|
+
import "./chunk-CKY5CKSU.mjs";
|
|
10
|
+
import "./chunk-EHTFXUBU.mjs";
|
|
11
|
+
import "./chunk-NBTE2AWP.mjs";
|
|
12
|
+
import "./chunk-PJDBGMYG.mjs";
|
|
13
13
|
import {
|
|
14
14
|
useAppStore,
|
|
15
15
|
useAppStoreApi
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-XTIXX7I3.mjs";
|
|
17
17
|
import "./chunk-Z2MS6UIF.mjs";
|
|
18
|
-
import "./chunk-
|
|
18
|
+
import "./chunk-ZRAERXB4.mjs";
|
|
19
19
|
import "./chunk-OT7NKYY4.mjs";
|
|
20
20
|
import "./chunk-H65MT2JK.mjs";
|
|
21
21
|
import {
|
|
@@ -99,7 +99,7 @@
|
|
|
99
99
|
}
|
|
100
100
|
|
|
101
101
|
/* css-module:/home/runner/work/puck/puck/packages/core/components/ActionBar/styles.module.css/#css-module-data */
|
|
102
|
-
.
|
|
102
|
+
._ActionBar_5vdfr_1 {
|
|
103
103
|
align-items: center;
|
|
104
104
|
cursor: default;
|
|
105
105
|
display: flex;
|
|
@@ -114,7 +114,7 @@
|
|
|
114
114
|
font-family: var(--puck-font-family);
|
|
115
115
|
min-height: 26px;
|
|
116
116
|
}
|
|
117
|
-
._ActionBar-
|
|
117
|
+
._ActionBar-label_5vdfr_17 {
|
|
118
118
|
color: var(--puck-actionbar-color-text, var(--puck-color-text-inverse));
|
|
119
119
|
font-size: var(--puck-actionbar-font-size, var(--puck-font-size-xxxs));
|
|
120
120
|
opacity: var(--puck-actionbar-opacity-text, var(--puck-opacity-text-inverse));
|
|
@@ -126,13 +126,13 @@
|
|
|
126
126
|
text-overflow: ellipsis;
|
|
127
127
|
white-space: nowrap;
|
|
128
128
|
}
|
|
129
|
-
.
|
|
129
|
+
._ActionBarAction_5vdfr_30 + ._ActionBar-label_5vdfr_17 {
|
|
130
130
|
padding-inline-start: 0;
|
|
131
131
|
}
|
|
132
|
-
._ActionBar-
|
|
132
|
+
._ActionBar-label_5vdfr_17 + ._ActionBarAction_5vdfr_30 {
|
|
133
133
|
margin-inline-start: calc(var(--puck-space-1) * -1);
|
|
134
134
|
}
|
|
135
|
-
._ActionBar-
|
|
135
|
+
._ActionBar-group_5vdfr_38 {
|
|
136
136
|
align-items: center;
|
|
137
137
|
border-inline-start: var(--puck-border-width-hairline) solid var(--puck-actionbar-color-separator, var(--puck-color-border-inverse));
|
|
138
138
|
display: flex;
|
|
@@ -140,13 +140,13 @@
|
|
|
140
140
|
padding-inline-start: var(--puck-space-1);
|
|
141
141
|
padding-inline-end: var(--puck-space-1);
|
|
142
142
|
}
|
|
143
|
-
._ActionBar-
|
|
143
|
+
._ActionBar-group_5vdfr_38:first-of-type {
|
|
144
144
|
border-inline-start: 0;
|
|
145
145
|
}
|
|
146
|
-
._ActionBar-
|
|
146
|
+
._ActionBar-group_5vdfr_38:empty {
|
|
147
147
|
display: none;
|
|
148
148
|
}
|
|
149
|
-
.
|
|
149
|
+
._ActionBarAction_5vdfr_30 {
|
|
150
150
|
background: transparent;
|
|
151
151
|
border: none;
|
|
152
152
|
color: var(--puck-actionbar-color-text, var(--puck-color-text-inverse));
|
|
@@ -162,43 +162,35 @@
|
|
|
162
162
|
opacity: var(--puck-actionbar-opacity-text, var(--puck-opacity-text-inverse));
|
|
163
163
|
transition: color var(--puck-duration-fast) var(--puck-ease-exit), opacity var(--puck-duration-fast) var(--puck-ease-exit);
|
|
164
164
|
}
|
|
165
|
-
._ActionBarAction--
|
|
165
|
+
._ActionBarAction--disabled_5vdfr_74 {
|
|
166
166
|
cursor: auto;
|
|
167
167
|
color: var( --puck-actionbar-color-action-disabled, var(--puck-color-text-inverse) );
|
|
168
168
|
opacity: var(--puck-actionbar-opacity-action-disabled, 0.54);
|
|
169
169
|
}
|
|
170
|
-
.
|
|
171
|
-
cursor: grab;
|
|
172
|
-
touch-action: none;
|
|
173
|
-
}
|
|
174
|
-
._ActionBarAction-icon_gr1cb_88 {
|
|
175
|
-
height: var(--puck-actionbar-action-size, var(--puck-icon-size-s));
|
|
176
|
-
width: var(--puck-actionbar-action-size, var(--puck-icon-size-s));
|
|
177
|
-
}
|
|
178
|
-
._ActionBarAction_gr1cb_30 svg {
|
|
170
|
+
._ActionBarAction_5vdfr_30 svg {
|
|
179
171
|
max-width: none !important;
|
|
180
172
|
}
|
|
181
|
-
.
|
|
173
|
+
._ActionBarAction_5vdfr_30:focus-visible {
|
|
182
174
|
outline: var(--puck-border-width-focus) solid var(--puck-color-focus-ring);
|
|
183
175
|
outline-offset: calc(var(--puck-border-width-focus) * -1);
|
|
184
176
|
}
|
|
185
177
|
@media (hover: hover) and (pointer: fine) {
|
|
186
|
-
.
|
|
178
|
+
._ActionBarAction_5vdfr_30:hover:not(._ActionBarAction--disabled_5vdfr_74) {
|
|
187
179
|
color: var( --puck-actionbar-color-action-hover, var(--puck-color-interactive-inverse-hover) );
|
|
188
180
|
opacity: 1;
|
|
189
181
|
transition: none;
|
|
190
182
|
}
|
|
191
183
|
}
|
|
192
|
-
.
|
|
193
|
-
._ActionBarAction--
|
|
184
|
+
._ActionBarAction_5vdfr_30:active:not(._ActionBarAction--disabled_5vdfr_74),
|
|
185
|
+
._ActionBarAction--active_5vdfr_104 {
|
|
194
186
|
color: var( --puck-actionbar-color-action-active, var(--puck-color-interactive-inverse-active) );
|
|
195
187
|
opacity: 1;
|
|
196
188
|
transition: none;
|
|
197
189
|
}
|
|
198
|
-
._ActionBar-
|
|
190
|
+
._ActionBar-group_5vdfr_38 * {
|
|
199
191
|
margin: 0;
|
|
200
192
|
}
|
|
201
|
-
._ActionBar-
|
|
193
|
+
._ActionBar-separator_5vdfr_117 {
|
|
202
194
|
background: var( --puck-actionbar-color-separator, var(--puck-color-border-inverse) );
|
|
203
195
|
margin-inline: var(--puck-space-1);
|
|
204
196
|
width: var( --puck-border-width-hairline );
|
|
@@ -53,7 +53,7 @@ type NonForwardableProps = {
|
|
|
53
53
|
/**
|
|
54
54
|
* Keys internally consumed by Puck and never forwarded to `as`.
|
|
55
55
|
*/
|
|
56
|
-
type ConsumedPropKey = keyof DropZoneOwnProps | "as" | "content" | "config" | "metadata"
|
|
56
|
+
type ConsumedPropKey = keyof DropZoneOwnProps | "as" | "content" | "config" | "metadata";
|
|
57
57
|
/**
|
|
58
58
|
* Additional props forwarded to the element or component provided via `as`,
|
|
59
59
|
* typed against it.
|
|
@@ -272,10 +272,6 @@ interface RadioField extends BaseField {
|
|
|
272
272
|
type: "radio";
|
|
273
273
|
options: FieldOptions;
|
|
274
274
|
}
|
|
275
|
-
interface CheckboxField extends BaseField {
|
|
276
|
-
type: "checkbox";
|
|
277
|
-
options: FieldOptions;
|
|
278
|
-
}
|
|
279
275
|
interface RichtextField<UserSelector extends RichTextSelector = RichTextSelector> extends BaseField {
|
|
280
276
|
type: "richtext";
|
|
281
277
|
contentEditable?: boolean;
|
|
@@ -318,7 +314,6 @@ interface ObjectField<Props extends any = {
|
|
|
318
314
|
[key: string]: any;
|
|
319
315
|
}, UserField extends {} = {}> extends BaseField {
|
|
320
316
|
type: "object";
|
|
321
|
-
expandable?: boolean;
|
|
322
317
|
objectFields: {
|
|
323
318
|
[SubPropName in keyof Props]: UserField extends {
|
|
324
319
|
type: PropertyKey;
|
|
@@ -383,7 +378,7 @@ interface SlotField extends BaseField {
|
|
|
383
378
|
allow?: string[];
|
|
384
379
|
disallow?: string[];
|
|
385
380
|
}
|
|
386
|
-
type Field<ValueType = any, UserField extends {} = {}> = TextField | RichtextField | NumberField | TextareaField | SelectField | RadioField |
|
|
381
|
+
type Field<ValueType = any, UserField extends {} = {}> = TextField | RichtextField | NumberField | TextareaField | SelectField | RadioField | ArrayField<ValueType extends {
|
|
387
382
|
[key: string]: any;
|
|
388
383
|
}[] ? ValueType : never, UserField> | ObjectField<ValueType, UserField> | ExternalField<ValueType> | ExternalFieldWithAdaptor<ValueType> | CustomField<ValueType> | SlotField;
|
|
389
384
|
type Fields<ComponentProps extends DefaultComponentProps = DefaultComponentProps, UserField extends {} = {}> = {
|
|
@@ -467,9 +462,6 @@ UserField extends BaseField = {}> = {
|
|
|
467
462
|
label?: string;
|
|
468
463
|
defaultProps?: FieldProps;
|
|
469
464
|
fields?: Fields<FieldProps, UserField>;
|
|
470
|
-
renderFields?: RenderFunc<{
|
|
471
|
-
fields: Partial<Record<keyof FieldProps, ReactNode>>;
|
|
472
|
-
}>;
|
|
473
465
|
permissions?: Partial<Permissions>;
|
|
474
466
|
inline?: boolean;
|
|
475
467
|
resolveFields?: (data: DataShape, params: {
|
|
@@ -627,13 +619,10 @@ type UiState = {
|
|
|
627
619
|
controlsVisible: boolean;
|
|
628
620
|
options: Viewport[];
|
|
629
621
|
};
|
|
630
|
-
expandedFieldGroups: Record<string, boolean>;
|
|
631
622
|
field: {
|
|
632
623
|
focus?: string | null;
|
|
633
624
|
metadata?: Record<string, any>;
|
|
634
625
|
};
|
|
635
|
-
/** The selected field tab. Shows the first available tab when `null`. */
|
|
636
|
-
fieldTab?: string | number | null;
|
|
637
626
|
plugin: {
|
|
638
627
|
current: string | null;
|
|
639
628
|
};
|
|
@@ -727,8 +716,6 @@ type Overrides<UserConfig extends Config = Config> = OverridesGeneric<{
|
|
|
727
716
|
label?: string;
|
|
728
717
|
children: ReactNode;
|
|
729
718
|
parentAction: ReactNode;
|
|
730
|
-
dragHandle?: ReactNode;
|
|
731
|
-
dragHandleRef?: (element: Element | null) => void;
|
|
732
719
|
}>;
|
|
733
720
|
headerActions: RenderFunc<{
|
|
734
721
|
children: ReactNode;
|
|
@@ -738,12 +725,10 @@ type Overrides<UserConfig extends Config = Config> = OverridesGeneric<{
|
|
|
738
725
|
children: ReactNode;
|
|
739
726
|
isLoading: boolean;
|
|
740
727
|
itemSelector?: ItemSelector | null;
|
|
741
|
-
fields: Partial<Record<string, ReactNode>>;
|
|
742
728
|
}>;
|
|
743
729
|
fieldLabel: RenderFunc<{
|
|
744
730
|
children?: ReactNode;
|
|
745
731
|
icon?: ReactNode;
|
|
746
|
-
endIcon?: ReactNode;
|
|
747
732
|
label: string;
|
|
748
733
|
el?: "label" | "div";
|
|
749
734
|
readOnly?: boolean;
|
|
@@ -810,11 +795,9 @@ type DndBehavior = "auto" | "fluid" | "static";
|
|
|
810
795
|
type DndConfig = {
|
|
811
796
|
disableAutoScroll?: boolean;
|
|
812
797
|
disableOutlineDrag?: boolean;
|
|
813
|
-
enableDragHandle?: boolean;
|
|
814
798
|
/**
|
|
815
799
|
* - `auto` (default): fluid drags within a slot, switching to a static
|
|
816
|
-
* line placeholder when dragging between slots
|
|
817
|
-
* or dragging from the action bar drag handle
|
|
800
|
+
* line placeholder when dragging between slots or inserting a new item
|
|
818
801
|
* - `fluid`: always animate sibling items during a drag
|
|
819
802
|
* - `static`: always show a line placeholder during a drag, only
|
|
820
803
|
* animating sibling items on drop
|
|
@@ -922,4 +905,4 @@ type PuckAction = {
|
|
|
922
905
|
recordHistory?: boolean;
|
|
923
906
|
} & (ReorderAction | InsertAction | MoveAction | ReplaceAction | ReplaceRootAction | RemoveAction | DuplicateAction | SetAction | SetDataAction | SetUiAction | RegisterZoneAction | UnregisterZoneAction);
|
|
924
907
|
|
|
925
|
-
export { type
|
|
908
|
+
export { type OverrideKey as $, type Adaptor as A, type BaseData as B, type CacheOpts as C, type Data as D, type DropZoneProps as E, type ExternalField as F, type ExternalFieldWithAdaptor as G, type ExtractConfigParams as H, type ExtractField as I, type Field as J, type FieldMetadata as K, type FieldProps as L, type FieldRenderFunctions as M, type FieldTransformFn as N, type FieldTransformFnParams as O, type FieldTransforms as P, type Fields as Q, type History as R, type IframeConfig as S, type InitialHistory as T, type ItemSelector as U, type ItemWithId as V, type MappedItem as W, type Metadata as X, type NumberField as Y, type ObjectField as Z, type OnAction as _, type AppState as a, type Overrides as a0, type Permissions as a1, type Plugin as a2, type PluginInternal as a3, type PrivateAppState as a4, type PuckAction as a5, type PuckComponent as a6, type PuckContext as a7, type PuckMetadata as a8, type RadioField as a9, type ResolveDataTrigger as aa, type RichText as ab, type RichtextField as ac, type RootConfig as ad, type RootData as ae, type RootDataWithProps as af, type RootDataWithoutProps as ag, type SelectField as ah, type Slot as ai, type SlotComponent as aj, type SlotField as ak, type TextField as al, type TextareaField as am, type UiState as an, type UserGenerics as ao, type Viewport as ap, type Viewports as aq, type WithChildren as ar, type WithDefaultRootFieldProps as as, type WithId as at, type WithPuckProps as au, type WithSlotProps as av, overrideKeys as aw, type ArrayField as b, type ArrayState as c, type AsFieldProps as d, type BaseField as e, type ComponentConfig as f, type ComponentConfigExtensions as g, type ComponentConfigParams as h, type ComponentData as i, type ComponentDataMap as j, type ComponentDataOptionalId as k, type ComponentMetadata as l, type Config as m, type ConfigParams as n, type Content as o, type CustomField as p, type CustomFieldRender as q, type DefaultComponentProps as r, type DefaultComponents as s, type DefaultRootFieldProps as t, type DefaultRootProps as u, type DefaultRootRenderProps as v, type Direction as w, type DndBehavior as x, type DndConfig as y, type DragAxis as z };
|
|
@@ -53,7 +53,7 @@ type NonForwardableProps = {
|
|
|
53
53
|
/**
|
|
54
54
|
* Keys internally consumed by Puck and never forwarded to `as`.
|
|
55
55
|
*/
|
|
56
|
-
type ConsumedPropKey = keyof DropZoneOwnProps | "as" | "content" | "config" | "metadata"
|
|
56
|
+
type ConsumedPropKey = keyof DropZoneOwnProps | "as" | "content" | "config" | "metadata";
|
|
57
57
|
/**
|
|
58
58
|
* Additional props forwarded to the element or component provided via `as`,
|
|
59
59
|
* typed against it.
|
|
@@ -272,10 +272,6 @@ interface RadioField extends BaseField {
|
|
|
272
272
|
type: "radio";
|
|
273
273
|
options: FieldOptions;
|
|
274
274
|
}
|
|
275
|
-
interface CheckboxField extends BaseField {
|
|
276
|
-
type: "checkbox";
|
|
277
|
-
options: FieldOptions;
|
|
278
|
-
}
|
|
279
275
|
interface RichtextField<UserSelector extends RichTextSelector = RichTextSelector> extends BaseField {
|
|
280
276
|
type: "richtext";
|
|
281
277
|
contentEditable?: boolean;
|
|
@@ -318,7 +314,6 @@ interface ObjectField<Props extends any = {
|
|
|
318
314
|
[key: string]: any;
|
|
319
315
|
}, UserField extends {} = {}> extends BaseField {
|
|
320
316
|
type: "object";
|
|
321
|
-
expandable?: boolean;
|
|
322
317
|
objectFields: {
|
|
323
318
|
[SubPropName in keyof Props]: UserField extends {
|
|
324
319
|
type: PropertyKey;
|
|
@@ -383,7 +378,7 @@ interface SlotField extends BaseField {
|
|
|
383
378
|
allow?: string[];
|
|
384
379
|
disallow?: string[];
|
|
385
380
|
}
|
|
386
|
-
type Field<ValueType = any, UserField extends {} = {}> = TextField | RichtextField | NumberField | TextareaField | SelectField | RadioField |
|
|
381
|
+
type Field<ValueType = any, UserField extends {} = {}> = TextField | RichtextField | NumberField | TextareaField | SelectField | RadioField | ArrayField<ValueType extends {
|
|
387
382
|
[key: string]: any;
|
|
388
383
|
}[] ? ValueType : never, UserField> | ObjectField<ValueType, UserField> | ExternalField<ValueType> | ExternalFieldWithAdaptor<ValueType> | CustomField<ValueType> | SlotField;
|
|
389
384
|
type Fields<ComponentProps extends DefaultComponentProps = DefaultComponentProps, UserField extends {} = {}> = {
|
|
@@ -467,9 +462,6 @@ UserField extends BaseField = {}> = {
|
|
|
467
462
|
label?: string;
|
|
468
463
|
defaultProps?: FieldProps;
|
|
469
464
|
fields?: Fields<FieldProps, UserField>;
|
|
470
|
-
renderFields?: RenderFunc<{
|
|
471
|
-
fields: Partial<Record<keyof FieldProps, ReactNode>>;
|
|
472
|
-
}>;
|
|
473
465
|
permissions?: Partial<Permissions>;
|
|
474
466
|
inline?: boolean;
|
|
475
467
|
resolveFields?: (data: DataShape, params: {
|
|
@@ -627,13 +619,10 @@ type UiState = {
|
|
|
627
619
|
controlsVisible: boolean;
|
|
628
620
|
options: Viewport[];
|
|
629
621
|
};
|
|
630
|
-
expandedFieldGroups: Record<string, boolean>;
|
|
631
622
|
field: {
|
|
632
623
|
focus?: string | null;
|
|
633
624
|
metadata?: Record<string, any>;
|
|
634
625
|
};
|
|
635
|
-
/** The selected field tab. Shows the first available tab when `null`. */
|
|
636
|
-
fieldTab?: string | number | null;
|
|
637
626
|
plugin: {
|
|
638
627
|
current: string | null;
|
|
639
628
|
};
|
|
@@ -727,8 +716,6 @@ type Overrides<UserConfig extends Config = Config> = OverridesGeneric<{
|
|
|
727
716
|
label?: string;
|
|
728
717
|
children: ReactNode;
|
|
729
718
|
parentAction: ReactNode;
|
|
730
|
-
dragHandle?: ReactNode;
|
|
731
|
-
dragHandleRef?: (element: Element | null) => void;
|
|
732
719
|
}>;
|
|
733
720
|
headerActions: RenderFunc<{
|
|
734
721
|
children: ReactNode;
|
|
@@ -738,12 +725,10 @@ type Overrides<UserConfig extends Config = Config> = OverridesGeneric<{
|
|
|
738
725
|
children: ReactNode;
|
|
739
726
|
isLoading: boolean;
|
|
740
727
|
itemSelector?: ItemSelector | null;
|
|
741
|
-
fields: Partial<Record<string, ReactNode>>;
|
|
742
728
|
}>;
|
|
743
729
|
fieldLabel: RenderFunc<{
|
|
744
730
|
children?: ReactNode;
|
|
745
731
|
icon?: ReactNode;
|
|
746
|
-
endIcon?: ReactNode;
|
|
747
732
|
label: string;
|
|
748
733
|
el?: "label" | "div";
|
|
749
734
|
readOnly?: boolean;
|
|
@@ -810,11 +795,9 @@ type DndBehavior = "auto" | "fluid" | "static";
|
|
|
810
795
|
type DndConfig = {
|
|
811
796
|
disableAutoScroll?: boolean;
|
|
812
797
|
disableOutlineDrag?: boolean;
|
|
813
|
-
enableDragHandle?: boolean;
|
|
814
798
|
/**
|
|
815
799
|
* - `auto` (default): fluid drags within a slot, switching to a static
|
|
816
|
-
* line placeholder when dragging between slots
|
|
817
|
-
* or dragging from the action bar drag handle
|
|
800
|
+
* line placeholder when dragging between slots or inserting a new item
|
|
818
801
|
* - `fluid`: always animate sibling items during a drag
|
|
819
802
|
* - `static`: always show a line placeholder during a drag, only
|
|
820
803
|
* animating sibling items on drop
|
|
@@ -922,4 +905,4 @@ type PuckAction = {
|
|
|
922
905
|
recordHistory?: boolean;
|
|
923
906
|
} & (ReorderAction | InsertAction | MoveAction | ReplaceAction | ReplaceRootAction | RemoveAction | DuplicateAction | SetAction | SetDataAction | SetUiAction | RegisterZoneAction | UnregisterZoneAction);
|
|
924
907
|
|
|
925
|
-
export { type
|
|
908
|
+
export { type OverrideKey as $, type Adaptor as A, type BaseData as B, type CacheOpts as C, type Data as D, type DropZoneProps as E, type ExternalField as F, type ExternalFieldWithAdaptor as G, type ExtractConfigParams as H, type ExtractField as I, type Field as J, type FieldMetadata as K, type FieldProps as L, type FieldRenderFunctions as M, type FieldTransformFn as N, type FieldTransformFnParams as O, type FieldTransforms as P, type Fields as Q, type History as R, type IframeConfig as S, type InitialHistory as T, type ItemSelector as U, type ItemWithId as V, type MappedItem as W, type Metadata as X, type NumberField as Y, type ObjectField as Z, type OnAction as _, type AppState as a, type Overrides as a0, type Permissions as a1, type Plugin as a2, type PluginInternal as a3, type PrivateAppState as a4, type PuckAction as a5, type PuckComponent as a6, type PuckContext as a7, type PuckMetadata as a8, type RadioField as a9, type ResolveDataTrigger as aa, type RichText as ab, type RichtextField as ac, type RootConfig as ad, type RootData as ae, type RootDataWithProps as af, type RootDataWithoutProps as ag, type SelectField as ah, type Slot as ai, type SlotComponent as aj, type SlotField as ak, type TextField as al, type TextareaField as am, type UiState as an, type UserGenerics as ao, type Viewport as ap, type Viewports as aq, type WithChildren as ar, type WithDefaultRootFieldProps as as, type WithId as at, type WithPuckProps as au, type WithSlotProps as av, overrideKeys as aw, type ArrayField as b, type ArrayState as c, type AsFieldProps as d, type BaseField as e, type ComponentConfig as f, type ComponentConfigExtensions as g, type ComponentConfigParams as h, type ComponentData as i, type ComponentDataMap as j, type ComponentDataOptionalId as k, type ComponentMetadata as l, type Config as m, type ConfigParams as n, type Content as o, type CustomField as p, type CustomFieldRender as q, type DefaultComponentProps as r, type DefaultComponents as s, type DefaultRootFieldProps as t, type DefaultRootProps as u, type DefaultRootRenderProps as v, type Direction as w, type DndBehavior as x, type DndConfig as y, type DragAxis as z };
|
|
@@ -36,10 +36,7 @@ var PuckRichText = Extension.create({
|
|
|
36
36
|
name: "puckRichText",
|
|
37
37
|
addExtensions() {
|
|
38
38
|
const extensions = [];
|
|
39
|
-
const options = __spreadValues({}, this.options);
|
|
40
|
-
if (options.textAlign !== false) {
|
|
41
|
-
options.textAlign = __spreadValues(__spreadValues({}, defaultPuckRichTextOptions.textAlign), options.textAlign);
|
|
42
|
-
}
|
|
39
|
+
const options = __spreadValues(__spreadValues({}, this.options), defaultPuckRichTextOptions);
|
|
43
40
|
if (options.bold !== false) {
|
|
44
41
|
extensions.push(Bold.configure(options.bold));
|
|
45
42
|
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
useAlignOptions
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-EHTFXUBU.mjs";
|
|
4
4
|
import {
|
|
5
5
|
useHeadingOptions
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-NBTE2AWP.mjs";
|
|
7
7
|
import {
|
|
8
8
|
useListOptions
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-PJDBGMYG.mjs";
|
|
10
10
|
import {
|
|
11
11
|
Action,
|
|
12
12
|
AlignCenter,
|
|
@@ -29,7 +29,7 @@ import {
|
|
|
29
29
|
Underline,
|
|
30
30
|
useControlContext,
|
|
31
31
|
useMessage
|
|
32
|
-
} from "./chunk-
|
|
32
|
+
} from "./chunk-XTIXX7I3.mjs";
|
|
33
33
|
import {
|
|
34
34
|
get_class_name_factory_default
|
|
35
35
|
} from "./chunk-OT7NKYY4.mjs";
|
|
@@ -204,7 +204,7 @@ function AlignSelectFallback() {
|
|
|
204
204
|
// components/RichTextMenu/controls/AlignSelect/index.tsx
|
|
205
205
|
import { jsx as jsx7 } from "react/jsx-runtime";
|
|
206
206
|
var AlignSelectLoaded = lazy(
|
|
207
|
-
() => import("./loaded-
|
|
207
|
+
() => import("./loaded-IRK2RWX3.mjs").then((m) => ({
|
|
208
208
|
default: m.AlignSelectLoaded
|
|
209
209
|
}))
|
|
210
210
|
);
|
|
@@ -445,7 +445,7 @@ function HeadingSelectFallback() {
|
|
|
445
445
|
// components/RichTextMenu/controls/HeadingSelect/index.tsx
|
|
446
446
|
import { jsx as jsx19 } from "react/jsx-runtime";
|
|
447
447
|
var HeadingSelectLoaded = lazy2(
|
|
448
|
-
() => import("./loaded-
|
|
448
|
+
() => import("./loaded-OZ2F7R6I.mjs").then((m) => ({
|
|
449
449
|
default: m.HeadingSelectLoaded
|
|
450
450
|
}))
|
|
451
451
|
);
|
|
@@ -477,7 +477,7 @@ function ListSelectFallback() {
|
|
|
477
477
|
// components/RichTextMenu/controls/ListSelect/index.tsx
|
|
478
478
|
import { jsx as jsx21 } from "react/jsx-runtime";
|
|
479
479
|
var ListSelectLoaded = lazy3(
|
|
480
|
-
() => import("./loaded-
|
|
480
|
+
() => import("./loaded-TUHXN2Y2.mjs").then((m) => ({
|
|
481
481
|
default: m.ListSelectLoaded
|
|
482
482
|
}))
|
|
483
483
|
);
|