@prosekit/web 0.8.0-beta.3 → 0.8.0-beta.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (77) hide show
  1. package/dist/get-safe-editor-view.js +0 -2
  2. package/dist/get-safe-editor-view.js.map +1 -1
  3. package/dist/prosekit-web-autocomplete.d.ts +47 -19
  4. package/dist/prosekit-web-autocomplete.d.ts.map +1 -1
  5. package/dist/prosekit-web-autocomplete.js +47 -27
  6. package/dist/prosekit-web-autocomplete.js.map +1 -1
  7. package/dist/prosekit-web-block-handle.d.ts +43 -16
  8. package/dist/prosekit-web-block-handle.d.ts.map +1 -1
  9. package/dist/prosekit-web-block-handle.js +43 -33
  10. package/dist/prosekit-web-block-handle.js.map +1 -1
  11. package/dist/prosekit-web-drop-indicator.d.ts +3 -4
  12. package/dist/prosekit-web-drop-indicator.d.ts.map +1 -1
  13. package/dist/prosekit-web-drop-indicator.js +3 -3
  14. package/dist/prosekit-web-drop-indicator.js.map +1 -1
  15. package/dist/prosekit-web-inline-popover.d.ts +31 -10
  16. package/dist/prosekit-web-inline-popover.d.ts.map +1 -1
  17. package/dist/prosekit-web-inline-popover.js +31 -19
  18. package/dist/prosekit-web-inline-popover.js.map +1 -1
  19. package/dist/prosekit-web-menu.d.ts +121 -5
  20. package/dist/prosekit-web-menu.d.ts.map +1 -1
  21. package/dist/prosekit-web-menu.js +115 -10
  22. package/dist/prosekit-web-menu.js.map +1 -1
  23. package/dist/prosekit-web-popover.d.ts +64 -5
  24. package/dist/prosekit-web-popover.d.ts.map +1 -1
  25. package/dist/prosekit-web-popover.js +60 -7
  26. package/dist/prosekit-web-popover.js.map +1 -1
  27. package/dist/prosekit-web-resizable.d.ts +14 -7
  28. package/dist/prosekit-web-resizable.d.ts.map +1 -1
  29. package/dist/prosekit-web-resizable.js +14 -12
  30. package/dist/prosekit-web-resizable.js.map +1 -1
  31. package/dist/prosekit-web-table-handle.d.ts +73 -36
  32. package/dist/prosekit-web-table-handle.d.ts.map +1 -1
  33. package/dist/prosekit-web-table-handle.js +73 -65
  34. package/dist/prosekit-web-table-handle.js.map +1 -1
  35. package/dist/prosekit-web-tooltip.d.ts +61 -5
  36. package/dist/prosekit-web-tooltip.d.ts.map +1 -1
  37. package/dist/prosekit-web-tooltip.js +58 -7
  38. package/dist/prosekit-web-tooltip.js.map +1 -1
  39. package/dist/prosekit-web.d.ts +0 -3
  40. package/dist/prosekit-web.d.ts.map +1 -1
  41. package/dist/prosekit-web.js +0 -2
  42. package/dist/prosekit-web.js.map +1 -1
  43. package/dist/use-editor-extension.js +0 -2
  44. package/dist/use-editor-extension.js.map +1 -1
  45. package/dist/use-scrolling.js +0 -4
  46. package/dist/use-scrolling.js.map +1 -1
  47. package/package.json +7 -7
  48. package/src/components/autocomplete/autocomplete-empty.ts +3 -4
  49. package/src/components/autocomplete/autocomplete-item.ts +11 -1
  50. package/src/components/autocomplete/autocomplete-popup.ts +11 -1
  51. package/src/components/autocomplete/autocomplete-positioner.ts +17 -1
  52. package/src/components/autocomplete/autocomplete-root.ts +5 -1
  53. package/src/components/block-handle/block-handle-add.ts +3 -1
  54. package/src/components/block-handle/block-handle-draggable.ts +9 -1
  55. package/src/components/block-handle/block-handle-popup.ts +9 -1
  56. package/src/components/block-handle/block-handle-positioner.ts +17 -1
  57. package/src/components/block-handle/block-handle-root.ts +5 -1
  58. package/src/components/drop-indicator/drop-indicator.ts +3 -1
  59. package/src/components/inline-popover/inline-popover-popup.ts +9 -1
  60. package/src/components/inline-popover/inline-popover-positioner.ts +17 -1
  61. package/src/components/inline-popover/inline-popover-root.ts +5 -1
  62. package/src/components/menu/index.ts +140 -43
  63. package/src/components/popover/index.ts +76 -23
  64. package/src/components/resizable/resizable-handle.ts +3 -1
  65. package/src/components/resizable/resizable-root.ts +11 -1
  66. package/src/components/table-handle/table-handle-column-menu-root.ts +3 -1
  67. package/src/components/table-handle/table-handle-column-menu-trigger.ts +3 -1
  68. package/src/components/table-handle/table-handle-column-popup.ts +9 -1
  69. package/src/components/table-handle/table-handle-column-positioner.ts +17 -1
  70. package/src/components/table-handle/table-handle-drag-preview.ts +3 -1
  71. package/src/components/table-handle/table-handle-drop-indicator.ts +3 -1
  72. package/src/components/table-handle/table-handle-root.ts +3 -1
  73. package/src/components/table-handle/table-handle-row-menu-root.ts +3 -1
  74. package/src/components/table-handle/table-handle-row-menu-trigger.ts +3 -1
  75. package/src/components/table-handle/table-handle-row-popup.ts +9 -1
  76. package/src/components/table-handle/table-handle-row-positioner.ts +17 -1
  77. package/src/components/tooltip/index.ts +73 -22
