soinproduction-gutenberg 0.1.14 → 0.1.16

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.
Files changed (60) hide show
  1. package/README.md +17 -0
  2. package/components/choice/index.tsx +1 -1
  3. package/components/heading/editor.tsx +16 -11
  4. package/components/heading/index.tsx +2 -2
  5. package/core/editor/inspector.tsx +9 -0
  6. package/core/editor/styles.css +19 -0
  7. package/core/fields/editor.tsx +30 -11
  8. package/core/fields/order.ts +11 -0
  9. package/core/fields/render.tsx +2 -2
  10. package/core/fields/schema.ts +1 -0
  11. package/core/fields/view-classes.ts +2 -0
  12. package/dist/components/background/index.d.ts +41 -1
  13. package/dist/components/button/index.d.ts +41 -1
  14. package/dist/components/buttons/index.d.ts +41 -1
  15. package/dist/components/categories/index.d.ts +41 -1
  16. package/dist/components/choice/index.d.ts +1 -0
  17. package/dist/components/choice/index.js.map +2 -2
  18. package/dist/components/forms/index.d.ts +41 -1
  19. package/dist/components/gallery/index.d.ts +41 -1
  20. package/dist/components/heading/editor.d.ts +1 -1
  21. package/dist/components/heading/editor.js +17 -12
  22. package/dist/components/heading/editor.js.map +2 -2
  23. package/dist/components/heading/index.d.ts +41 -1
  24. package/dist/components/heading/index.js +2 -2
  25. package/dist/components/heading/index.js.map +2 -2
  26. package/dist/components/icon/index.d.ts +41 -1
  27. package/dist/components/image/index.d.ts +41 -1
  28. package/dist/components/link/index.d.ts +41 -1
  29. package/dist/components/media/index.d.ts +41 -1
  30. package/dist/components/paragraphs/index.d.ts +41 -1
  31. package/dist/components/pricing-plans/index.d.ts +41 -1
  32. package/dist/components/records/index.d.ts +41 -1
  33. package/dist/components/reviews-carousel/index.d.ts +41 -1
  34. package/dist/components/slider/index.d.ts +82 -2
  35. package/dist/components/text/index.d.ts +41 -1
  36. package/dist/core/editor/inspector.d.ts +7 -0
  37. package/dist/core/editor/inspector.js +13 -0
  38. package/dist/core/editor/inspector.js.map +7 -0
  39. package/dist/core/editor/styles.css +19 -0
  40. package/dist/core/fields/editor.js +41 -19
  41. package/dist/core/fields/editor.js.map +2 -2
  42. package/dist/core/fields/order.d.ts +4 -0
  43. package/dist/core/fields/order.js +11 -0
  44. package/dist/core/fields/order.js.map +7 -0
  45. package/dist/core/fields/render.js +2 -2
  46. package/dist/core/fields/render.js.map +2 -2
  47. package/dist/core/fields/schema.d.ts +1 -0
  48. package/dist/core/fields/schema.js.map +2 -2
  49. package/dist/core/fields/view-classes.d.ts +2 -0
  50. package/dist/core/fields/view-classes.js.map +2 -2
  51. package/dist/schema/index.js +2 -1
  52. package/dist/schema/index.js.map +2 -2
  53. package/dist/shared/index.d.ts +41 -1
  54. package/dist/shared/index.js +1 -1
  55. package/dist/shared/index.js.map +2 -2
  56. package/dist/tooling/build-doc-props.mjs +11 -5
  57. package/package.json +1 -1
  58. package/schema/index.tsx +2 -2
  59. package/shared/index.tsx +1 -1
  60. package/tooling/build-doc-props.mjs +11 -5
package/README.md CHANGED
@@ -189,3 +189,20 @@ Bare numbers are pixels; explicit CSS units such as `px`, `rem`, `em` and `%` ar
189
189
  ## Plain links
190
190
 
191
191
  `<Link name="action" label="Link" icon="custom:library:arrow" className="..." />` uses the same stored `{text, url, linkId, modalId, icon}` value as `Button`, with plain link presentation in both views. Existing values and field names stay intact when replacing a Button. Caption text edits on the canvas; the link control or Ctrl/Cmd+K edits the destination, and Ctrl/Cmd+Shift+K removes it. Section classes own its appearance.
192
+
193
+ ### Settings order in the editor
194
+
195
+ Every public JSX component accepts `order?: number`. Lower values appear first inside the same Item or settings group; the default is `0`, and ties keep JSX order. Negative values are allowed. `order` does not change frontend DOM order, grid placement, stored field names or list item order. Structural components without their own settings do not add a sidebar panel.
196
+
197
+ ```tsx
198
+ <List name="cards">
199
+ <article>
200
+ <Background name="image" order={10} />
201
+ <Heading name="title" order={20} />
202
+ <Text name="description" order={30} />
203
+ <Link name="action" order={40} />
204
+ </article>
205
+ </List>
206
+ ```
207
+
208
+ The component reference includes all public JSX props, including inherited props. Its type table is regenerated from TypeScript before each documentation build. Run `node tooling/build-doc-props.mjs --check` to check it without writing files.
@@ -1,7 +1,7 @@
1
1
  'use client';
