@pixpilot/formily-shadcn 2.0.4 → 2.2.0

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 (38) hide show
  1. package/dist/components/array-dialog/EditDialog.cjs +1 -1
  2. package/dist/components/array-dialog/EditDialog.js +2 -2
  3. package/dist/components/array-drawer/EditDrawer.cjs +1 -1
  4. package/dist/components/array-drawer/EditDrawer.js +2 -2
  5. package/dist/components/array-popover/Popover.cjs +1 -1
  6. package/dist/components/array-popover/Popover.js +1 -1
  7. package/dist/components/array-toggle-group/ArrayToggleGroup.d.ts +2 -2
  8. package/dist/components/column/Column.d.ts +2 -2
  9. package/dist/components/date-picker/DatePicker.d.cts +3 -3
  10. package/dist/components/dialog-item/BaseDialogItem.cjs +1 -2
  11. package/dist/components/dialog-item/BaseDialogItem.js +1 -2
  12. package/dist/components/dialog-item/ConnectedDialogItem.d.cts +4 -4
  13. package/dist/components/drawer-item/BaseDrawerItem.cjs +1 -2
  14. package/dist/components/drawer-item/BaseDrawerItem.js +1 -2
  15. package/dist/components/drawer-item/ConnectedDrawerItem.d.cts +4 -4
  16. package/dist/components/form/Form.d.cts +2 -2
  17. package/dist/components/form/Form.d.ts +2 -2
  18. package/dist/components/form/mcp.js +38 -1
  19. package/dist/components/form-grid/FormGrid.d.cts +2 -2
  20. package/dist/components/form-grid/FormGrid.d.ts +2 -2
  21. package/dist/components/popover-item/BasePopoverItem.cjs +3 -2
  22. package/dist/components/popover-item/BasePopoverItem.js +8 -8
  23. package/dist/components/radio/Radio.d.cts +2 -2
  24. package/dist/components/radio/Radio.d.ts +2 -2
  25. package/dist/components/rich-text-editor/mcp.js +53 -8
  26. package/dist/components/row/Row.d.cts +2 -2
  27. package/dist/components/row/Row.d.ts +2 -2
  28. package/dist/components/schema-field/schema-field-basics.d.cts +380 -380
  29. package/dist/components/schema-field/schema-field-basics.d.ts +380 -380
  30. package/dist/components/schema-field/schema-field-extended.d.cts +534 -534
  31. package/dist/components/schema-field/schema-field-extended.d.ts +534 -534
  32. package/dist/components/schema-field/schema-field.d.cts +467 -467
  33. package/dist/components/schema-field/schema-field.d.ts +467 -467
  34. package/dist/{components/array-common → shadcn-ui/src/shake-styles}/ShakeStyles.cjs +2 -2
  35. package/dist/{components/array-common → shadcn-ui/src/shake-styles}/ShakeStyles.js +1 -1
  36. package/dist/utils/transform-schema.cjs +26 -6
  37. package/dist/utils/transform-schema.js +26 -6
  38. package/package.json +7 -6
@@ -1,7 +1,7 @@
1
1
  const require_rolldown_runtime = require('../../_virtual/rolldown_runtime.cjs');
2
2
  const require_use_form_context = require('../../hooks/use-form-context.cjs');
3
3
  const require_ArrayItemDraftFields = require('../array-common/ArrayItemDraftFields.cjs');
4
- const require_ShakeStyles = require('../array-common/ShakeStyles.cjs');
4
+ const require_ShakeStyles = require('../../shadcn-ui/src/shake-styles/ShakeStyles.cjs');
5
5
  const require_use_array_item_edit_state = require('../array-common/use-array-item-edit-state.cjs');
6
6
  let __formily_react = require("@formily/react");
7
7
  __formily_react = require_rolldown_runtime.__toESM(__formily_react);
@@ -1,6 +1,6 @@
1
1
  import { useFormContext } from "../../hooks/use-form-context.js";
2
2
  import { ArrayItemDraftFields } from "../array-common/ArrayItemDraftFields.js";
3
- import { ShakeStyles } from "../array-common/ShakeStyles.js";
3
+ import { ShakeStyles as ShakeStyles$1 } from "../../shadcn-ui/src/shake-styles/ShakeStyles.js";
4
4
  import { useArrayItemEditState } from "../array-common/use-array-item-edit-state.js";