@@ -1 +1 @@
1
- {"version":3,"file":"prosekit-web.js","names":[],"sources":["../src/queue-extension.ts"],"sourcesContent":["import type { Editor, Extension } from '@prosekit/core'\n\n/**\n\n @internal\n\n Queues an extension to be added to the editor in the next task. Returns a\n dispose function that can be used to remove the extension in the next task.\n\n Why?\n\n Let's take React as an example.\n\n `editor.use(extension)` is synchronous. If the extension adds a node view that\n is controlled by `@prosemirror-adapter/react`, adding this extension will\n cause `prosemirror-adapter` to set UI state synchronously (e.g. `setState`\n returned by `useState` in React).\n\n ProseMirror is a sync-based framework. When updating node view, ProseMirror\n will first stop DOMObserver, then update the DOM, then resume DOMObserver.\n `prosemirror-adapter` needs to call `React.flushSync()` to update the DOM\n synchronously right after React state is updated, before ProseMirror resumes\n DOMObserver.\n\n If we call `editor.use(extension)` directly in `useEffect`, we eventually are\n doing something like this:\n\n ```ts\n React.useEffect(() => {\n React.flushSync(() => {\n setState(newState)\n })\n }, [])\n ```\n\n This breaks the async nature of React, and causes the following React\n warning:\n\n ```\n flushSync was called from inside a lifecycle method. React cannot flush when\n React is already rendering. Consider moving this call to a scheduler task or\n micro task.\n ```\n\n To fix this, we need to queue the extension addition to the editor in the next\n task or in the next microtask.\n\n ```ts\n // In the next microtask\n React.useEffect(() => {\n queueMicrotask(() => {\n React.flushSync(() => {\n setState(newState)\n })\n })\n }, [])\n\n // In the next task\n React.useEffect(() => {\n setTimeout(() => {\n React.flushSync(() => {\n setState(newState)\n })\n })\n }, [])\n ```\n\n I chose to use `setTimeout` instead of `queueMicrotask` because\n `queueMicrotask` causes another React act warning `An update to %s inside a\n test was not wrapped in act(...)` during testing.\n\n Although the example above is based on React, this is a general pattern for\n any async based UI framework, including Svelte.\n\n */\nexport function queueExtension(editor: Editor, extension: Extension): VoidFunction {\n let canceled = false\n let dispose: VoidFunction | undefined\n const timeout = setTimeout(() => {\n if (canceled) return\n dispose?.()\n dispose = editor.use(extension)\n })\n\n return () => {\n canceled = true\n clearTimeout(timeout)\n setTimeout(() => {\n dispose?.()\n dispose = undefined\n })\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2EA,SAAgB,eAAe,QAAgB,WAAoC;CACjF,IAAI,WAAW;CACf,IAAI;CACJ,MAAM,UAAU,iBAAiB;AAC/B,MAAI,SAAU;AACd,aAAW;AACX,YAAU,OAAO,IAAI,UAAU;GAC/B;AAEF,cAAa;AACX,aAAW;AACX,eAAa,QAAQ;AACrB,mBAAiB;AACf,cAAW;AACX,aAAU,KAAA;IACV"}
1
+ {"version":3,"file":"prosekit-web.js","names":[],"sources":["../src/queue-extension.ts"],"sourcesContent":["import type { Editor, Extension } from '@prosekit/core'\n\n/**\n\n @internal\n\n Queues an extension to be added to the editor in the next task. Returns a\n dispose function that can be used to remove the extension in the next task.\n\n Why?\n\n Let's take React as an example.\n\n `editor.use(extension)` is synchronous. If the extension adds a node view that\n is controlled by `@prosemirror-adapter/react`, adding this extension will\n cause `prosemirror-adapter` to set UI state synchronously (e.g. `setState`\n returned by `useState` in React).\n\n ProseMirror is a sync-based framework. When updating node view, ProseMirror\n will first stop DOMObserver, then update the DOM, then resume DOMObserver.\n `prosemirror-adapter` needs to call `React.flushSync()` to update the DOM\n synchronously right after React state is updated, before ProseMirror resumes\n DOMObserver.\n\n If we call `editor.use(extension)` directly in `useEffect`, we eventually are\n doing something like this:\n\n ```ts\n React.useEffect(() => {\n React.flushSync(() => {\n setState(newState)\n })\n }, [])\n ```\n\n This breaks the async nature of React, and causes the following React\n warning:\n\n ```\n flushSync was called from inside a lifecycle method. React cannot flush when\n React is already rendering. Consider moving this call to a scheduler task or\n micro task.\n ```\n\n To fix this, we need to queue the extension addition to the editor in the next\n task or in the next microtask.\n\n ```ts\n // In the next microtask\n React.useEffect(() => {\n queueMicrotask(() => {\n React.flushSync(() => {\n setState(newState)\n })\n })\n }, [])\n\n // In the next task\n React.useEffect(() => {\n setTimeout(() => {\n React.flushSync(() => {\n setState(newState)\n })\n })\n }, [])\n ```\n\n I chose to use `setTimeout` instead of `queueMicrotask` because\n `queueMicrotask` causes another React act warning `An update to %s inside a\n test was not wrapped in act(...)` during testing.\n\n Although the example above is based on React, this is a general pattern for\n any async based UI framework, including Svelte.\n\n */\nexport function queueExtension(editor: Editor, extension: Extension): VoidFunction {\n let canceled = false\n let dispose: VoidFunction | undefined\n const timeout = setTimeout(() => {\n if (canceled) return\n dispose?.()\n dispose = editor.use(extension)\n })\n\n return () => {\n canceled = true\n clearTimeout(timeout)\n setTimeout(() => {\n dispose?.()\n dispose = undefined\n })\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2EA,SAAgB,eAAe,QAAgB,WAAoC;CACjF,IAAI,WAAW;CACf,IAAI;CACJ,MAAM,UAAU,iBAAiB;AAC/B,MAAI,SAAU;AACd,aAAW;AACX,YAAU,OAAO,IAAI,UAAU;GAC/B;AAEF,cAAa;AACX,aAAW;AACX,eAAa,QAAQ;AACrB,mBAAiB;AACf,cAAW;AACX,aAAU,KAAA;IACV"}
@@ -1,11 +1,9 @@
1
1
  import { useEffect } from "@aria-ui/core";
2
- //#region src/hooks/use-editor-extension.ts
3
2
  function useEditorExtension(host, getEditor, extension) {
4
3
  useEffect(host, () => {
5
4
  return getEditor()?.use(extension);
6
5
  });
7
6
  }
8
- //#endregion
9
7
  export { useEditorExtension as t };
10
8
 
11
9
  //# sourceMappingURL=use-editor-extension.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"use-editor-extension.js","names":[],"sources":["../src/hooks/use-editor-extension.ts"],"sourcesContent":["import { useEffect, type HostElement } from '@aria-ui/core'\nimport type { Editor, Extension } from '@prosekit/core'\n\nexport function useEditorExtension(\n host: HostElement,\n getEditor: () => Editor | null,\n extension: Extension,\n): void {\n useEffect(host, () => {\n return getEditor()?.use(extension)\n })\n}\n"],"mappings":";;AAGA,SAAgB,mBACd,MACA,WACA,WACM;AACN,WAAU,YAAY;AACpB,SAAO,WAAW,EAAE,IAAI,UAAU;GAClC"}
1
+ {"version":3,"file":"use-editor-extension.js","names":[],"sources":["../src/hooks/use-editor-extension.ts"],"sourcesContent":["import { useEffect, type HostElement } from '@aria-ui/core'\nimport type { Editor, Extension } from '@prosekit/core'\n\nexport function useEditorExtension(\n host: HostElement,\n getEditor: () => Editor | null,\n extension: Extension,\n): void {\n useEffect(host, () => {\n return getEditor()?.use(extension)\n })\n}\n"],"mappings":";AAGA,SAAgB,mBACd,MACA,WACA,WACM;AACN,WAAU,YAAY;AACpB,SAAO,WAAW,EAAE,IAAI,UAAU;GAClC"}
@@ -1,14 +1,11 @@
1
1
  import { createSignal, useEffect } from "@aria-ui/core";
2
2
  import { getNearestOverflowAncestor } from "@aria-ui/utils";
3
- //#region src/utils/assign-styles.ts
4
3
  /**
5
4
  * A type-safe version of `Object.assign` for `element.style`.
6
5
  */
7
6
  function assignStyles(element, styles) {
8
7
  Object.assign(element.style, styles);
9
8
  }
10
- //#endregion
11
- //#region src/hooks/use-scrolling.ts
12
9
  function useScrolling(host) {
13
10
  const scrolling = createSignal(false);
14
11
  useEffect(host, () => {
@@ -39,7 +36,6 @@ function useScrolling(host) {
39
36
  });
40
37
  return scrolling.get;
41
38
  }
42
- //#endregion
43
39
  export { assignStyles as n, useScrolling as t };
44
40
 
45
41
  //# sourceMappingURL=use-scrolling.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"use-scrolling.js","names":[],"sources":["../src/utils/assign-styles.ts","../src/hooks/use-scrolling.ts"],"sourcesContent":["import type { ConditionalPick } from 'type-fest'\n\n// Only include CSS properties whose value type is `string`\ntype StringStyleDeclaration = Partial<ConditionalPick<CSSStyleDeclaration, string>>\n\n/**\n * A type-safe version of `Object.assign` for `element.style`.\n */\nexport function assignStyles(\n element: HTMLElement | SVGElement | MathMLElement,\n styles: StringStyleDeclaration,\n): void {\n Object.assign(element.style, styles)\n}\n","import { createSignal, useEffect, type HostElement } from '@aria-ui/core'\nimport { getNearestOverflowAncestor } from '@aria-ui/utils'\n\nexport function useScrolling(host: HostElement): () => boolean {\n const scrolling = createSignal(false)\n\n useEffect(host, () => {\n const scrollableParent = getNearestOverflowAncestor(host)\n\n const handleScroll = () => {\n scrolling.set(true)\n }\n\n const handleMouseMove = () => {\n scrolling.set(false)\n }\n\n const abortController = new AbortController()\n const abortSignal = abortController.signal\n\n scrollableParent.addEventListener('scroll', handleScroll, { passive: true, signal: abortSignal })\n window.addEventListener('mousemove', handleMouseMove, { passive: true, signal: abortSignal })\n window.addEventListener('pointermove', handleMouseMove, { passive: true, signal: abortSignal })\n\n return () => {\n abortController.abort()\n }\n })\n\n return scrolling.get\n}\n"],"mappings":";;;;;;AAQA,SAAgB,aACd,SACA,QACM;AACN,QAAO,OAAO,QAAQ,OAAO,OAAO;;;;ACTtC,SAAgB,aAAa,MAAkC;CAC7D,MAAM,YAAY,aAAa,MAAM;AAErC,WAAU,YAAY;EACpB,MAAM,mBAAmB,2BAA2B,KAAK;EAEzD,MAAM,qBAAqB;AACzB,aAAU,IAAI,KAAK;;EAGrB,MAAM,wBAAwB;AAC5B,aAAU,IAAI,MAAM;;EAGtB,MAAM,kBAAkB,IAAI,iBAAiB;EAC7C,MAAM,cAAc,gBAAgB;AAEpC,mBAAiB,iBAAiB,UAAU,cAAc;GAAE,SAAS;GAAM,QAAQ;GAAa,CAAC;AACjG,SAAO,iBAAiB,aAAa,iBAAiB;GAAE,SAAS;GAAM,QAAQ;GAAa,CAAC;AAC7F,SAAO,iBAAiB,eAAe,iBAAiB;GAAE,SAAS;GAAM,QAAQ;GAAa,CAAC;AAE/F,eAAa;AACX,mBAAgB,OAAO;;GAEzB;AAEF,QAAO,UAAU"}
1
+ {"version":3,"file":"use-scrolling.js","names":[],"sources":["../src/utils/assign-styles.ts","../src/hooks/use-scrolling.ts"],"sourcesContent":["import type { ConditionalPick } from 'type-fest'\n\n// Only include CSS properties whose value type is `string`\ntype StringStyleDeclaration = Partial<ConditionalPick<CSSStyleDeclaration, string>>\n\n/**\n * A type-safe version of `Object.assign` for `element.style`.\n */\nexport function assignStyles(\n element: HTMLElement | SVGElement | MathMLElement,\n styles: StringStyleDeclaration,\n): void {\n Object.assign(element.style, styles)\n}\n","import { createSignal, useEffect, type HostElement } from '@aria-ui/core'\nimport { getNearestOverflowAncestor } from '@aria-ui/utils'\n\nexport function useScrolling(host: HostElement): () => boolean {\n const scrolling = createSignal(false)\n\n useEffect(host, () => {\n const scrollableParent = getNearestOverflowAncestor(host)\n\n const handleScroll = () => {\n scrolling.set(true)\n }\n\n const handleMouseMove = () => {\n scrolling.set(false)\n }\n\n const abortController = new AbortController()\n const abortSignal = abortController.signal\n\n scrollableParent.addEventListener('scroll', handleScroll, { passive: true, signal: abortSignal })\n window.addEventListener('mousemove', handleMouseMove, { passive: true, signal: abortSignal })\n window.addEventListener('pointermove', handleMouseMove, { passive: true, signal: abortSignal })\n\n return () => {\n abortController.abort()\n }\n })\n\n return scrolling.get\n}\n"],"mappings":";;;;;AAQA,SAAgB,aACd,SACA,QACM;AACN,QAAO,OAAO,QAAQ,OAAO,OAAO;;ACTtC,SAAgB,aAAa,MAAkC;CAC7D,MAAM,YAAY,aAAa,MAAM;AAErC,WAAU,YAAY;EACpB,MAAM,mBAAmB,2BAA2B,KAAK;EAEzD,MAAM,qBAAqB;AACzB,aAAU,IAAI,KAAK;;EAGrB,MAAM,wBAAwB;AAC5B,aAAU,IAAI,MAAM;;EAGtB,MAAM,kBAAkB,IAAI,iBAAiB;EAC7C,MAAM,cAAc,gBAAgB;AAEpC,mBAAiB,iBAAiB,UAAU,cAAc;GAAE,SAAS;GAAM,QAAQ;GAAa,CAAC;AACjG,SAAO,iBAAiB,aAAa,iBAAiB;GAAE,SAAS;GAAM,QAAQ;GAAa,CAAC;AAC7F,SAAO,iBAAiB,eAAe,iBAAiB;GAAE,SAAS;GAAM,QAAQ;GAAa,CAAC;AAE/F,eAAa;AACX,mBAAgB,OAAO;;GAEzB;AAEF,QAAO,UAAU"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@prosekit/web",
3
3
  "type": "module",
4
- "version": "0.8.0-beta.3",
4
+ "version": "0.8.0-beta.4",
5
5
  "private": false,
6
6
  "description": "A collection of web components for ProseKit",
7
7
  "author": {
@@ -72,9 +72,9 @@
72
72
  "src"
73
73
  ],
74
74
  "dependencies": {
75
- "@aria-ui/core": "^0.1.0",
76
- "@aria-ui/elements": "^0.1.2",
77
- "@aria-ui/utils": "^0.1.0",
75
+ "@aria-ui/core": "^0.1.1",
76
+ "@aria-ui/elements": "^0.1.4",
77
+ "@aria-ui/utils": "^0.1.1",
78
78
  "@floating-ui/dom": "^1.7.6",
79
79
  "@ocavue/utils": "^1.6.0",
80
80
  "prosemirror-tables": "^1.8.5",
@@ -83,14 +83,14 @@
83
83
  "@prosekit/pm": "^0.1.15"
84
84
  },
85
85
  "devDependencies": {
86
- "@aria-ui/cli": "^0.1.3",
86
+ "@aria-ui/cli": "^0.1.5",
87
87
  "tsdown": "^0.21.7",
88
88
  "type-fest": "^5.5.0",
89
89
  "typescript": "~5.9.3",
90
90
  "vitest": "^4.1.4",
91
- "@prosekit/config-ts": "0.0.0",
92
91
  "@prosekit/config-tsdown": "0.0.0",
93
- "@prosekit/config-vitest": "0.0.0"
92
+ "@prosekit/config-vitest": "0.0.0",
93
+ "@prosekit/config-ts": "0.0.0"
94
94
  },
95
95
  "publishConfig": {
96
96
  "dev": {}
@@ -9,9 +9,6 @@ import {
9
9
  } from '@aria-ui/core'
10
10
  import { setupListboxEmpty, type ListboxEmptyProps } from '@aria-ui/elements/listbox'
11
11
 
12
- /**
13
- * @internal
14
- */
15
12
  export interface AutocompleteEmptyProps extends ListboxEmptyProps {}
16
13
 
17
14
  /** @internal */
@@ -35,7 +32,9 @@ const AutocompleteEmptyElementBase: HostElementConstructor<AutocompleteEmptyProp
35
32
  )
36
33
 
37
34
  /**
38
- * @public
35
+ * `<prosekit-autocomplete-empty>` custom element.
36
+ *
37
+ * Properties: {@link AutocompleteEmptyProps}
39
38
  */
40
39
  export class AutocompleteEmptyElement extends AutocompleteEmptyElementBase {}
41
40
 
@@ -55,7 +55,17 @@ const AutocompleteItemElementBase: HostElementConstructor<AutocompleteItemProps>
55
55
  )
56
56
 
57
57
  /**
58
- * @public
58
+ * `<prosekit-autocomplete-item>` custom element.
59
+ *
60
+ * Properties: {@link AutocompleteItemProps}
61
+ *
62
+ * Events: {@link AutocompleteItemEvents}
63
+ *
64
+ * Data attributes:
65
+ *
66
+ * | Attribute | Description |
67
+ * | --- | --- |
68
+ * | `data-highlighted` | Present when the item is the currently highlighted option |
59
69
  */
60
70
  export class AutocompleteItemElement extends AutocompleteItemElementBase {}
61
71
 
@@ -85,7 +85,17 @@ const AutocompletePopupElementBase: HostElementConstructor<AutocompletePopupProp
85
85
  )
86
86
 
87
87
  /**
88
- * @public
88
+ * `<prosekit-autocomplete-popup>` custom element.
89
+ *
90
+ * Properties: {@link AutocompletePopupProps}
91
+ *
92
+ * Events: {@link AutocompletePopupEvents}
93
+ *
94
+ * Data attributes:
95
+ *
96
+ * | Attribute | Description |
97
+ * | --- | --- |
98
+ * | `data-state` | `"open"` when the autocomplete is visible, `"closed"` otherwise |
89
99
  */
90
100
  export class AutocompletePopupElement extends AutocompletePopupElementBase {}
91
101
 
@@ -88,7 +88,23 @@ const AutocompletePositionerElementBase: HostElementConstructor<AutocompletePosi
88
88
  )
89
89
 
90
90
  /**
91
- * @public
91
+ * `<prosekit-autocomplete-positioner>` custom element.
92
+ *
93
+ * Properties: {@link AutocompletePositionerProps}
94
+ *
95
+ * Data attributes:
96
+ *
97
+ * | Attribute | Description |
98
+ * | --- | --- |
99
+ * | `data-state` | `"open"` when the autocomplete is visible, `"closed"` otherwise |
100
+ * | `data-side` | The side of the anchor element the positioner is on |
101
+ * | `data-align` | The alignment of the positioner relative to the anchor element |
102
+ *
103
+ * CSS variables:
104
+ *
105
+ * | Variable | Description |
106
+ * | --- | --- |
107
+ * | `--transform-origin` | The coordinates that this element is anchored to. Useful for scale animations. |
92
108
  */
93
109
  export class AutocompletePositionerElement extends AutocompletePositionerElementBase {}
94
110
 
@@ -270,7 +270,11 @@ const AutocompleteRootElementBase: HostElementConstructor<AutocompleteRootProps>
270
270
  )
