@prosekit/solid 0.4.17 → 0.5.1

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 (95) hide show
  1. package/dist/create-component-x4Duyu8z.js +2 -1
  2. package/dist/create-component-x4Duyu8z.js.map +1 -0
  3. package/dist/{create-props-B3k6ERfv.d.ts → create-props-BwXSSFVp.d.ts} +3 -2
  4. package/dist/create-props-BwXSSFVp.d.ts.map +1 -0
  5. package/dist/editor-context-DIj_hnDx.js +2 -1
  6. package/dist/editor-context-DIj_hnDx.js.map +1 -0
  7. package/dist/prosekit-solid-autocomplete.d.ts +12 -11
  8. package/dist/prosekit-solid-autocomplete.d.ts.map +1 -0
  9. package/dist/prosekit-solid-autocomplete.js +2 -1
  10. package/dist/prosekit-solid-autocomplete.js.map +1 -0
  11. package/dist/prosekit-solid-block-handle.d.ts +10 -9
  12. package/dist/prosekit-solid-block-handle.d.ts.map +1 -0
  13. package/dist/prosekit-solid-block-handle.js +2 -1
  14. package/dist/prosekit-solid-block-handle.js.map +1 -0
  15. package/dist/prosekit-solid-drop-indicator.d.ts +15 -0
  16. package/dist/prosekit-solid-drop-indicator.d.ts.map +1 -0
  17. package/dist/prosekit-solid-drop-indicator.js +10 -0
  18. package/dist/prosekit-solid-drop-indicator.js.map +1 -0
  19. package/dist/prosekit-solid-inline-popover.d.ts +6 -5
  20. package/dist/prosekit-solid-inline-popover.d.ts.map +1 -0
  21. package/dist/prosekit-solid-inline-popover.js +2 -1
  22. package/dist/prosekit-solid-inline-popover.js.map +1 -0
  23. package/dist/prosekit-solid-popover.d.ts +10 -9
  24. package/dist/prosekit-solid-popover.d.ts.map +1 -0
  25. package/dist/prosekit-solid-popover.js +2 -1
  26. package/dist/prosekit-solid-popover.js.map +1 -0
  27. package/dist/prosekit-solid-resizable.d.ts +8 -7
  28. package/dist/prosekit-solid-resizable.d.ts.map +1 -0
  29. package/dist/prosekit-solid-resizable.js +2 -1
  30. package/dist/prosekit-solid-resizable.js.map +1 -0
  31. package/dist/prosekit-solid-table-handle.d.ts +22 -21
  32. package/dist/prosekit-solid-table-handle.d.ts.map +1 -0
  33. package/dist/prosekit-solid-table-handle.js +2 -1
  34. package/dist/prosekit-solid-table-handle.js.map +1 -0
  35. package/dist/prosekit-solid-tooltip.d.ts +10 -9
  36. package/dist/prosekit-solid-tooltip.d.ts.map +1 -0
  37. package/dist/prosekit-solid-tooltip.js +2 -1
  38. package/dist/prosekit-solid-tooltip.js.map +1 -0
  39. package/dist/prosekit-solid.d.ts +69 -63
  40. package/dist/prosekit-solid.d.ts.map +1 -0
  41. package/dist/prosekit-solid.js +2 -1
  42. package/dist/prosekit-solid.js.map +1 -0
  43. package/dist/{types-DFZJMe9D.d.ts → types-CoG9Vl2B.d.ts} +10 -23
  44. package/dist/types-CoG9Vl2B.d.ts.map +1 -0
  45. package/package.json +22 -14
  46. package/src/components/autocomplete/autocomplete-empty.gen.ts +29 -0
  47. package/src/components/autocomplete/autocomplete-item.gen.ts +29 -0
  48. package/src/components/autocomplete/autocomplete-list.gen.ts +29 -0
  49. package/src/components/autocomplete/autocomplete-popover.gen.ts +29 -0
  50. package/src/components/autocomplete/index.gen.ts +7 -0
  51. package/src/components/block-handle/block-handle-add.gen.ts +29 -0
  52. package/src/components/block-handle/block-handle-draggable.gen.ts +29 -0
  53. package/src/components/block-handle/block-handle-popover.gen.ts +29 -0
  54. package/src/components/block-handle/index.gen.ts +5 -0
  55. package/src/components/create-component.ts +60 -0
  56. package/src/components/create-props.ts +13 -0
  57. package/src/components/drop-indicator/drop-indicator.gen.ts +29 -0
  58. package/src/components/drop-indicator/index.gen.ts +1 -0
  59. package/src/components/inline-popover/index.gen.ts +1 -0
  60. package/src/components/inline-popover/inline-popover.gen.ts +29 -0
  61. package/src/components/popover/index.gen.ts +5 -0
  62. package/src/components/popover/popover-content.gen.ts +29 -0
  63. package/src/components/popover/popover-root.gen.ts +29 -0
  64. package/src/components/popover/popover-trigger.gen.ts +29 -0
  65. package/src/components/prosekit.ts +37 -0
  66. package/src/components/resizable/index.gen.ts +3 -0
  67. package/src/components/resizable/resizable-handle.gen.ts +29 -0
  68. package/src/components/resizable/resizable-root.gen.ts +29 -0
  69. package/src/components/table-handle/index.gen.ts +17 -0
  70. package/src/components/table-handle/table-handle-column-root.gen.ts +29 -0
  71. package/src/components/table-handle/table-handle-column-trigger.gen.ts +29 -0
  72. package/src/components/table-handle/table-handle-drag-preview.gen.ts +29 -0
  73. package/src/components/table-handle/table-handle-drop-indicator.gen.ts +29 -0
  74. package/src/components/table-handle/table-handle-popover-content.gen.ts +29 -0
  75. package/src/components/table-handle/table-handle-popover-item.gen.ts +29 -0
  76. package/src/components/table-handle/table-handle-root.gen.ts +29 -0
  77. package/src/components/table-handle/table-handle-row-root.gen.ts +29 -0
  78. package/src/components/table-handle/table-handle-row-trigger.gen.ts +29 -0
  79. package/src/components/tooltip/index.gen.ts +5 -0
  80. package/src/components/tooltip/tooltip-content.gen.ts +29 -0
  81. package/src/components/tooltip/tooltip-root.gen.ts +29 -0
  82. package/src/components/tooltip/tooltip-trigger.gen.ts +29 -0
  83. package/src/contexts/editor-context.ts +23 -0
  84. package/src/extensions/solid-mark-view.ts +95 -0
  85. package/src/extensions/solid-node-view.ts +95 -0
  86. package/src/hooks/use-doc-change.ts +20 -0
  87. package/src/hooks/use-editor-extension.ts +36 -0
  88. package/src/hooks/use-editor.ts +59 -0
  89. package/src/hooks/use-extension.ts +41 -0
  90. package/src/hooks/use-keymap.ts +14 -0
  91. package/src/hooks/use-priority-extension.ts +18 -0
  92. package/src/hooks/use-state-update.ts +20 -0
  93. package/src/index.ts +30 -0
  94. package/src/types.ts +29 -0
  95. package/src/utils/to-value.ts +14 -0
