@prosekit/solid 0.7.0-beta.1 → 0.7.0-beta.2
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/prosekit-solid-autocomplete.d.ts +225 -19
- package/dist/prosekit-solid-autocomplete.d.ts.map +1 -1
- package/dist/prosekit-solid-autocomplete.js +204 -9
- package/dist/prosekit-solid-autocomplete.js.map +1 -1
- package/dist/prosekit-solid-block-handle.d.ts +209 -15
- package/dist/prosekit-solid-block-handle.d.ts.map +1 -1
- package/dist/prosekit-solid-block-handle.js +160 -7
- package/dist/prosekit-solid-block-handle.js.map +1 -1
- package/dist/prosekit-solid-drop-indicator.d.ts +26 -7
- package/dist/prosekit-solid-drop-indicator.d.ts.map +1 -1
- package/dist/prosekit-solid-drop-indicator.js +29 -3
- package/dist/prosekit-solid-drop-indicator.js.map +1 -1
- package/dist/prosekit-solid-inline-popover.d.ts +203 -9
- package/dist/prosekit-solid-inline-popover.d.ts.map +1 -1
- package/dist/prosekit-solid-inline-popover.js +128 -5
- package/dist/prosekit-solid-inline-popover.js.map +1 -1
- package/dist/prosekit-solid-menu.d.ts +287 -0
- package/dist/prosekit-solid-menu.d.ts.map +1 -0
- package/dist/prosekit-solid-menu.js +241 -0
- package/dist/prosekit-solid-menu.js.map +1 -0
- package/dist/prosekit-solid-popover.d.ts +226 -15
- package/dist/prosekit-solid-popover.d.ts.map +1 -1
- package/dist/prosekit-solid-popover.js +165 -7
- package/dist/prosekit-solid-popover.js.map +1 -1
- package/dist/prosekit-solid-resizable.d.ts +55 -13
- package/dist/prosekit-solid-resizable.d.ts.map +1 -1
- package/dist/prosekit-solid-resizable.js +69 -7
- package/dist/prosekit-solid-resizable.js.map +1 -1
- package/dist/prosekit-solid-table-handle.d.ts +446 -39
- package/dist/prosekit-solid-table-handle.d.ts.map +1 -1
- package/dist/prosekit-solid-table-handle.js +334 -19
- package/dist/prosekit-solid-table-handle.js.map +1 -1
- package/dist/prosekit-solid-tooltip.d.ts +210 -15
- package/dist/prosekit-solid-tooltip.d.ts.map +1 -1
- package/dist/prosekit-solid-tooltip.js +149 -7
- package/dist/prosekit-solid-tooltip.js.map +1 -1
- package/dist/prosekit-solid.d.ts +23 -2
- package/dist/prosekit-solid.d.ts.map +1 -1
- package/package.json +26 -18
- package/src/components/autocomplete/autocomplete-empty.gen.ts +22 -24
- package/src/components/autocomplete/autocomplete-item.gen.ts +82 -26
- package/src/components/autocomplete/autocomplete-popup.gen.ts +78 -0
- package/src/components/autocomplete/autocomplete-positioner.gen.ts +167 -0
- package/src/components/autocomplete/autocomplete-root.gen.ts +110 -0
- package/src/components/autocomplete/index.gen.ts +12 -4
- package/src/components/autocomplete/index.ts +27 -0
- package/src/components/block-handle/block-handle-add.gen.ts +54 -26
- package/src/components/block-handle/block-handle-draggable.gen.ts +54 -26
- package/src/components/block-handle/block-handle-popup.gen.ts +27 -0
- package/src/components/block-handle/block-handle-positioner.gen.ts +185 -0
- package/src/components/block-handle/block-handle-root.gen.ts +82 -0
- package/src/components/block-handle/index.gen.ts +13 -3
- package/src/components/block-handle/index.ts +27 -0
- package/src/components/drop-indicator/drop-indicator.gen.ts +60 -26
- package/src/components/drop-indicator/index.gen.ts +5 -1
- package/src/components/drop-indicator/index.ts +14 -0
- package/src/components/inline-popover/index.gen.ts +11 -1
- package/src/components/inline-popover/index.ts +22 -0
- package/src/components/inline-popover/inline-popover-popup.gen.ts +27 -0
- package/src/components/inline-popover/inline-popover-positioner.gen.ts +191 -0
- package/src/components/inline-popover/inline-popover-root.gen.ts +106 -0
- package/src/components/menu/index.gen.ts +19 -0
- package/src/components/menu/index.ts +37 -0
- package/src/components/menu/menu-item.gen.ts +89 -0
- package/src/components/menu/menu-popup.gen.ts +53 -0
- package/src/components/menu/menu-positioner.gen.ts +192 -0
- package/src/components/menu/menu-root.gen.ts +86 -0
- package/src/components/menu/menu-submenu-root.gen.ts +27 -0
- package/src/components/menu/menu-submenu-trigger.gen.ts +27 -0
- package/src/components/menu/menu-trigger.gen.ts +77 -0
- package/src/components/popover/index.gen.ts +11 -3
- package/src/components/popover/index.ts +24 -0
- package/src/components/popover/popover-popup.gen.ts +27 -0
- package/src/components/popover/popover-positioner.gen.ts +192 -0
- package/src/components/popover/popover-root.gen.ts +90 -26
- package/src/components/popover/popover-trigger.gen.ts +90 -26
- package/src/components/resizable/index.gen.ts +8 -2
- package/src/components/resizable/index.ts +20 -0
- package/src/components/resizable/resizable-handle.gen.ts +49 -26
- package/src/components/resizable/resizable-root.gen.ts +89 -26
- package/src/components/table-handle/index.gen.ts +17 -9
- package/src/components/table-handle/index.ts +58 -0
- package/src/components/table-handle/table-handle-column-menu-root.gen.ts +61 -0
- package/src/components/table-handle/table-handle-column-menu-trigger.gen.ts +55 -0
- package/src/components/table-handle/table-handle-column-popup.gen.ts +27 -0
- package/src/components/table-handle/table-handle-column-positioner.gen.ts +196 -0
- package/src/components/table-handle/table-handle-drag-preview.gen.ts +52 -26
- package/src/components/table-handle/table-handle-drop-indicator.gen.ts +52 -26
- package/src/components/table-handle/table-handle-root.gen.ts +54 -26
- package/src/components/table-handle/table-handle-row-menu-root.gen.ts +61 -0
- package/src/components/table-handle/table-handle-row-menu-trigger.gen.ts +55 -0
- package/src/components/table-handle/table-handle-row-popup.gen.ts +27 -0
- package/src/components/table-handle/table-handle-row-positioner.gen.ts +196 -0
- package/src/components/tooltip/index.gen.ts +11 -3
- package/src/components/tooltip/index.ts +24 -0
- package/src/components/tooltip/tooltip-popup.gen.ts +27 -0
- package/src/components/tooltip/tooltip-positioner.gen.ts +192 -0
- package/src/components/tooltip/tooltip-root.gen.ts +83 -26
- package/src/components/tooltip/tooltip-trigger.gen.ts +58 -26
- package/dist/create-component.js +0 -41
- package/dist/create-component.js.map +0 -1
- package/dist/create-props.d.ts +0 -6
- package/dist/create-props.d.ts.map +0 -1
- package/dist/types.d.ts +0 -26
- package/dist/types.d.ts.map +0 -1
- package/src/components/autocomplete/autocomplete-list.gen.ts +0 -29
- package/src/components/autocomplete/autocomplete-popover.gen.ts +0 -29
- package/src/components/block-handle/block-handle-popover.gen.ts +0 -29
- package/src/components/create-component.ts +0 -60
- package/src/components/create-props.ts +0 -13
- package/src/components/inline-popover/inline-popover.gen.ts +0 -29
- package/src/components/popover/popover-content.gen.ts +0 -29
- package/src/components/table-handle/table-handle-column-root.gen.ts +0 -29
- package/src/components/table-handle/table-handle-column-trigger.gen.ts +0 -29
- package/src/components/table-handle/table-handle-popover-content.gen.ts +0 -29
- package/src/components/table-handle/table-handle-popover-item.gen.ts +0 -29
- package/src/components/table-handle/table-handle-row-root.gen.ts +0 -29
- package/src/components/table-handle/table-handle-row-trigger.gen.ts +0 -29
- package/src/components/tooltip/tooltip-content.gen.ts +0 -29
package/dist/create-component.js
DELETED
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import { n as useEditorContext } from "./editor-context.js";
|
|
2
|
-
import h from "solid-js/h";
|
|
3
|
-
//#region src/components/create-component.ts
|
|
4
|
-
function createComponent(tagName, propNames, eventNames) {
|
|
5
|
-
const hasEditor = propNames.includes("editor");
|
|
6
|
-
const lowerCaseEventNameMap = new Map(eventNames.map((name) => [name.toLowerCase(), name]));
|
|
7
|
-
const Component = (props) => {
|
|
8
|
-
const properties = {};
|
|
9
|
-
const eventHandlers = {};
|
|
10
|
-
for (const name of Object.keys(props)) {
|
|
11
|
-
if (propNames.includes(name)) {
|
|
12
|
-
properties["prop:" + name] = () => props[name];
|
|
13
|
-
continue;
|
|
14
|
-
}
|
|
15
|
-
if (name.startsWith("on")) {
|
|
16
|
-
const lowerCaseEventName = name.slice(2).toLowerCase();
|
|
17
|
-
const eventName = lowerCaseEventNameMap.get(lowerCaseEventName);
|
|
18
|
-
if (eventName) {
|
|
19
|
-
const extractDetail = eventName.endsWith("Change");
|
|
20
|
-
eventHandlers["on:" + eventName] = (event) => {
|
|
21
|
-
const handler = props[name];
|
|
22
|
-
if (typeof handler === "function") handler(extractDetail ? event.detail : event);
|
|
23
|
-
};
|
|
24
|
-
continue;
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
properties[name] = () => props[name];
|
|
28
|
-
}
|
|
29
|
-
const editor = useEditorContext();
|
|
30
|
-
if (hasEditor && editor) properties["prop:editor"] = () => props["editor"] || editor;
|
|
31
|
-
return () => h(tagName, {
|
|
32
|
-
...properties,
|
|
33
|
-
...eventHandlers
|
|
34
|
-
});
|
|
35
|
-
};
|
|
36
|
-
return Component;
|
|
37
|
-
}
|
|
38
|
-
//#endregion
|
|
39
|
-
export { createComponent as t };
|
|
40
|
-
|
|
41
|
-
//# sourceMappingURL=create-component.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"create-component.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.ts'\nimport type { PropsWithElement } from '../types.ts'\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"}
|
package/dist/create-props.d.ts
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
//#region src/components/create-props.d.ts
|
|
2
|
-
type CreateProps<Props extends { [PropName in keyof Props]: unknown }, Events extends { [EventName in keyof Events]: CustomEvent }> = Props & CreateEventProps<Events>;
|
|
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
|
-
//#endregion
|
|
5
|
-
export { CreateProps as t };
|
|
6
|
-
//# sourceMappingURL=create-props.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"create-props.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"}
|
package/dist/types.d.ts
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { Accessor, JSX, JSXElement } from "solid-js";
|
|
2
|
-
|
|
3
|
-
//#region src/types.d.ts
|
|
4
|
-
/**
|
|
5
|
-
* @internal
|
|
6
|
-
*/
|
|
7
|
-
type PropsWithClass<P = unknown> = P & {
|
|
8
|
-
class?: string | undefined;
|
|
9
|
-
};
|
|
10
|
-
/**
|
|
11
|
-
* @internal
|
|
12
|
-
*/
|
|
13
|
-
type PropsWithChildren<P = unknown> = P & {
|
|
14
|
-
children?: JSXElement | undefined;
|
|
15
|
-
};
|
|
16
|
-
/**
|
|
17
|
-
* @internal
|
|
18
|
-
*/
|
|
19
|
-
type PropsWithElement<Props extends object, CustomElement extends HTMLElement> = Props & JSX.HTMLAttributes<CustomElement>;
|
|
20
|
-
/**
|
|
21
|
-
* T or a reactive/non-reactive function returning T
|
|
22
|
-
*/
|
|
23
|
-
type MaybeAccessor<T> = T | Accessor<T>;
|
|
24
|
-
//#endregion
|
|
25
|
-
export { PropsWithElement as i, PropsWithChildren as n, PropsWithClass as r, MaybeAccessor as t };
|
|
26
|
-
//# sourceMappingURL=types.d.ts.map
|
package/dist/types.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.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"}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
type AutocompleteListElement,
|
|
3
|
-
type AutocompleteListProps as Props,
|
|
4
|
-
type AutocompleteListEvents as Events,
|
|
5
|
-
autocompleteListProps,
|
|
6
|
-
autocompleteListEvents,
|
|
7
|
-
} from '@prosekit/web/autocomplete'
|
|
8
|
-
import type { Component } from 'solid-js'
|
|
9
|
-
|
|
10
|
-
import type { PropsWithElement } from '../../types.ts'
|
|
11
|
-
import { createComponent } from '../create-component.ts'
|
|
12
|
-
import type { CreateProps } from '../create-props.ts'
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* Props for the {@link AutocompleteList} component.
|
|
16
|
-
*/
|
|
17
|
-
export interface AutocompleteListProps extends Partial<CreateProps<Props, Events>> {}
|
|
18
|
-
|
|
19
|
-
export const AutocompleteList: Component<PropsWithElement<
|
|
20
|
-
AutocompleteListProps,
|
|
21
|
-
AutocompleteListElement
|
|
22
|
-
>> = createComponent<
|
|
23
|
-
AutocompleteListProps,
|
|
24
|
-
AutocompleteListElement
|
|
25
|
-
>(
|
|
26
|
-
'prosekit-autocomplete-list',
|
|
27
|
-
Object.keys(autocompleteListProps),
|
|
28
|
-
Object.keys(autocompleteListEvents),
|
|
29
|
-
)
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
type AutocompletePopoverElement,
|
|
3
|
-
type AutocompletePopoverProps as Props,
|
|
4
|
-
type AutocompletePopoverEvents as Events,
|
|
5
|
-
autocompletePopoverProps,
|
|
6
|
-
autocompletePopoverEvents,
|
|
7
|
-
} from '@prosekit/web/autocomplete'
|
|
8
|
-
import type { Component } from 'solid-js'
|
|
9
|
-
|
|
10
|
-
import type { PropsWithElement } from '../../types.ts'
|
|
11
|
-
import { createComponent } from '../create-component.ts'
|
|
12
|
-
import type { CreateProps } from '../create-props.ts'
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* Props for the {@link AutocompletePopover} component.
|
|
16
|
-
*/
|
|
17
|
-
export interface AutocompletePopoverProps extends Partial<CreateProps<Props, Events>> {}
|
|
18
|
-
|
|
19
|
-
export const AutocompletePopover: Component<PropsWithElement<
|
|
20
|
-
AutocompletePopoverProps,
|
|
21
|
-
AutocompletePopoverElement
|
|
22
|
-
>> = createComponent<
|
|
23
|
-
AutocompletePopoverProps,
|
|
24
|
-
AutocompletePopoverElement
|
|
25
|
-
>(
|
|
26
|
-
'prosekit-autocomplete-popover',
|
|
27
|
-
Object.keys(autocompletePopoverProps),
|
|
28
|
-
Object.keys(autocompletePopoverEvents),
|
|
29
|
-
)
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
type BlockHandlePopoverElement,
|
|
3
|
-
type BlockHandlePopoverProps as Props,
|
|
4
|
-
type BlockHandlePopoverEvents as Events,
|
|
5
|
-
blockHandlePopoverProps,
|
|
6
|
-
blockHandlePopoverEvents,
|
|
7
|
-
} from '@prosekit/web/block-handle'
|
|
8
|
-
import type { Component } from 'solid-js'
|
|
9
|
-
|
|
10
|
-
import type { PropsWithElement } from '../../types.ts'
|
|
11
|
-
import { createComponent } from '../create-component.ts'
|
|
12
|
-
import type { CreateProps } from '../create-props.ts'
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* Props for the {@link BlockHandlePopover} component.
|
|
16
|
-
*/
|
|
17
|
-
export interface BlockHandlePopoverProps extends Partial<CreateProps<Props, Events>> {}
|
|
18
|
-
|
|
19
|
-
export const BlockHandlePopover: Component<PropsWithElement<
|
|
20
|
-
BlockHandlePopoverProps,
|
|
21
|
-
BlockHandlePopoverElement
|
|
22
|
-
>> = createComponent<
|
|
23
|
-
BlockHandlePopoverProps,
|
|
24
|
-
BlockHandlePopoverElement
|
|
25
|
-
>(
|
|
26
|
-
'prosekit-block-handle-popover',
|
|
27
|
-
Object.keys(blockHandlePopoverProps),
|
|
28
|
-
Object.keys(blockHandlePopoverEvents),
|
|
29
|
-
)
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
import type { AnyFunction } from '@prosekit/core'
|
|
2
|
-
import type { Component } from 'solid-js'
|
|
3
|
-
import h from 'solid-js/h'
|
|
4
|
-
|
|
5
|
-
import { useEditorContext } from '../contexts/editor-context.ts'
|
|
6
|
-
import type { PropsWithElement } from '../types.ts'
|
|
7
|
-
|
|
8
|
-
export function createComponent<
|
|
9
|
-
Props extends object,
|
|
10
|
-
CustomElement extends HTMLElement,
|
|
11
|
-
>(
|
|
12
|
-
tagName: string,
|
|
13
|
-
propNames: string[],
|
|
14
|
-
eventNames: string[],
|
|
15
|
-
): Component<PropsWithElement<Props, CustomElement>> {
|
|
16
|
-
const hasEditor = propNames.includes('editor')
|
|
17
|
-
const lowerCaseEventNameMap = new Map(
|
|
18
|
-
eventNames.map((name) => [name.toLowerCase(), name]),
|
|
19
|
-
)
|
|
20
|
-
|
|
21
|
-
const Component = (props: Record<string, unknown>) => {
|
|
22
|
-
const properties: Record<string, () => unknown> = {}
|
|
23
|
-
const eventHandlers: Record<string, AnyFunction> = {}
|
|
24
|
-
|
|
25
|
-
for (const name of Object.keys(props)) {
|
|
26
|
-
if (propNames.includes(name)) {
|
|
27
|
-
properties['prop:' + name] = () => props[name]
|
|
28
|
-
continue
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
if (name.startsWith('on')) {
|
|
32
|
-
const lowerCaseEventName = name.slice(2).toLowerCase()
|
|
33
|
-
const eventName = lowerCaseEventNameMap.get(lowerCaseEventName)
|
|
34
|
-
if (eventName) {
|
|
35
|
-
const extractDetail = eventName.endsWith('Change')
|
|
36
|
-
eventHandlers['on:' + eventName] = (event: Event) => {
|
|
37
|
-
const handler = props[name] as AnyFunction | null
|
|
38
|
-
if (typeof handler === 'function') {
|
|
39
|
-
handler(extractDetail ? (event as CustomEvent).detail : event)
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
continue
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
properties[name] = () => props[name]
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
const editor = useEditorContext()
|
|
50
|
-
|
|
51
|
-
if (hasEditor && editor) {
|
|
52
|
-
properties['prop:editor'] = () => props['editor'] || editor
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
return () => h(tagName, { ...properties, ...eventHandlers })
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-return
|
|
59
|
-
return Component as any
|
|
60
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
export type CreateProps<
|
|
2
|
-
Props extends { [PropName in keyof Props]: unknown },
|
|
3
|
-
Events extends { [EventName in keyof Events]: CustomEvent },
|
|
4
|
-
> = Props & CreateEventProps<Events>
|
|
5
|
-
|
|
6
|
-
type CreateEventProps<
|
|
7
|
-
Events extends { [EventName in keyof Events]: CustomEvent },
|
|
8
|
-
> = {
|
|
9
|
-
[EventName in keyof Events as `on${Capitalize<string & EventName>}`]: (
|
|
10
|
-
event: EventName extends `${string}Change` ? Events[EventName]['detail']
|
|
11
|
-
: Events[EventName],
|
|
12
|
-
) => void
|
|
13
|
-
}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
type InlinePopoverElement,
|
|
3
|
-
type InlinePopoverProps as Props,
|
|
4
|
-
type InlinePopoverEvents as Events,
|
|
5
|
-
inlinePopoverProps,
|
|
6
|
-
inlinePopoverEvents,
|
|
7
|
-
} from '@prosekit/web/inline-popover'
|
|
8
|
-
import type { Component } from 'solid-js'
|
|
9
|
-
|
|
10
|
-
import type { PropsWithElement } from '../../types.ts'
|
|
11
|
-
import { createComponent } from '../create-component.ts'
|
|
12
|
-
import type { CreateProps } from '../create-props.ts'
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* Props for the {@link InlinePopover} component.
|
|
16
|
-
*/
|
|
17
|
-
export interface InlinePopoverProps extends Partial<CreateProps<Props, Events>> {}
|
|
18
|
-
|
|
19
|
-
export const InlinePopover: Component<PropsWithElement<
|
|
20
|
-
InlinePopoverProps,
|
|
21
|
-
InlinePopoverElement
|
|
22
|
-
>> = createComponent<
|
|
23
|
-
InlinePopoverProps,
|
|
24
|
-
InlinePopoverElement
|
|
25
|
-
>(
|
|
26
|
-
'prosekit-inline-popover',
|
|
27
|
-
Object.keys(inlinePopoverProps),
|
|
28
|
-
Object.keys(inlinePopoverEvents),
|
|
29
|
-
)
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
type PopoverContentElement,
|
|
3
|
-
type PopoverContentProps as Props,
|
|
4
|
-
type PopoverContentEvents as Events,
|
|
5
|
-
popoverContentProps,
|
|
6
|
-
popoverContentEvents,
|
|
7
|
-
} from '@prosekit/web/popover'
|
|
8
|
-
import type { Component } from 'solid-js'
|
|
9
|
-
|
|
10
|
-
import type { PropsWithElement } from '../../types.ts'
|
|
11
|
-
import { createComponent } from '../create-component.ts'
|
|
12
|
-
import type { CreateProps } from '../create-props.ts'
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* Props for the {@link PopoverContent} component.
|
|
16
|
-
*/
|
|
17
|
-
export interface PopoverContentProps extends Partial<CreateProps<Props, Events>> {}
|
|
18
|
-
|
|
19
|
-
export const PopoverContent: Component<PropsWithElement<
|
|
20
|
-
PopoverContentProps,
|
|
21
|
-
PopoverContentElement
|
|
22
|
-
>> = createComponent<
|
|
23
|
-
PopoverContentProps,
|
|
24
|
-
PopoverContentElement
|
|
25
|
-
>(
|
|
26
|
-
'prosekit-popover-content',
|
|
27
|
-
Object.keys(popoverContentProps),
|
|
28
|
-
Object.keys(popoverContentEvents),
|
|
29
|
-
)
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
type TableHandleColumnRootElement,
|
|
3
|
-
type TableHandleColumnRootProps as Props,
|
|
4
|
-
type TableHandleColumnRootEvents as Events,
|
|
5
|
-
tableHandleColumnRootProps,
|
|
6
|
-
tableHandleColumnRootEvents,
|
|
7
|
-
} from '@prosekit/web/table-handle'
|
|
8
|
-
import type { Component } from 'solid-js'
|
|
9
|
-
|
|
10
|
-
import type { PropsWithElement } from '../../types.ts'
|
|
11
|
-
import { createComponent } from '../create-component.ts'
|
|
12
|
-
import type { CreateProps } from '../create-props.ts'
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* Props for the {@link TableHandleColumnRoot} component.
|
|
16
|
-
*/
|
|
17
|
-
export interface TableHandleColumnRootProps extends Partial<CreateProps<Props, Events>> {}
|
|
18
|
-
|
|
19
|
-
export const TableHandleColumnRoot: Component<PropsWithElement<
|
|
20
|
-
TableHandleColumnRootProps,
|
|
21
|
-
TableHandleColumnRootElement
|
|
22
|
-
>> = createComponent<
|
|
23
|
-
TableHandleColumnRootProps,
|
|
24
|
-
TableHandleColumnRootElement
|
|
25
|
-
>(
|
|
26
|
-
'prosekit-table-handle-column-root',
|
|
27
|
-
Object.keys(tableHandleColumnRootProps),
|
|
28
|
-
Object.keys(tableHandleColumnRootEvents),
|
|
29
|
-
)
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
type TableHandleColumnTriggerElement,
|
|
3
|
-
type TableHandleColumnTriggerProps as Props,
|
|
4
|
-
type TableHandleColumnTriggerEvents as Events,
|
|
5
|
-
tableHandleColumnTriggerProps,
|
|
6
|
-
tableHandleColumnTriggerEvents,
|
|
7
|
-
} from '@prosekit/web/table-handle'
|
|
8
|
-
import type { Component } from 'solid-js'
|
|
9
|
-
|
|
10
|
-
import type { PropsWithElement } from '../../types.ts'
|
|
11
|
-
import { createComponent } from '../create-component.ts'
|
|
12
|
-
import type { CreateProps } from '../create-props.ts'
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* Props for the {@link TableHandleColumnTrigger} component.
|
|
16
|
-
*/
|
|
17
|
-
export interface TableHandleColumnTriggerProps extends Partial<CreateProps<Props, Events>> {}
|
|
18
|
-
|
|
19
|
-
export const TableHandleColumnTrigger: Component<PropsWithElement<
|
|
20
|
-
TableHandleColumnTriggerProps,
|
|
21
|
-
TableHandleColumnTriggerElement
|
|
22
|
-
>> = createComponent<
|
|
23
|
-
TableHandleColumnTriggerProps,
|
|
24
|
-
TableHandleColumnTriggerElement
|
|
25
|
-
>(
|
|
26
|
-
'prosekit-table-handle-column-trigger',
|
|
27
|
-
Object.keys(tableHandleColumnTriggerProps),
|
|
28
|
-
Object.keys(tableHandleColumnTriggerEvents),
|
|
29
|
-
)
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
type TableHandlePopoverContentElement,
|
|
3
|
-
type TableHandlePopoverContentProps as Props,
|
|
4
|
-
type TableHandlePopoverContentEvents as Events,
|
|
5
|
-
tableHandlePopoverContentProps,
|
|
6
|
-
tableHandlePopoverContentEvents,
|
|
7
|
-
} from '@prosekit/web/table-handle'
|
|
8
|
-
import type { Component } from 'solid-js'
|
|
9
|
-
|
|
10
|
-
import type { PropsWithElement } from '../../types.ts'
|
|
11
|
-
import { createComponent } from '../create-component.ts'
|
|
12
|
-
import type { CreateProps } from '../create-props.ts'
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* Props for the {@link TableHandlePopoverContent} component.
|
|
16
|
-
*/
|
|
17
|
-
export interface TableHandlePopoverContentProps extends Partial<CreateProps<Props, Events>> {}
|
|
18
|
-
|
|
19
|
-
export const TableHandlePopoverContent: Component<PropsWithElement<
|
|
20
|
-
TableHandlePopoverContentProps,
|
|
21
|
-
TableHandlePopoverContentElement
|
|
22
|
-
>> = createComponent<
|
|
23
|
-
TableHandlePopoverContentProps,
|
|
24
|
-
TableHandlePopoverContentElement
|
|
25
|
-
>(
|
|
26
|
-
'prosekit-table-handle-popover-content',
|
|
27
|
-
Object.keys(tableHandlePopoverContentProps),
|
|
28
|
-
Object.keys(tableHandlePopoverContentEvents),
|
|
29
|
-
)
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
type TableHandlePopoverItemElement,
|
|
3
|
-
type TableHandlePopoverItemProps as Props,
|
|
4
|
-
type TableHandlePopoverItemEvents as Events,
|
|
5
|
-
tableHandlePopoverItemProps,
|
|
6
|
-
tableHandlePopoverItemEvents,
|
|
7
|
-
} from '@prosekit/web/table-handle'
|
|
8
|
-
import type { Component } from 'solid-js'
|
|
9
|
-
|
|
10
|
-
import type { PropsWithElement } from '../../types.ts'
|
|
11
|
-
import { createComponent } from '../create-component.ts'
|
|
12
|
-
import type { CreateProps } from '../create-props.ts'
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* Props for the {@link TableHandlePopoverItem} component.
|
|
16
|
-
*/
|
|
17
|
-
export interface TableHandlePopoverItemProps extends Partial<CreateProps<Props, Events>> {}
|
|
18
|
-
|
|
19
|
-
export const TableHandlePopoverItem: Component<PropsWithElement<
|
|
20
|
-
TableHandlePopoverItemProps,
|
|
21
|
-
TableHandlePopoverItemElement
|
|
22
|
-
>> = createComponent<
|
|
23
|
-
TableHandlePopoverItemProps,
|
|
24
|
-
TableHandlePopoverItemElement
|
|
25
|
-
>(
|
|
26
|
-
'prosekit-table-handle-popover-item',
|
|
27
|
-
Object.keys(tableHandlePopoverItemProps),
|
|
28
|
-
Object.keys(tableHandlePopoverItemEvents),
|
|
29
|
-
)
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
type TableHandleRowRootElement,
|
|
3
|
-
type TableHandleRowRootProps as Props,
|
|
4
|
-
type TableHandleRowRootEvents as Events,
|
|
5
|
-
tableHandleRowRootProps,
|
|
6
|
-
tableHandleRowRootEvents,
|
|
7
|
-
} from '@prosekit/web/table-handle'
|
|
8
|
-
import type { Component } from 'solid-js'
|
|
9
|
-
|
|
10
|
-
import type { PropsWithElement } from '../../types.ts'
|
|
11
|
-
import { createComponent } from '../create-component.ts'
|
|
12
|
-
import type { CreateProps } from '../create-props.ts'
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* Props for the {@link TableHandleRowRoot} component.
|
|
16
|
-
*/
|
|
17
|
-
export interface TableHandleRowRootProps extends Partial<CreateProps<Props, Events>> {}
|
|
18
|
-
|
|
19
|
-
export const TableHandleRowRoot: Component<PropsWithElement<
|
|
20
|
-
TableHandleRowRootProps,
|
|
21
|
-
TableHandleRowRootElement
|
|
22
|
-
>> = createComponent<
|
|
23
|
-
TableHandleRowRootProps,
|
|
24
|
-
TableHandleRowRootElement
|
|
25
|
-
>(
|
|
26
|
-
'prosekit-table-handle-row-root',
|
|
27
|
-
Object.keys(tableHandleRowRootProps),
|
|
28
|
-
Object.keys(tableHandleRowRootEvents),
|
|
29
|
-
)
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
type TableHandleRowTriggerElement,
|
|
3
|
-
type TableHandleRowTriggerProps as Props,
|
|
4
|
-
type TableHandleRowTriggerEvents as Events,
|
|
5
|
-
tableHandleRowTriggerProps,
|
|
6
|
-
tableHandleRowTriggerEvents,
|
|
7
|
-
} from '@prosekit/web/table-handle'
|
|
8
|
-
import type { Component } from 'solid-js'
|
|
9
|
-
|
|
10
|
-
import type { PropsWithElement } from '../../types.ts'
|
|
11
|
-
import { createComponent } from '../create-component.ts'
|
|
12
|
-
import type { CreateProps } from '../create-props.ts'
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* Props for the {@link TableHandleRowTrigger} component.
|
|
16
|
-
*/
|
|
17
|
-
export interface TableHandleRowTriggerProps extends Partial<CreateProps<Props, Events>> {}
|
|
18
|
-
|
|
19
|
-
export const TableHandleRowTrigger: Component<PropsWithElement<
|
|
20
|
-
TableHandleRowTriggerProps,
|
|
21
|
-
TableHandleRowTriggerElement
|
|
22
|
-
>> = createComponent<
|
|
23
|
-
TableHandleRowTriggerProps,
|
|
24
|
-
TableHandleRowTriggerElement
|
|
25
|
-
>(
|
|
26
|
-
'prosekit-table-handle-row-trigger',
|
|
27
|
-
Object.keys(tableHandleRowTriggerProps),
|
|
28
|
-
Object.keys(tableHandleRowTriggerEvents),
|
|
29
|
-
)
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
type TooltipContentElement,
|
|
3
|
-
type TooltipContentProps as Props,
|
|
4
|
-
type TooltipContentEvents as Events,
|
|
5
|
-
tooltipContentProps,
|
|
6
|
-
tooltipContentEvents,
|
|
7
|
-
} from '@prosekit/web/tooltip'
|
|
8
|
-
import type { Component } from 'solid-js'
|
|
9
|
-
|
|
10
|
-
import type { PropsWithElement } from '../../types.ts'
|
|
11
|
-
import { createComponent } from '../create-component.ts'
|
|
12
|
-
import type { CreateProps } from '../create-props.ts'
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* Props for the {@link TooltipContent} component.
|
|
16
|
-
*/
|
|
17
|
-
export interface TooltipContentProps extends Partial<CreateProps<Props, Events>> {}
|
|
18
|
-
|
|
19
|
-
export const TooltipContent: Component<PropsWithElement<
|
|
20
|
-
TooltipContentProps,
|
|
21
|
-
TooltipContentElement
|
|
22
|
-
>> = createComponent<
|
|
23
|
-
TooltipContentProps,
|
|
24
|
-
TooltipContentElement
|
|
25
|
-
>(
|
|
26
|
-
'prosekit-tooltip-content',
|
|
27
|
-
Object.keys(tooltipContentProps),
|
|
28
|
-
Object.keys(tooltipContentEvents),
|
|
29
|
-
)
|