271
271
 
272
272
  /**
273
- * @public
273
+ * `<prosekit-autocomplete-root>` custom element.
274
+ *
275
+ * Properties: {@link AutocompleteRootProps}
276
+ *
277
+ * Events: {@link AutocompleteRootEvents}
274
278
  */
275
279
  export class AutocompleteRootElement extends AutocompleteRootElementBase {}
276
280
 
@@ -61,7 +61,9 @@ const BlockHandleAddElementBase: HostElementConstructor<BlockHandleAddProps> = d
61
61
  )
62
62
 
63
63
  /**
64
- * @public
64
+ * `<prosekit-block-handle-add>` custom element.
65
+ *
66
+ * Properties: {@link BlockHandleAddProps}
65
67
  */
66
68
  export class BlockHandleAddElement extends BlockHandleAddElementBase {}
67
69
 
@@ -148,7 +148,15 @@ const BlockHandleDraggableElementBase: HostElementConstructor<BlockHandleDraggab
148
148
  )
149
149
 
150
150
  /**
151
- * @public
151
+ * `<prosekit-block-handle-draggable>` custom element.
152
+ *
153
+ * Properties: {@link BlockHandleDraggableProps}
154
+ *
155
+ * Data attributes:
156
+ *
157
+ * | Attribute | Description |
158
+ * | --- | --- |
159
+ * | `data-dragging` | Present when the element is being dragged |
152
160
  */