@@ -1,4 +1,4 @@
1
- import { MaybeAccessor, PropsWithChildren, PropsWithClass, PropsWithElement } from "./types-DFZJMe9D.js";
1
+ import { MaybeAccessor, PropsWithChildren, PropsWithClass, PropsWithElement } from "./types-CoG9Vl2B.js";
2
2
  import { MarkViewContextProps, NodeViewContextProps } from "@prosemirror-adapter/solid";
3
3
  import { Accessor, Component, ParentProps } from "solid-js";
4
4
  import { Editor, Extension, Keymap, Priority } from "@prosekit/core";
@@ -11,112 +11,117 @@ type ProseKitProps = ParentProps<{
11
11
  editor: Editor;
12
12
  }>;
13
13
  /**
14
- * The root component for a ProseKit editor.
15
- *
16
- * @public
17
- */
14
+ * The root component for a ProseKit editor.
15
+ *
16
+ * @public
17
+ */
18
18
  declare const ProseKit: Component<ProseKitProps>;
19
19
  //#endregion
20
20
  //#region src/extensions/solid-mark-view.d.ts
21
21
  /**
22
- * @public
23
- */
22
+ * @public
23
+ */
24
24
  interface SolidMarkViewProps extends MarkViewContextProps {}
25
25
  /**
26
- * @public
27
- */
26
+ * @public
27
+ */
28
28
  type SolidMarkViewComponent = Component<SolidMarkViewProps>;
29
29
  /**
30
- * Options for {@link defineSolidMarkView}.
31
- *
32
- * @public
33
- */
30
+ * Options for {@link defineSolidMarkView}.
31
+ *
32
+ * @public
33
+ */
34
34
  interface SolidMarkViewOptions extends CoreMarkViewUserOptions<SolidMarkViewComponent> {
35
35
  /**
36
- * The name of the mark type.
37
- */
36
+ * The name of the mark type.
37
+ */
38
38
  name: string;
39
39
  }
40
40
  /**
41
- * @internal
42
- */
41
+ * @internal
42
+ */
43
43
 
44
44
  /**
45
- * Defines a mark view using a Solid component.
46
- *
47
- * @public
48
- */
45
+ * Defines a mark view using a Solid component.
46
+ *
47
+ * @public
48
+ */
49
49
  declare function defineSolidMarkView(options: SolidMarkViewOptions): Extension;
50
50
  //#endregion
51
51
  //#region src/extensions/solid-node-view.d.ts
52
52
  /**
53
- * @public
54
- */
53
+ * @public
54
+ */
55
55
  interface SolidNodeViewProps extends NodeViewContextProps {}
56
56
  /**
57
- * @public
58
- */
57
+ * @public
58
+ */
59
59
  type SolidNodeViewComponent = Component<SolidNodeViewProps>;
60
60
  /**
61
- * Options for {@link defineSolidNodeView}.
62
- *
63
- * @public
64
- */
61
+ * Options for {@link defineSolidNodeView}.
62
+ *
63
+ * @public
64
+ */
65
65
  interface SolidNodeViewOptions extends CoreNodeViewUserOptions<SolidNodeViewComponent> {
66
66
  /**
67
- * The name of the node type.
68
- */
67
+ * The name of the node type.
68
+ */
69
69
  name: string;
70
70
  }
71
71
  /**
72
- * @internal
73
- */
72
+ * @internal
73
+ */
74
74
 
75
75
  /**
76
- * Defines a node view using a Solid component.
77
- *
78
- * @public
79
- */
76
+ * Defines a node view using a Solid component.
77
+ *
78
+ * @public
79
+ */
80
80
  declare function defineSolidNodeView(options: SolidNodeViewOptions): Extension;
81
81
  //#endregion
82
82
  //#region src/hooks/use-extension.d.ts
83
83
  interface UseExtensionOptions {
84
84
  /**
85
- * The editor to add the extension to. If not provided, it will use the
86
- * editor from the nearest `ProseKit` component.
87
- */
85
+ * The editor to add the extension to. If not provided, it will use the
86
+ * editor from the nearest `ProseKit` component.
87
+ */
88
88
  editor?: MaybeAccessor<Editor>;
89
89
  /**
90
- * Optional priority to add the extension with.
91
- */
90
+ * Optional priority to add the extension with.
91
+ */
92
92
  priority?: Priority;
93
93
  }