5
5
  import { observer } from "@formily/react";
6
6
  import React from "react";
@@ -84,7 +84,7 @@ const EditDialog = observer(({ schema, onSave, onAutoSave: _onAutoSave, onCancel
84
84
  validateAndClose();
85
85
  },
86
86
  children: [
87
- /* @__PURE__ */ jsx(ShakeStyles, {}),
87
+ /* @__PURE__ */ jsx(ShakeStyles$1, {}),
88
88
  /* @__PURE__ */ jsxs(DialogHeader, { children: [/* @__PURE__ */ jsx(DialogTitle, { children: title }), /* @__PURE__ */ jsx(DialogDescription, { children: description })] }),
89
89
  itemIndex != null && /* @__PURE__ */ jsx(ArrayItemDraftFields, {
90
90
  as: DialogBody,
@@ -1,7 +1,7 @@
1
1
  const require_rolldown_runtime = require('../../_virtual/rolldown_runtime.cjs');
2
2
  const require_use_form_context = require('../../hooks/use-form-context.cjs');
3
3
  const require_ArrayItemDraftFields = require('../array-common/ArrayItemDraftFields.cjs');
4
- const require_ShakeStyles = require('../array-common/ShakeStyles.cjs');
4
+ const require_ShakeStyles = require('../../shadcn-ui/src/shake-styles/ShakeStyles.cjs');
5
5
  const require_use_array_item_edit_state = require('../array-common/use-array-item-edit-state.cjs');
6
6
  let __formily_react = require("@formily/react");
7
7
  __formily_react = require_rolldown_runtime.__toESM(__formily_react);
@@ -1,6 +1,6 @@
1
1
  import { useFormContext } from "../../hooks/use-form-context.js";
2
2
  import { ArrayItemDraftFields } from "../array-common/ArrayItemDraftFields.js";
3
- import { ShakeStyles } from "../array-common/ShakeStyles.js";
3
+ import { ShakeStyles as ShakeStyles$1 } from "../../shadcn-ui/src/shake-styles/ShakeStyles.js";
4
4
  import { useArrayItemEditState } from "../array-common/use-array-item-edit-state.js";
5
5
  import { observer } from "@formily/react";
6
6
  import React from "react";
@@ -85,7 +85,7 @@ const EditDrawer = observer(({ schema, onSave, onAutoSave: _onAutoSave, onCancel
85
85
  validateAndClose();
86
86
  },
87
87
  children: [
88
- /* @__PURE__ */ jsx(ShakeStyles, {}),
88
+ /* @__PURE__ */ jsx(ShakeStyles$1, {}),
89
89
  /* @__PURE__ */ jsxs(DrawerHeader, { children: [/* @__PURE__ */ jsx(DrawerTitle, { children: title }), /* @__PURE__ */ jsx(DrawerDescription, { children: description })] }),
90
90
  itemIndex != null && /* @__PURE__ */ jsx(ArrayItemDraftFields, {
91
91
  as: DrawerBody,
@@ -1,7 +1,7 @@
1
1
  const require_rolldown_runtime = require('../../_virtual/rolldown_runtime.cjs');
2
2
  const require_use_form_context = require('../../hooks/use-form-context.cjs');
3
3
  const require_ArrayItemDraftFields = require('../array-common/ArrayItemDraftFields.cjs');
4
- const require_ShakeStyles = require('../array-common/ShakeStyles.cjs');
4
+ const require_ShakeStyles = require('../../shadcn-ui/src/shake-styles/ShakeStyles.cjs');
5
5
  const require_use_array_item_edit_state = require('../array-common/use-array-item-edit-state.cjs');
6
6
  let __formily_react = require("@formily/react");
7
7
  __formily_react = require_rolldown_runtime.__toESM(__formily_react);
@@ -1,6 +1,6 @@
1
1
  import { useFormContext } from "../../hooks/use-form-context.js";
2
2
  import { ArrayItemDraftFields } from "../array-common/ArrayItemDraftFields.js";
3
- import { ShakeStyles } from "../array-common/ShakeStyles.js";
3
+ import { ShakeStyles } from "../../shadcn-ui/src/shake-styles/ShakeStyles.js";
4
4
  import { useArrayItemEditState } from "../array-common/use-array-item-edit-state.js";
5
5
  import { observer } from "@formily/react";
6
6
  import React from "react";
@@ -1,4 +1,4 @@
1
- import * as _formily_react0 from "@formily/react";
1
+ import * as _formily_react102 from "@formily/react";
2
2
  import React from "react";
3
3
  import { ToggleGroupProps } from "@pixpilot/shadcn-ui";
4
4
 
@@ -60,6 +60,6 @@ interface ArrayToggleGroupProps extends Omit<ToggleGroupProps, 'value' | 'onChan
60
60
  * };
61
61
  * ```
62
62
  */
63
- declare const ArrayToggleGroup: React.MemoExoticComponent<_formily_react0.ReactFC<Omit<ArrayToggleGroupProps, "ref">>>;
63
+ declare const ArrayToggleGroup: React.MemoExoticComponent<_formily_react102.ReactFC<Omit<ArrayToggleGroupProps, "ref">>>;
64
64
  //#endregion
65
65
  export { ArrayToggleGroup, ArrayToggleGroupProps };
@@ -1,5 +1,5 @@
1
1
  import React from "react";
2
- import * as react_jsx_runtime0 from "react/jsx-runtime";
2
+ import * as react_jsx_runtime3 from "react/jsx-runtime";
3
3
 
4
4
  //#region src/components/column/Column.d.ts
5
5
  interface IColumnProps {
@@ -36,6 +36,6 @@ interface IColumnProps {
36
36
  declare function Column({
37
37
  className,
38
38
  children
39
- }: IColumnProps): react_jsx_runtime0.JSX.Element;
39
+ }: IColumnProps): react_jsx_runtime3.JSX.Element;
40
40
  //#endregion
41
41
  export { Column, IColumnProps };
@@ -1,12 +1,12 @@
1
- import * as react2 from "react";
1
+ import * as react0 from "react";
2
2
  import { DatePickerProps } from "@pixpilot/shadcn-ui";
3
3
 
4
4
  //#region src/components/date-picker/DatePicker.d.ts
5
5
 
6
- declare const DatePicker: react2.ForwardRefExoticComponent<Partial<{
6
+ declare const DatePicker: react0.ForwardRefExoticComponent<Partial<{
7
7
  value?: Date;
8
8
  onChange?: (date: Date | undefined) => void;
9
9
  placeholder?: string;
10
- } & Omit<DatePickerProps, "onSelect" | "selected" | "mode">> & react2.RefAttributes<unknown>>;
10
+ } & Omit<DatePickerProps, "onSelect" | "selected" | "mode">> & react0.RefAttributes<unknown>>;
11
11
  //#endregion
12
12
  export { DatePicker };
@@ -1,5 +1,4 @@
1
1
  const require_rolldown_runtime = require('../../_virtual/rolldown_runtime.cjs');
2
- const require_ShakeStyles = require('../array-common/ShakeStyles.cjs');
3
2
  const require_BaseFormItem = require('../form-item/BaseFormItem.cjs');
4
3
  const require_OverlayFields = require('../overlay-common/OverlayFields.cjs');
5
4
  const require_OverlayTrigger = require('../overlay-common/OverlayTrigger.cjs');
@@ -72,7 +71,7 @@ const BaseDialogItem = ({ children, label, description, trigger: triggerProp, op
72
71
  requestClose();
73
72
  },
74
73
  children: [
75
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_ShakeStyles.ShakeStyles, {}),
74
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__pixpilot_shadcn_ui.ShakeStyles, {}),
76
75
  /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(__pixpilot_shadcn_ui.DialogHeader, {
77
76
  ...slots?.header,
78
77
  children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(__pixpilot_shadcn_ui.DialogTitle, {
@@ -1,10 +1,9 @@
1
- import { ShakeStyles } from "../array-common/ShakeStyles.js";
2
1
  import { BaseFormItem } from "../form-item/BaseFormItem.js";
3
2
  import { OverlayFields } from "../overlay-common/OverlayFields.js";
4
3
  import { OverlayTrigger } from "../overlay-common/OverlayTrigger.js";
5
4
  import { useOverlay } from "../overlay-common/use-overlay.js";
6
5
  import React from "react";
7
- import { Button, Dialog, DialogBody, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, DialogTrigger } from "@pixpilot/shadcn-ui";
6
+ import { Button, Dialog, DialogBody, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, DialogTrigger, ShakeStyles } from "@pixpilot/shadcn-ui";
8
7
  import { jsx, jsxs } from "react/jsx-runtime";
9
8
  import { cn as cn$1 } from "@pixpilot/shadcn";
10
9
 
@@ -1,5 +1,5 @@
1
1
  import { DialogItemProps } from "./BaseDialogItem.cjs";
2
- import * as react4 from "react";
2
+ import * as react1 from "react";
3
3
 
4
4
  //#region src/components/dialog-item/ConnectedDialogItem.d.ts
5
5
 
@@ -8,8 +8,8 @@ import * as react4 from "react";
8
8
  * Maps field label, description, and validation state onto the decorator the
9
9
  * same way FormItem does.
10
10
  */
11
- declare const DialogItem: react4.ForwardRefExoticComponent<Omit<Partial<DialogItemProps & {
12
- children?: react4.ReactNode | undefined;
13
- }>, "ref"> & react4.RefAttributes<unknown>>;
11
+ declare const DialogItem: react1.ForwardRefExoticComponent<Omit<Partial<DialogItemProps & {
12
+ children?: react1.ReactNode | undefined;
13
+ }>, "ref"> & react1.RefAttributes<unknown>>;
14
14
  //#endregion
15
15
  export { DialogItem };
@@ -1,5 +1,4 @@
1
1
  const require_rolldown_runtime = require('../../_virtual/rolldown_runtime.cjs');
2
- const require_ShakeStyles = require('../array-common/ShakeStyles.cjs');
3
2
  const require_BaseFormItem = require('../form-item/BaseFormItem.cjs');
4
3
  const require_OverlayFields = require('../overlay-common/OverlayFields.cjs');
5
4
  const require_OverlayTrigger = require('../overlay-common/OverlayTrigger.cjs');
@@ -73,7 +72,7 @@ const BaseDrawerItem = ({ children, label, description, trigger: triggerProp, op
73
72
  requestClose();
74
73
  },
75
74
  children: [
76
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_ShakeStyles.ShakeStyles, {}),
75
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__pixpilot_shadcn_ui.ShakeStyles, {}),
77
76
  /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(__pixpilot_shadcn_ui.DrawerHeader, {
78
77
  ...slots?.header,
79
78
  children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(__pixpilot_shadcn_ui.DrawerTitle, {
@@ -1,10 +1,9 @@
1
- import { ShakeStyles } from "../array-common/ShakeStyles.js";
2
1
  import { BaseFormItem } from "../form-item/BaseFormItem.js";
3
2
  import { OverlayFields } from "../overlay-common/OverlayFields.js";
4
3
  import { OverlayTrigger } from "../overlay-common/OverlayTrigger.js";
5
4
  import { useOverlay } from "../overlay-common/use-overlay.js";
6
5
  import React from "react";
7
- import { Button, Drawer, DrawerBody, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerTitle, DrawerTrigger } from "@pixpilot/shadcn-ui";
6
+ import { Button, Drawer, DrawerBody, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerTitle, DrawerTrigger, ShakeStyles } from "@pixpilot/shadcn-ui";
8
7
  import { jsx, jsxs } from "react/jsx-runtime";
9
8
  import { cn as cn$1 } from "@pixpilot/shadcn";
10
9
 
@@ -1,5 +1,5 @@
1
1
  import { DrawerItemProps } from "./BaseDrawerItem.cjs";
2
- import * as react0 from "react";
2
+ import * as react4 from "react";
3
3
 
4
4
  //#region src/components/drawer-item/ConnectedDrawerItem.d.ts
5
5
 
@@ -8,8 +8,8 @@ import * as react0 from "react";
8
8
  * Maps field label, description, and validation state onto the decorator the
9
9
  * same way FormItem does.
10
10
  */
11
- declare const DrawerItem: react0.ForwardRefExoticComponent<Omit<Partial<DrawerItemProps & {
12
- children?: react0.ReactNode | undefined;
13
- }>, "ref"> & react0.RefAttributes<unknown>>;
11
+ declare const DrawerItem: react4.ForwardRefExoticComponent<Omit<Partial<DrawerItemProps & {
12
+ children?: react4.ReactNode | undefined;
13
+ }>, "ref"> & react4.RefAttributes<unknown>>;
14
14
  //#endregion
15
15
  export { DrawerItem };
@@ -2,7 +2,7 @@ import { FormContextStates } from "../context/form-context.cjs";
2
2
  import "../context/index.cjs";
3
3
  import React from "react";
4
4
  import { Form } from "@formily/core";
5
- import * as react_jsx_runtime3 from "react/jsx-runtime";
5
+ import * as react_jsx_runtime0 from "react/jsx-runtime";
6
6
 
7
7
  //#region src/components/form/Form.d.ts
8
8
  interface IFormProps extends FormContextStates {
@@ -27,6 +27,6 @@ declare function Form$1({
27
27
  onAutoSubmit,
28
28
  layout,
29
29
  settings
30
- }: IFormProps): react_jsx_runtime3.JSX.Element;
30
+ }: IFormProps): react_jsx_runtime0.JSX.Element;
31
31
  //#endregion
32
32
  export { Form$1 as Form, IFormProps };
@@ -1,7 +1,7 @@
1
1
  import { FormContextStates } from "../context/form-context.js";
2
2
  import "../context/index.js";
3
3
  import React from "react";
4
- import * as react_jsx_runtime1 from "react/jsx-runtime";
4
+ import * as react_jsx_runtime2 from "react/jsx-runtime";
5
5
  import { Form } from "@formily/core";
6
6
 
7
7
  //#region src/components/form/Form.d.ts
@@ -27,6 +27,6 @@ declare function Form$1({
27
27
  onAutoSubmit,
28
28
  layout,
29
29
  settings
30
- }: IFormProps): react_jsx_runtime1.JSX.Element;
30
+ }: IFormProps): react_jsx_runtime2.JSX.Element;
31
31
  //#endregion
32
32
  export { Form$1 as Form, IFormProps };
@@ -14,11 +14,48 @@ const meta = {
14
14
  },
15
15
  layout: "Optional layout configuration passed through the Formily shadcn form context.",
16
16
  onAutoSubmit: "Called with submitted values after the underlying Formily form submit succeeds.",
17
- settings: "Optional form settings passed through the Formily shadcn form context."
17
+ settings: "Optional form-wide settings passed through the Formily shadcn form context. Each key holds default props applied to every instance of that component in the form (field-level x-component-props still override them). Notably `settings.richTextEditor` accepts the full RichTextEditorProps, so you can register TipTap `extensions` (and their toolbar buttons) once for all RichTextEditor fields. See the \"RichTextEditor extensions via form settings\" example."
18
18
  }),
19
19
  examples: [{
20
20
  title: "Basic Formily form",
21
21
  code: "<Form form={form} onSubmit={(values) => save(values)}><SchemaField schema={schema} /></Form>"
22
+ }, {
23
+ title: "RichTextEditor extensions via form settings",
24
+ code: `import { Mark, mergeAttributes } from '@tiptap/core';
25
+
26
+ // Register a custom TipTap extension (or an official package like
27
+ // @tiptap/extension-highlight) once for every RichTextEditor field in the form.
28
+ const Highlight = Mark.create({
29
+ name: 'highlight',
30
+ parseHTML() {
31
+ return [{ tag: 'mark' }];
32
+ },
33
+ renderHTML({ HTMLAttributes }) {
34
+ return ['mark', mergeAttributes(HTMLAttributes), 0];
35
+ },
36
+ });
37
+
38
+ <Form
39
+ form={form}
40
+ settings={{
41
+ richTextEditor: {
42
+ extensions: [Highlight],
43
+ toolbarItems: [
44
+ 'bold',
45
+ 'italic',
46
+ '|',
47
+ {
48
+ icon: '🖍️',
49
+ tooltip: 'Highlight',
50
+ onClick: (editor) => editor.chain().focus().toggleMark('highlight').run(),
51
+ isActive: (editor) => editor.isActive('highlight'),
52
+ },
53
+ ],
54
+ },
55
+ }}
56
+ >
57
+ <SchemaField schema={schema} />
58
+ </Form>`
22
59
  }],
23
60
  keywords: [
24
61
  "formily",
@@ -1,5 +1,5 @@
1
1
  import React from "react";
2
- import * as react_jsx_runtime0 from "react/jsx-runtime";
2
+ import * as react_jsx_runtime1 from "react/jsx-runtime";
3
3
 
4
4
  //#region src/components/form-grid/FormGrid.d.ts
5
5
  interface IFormGridProps extends React.HTMLAttributes<HTMLDivElement> {}
@@ -7,6 +7,6 @@ declare function FormGrid({
7
7
  className,
8
8
  children,
9
9
  ...rest
10
- }: IFormGridProps): react_jsx_runtime0.JSX.Element;
10
+ }: IFormGridProps): react_jsx_runtime1.JSX.Element;
11
11
  //#endregion
12
12
  export { FormGrid, IFormGridProps };
@@ -1,5 +1,5 @@
1
1
  import React from "react";
2
- import * as react_jsx_runtime0 from "react/jsx-runtime";
2
+ import * as react_jsx_runtime1 from "react/jsx-runtime";
3
3
 
4
4
  //#region src/components/form-grid/FormGrid.d.ts
5
5
  interface IFormGridProps extends React.HTMLAttributes<HTMLDivElement> {}
@@ -7,6 +7,6 @@ declare function FormGrid({
7
7
  className,
8
8
  children,
9
9
  ...rest
10
- }: IFormGridProps): react_jsx_runtime0.JSX.Element;
10
+ }: IFormGridProps): react_jsx_runtime1.JSX.Element;
11
11
  //#endregion
12
12
  export { FormGrid, IFormGridProps };
@@ -1,11 +1,12 @@
1
1
  const require_rolldown_runtime = require('../../_virtual/rolldown_runtime.cjs');
2
- const require_ShakeStyles = require('../array-common/ShakeStyles.cjs');
3
2
  const require_BaseFormItem = require('../form-item/BaseFormItem.cjs');
4
3
  const require_OverlayFields = require('../overlay-common/OverlayFields.cjs');
5
4
  const require_OverlayTrigger = require('../overlay-common/OverlayTrigger.cjs');
6
5
  const require_use_overlay = require('../overlay-common/use-overlay.cjs');
7
6
  let react = require("react");
8
7
  react = require_rolldown_runtime.__toESM(react);
8
+ let __pixpilot_shadcn_ui = require("@pixpilot/shadcn-ui");
9
+ __pixpilot_shadcn_ui = require_rolldown_runtime.__toESM(__pixpilot_shadcn_ui);
9
10
  let react_jsx_runtime = require("react/jsx-runtime");
10
11
  react_jsx_runtime = require_rolldown_runtime.__toESM(react_jsx_runtime);
11
12
  let __pixpilot_shadcn = require("@pixpilot/shadcn");
@@ -72,7 +73,7 @@ const BasePopoverItem = ({ children, label, description, trigger: triggerProp, o
72
73
  requestClose();
73
74
  },
74
75
  children: [
75
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_ShakeStyles.ShakeStyles, {}),
76
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__pixpilot_shadcn_ui.ShakeStyles, {}),
76
77
  hasHeader && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
77
78
  ...slots?.header,
78
79
  className: (0, __pixpilot_shadcn.cn)("space-y-1 pb-3", slots?.header?.className),
@@ -1,11 +1,11 @@
1
- import { ShakeStyles } from "../array-common/ShakeStyles.js";
2
1
  import { BaseFormItem } from "../form-item/BaseFormItem.js";
3
2
  import { OverlayFields } from "../overlay-common/OverlayFields.js";
4
3
  import { OverlayTrigger } from "../overlay-common/OverlayTrigger.js";
5
4
  import { useOverlay } from "../overlay-common/use-overlay.js";
6
5
  import React from "react";
6
+ import { ShakeStyles } from "@pixpilot/shadcn-ui";
7
7
  import { jsx, jsxs } from "react/jsx-runtime";
8
- import { Popover, PopoverContent, PopoverTrigger, cn } from "@pixpilot/shadcn";
8
+ import { Popover, PopoverContent, PopoverTrigger, cn as cn$1 } from "@pixpilot/shadcn";
9
9
 
10
10
  //#region src/components/popover-item/BasePopoverItem.tsx
11
11
  /**
@@ -54,7 +54,7 @@ const BasePopoverItem = ({ children, label, description, trigger: triggerProp, o
54
54
  /* @__PURE__ */ jsxs(PopoverContent, {
55
55
  align: "start",
56
56
  ...slots?.content,
57
- className: cn("w-(--radix-popover-trigger-width) min-w-72", shouldShake && "pp-shake", slots?.content?.className),
57
+ className: cn$1("w-(--radix-popover-trigger-width) min-w-72", shouldShake && "pp-shake", slots?.content?.className),
58
58
  onInteractOutside: (event) => {
59
59
  slots?.content?.onInteractOutside?.(event);
60
60
  if (event.defaultPrevented) return;
@@ -71,22 +71,22 @@ const BasePopoverItem = ({ children, label, description, trigger: triggerProp, o
71
71
  /* @__PURE__ */ jsx(ShakeStyles, {}),
72
72
  hasHeader && /* @__PURE__ */ jsxs("div", {
73
73
  ...slots?.header,
74
- className: cn("space-y-1 pb-3", slots?.header?.className),
74
+ className: cn$1("space-y-1 pb-3", slots?.header?.className),
75
75
  children: [title != null && /* @__PURE__ */ jsx("h4", {
76
76
  ...slots?.title,
77
- className: cn("font-medium leading-none", slots?.title?.className),
77
+ className: cn$1("font-medium leading-none", slots?.title?.className),
78
78
  children: title
79
79
  }), overlayDescription != null && /* @__PURE__ */ jsx("p", {
80
80
  ...slots?.description,
81
- className: cn("text-muted-foreground text-sm", slots?.description?.className),
81
+ className: cn$1("text-muted-foreground text-sm", slots?.description?.className),
82
82
  children: overlayDescription
83
83
  })]
84
84
  }),
85
85
  open && /* @__PURE__ */ jsxs("div", {
86
86
  ...slots?.body,
87
- className: cn("grid", gapClass, slots?.body?.className),
87
+ className: cn$1("grid", gapClass, slots?.body?.className),
88
88
  children: [children, feedbackText != null && feedbackText !== "" && /* @__PURE__ */ jsx("p", {
89
- className: cn("text-[0.8rem]", feedbackStatus === "error" && "text-destructive font-medium", feedbackStatus === "warning" && "text-amber-600", feedbackStatus === "success" && "text-green-600"),
89
+ className: cn$1("text-[0.8rem]", feedbackStatus === "error" && "text-destructive font-medium", feedbackStatus === "warning" && "text-amber-600", feedbackStatus === "success" && "text-green-600"),
90
90
  children: feedbackText
91
91
  })]
92
92
  })
@@ -1,5 +1,5 @@
1
1
  import { ComponentProps, FC } from "react";
2
- import * as react_jsx_runtime1 from "react/jsx-runtime";
2
+ import * as react_jsx_runtime2 from "react/jsx-runtime";
3
3
  import { RadioGroup } from "@pixpilot/shadcn";
4
4
 
5
5
  //#region src/components/radio/Radio.d.ts
@@ -15,7 +15,7 @@ type RadioProps = {
15
15
  /**
16
16
  * Radio component with options rendering
17
17
  */
18
- declare function Radio(props: RadioProps): react_jsx_runtime1.JSX.Element;
18
+ declare function Radio(props: RadioProps): react_jsx_runtime2.JSX.Element;
19
19
  declare namespace Radio {
20
20
  var displayName: string;
21
21
  }
@@ -1,5 +1,5 @@
1
1
  import { ComponentProps, FC } from "react";
2
- import * as react_jsx_runtime2 from "react/jsx-runtime";
2
+ import * as react_jsx_runtime0 from "react/jsx-runtime";
3
3
  import { RadioGroup } from "@pixpilot/shadcn";
4
4
 
5
5
  //#region src/components/radio/Radio.d.ts
@@ -15,7 +15,7 @@ type RadioProps = {
15
15
  /**
16
16
  * Radio component with options rendering
17
17
  */
18
- declare function Radio(props: RadioProps): react_jsx_runtime2.JSX.Element;
18
+ declare function Radio(props: RadioProps): react_jsx_runtime0.JSX.Element;
19
19
  declare namespace Radio {
20
20
  var displayName: string;
21
21
  }
@@ -11,7 +11,7 @@ const meta = {
11
11
  editable: "Forwarded to the underlying UI component.",
12
12
  editorProps: "Forwarded to the underlying UI component.",
13
13
  immediatelyRender: "Forwarded to the underlying UI component.",
14
- extensions: "Forwarded to the underlying UI component.",
14
+ extensions: "Additional TipTap extensions forwarded to the underlying UI component, appended to the built-in ones (StarterKit, Link, TextAlign, Placeholder). Accepts any TipTap Extension, Node, or Mark. In schema forms pass them via `x-component-props.extensions`. See the \"Add a custom extension\" example.",
15
15
  slots: "Slot props for customizing internal rendered parts.",
16
16
  showToolbar: "Forwarded to the underlying UI component.",
17
17
  toolbarItems: "Forwarded to the underlying UI component.",
@@ -20,12 +20,14 @@ const meta = {
20
20
  allowLinkTarget: "Forwarded to the underlying UI component.",
21
21
  openOnClick: "Forwarded to the underlying UI component."
22
22
  }),
23
- examples: [{
24
- title: "Declarative schema field",
25
- code: `<SchemaField.String name="richTextEditor" title="RichTextEditor" x-decorator="FormItem" x-component="RichTextEditor" />`
26
- }, {
27
- title: "JSON schema for form renderer",
28
- code: `{
23
+ examples: [
24
+ {
25
+ title: "Declarative schema field",
26
+ code: `<SchemaField.String name="richTextEditor" title="RichTextEditor" x-decorator="FormItem" x-component="RichTextEditor" />`
27
+ },
28
+ {
29
+ title: "JSON schema for form renderer",
30
+ code: `{
29
31
  type: 'object',
30
32
  properties: {
31
33
  richTextEditor: {
@@ -36,7 +38,50 @@ const meta = {
36
38
  },
37
39
  },
38
40
  }`
39
- }],
41
+ },
42
+ {
43
+ title: "Add a custom extension via x-component-props",
44
+ code: `import { Mark, mergeAttributes } from '@tiptap/core';
45
+
46
+ // Any Mark.create / Node.create / Extension.create result (or an official
47
+ // package like @tiptap/extension-highlight) can be passed to \`extensions\`.
48
+ const Highlight = Mark.create({
49
+ name: 'highlight',
50
+ parseHTML() {
51
+ return [{ tag: 'mark' }];
52
+ },
53
+ renderHTML({ HTMLAttributes }) {
54
+ return ['mark', mergeAttributes(HTMLAttributes), 0];
55
+ },
56
+ });
57
+
58
+ const schema = {
59
+ type: 'object',
60
+ properties: {
61
+ richText: {
62
+ type: 'string',
63
+ title: 'Rich Text Editor',
64
+ 'x-decorator': 'FormItem',
65
+ 'x-component': 'RichTextEditor',
66
+ 'x-component-props': {
67
+ extensions: [Highlight],
68
+ toolbarItems: [
69
+ 'bold',
70
+ 'italic',
71
+ '|',
72
+ {
73
+ icon: '🖍️',
74
+ tooltip: 'Highlight',
75
+ onClick: (editor) => editor.chain().focus().toggleMark('highlight').run(),
76
+ isActive: (editor) => editor.isActive('highlight'),
77
+ },
78
+ ],
79
+ },
80
+ },
81
+ },
82
+ };`
83
+ }
84
+ ],
40
85
  keywords: [
41
86
  "formily",
42
87
  "rich text",
@@ -1,5 +1,5 @@
1
1
  import React from "react";
2
- import * as react_jsx_runtime2 from "react/jsx-runtime";
2
+ import * as react_jsx_runtime3 from "react/jsx-runtime";
3
3
 
4
4
  //#region src/components/row/Row.d.ts
5
5
  interface IRowProps {
@@ -36,6 +36,6 @@ interface IRowProps {
36
36
  declare function Row({
37
37
  className,
38
38
  children
39
- }: IRowProps): react_jsx_runtime2.JSX.Element;
39
+ }: IRowProps): react_jsx_runtime3.JSX.Element;
40
40
  //#endregion
41
41
  export { IRowProps, Row };
@@ -1,5 +1,5 @@
1
1
  import React from "react";
2
- import * as react_jsx_runtime3 from "react/jsx-runtime";
2
+ import * as react_jsx_runtime4 from "react/jsx-runtime";
3
3
 
4
4
  //#region src/components/row/Row.d.ts
5
5
  interface IRowProps {
@@ -36,6 +36,6 @@ interface IRowProps {
36
36
  declare function Row({
37
37
  className,
38
38
  children
39
- }: IRowProps): react_jsx_runtime3.JSX.Element;
39
+ }: IRowProps): react_jsx_runtime4.JSX.Element;
40
40
  //#endregion
41
41
  export { IRowProps, Row };