153
161
  export class BlockHandleDraggableElement extends BlockHandleDraggableElementBase {}
154
162
 
@@ -33,7 +33,15 @@ const BlockHandlePopupElementBase: HostElementConstructor<BlockHandlePopupProps>
33
33
  )
34
34
 
35
35
  /**
36
- * @public
36
+ * `<prosekit-block-handle-popup>` custom element.
37
+ *
38
+ * Properties: {@link BlockHandlePopupProps}
39
+ *
40
+ * Data attributes:
41
+ *
42
+ * | Attribute | Description |
43
+ * | --- | --- |
44
+ * | `data-state` | `"open"` when the block handle is visible, `"closed"` otherwise |
37
45
  */
38
46
  export class BlockHandlePopupElement extends BlockHandlePopupElementBase {}
39
47
 
@@ -79,7 +79,23 @@ const BlockHandlePositionerElementBase: HostElementConstructor<BlockHandlePositi
79
79
  )
80
80
 
81
81
  /**
82
- * @public
82
+ * `<prosekit-block-handle-positioner>` custom element.
83
+ *
84
+ * Properties: {@link BlockHandlePositionerProps}
85
+ *
86
+ * Data attributes:
87
+ *
88
+ * | Attribute | Description |
89
+ * | --- | --- |
90
+ * | `data-state` | `"open"` when the block handle is visible, `"closed"` otherwise |
91
+ * | `data-side` | The side of the anchor element the positioner is on |
92
+ * | `data-align` | The alignment of the positioner relative to the anchor element |
93
+ *
94
+ * CSS variables:
95
+ *
96
+ * | Variable | Description |
97
+ * | --- | --- |
98
+ * | `--transform-origin` | The coordinates that this element is anchored to. Useful for scale animations. |
83
99
  */