94
94
  /**
95
- * Add an extension to the editor.
96
- */
97
- declare function useExtension(extension: Accessor<Extension | null>, options?: UseExtensionOptions): void;
95
+ * Add an extension to the editor.
96
+ */
97
+ declare function useExtension(
98
+ /**
99
+ * The accessor to an extension to add to the editor. If it changes, the previous
100
+ * extension will be removed and the new one (if not null) will be added.
101
+ */
102
+ extension: Accessor<Extension | null>, options?: UseExtensionOptions): void;
98
103
  //#endregion
99
104
  //#region src/hooks/use-doc-change.d.ts
100
105
  /**
101
- * Calls the given handler whenever the editor document changes.
102
- *
103
- * @public
104
- */
106
+ * Calls the given handler whenever the editor document changes.
107
+ *
108
+ * @public
109
+ */
105
110
  declare function useDocChange(handler: (doc: ProseMirrorNode) => void, options?: UseExtensionOptions): void;
106
111
  //#endregion
107
112
  //#region src/hooks/use-editor.d.ts
108
113
  /**
109
- * Retrieves the editor instance from the nearest ProseKit component.
110
- *
111
- * @public
112
- */
114
+ * Retrieves the editor instance from the nearest ProseKit component.
115
+ *
116
+ * @public
117
+ */
113
118
  declare function useEditor<E extends Extension = any>(options?: {
114
119
  /**
115
- * Whether to update the component when the editor is mounted or editor state
116
- * is updated.
117
- *
118
- * @default false
119
- */
120
+ * Whether to update the component when the editor is mounted or editor state
121
+ * is updated.
122
+ *
123
+ * @default false
124
+ */
120
125
  update?: boolean;
121
126
  }): () => Editor<E>;
122
127
  //#endregion
@@ -125,10 +130,11 @@ declare function useKeymap(keymap: () => Keymap, options?: UseExtensionOptions):
125
130
  //#endregion
126
131
  //#region src/hooks/use-state-update.d.ts
127
132
  /**
128
- * Calls the given handler whenever the editor state changes.
129
- *
130
- * @public
131
- */
133
+ * Calls the given handler whenever the editor state changes.
134
+ *
135
+ * @public
136
+ */
132
137
  declare function useStateUpdate(handler: (state: EditorState) => void, options?: UseExtensionOptions): void;
133
138
  //#endregion
134
- export { MaybeAccessor, PropsWithChildren, PropsWithClass, PropsWithElement, ProseKit, ProseKitProps, SolidMarkViewComponent, SolidMarkViewOptions, SolidMarkViewProps, SolidNodeViewComponent, SolidNodeViewOptions, SolidNodeViewProps, UseExtensionOptions, defineSolidMarkView, defineSolidNodeView, useDocChange, useEditor, useExtension, useKeymap, useStateUpdate };
139
+ export { type MaybeAccessor, type PropsWithChildren, type PropsWithClass, type PropsWithElement, ProseKit, type ProseKitProps, type SolidMarkViewComponent, type SolidMarkViewOptions, type SolidMarkViewProps, type SolidNodeViewComponent, type SolidNodeViewOptions, type SolidNodeViewProps, type UseExtensionOptions, defineSolidMarkView, defineSolidNodeView, useDocChange, useEditor, useExtension, useKeymap, useStateUpdate };
140
+ //# sourceMappingURL=prosekit-solid.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"prosekit-solid.d.ts","names":[],"sources":["../src/components/prosekit.ts","../src/extensions/solid-mark-view.ts","../src/extensions/solid-node-view.ts","../src/hooks/use-extension.ts","../src/hooks/use-doc-change.ts","../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5 @@ function useStateUpdate(handler, options) {
218
218
  }
219
219
 
220
220
  //#endregion