2
2
 
3
3
  export const Choice = Object.assign(
4
- (_props: { name: string; label: string; choices: Record<string, string> }) => null,
4
+ (_props: { name: string; label: string; choices: Record<string, string>; order?: number }) => null,
5
5
  {
6
6
  kind: 'choice',
7
7
  field: ({ label, choices }: any) => ({
@@ -1,18 +1,17 @@
1
1
  'use client';
2
- import {useSyncExternalStore, type KeyboardEvent} from 'react';
3
- import {onListItemFocus,selectedListItem} from '../../core/fields/item-focus.js';
2
+ import { OrderedInspectorControls } from '../../core/editor/inspector.js';
3
+ import { ChevronDown } from 'lucide-react';
4
+ import { useId, useState, type KeyboardEvent} from 'react';
4
5
  import { headingTags, headingStyles, isHeadingTag, isHeadingStyle, type HeadingSettings } from './model.js';
5
6
  declare const wp: any;
6
7
 
7
8
  export function HeadingSettingsControl(props: any) {
8
- return props.options?.itemPanel ? <SelectedHeadingSettings {...props} /> : headingSettings(props);
9
+ // A grouped row owns all its controls; canvas headings must not add sibling panels.
10
+ return props.options?.itemPanel && !props.controls ? null : <HeadingSettings {...props} />;
9
11
  }
10
- function SelectedHeadingSettings(props: any) {
11
- const selected = useSyncExternalStore(onListItemFocus, selectedListItem, () => '');
12
- return selected === props.options?.itemFocusKey ? headingSettings(props) : null;
13
- }
14
- function headingSettings({ field, value = {}, setValue, options = {} }: any) {
15
- const { InspectorControls } = wp.blockEditor;
12
+ function HeadingSettings({ field, value = {}, setValue, options = {}, controls = false }: any) {
13
+ const [open, setOpen] = useState(false);
14
+ const id = useId();
16
15
  const { PanelBody, Button } = wp.components;
17
16
  const defaults = options.defaults ?? {};
18
17
  const select = (key: keyof HeadingSettings, selected: string) => {
@@ -35,7 +34,7 @@ function headingSettings({ field, value = {}, setValue, options = {} }: any) {
35
34
  select(key, next);
36
35
  event.currentTarget.querySelector<HTMLButtonElement>(`[data-heading-value="${next}"]`)?.focus();
37
36
  };
38
- return <InspectorControls><PanelBody title={field.label ?? 'Heading'} initialOpen>
37
+ const fields = <>
39
38
  {([{key:'tag',label:'HTML tag',fallback:defaults.tag ?? 'h2'},
40
39
  {key:'textStyle',label:'Heading style',fallback:defaults.textStyle}] as const).map(({key,label,fallback}) => {
41
40
  const choices: readonly string[] = key === 'tag' ? headingTags : headingStyles;
@@ -51,5 +50,11 @@ function headingSettings({ field, value = {}, setValue, options = {} }: any) {
51
50
  </div>
52
51
  </fieldset>;
53
52
  })}
54
- </PanelBody></InspectorControls>;
53
+ </>;
54
+ return controls ? <div className="site-item-heading-settings">
55
+ <Button className="site-item-heading-toggle" aria-expanded={open} aria-controls={id} onClick={() => setOpen(current => !current)}>
56
+ <span>Heading settings</span><ChevronDown size={16} aria-hidden="true" />
57
+ </Button>
58
+ <div id={id} className="site-item-heading-content" hidden={!open}>{fields}</div>
59
+ </div> : <OrderedInspectorControls><PanelBody title={field.label ?? 'Heading'} initialOpen>{fields}</PanelBody></OrderedInspectorControls>;
55
60
  }
@@ -14,7 +14,7 @@ export function HeadingView({ name, label, level = 2, tag, textStyle, className
14
14
  return <>
15
15
  {field.edit && field.edit({
16
16
  name,
17
- field: { name, type: 'custom', control: 'heading-settings', label: label ?? field.field.label ?? 'Heading' },
17
+ field: { name, order: field.field.order, type: 'custom', control: 'heading-settings', label: label ?? field.field.label ?? 'Heading' },
18
18
  value: stored ?? {},
19
19
  setValue: (next) => scope.onChange?.(updateHeadingSettings(scope.value, name, next)),
20
20
  site: scope.site,
@@ -27,6 +27,6 @@ export function HeadingView({ name, label, level = 2, tag, textStyle, className
27
27
  /** `level` remains compatible; `tag` and `textStyle` set independent editor defaults. */
28
28
  export const Heading = kit<HeadingProps>(
29
29
  'heading',
30
- ({ label, level = 2, tag }) => ({ type: 'richText', tag: resolveHeading(undefined, { level, tag }).tag, label: label ?? 'Heading' }),
30
+ ({ label, level = 2, tag, textStyle }) => ({ type: 'richText', tag: resolveHeading(undefined, { level, tag }).tag, label: label ?? 'Heading', controlOptions: { headingDefaults: resolveHeading(undefined, { level, tag, textStyle }) } }),
31
31
  (props) => <HeadingView {...props} />
32
32
  );
@@ -0,0 +1,9 @@
1
+ import { createContext, useContext, type ReactNode } from 'react';
2
+ import { fieldOrder } from '../fields/order.js';
3
+ declare const wp: any;
4
+ export const InspectorOrderContext = createContext<number | undefined>(undefined);
5
+ /** Keep an editor-only priority out of authored DOM attributes and frontend CSS. */
6
+ export function OrderedInspectorControls({ children, order }: { children: ReactNode; order?: number }) {
7
+ const inherited = useContext(InspectorOrderContext);
8
+ return <wp.blockEditor.InspectorControls><div className="site-inspector-group" style={{order: fieldOrder(order ?? inherited)}}>{children}</div></wp.blockEditor.InspectorControls>;
9
+ }
@@ -1219,3 +1219,22 @@
1219
1219
  .site-inline-link{position:relative;}
1220
1220
  .site-inline-link:hover>.site-button-tools,.site-inline-link:focus-within>.site-button-tools{opacity:1;}
1221
1221
  .site-inline-link .block-editor-rich-text__editable{display:inline;font:inherit;line-height:inherit;color:inherit;}
1222
+
1223
+ /* Settings use one spacing system; nested WordPress margins must not add a second gap. */
1224
+ .site-field-controls { gap: 16px; }
1225
+ .site-item-field { display: grid; gap: 12px; min-width: 0; }
1226
+ .site-item-field > :is(.site-field-rich-control, .components-base-control, .site-media-setting, .site-background-settings, .site-item-field-label) { margin: 0; }
1227
+ .site-item-field .components-base-control:last-child { margin-bottom: 0; }
1228
+ .site-item-field-label { display: block; font-size: 12px; }
1229
+ .site-item-heading-settings { min-width: 0; }
1230
+ .site-item-heading-toggle.components-button { display: flex; width: 100%; height: 32px; min-height: 32px; padding: 0; justify-content: space-between; border: 0; color: #50575e; background: transparent; box-shadow: none; font-size: 12px; font-weight: 500; }
1231
+ .site-item-heading-toggle svg { flex: none; transition: transform 150ms ease; }
1232
+ .site-item-heading-toggle[aria-expanded="true"] svg { transform: rotate(180deg); }
1233
+ .site-item-heading-toggle:focus-visible { outline: 2px solid var(--wp-admin-theme-color, #3858e9); outline-offset: 2px; }
1234
+ .site-item-heading-content:not([hidden]) { display: grid; gap: 16px; padding: 12px 0 0; }
1235
+ .site-item-heading-content[hidden] { display: none !important; }
1236
+ .site-item-heading-content .site-heading-setting { margin: 0; }
1237
+ /* Inspector fills are siblings in Gutenberg; priority affects only their editor groups. */
1238
+ :has(> .site-inspector-group) { display: flex; flex-direction: column; }
1239
+ .site-inspector-group { min-width: 0; }
1240
+ @media (prefers-reduced-motion: reduce) { .site-item-heading-toggle svg { transition: none; } }
@@ -1,3 +1,6 @@
1
+ import { orderedFields } from './order.js';
2
+ import { InspectorOrderContext, OrderedInspectorControls } from '../editor/inspector.js';
3
+ import { updateHeadingSettings } from '../../components/heading/model.js';
1
4
  import { InlineLinkEditor } from '../editor/inline-link.js';
2
5
  import { ButtonIconSettings } from '../editor/button-icon-settings.js';
3
6
  import { CollectionDisplaySettings } from '../editor/collection-display.js';
@@ -42,8 +45,9 @@ function ItemSettings({ field, value, setValue, site, options }: Props) {
42
45
  useEffect(() => {
43
46
  let frame = 0;
44
47
  const reveal = (selected: string) => {
45
- if (!key || selected !== key) return;
46
- setOpen(true);
48
+ if (!key) return;
49
+ setOpen(selected === key);
50
+ if (selected !== key) return;
47
51
  cancelAnimationFrame(frame);
48
52
  frame = requestAnimationFrame(() => {
49
53
  frame = requestAnimationFrame(() => panel.current?.scrollIntoView({ behavior: 'smooth', block: 'start' }));
@@ -53,7 +57,7 @@ function ItemSettings({ field, value, setValue, site, options }: Props) {
53
57
  reveal(selectedListItem());
54
58
  return () => { unsubscribe(); cancelAnimationFrame(frame); };
55
59
  }, [key]);
56
- return <wp.blockEditor.InspectorControls><div ref={panel}
60
+ return <OrderedInspectorControls><div ref={panel}
57
61
  className={'site-item-settings' + (drop ? ' is-drop-' + drop : '') + (dragging ? ' is-dragging' : '')}
58
62
  onDragOver={event => {
59
63
  if (!options?.listKey || !event.dataTransfer.types.includes('application/x-site-list-item')) return;
@@ -87,7 +91,7 @@ function ItemSettings({ field, value, setValue, site, options }: Props) {
87
91
  <wp.components.PanelBody title={field.label} opened={open} onToggle={() => setOpen(current => !current)}>
88
92
  <FieldControls schema={field.fields ?? []} value={value} onChange={setValue} site={site} />
89
93
  </wp.components.PanelBody>
90
- </div></wp.blockEditor.InspectorControls>;
94
+ </div></OrderedInspectorControls>;
91
95
  }
92
96
 
93
97
  function MediaPicker({ value, setValue, label = 'Image' }: any) {
@@ -184,7 +188,9 @@ function LinkControls({ value = {}, setValue, site = {}, textLabel = 'Button tex
184
188
  function FieldControls({ schema, value, onChange, site }: any) {
185
189
  return (
186
190
  <div className="site-field-controls">
187
- {schema.map((field: FieldDefinition) => (
191
+ {orderedFields<FieldDefinition>(schema).map((field: FieldDefinition) => (
192
+ <div key={field.name} className="site-item-field" data-field-name={field.name}>
193
+ {['custom', 'media', 'link'].includes(field.type) && <strong className="site-item-field-label">{labelOf(field)}</strong>}
188
194
  <FieldEditor
189
195
  key={field.name}
190
196
  controls
@@ -194,6 +200,16 @@ function FieldControls({ schema, value, onChange, site }: any) {
194
200
  setValue={(next) => onChange({ ...value, [field.name]: next })}
195
201
  site={site}
196
202
  />
203
+ {Boolean(field.controlOptions?.headingDefaults) && <FieldEditor
204
+ controls
205
+ name={field.name}
206
+ field={{name: field.name, type: 'custom', control: 'heading-settings', label: labelOf(field)}}
207
+ value={value.__headings?.[field.name] ?? {}}
208
+ setValue={next => onChange(updateHeadingSettings(value, field.name, next))}
209
+ site={site}
210
+ options={{defaults: field.controlOptions?.headingDefaults}}
211
+ />}
212
+ </div>
197
213
  ))}
198
214
  </div>
199
215
  );
@@ -259,20 +275,23 @@ function CollectionControls({ field, value, setValue, site, focusRequest }: Prop
259
275
  );
260
276
  }
261
277
  function FieldEditor(props: Props) {
278
+ return <InspectorOrderContext.Provider value={props.field.order}><FieldEditorView {...props} /></InspectorOrderContext.Provider>;
279
+ }
280
+ function FieldEditorView(props: Props) {
262
281
  const scope = useFieldScope(), recordLink = useRecordLink();
263
282
  const [focusRequest, setFocusRequest] = useState<{ index: number } | null>(null);
264
283
  const { field, setValue, site, controls = false } = props;
265
284
  const value = props.value ?? emptyValues([field])[field.name],
266
285
  label = labelOf(field);
267
- const { RichText, InspectorControls } = wp.blockEditor;
286
+ const { RichText } = wp.blockEditor;
268
287
  const { TextControl, TextareaControl, ToggleControl, PanelBody, ColorPalette } = wp.components;
269
288
  const inspector = (children: any) => (
270
- <InspectorControls>
289
+ <OrderedInspectorControls>
271
290
  <PanelBody title={label}>
272
291
  {field.instructions && <p>{field.instructions}</p>}
273
292
  {children}
274
293
  </PanelBody>
275
- </InspectorControls>
294
+ </OrderedInspectorControls>
276
295
  );
277
296
  if (field.control === 'row-settings') return <ItemSettings {...props} />;
278
297
  if (field.control === 'list-display') return <CollectionDisplaySettings label={label} value={value} onChange={setValue} />;
@@ -694,9 +713,9 @@ function FieldEditor(props: Props) {
694
713
  }
695
714
  function SchemaSettings({ schema }: any) {
696
715
  const scope = useFieldScope();
697
- const fields = schema.filter((field: any) => field.settings);
716
+ const fields = orderedFields<FieldDefinition>(schema.filter((field: FieldDefinition) => field.settings));
698
717
  return fields.length ? (
699
- <wp.blockEditor.InspectorControls>
718
+ <OrderedInspectorControls>
700
719
  <wp.components.PanelBody title="Section settings">
701
720
  {fields.map((field: any) => (
702
721
  <FieldEditor
@@ -710,7 +729,7 @@ function SchemaSettings({ schema }: any) {
710
729
  />
711
730
  ))}
712
731
  </wp.components.PanelBody>
713
- </wp.blockEditor.InspectorControls>
732
+ </OrderedInspectorControls>
714
733
  ) : null;
715
734
  }
716
735
  const editField: EditField = (props) => <FieldEditor {...props} />;
@@ -0,0 +1,11 @@
1
+ import type { FieldDefinition } from './schema.js';
2
+
3
+ /** Unordered fields have priority zero; equal priorities retain markup order. */
4
+ export function fieldOrder(order: unknown): number {
5
+ return typeof order === 'number' && Number.isFinite(order) ? order : 0;
6
+ }
7
+ export function orderedFields<T extends Pick<FieldDefinition, 'order'>>(fields: readonly T[]): T[] {
8
+ return fields.map((field, index) => ({ field, index }))
9
+ .sort((a, b) => fieldOrder(a.field.order) - fieldOrder(b.field.order) || a.index - b.index)
10
+ .map(({ field }) => field);
11
+ }
@@ -336,7 +336,7 @@ export function Repeater({ name, children, className, renderRow, addText, button
336
336
  const scope = useField(name);
337
337
  const rows = Array.isArray(scope.value) ? scope.value : [];
338
338
  const grouped = Boolean(scope.field.controlOptions?.itemPanels);
339
- const settings = scope.field.fields?.filter(field => field.settings || (grouped && ['image','link'].includes(field.type))) ?? [];
339
+ const settings = scope.field.fields?.filter(field => grouped || field.settings) ?? [];
340
340
  const id=useId().replace(/[^a-zA-Z0-9_-]/g,'');
341
341
  const root=useFieldScope();
342
342
  const render=(offset:number,limit?:number) => (
@@ -364,7 +364,7 @@ export function Repeater({ name, children, className, renderRow, addText, button
364
364
  listKey: itemFocusKey, index, total: rows.length,
365
365
  onMove: (from: number, target: number) => scope.setValue(reorderListItems(rows, from, target)),
366
366
  },
367
- field: { name: scope.field.name, type: 'custom', control: 'row-settings', label: `Item ${index + 1}`, fields: settings },
367
+ field: { name: scope.field.name, order: scope.field.order, type: 'custom', control: 'row-settings', label: `Item ${index + 1}`, fields: settings },
368
368
  value: row,
369
369
  setValue: next => scope.setValue(rows.map((old: any, i: number) => i === index ? next : old)),
370
370
  site: scope.site,
@@ -22,6 +22,7 @@ export type FieldType =
22
22
  | 'content';
23
23
  export type PostType = string;
24
24
  export type FieldOptions = {
25
+ order?: number;
25
26
  label?: string;
26
27
  instructions?: string;
27
28
  placeholder?: string;
@@ -1,4 +1,6 @@
1
1
  export type ViewClasses = {
2
+ /** Sidebar priority within its settings group. Lower numbers appear first; default 0. */
3
+ order?: number;
2
4
  className?: string;
3
5
  adminClassName?: string;
4
6
  frontClassName?: string;
@@ -6,5 +6,45 @@ export declare function BackgroundView({ name, className }: {
6
6
  }): import("react").JSX.Element;
7
7
  export declare const Background: ((props: Props) => import("react").ReactNode) & {
8
8
  kind: string;
9
- field: (props: Props) => Omit<import("../../core/fields/schema.js").FieldDefinition, "name">;
9
+ field: (props: Props) => {
10
+ order?: number;
11
+ manual?: boolean | undefined;
12
+ type: import("../../core/fields/schema.js").FieldType;
13
+ defaultValue?: any;
14
+ itemType?: "string" | undefined;
15
+ label?: string | undefined;
16
+ step?: number | undefined;
17
+ max?: number | undefined;
18
+ media?: import("../../core/media/universal/model.js").MediaOptions | undefined;
19
+ min?: number | undefined;
20
+ storage?: "url" | undefined;
21
+ fields?: import("../../core/fields/schema.js").FieldDefinition[] | undefined;
22
+ area?: import("../../core/content/areas/data.js").ContentAreaDefinition | undefined;
23
+ instructions?: string | undefined;
24
+ placeholder?: string | undefined;
25
+ choices?: Record<string, string> | undefined;
26
+ postType?: import("../../core/fields/schema.js").PostType | undefined;
27
+ tag?: string | undefined;
28
+ settings?: boolean | undefined;
29
+ scaffold?: boolean | undefined;
30
+ optional?: boolean | undefined;
31
+ control?: string | undefined;
32
+ recordField?: string | undefined;
33
+ recordMeta?: string | undefined;
34
+ recordSource?: string | undefined;
35
+ collection?: string | undefined;
36
+ taxonomy?: string | undefined;
37
+ basePath?: string | null | undefined;
38
+ readOnly?: boolean | undefined;
39
+ resolveValue?: (context: {
40
+ value: any;
41
+ site: any;
42
+ record: any;
43
+ }) => any;
44
+ resolveRecords?: boolean | undefined;
45
+ fromPosts?: boolean | undefined;
46
+ excludeCurrent?: boolean | undefined;
47
+ controlOptions?: Record<string, unknown> | undefined;
48
+ elements?: any[] | undefined;
49
+ };
10
50
  };
@@ -19,5 +19,45 @@ export declare const Button: ((props: import("../../core/fields/view-classes.js"
19
19
  label?: string;
20
20
  } & {
21
21
  style?: string;
22
- }) => Omit<import("../../core/fields/schema.js").FieldDefinition, "name">;
22
+ }) => {
23
+ order?: number;
24
+ manual?: boolean | undefined;
25
+ type: import("../../core/fields/schema.js").FieldType;
26
+ defaultValue?: any;
27
+ itemType?: "string" | undefined;
28
+ label?: string | undefined;
29
+ step?: number | undefined;
30
+ max?: number | undefined;
31
+ media?: import("../../core/media/universal/model.js").MediaOptions | undefined;
32
+ min?: number | undefined;
33
+ storage?: "url" | undefined;
34
+ fields?: import("../../core/fields/schema.js").FieldDefinition[] | undefined;
35
+ area?: import("../../core/content/areas/data.js").ContentAreaDefinition | undefined;
36
+ instructions?: string | undefined;
37
+ placeholder?: string | undefined;
38
+ choices?: Record<string, string> | undefined;
39
+ postType?: import("../../core/fields/schema.js").PostType | undefined;
40
+ tag?: string | undefined;
41
+ settings?: boolean | undefined;
42
+ scaffold?: boolean | undefined;
43
+ optional?: boolean | undefined;
44
+ control?: string | undefined;
45
+ recordField?: string | undefined;
46
+ recordMeta?: string | undefined;
47
+ recordSource?: string | undefined;
48
+ collection?: string | undefined;
49
+ taxonomy?: string | undefined;
50
+ basePath?: string | null | undefined;
51
+ readOnly?: boolean | undefined;
52
+ resolveValue?: (context: {
53
+ value: any;
54
+ site: any;
55
+ record: any;
56
+ }) => any;
57
+ resolveRecords?: boolean | undefined;
58
+ fromPosts?: boolean | undefined;
59
+ excludeCurrent?: boolean | undefined;
60
+ controlOptions?: Record<string, unknown> | undefined;
61
+ elements?: any[] | undefined;
62
+ };
23
63
  };
@@ -27,5 +27,45 @@ export declare const Buttons: ((props: import("../../core/fields/view-classes.js
27
27
  } & AddButton & {
28
28
  max?: number;
29
29
  styles?: string[];
30
- }) => Omit<import("../../core/fields/schema.js").FieldDefinition, "name">;
30
+ }) => {
31
+ order?: number;
32
+ manual?: boolean | undefined;
33
+ type: import("../../core/fields/schema.js").FieldType;
34
+ defaultValue?: any;
35
+ itemType?: "string" | undefined;
36
+ label?: string | undefined;
37
+ step?: number | undefined;
38
+ max?: number | undefined;
39
+ media?: import("../../core/media/universal/model.js").MediaOptions | undefined;
40
+ min?: number | undefined;
41
+ storage?: "url" | undefined;
42
+ fields?: import("../../core/fields/schema.js").FieldDefinition[] | undefined;
43
+ area?: import("../../core/content/areas/data.js").ContentAreaDefinition | undefined;
44
+ instructions?: string | undefined;
45
+ placeholder?: string | undefined;
46
+ choices?: Record<string, string> | undefined;
47
+ postType?: import("../../core/fields/schema.js").PostType | undefined;
48
+ tag?: string | undefined;
49
+ settings?: boolean | undefined;
50
+ scaffold?: boolean | undefined;
51
+ optional?: boolean | undefined;
52
+ control?: string | undefined;
53
+ recordField?: string | undefined;
54
+ recordMeta?: string | undefined;
55
+ recordSource?: string | undefined;
56
+ collection?: string | undefined;
57
+ taxonomy?: string | undefined;
58
+ basePath?: string | null | undefined;
59
+ readOnly?: boolean | undefined;
60
+ resolveValue?: (context: {
61
+ value: any;
62
+ site: any;
63
+ record: any;
64
+ }) => any;
65
+ resolveRecords?: boolean | undefined;
66
+ fromPosts?: boolean | undefined;
67
+ excludeCurrent?: boolean | undefined;
68
+ controlOptions?: Record<string, unknown> | undefined;
69
+ elements?: any[] | undefined;
70
+ };
31
71
  };
@@ -37,5 +37,45 @@ export declare const Categories: ((props: import("../../core/fields/view-classes
37
37
  children: ReactNode;
38
38
  countField?: string;
39
39
  countClassName?: string;
40
- }) => Omit<import("../../core/fields/schema.js").FieldDefinition, "name">;
40
+ }) => {
41
+ order?: number;
42
+ manual?: boolean | undefined;
43
+ type: import("../../core/fields/schema.js").FieldType;
44
+ defaultValue?: any;
45
+ itemType?: "string" | undefined;
46
+ label?: string | undefined;
47
+ step?: number | undefined;
48
+ max?: number | undefined;
49
+ media?: import("../../core/media/universal/model.js").MediaOptions | undefined;
50
+ min?: number | undefined;
51
+ storage?: "url" | undefined;
52
+ fields?: import("../../core/fields/schema.js").FieldDefinition[] | undefined;
53
+ area?: import("../../core/content/areas/data.js").ContentAreaDefinition | undefined;
54
+ instructions?: string | undefined;
55
+ placeholder?: string | undefined;
56
+ choices?: Record<string, string> | undefined;
57
+ postType?: import("../../core/fields/schema.js").PostType | undefined;
58
+ tag?: string | undefined;
59
+ settings?: boolean | undefined;
60
+ scaffold?: boolean | undefined;
61
+ optional?: boolean | undefined;
62
+ control?: string | undefined;
63
+ recordField?: string | undefined;
64
+ recordMeta?: string | undefined;
65
+ recordSource?: string | undefined;
66
+ collection?: string | undefined;
67
+ taxonomy?: string | undefined;
68
+ basePath?: string | null | undefined;
69
+ readOnly?: boolean | undefined;
70
+ resolveValue?: (context: {
71
+ value: any;
72
+ site: any;
73
+ record: any;
74
+ }) => any;
75
+ resolveRecords?: boolean | undefined;
76
+ fromPosts?: boolean | undefined;
77
+ excludeCurrent?: boolean | undefined;
78
+ controlOptions?: Record<string, unknown> | undefined;
79
+ elements?: any[] | undefined;
80
+ };
41
81
  };
@@ -2,6 +2,7 @@ export declare const Choice: ((_props: {
2
2
  name: string;
3
3
  label: string;
4
4
  choices: Record<string, string>;
5
+ order?: number;
5
6
  }) => null) & {
6
7
  kind: string;
7
8
  field: ({ label, choices }: any) => {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../components/choice/index.tsx"],
4
- "sourcesContent": ["'use client';\n\nexport const Choice = Object.assign(\n (_props: { name: string; label: string; choices: Record<string, string> }) => null,\n {\n kind: 'choice',\n field: ({ label, choices }: any) => ({\n type: 'select' as const,\n label,\n choices,\n settings: true,\n defaultValue: Object.keys(choices)[0],\n }),\n }\n);\n"],
5
- "mappings": ";AAEO,MAAM,SAAS,OAAO;AAAA,EAC3B,CAAC,WAA6E;AAAA,EAC9E;AAAA,IACE,MAAM;AAAA,IACN,OAAO,CAAC,EAAE,OAAO,QAAQ,OAAY;AAAA,MACnC,MAAM;AAAA,MACN;AAAA,MACA;AAAA,MACA,UAAU;AAAA,MACV,cAAc,OAAO,KAAK,OAAO,EAAE,CAAC;AAAA,IACtC;AAAA,EACF;AACF;",
4
+ "sourcesContent": ["'use client';\n\nexport const Choice = Object.assign(\n (_props: { name: string; label: string; choices: Record<string, string>; order?: number }) => null,\n {\n kind: 'choice',\n field: ({ label, choices }: any) => ({\n type: 'select' as const,\n label,\n choices,\n settings: true,\n defaultValue: Object.keys(choices)[0],\n }),\n }\n);\n"],
5
+ "mappings": ";AAEO,MAAM,SAAS,OAAO;AAAA,EAC3B,CAAC,WAA6F;AAAA,EAC9F;AAAA,IACE,MAAM;AAAA,IACN,OAAO,CAAC,EAAE,OAAO,QAAQ,OAAY;AAAA,MACnC,MAAM;AAAA,MACN;AAAA,MACA;AAAA,MACA,UAAU;AAAA,MACV,cAAc,OAAO,KAAK,OAAO,EAAE,CAAC;AAAA,IACtC;AAAA,EACF;AACF;",
6
6
  "names": []
7
7
  }
@@ -2,5 +2,45 @@ import { Props } from '../../shared/index.js';
2
2
  /** A published form chosen in the sidebar. */
3
3
  export declare const Form: ((props: Props) => import("react").ReactNode) & {
4
4
  kind: string;
5
- field: (props: Props) => Omit<import("../../core/fields/schema.js").FieldDefinition, "name">;
5
+ field: (props: Props) => {
6
+ order?: number;
7
+ manual?: boolean | undefined;
8
+ type: import("../../core/fields/schema.js").FieldType;
9
+ defaultValue?: any;
10
+ itemType?: "string" | undefined;
11
+ label?: string | undefined;
12
+ step?: number | undefined;
13
+ max?: number | undefined;
14
+ media?: import("../../core/media/universal/model.js").MediaOptions | undefined;
15
+ min?: number | undefined;
16
+ storage?: "url" | undefined;
17
+ fields?: import("../../core/fields/schema.js").FieldDefinition[] | undefined;
18
+ area?: import("../../core/content/areas/data.js").ContentAreaDefinition | undefined;
19
+ instructions?: string | undefined;
20
+ placeholder?: string | undefined;
21
+ choices?: Record<string, string> | undefined;
22
+ postType?: import("../../core/fields/schema.js").PostType | undefined;
23
+ tag?: string | undefined;
24
+ settings?: boolean | undefined;
25
+ scaffold?: boolean | undefined;
26
+ optional?: boolean | undefined;
27
+ control?: string | undefined;
28
+ recordField?: string | undefined;
29
+ recordMeta?: string | undefined;
30
+ recordSource?: string | undefined;
31
+ collection?: string | undefined;
32
+ taxonomy?: string | undefined;
33
+ basePath?: string | null | undefined;
34
+ readOnly?: boolean | undefined;
35
+ resolveValue?: (context: {
36
+ value: any;
37
+ site: any;
38
+ record: any;
39
+ }) => any;
40
+ resolveRecords?: boolean | undefined;
41
+ fromPosts?: boolean | undefined;
42
+ excludeCurrent?: boolean | undefined;
43
+ controlOptions?: Record<string, unknown> | undefined;
44
+ elements?: any[] | undefined;
45
+ };
6
46
  };
@@ -14,5 +14,45 @@ export declare const Gallery: ((props: import("../../core/fields/view-classes.js
14
14
  label?: string;
15
15
  } & {
16
16
  max?: number;
17
- }) => Omit<import("../../core/fields/schema.js").FieldDefinition, "name">;
17
+ }) => {
18
+ order?: number;
19
+ manual?: boolean | undefined;
20
+ type: import("../../core/fields/schema.js").FieldType;
21
+ defaultValue?: any;
22
+ itemType?: "string" | undefined;
23
+ label?: string | undefined;
24
+ step?: number | undefined;
25
+ max?: number | undefined;
26
+ media?: import("../../core/media/universal/model.js").MediaOptions | undefined;
27
+ min?: number | undefined;
28
+ storage?: "url" | undefined;
29
+ fields?: import("../../core/fields/schema.js").FieldDefinition[] | undefined;
30
+ area?: import("../../core/content/areas/data.js").ContentAreaDefinition | undefined;
31
+ instructions?: string | undefined;
32
+ placeholder?: string | undefined;
33
+ choices?: Record<string, string> | undefined;
34
+ postType?: import("../../core/fields/schema.js").PostType | undefined;
35
+ tag?: string | undefined;
36
+ settings?: boolean | undefined;
37
+ scaffold?: boolean | undefined;
38
+ optional?: boolean | undefined;
39
+ control?: string | undefined;
40
+ recordField?: string | undefined;
41
+ recordMeta?: string | undefined;
42
+ recordSource?: string | undefined;
43
+ collection?: string | undefined;
44
+ taxonomy?: string | undefined;
45
+ basePath?: string | null | undefined;
46
+ readOnly?: boolean | undefined;
47
+ resolveValue?: (context: {
48
+ value: any;
49
+ site: any;
50
+ record: any;
51
+ }) => any;
52
+ resolveRecords?: boolean | undefined;
53
+ fromPosts?: boolean | undefined;
54
+ excludeCurrent?: boolean | undefined;
55
+ controlOptions?: Record<string, unknown> | undefined;
56
+ elements?: any[] | undefined;
57
+ };
18
58
  };
@@ -1 +1 @@
1
- export declare function HeadingSettingsControl(props: any): import("react").JSX.Element;
1
+ export declare function HeadingSettingsControl(props: any): import("react").JSX.Element | null;