84
100
  export class BlockHandlePositionerElement extends BlockHandlePositionerElementBase {}
85
101
 
@@ -106,7 +106,11 @@ const BlockHandleRootElementBase: HostElementConstructor<BlockHandleRootProps> =
106
106
  )
107
107
 
108
108
  /**
109
- * @public
109
+ * `<prosekit-block-handle-root>` custom element.
110
+ *
111
+ * Properties: {@link BlockHandleRootProps}
112
+ *
113
+ * Events: {@link BlockHandleRootEvents}
110
114
  */
111
115
  export class BlockHandleRootElement extends BlockHandleRootElementBase {}
112
116
 
@@ -116,7 +116,9 @@ const DropIndicatorElementBase: HostElementConstructor<DropIndicatorProps> = def
116
116
  )
117
117
 
118
118
  /**
119
- * @public
119
+ * `<prosekit-drop-indicator>` custom element.
120
+ *
121
+ * Properties: {@link DropIndicatorProps}
120
122
  */
121
123
  export class DropIndicatorElement extends DropIndicatorElementBase {}
122
124
 
@@ -42,7 +42,15 @@ const InlinePopoverPopupElementBase: HostElementConstructor<InlinePopoverPopupPr
42
42
  )
43
43
 
44
44
  /**
45
- * @public
45
+ * `<prosekit-inline-popover-popup>` custom element.
46
+ *
47
+ * Properties: {@link InlinePopoverPopupProps}
48
+ *
49
+ * Data attributes:
50
+ *
51
+ * | Attribute | Description |
52
+ * | --- | --- |
53
+ * | `data-state` | `"open"` when the inline popover is visible, `"closed"` otherwise |
46
54
  */