221
- export { ProseKit, defineSolidMarkView, defineSolidNodeView, useDocChange, useEditor, useExtension, useKeymap, useStateUpdate };
221
+ export { ProseKit, defineSolidMarkView, defineSolidNodeView, useDocChange, useEditor, useExtension, useKeymap, useStateUpdate };
222
+ //# sourceMappingURL=prosekit-solid.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"prosekit-solid.js","names":["props: Accessor<SolidMarkViewProps>","args: SolidMarkViewUserOptions","props: Accessor<SolidNodeViewProps>","args: SolidNodeViewUserOptions","ProseKit: Component<ProseKitProps>"],"sources":["../src/utils/to-value.ts","../src/hooks/use-editor-extension.ts","../src/hooks/use-priority-extension.ts","../src/hooks/use-extension.ts","../src/extensions/solid-mark-view.ts","../src/extensions/solid-node-view.ts","../src/components/prosekit.ts","../src/hooks/use-doc-change.ts","../src/hooks/use-editor.ts","../src/hooks/use-keymap.ts","../src/hooks/use-state-update.ts"],"sourcesContent":["/**\n * Accesses the value of a MaybeAccessor\n *\n * @example\n * ```ts\n * access(\"foo\") // => \"foo\"\n * access(() => \"foo\") // => \"foo\"\n * ```\n */\nexport function toValue<T>(\n v: (() => T) | T,\n): T {\n return (typeof v === 'function') ? (v as () => T)() : v\n}\n","import {\n EditorNotFoundError,\n type Editor,\n type Extension,\n} from '@prosekit/core'\nimport {\n createEffect,\n onCleanup,\n type Accessor,\n} from 'solid-js'\n\nimport { useEditorContext } from '../contexts/editor-context'\nimport type { MaybeAccessor } from '../types'\nimport { toValue } from '../utils/to-value'\n\n/**\n * @internal\n */\nexport function useEditorExtension(\n editorAccessor: MaybeAccessor<Editor> | undefined | null,\n extensionAccessor: Accessor<Extension | null>,\n): void {\n const editorContext = useEditorContext()\n\n createEffect(() => {\n const editor = toValue(editorAccessor) || toValue(editorContext)\n const extension = extensionAccessor()\n\n if (!editor) {\n throw new EditorNotFoundError()\n }\n if (extension) {\n onCleanup(editor.use(extension))\n }\n })\n}\n","import {\n withPriority,\n type Extension,\n type Priority,\n} from '@prosekit/core'\n\n/**\n * @internal\n */\nexport function usePriorityExtension<T extends Extension = Extension>(\n extension: () => T | null,\n priority?: Priority | null,\n): () => T | null {\n return () => {\n const ext = extension()\n return ext && priority ? withPriority(ext, priority) : ext\n }\n}\n","import type {\n Editor,\n Extension,\n Priority,\n} from '@prosekit/core'\nimport type { Accessor } from 'solid-js'\n\nimport type { MaybeAccessor } from '../types'\n\nimport { useEditorExtension } from './use-editor-extension'\nimport { usePriorityExtension } from './use-priority-extension'\n\nexport interface UseExtensionOptions {\n /**\n * The editor to add the extension to. If not provided, it will use the\n * editor from the nearest `ProseKit` component.\n */\n editor?: MaybeAccessor<Editor>\n\n /**\n * Optional priority to add the extension with.\n */\n priority?: Priority\n}\n\n/**\n * Add an extension to the editor.\n */\nexport function useExtension(\n /**\n * The accessor to an extension to add to the editor. If it changes, the previous\n * extension will be removed and the new one (if not null) will be added.\n */\n extension: Accessor<Extension | null>,\n options?: UseExtensionOptions,\n): void {\n useEditorExtension(\n options?.editor,\n usePriorityExtension(extension, options?.priority),\n )\n}\n","import {\n defineMarkViewComponent,\n defineMarkViewFactory,\n type Extension,\n} from '@prosekit/core'\nimport type { MarkViewConstructor } from '@prosekit/pm/view'\nimport type { CoreMarkViewUserOptions } from '@prosemirror-adapter/core'\nimport {\n useMarkViewContext,\n useMarkViewFactory,\n type MarkViewContextProps,\n type SolidMarkViewUserOptions,\n} from '@prosemirror-adapter/solid'\nimport {\n createComponent,\n createMemo,\n type Accessor,\n type Component,\n} from 'solid-js'\n\nimport { useExtension } from '../hooks/use-extension'\n\n/**\n * @public\n */\nexport interface SolidMarkViewProps extends MarkViewContextProps {}\n\n/**\n * @public\n */\nexport type SolidMarkViewComponent = Component<SolidMarkViewProps>\n\n/**\n * Options for {@link defineSolidMarkView}.\n *\n * @public\n */\nexport interface SolidMarkViewOptions extends CoreMarkViewUserOptions<SolidMarkViewComponent> {\n /**\n * The name of the mark type.\n */\n name: string\n}\n\nfunction withMarkViewProps(\n component: SolidMarkViewComponent,\n): Component<SolidMarkViewProps> {\n return function MarkViewPropsWrapper() {\n const props: Accessor<SolidMarkViewProps> = useMarkViewContext()\n\n return createComponent(component, props())\n }\n}\n\n/**\n * @internal\n */\nexport function consumeSolidMarkViews(): void {\n const markViewFactory = useMarkViewFactory()\n const extension = createMemo(\n () => defineSolidMarkViewFactory(markViewFactory),\n [markViewFactory],\n )\n\n useExtension(extension)\n}\n\n/**\n * Defines a mark view using a Solid component.\n *\n * @public\n */\nexport function defineSolidMarkView(options: SolidMarkViewOptions): Extension {\n const { name, component, ...userOptions } = options\n\n const args: SolidMarkViewUserOptions = {\n ...userOptions,\n component: withMarkViewProps(component),\n }\n\n return defineMarkViewComponent<SolidMarkViewUserOptions>({\n group: 'solid',\n name,\n args,\n })\n}\n\nfunction defineSolidMarkViewFactory(\n factory: (options: SolidMarkViewOptions) => MarkViewConstructor,\n) {\n return defineMarkViewFactory<SolidMarkViewOptions>({\n group: 'solid',\n factory,\n })\n}\n","import {\n defineNodeViewComponent,\n defineNodeViewFactory,\n type Extension,\n} from '@prosekit/core'\nimport type { NodeViewConstructor } from '@prosekit/pm/view'\nimport type { CoreNodeViewUserOptions } from '@prosemirror-adapter/core'\nimport {\n useNodeViewContext,\n useNodeViewFactory,\n type NodeViewContextProps,\n type SolidNodeViewUserOptions,\n} from '@prosemirror-adapter/solid'\nimport {\n createComponent,\n createMemo,\n type Accessor,\n type Component,\n} from 'solid-js'\n\nimport { useExtension } from '../hooks/use-extension'\n\n/**\n * @public\n */\nexport interface SolidNodeViewProps extends NodeViewContextProps {}\n\n/**\n * @public\n */\nexport type SolidNodeViewComponent = Component<SolidNodeViewProps>\n\n/**\n * Options for {@link defineSolidNodeView}.\n *\n * @public\n */\nexport interface SolidNodeViewOptions extends CoreNodeViewUserOptions<SolidNodeViewComponent> {\n /**\n * The name of the node type.\n */\n name: string\n}\n\nfunction withNodeViewProps(\n component: SolidNodeViewComponent,\n): Component<SolidNodeViewProps> {\n return function NodeViewPropsWrapper() {\n const props: Accessor<SolidNodeViewProps> = useNodeViewContext()\n\n return createComponent(component, props())\n }\n}\n\n/**\n * @internal\n */\nexport function consumeSolidNodeViews(): void {\n const nodeViewFactory = useNodeViewFactory()\n const extension = createMemo(\n () => defineSolidNodeViewFactory(nodeViewFactory),\n [nodeViewFactory],\n )\n\n useExtension(extension)\n}\n\n/**\n * Defines a node view using a Solid component.\n *\n * @public\n */\nexport function defineSolidNodeView(options: SolidNodeViewOptions): Extension {\n const { name, component, ...userOptions } = options\n\n const args: SolidNodeViewUserOptions = {\n ...userOptions,\n component: withNodeViewProps(component),\n }\n\n return defineNodeViewComponent<SolidNodeViewUserOptions>({\n group: 'solid',\n name,\n args,\n })\n}\n\nfunction defineSolidNodeViewFactory(\n factory: (options: SolidNodeViewOptions) => NodeViewConstructor,\n) {\n return defineNodeViewFactory<SolidNodeViewOptions>({\n group: 'solid',\n factory,\n })\n}\n","import type { Editor } from '@prosekit/core'\nimport { ProsemirrorAdapterProvider } from '@prosemirror-adapter/solid'\nimport {\n createComponent,\n type Component,\n type ParentProps,\n} from 'solid-js'\n\nimport { EditorContextProvider } from '../contexts/editor-context'\nimport { consumeSolidMarkViews } from '../extensions/solid-mark-view'\nimport { consumeSolidNodeViews } from '../extensions/solid-node-view'\n\nexport type ProseKitProps = ParentProps<{\n editor: Editor\n}>\n\n/**\n * The root component for a ProseKit editor.\n *\n * @public\n */\nexport const ProseKit: Component<ProseKitProps> = (props) => {\n return createComponent(ProsemirrorAdapterProvider, {\n get children() {\n return createComponent(EditorContextProvider, {\n get value() {\n return props.editor\n },\n get children() {\n consumeSolidNodeViews()\n consumeSolidMarkViews()\n return props.children\n },\n })\n },\n })\n}\n","import { defineDocChangeHandler } from '@prosekit/core'\nimport type { ProseMirrorNode } from '@prosekit/pm/model'\n\nimport {\n useExtension,\n type UseExtensionOptions,\n} from './use-extension'\n\n/**\n * Calls the given handler whenever the editor document changes.\n *\n * @public\n */\nexport function useDocChange(\n handler: (doc: ProseMirrorNode) => void,\n options?: UseExtensionOptions,\n): void {\n const extension = defineDocChangeHandler((view) => handler(view.state.doc))\n useExtension(() => extension, options)\n}\n","import {\n defineMountHandler,\n defineUpdateHandler,\n ProseKitError,\n union,\n type Editor,\n type Extension,\n} from '@prosekit/core'\nimport {\n createEffect,\n createSignal,\n} from 'solid-js'\n\nimport { useEditorContext } from '../contexts/editor-context'\n\n/**\n * Retrieves the editor instance from the nearest ProseKit component.\n *\n * @public\n */\nexport function useEditor<E extends Extension = any>(options?: {\n /**\n * Whether to update the component when the editor is mounted or editor state\n * is updated.\n *\n * @default false\n */\n update?: boolean\n}): () => Editor<E> {\n const update = options?.update ?? false\n\n const editor = useEditorContext<E>()\n if (!editor) {\n throw new ProseKitError(\n 'useEditor must be used within the ProseKit component',\n )\n }\n\n const [depend, forceUpdate] = useForceUpdate()\n\n createEffect(() => {\n if (update) {\n const extension = union(\n defineMountHandler(forceUpdate),\n defineUpdateHandler(forceUpdate),\n )\n return editor.use(extension)\n }\n }, [editor, update, forceUpdate])\n\n return () => {\n depend()\n return editor\n }\n}\n\nfunction useForceUpdate() {\n return createSignal(undefined, { equals: false })\n}\n","import {\n defineKeymap,\n type Keymap,\n} from '@prosekit/core'\n\nimport {\n useExtension,\n type UseExtensionOptions,\n} from './use-extension'\n\nexport function useKeymap(keymap: () => Keymap, options?: UseExtensionOptions): void {\n const extension = () => defineKeymap(keymap())\n useExtension(extension, options)\n}\n","import { defineUpdateHandler } from '@prosekit/core'\nimport type { EditorState } from '@prosekit/pm/state'\n\nimport {\n useExtension,\n type UseExtensionOptions,\n} from './use-extension'\n\n/**\n * Calls the given handler whenever the editor state changes.\n *\n * @public\n */\nexport function useStateUpdate(\n handler: (state: EditorState) => void,\n options?: UseExtensionOptions,\n): void {\n const extension = defineUpdateHandler((view) => handler(view.state))\n useExtension(() => extension, options)\n}\n"],"mappings":";;;;;;;;;;;;;;;AASA,SAAgB,QACd,GACG;AACH,QA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B,SAAqC;CACnF,MAAM,kBAAkB,aAAa,QAAQ,CAAC;AAC9C,cAAa,WAAW,QAAQ;;;;;;;;;;ACClC,SAAgB,eACd,SACA,SACM;CACN,MAAM,YAAY,qBAAqB,SAAS,QAAQ,KAAK,MAAM,CAAC;AACpE,oBAAmB,WAAW,QAAQ"}
@@ -3,38 +3,25 @@ import { Accessor, JSX, JSXElement } from "solid-js";
3
3
  //#region src/types.d.ts
