@prosekit/solid 0.6.3 → 0.6.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{create-component-DOv1yHjo.js → create-component-B7NzEJxP.js} +3 -3
- package/dist/create-component-B7NzEJxP.js.map +1 -0
- package/dist/{create-props-IUcX0Ggy.d.ts → create-props-CFK4CtjG.d.ts} +1 -1
- package/dist/create-props-CFK4CtjG.d.ts.map +1 -0
- package/dist/{editor-context-B5bsBkGo.js → editor-context-CAdqwRwB.js} +1 -1
- package/dist/editor-context-CAdqwRwB.js.map +1 -0
- package/dist/prosekit-solid-autocomplete.d.ts +2 -3
- package/dist/prosekit-solid-autocomplete.d.ts.map +1 -1
- package/dist/prosekit-solid-autocomplete.js +1 -1
- package/dist/prosekit-solid-autocomplete.js.map +1 -1
- package/dist/prosekit-solid-block-handle.d.ts +2 -3
- package/dist/prosekit-solid-block-handle.d.ts.map +1 -1
- package/dist/prosekit-solid-block-handle.js +1 -1
- package/dist/prosekit-solid-block-handle.js.map +1 -1
- package/dist/prosekit-solid-drop-indicator.d.ts +2 -3
- package/dist/prosekit-solid-drop-indicator.d.ts.map +1 -1
- package/dist/prosekit-solid-drop-indicator.js +1 -1
- package/dist/prosekit-solid-drop-indicator.js.map +1 -1
- package/dist/prosekit-solid-inline-popover.d.ts +2 -3
- package/dist/prosekit-solid-inline-popover.d.ts.map +1 -1
- package/dist/prosekit-solid-inline-popover.js +1 -1
- package/dist/prosekit-solid-inline-popover.js.map +1 -1
- package/dist/prosekit-solid-popover.d.ts +2 -3
- package/dist/prosekit-solid-popover.d.ts.map +1 -1
- package/dist/prosekit-solid-popover.js +1 -1
- package/dist/prosekit-solid-popover.js.map +1 -1
- package/dist/prosekit-solid-resizable.d.ts +2 -3
- package/dist/prosekit-solid-resizable.d.ts.map +1 -1
- package/dist/prosekit-solid-resizable.js +1 -1
- package/dist/prosekit-solid-resizable.js.map +1 -1
- package/dist/prosekit-solid-table-handle.d.ts +2 -3
- package/dist/prosekit-solid-table-handle.d.ts.map +1 -1
- package/dist/prosekit-solid-table-handle.js +1 -1
- package/dist/prosekit-solid-table-handle.js.map +1 -1
- package/dist/prosekit-solid-tooltip.d.ts +2 -3
- package/dist/prosekit-solid-tooltip.d.ts.map +1 -1
- package/dist/prosekit-solid-tooltip.js +1 -1
- package/dist/prosekit-solid-tooltip.js.map +1 -1
- package/dist/prosekit-solid.d.ts +3 -1
- package/dist/prosekit-solid.d.ts.map +1 -1
- package/dist/prosekit-solid.js +10 -10
- package/dist/prosekit-solid.js.map +1 -1
- package/dist/{types-VT1O6Xnr.d.ts → types-Bx9mKDTJ.d.ts} +1 -2
- package/dist/types-Bx9mKDTJ.d.ts.map +1 -0
- package/package.json +5 -5
- package/src/components/create-component.ts +1 -1
- package/src/components/prosekit.ts +6 -10
- package/src/contexts/editor-context.ts +2 -9
- package/src/extensions/solid-mark-view.ts +2 -11
- package/src/extensions/solid-node-view.ts +2 -11
- package/src/hooks/use-doc-change.ts +1 -4
- package/src/hooks/use-editor-derived-value.ts +2 -8
- package/src/hooks/use-editor-extension.ts +2 -10
- package/src/hooks/use-editor.ts +2 -12
- package/src/hooks/use-extension.ts +1 -5
- package/src/hooks/use-keymap.ts +2 -8
- package/src/hooks/use-priority-extension.ts +1 -5
- package/src/hooks/use-state-update.ts +1 -4
- package/src/index.ts +4 -18
- package/src/types.ts +1 -5
- package/dist/create-component-DOv1yHjo.js.map +0 -1
- package/dist/create-props-IUcX0Ggy.d.ts.map +0 -1
- package/dist/editor-context-B5bsBkGo.js.map +0 -1
- package/dist/types-VT1O6Xnr.d.ts.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as useEditorContext } from "./editor-context-
|
|
1
|
+
import { n as useEditorContext } from "./editor-context-CAdqwRwB.js";
|
|
2
2
|
import h from "solid-js/h";
|
|
3
3
|
|
|
4
4
|
//#region src/components/create-component.ts
|
|
@@ -29,7 +29,7 @@ function createComponent(tagName, propNames, eventNames) {
|
|
|
29
29
|
}
|
|
30
30
|
const editor = useEditorContext();
|
|
31
31
|
if (hasEditor && editor) properties["prop:editor"] = () => props["editor"] || editor;
|
|
32
|
-
return h(tagName, {
|
|
32
|
+
return () => h(tagName, {
|
|
33
33
|
...properties,
|
|
34
34
|
...eventHandlers
|
|
35
35
|
});
|
|
@@ -39,4 +39,4 @@ function createComponent(tagName, propNames, eventNames) {
|
|
|
39
39
|
|
|
40
40
|
//#endregion
|
|
41
41
|
export { createComponent as t };
|
|
42
|
-
//# sourceMappingURL=create-component-
|
|
42
|
+
//# sourceMappingURL=create-component-B7NzEJxP.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-component-B7NzEJxP.js","names":[],"sources":["../src/components/create-component.ts"],"sourcesContent":["import type { AnyFunction } from '@prosekit/core'\nimport type { Component } from 'solid-js'\nimport h from 'solid-js/h'\n\nimport { useEditorContext } from '../contexts/editor-context'\nimport type { PropsWithElement } from '../types'\n\nexport function createComponent<\n Props extends object,\n CustomElement extends HTMLElement,\n>(\n tagName: string,\n propNames: string[],\n eventNames: string[],\n): Component<PropsWithElement<Props, CustomElement>> {\n const hasEditor = propNames.includes('editor')\n const lowerCaseEventNameMap = new Map(\n eventNames.map((name) => [name.toLowerCase(), name]),\n )\n\n const Component = (props: Record<string, unknown>) => {\n const properties: Record<string, () => unknown> = {}\n const eventHandlers: Record<string, AnyFunction> = {}\n\n for (const name of Object.keys(props)) {\n if (propNames.includes(name)) {\n properties['prop:' + name] = () => props[name]\n continue\n }\n\n if (name.startsWith('on')) {\n const lowerCaseEventName = name.slice(2).toLowerCase()\n const eventName = lowerCaseEventNameMap.get(lowerCaseEventName)\n if (eventName) {\n const extractDetail = eventName.endsWith('Change')\n eventHandlers['on:' + eventName] = (event: Event) => {\n const handler = props[name] as AnyFunction | null\n if (typeof handler === 'function') {\n handler(extractDetail ? (event as CustomEvent).detail : event)\n }\n }\n continue\n }\n }\n\n properties[name] = () => props[name]\n }\n\n const editor = useEditorContext()\n\n if (hasEditor && editor) {\n properties['prop:editor'] = () => props['editor'] || editor\n }\n\n return () => h(tagName, { ...properties, ...eventHandlers })\n }\n\n // eslint-disable-next-line @typescript-eslint/no-unsafe-return\n return Component as any\n}\n"],"mappings":";;;;AAOA,SAAgB,gBAId,SACA,WACA,YACmD;CACnD,MAAM,YAAY,UAAU,SAAS,SAAS;CAC9C,MAAM,wBAAwB,IAAI,IAChC,WAAW,KAAK,SAAS,CAAC,KAAK,aAAa,EAAE,KAAK,CAAC,CACrD;CAED,MAAM,aAAa,UAAmC;EACpD,MAAM,aAA4C,EAAE;EACpD,MAAM,gBAA6C,EAAE;AAErD,OAAK,MAAM,QAAQ,OAAO,KAAK,MAAM,EAAE;AACrC,OAAI,UAAU,SAAS,KAAK,EAAE;AAC5B,eAAW,UAAU,cAAc,MAAM;AACzC;;AAGF,OAAI,KAAK,WAAW,KAAK,EAAE;IACzB,MAAM,qBAAqB,KAAK,MAAM,EAAE,CAAC,aAAa;IACtD,MAAM,YAAY,sBAAsB,IAAI,mBAAmB;AAC/D,QAAI,WAAW;KACb,MAAM,gBAAgB,UAAU,SAAS,SAAS;AAClD,mBAAc,QAAQ,cAAc,UAAiB;MACnD,MAAM,UAAU,MAAM;AACtB,UAAI,OAAO,YAAY,WACrB,SAAQ,gBAAiB,MAAsB,SAAS,MAAM;;AAGlE;;;AAIJ,cAAW,cAAc,MAAM;;EAGjC,MAAM,SAAS,kBAAkB;AAEjC,MAAI,aAAa,OACf,YAAW,uBAAuB,MAAM,aAAa;AAGvD,eAAa,EAAE,SAAS;GAAE,GAAG;GAAY,GAAG;GAAe,CAAC;;AAI9D,QAAO"}
|
|
@@ -3,4 +3,4 @@ type CreateProps<Props extends { [PropName in keyof Props]: unknown }, Events ex
|
|
|
3
3
|
type CreateEventProps<Events extends { [EventName in keyof Events]: CustomEvent }> = { [EventName in keyof Events as `on${Capitalize<string & EventName>}`]: (event: EventName extends `${string}Change` ? Events[EventName]['detail'] : Events[EventName]) => void };
|
|
4
4
|
//#endregion
|
|
5
5
|
export { CreateProps as t };
|
|
6
|
-
//# sourceMappingURL=create-props-
|
|
6
|
+
//# sourceMappingURL=create-props-CFK4CtjG.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-props-CFK4CtjG.d.ts","names":[],"sources":["../src/components/create-props.ts"],"mappings":";KAAY,WAAA,oCACyB,KAAA,mDACE,MAAA,GAAS,WAAA,MAC5C,KAAA,GAAQ,gBAAA,CAAiB,MAAA;AAAA,KAExB,gBAAA,sCACkC,MAAA,GAAS,WAAA,4BAE1B,MAAA,SAAe,UAAA,UAAoB,SAAA,OACrD,KAAA,EAAO,SAAA,6BAAsC,MAAA,CAAO,SAAA,cAChD,MAAA,CAAO,SAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"editor-context-CAdqwRwB.js","names":[],"sources":["../src/contexts/editor-context.ts"],"sourcesContent":["import type { Editor, Extension } from '@prosekit/core'\nimport { createContext, useContext, type ContextProviderComponent } from 'solid-js'\n\nconst editorContext = createContext<Editor | null>(null)\n\n/**\n * @internal\n */\nexport function useEditorContext<E extends Extension>(): Editor<E> | null {\n return useContext(editorContext)\n}\n\n/**\n * @internal\n */\nexport const EditorContextProvider: ContextProviderComponent<Editor | null> = editorContext.Provider\n"],"mappings":";;;AAGA,MAAM,gBAAgB,cAA6B,KAAK;;;;AAKxD,SAAgB,mBAA0D;AACxE,QAAO,WAAW,cAAc;;;;;AAMlC,MAAa,wBAAiE,cAAc"}
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import { i as PropsWithElement } from "./types-
|
|
2
|
-
import { t as CreateProps } from "./create-props-
|
|
1
|
+
import { i as PropsWithElement } from "./types-Bx9mKDTJ.js";
|
|
2
|
+
import { t as CreateProps } from "./create-props-CFK4CtjG.js";
|
|
3
3
|
import { Component } from "solid-js";
|
|
4
4
|
import { AutocompleteEmptyElement, AutocompleteEmptyEvents, AutocompleteEmptyProps as AutocompleteEmptyProps$1, AutocompleteItemElement, AutocompleteItemEvents, AutocompleteItemProps as AutocompleteItemProps$1, AutocompleteListElement, AutocompleteListEvents, AutocompleteListProps as AutocompleteListProps$1, AutocompletePopoverElement, AutocompletePopoverEvents, AutocompletePopoverProps as AutocompletePopoverProps$1 } from "@prosekit/web/autocomplete";
|
|
5
5
|
|
|
6
6
|
//#region src/components/autocomplete/autocomplete-empty.gen.d.ts
|
|
7
|
-
|
|
8
7
|
/**
|
|
9
8
|
* Props for the {@link AutocompleteEmpty} component.
|
|
10
9
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prosekit-solid-autocomplete.d.ts","names":[],"sources":["../src/components/autocomplete/autocomplete-empty.gen.ts","../src/components/autocomplete/autocomplete-item.gen.ts","../src/components/autocomplete/autocomplete-list.gen.ts","../src/components/autocomplete/autocomplete-popover.gen.ts"],"
|
|
1
|
+
{"version":3,"file":"prosekit-solid-autocomplete.d.ts","names":[],"sources":["../src/components/autocomplete/autocomplete-empty.gen.ts","../src/components/autocomplete/autocomplete-item.gen.ts","../src/components/autocomplete/autocomplete-list.gen.ts","../src/components/autocomplete/autocomplete-popover.gen.ts"],"mappings":";;;;;;;;AAgBA;UAAiB,sBAAA,SAA+B,OAAA,CAAQ,WAAA,CAAY,wBAAA,EAAO,uBAAA;AAAA,cAE9D,iBAAA,EAAmB,SAAA,CAAU,gBAAA,CACxC,sBAAA,EACA,wBAAA;;;;;AAJF;UCAiB,qBAAA,SAA8B,OAAA,CAAQ,WAAA,CAAY,uBAAA,EAAO,sBAAA;AAAA,cAE7D,gBAAA,EAAkB,SAAA,CAAU,gBAAA,CACvC,qBAAA,EACA,uBAAA;;;;;ADJF;UEAiB,qBAAA,SAA8B,OAAA,CAAQ,WAAA,CAAY,uBAAA,EAAO,sBAAA;AAAA,cAE7D,gBAAA,EAAkB,SAAA,CAAU,gBAAA,CACvC,qBAAA,EACA,uBAAA;;;;;AFJF;UGAiB,wBAAA,SAAiC,OAAA,CAAQ,WAAA,CAAY,0BAAA,EAAO,yBAAA;AAAA,cAEhE,mBAAA,EAAqB,SAAA,CAAU,gBAAA,CAC1C,wBAAA,EACA,0BAAA"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as createComponent } from "./create-component-
|
|
1
|
+
import { t as createComponent } from "./create-component-B7NzEJxP.js";
|
|
2
2
|
import { autocompleteEmptyEvents, autocompleteEmptyProps, autocompleteItemEvents, autocompleteItemProps, autocompleteListEvents, autocompleteListProps, autocompletePopoverEvents, autocompletePopoverProps } from "@prosekit/web/autocomplete";
|
|
3
3
|
|
|
4
4
|
//#region src/components/autocomplete/autocomplete-empty.gen.ts
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prosekit-solid-autocomplete.js","names":[
|
|
1
|
+
{"version":3,"file":"prosekit-solid-autocomplete.js","names":[],"sources":["../src/components/autocomplete/autocomplete-empty.gen.ts","../src/components/autocomplete/autocomplete-item.gen.ts","../src/components/autocomplete/autocomplete-list.gen.ts","../src/components/autocomplete/autocomplete-popover.gen.ts"],"sourcesContent":["import { \n type AutocompleteEmptyElement,\n type AutocompleteEmptyProps as Props,\n type AutocompleteEmptyEvents as Events,\n autocompleteEmptyProps,\n autocompleteEmptyEvents,\n} from '@prosekit/web/autocomplete'\nimport type { Component } from 'solid-js'\n\nimport type { PropsWithElement } from '../../types'\nimport { createComponent } from '../create-component'\nimport type { CreateProps } from '../create-props'\n\n/**\n * Props for the {@link AutocompleteEmpty} component.\n */\nexport interface AutocompleteEmptyProps extends Partial<CreateProps<Props, Events>> {}\n\nexport const AutocompleteEmpty: Component<PropsWithElement<\n AutocompleteEmptyProps,\n AutocompleteEmptyElement\n>> = createComponent<\n AutocompleteEmptyProps,\n AutocompleteEmptyElement\n>(\n 'prosekit-autocomplete-empty', \n Object.keys(autocompleteEmptyProps),\n Object.keys(autocompleteEmptyEvents),\n)\n","import { \n type AutocompleteItemElement,\n type AutocompleteItemProps as Props,\n type AutocompleteItemEvents as Events,\n autocompleteItemProps,\n autocompleteItemEvents,\n} from '@prosekit/web/autocomplete'\nimport type { Component } from 'solid-js'\n\nimport type { PropsWithElement } from '../../types'\nimport { createComponent } from '../create-component'\nimport type { CreateProps } from '../create-props'\n\n/**\n * Props for the {@link AutocompleteItem} component.\n */\nexport interface AutocompleteItemProps extends Partial<CreateProps<Props, Events>> {}\n\nexport const AutocompleteItem: Component<PropsWithElement<\n AutocompleteItemProps,\n AutocompleteItemElement\n>> = createComponent<\n AutocompleteItemProps,\n AutocompleteItemElement\n>(\n 'prosekit-autocomplete-item', \n Object.keys(autocompleteItemProps),\n Object.keys(autocompleteItemEvents),\n)\n","import { \n type AutocompleteListElement,\n type AutocompleteListProps as Props,\n type AutocompleteListEvents as Events,\n autocompleteListProps,\n autocompleteListEvents,\n} from '@prosekit/web/autocomplete'\nimport type { Component } from 'solid-js'\n\nimport type { PropsWithElement } from '../../types'\nimport { createComponent } from '../create-component'\nimport type { CreateProps } from '../create-props'\n\n/**\n * Props for the {@link AutocompleteList} component.\n */\nexport interface AutocompleteListProps extends Partial<CreateProps<Props, Events>> {}\n\nexport const AutocompleteList: Component<PropsWithElement<\n AutocompleteListProps,\n AutocompleteListElement\n>> = createComponent<\n AutocompleteListProps,\n AutocompleteListElement\n>(\n 'prosekit-autocomplete-list', \n Object.keys(autocompleteListProps),\n Object.keys(autocompleteListEvents),\n)\n","import { \n type AutocompletePopoverElement,\n type AutocompletePopoverProps as Props,\n type AutocompletePopoverEvents as Events,\n autocompletePopoverProps,\n autocompletePopoverEvents,\n} from '@prosekit/web/autocomplete'\nimport type { Component } from 'solid-js'\n\nimport type { PropsWithElement } from '../../types'\nimport { createComponent } from '../create-component'\nimport type { CreateProps } from '../create-props'\n\n/**\n * Props for the {@link AutocompletePopover} component.\n */\nexport interface AutocompletePopoverProps extends Partial<CreateProps<Props, Events>> {}\n\nexport const AutocompletePopover: Component<PropsWithElement<\n AutocompletePopoverProps,\n AutocompletePopoverElement\n>> = createComponent<\n AutocompletePopoverProps,\n AutocompletePopoverElement\n>(\n 'prosekit-autocomplete-popover', \n Object.keys(autocompletePopoverProps),\n Object.keys(autocompletePopoverEvents),\n)\n"],"mappings":";;;;AAkBA,MAAa,oBAGR,gBAIH,+BACA,OAAO,KAAK,uBAAuB,EACnC,OAAO,KAAK,wBAAwB,CACrC;;;;ACVD,MAAa,mBAGR,gBAIH,8BACA,OAAO,KAAK,sBAAsB,EAClC,OAAO,KAAK,uBAAuB,CACpC;;;;ACVD,MAAa,mBAGR,gBAIH,8BACA,OAAO,KAAK,sBAAsB,EAClC,OAAO,KAAK,uBAAuB,CACpC;;;;ACVD,MAAa,sBAGR,gBAIH,iCACA,OAAO,KAAK,yBAAyB,EACrC,OAAO,KAAK,0BAA0B,CACvC"}
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import { i as PropsWithElement } from "./types-
|
|
2
|
-
import { t as CreateProps } from "./create-props-
|
|
1
|
+
import { i as PropsWithElement } from "./types-Bx9mKDTJ.js";
|
|
2
|
+
import { t as CreateProps } from "./create-props-CFK4CtjG.js";
|
|
3
3
|
import { Component } from "solid-js";
|
|
4
4
|
import { BlockHandleAddElement, BlockHandleAddEvents, BlockHandleAddProps as BlockHandleAddProps$1, BlockHandleDraggableElement, BlockHandleDraggableEvents, BlockHandleDraggableProps as BlockHandleDraggableProps$1, BlockHandlePopoverElement, BlockHandlePopoverEvents, BlockHandlePopoverProps as BlockHandlePopoverProps$1 } from "@prosekit/web/block-handle";
|
|
5
5
|
|
|
6
6
|
//#region src/components/block-handle/block-handle-add.gen.d.ts
|
|
7
|
-
|
|
8
7
|
/**
|
|
9
8
|
* Props for the {@link BlockHandleAdd} component.
|
|
10
9
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prosekit-solid-block-handle.d.ts","names":[],"sources":["../src/components/block-handle/block-handle-add.gen.ts","../src/components/block-handle/block-handle-draggable.gen.ts","../src/components/block-handle/block-handle-popover.gen.ts"],"
|
|
1
|
+
{"version":3,"file":"prosekit-solid-block-handle.d.ts","names":[],"sources":["../src/components/block-handle/block-handle-add.gen.ts","../src/components/block-handle/block-handle-draggable.gen.ts","../src/components/block-handle/block-handle-popover.gen.ts"],"mappings":";;;;;;;;AAgBA;UAAiB,mBAAA,SAA4B,OAAA,CAAQ,WAAA,CAAY,qBAAA,EAAO,oBAAA;AAAA,cAE3D,cAAA,EAAgB,SAAA,CAAU,gBAAA,CACrC,mBAAA,EACA,qBAAA;;;;;AAJF;UCAiB,yBAAA,SAAkC,OAAA,CAAQ,WAAA,CAAY,2BAAA,EAAO,0BAAA;AAAA,cAEjE,oBAAA,EAAsB,SAAA,CAAU,gBAAA,CAC3C,yBAAA,EACA,2BAAA;;;;;ADJF;UEAiB,uBAAA,SAAgC,OAAA,CAAQ,WAAA,CAAY,yBAAA,EAAO,wBAAA;AAAA,cAE/D,kBAAA,EAAoB,SAAA,CAAU,gBAAA,CACzC,uBAAA,EACA,yBAAA"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as createComponent } from "./create-component-
|
|
1
|
+
import { t as createComponent } from "./create-component-B7NzEJxP.js";
|
|
2
2
|
import { blockHandleAddEvents, blockHandleAddProps, blockHandleDraggableEvents, blockHandleDraggableProps, blockHandlePopoverEvents, blockHandlePopoverProps } from "@prosekit/web/block-handle";
|
|
3
3
|
|
|
4
4
|
//#region src/components/block-handle/block-handle-add.gen.ts
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prosekit-solid-block-handle.js","names":[
|
|
1
|
+
{"version":3,"file":"prosekit-solid-block-handle.js","names":[],"sources":["../src/components/block-handle/block-handle-add.gen.ts","../src/components/block-handle/block-handle-draggable.gen.ts","../src/components/block-handle/block-handle-popover.gen.ts"],"sourcesContent":["import { \n type BlockHandleAddElement,\n type BlockHandleAddProps as Props,\n type BlockHandleAddEvents as Events,\n blockHandleAddProps,\n blockHandleAddEvents,\n} from '@prosekit/web/block-handle'\nimport type { Component } from 'solid-js'\n\nimport type { PropsWithElement } from '../../types'\nimport { createComponent } from '../create-component'\nimport type { CreateProps } from '../create-props'\n\n/**\n * Props for the {@link BlockHandleAdd} component.\n */\nexport interface BlockHandleAddProps extends Partial<CreateProps<Props, Events>> {}\n\nexport const BlockHandleAdd: Component<PropsWithElement<\n BlockHandleAddProps,\n BlockHandleAddElement\n>> = createComponent<\n BlockHandleAddProps,\n BlockHandleAddElement\n>(\n 'prosekit-block-handle-add', \n Object.keys(blockHandleAddProps),\n Object.keys(blockHandleAddEvents),\n)\n","import { \n type BlockHandleDraggableElement,\n type BlockHandleDraggableProps as Props,\n type BlockHandleDraggableEvents as Events,\n blockHandleDraggableProps,\n blockHandleDraggableEvents,\n} from '@prosekit/web/block-handle'\nimport type { Component } from 'solid-js'\n\nimport type { PropsWithElement } from '../../types'\nimport { createComponent } from '../create-component'\nimport type { CreateProps } from '../create-props'\n\n/**\n * Props for the {@link BlockHandleDraggable} component.\n */\nexport interface BlockHandleDraggableProps extends Partial<CreateProps<Props, Events>> {}\n\nexport const BlockHandleDraggable: Component<PropsWithElement<\n BlockHandleDraggableProps,\n BlockHandleDraggableElement\n>> = createComponent<\n BlockHandleDraggableProps,\n BlockHandleDraggableElement\n>(\n 'prosekit-block-handle-draggable', \n Object.keys(blockHandleDraggableProps),\n Object.keys(blockHandleDraggableEvents),\n)\n","import { \n type BlockHandlePopoverElement,\n type BlockHandlePopoverProps as Props,\n type BlockHandlePopoverEvents as Events,\n blockHandlePopoverProps,\n blockHandlePopoverEvents,\n} from '@prosekit/web/block-handle'\nimport type { Component } from 'solid-js'\n\nimport type { PropsWithElement } from '../../types'\nimport { createComponent } from '../create-component'\nimport type { CreateProps } from '../create-props'\n\n/**\n * Props for the {@link BlockHandlePopover} component.\n */\nexport interface BlockHandlePopoverProps extends Partial<CreateProps<Props, Events>> {}\n\nexport const BlockHandlePopover: Component<PropsWithElement<\n BlockHandlePopoverProps,\n BlockHandlePopoverElement\n>> = createComponent<\n BlockHandlePopoverProps,\n BlockHandlePopoverElement\n>(\n 'prosekit-block-handle-popover', \n Object.keys(blockHandlePopoverProps),\n Object.keys(blockHandlePopoverEvents),\n)\n"],"mappings":";;;;AAkBA,MAAa,iBAGR,gBAIH,6BACA,OAAO,KAAK,oBAAoB,EAChC,OAAO,KAAK,qBAAqB,CAClC;;;;ACVD,MAAa,uBAGR,gBAIH,mCACA,OAAO,KAAK,0BAA0B,EACtC,OAAO,KAAK,2BAA2B,CACxC;;;;ACVD,MAAa,qBAGR,gBAIH,iCACA,OAAO,KAAK,wBAAwB,EACpC,OAAO,KAAK,yBAAyB,CACtC"}
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import { i as PropsWithElement } from "./types-
|
|
2
|
-
import { t as CreateProps } from "./create-props-
|
|
1
|
+
import { i as PropsWithElement } from "./types-Bx9mKDTJ.js";
|
|
2
|
+
import { t as CreateProps } from "./create-props-CFK4CtjG.js";
|
|
3
3
|
import { Component } from "solid-js";
|
|
4
4
|
import { DropIndicatorElement, DropIndicatorEvents, DropIndicatorProps as DropIndicatorProps$1 } from "@prosekit/web/drop-indicator";
|
|
5
5
|
|
|
6
6
|
//#region src/components/drop-indicator/drop-indicator.gen.d.ts
|
|
7
|
-
|
|
8
7
|
/**
|
|
9
8
|
* Props for the {@link DropIndicator} component.
|
|
10
9
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prosekit-solid-drop-indicator.d.ts","names":[],"sources":["../src/components/drop-indicator/drop-indicator.gen.ts"],"
|
|
1
|
+
{"version":3,"file":"prosekit-solid-drop-indicator.d.ts","names":[],"sources":["../src/components/drop-indicator/drop-indicator.gen.ts"],"mappings":";;;;;;;;AAgBA;UAAiB,kBAAA,SAA2B,OAAA,CAAQ,WAAA,CAAY,oBAAA,EAAO,mBAAA;AAAA,cAE1D,aAAA,EAAe,SAAA,CAAU,gBAAA,CACpC,kBAAA,EACA,oBAAA"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as createComponent } from "./create-component-
|
|
1
|
+
import { t as createComponent } from "./create-component-B7NzEJxP.js";
|
|
2
2
|
import { dropIndicatorEvents, dropIndicatorProps } from "@prosekit/web/drop-indicator";
|
|
3
3
|
|
|
4
4
|
//#region src/components/drop-indicator/drop-indicator.gen.ts
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prosekit-solid-drop-indicator.js","names":[
|
|
1
|
+
{"version":3,"file":"prosekit-solid-drop-indicator.js","names":[],"sources":["../src/components/drop-indicator/drop-indicator.gen.ts"],"sourcesContent":["import { \n type DropIndicatorElement,\n type DropIndicatorProps as Props,\n type DropIndicatorEvents as Events,\n dropIndicatorProps,\n dropIndicatorEvents,\n} from '@prosekit/web/drop-indicator'\nimport type { Component } from 'solid-js'\n\nimport type { PropsWithElement } from '../../types'\nimport { createComponent } from '../create-component'\nimport type { CreateProps } from '../create-props'\n\n/**\n * Props for the {@link DropIndicator} component.\n */\nexport interface DropIndicatorProps extends Partial<CreateProps<Props, Events>> {}\n\nexport const DropIndicator: Component<PropsWithElement<\n DropIndicatorProps,\n DropIndicatorElement\n>> = createComponent<\n DropIndicatorProps,\n DropIndicatorElement\n>(\n 'prosekit-drop-indicator', \n Object.keys(dropIndicatorProps),\n Object.keys(dropIndicatorEvents),\n)\n"],"mappings":";;;;AAkBA,MAAa,gBAGR,gBAIH,2BACA,OAAO,KAAK,mBAAmB,EAC/B,OAAO,KAAK,oBAAoB,CACjC"}
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import { i as PropsWithElement } from "./types-
|
|
2
|
-
import { t as CreateProps } from "./create-props-
|
|
1
|
+
import { i as PropsWithElement } from "./types-Bx9mKDTJ.js";
|
|
2
|
+
import { t as CreateProps } from "./create-props-CFK4CtjG.js";
|
|
3
3
|
import { Component } from "solid-js";
|
|
4
4
|
import { InlinePopoverElement, InlinePopoverEvents, InlinePopoverProps as InlinePopoverProps$1 } from "@prosekit/web/inline-popover";
|
|
5
5
|
|
|
6
6
|
//#region src/components/inline-popover/inline-popover.gen.d.ts
|
|
7
|
-
|
|
8
7
|
/**
|
|
9
8
|
* Props for the {@link InlinePopover} component.
|
|
10
9
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prosekit-solid-inline-popover.d.ts","names":[],"sources":["../src/components/inline-popover/inline-popover.gen.ts"],"
|
|
1
|
+
{"version":3,"file":"prosekit-solid-inline-popover.d.ts","names":[],"sources":["../src/components/inline-popover/inline-popover.gen.ts"],"mappings":";;;;;;;;AAgBA;UAAiB,kBAAA,SAA2B,OAAA,CAAQ,WAAA,CAAY,oBAAA,EAAO,mBAAA;AAAA,cAE1D,aAAA,EAAe,SAAA,CAAU,gBAAA,CACpC,kBAAA,EACA,oBAAA"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as createComponent } from "./create-component-
|
|
1
|
+
import { t as createComponent } from "./create-component-B7NzEJxP.js";
|
|
2
2
|
import { inlinePopoverEvents, inlinePopoverProps } from "@prosekit/web/inline-popover";
|
|
3
3
|
|
|
4
4
|
//#region src/components/inline-popover/inline-popover.gen.ts
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prosekit-solid-inline-popover.js","names":[
|
|
1
|
+
{"version":3,"file":"prosekit-solid-inline-popover.js","names":[],"sources":["../src/components/inline-popover/inline-popover.gen.ts"],"sourcesContent":["import { \n type InlinePopoverElement,\n type InlinePopoverProps as Props,\n type InlinePopoverEvents as Events,\n inlinePopoverProps,\n inlinePopoverEvents,\n} from '@prosekit/web/inline-popover'\nimport type { Component } from 'solid-js'\n\nimport type { PropsWithElement } from '../../types'\nimport { createComponent } from '../create-component'\nimport type { CreateProps } from '../create-props'\n\n/**\n * Props for the {@link InlinePopover} component.\n */\nexport interface InlinePopoverProps extends Partial<CreateProps<Props, Events>> {}\n\nexport const InlinePopover: Component<PropsWithElement<\n InlinePopoverProps,\n InlinePopoverElement\n>> = createComponent<\n InlinePopoverProps,\n InlinePopoverElement\n>(\n 'prosekit-inline-popover', \n Object.keys(inlinePopoverProps),\n Object.keys(inlinePopoverEvents),\n)\n"],"mappings":";;;;AAkBA,MAAa,gBAGR,gBAIH,2BACA,OAAO,KAAK,mBAAmB,EAC/B,OAAO,KAAK,oBAAoB,CACjC"}
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import { i as PropsWithElement } from "./types-
|
|
2
|
-
import { t as CreateProps } from "./create-props-
|
|
1
|
+
import { i as PropsWithElement } from "./types-Bx9mKDTJ.js";
|
|
2
|
+
import { t as CreateProps } from "./create-props-CFK4CtjG.js";
|
|
3
3
|
import { Component } from "solid-js";
|
|
4
4
|
import { PopoverContentElement, PopoverContentEvents, PopoverContentProps as PopoverContentProps$1, PopoverRootElement, PopoverRootEvents, PopoverRootProps as PopoverRootProps$1, PopoverTriggerElement, PopoverTriggerEvents, PopoverTriggerProps as PopoverTriggerProps$1 } from "@prosekit/web/popover";
|
|
5
5
|
|
|
6
6
|
//#region src/components/popover/popover-content.gen.d.ts
|
|
7
|
-
|
|
8
7
|
/**
|
|
9
8
|
* Props for the {@link PopoverContent} component.
|
|
10
9
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prosekit-solid-popover.d.ts","names":[],"sources":["../src/components/popover/popover-content.gen.ts","../src/components/popover/popover-root.gen.ts","../src/components/popover/popover-trigger.gen.ts"],"
|
|
1
|
+
{"version":3,"file":"prosekit-solid-popover.d.ts","names":[],"sources":["../src/components/popover/popover-content.gen.ts","../src/components/popover/popover-root.gen.ts","../src/components/popover/popover-trigger.gen.ts"],"mappings":";;;;;;;;AAgBA;UAAiB,mBAAA,SAA4B,OAAA,CAAQ,WAAA,CAAY,qBAAA,EAAO,oBAAA;AAAA,cAE3D,cAAA,EAAgB,SAAA,CAAU,gBAAA,CACrC,mBAAA,EACA,qBAAA;;;;;AAJF;UCAiB,gBAAA,SAAyB,OAAA,CAAQ,WAAA,CAAY,kBAAA,EAAO,iBAAA;AAAA,cAExD,WAAA,EAAa,SAAA,CAAU,gBAAA,CAClC,gBAAA,EACA,kBAAA;;;;;ADJF;UEAiB,mBAAA,SAA4B,OAAA,CAAQ,WAAA,CAAY,qBAAA,EAAO,oBAAA;AAAA,cAE3D,cAAA,EAAgB,SAAA,CAAU,gBAAA,CACrC,mBAAA,EACA,qBAAA"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as createComponent } from "./create-component-
|
|
1
|
+
import { t as createComponent } from "./create-component-B7NzEJxP.js";
|
|
2
2
|
import { popoverContentEvents, popoverContentProps, popoverRootEvents, popoverRootProps, popoverTriggerEvents, popoverTriggerProps } from "@prosekit/web/popover";
|
|
3
3
|
|
|
4
4
|
//#region src/components/popover/popover-content.gen.ts
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prosekit-solid-popover.js","names":[
|
|
1
|
+
{"version":3,"file":"prosekit-solid-popover.js","names":[],"sources":["../src/components/popover/popover-content.gen.ts","../src/components/popover/popover-root.gen.ts","../src/components/popover/popover-trigger.gen.ts"],"sourcesContent":["import { \n type PopoverContentElement,\n type PopoverContentProps as Props,\n type PopoverContentEvents as Events,\n popoverContentProps,\n popoverContentEvents,\n} from '@prosekit/web/popover'\nimport type { Component } from 'solid-js'\n\nimport type { PropsWithElement } from '../../types'\nimport { createComponent } from '../create-component'\nimport type { CreateProps } from '../create-props'\n\n/**\n * Props for the {@link PopoverContent} component.\n */\nexport interface PopoverContentProps extends Partial<CreateProps<Props, Events>> {}\n\nexport const PopoverContent: Component<PropsWithElement<\n PopoverContentProps,\n PopoverContentElement\n>> = createComponent<\n PopoverContentProps,\n PopoverContentElement\n>(\n 'prosekit-popover-content', \n Object.keys(popoverContentProps),\n Object.keys(popoverContentEvents),\n)\n","import { \n type PopoverRootElement,\n type PopoverRootProps as Props,\n type PopoverRootEvents as Events,\n popoverRootProps,\n popoverRootEvents,\n} from '@prosekit/web/popover'\nimport type { Component } from 'solid-js'\n\nimport type { PropsWithElement } from '../../types'\nimport { createComponent } from '../create-component'\nimport type { CreateProps } from '../create-props'\n\n/**\n * Props for the {@link PopoverRoot} component.\n */\nexport interface PopoverRootProps extends Partial<CreateProps<Props, Events>> {}\n\nexport const PopoverRoot: Component<PropsWithElement<\n PopoverRootProps,\n PopoverRootElement\n>> = createComponent<\n PopoverRootProps,\n PopoverRootElement\n>(\n 'prosekit-popover-root', \n Object.keys(popoverRootProps),\n Object.keys(popoverRootEvents),\n)\n","import { \n type PopoverTriggerElement,\n type PopoverTriggerProps as Props,\n type PopoverTriggerEvents as Events,\n popoverTriggerProps,\n popoverTriggerEvents,\n} from '@prosekit/web/popover'\nimport type { Component } from 'solid-js'\n\nimport type { PropsWithElement } from '../../types'\nimport { createComponent } from '../create-component'\nimport type { CreateProps } from '../create-props'\n\n/**\n * Props for the {@link PopoverTrigger} component.\n */\nexport interface PopoverTriggerProps extends Partial<CreateProps<Props, Events>> {}\n\nexport const PopoverTrigger: Component<PropsWithElement<\n PopoverTriggerProps,\n PopoverTriggerElement\n>> = createComponent<\n PopoverTriggerProps,\n PopoverTriggerElement\n>(\n 'prosekit-popover-trigger', \n Object.keys(popoverTriggerProps),\n Object.keys(popoverTriggerEvents),\n)\n"],"mappings":";;;;AAkBA,MAAa,iBAGR,gBAIH,4BACA,OAAO,KAAK,oBAAoB,EAChC,OAAO,KAAK,qBAAqB,CAClC;;;;ACVD,MAAa,cAGR,gBAIH,yBACA,OAAO,KAAK,iBAAiB,EAC7B,OAAO,KAAK,kBAAkB,CAC/B;;;;ACVD,MAAa,iBAGR,gBAIH,4BACA,OAAO,KAAK,oBAAoB,EAChC,OAAO,KAAK,qBAAqB,CAClC"}
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import { i as PropsWithElement } from "./types-
|
|
2
|
-
import { t as CreateProps } from "./create-props-
|
|
1
|
+
import { i as PropsWithElement } from "./types-Bx9mKDTJ.js";
|
|
2
|
+
import { t as CreateProps } from "./create-props-CFK4CtjG.js";
|
|
3
3
|
import { Component } from "solid-js";
|
|
4
4
|
import { ResizableHandleElement, ResizableHandleEvents, ResizableHandleProps as ResizableHandleProps$1, ResizableRootElement, ResizableRootEvents, ResizableRootProps as ResizableRootProps$1 } from "@prosekit/web/resizable";
|
|
5
5
|
|
|
6
6
|
//#region src/components/resizable/resizable-handle.gen.d.ts
|
|
7
|
-
|
|
8
7
|
/**
|
|
9
8
|
* Props for the {@link ResizableHandle} component.
|
|
10
9
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prosekit-solid-resizable.d.ts","names":[],"sources":["../src/components/resizable/resizable-handle.gen.ts","../src/components/resizable/resizable-root.gen.ts"],"
|
|
1
|
+
{"version":3,"file":"prosekit-solid-resizable.d.ts","names":[],"sources":["../src/components/resizable/resizable-handle.gen.ts","../src/components/resizable/resizable-root.gen.ts"],"mappings":";;;;;;;;AAgBA;UAAiB,oBAAA,SAA6B,OAAA,CAAQ,WAAA,CAAY,sBAAA,EAAO,qBAAA;AAAA,cAE5D,eAAA,EAAiB,SAAA,CAAU,gBAAA,CACtC,oBAAA,EACA,sBAAA;;;;;AAJF;UCAiB,kBAAA,SAA2B,OAAA,CAAQ,WAAA,CAAY,oBAAA,EAAO,mBAAA;AAAA,cAE1D,aAAA,EAAe,SAAA,CAAU,gBAAA,CACpC,kBAAA,EACA,oBAAA"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as createComponent } from "./create-component-
|
|
1
|
+
import { t as createComponent } from "./create-component-B7NzEJxP.js";
|
|
2
2
|
import { resizableHandleEvents, resizableHandleProps, resizableRootEvents, resizableRootProps } from "@prosekit/web/resizable";
|
|
3
3
|
|
|
4
4
|
//#region src/components/resizable/resizable-handle.gen.ts
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prosekit-solid-resizable.js","names":[
|
|
1
|
+
{"version":3,"file":"prosekit-solid-resizable.js","names":[],"sources":["../src/components/resizable/resizable-handle.gen.ts","../src/components/resizable/resizable-root.gen.ts"],"sourcesContent":["import { \n type ResizableHandleElement,\n type ResizableHandleProps as Props,\n type ResizableHandleEvents as Events,\n resizableHandleProps,\n resizableHandleEvents,\n} from '@prosekit/web/resizable'\nimport type { Component } from 'solid-js'\n\nimport type { PropsWithElement } from '../../types'\nimport { createComponent } from '../create-component'\nimport type { CreateProps } from '../create-props'\n\n/**\n * Props for the {@link ResizableHandle} component.\n */\nexport interface ResizableHandleProps extends Partial<CreateProps<Props, Events>> {}\n\nexport const ResizableHandle: Component<PropsWithElement<\n ResizableHandleProps,\n ResizableHandleElement\n>> = createComponent<\n ResizableHandleProps,\n ResizableHandleElement\n>(\n 'prosekit-resizable-handle', \n Object.keys(resizableHandleProps),\n Object.keys(resizableHandleEvents),\n)\n","import { \n type ResizableRootElement,\n type ResizableRootProps as Props,\n type ResizableRootEvents as Events,\n resizableRootProps,\n resizableRootEvents,\n} from '@prosekit/web/resizable'\nimport type { Component } from 'solid-js'\n\nimport type { PropsWithElement } from '../../types'\nimport { createComponent } from '../create-component'\nimport type { CreateProps } from '../create-props'\n\n/**\n * Props for the {@link ResizableRoot} component.\n */\nexport interface ResizableRootProps extends Partial<CreateProps<Props, Events>> {}\n\nexport const ResizableRoot: Component<PropsWithElement<\n ResizableRootProps,\n ResizableRootElement\n>> = createComponent<\n ResizableRootProps,\n ResizableRootElement\n>(\n 'prosekit-resizable-root', \n Object.keys(resizableRootProps),\n Object.keys(resizableRootEvents),\n)\n"],"mappings":";;;;AAkBA,MAAa,kBAGR,gBAIH,6BACA,OAAO,KAAK,qBAAqB,EACjC,OAAO,KAAK,sBAAsB,CACnC;;;;ACVD,MAAa,gBAGR,gBAIH,2BACA,OAAO,KAAK,mBAAmB,EAC/B,OAAO,KAAK,oBAAoB,CACjC"}
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import { i as PropsWithElement } from "./types-
|
|
2
|
-
import { t as CreateProps } from "./create-props-
|
|
1
|
+
import { i as PropsWithElement } from "./types-Bx9mKDTJ.js";
|
|
2
|
+
import { t as CreateProps } from "./create-props-CFK4CtjG.js";
|
|
3
3
|
import { Component } from "solid-js";
|
|
4
4
|
import { TableHandleColumnRootElement, TableHandleColumnRootEvents, TableHandleColumnRootProps as TableHandleColumnRootProps$1, TableHandleColumnTriggerElement, TableHandleColumnTriggerEvents, TableHandleColumnTriggerProps as TableHandleColumnTriggerProps$1, TableHandleDragPreviewElement, TableHandleDragPreviewEvents, TableHandleDragPreviewProps as TableHandleDragPreviewProps$1, TableHandleDropIndicatorElement, TableHandleDropIndicatorEvents, TableHandleDropIndicatorProps as TableHandleDropIndicatorProps$1, TableHandlePopoverContentElement, TableHandlePopoverContentEvents, TableHandlePopoverContentProps as TableHandlePopoverContentProps$1, TableHandlePopoverItemElement, TableHandlePopoverItemEvents, TableHandlePopoverItemProps as TableHandlePopoverItemProps$1, TableHandleRootElement, TableHandleRootEvents, TableHandleRootProps as TableHandleRootProps$1, TableHandleRowRootElement, TableHandleRowRootEvents, TableHandleRowRootProps as TableHandleRowRootProps$1, TableHandleRowTriggerElement, TableHandleRowTriggerEvents, TableHandleRowTriggerProps as TableHandleRowTriggerProps$1 } from "@prosekit/web/table-handle";
|
|
5
5
|
|
|
6
6
|
//#region src/components/table-handle/table-handle-column-root.gen.d.ts
|
|
7
|
-
|
|
8
7
|
/**
|
|
9
8
|
* Props for the {@link TableHandleColumnRoot} component.
|
|
10
9
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prosekit-solid-table-handle.d.ts","names":[],"sources":["../src/components/table-handle/table-handle-column-root.gen.ts","../src/components/table-handle/table-handle-column-trigger.gen.ts","../src/components/table-handle/table-handle-drag-preview.gen.ts","../src/components/table-handle/table-handle-drop-indicator.gen.ts","../src/components/table-handle/table-handle-popover-content.gen.ts","../src/components/table-handle/table-handle-popover-item.gen.ts","../src/components/table-handle/table-handle-root.gen.ts","../src/components/table-handle/table-handle-row-root.gen.ts","../src/components/table-handle/table-handle-row-trigger.gen.ts"],"
|
|
1
|
+
{"version":3,"file":"prosekit-solid-table-handle.d.ts","names":[],"sources":["../src/components/table-handle/table-handle-column-root.gen.ts","../src/components/table-handle/table-handle-column-trigger.gen.ts","../src/components/table-handle/table-handle-drag-preview.gen.ts","../src/components/table-handle/table-handle-drop-indicator.gen.ts","../src/components/table-handle/table-handle-popover-content.gen.ts","../src/components/table-handle/table-handle-popover-item.gen.ts","../src/components/table-handle/table-handle-root.gen.ts","../src/components/table-handle/table-handle-row-root.gen.ts","../src/components/table-handle/table-handle-row-trigger.gen.ts"],"mappings":";;;;;;;;AAgBA;UAAiB,0BAAA,SAAmC,OAAA,CAAQ,WAAA,CAAY,4BAAA,EAAO,2BAAA;AAAA,cAElE,qBAAA,EAAuB,SAAA,CAAU,gBAAA,CAC5C,0BAAA,EACA,4BAAA;;;;;AAJF;UCAiB,6BAAA,SAAsC,OAAA,CAAQ,WAAA,CAAY,+BAAA,EAAO,8BAAA;AAAA,cAErE,wBAAA,EAA0B,SAAA,CAAU,gBAAA,CAC/C,6BAAA,EACA,+BAAA;;;;;ADJF;UEAiB,2BAAA,SAAoC,OAAA,CAAQ,WAAA,CAAY,6BAAA,EAAO,4BAAA;AAAA,cAEnE,sBAAA,EAAwB,SAAA,CAAU,gBAAA,CAC7C,2BAAA,EACA,6BAAA;;;;;AFJF;UGAiB,6BAAA,SAAsC,OAAA,CAAQ,WAAA,CAAY,+BAAA,EAAO,8BAAA;AAAA,cAErE,wBAAA,EAA0B,SAAA,CAAU,gBAAA,CAC/C,6BAAA,EACA,+BAAA;;;;;AHJF;UIAiB,8BAAA,SAAuC,OAAA,CAAQ,WAAA,CAAY,gCAAA,EAAO,+BAAA;AAAA,cAEtE,yBAAA,EAA2B,SAAA,CAAU,gBAAA,CAChD,8BAAA,EACA,gCAAA;;;;;AJJF;UKAiB,2BAAA,SAAoC,OAAA,CAAQ,WAAA,CAAY,6BAAA,EAAO,4BAAA;AAAA,cAEnE,sBAAA,EAAwB,SAAA,CAAU,gBAAA,CAC7C,2BAAA,EACA,6BAAA;;;;;ALJF;UMAiB,oBAAA,SAA6B,OAAA,CAAQ,WAAA,CAAY,sBAAA,EAAO,qBAAA;AAAA,cAE5D,eAAA,EAAiB,SAAA,CAAU,gBAAA,CACtC,oBAAA,EACA,sBAAA;;;;;ANJF;UOAiB,uBAAA,SAAgC,OAAA,CAAQ,WAAA,CAAY,yBAAA,EAAO,wBAAA;AAAA,cAE/D,kBAAA,EAAoB,SAAA,CAAU,gBAAA,CACzC,uBAAA,EACA,yBAAA;;;;;APJF;UQAiB,0BAAA,SAAmC,OAAA,CAAQ,WAAA,CAAY,4BAAA,EAAO,2BAAA;AAAA,cAElE,qBAAA,EAAuB,SAAA,CAAU,gBAAA,CAC5C,0BAAA,EACA,4BAAA"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as createComponent } from "./create-component-
|
|
1
|
+
import { t as createComponent } from "./create-component-B7NzEJxP.js";
|
|
2
2
|
import { tableHandleColumnRootEvents, tableHandleColumnRootProps, tableHandleColumnTriggerEvents, tableHandleColumnTriggerProps, tableHandleDragPreviewEvents, tableHandleDragPreviewProps, tableHandleDropIndicatorEvents, tableHandleDropIndicatorProps, tableHandlePopoverContentEvents, tableHandlePopoverContentProps, tableHandlePopoverItemEvents, tableHandlePopoverItemProps, tableHandleRootEvents, tableHandleRootProps, tableHandleRowRootEvents, tableHandleRowRootProps, tableHandleRowTriggerEvents, tableHandleRowTriggerProps } from "@prosekit/web/table-handle";
|
|
3
3
|
|
|
4
4
|
//#region src/components/table-handle/table-handle-column-root.gen.ts
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prosekit-solid-table-handle.js","names":["TableHandleColumnRoot: Component<PropsWithElement<\n TableHandleColumnRootProps,\n TableHandleColumnRootElement\n>>","TableHandleColumnTrigger: Component<PropsWithElement<\n TableHandleColumnTriggerProps,\n TableHandleColumnTriggerElement\n>>","TableHandleDragPreview: Component<PropsWithElement<\n TableHandleDragPreviewProps,\n TableHandleDragPreviewElement\n>>","TableHandleDropIndicator: Component<PropsWithElement<\n TableHandleDropIndicatorProps,\n TableHandleDropIndicatorElement\n>>","TableHandlePopoverContent: Component<PropsWithElement<\n TableHandlePopoverContentProps,\n TableHandlePopoverContentElement\n>>","TableHandlePopoverItem: Component<PropsWithElement<\n TableHandlePopoverItemProps,\n TableHandlePopoverItemElement\n>>","TableHandleRoot: Component<PropsWithElement<\n TableHandleRootProps,\n TableHandleRootElement\n>>","TableHandleRowRoot: Component<PropsWithElement<\n TableHandleRowRootProps,\n TableHandleRowRootElement\n>>","TableHandleRowTrigger: Component<PropsWithElement<\n TableHandleRowTriggerProps,\n TableHandleRowTriggerElement\n>>"],"sources":["../src/components/table-handle/table-handle-column-root.gen.ts","../src/components/table-handle/table-handle-column-trigger.gen.ts","../src/components/table-handle/table-handle-drag-preview.gen.ts","../src/components/table-handle/table-handle-drop-indicator.gen.ts","../src/components/table-handle/table-handle-popover-content.gen.ts","../src/components/table-handle/table-handle-popover-item.gen.ts","../src/components/table-handle/table-handle-root.gen.ts","../src/components/table-handle/table-handle-row-root.gen.ts","../src/components/table-handle/table-handle-row-trigger.gen.ts"],"sourcesContent":["import { \n type TableHandleColumnRootElement,\n type TableHandleColumnRootProps as Props,\n type TableHandleColumnRootEvents as Events,\n tableHandleColumnRootProps,\n tableHandleColumnRootEvents,\n} from '@prosekit/web/table-handle'\nimport type { Component } from 'solid-js'\n\nimport type { PropsWithElement } from '../../types'\nimport { createComponent } from '../create-component'\nimport type { CreateProps } from '../create-props'\n\n/**\n * Props for the {@link TableHandleColumnRoot} component.\n */\nexport interface TableHandleColumnRootProps extends Partial<CreateProps<Props, Events>> {}\n\nexport const TableHandleColumnRoot: Component<PropsWithElement<\n TableHandleColumnRootProps,\n TableHandleColumnRootElement\n>> = createComponent<\n TableHandleColumnRootProps,\n TableHandleColumnRootElement\n>(\n 'prosekit-table-handle-column-root', \n Object.keys(tableHandleColumnRootProps),\n Object.keys(tableHandleColumnRootEvents),\n)\n","import { \n type TableHandleColumnTriggerElement,\n type TableHandleColumnTriggerProps as Props,\n type TableHandleColumnTriggerEvents as Events,\n tableHandleColumnTriggerProps,\n tableHandleColumnTriggerEvents,\n} from '@prosekit/web/table-handle'\nimport type { Component } from 'solid-js'\n\nimport type { PropsWithElement } from '../../types'\nimport { createComponent } from '../create-component'\nimport type { CreateProps } from '../create-props'\n\n/**\n * Props for the {@link TableHandleColumnTrigger} component.\n */\nexport interface TableHandleColumnTriggerProps extends Partial<CreateProps<Props, Events>> {}\n\nexport const TableHandleColumnTrigger: Component<PropsWithElement<\n TableHandleColumnTriggerProps,\n TableHandleColumnTriggerElement\n>> = createComponent<\n TableHandleColumnTriggerProps,\n TableHandleColumnTriggerElement\n>(\n 'prosekit-table-handle-column-trigger', \n Object.keys(tableHandleColumnTriggerProps),\n Object.keys(tableHandleColumnTriggerEvents),\n)\n","import { \n type TableHandleDragPreviewElement,\n type TableHandleDragPreviewProps as Props,\n type TableHandleDragPreviewEvents as Events,\n tableHandleDragPreviewProps,\n tableHandleDragPreviewEvents,\n} from '@prosekit/web/table-handle'\nimport type { Component } from 'solid-js'\n\nimport type { PropsWithElement } from '../../types'\nimport { createComponent } from '../create-component'\nimport type { CreateProps } from '../create-props'\n\n/**\n * Props for the {@link TableHandleDragPreview} component.\n */\nexport interface TableHandleDragPreviewProps extends Partial<CreateProps<Props, Events>> {}\n\nexport const TableHandleDragPreview: Component<PropsWithElement<\n TableHandleDragPreviewProps,\n TableHandleDragPreviewElement\n>> = createComponent<\n TableHandleDragPreviewProps,\n TableHandleDragPreviewElement\n>(\n 'prosekit-table-handle-drag-preview', \n Object.keys(tableHandleDragPreviewProps),\n Object.keys(tableHandleDragPreviewEvents),\n)\n","import { \n type TableHandleDropIndicatorElement,\n type TableHandleDropIndicatorProps as Props,\n type TableHandleDropIndicatorEvents as Events,\n tableHandleDropIndicatorProps,\n tableHandleDropIndicatorEvents,\n} from '@prosekit/web/table-handle'\nimport type { Component } from 'solid-js'\n\nimport type { PropsWithElement } from '../../types'\nimport { createComponent } from '../create-component'\nimport type { CreateProps } from '../create-props'\n\n/**\n * Props for the {@link TableHandleDropIndicator} component.\n */\nexport interface TableHandleDropIndicatorProps extends Partial<CreateProps<Props, Events>> {}\n\nexport const TableHandleDropIndicator: Component<PropsWithElement<\n TableHandleDropIndicatorProps,\n TableHandleDropIndicatorElement\n>> = createComponent<\n TableHandleDropIndicatorProps,\n TableHandleDropIndicatorElement\n>(\n 'prosekit-table-handle-drop-indicator', \n Object.keys(tableHandleDropIndicatorProps),\n Object.keys(tableHandleDropIndicatorEvents),\n)\n","import { \n type TableHandlePopoverContentElement,\n type TableHandlePopoverContentProps as Props,\n type TableHandlePopoverContentEvents as Events,\n tableHandlePopoverContentProps,\n tableHandlePopoverContentEvents,\n} from '@prosekit/web/table-handle'\nimport type { Component } from 'solid-js'\n\nimport type { PropsWithElement } from '../../types'\nimport { createComponent } from '../create-component'\nimport type { CreateProps } from '../create-props'\n\n/**\n * Props for the {@link TableHandlePopoverContent} component.\n */\nexport interface TableHandlePopoverContentProps extends Partial<CreateProps<Props, Events>> {}\n\nexport const TableHandlePopoverContent: Component<PropsWithElement<\n TableHandlePopoverContentProps,\n TableHandlePopoverContentElement\n>> = createComponent<\n TableHandlePopoverContentProps,\n TableHandlePopoverContentElement\n>(\n 'prosekit-table-handle-popover-content', \n Object.keys(tableHandlePopoverContentProps),\n Object.keys(tableHandlePopoverContentEvents),\n)\n","import { \n type TableHandlePopoverItemElement,\n type TableHandlePopoverItemProps as Props,\n type TableHandlePopoverItemEvents as Events,\n tableHandlePopoverItemProps,\n tableHandlePopoverItemEvents,\n} from '@prosekit/web/table-handle'\nimport type { Component } from 'solid-js'\n\nimport type { PropsWithElement } from '../../types'\nimport { createComponent } from '../create-component'\nimport type { CreateProps } from '../create-props'\n\n/**\n * Props for the {@link TableHandlePopoverItem} component.\n */\nexport interface TableHandlePopoverItemProps extends Partial<CreateProps<Props, Events>> {}\n\nexport const TableHandlePopoverItem: Component<PropsWithElement<\n TableHandlePopoverItemProps,\n TableHandlePopoverItemElement\n>> = createComponent<\n TableHandlePopoverItemProps,\n TableHandlePopoverItemElement\n>(\n 'prosekit-table-handle-popover-item', \n Object.keys(tableHandlePopoverItemProps),\n Object.keys(tableHandlePopoverItemEvents),\n)\n","import { \n type TableHandleRootElement,\n type TableHandleRootProps as Props,\n type TableHandleRootEvents as Events,\n tableHandleRootProps,\n tableHandleRootEvents,\n} from '@prosekit/web/table-handle'\nimport type { Component } from 'solid-js'\n\nimport type { PropsWithElement } from '../../types'\nimport { createComponent } from '../create-component'\nimport type { CreateProps } from '../create-props'\n\n/**\n * Props for the {@link TableHandleRoot} component.\n */\nexport interface TableHandleRootProps extends Partial<CreateProps<Props, Events>> {}\n\nexport const TableHandleRoot: Component<PropsWithElement<\n TableHandleRootProps,\n TableHandleRootElement\n>> = createComponent<\n TableHandleRootProps,\n TableHandleRootElement\n>(\n 'prosekit-table-handle-root', \n Object.keys(tableHandleRootProps),\n Object.keys(tableHandleRootEvents),\n)\n","import { \n type TableHandleRowRootElement,\n type TableHandleRowRootProps as Props,\n type TableHandleRowRootEvents as Events,\n tableHandleRowRootProps,\n tableHandleRowRootEvents,\n} from '@prosekit/web/table-handle'\nimport type { Component } from 'solid-js'\n\nimport type { PropsWithElement } from '../../types'\nimport { createComponent } from '../create-component'\nimport type { CreateProps } from '../create-props'\n\n/**\n * Props for the {@link TableHandleRowRoot} component.\n */\nexport interface TableHandleRowRootProps extends Partial<CreateProps<Props, Events>> {}\n\nexport const TableHandleRowRoot: Component<PropsWithElement<\n TableHandleRowRootProps,\n TableHandleRowRootElement\n>> = createComponent<\n TableHandleRowRootProps,\n TableHandleRowRootElement\n>(\n 'prosekit-table-handle-row-root', \n Object.keys(tableHandleRowRootProps),\n Object.keys(tableHandleRowRootEvents),\n)\n","import { \n type TableHandleRowTriggerElement,\n type TableHandleRowTriggerProps as Props,\n type TableHandleRowTriggerEvents as Events,\n tableHandleRowTriggerProps,\n tableHandleRowTriggerEvents,\n} from '@prosekit/web/table-handle'\nimport type { Component } from 'solid-js'\n\nimport type { PropsWithElement } from '../../types'\nimport { createComponent } from '../create-component'\nimport type { CreateProps } from '../create-props'\n\n/**\n * Props for the {@link TableHandleRowTrigger} component.\n */\nexport interface TableHandleRowTriggerProps extends Partial<CreateProps<Props, Events>> {}\n\nexport const TableHandleRowTrigger: Component<PropsWithElement<\n TableHandleRowTriggerProps,\n TableHandleRowTriggerElement\n>> = createComponent<\n TableHandleRowTriggerProps,\n TableHandleRowTriggerElement\n>(\n 'prosekit-table-handle-row-trigger', \n Object.keys(tableHandleRowTriggerProps),\n Object.keys(tableHandleRowTriggerEvents),\n)\n"],"mappings":";;;;AAkBA,MAAaA,wBAGR,gBAIH,qCACA,OAAO,KAAK,2BAA2B,EACvC,OAAO,KAAK,4BAA4B,CACzC;;;;ACVD,MAAaC,2BAGR,gBAIH,wCACA,OAAO,KAAK,8BAA8B,EAC1C,OAAO,KAAK,+BAA+B,CAC5C;;;;ACVD,MAAaC,yBAGR,gBAIH,sCACA,OAAO,KAAK,4BAA4B,EACxC,OAAO,KAAK,6BAA6B,CAC1C;;;;ACVD,MAAaC,2BAGR,gBAIH,wCACA,OAAO,KAAK,8BAA8B,EAC1C,OAAO,KAAK,+BAA+B,CAC5C;;;;ACVD,MAAaC,4BAGR,gBAIH,yCACA,OAAO,KAAK,+BAA+B,EAC3C,OAAO,KAAK,gCAAgC,CAC7C;;;;ACVD,MAAaC,yBAGR,gBAIH,sCACA,OAAO,KAAK,4BAA4B,EACxC,OAAO,KAAK,6BAA6B,CAC1C;;;;ACVD,MAAaC,kBAGR,gBAIH,8BACA,OAAO,KAAK,qBAAqB,EACjC,OAAO,KAAK,sBAAsB,CACnC;;;;ACVD,MAAaC,qBAGR,gBAIH,kCACA,OAAO,KAAK,wBAAwB,EACpC,OAAO,KAAK,yBAAyB,CACtC;;;;ACVD,MAAaC,wBAGR,gBAIH,qCACA,OAAO,KAAK,2BAA2B,EACvC,OAAO,KAAK,4BAA4B,CACzC"}
|
|
1
|
+
{"version":3,"file":"prosekit-solid-table-handle.js","names":[],"sources":["../src/components/table-handle/table-handle-column-root.gen.ts","../src/components/table-handle/table-handle-column-trigger.gen.ts","../src/components/table-handle/table-handle-drag-preview.gen.ts","../src/components/table-handle/table-handle-drop-indicator.gen.ts","../src/components/table-handle/table-handle-popover-content.gen.ts","../src/components/table-handle/table-handle-popover-item.gen.ts","../src/components/table-handle/table-handle-root.gen.ts","../src/components/table-handle/table-handle-row-root.gen.ts","../src/components/table-handle/table-handle-row-trigger.gen.ts"],"sourcesContent":["import { \n type TableHandleColumnRootElement,\n type TableHandleColumnRootProps as Props,\n type TableHandleColumnRootEvents as Events,\n tableHandleColumnRootProps,\n tableHandleColumnRootEvents,\n} from '@prosekit/web/table-handle'\nimport type { Component } from 'solid-js'\n\nimport type { PropsWithElement } from '../../types'\nimport { createComponent } from '../create-component'\nimport type { CreateProps } from '../create-props'\n\n/**\n * Props for the {@link TableHandleColumnRoot} component.\n */\nexport interface TableHandleColumnRootProps extends Partial<CreateProps<Props, Events>> {}\n\nexport const TableHandleColumnRoot: Component<PropsWithElement<\n TableHandleColumnRootProps,\n TableHandleColumnRootElement\n>> = createComponent<\n TableHandleColumnRootProps,\n TableHandleColumnRootElement\n>(\n 'prosekit-table-handle-column-root', \n Object.keys(tableHandleColumnRootProps),\n Object.keys(tableHandleColumnRootEvents),\n)\n","import { \n type TableHandleColumnTriggerElement,\n type TableHandleColumnTriggerProps as Props,\n type TableHandleColumnTriggerEvents as Events,\n tableHandleColumnTriggerProps,\n tableHandleColumnTriggerEvents,\n} from '@prosekit/web/table-handle'\nimport type { Component } from 'solid-js'\n\nimport type { PropsWithElement } from '../../types'\nimport { createComponent } from '../create-component'\nimport type { CreateProps } from '../create-props'\n\n/**\n * Props for the {@link TableHandleColumnTrigger} component.\n */\nexport interface TableHandleColumnTriggerProps extends Partial<CreateProps<Props, Events>> {}\n\nexport const TableHandleColumnTrigger: Component<PropsWithElement<\n TableHandleColumnTriggerProps,\n TableHandleColumnTriggerElement\n>> = createComponent<\n TableHandleColumnTriggerProps,\n TableHandleColumnTriggerElement\n>(\n 'prosekit-table-handle-column-trigger', \n Object.keys(tableHandleColumnTriggerProps),\n Object.keys(tableHandleColumnTriggerEvents),\n)\n","import { \n type TableHandleDragPreviewElement,\n type TableHandleDragPreviewProps as Props,\n type TableHandleDragPreviewEvents as Events,\n tableHandleDragPreviewProps,\n tableHandleDragPreviewEvents,\n} from '@prosekit/web/table-handle'\nimport type { Component } from 'solid-js'\n\nimport type { PropsWithElement } from '../../types'\nimport { createComponent } from '../create-component'\nimport type { CreateProps } from '../create-props'\n\n/**\n * Props for the {@link TableHandleDragPreview} component.\n */\nexport interface TableHandleDragPreviewProps extends Partial<CreateProps<Props, Events>> {}\n\nexport const TableHandleDragPreview: Component<PropsWithElement<\n TableHandleDragPreviewProps,\n TableHandleDragPreviewElement\n>> = createComponent<\n TableHandleDragPreviewProps,\n TableHandleDragPreviewElement\n>(\n 'prosekit-table-handle-drag-preview', \n Object.keys(tableHandleDragPreviewProps),\n Object.keys(tableHandleDragPreviewEvents),\n)\n","import { \n type TableHandleDropIndicatorElement,\n type TableHandleDropIndicatorProps as Props,\n type TableHandleDropIndicatorEvents as Events,\n tableHandleDropIndicatorProps,\n tableHandleDropIndicatorEvents,\n} from '@prosekit/web/table-handle'\nimport type { Component } from 'solid-js'\n\nimport type { PropsWithElement } from '../../types'\nimport { createComponent } from '../create-component'\nimport type { CreateProps } from '../create-props'\n\n/**\n * Props for the {@link TableHandleDropIndicator} component.\n */\nexport interface TableHandleDropIndicatorProps extends Partial<CreateProps<Props, Events>> {}\n\nexport const TableHandleDropIndicator: Component<PropsWithElement<\n TableHandleDropIndicatorProps,\n TableHandleDropIndicatorElement\n>> = createComponent<\n TableHandleDropIndicatorProps,\n TableHandleDropIndicatorElement\n>(\n 'prosekit-table-handle-drop-indicator', \n Object.keys(tableHandleDropIndicatorProps),\n Object.keys(tableHandleDropIndicatorEvents),\n)\n","import { \n type TableHandlePopoverContentElement,\n type TableHandlePopoverContentProps as Props,\n type TableHandlePopoverContentEvents as Events,\n tableHandlePopoverContentProps,\n tableHandlePopoverContentEvents,\n} from '@prosekit/web/table-handle'\nimport type { Component } from 'solid-js'\n\nimport type { PropsWithElement } from '../../types'\nimport { createComponent } from '../create-component'\nimport type { CreateProps } from '../create-props'\n\n/**\n * Props for the {@link TableHandlePopoverContent} component.\n */\nexport interface TableHandlePopoverContentProps extends Partial<CreateProps<Props, Events>> {}\n\nexport const TableHandlePopoverContent: Component<PropsWithElement<\n TableHandlePopoverContentProps,\n TableHandlePopoverContentElement\n>> = createComponent<\n TableHandlePopoverContentProps,\n TableHandlePopoverContentElement\n>(\n 'prosekit-table-handle-popover-content', \n Object.keys(tableHandlePopoverContentProps),\n Object.keys(tableHandlePopoverContentEvents),\n)\n","import { \n type TableHandlePopoverItemElement,\n type TableHandlePopoverItemProps as Props,\n type TableHandlePopoverItemEvents as Events,\n tableHandlePopoverItemProps,\n tableHandlePopoverItemEvents,\n} from '@prosekit/web/table-handle'\nimport type { Component } from 'solid-js'\n\nimport type { PropsWithElement } from '../../types'\nimport { createComponent } from '../create-component'\nimport type { CreateProps } from '../create-props'\n\n/**\n * Props for the {@link TableHandlePopoverItem} component.\n */\nexport interface TableHandlePopoverItemProps extends Partial<CreateProps<Props, Events>> {}\n\nexport const TableHandlePopoverItem: Component<PropsWithElement<\n TableHandlePopoverItemProps,\n TableHandlePopoverItemElement\n>> = createComponent<\n TableHandlePopoverItemProps,\n TableHandlePopoverItemElement\n>(\n 'prosekit-table-handle-popover-item', \n Object.keys(tableHandlePopoverItemProps),\n Object.keys(tableHandlePopoverItemEvents),\n)\n","import { \n type TableHandleRootElement,\n type TableHandleRootProps as Props,\n type TableHandleRootEvents as Events,\n tableHandleRootProps,\n tableHandleRootEvents,\n} from '@prosekit/web/table-handle'\nimport type { Component } from 'solid-js'\n\nimport type { PropsWithElement } from '../../types'\nimport { createComponent } from '../create-component'\nimport type { CreateProps } from '../create-props'\n\n/**\n * Props for the {@link TableHandleRoot} component.\n */\nexport interface TableHandleRootProps extends Partial<CreateProps<Props, Events>> {}\n\nexport const TableHandleRoot: Component<PropsWithElement<\n TableHandleRootProps,\n TableHandleRootElement\n>> = createComponent<\n TableHandleRootProps,\n TableHandleRootElement\n>(\n 'prosekit-table-handle-root', \n Object.keys(tableHandleRootProps),\n Object.keys(tableHandleRootEvents),\n)\n","import { \n type TableHandleRowRootElement,\n type TableHandleRowRootProps as Props,\n type TableHandleRowRootEvents as Events,\n tableHandleRowRootProps,\n tableHandleRowRootEvents,\n} from '@prosekit/web/table-handle'\nimport type { Component } from 'solid-js'\n\nimport type { PropsWithElement } from '../../types'\nimport { createComponent } from '../create-component'\nimport type { CreateProps } from '../create-props'\n\n/**\n * Props for the {@link TableHandleRowRoot} component.\n */\nexport interface TableHandleRowRootProps extends Partial<CreateProps<Props, Events>> {}\n\nexport const TableHandleRowRoot: Component<PropsWithElement<\n TableHandleRowRootProps,\n TableHandleRowRootElement\n>> = createComponent<\n TableHandleRowRootProps,\n TableHandleRowRootElement\n>(\n 'prosekit-table-handle-row-root', \n Object.keys(tableHandleRowRootProps),\n Object.keys(tableHandleRowRootEvents),\n)\n","import { \n type TableHandleRowTriggerElement,\n type TableHandleRowTriggerProps as Props,\n type TableHandleRowTriggerEvents as Events,\n tableHandleRowTriggerProps,\n tableHandleRowTriggerEvents,\n} from '@prosekit/web/table-handle'\nimport type { Component } from 'solid-js'\n\nimport type { PropsWithElement } from '../../types'\nimport { createComponent } from '../create-component'\nimport type { CreateProps } from '../create-props'\n\n/**\n * Props for the {@link TableHandleRowTrigger} component.\n */\nexport interface TableHandleRowTriggerProps extends Partial<CreateProps<Props, Events>> {}\n\nexport const TableHandleRowTrigger: Component<PropsWithElement<\n TableHandleRowTriggerProps,\n TableHandleRowTriggerElement\n>> = createComponent<\n TableHandleRowTriggerProps,\n TableHandleRowTriggerElement\n>(\n 'prosekit-table-handle-row-trigger', \n Object.keys(tableHandleRowTriggerProps),\n Object.keys(tableHandleRowTriggerEvents),\n)\n"],"mappings":";;;;AAkBA,MAAa,wBAGR,gBAIH,qCACA,OAAO,KAAK,2BAA2B,EACvC,OAAO,KAAK,4BAA4B,CACzC;;;;ACVD,MAAa,2BAGR,gBAIH,wCACA,OAAO,KAAK,8BAA8B,EAC1C,OAAO,KAAK,+BAA+B,CAC5C;;;;ACVD,MAAa,yBAGR,gBAIH,sCACA,OAAO,KAAK,4BAA4B,EACxC,OAAO,KAAK,6BAA6B,CAC1C;;;;ACVD,MAAa,2BAGR,gBAIH,wCACA,OAAO,KAAK,8BAA8B,EAC1C,OAAO,KAAK,+BAA+B,CAC5C;;;;ACVD,MAAa,4BAGR,gBAIH,yCACA,OAAO,KAAK,+BAA+B,EAC3C,OAAO,KAAK,gCAAgC,CAC7C;;;;ACVD,MAAa,yBAGR,gBAIH,sCACA,OAAO,KAAK,4BAA4B,EACxC,OAAO,KAAK,6BAA6B,CAC1C;;;;ACVD,MAAa,kBAGR,gBAIH,8BACA,OAAO,KAAK,qBAAqB,EACjC,OAAO,KAAK,sBAAsB,CACnC;;;;ACVD,MAAa,qBAGR,gBAIH,kCACA,OAAO,KAAK,wBAAwB,EACpC,OAAO,KAAK,yBAAyB,CACtC;;;;ACVD,MAAa,wBAGR,gBAIH,qCACA,OAAO,KAAK,2BAA2B,EACvC,OAAO,KAAK,4BAA4B,CACzC"}
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import { i as PropsWithElement } from "./types-
|
|
2
|
-
import { t as CreateProps } from "./create-props-
|
|
1
|
+
import { i as PropsWithElement } from "./types-Bx9mKDTJ.js";
|
|
2
|
+
import { t as CreateProps } from "./create-props-CFK4CtjG.js";
|
|
3
3
|
import { Component } from "solid-js";
|
|
4
4
|
import { TooltipContentElement, TooltipContentEvents, TooltipContentProps as TooltipContentProps$1, TooltipRootElement, TooltipRootEvents, TooltipRootProps as TooltipRootProps$1, TooltipTriggerElement, TooltipTriggerEvents, TooltipTriggerProps as TooltipTriggerProps$1 } from "@prosekit/web/tooltip";
|
|
5
5
|
|
|
6
6
|
//#region src/components/tooltip/tooltip-content.gen.d.ts
|
|
7
|
-
|
|
8
7
|
/**
|
|
9
8
|
* Props for the {@link TooltipContent} component.
|
|
10
9
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prosekit-solid-tooltip.d.ts","names":[],"sources":["../src/components/tooltip/tooltip-content.gen.ts","../src/components/tooltip/tooltip-root.gen.ts","../src/components/tooltip/tooltip-trigger.gen.ts"],"
|
|
1
|
+
{"version":3,"file":"prosekit-solid-tooltip.d.ts","names":[],"sources":["../src/components/tooltip/tooltip-content.gen.ts","../src/components/tooltip/tooltip-root.gen.ts","../src/components/tooltip/tooltip-trigger.gen.ts"],"mappings":";;;;;;;;AAgBA;UAAiB,mBAAA,SAA4B,OAAA,CAAQ,WAAA,CAAY,qBAAA,EAAO,oBAAA;AAAA,cAE3D,cAAA,EAAgB,SAAA,CAAU,gBAAA,CACrC,mBAAA,EACA,qBAAA;;;;;AAJF;UCAiB,gBAAA,SAAyB,OAAA,CAAQ,WAAA,CAAY,kBAAA,EAAO,iBAAA;AAAA,cAExD,WAAA,EAAa,SAAA,CAAU,gBAAA,CAClC,gBAAA,EACA,kBAAA;;;;;ADJF;UEAiB,mBAAA,SAA4B,OAAA,CAAQ,WAAA,CAAY,qBAAA,EAAO,oBAAA;AAAA,cAE3D,cAAA,EAAgB,SAAA,CAAU,gBAAA,CACrC,mBAAA,EACA,qBAAA"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as createComponent } from "./create-component-
|
|
1
|
+
import { t as createComponent } from "./create-component-B7NzEJxP.js";
|
|
2
2
|
import { tooltipContentEvents, tooltipContentProps, tooltipRootEvents, tooltipRootProps, tooltipTriggerEvents, tooltipTriggerProps } from "@prosekit/web/tooltip";
|
|
3
3
|
|
|
4
4
|
//#region src/components/tooltip/tooltip-content.gen.ts
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prosekit-solid-tooltip.js","names":[
|
|
1
|
+
{"version":3,"file":"prosekit-solid-tooltip.js","names":[],"sources":["../src/components/tooltip/tooltip-content.gen.ts","../src/components/tooltip/tooltip-root.gen.ts","../src/components/tooltip/tooltip-trigger.gen.ts"],"sourcesContent":["import { \n type TooltipContentElement,\n type TooltipContentProps as Props,\n type TooltipContentEvents as Events,\n tooltipContentProps,\n tooltipContentEvents,\n} from '@prosekit/web/tooltip'\nimport type { Component } from 'solid-js'\n\nimport type { PropsWithElement } from '../../types'\nimport { createComponent } from '../create-component'\nimport type { CreateProps } from '../create-props'\n\n/**\n * Props for the {@link TooltipContent} component.\n */\nexport interface TooltipContentProps extends Partial<CreateProps<Props, Events>> {}\n\nexport const TooltipContent: Component<PropsWithElement<\n TooltipContentProps,\n TooltipContentElement\n>> = createComponent<\n TooltipContentProps,\n TooltipContentElement\n>(\n 'prosekit-tooltip-content', \n Object.keys(tooltipContentProps),\n Object.keys(tooltipContentEvents),\n)\n","import { \n type TooltipRootElement,\n type TooltipRootProps as Props,\n type TooltipRootEvents as Events,\n tooltipRootProps,\n tooltipRootEvents,\n} from '@prosekit/web/tooltip'\nimport type { Component } from 'solid-js'\n\nimport type { PropsWithElement } from '../../types'\nimport { createComponent } from '../create-component'\nimport type { CreateProps } from '../create-props'\n\n/**\n * Props for the {@link TooltipRoot} component.\n */\nexport interface TooltipRootProps extends Partial<CreateProps<Props, Events>> {}\n\nexport const TooltipRoot: Component<PropsWithElement<\n TooltipRootProps,\n TooltipRootElement\n>> = createComponent<\n TooltipRootProps,\n TooltipRootElement\n>(\n 'prosekit-tooltip-root', \n Object.keys(tooltipRootProps),\n Object.keys(tooltipRootEvents),\n)\n","import { \n type TooltipTriggerElement,\n type TooltipTriggerProps as Props,\n type TooltipTriggerEvents as Events,\n tooltipTriggerProps,\n tooltipTriggerEvents,\n} from '@prosekit/web/tooltip'\nimport type { Component } from 'solid-js'\n\nimport type { PropsWithElement } from '../../types'\nimport { createComponent } from '../create-component'\nimport type { CreateProps } from '../create-props'\n\n/**\n * Props for the {@link TooltipTrigger} component.\n */\nexport interface TooltipTriggerProps extends Partial<CreateProps<Props, Events>> {}\n\nexport const TooltipTrigger: Component<PropsWithElement<\n TooltipTriggerProps,\n TooltipTriggerElement\n>> = createComponent<\n TooltipTriggerProps,\n TooltipTriggerElement\n>(\n 'prosekit-tooltip-trigger', \n Object.keys(tooltipTriggerProps),\n Object.keys(tooltipTriggerEvents),\n)\n"],"mappings":";;;;AAkBA,MAAa,iBAGR,gBAIH,4BACA,OAAO,KAAK,oBAAoB,EAChC,OAAO,KAAK,qBAAqB,CAClC;;;;ACVD,MAAa,cAGR,gBAIH,yBACA,OAAO,KAAK,iBAAiB,EAC7B,OAAO,KAAK,kBAAkB,CAC/B;;;;ACVD,MAAa,iBAGR,gBAIH,4BACA,OAAO,KAAK,oBAAoB,EAChC,OAAO,KAAK,qBAAqB,CAClC"}
|
package/dist/prosekit-solid.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { i as PropsWithElement, n as PropsWithChildren, r as PropsWithClass, t as MaybeAccessor } from "./types-
|
|
1
|
+
import { i as PropsWithElement, n as PropsWithChildren, r as PropsWithClass, t as MaybeAccessor } from "./types-Bx9mKDTJ.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";
|
|
@@ -91,6 +91,7 @@ declare function useExtension(
|
|
|
91
91
|
* The accessor to an extension to add to the editor. If it changes, the previous
|
|
92
92
|
* extension will be removed and the new one (if not null) will be added.
|
|
93
93
|
*/
|
|
94
|
+
|
|
94
95
|
extension: Accessor<Extension | null>, options?: UseExtensionOptions): void;
|
|
95
96
|
//#endregion
|
|
96
97
|
//#region src/hooks/use-doc-change.d.ts
|
|
@@ -144,6 +145,7 @@ declare function useEditorDerivedValue<E extends Extension, Derived>(
|
|
|
144
145
|
* It will be called whenever the editor's document state changes, or when it
|
|
145
146
|
* mounts.
|
|
146
147
|
*/
|
|
148
|
+
|
|
147
149
|
derive: (editor: Editor<E>) => Derived, options?: UseEditorDerivedOptions<E>): Accessor<Derived>;
|
|
148
150
|
//#endregion
|
|
149
151
|
//#region src/hooks/use-keymap.d.ts
|
|
@@ -1 +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","../src/hooks/use-editor.ts","../src/hooks/use-editor-derived-value.ts","../src/hooks/use-keymap.ts","../src/hooks/use-state-update.ts"],"
|
|
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","../src/hooks/use-editor.ts","../src/hooks/use-editor-derived-value.ts","../src/hooks/use-keymap.ts","../src/hooks/use-state-update.ts"],"mappings":";;;;;;;;;KAQY,aAAA,GAAgB,WAAA;EAC1B,MAAA,EAAQ,MAAA;AAAA;;;;;AADV;cASa,QAAA,EAAU,SAAA,CAAU,aAAA;;;;;;UCDhB,kBAAA,SAA2B,oBAAA;ADR5C;;;AAAA,KCaY,sBAAA,GAAyB,SAAA,CAAU,kBAAA;;;;;;UAO9B,oBAAA,SAA6B,uBAAA,CAAwB,sBAAA;EDIrE;;;ECAC,IAAA;AAAA;;;;AAXF;;iBAoDgB,mBAAA,CAAoB,OAAA,EAAS,oBAAA,GAAuB,SAAA;;;;;;UCzDnD,kBAAA,SAA2B,oBAAA;AFR5C;;;AAAA,KEaY,sBAAA,GAAyB,SAAA,CAAU,kBAAA;;;;;;UAO9B,oBAAA,SAA6B,uBAAA,CAAwB,sBAAA;EFIrE;;;EEAC,IAAA;AAAA;;;;ADXF;;iBCmEgB,mBAAA,CAAoB,OAAA,EAAS,oBAAA,GAAuB,SAAA;;;UChFnD,mBAAA;;;;;EAKf,MAAA,GAAS,aAAA,CAAc,MAAA;EHLb;;;EGUV,QAAA,GAAW,QAAA;AAAA;;;;iBAMG,YAAA;AHPhB;;;;;AGYE,SAAA,EAAW,QAAA,CAAS,SAAA,UACpB,OAAA,GAAU,mBAAA;;;;;;;;iBCpBI,YAAA,CACd,OAAA,GAAU,GAAA,EAAK,eAAA,WACf,OAAA,GAAU,mBAAA;;;;;;;;iBCFI,SAAA,WAAoB,SAAA,OAAA,CAAiB,OAAA;;;ALFrD;;;;EKSE,MAAA;AAAA,UACQ,MAAA,CAAO,CAAA;;;UCVA,uBAAA,WAAkC,SAAA;;;;;EAKjD,MAAA,GAAS,aAAA,CAAc,MAAA,CAAO,CAAA;AAAA;;;;;;;;;ANIhC;;;;iBMWgB,qBAAA,WAAgC,SAAA,UAAA;;;;ALZhD;;;;AKmBE,MAAA,GAAS,MAAA,EAAQ,MAAA,CAAO,CAAA,MAAO,OAAA,EAC/B,OAAA,GAAU,uBAAA,CAAwB,CAAA,IACjC,QAAA,CAAS,OAAA;;;iBCjCI,SAAA,CAAU,MAAA,QAAc,MAAA,EAAQ,OAAA,GAAU,mBAAA;;;;;;;;iBCM1C,cAAA,CACd,OAAA,GAAU,KAAA,EAAO,WAAA,WACjB,OAAA,GAAU,mBAAA"}
|
package/dist/prosekit-solid.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as useEditorContext, t as EditorContextProvider } from "./editor-context-
|
|
1
|
+
import { n as useEditorContext, t as EditorContextProvider } from "./editor-context-CAdqwRwB.js";
|
|
2
2
|
import { ProsemirrorAdapterProvider, useMarkViewContext, useMarkViewFactory, useNodeViewContext, useNodeViewFactory } from "@prosemirror-adapter/solid";
|
|
3
3
|
import { createComponent, createEffect, createMemo, createSignal, onCleanup } from "solid-js";
|
|
4
4
|
import { EditorNotFoundError, ProseKitError, defineDocChangeHandler, defineKeymap, defineMarkViewComponent, defineMarkViewFactory, defineMountHandler, defineNodeViewComponent, defineNodeViewFactory, defineUpdateHandler, union, withPriority } from "@prosekit/core";
|
|
@@ -172,18 +172,18 @@ function defineSolidNodeViewFactory(factory) {
|
|
|
172
172
|
* @public
|
|
173
173
|
*/
|
|
174
174
|
const ProseKit = (props) => {
|
|
175
|
-
return createComponent(
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
get children() {
|
|
175
|
+
return createComponent(EditorContextProvider, {
|
|
176
|
+
get value() {
|
|
177
|
+
return props.editor;
|
|
178
|
+
},
|
|
179
|
+
get children() {
|
|
180
|
+
return createComponent(ProsemirrorAdapterProvider, { get children() {
|
|
181
181
|
consumeSolidNodeViews();
|
|
182
182
|
consumeSolidMarkViews();
|
|
183
183
|
return props.children;
|
|
184
|
-
}
|
|
185
|
-
}
|
|
186
|
-
}
|
|
184
|
+
} });
|
|
185
|
+
}
|
|
186
|
+
});
|
|
187
187
|
};
|
|
188
188
|
|
|
189
189
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prosekit-solid.js","names":["context: Accessor<SolidMarkViewProps>","context: Accessor<SolidNodeViewProps>","ProseKit: Component<ProseKitProps>","editorAccessor: Accessor<Editor<E>>"],"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-editor-derived-value.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 context: Accessor<SolidMarkViewProps> = useMarkViewContext()\n const props: SolidMarkViewProps = {\n get contentRef() {\n return context().contentRef\n },\n get view() {\n return context().view\n },\n get mark() {\n return context().mark\n },\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 context: Accessor<SolidNodeViewProps> = useNodeViewContext()\n const props: SolidNodeViewProps = {\n get contentRef() {\n return context().contentRef\n },\n get view() {\n return context().view\n },\n get getPos() {\n return context().getPos\n },\n get setAttrs() {\n return context().setAttrs\n },\n get node() {\n return context().node\n },\n get selected() {\n return context().selected\n },\n get decorations() {\n return context().decorations\n },\n get innerDecorations() {\n return context().innerDecorations\n },\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 type {\n Editor,\n Extension,\n} from '@prosekit/core'\nimport {\n createMemo,\n type Accessor,\n} from 'solid-js'\n\nimport type { MaybeAccessor } from '../types'\nimport { toValue } from '../utils/to-value'\n\nimport { useEditor } from './use-editor'\n\nexport interface UseEditorDerivedOptions<E extends Extension = any> {\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<E>>\n}\n\n/**\n * Runs a function to derive a value from the editor instance after editor state\n * changes.\n *\n * This is useful when you need to render something based on the editor state,\n * for example, whether the selected text is wrapped in an italic mark.\n *\n * It returns an accessor of the derived value that updates whenever the editor\n * state changes.\n *\n * @public\n */\nexport function useEditorDerivedValue<E extends Extension, Derived>(\n /**\n * A function that receives the editor instance and returns a derived value.\n *\n * It will be called whenever the editor's document state changes, or when it\n * mounts.\n */\n derive: (editor: Editor<E>) => Derived,\n options?: UseEditorDerivedOptions<E>,\n): Accessor<Derived> {\n const initialEditor = options?.editor\n const editorAccessor: Accessor<Editor<E>> = initialEditor\n ? () => toValue(initialEditor)\n : useEditor<E>({ update: true })\n\n return createMemo(() => derive(editorAccessor()))\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":"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"}
|
|
1
|
+
{"version":3,"file":"prosekit-solid.js","names":[],"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-editor-derived-value.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 { EditorNotFoundError, type Editor, type Extension } from '@prosekit/core'\nimport { createEffect, onCleanup, type Accessor } 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 { withPriority, type Extension, type Priority } 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 { Editor, Extension, Priority } 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 { defineMarkViewComponent, defineMarkViewFactory, type Extension } 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 { createComponent, createMemo, type Accessor, type Component } 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 context: Accessor<SolidMarkViewProps> = useMarkViewContext()\n const props: SolidMarkViewProps = {\n get contentRef() {\n return context().contentRef\n },\n get view() {\n return context().view\n },\n get mark() {\n return context().mark\n },\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 { defineNodeViewComponent, defineNodeViewFactory, type Extension } 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 { createComponent, createMemo, type Accessor, type Component } 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 context: Accessor<SolidNodeViewProps> = useNodeViewContext()\n const props: SolidNodeViewProps = {\n get contentRef() {\n return context().contentRef\n },\n get view() {\n return context().view\n },\n get getPos() {\n return context().getPos\n },\n get setAttrs() {\n return context().setAttrs\n },\n get node() {\n return context().node\n },\n get selected() {\n return context().selected\n },\n get decorations() {\n return context().decorations\n },\n get innerDecorations() {\n return context().innerDecorations\n },\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 { createComponent, type Component, type ParentProps } 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(EditorContextProvider, {\n get value() {\n return props.editor\n },\n get children() {\n return createComponent(ProsemirrorAdapterProvider, {\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 { useExtension, type UseExtensionOptions } 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 { defineMountHandler, defineUpdateHandler, ProseKitError, union, type Editor, type Extension } from '@prosekit/core'\nimport { createEffect, createSignal } 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 type { Editor, Extension } from '@prosekit/core'\nimport { createMemo, type Accessor } from 'solid-js'\n\nimport type { MaybeAccessor } from '../types'\nimport { toValue } from '../utils/to-value'\n\nimport { useEditor } from './use-editor'\n\nexport interface UseEditorDerivedOptions<E extends Extension = any> {\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<E>>\n}\n\n/**\n * Runs a function to derive a value from the editor instance after editor state\n * changes.\n *\n * This is useful when you need to render something based on the editor state,\n * for example, whether the selected text is wrapped in an italic mark.\n *\n * It returns an accessor of the derived value that updates whenever the editor\n * state changes.\n *\n * @public\n */\nexport function useEditorDerivedValue<E extends Extension, Derived>(\n /**\n * A function that receives the editor instance and returns a derived value.\n *\n * It will be called whenever the editor's document state changes, or when it\n * mounts.\n */\n derive: (editor: Editor<E>) => Derived,\n options?: UseEditorDerivedOptions<E>,\n): Accessor<Derived> {\n const initialEditor = options?.editor\n const editorAccessor: Accessor<Editor<E>> = initialEditor\n ? () => toValue(initialEditor)\n : useEditor<E>({ update: true })\n\n return createMemo(() => derive(editorAccessor()))\n}\n","import { defineKeymap, type Keymap } from '@prosekit/core'\n\nimport { useExtension, type UseExtensionOptions } 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 { useExtension, type UseExtensionOptions } 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":"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"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { Accessor, JSX, JSXElement } from "solid-js";
|
|
2
2
|
|
|
3
3
|
//#region src/types.d.ts
|
|
4
|
-
|
|
5
4
|
/**
|
|
6
5
|
* @internal
|
|
7
6
|
*/
|
|
@@ -24,4 +23,4 @@ type PropsWithElement<Props extends object, CustomElement extends HTMLElement> =
|
|
|
24
23
|
type MaybeAccessor<T> = T | Accessor<T>;
|
|
25
24
|
//#endregion
|
|
26
25
|
export { PropsWithElement as i, PropsWithChildren as n, PropsWithClass as r, MaybeAccessor as t };
|
|
27
|
-
//# sourceMappingURL=types-
|
|
26
|
+
//# sourceMappingURL=types-Bx9mKDTJ.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types-Bx9mKDTJ.d.ts","names":[],"sources":["../src/types.ts"],"mappings":";;;;;AAKA;KAAY,cAAA,gBAA8B,CAAA;EACxC,KAAA;AAAA;;;;KAMU,iBAAA,gBAAiC,CAAA;EAC3C,QAAA,GAAW,UAAA;AAAA;;;;KAMD,gBAAA,6CAA6D,WAAA,IAAe,KAAA,GAAQ,GAAA,CAAI,cAAA,CAAe,aAAA;;;;KAKvG,aAAA,MAAmB,CAAA,GAAI,QAAA,CAAS,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@prosekit/solid",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.6.
|
|
4
|
+
"version": "0.6.5",
|
|
5
5
|
"private": false,
|
|
6
6
|
"description": "Solid components and utilities for ProseKit",
|
|
7
7
|
"author": {
|
|
@@ -70,9 +70,9 @@
|
|
|
70
70
|
"dependencies": {
|
|
71
71
|
"@prosemirror-adapter/core": "^0.4.6",
|
|
72
72
|
"@prosemirror-adapter/solid": "^0.4.6",
|
|
73
|
+
"@prosekit/core": "^0.10.0",
|
|
73
74
|
"@prosekit/pm": "^0.1.15",
|
|
74
|
-
"@prosekit/
|
|
75
|
-
"@prosekit/web": "^0.7.8"
|
|
75
|
+
"@prosekit/web": "^0.7.10"
|
|
76
76
|
},
|
|
77
77
|
"peerDependencies": {
|
|
78
78
|
"solid-js": ">= 1.7.0"
|
|
@@ -83,8 +83,8 @@
|
|
|
83
83
|
}
|
|
84
84
|
},
|
|
85
85
|
"devDependencies": {
|
|
86
|
-
"solid-js": "^1.9.
|
|
87
|
-
"tsdown": "^0.
|
|
86
|
+
"solid-js": "^1.9.11",
|
|
87
|
+
"tsdown": "^0.20.1",
|
|
88
88
|
"typescript": "~5.9.3",
|
|
89
89
|
"@prosekit/config-tsdown": "0.0.0",
|
|
90
90
|
"@prosekit/config-vitest": "0.0.0"
|
|
@@ -52,7 +52,7 @@ export function createComponent<
|
|
|
52
52
|
properties['prop:editor'] = () => props['editor'] || editor
|
|
53
53
|
}
|
|
54
54
|
|
|
55
|
-
return h(tagName, { ...properties, ...eventHandlers })
|
|
55
|
+
return () => h(tagName, { ...properties, ...eventHandlers })
|
|
56
56
|
}
|
|
57
57
|
|
|
58
58
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-return
|
|
@@ -1,10 +1,6 @@
|
|
|
1
1
|
import type { Editor } from '@prosekit/core'
|
|
2
2
|
import { ProsemirrorAdapterProvider } from '@prosemirror-adapter/solid'
|
|
3
|
-
import {
|
|
4
|
-
createComponent,
|
|
5
|
-
type Component,
|
|
6
|
-
type ParentProps,
|
|
7
|
-
} from 'solid-js'
|
|
3
|
+
import { createComponent, type Component, type ParentProps } from 'solid-js'
|
|
8
4
|
|
|
9
5
|
import { EditorContextProvider } from '../contexts/editor-context'
|
|
10
6
|
import { consumeSolidMarkViews } from '../extensions/solid-mark-view'
|
|
@@ -20,12 +16,12 @@ export type ProseKitProps = ParentProps<{
|
|
|
20
16
|
* @public
|
|
21
17
|
*/
|
|
22
18
|
export const ProseKit: Component<ProseKitProps> = (props) => {
|
|
23
|
-
return createComponent(
|
|
19
|
+
return createComponent(EditorContextProvider, {
|
|
20
|
+
get value() {
|
|
21
|
+
return props.editor
|
|
22
|
+
},
|
|
24
23
|
get children() {
|
|
25
|
-
return createComponent(
|
|
26
|
-
get value() {
|
|
27
|
-
return props.editor
|
|
28
|
-
},
|
|
24
|
+
return createComponent(ProsemirrorAdapterProvider, {
|
|
29
25
|
get children() {
|
|
30
26
|
consumeSolidNodeViews()
|
|
31
27
|
consumeSolidMarkViews()
|
|
@@ -1,12 +1,5 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
|
|
3
|
-
Extension,
|
|
4
|
-
} from '@prosekit/core'
|
|
5
|
-
import {
|
|
6
|
-
createContext,
|
|
7
|
-
useContext,
|
|
8
|
-
type ContextProviderComponent,
|
|
9
|
-
} from 'solid-js'
|
|
1
|
+
import type { Editor, Extension } from '@prosekit/core'
|
|
2
|
+
import { createContext, useContext, type ContextProviderComponent } from 'solid-js'
|
|
10
3
|
|
|
11
4
|
const editorContext = createContext<Editor | null>(null)
|
|
12
5
|
|
|
@@ -1,8 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
defineMarkViewComponent,
|
|
3
|
-
defineMarkViewFactory,
|
|
4
|
-
type Extension,
|
|
5
|
-
} from '@prosekit/core'
|
|
1
|
+
import { defineMarkViewComponent, defineMarkViewFactory, type Extension } from '@prosekit/core'
|
|
6
2
|
import type { MarkViewConstructor } from '@prosekit/pm/view'
|
|
7
3
|
import type { CoreMarkViewUserOptions } from '@prosemirror-adapter/core'
|
|
8
4
|
import {
|
|
@@ -11,12 +7,7 @@ import {
|
|
|
11
7
|
type MarkViewContextProps,
|
|
12
8
|
type SolidMarkViewUserOptions,
|
|
13
9
|
} from '@prosemirror-adapter/solid'
|
|
14
|
-
import {
|
|
15
|
-
createComponent,
|
|
16
|
-
createMemo,
|
|
17
|
-
type Accessor,
|
|
18
|
-
type Component,
|
|
19
|
-
} from 'solid-js'
|
|
10
|
+
import { createComponent, createMemo, type Accessor, type Component } from 'solid-js'
|
|
20
11
|
|
|
21
12
|
import { useExtension } from '../hooks/use-extension'
|
|
22
13
|
|
|
@@ -1,8 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
defineNodeViewComponent,
|
|
3
|
-
defineNodeViewFactory,
|
|
4
|
-
type Extension,
|
|
5
|
-
} from '@prosekit/core'
|
|
1
|
+
import { defineNodeViewComponent, defineNodeViewFactory, type Extension } from '@prosekit/core'
|
|
6
2
|
import type { NodeViewConstructor } from '@prosekit/pm/view'
|
|
7
3
|
import type { CoreNodeViewUserOptions } from '@prosemirror-adapter/core'
|
|
8
4
|
import {
|
|
@@ -11,12 +7,7 @@ import {
|
|
|
11
7
|
type NodeViewContextProps,
|
|
12
8
|
type SolidNodeViewUserOptions,
|
|
13
9
|
} from '@prosemirror-adapter/solid'
|
|
14
|
-
import {
|
|
15
|
-
createComponent,
|
|
16
|
-
createMemo,
|
|
17
|
-
type Accessor,
|
|
18
|
-
type Component,
|
|
19
|
-
} from 'solid-js'
|
|
10
|
+
import { createComponent, createMemo, type Accessor, type Component } from 'solid-js'
|
|
20
11
|
|
|
21
12
|
import { useExtension } from '../hooks/use-extension'
|
|
22
13
|
|
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
import { defineDocChangeHandler } from '@prosekit/core'
|
|
2
2
|
import type { ProseMirrorNode } from '@prosekit/pm/model'
|
|
3
3
|
|
|
4
|
-
import {
|
|
5
|
-
useExtension,
|
|
6
|
-
type UseExtensionOptions,
|
|
7
|
-
} from './use-extension'
|
|
4
|
+
import { useExtension, type UseExtensionOptions } from './use-extension'
|
|
8
5
|
|
|
9
6
|
/**
|
|
10
7
|
* Calls the given handler whenever the editor document changes.
|
|
@@ -1,11 +1,5 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
|
|
3
|
-
Extension,
|
|
4
|
-
} from '@prosekit/core'
|
|
5
|
-
import {
|
|
6
|
-
createMemo,
|
|
7
|
-
type Accessor,
|
|
8
|
-
} from 'solid-js'
|
|
1
|
+
import type { Editor, Extension } from '@prosekit/core'
|
|
2
|
+
import { createMemo, type Accessor } from 'solid-js'
|
|
9
3
|
|
|
10
4
|
import type { MaybeAccessor } from '../types'
|
|
11
5
|
import { toValue } from '../utils/to-value'
|
|
@@ -1,13 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
type Editor,
|
|
4
|
-
type Extension,
|
|
5
|
-
} from '@prosekit/core'
|
|
6
|
-
import {
|
|
7
|
-
createEffect,
|
|
8
|
-
onCleanup,
|
|
9
|
-
type Accessor,
|
|
10
|
-
} from 'solid-js'
|
|
1
|
+
import { EditorNotFoundError, type Editor, type Extension } from '@prosekit/core'
|
|
2
|
+
import { createEffect, onCleanup, type Accessor } from 'solid-js'
|
|
11
3
|
|
|
12
4
|
import { useEditorContext } from '../contexts/editor-context'
|
|
13
5
|
import type { MaybeAccessor } from '../types'
|
package/src/hooks/use-editor.ts
CHANGED
|
@@ -1,15 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
defineUpdateHandler,
|
|
4
|
-
ProseKitError,
|
|
5
|
-
union,
|
|
6
|
-
type Editor,
|
|
7
|
-
type Extension,
|
|
8
|
-
} from '@prosekit/core'
|
|
9
|
-
import {
|
|
10
|
-
createEffect,
|
|
11
|
-
createSignal,
|
|
12
|
-
} from 'solid-js'
|
|
1
|
+
import { defineMountHandler, defineUpdateHandler, ProseKitError, union, type Editor, type Extension } from '@prosekit/core'
|
|
2
|
+
import { createEffect, createSignal } from 'solid-js'
|
|
13
3
|
|
|
14
4
|
import { useEditorContext } from '../contexts/editor-context'
|
|
15
5
|
|
package/src/hooks/use-keymap.ts
CHANGED
|
@@ -1,12 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
defineKeymap,
|
|
3
|
-
type Keymap,
|
|
4
|
-
} from '@prosekit/core'
|
|
1
|
+
import { defineKeymap, type Keymap } from '@prosekit/core'
|
|
5
2
|
|
|
6
|
-
import {
|
|
7
|
-
useExtension,
|
|
8
|
-
type UseExtensionOptions,
|
|
9
|
-
} from './use-extension'
|
|
3
|
+
import { useExtension, type UseExtensionOptions } from './use-extension'
|
|
10
4
|
|
|
11
5
|
export function useKeymap(keymap: () => Keymap, options?: UseExtensionOptions): void {
|
|
12
6
|
const extension = () => defineKeymap(keymap())
|
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
import { defineUpdateHandler } from '@prosekit/core'
|
|
2
2
|
import type { EditorState } from '@prosekit/pm/state'
|
|
3
3
|
|
|
4
|
-
import {
|
|
5
|
-
useExtension,
|
|
6
|
-
type UseExtensionOptions,
|
|
7
|
-
} from './use-extension'
|
|
4
|
+
import { useExtension, type UseExtensionOptions } from './use-extension'
|
|
8
5
|
|
|
9
6
|
/**
|
|
10
7
|
* Calls the given handler whenever the editor state changes.
|
package/src/index.ts
CHANGED
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
export {
|
|
2
|
-
ProseKit,
|
|
3
|
-
type ProseKitProps,
|
|
4
|
-
} from './components/prosekit'
|
|
1
|
+
export { ProseKit, type ProseKitProps } from './components/prosekit'
|
|
5
2
|
export {
|
|
6
3
|
defineSolidMarkView,
|
|
7
4
|
type SolidMarkViewComponent,
|
|
@@ -16,19 +13,8 @@ export {
|
|
|
16
13
|
} from './extensions/solid-node-view'
|
|
17
14
|
export { useDocChange } from './hooks/use-doc-change'
|
|
18
15
|
export { useEditor } from './hooks/use-editor'
|
|
19
|
-
export {
|
|
20
|
-
|
|
21
|
-
type UseEditorDerivedOptions,
|
|
22
|
-
} from './hooks/use-editor-derived-value'
|
|
23
|
-
export {
|
|
24
|
-
useExtension,
|
|
25
|
-
type UseExtensionOptions,
|
|
26
|
-
} from './hooks/use-extension'
|
|
16
|
+
export { useEditorDerivedValue, type UseEditorDerivedOptions } from './hooks/use-editor-derived-value'
|
|
17
|
+
export { useExtension, type UseExtensionOptions } from './hooks/use-extension'
|
|
27
18
|
export { useKeymap } from './hooks/use-keymap'
|
|
28
19
|
export { useStateUpdate } from './hooks/use-state-update'
|
|
29
|
-
export type {
|
|
30
|
-
MaybeAccessor,
|
|
31
|
-
PropsWithChildren,
|
|
32
|
-
PropsWithClass,
|
|
33
|
-
PropsWithElement,
|
|
34
|
-
} from './types'
|
|
20
|
+
export type { MaybeAccessor, PropsWithChildren, PropsWithClass, PropsWithElement } from './types'
|
package/src/types.ts
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"create-component-DOv1yHjo.js","names":["properties: Record<string, () => unknown>","eventHandlers: Record<string, AnyFunction>"],"sources":["../src/components/create-component.ts"],"sourcesContent":["import type { AnyFunction } from '@prosekit/core'\nimport type { Component } from 'solid-js'\nimport h from 'solid-js/h'\n\nimport { useEditorContext } from '../contexts/editor-context'\nimport type { PropsWithElement } from '../types'\n\nexport function createComponent<\n Props extends object,\n CustomElement extends HTMLElement,\n>(\n tagName: string,\n propNames: string[],\n eventNames: string[],\n): Component<PropsWithElement<Props, CustomElement>> {\n const hasEditor = propNames.includes('editor')\n const lowerCaseEventNameMap = new Map(\n eventNames.map((name) => [name.toLowerCase(), name]),\n )\n\n const Component = (props: Record<string, unknown>) => {\n const properties: Record<string, () => unknown> = {}\n const eventHandlers: Record<string, AnyFunction> = {}\n\n for (const name of Object.keys(props)) {\n if (propNames.includes(name)) {\n properties['prop:' + name] = () => props[name]\n continue\n }\n\n if (name.startsWith('on')) {\n const lowerCaseEventName = name.slice(2).toLowerCase()\n const eventName = lowerCaseEventNameMap.get(lowerCaseEventName)\n if (eventName) {\n const extractDetail = eventName.endsWith('Change')\n eventHandlers['on:' + eventName] = (event: Event) => {\n const handler = props[name] as AnyFunction | null\n if (typeof handler === 'function') {\n handler(extractDetail ? (event as CustomEvent).detail : event)\n }\n }\n continue\n }\n }\n\n properties[name] = () => props[name]\n }\n\n const editor = useEditorContext()\n\n if (hasEditor && editor) {\n properties['prop:editor'] = () => props['editor'] || editor\n }\n\n return h(tagName, { ...properties, ...eventHandlers })\n }\n\n // eslint-disable-next-line @typescript-eslint/no-unsafe-return\n return Component as any\n}\n"],"mappings":";;;;AAOA,SAAgB,gBAId,SACA,WACA,YACmD;CACnD,MAAM,YAAY,UAAU,SAAS,SAAS;CAC9C,MAAM,wBAAwB,IAAI,IAChC,WAAW,KAAK,SAAS,CAAC,KAAK,aAAa,EAAE,KAAK,CAAC,CACrD;CAED,MAAM,aAAa,UAAmC;EACpD,MAAMA,aAA4C,EAAE;EACpD,MAAMC,gBAA6C,EAAE;AAErD,OAAK,MAAM,QAAQ,OAAO,KAAK,MAAM,EAAE;AACrC,OAAI,UAAU,SAAS,KAAK,EAAE;AAC5B,eAAW,UAAU,cAAc,MAAM;AACzC;;AAGF,OAAI,KAAK,WAAW,KAAK,EAAE;IACzB,MAAM,qBAAqB,KAAK,MAAM,EAAE,CAAC,aAAa;IACtD,MAAM,YAAY,sBAAsB,IAAI,mBAAmB;AAC/D,QAAI,WAAW;KACb,MAAM,gBAAgB,UAAU,SAAS,SAAS;AAClD,mBAAc,QAAQ,cAAc,UAAiB;MACnD,MAAM,UAAU,MAAM;AACtB,UAAI,OAAO,YAAY,WACrB,SAAQ,gBAAiB,MAAsB,SAAS,MAAM;;AAGlE;;;AAIJ,cAAW,cAAc,MAAM;;EAGjC,MAAM,SAAS,kBAAkB;AAEjC,MAAI,aAAa,OACf,YAAW,uBAAuB,MAAM,aAAa;AAGvD,SAAO,EAAE,SAAS;GAAE,GAAG;GAAY,GAAG;GAAe,CAAC;;AAIxD,QAAO"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"create-props-IUcX0Ggy.d.ts","names":[],"sources":["../src/components/create-props.ts"],"sourcesContent":[],"mappings":";KAAY,yCAAA,MACyB,KADd,GAAA,OAAA,EACc,EAAA,eAAA,gBACE,MAAA,MAAA,GAAS,WAAT,EAAS,CAAA,GAC5C,KAD4C,GACpC,gBADoC,CACnB,MADmB,CAAA;KAG3C,gBAFD,CAAA,eAAA,gBAAyB,MAGU,MAHV,GAGmB,WAHnB,EAAjB,CAAA,GAAA,gBAAgB,MAKN,MALM,IAAA,KAKS,UALT,CAAA,MAAA,GAK6B,SAL7B,CAAA,EAAA,GAAA,CAAA,KAAA,EAMjB,SANiB,SAAA,GAAA,MAAA,QAAA,GAMqB,MANrB,CAM4B,SAN5B,CAAA,CAAA,QAAA,CAAA,GAOpB,MAPoB,CAOb,SAPa,CAAA,EAAA,GAAA,IAAA,EAAQ"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"editor-context-B5bsBkGo.js","names":["EditorContextProvider: ContextProviderComponent<Editor | null>"],"sources":["../src/contexts/editor-context.ts"],"sourcesContent":["import type {\n Editor,\n Extension,\n} from '@prosekit/core'\nimport {\n createContext,\n useContext,\n type ContextProviderComponent,\n} from 'solid-js'\n\nconst editorContext = createContext<Editor | null>(null)\n\n/**\n * @internal\n */\nexport function useEditorContext<E extends Extension>(): Editor<E> | null {\n return useContext(editorContext)\n}\n\n/**\n * @internal\n */\nexport const EditorContextProvider: ContextProviderComponent<Editor | null> = editorContext.Provider\n"],"mappings":";;;AAUA,MAAM,gBAAgB,cAA6B,KAAK;;;;AAKxD,SAAgB,mBAA0D;AACxE,QAAO,WAAW,cAAc;;;;;AAMlC,MAAaA,wBAAiE,cAAc"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types-VT1O6Xnr.d.ts","names":[],"sources":["../src/types.ts"],"sourcesContent":[],"mappings":";;;;;;AASA;AAOY,KAPA,cAOiB,CAAA,IAAA,OAAgB,CAAA,GAPH,CAQ7B,GAAA;EAMD,KAAA,CAAA,EAAA,MAAA,GAAA,SAAgB;CAA6C;;;;AAAyC,KAPtG,iBAOsG,CAAA,IAAA,OAAA,CAAA,GAPrE,CAOqE,GAAA;EAKtG,QAAA,CAAA,EAXC,UAWY,GAAA,SAAA;CAAM;;;;KALnB,6DAA6D,eAAe,QAAQ,GAAA,CAAI,eAAe;;;;KAKvG,mBAAmB,IAAI,SAAS"}
|