47
55
  export class InlinePopoverPopupElement extends InlinePopoverPopupElementBase {}
48
56
 
@@ -108,7 +108,23 @@ const InlinePopoverPositionerElementBase: HostElementConstructor<InlinePopoverPo
108
108
  )
109
109
 
110
110
  /**
111
- * @public
111
+ * `<prosekit-inline-popover-positioner>` custom element.
112
+ *
113
+ * Properties: {@link InlinePopoverPositionerProps}
114
+ *
115
+ * Data attributes:
116
+ *
117
+ * | Attribute | Description |
118
+ * | --- | --- |
119
+ * | `data-state` | `"open"` when the inline popover is visible, `"closed"` otherwise |
120
+ * | `data-side` | The side of the anchor element the positioner is on |
121
+ * | `data-align` | The alignment of the positioner relative to the anchor element |
122
+ *
123
+ * CSS variables:
124
+ *
125
+ * | Variable | Description |
126
+ * | --- | --- |
127
+ * | `--transform-origin` | The coordinates that this element is anchored to. Useful for scale animations. |
112
128
  */
113
129
  export class InlinePopoverPositionerElement extends InlinePopoverPositionerElementBase {}
114
130
 
@@ -115,7 +115,11 @@ const InlinePopoverRootElementBase: HostElementConstructor<InlinePopoverRootProp
115
115
  )