4
4
 
5
5
  /**
6
- * @internal
7
- */
6
+ * @internal
7
+ */
8
8
  type PropsWithClass<P = unknown> = P & {
9
9
  class?: string | undefined;
10
10
  };
11
11
  /**
12
- * @internal
13
- */
12
+ * @internal
13
+ */
14
14
  type PropsWithChildren<P = unknown> = P & {
15
15
  children?: JSXElement | undefined;
16
16
  };
17
17
  /**
18
- * @internal
19
- */
18
+ * @internal
19
+ */
20
20
  type PropsWithElement<Props extends object, CustomElement extends HTMLElement> = Props & JSX.HTMLAttributes<CustomElement>;
21
21
  /**
22
- * T or a reactive/non-reactive function returning T
23
- */
22
+ * T or a reactive/non-reactive function returning T
23
+ */
24
24
  type MaybeAccessor<T> = T | Accessor<T>;
25
- /**
26
- * Accessed value of a MaybeAccessor
27
- *
28
- * @example
29
- *
30
- * ```ts
31
- * MaybeAccessorValue<MaybeAccessor<string>>
32
- * // => string
33
- * MaybeAccessorValue<MaybeAccessor<() => string>>
34
- * // => string | (() => string)
35
- * MaybeAccessorValue<MaybeAccessor<string> | Function>
36
- * // => string | void
37
- * ```
38
- */
39
25
  //#endregion
40
- export { MaybeAccessor, PropsWithChildren, PropsWithClass, PropsWithElement };
26
+ export { MaybeAccessor, PropsWithChildren, PropsWithClass, PropsWithElement };
27
+ //# sourceMappingURL=types-CoG9Vl2B.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types-CoG9Vl2B.d.ts","names":[],"sources":["../src/types.ts"],"sourcesContent":[],"mappings":";;;;;;AASA;AAOY,KAPA,cAOiB,CAAA,IAAA,OAAA,CAAA,GAPa,CAOb,GAAA;EAAA,KAAA,CAAA,EAAA,MAAA,GAAA,SAAA;;;;AAO7B;AAA4B,KAPhB,iBAOgB,CAAA,IAAA,OAAA,CAAA,GAPiB,CAOjB,GAAA;UAA6C,CAAA,EAN5D,UAM4D,GAAA,SAAA;;;;;AAK7D,KALA,gBAKa,CAAA,cAAA,MAAA,EAAA,sBALgD,WAKhD,CAAA,GAL+D,KAK/D,GALuE,GAAA,CAAI,cAK3E,CAL0F,aAK1F,CAAA;;;;AAAU,KAAvB,aAAuB,CAAA,CAAA,CAAA,GAAJ,CAAI,GAAA,QAAA,CAAS,CAAT,CAAA"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@prosekit/solid",
3
3
  "type": "module",
4
- "version": "0.4.17",
4
+ "version": "0.5.1",
5
5
  "private": false,
6
6
  "description": "Solid components and utilities for ProseKit",
7
7
  "author": {
@@ -10,14 +10,14 @@
10
10
  },
11
11
  "license": "MIT",
12
12
  "funding": "https://github.com/sponsors/ocavue",
13
- "homepage": "https://github.com/ocavue/prosekit#readme",
13
+ "homepage": "https://github.com/prosekit/prosekit#readme",
14
14
  "repository": {
15
15
  "type": "git",
16
- "url": "git+https://github.com/ocavue/prosekit.git",
16
+ "url": "git+https://github.com/prosekit/prosekit.git",
17
17
  "directory": "packages/solid"
18
18
  },
19
19
  "bugs": {
20
- "url": "https://github.com/ocavue/prosekit/issues"
20
+ "url": "https://github.com/prosekit/prosekit/issues"
21
21
  },
22
22
  "keywords": [
23
23
  "ProseMirror"
@@ -38,6 +38,10 @@
38
38
  "types": "./dist/prosekit-solid-block-handle.d.ts",
39
39
  "default": "./dist/prosekit-solid-block-handle.js"
40
40
  },
41
+ "./drop-indicator": {
42
+ "types": "./dist/prosekit-solid-drop-indicator.d.ts",
43
+ "default": "./dist/prosekit-solid-drop-indicator.js"
44
+ },
41
45
  "./inline-popover": {
42
46
  "types": "./dist/prosekit-solid-inline-popover.d.ts",
43
47
  "default": "./dist/prosekit-solid-inline-popover.js"
@@ -60,14 +64,15 @@
60
64
  }
61
65
  },
62
66
  "files": [
63
- "dist"
67
+ "dist",
68
+ "src"
64
69
  ],
65
70
  "dependencies": {
66
- "@prosemirror-adapter/core": "^0.4.0",
67
- "@prosemirror-adapter/solid": "^0.4.1",
68
- "@prosekit/core": "^0.8.3",
69
- "@prosekit/web": "^0.6.0",
70
- "@prosekit/pm": "^0.1.11"
71
+ "@prosemirror-adapter/core": "^0.4.2",
72
+ "@prosemirror-adapter/solid": "^0.4.2",
73
+ "@prosekit/core": "^0.8.4",
74
+ "@prosekit/pm": "^0.1.12",
75
+ "@prosekit/web": "^0.7.4"
71
76
  },