116
116
 
117
117
  /**
118
- * @public
118
+ * `<prosekit-inline-popover-root>` custom element.
119
+ *
120
+ * Properties: {@link InlinePopoverRootProps}
121
+ *
122
+ * Events: {@link InlinePopoverRootEvents}
119
123
  */
120
124
  export class InlinePopoverRootElement extends InlinePopoverRootElementBase {}
121
125
 
@@ -24,50 +24,135 @@
24
24
  ```
25
25
  */
26
26
 
27
- import { registerCustomElement } from '@aria-ui/core'
28
- import {
29
- MenuItemElement,
30
- MenuPopupElement,
31
- MenuPositionerElement,
32
- MenuRootElement,
33
- MenuSubmenuRootElement,
34
- MenuSubmenuTriggerElement,
35
- MenuTriggerElement,
36
- } from '@aria-ui/elements/menu'
27
+ import { registerCustomElement, type PropsDeclaration } from '@aria-ui/core'
28
+ import * as Base from '@aria-ui/elements/menu'
37
29
 
38
- export {
39
- MenuItemElement,
40
- MenuItemPropsDeclaration,
41
- MenuPopupElement,
42
- MenuPopupPropsDeclaration,
43
- MenuPositionerElement,
44
- MenuPositionerPropsDeclaration,
45
- MenuRootElement,
46
- MenuRootPropsDeclaration,
47
- MenuSubmenuRootElement,
48
- MenuSubmenuRootPropsDeclaration,
49
- MenuSubmenuTriggerElement,
50
- MenuSubmenuTriggerPropsDeclaration,
51
- MenuTriggerElement,
52
- MenuTriggerPropsDeclaration,
53
- OpenChangeEvent,
54
- SelectEvent,
55
- setupMenuItem,
56
- setupMenuPopup,
57
- setupMenuPositioner,
58
- setupMenuRoot,
59
- setupMenuSubmenuRoot,
60
- setupMenuSubmenuTrigger,
61
- setupMenuTrigger,
62
- type MenuItemEvents,
63
- type MenuItemProps,
64
- type MenuPopupProps,
65
- type MenuPositionerProps,
66
- type MenuRootEvents,
67
- type MenuRootProps,
68
- type MenuTriggerEvents,
69
- type MenuTriggerProps,
70
- } from '@aria-ui/elements/menu'
30
+ /**
31
+ * `<prosekit-menu-item>` custom element.
32
+ *
33
+ * Properties: {@link MenuItemProps}
34
+ *
35
+ * Events: {@link MenuItemEvents}
36
+ *
37
+ * Data attributes:
38
+ *
39
+ * | Attribute | Description |
40
+ * | --- | --- |
41
+ * | `data-highlighted` | Present when the item is the currently highlighted option |
42
+ */
43
+ export class MenuItemElement extends Base.MenuItemElement {}
44
+
45
+ /**
46
+ * `<prosekit-menu-popup>` custom element.
47
+ *
48
+ * Properties: {@link MenuPopupProps}
49
+ *
50
+ * Data attributes:
51
+ *
52
+ * | Attribute | Description |
53
+ * | --- | --- |
54
+ * | `data-state` | `"open"` when the menu is visible, `"closed"` otherwise |
55
+ */
56
+ export class MenuPopupElement extends Base.MenuPopupElement {}
57
+
58
+ /**
59
+ * `<prosekit-menu-positioner>` custom element.
60
+ *
61
+ * Properties: {@link MenuPositionerProps}
62
+ *
63
+ * Data attributes:
64
+ *
65
+ * | Attribute | Description |
66
+ * | --- | --- |
67
+ * | `data-state` | `"open"` when the menu is visible, `"closed"` otherwise |
68
+ *
69
+ * CSS variables:
70
+ *
71
+ * | Variable | Description |
72
+ * | --- | --- |
73
+ * | `--transform-origin` | The coordinates that this element is anchored to. Useful for scale animations. |
74
+ */
75
+ export class MenuPositionerElement extends Base.MenuPositionerElement {}
76
+
77
+ /**
78
+ * `<prosekit-menu-root>` custom element.
79
+ *
80
+ * Properties: {@link MenuRootProps}
81
+ *
82
+ * Events: {@link MenuRootEvents}
83
+ *
84
+ * Data attributes:
85
+ *
86
+ * | Attribute | Description |
87
+ * | --- | --- |
88
+ * | `data-menu-root` | Always present on the element |
89
+ */
90
+ export class MenuRootElement extends Base.MenuRootElement {}
91
+
92
+ /**
93
+ * `<prosekit-menu-submenu-root>` custom element.
94
+ *
95
+ * Properties: {@link MenuSubmenuRootProps}
96
+ *
97
+ * Events: {@link MenuSubmenuRootEvents}
98
+ *
99
+ * Data attributes:
100
+ *
101
+ * | Attribute | Description |
102
+ * | --- | --- |
103
+ * | `data-menu-submenu-root` | Always present on the element |
104
+ */
105
+ export class MenuSubmenuRootElement extends Base.MenuSubmenuRootElement {}
106
+
107
+ /**
108
+ * `<prosekit-menu-submenu-trigger>` custom element.
109
+ *
110
+ * Properties: {@link MenuSubmenuTriggerProps}
111
+ *
112
+ * Data attributes:
113
+ *
114
+ * | Attribute | Description |
115
+ * | --- | --- |
116
+ * | `data-highlighted` | Present when the item is the currently highlighted option |
117
+ */
118
+ export class MenuSubmenuTriggerElement extends Base.MenuSubmenuTriggerElement {}
119
+
120
+ /**
121
+ * `<prosekit-menu-trigger>` custom element.
122
+ *
123
+ * Properties: {@link MenuTriggerProps}
124
+ *
125
+ * Events: {@link MenuTriggerEvents}
126
+ */
127
+ export class MenuTriggerElement extends Base.MenuTriggerElement {}
128
+
129
+ export interface MenuItemProps extends Base.MenuItemProps {}
130
+ export interface MenuPopupProps extends Base.MenuPopupProps {}
131
+ export interface MenuPositionerProps extends Base.MenuPositionerProps {}
132
+ export interface MenuRootProps extends Base.MenuRootProps {}
133
+ export interface MenuSubmenuRootProps extends Base.MenuSubmenuRootProps {}
134
+ export interface MenuSubmenuTriggerProps extends Base.MenuSubmenuTriggerProps {}
135
+ export interface MenuTriggerProps extends Base.MenuTriggerProps {}
136
+
137
+ export interface MenuItemEvents extends Base.MenuItemEvents {}
138
+ export interface MenuRootEvents extends Base.MenuRootEvents {}
139
+ export interface MenuSubmenuRootEvents extends Base.MenuSubmenuRootEvents {}
140
+ export interface MenuTriggerEvents extends Base.MenuTriggerEvents {}
141
+
142
+ /** @internal */
143
+ export const MenuItemPropsDeclaration: PropsDeclaration<MenuItemProps> = Base.MenuItemPropsDeclaration
144
+ /** @internal */
145
+ export const MenuPopupPropsDeclaration: PropsDeclaration<MenuPopupProps> = Base.MenuPopupPropsDeclaration
146
+ /** @internal */
147
+ export const MenuPositionerPropsDeclaration: PropsDeclaration<MenuPositionerProps> = Base.MenuPositionerPropsDeclaration
148
+ /** @internal */
149
+ export const MenuRootPropsDeclaration: PropsDeclaration<MenuRootProps> = Base.MenuRootPropsDeclaration
150
+ /** @internal */
151
+ export const MenuSubmenuRootPropsDeclaration: PropsDeclaration<MenuSubmenuRootProps> = Base.MenuSubmenuRootPropsDeclaration
152
+ /** @internal */
153
+ export const MenuSubmenuTriggerPropsDeclaration: PropsDeclaration<MenuSubmenuTriggerProps> = Base.MenuSubmenuTriggerPropsDeclaration
154
+ /** @internal */
155
+ export const MenuTriggerPropsDeclaration: PropsDeclaration<MenuTriggerProps> = Base.MenuTriggerPropsDeclaration
71
156
 
72
157
  export function registerMenuRootElement(): void {
73
158
  registerCustomElement('prosekit-menu-root', MenuRootElement)
@@ -90,3 +175,15 @@ export function registerMenuSubmenuRootElement(): void {
90
175
  export function registerMenuSubmenuTriggerElement(): void {
91
176
  registerCustomElement('prosekit-menu-submenu-trigger', MenuSubmenuTriggerElement)
92
177
  }
178
+
179
+ export {
180
+ OpenChangeEvent,
181
+ SelectEvent,
182
+ setupMenuItem,
183
+ setupMenuPopup,
184
+ setupMenuPositioner,
185
+ setupMenuRoot,
186
+ setupMenuSubmenuRoot,
187
+ setupMenuSubmenuTrigger,
188
+ setupMenuTrigger,
189
+ } from '@aria-ui/elements/menu'