72
77
  "peerDependencies": {
73
78
  "solid-js": ">= 1.7.0"
@@ -78,10 +83,9 @@
78
83
  }
79
84
  },
80
85
  "devDependencies": {
81
- "solid-js": "^1.9.7",
82
- "tsdown": "^0.12.9",
83
- "typescript": "~5.8.3",
84
- "vitest": "^3.2.4",
86
+ "solid-js": "^1.9.9",
87
+ "tsdown": "^0.14.2",
88
+ "typescript": "~5.9.2",
85
89
  "@prosekit/config-tsdown": "0.0.0",
86
90
  "@prosekit/config-vitest": "0.0.0"
87
91
  },
@@ -93,6 +97,7 @@
93
97
  "prosekit-solid": "./src/index.ts",
94
98
  "prosekit-solid-autocomplete": "./src/components/autocomplete/index.gen.ts",
95
99
  "prosekit-solid-block-handle": "./src/components/block-handle/index.gen.ts",
100
+ "prosekit-solid-drop-indicator": "./src/components/drop-indicator/index.gen.ts",
96
101
  "prosekit-solid-inline-popover": "./src/components/inline-popover/index.gen.ts",
97
102
  "prosekit-solid-popover": "./src/components/popover/index.gen.ts",
98
103
  "prosekit-solid-resizable": "./src/components/resizable/index.gen.ts",
@@ -116,6 +121,9 @@
116
121
  "block-handle": [
117
122
  "./dist/prosekit-solid-block-handle.d.ts"
118
123
  ],
124
+ "drop-indicator": [
125
+ "./dist/prosekit-solid-drop-indicator.d.ts"
126
+ ],
119
127
  "inline-popover": [
120
128
  "./dist/prosekit-solid-inline-popover.d.ts"
121
129
  ],
@@ -0,0 +1,29 @@
1
+ import {
2
+ type AutocompleteEmptyElement,
3
+ type AutocompleteEmptyProps as Props,
4
+ type AutocompleteEmptyEvents as Events,
5
+ autocompleteEmptyProps,
6
+ autocompleteEmptyEvents,
7
+ } from '@prosekit/web/autocomplete'
8
+ import type { Component } from 'solid-js'
9
+
10
+ import type { PropsWithElement } from '../../types'
11
+ import { createComponent } from '../create-component'
12
+ import type { CreateProps } from '../create-props'
13
+
14
+ /**
15
+ * Props for the {@link AutocompleteEmpty} component.
16
+ */
17
+ export interface AutocompleteEmptyProps extends Partial<CreateProps<Props, Events>> {}
18
+
19
+ export const AutocompleteEmpty: Component<PropsWithElement<
20
+ AutocompleteEmptyProps,
21
+ AutocompleteEmptyElement
22
+ >> = createComponent<
23
+ AutocompleteEmptyProps,
24
+ AutocompleteEmptyElement
25
+ >(
26
+ 'prosekit-autocomplete-empty',
27
+ Object.keys(autocompleteEmptyProps),
28
+ Object.keys(autocompleteEmptyEvents),
29
+ )
@@ -0,0 +1,29 @@
1
+ import {
2
+ type AutocompleteItemElement,
3
+ type AutocompleteItemProps as Props,
4
+ type AutocompleteItemEvents as Events,
5
+ autocompleteItemProps,
6
+ autocompleteItemEvents,
7
+ } from '@prosekit/web/autocomplete'
8
+ import type { Component } from 'solid-js'
9
+
10
+ import type { PropsWithElement } from '../../types'
11
+ import { createComponent } from '../create-component'
12
+ import type { CreateProps } from '../create-props'
13
+
14
+ /**
15
+ * Props for the {@link AutocompleteItem} component.
16
+ */
17
+ export interface AutocompleteItemProps extends Partial<CreateProps<Props, Events>> {}
18
+
19
+ export const AutocompleteItem: Component<PropsWithElement<
20
+ AutocompleteItemProps,
21
+ AutocompleteItemElement
22
+ >> = createComponent<
23
+ AutocompleteItemProps,
24
+ AutocompleteItemElement
25
+ >(
26
+ 'prosekit-autocomplete-item',
27
+ Object.keys(autocompleteItemProps),
28
+ Object.keys(autocompleteItemEvents),
29
+ )
@@ -0,0 +1,29 @@
1
+ import {
2
+ type AutocompleteListElement,
3
+ type AutocompleteListProps as Props,
4
+ type AutocompleteListEvents as Events,
5
+ autocompleteListProps,
6
+ autocompleteListEvents,
7
+ } from '@prosekit/web/autocomplete'
8
+ import type { Component } from 'solid-js'
9
+
10
+ import type { PropsWithElement } from '../../types'
11
+ import { createComponent } from '../create-component'
12
+ import type { CreateProps } from '../create-props'
13
+
14
+ /**
15
+ * Props for the {@link AutocompleteList} component.
16
+ */
17
+ export interface AutocompleteListProps extends Partial<CreateProps<Props, Events>> {}
18
+
19
+ export const AutocompleteList: Component<PropsWithElement<
20
+ AutocompleteListProps,
21
+ AutocompleteListElement
22
+ >> = createComponent<
23
+ AutocompleteListProps,
24
+ AutocompleteListElement
25
+ >(
26
+ 'prosekit-autocomplete-list',
27
+ Object.keys(autocompleteListProps),
28
+ Object.keys(autocompleteListEvents),
29
+ )
@@ -0,0 +1,29 @@
1
+ import {
2
+ type AutocompletePopoverElement,
3
+ type AutocompletePopoverProps as Props,
4
+ type AutocompletePopoverEvents as Events,
5
+ autocompletePopoverProps,
6
+ autocompletePopoverEvents,
7
+ } from '@prosekit/web/autocomplete'
8
+ import type { Component } from 'solid-js'
9
+
10
+ import type { PropsWithElement } from '../../types'
11
+ import { createComponent } from '../create-component'
12
+ import type { CreateProps } from '../create-props'
13
+
14
+ /**
15
+ * Props for the {@link AutocompletePopover} component.
16
+ */
17
+ export interface AutocompletePopoverProps extends Partial<CreateProps<Props, Events>> {}
18
+
19
+ export const AutocompletePopover: Component<PropsWithElement<
20
+ AutocompletePopoverProps,
21
+ AutocompletePopoverElement
22
+ >> = createComponent<
23
+ AutocompletePopoverProps,
24
+ AutocompletePopoverElement
25
+ >(
26
+ 'prosekit-autocomplete-popover',
27
+ Object.keys(autocompletePopoverProps),
28
+ Object.keys(autocompletePopoverEvents),
29
+ )
@@ -0,0 +1,7 @@
1
+ export { AutocompleteEmpty, type AutocompleteEmptyProps } from './autocomplete-empty.gen'
2
+
3
+ export { AutocompleteItem, type AutocompleteItemProps } from './autocomplete-item.gen'
4
+
5
+ export { AutocompleteList, type AutocompleteListProps } from './autocomplete-list.gen'
6
+
7
+ export { AutocompletePopover, type AutocompletePopoverProps } from './autocomplete-popover.gen'
@@ -0,0 +1,29 @@
1
+ import {
2
+ type BlockHandleAddElement,
3
+ type BlockHandleAddProps as Props,
4
+ type BlockHandleAddEvents as Events,
5
+ blockHandleAddProps,
6
+ blockHandleAddEvents,
7
+ } from '@prosekit/web/block-handle'
8
+ import type { Component } from 'solid-js'
9
+
10
+ import type { PropsWithElement } from '../../types'
11
+ import { createComponent } from '../create-component'
12
+ import type { CreateProps } from '../create-props'
13
+
14
+ /**
15
+ * Props for the {@link BlockHandleAdd} component.
16
+ */
17
+ export interface BlockHandleAddProps extends Partial<CreateProps<Props, Events>> {}
18
+
19
+ export const BlockHandleAdd: Component<PropsWithElement<
20
+ BlockHandleAddProps,
21
+ BlockHandleAddElement
22
+ >> = createComponent<
23
+ BlockHandleAddProps,
24
+ BlockHandleAddElement
25
+ >(
26
+ 'prosekit-block-handle-add',
27
+ Object.keys(blockHandleAddProps),
28
+ Object.keys(blockHandleAddEvents),
29
+ )
@@ -0,0 +1,29 @@
1
+ import {
2
+ type BlockHandleDraggableElement,
3
+ type BlockHandleDraggableProps as Props,
4
+ type BlockHandleDraggableEvents as Events,
5
+ blockHandleDraggableProps,
6
+ blockHandleDraggableEvents,
7
+ } from '@prosekit/web/block-handle'
8
+ import type { Component } from 'solid-js'
9
+
10
+ import type { PropsWithElement } from '../../types'
11
+ import { createComponent } from '../create-component'
12
+ import type { CreateProps } from '../create-props'
13
+
14
+ /**
15
+ * Props for the {@link BlockHandleDraggable} component.
16
+ */
17
+ export interface BlockHandleDraggableProps extends Partial<CreateProps<Props, Events>> {}
18
+
19
+ export const BlockHandleDraggable: Component<PropsWithElement<
20
+ BlockHandleDraggableProps,
21
+ BlockHandleDraggableElement
22
+ >> = createComponent<
23
+ BlockHandleDraggableProps,
24
+ BlockHandleDraggableElement
25
+ >(
26
+ 'prosekit-block-handle-draggable',
27
+ Object.keys(blockHandleDraggableProps),
28
+ Object.keys(blockHandleDraggableEvents),
29
+ )
@@ -0,0 +1,29 @@
1
+ import {
2
+ type BlockHandlePopoverElement,
3
+ type BlockHandlePopoverProps as Props,
4
+ type BlockHandlePopoverEvents as Events,
5
+ blockHandlePopoverProps,
6
+ blockHandlePopoverEvents,
7
+ } from '@prosekit/web/block-handle'
8
+ import type { Component } from 'solid-js'
9
+
10
+ import type { PropsWithElement } from '../../types'
11
+ import { createComponent } from '../create-component'
12
+ import type { CreateProps } from '../create-props'
13
+
14
+ /**
15
+ * Props for the {@link BlockHandlePopover} component.
16
+ */
17
+ export interface BlockHandlePopoverProps extends Partial<CreateProps<Props, Events>> {}
18
+
19
+ export const BlockHandlePopover: Component<PropsWithElement<
20
+ BlockHandlePopoverProps,
21
+ BlockHandlePopoverElement
22
+ >> = createComponent<
23
+ BlockHandlePopoverProps,
24
+ BlockHandlePopoverElement
25
+ >(
26
+ 'prosekit-block-handle-popover',
27
+ Object.keys(blockHandlePopoverProps),
28
+ Object.keys(blockHandlePopoverEvents),
29
+ )
@@ -0,0 +1,5 @@
1
+ export { BlockHandleAdd, type BlockHandleAddProps } from './block-handle-add.gen'
2
+
3
+ export { BlockHandleDraggable, type BlockHandleDraggableProps } from './block-handle-draggable.gen'
4
+
5
+ export { BlockHandlePopover, type BlockHandlePopoverProps } from './block-handle-popover.gen'