@prosekit/vue 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.
Files changed (115) hide show
  1. package/dist/prosekit-vue-autocomplete.d.ts +216 -25
  2. package/dist/prosekit-vue-autocomplete.d.ts.map +1 -1
  3. package/dist/prosekit-vue-autocomplete.js +270 -9
  4. package/dist/prosekit-vue-autocomplete.js.map +1 -1
  5. package/dist/prosekit-vue-block-handle.d.ts +202 -19
  6. package/dist/prosekit-vue-block-handle.d.ts.map +1 -1
  7. package/dist/prosekit-vue-block-handle.js +211 -7
  8. package/dist/prosekit-vue-block-handle.js.map +1 -1
  9. package/dist/prosekit-vue-drop-indicator.d.ts +24 -8
  10. package/dist/prosekit-vue-drop-indicator.d.ts.map +1 -1
  11. package/dist/prosekit-vue-drop-indicator.js +36 -3
  12. package/dist/prosekit-vue-drop-indicator.js.map +1 -1
  13. package/dist/prosekit-vue-inline-popover.d.ts +200 -9
  14. package/dist/prosekit-vue-inline-popover.d.ts.map +1 -1
  15. package/dist/prosekit-vue-inline-popover.js +171 -5
  16. package/dist/prosekit-vue-inline-popover.js.map +1 -1
  17. package/dist/prosekit-vue-menu.d.ts +287 -0
  18. package/dist/prosekit-vue-menu.d.ts.map +1 -0
  19. package/dist/prosekit-vue-menu.js +313 -0
  20. package/dist/prosekit-vue-menu.js.map +1 -0
  21. package/dist/prosekit-vue-popover.d.ts +219 -19
  22. package/dist/prosekit-vue-popover.d.ts.map +1 -1
  23. package/dist/prosekit-vue-popover.js +222 -7
  24. package/dist/prosekit-vue-popover.js.map +1 -1
  25. package/dist/prosekit-vue-resizable.d.ts +50 -15
  26. package/dist/prosekit-vue-resizable.d.ts.map +1 -1
  27. package/dist/prosekit-vue-resizable.js +92 -7
  28. package/dist/prosekit-vue-resizable.js.map +1 -1
  29. package/dist/prosekit-vue-table-handle.d.ts +427 -55
  30. package/dist/prosekit-vue-table-handle.d.ts.map +1 -1
  31. package/dist/prosekit-vue-table-handle.js +455 -19
  32. package/dist/prosekit-vue-table-handle.js.map +1 -1
  33. package/dist/prosekit-vue-tooltip.d.ts +203 -19
  34. package/dist/prosekit-vue-tooltip.d.ts.map +1 -1
  35. package/dist/prosekit-vue-tooltip.js +202 -7
  36. package/dist/prosekit-vue-tooltip.js.map +1 -1
  37. package/package.json +24 -16
  38. package/src/components/autocomplete/autocomplete-empty.gen.ts +21 -25
  39. package/src/components/autocomplete/autocomplete-item.gen.ts +80 -26
  40. package/src/components/autocomplete/autocomplete-popup.gen.ts +80 -0
  41. package/src/components/autocomplete/autocomplete-positioner.gen.ts +149 -0
  42. package/src/components/autocomplete/autocomplete-root.gen.ts +112 -0
  43. package/src/components/autocomplete/index.gen.ts +12 -4
  44. package/src/components/autocomplete/index.ts +27 -0
  45. package/src/components/block-handle/block-handle-add.gen.ts +51 -26
  46. package/src/components/block-handle/block-handle-draggable.gen.ts +51 -26
  47. package/src/components/block-handle/block-handle-popup.gen.ts +29 -0
  48. package/src/components/block-handle/block-handle-positioner.gen.ts +167 -0
  49. package/src/components/block-handle/block-handle-root.gen.ts +84 -0
  50. package/src/components/block-handle/index.gen.ts +13 -3
  51. package/src/components/block-handle/index.ts +27 -0
  52. package/src/components/drop-indicator/drop-indicator.gen.ts +57 -26
  53. package/src/components/drop-indicator/index.gen.ts +5 -1
  54. package/src/components/drop-indicator/index.ts +14 -0
  55. package/src/components/inline-popover/index.gen.ts +11 -1
  56. package/src/components/inline-popover/index.ts +22 -0
  57. package/src/components/inline-popover/inline-popover-popup.gen.ts +29 -0
  58. package/src/components/inline-popover/inline-popover-positioner.gen.ts +173 -0
  59. package/src/components/inline-popover/inline-popover-root.gen.ts +108 -0
  60. package/src/components/menu/index.gen.ts +19 -0
  61. package/src/components/menu/index.ts +37 -0
  62. package/src/components/menu/menu-item.gen.ts +91 -0
  63. package/src/components/menu/menu-popup.gen.ts +54 -0
  64. package/src/components/menu/menu-positioner.gen.ts +174 -0
  65. package/src/components/menu/menu-root.gen.ts +88 -0
  66. package/src/components/menu/menu-submenu-root.gen.ts +29 -0
  67. package/src/components/menu/menu-submenu-trigger.gen.ts +29 -0
  68. package/src/components/menu/menu-trigger.gen.ts +79 -0
  69. package/src/components/popover/index.gen.ts +11 -3
  70. package/src/components/popover/index.ts +24 -0
  71. package/src/components/popover/popover-popup.gen.ts +29 -0
  72. package/src/components/popover/popover-positioner.gen.ts +174 -0
  73. package/src/components/popover/popover-root.gen.ts +88 -26
  74. package/src/components/popover/popover-trigger.gen.ts +88 -26
  75. package/src/components/resizable/index.gen.ts +8 -2
  76. package/src/components/resizable/index.ts +20 -0
  77. package/src/components/resizable/resizable-handle.gen.ts +46 -26
  78. package/src/components/resizable/resizable-root.gen.ts +87 -26
  79. package/src/components/table-handle/index.gen.ts +17 -9
  80. package/src/components/table-handle/index.ts +58 -0
  81. package/src/components/table-handle/table-handle-column-menu-root.gen.ts +62 -0
  82. package/src/components/table-handle/table-handle-column-menu-trigger.gen.ts +56 -0
  83. package/src/components/table-handle/table-handle-column-popup.gen.ts +29 -0
  84. package/src/components/table-handle/table-handle-column-positioner.gen.ts +197 -0
  85. package/src/components/table-handle/table-handle-drag-preview.gen.ts +49 -26
  86. package/src/components/table-handle/table-handle-drop-indicator.gen.ts +49 -26
  87. package/src/components/table-handle/table-handle-root.gen.ts +51 -26
  88. package/src/components/table-handle/table-handle-row-menu-root.gen.ts +62 -0
  89. package/src/components/table-handle/table-handle-row-menu-trigger.gen.ts +56 -0
  90. package/src/components/table-handle/table-handle-row-popup.gen.ts +29 -0
  91. package/src/components/table-handle/table-handle-row-positioner.gen.ts +197 -0
  92. package/src/components/tooltip/index.gen.ts +11 -3
  93. package/src/components/tooltip/index.ts +24 -0
  94. package/src/components/tooltip/tooltip-popup.gen.ts +29 -0
  95. package/src/components/tooltip/tooltip-positioner.gen.ts +174 -0
  96. package/src/components/tooltip/tooltip-root.gen.ts +81 -26
  97. package/src/components/tooltip/tooltip-trigger.gen.ts +55 -26
  98. package/dist/create-component.js +0 -45
  99. package/dist/create-component.js.map +0 -1
  100. package/dist/create-emits.d.ts +0 -5
  101. package/dist/create-emits.d.ts.map +0 -1
  102. package/src/components/autocomplete/autocomplete-list.gen.ts +0 -33
  103. package/src/components/autocomplete/autocomplete-popover.gen.ts +0 -33
  104. package/src/components/block-handle/block-handle-popover.gen.ts +0 -33
  105. package/src/components/create-component.ts +0 -84
  106. package/src/components/create-emits.ts +0 -8
  107. package/src/components/inline-popover/inline-popover.gen.ts +0 -33
  108. package/src/components/popover/popover-content.gen.ts +0 -33
  109. package/src/components/table-handle/table-handle-column-root.gen.ts +0 -33
  110. package/src/components/table-handle/table-handle-column-trigger.gen.ts +0 -33
  111. package/src/components/table-handle/table-handle-popover-content.gen.ts +0 -33
  112. package/src/components/table-handle/table-handle-popover-item.gen.ts +0 -33
  113. package/src/components/table-handle/table-handle-row-root.gen.ts +0 -33
  114. package/src/components/table-handle/table-handle-row-trigger.gen.ts +0 -33
  115. package/src/components/tooltip/tooltip-content.gen.ts +0 -33
@@ -1,17 +1,208 @@
1
- import { t as CreateEmits } from "./create-emits.js";
2
1
  import { DefineSetupFnComponent, HTMLAttributes } from "vue";
3
- import { InlinePopoverEvents, InlinePopoverProps as InlinePopoverProps$1 } from "@prosekit/web/inline-popover";
2
+ import { InlinePopoverPositionerProps as InlinePopoverPositionerProps$1, InlinePopoverRootEvents, InlinePopoverRootProps as InlinePopoverRootProps$1, OpenChangeEvent } from "@prosekit/web/inline-popover";
4
3
 
5
- //#region src/components/inline-popover/inline-popover.gen.d.ts
4
+ //#region src/components/inline-popover/inline-popover-popup.gen.d.ts
6
5
  /**
7
- * Props for the {@link InlinePopover} component.
6
+ * Props for the {@link InlinePopoverPopup} Vue component.
7
+ *
8
+ * @public
8
9
  */
9
- interface InlinePopoverProps extends Partial<InlinePopoverProps$1> {}
10
+ interface InlinePopoverPopupProps {}
10
11
  /**
11
- * Emits for the {@link InlinePopover} component.
12
+ * A Vue component that renders an `prosekit-inline-popover-popup` custom element.
13
+ *
14
+ * @public
12
15
  */
13
- interface InlinePopoverEmits extends CreateEmits<InlinePopoverEvents> {}
14
- declare const InlinePopover: DefineSetupFnComponent<InlinePopoverProps & HTMLAttributes, InlinePopoverEmits>;
16
+ declare const InlinePopoverPopup: DefineSetupFnComponent<InlinePopoverPopupProps & HTMLAttributes>;
15
17
  //#endregion
16
- export { InlinePopover, type InlinePopoverEmits, type InlinePopoverProps };
18
+ //#region src/components/inline-popover/inline-popover-positioner.gen.d.ts
19
+ /**
20
+ * Props for the {@link InlinePopoverPositioner} Vue component.
21
+ *
22
+ * @public
23
+ */
24
+ interface InlinePopoverPositionerProps {
25
+ /**
26
+ * The initial placement of the floating element
27
+ *
28
+ * @default "top"
29
+ */
30
+ placement?: InlinePopoverPositionerProps$1['placement'];
31
+ /**
32
+ * The distance between the reference and floating element.
33
+ *
34
+ * @default 12
35
+ */
36
+ offset?: InlinePopoverPositionerProps$1['offset'];
37
+ /**
38
+ * Whether to hide the floating element when the reference element or the
39
+ * floating element is fully clipped.
40
+ *
41
+ * @default true
42
+ */
43
+ hide?: InlinePopoverPositionerProps$1['hide'];
44
+ /**
45
+ * Whether the floating element can overlap the reference element to keep it
46
+ * in view.
47
+ *
48
+ * @default true
49
+ */
50
+ overlap?: InlinePopoverPositionerProps$1['overlap'];
51
+ /**
52
+ * Whether to improve positioning for inline reference elements that span over
53
+ * multiple lines.
54
+ *
55
+ * @default true
56
+ */
57
+ inline?: InlinePopoverPositionerProps$1['inline'];
58
+ /**
59
+ * Describes the virtual padding around the boundary to check for overflow.
60
+ *
61
+ * @default 8
62
+ */
63
+ overflowPadding?: InlinePopoverPositionerProps$1['overflowPadding'];
64
+ /**
65
+ * The strategy to use for positioning
66
+ *
67
+ * @default "absolute"
68
+ */
69
+ strategy?: InlinePopoverPositionerProps$1['strategy'];
70
+ /**
71
+ * Options to activate auto-update listeners
72
+ *
73
+ * @see https://floating-ui.com/docs/autoUpdate
74
+ *
75
+ * @default true
76
+ */
77
+ autoUpdate?: InlinePopoverPositionerProps$1['autoUpdate'];
78
+ /**
79
+ * Whether to use the browser Popover API to place the floating element on
80
+ * top of other page content.
81
+ *
82
+ * @default true
83
+ */
84
+ hoist?: InlinePopoverPositionerProps$1['hoist'];
85
+ /**
86
+ * Whether to flip the `placement` in order to keep it in view when the
87
+ * preferred placement(s) will overflow the clipping boundary. You can also
88
+ * provide an array of placements to try sequentially if the preferred
89
+ * `placement` does not fit.
90
+ *
91
+ * @default true
92
+ */
93
+ flip?: InlinePopoverPositionerProps$1['flip'];
94
+ /**
95
+ * Whether the floating element should shift to keep it in view.
96
+ *
97
+ * @default true
98
+ */
99
+ shift?: InlinePopoverPositionerProps$1['shift'];
100
+ /**
101
+ * Whether to constrain the floating element's width and height to not exceed
102
+ * the viewport.
103
+ *
104
+ * @default false
105
+ */
106
+ fitViewport?: InlinePopoverPositionerProps$1['fitViewport'];
107
+ /**
108
+ * Whether to constrain the floating element's width so that it matches the
109
+ * reference element.
110
+ *
111
+ * @default false
112
+ */
113
+ sameWidth?: InlinePopoverPositionerProps$1['sameWidth'];
114
+ /**
115
+ * Whether to constrain the floating element's height so that it matches the
116
+ * reference element.
117
+ *
118
+ * @default false
119
+ */
120
+ sameHeight?: InlinePopoverPositionerProps$1['sameHeight'];
121
+ /**
122
+ * Describes the clipping element(s) or area that overflow will be checked relative to.
123
+ * Please see https://floating-ui.com/docs/detectoverflow#boundary for more information.
124
+ *
125
+ * @default 'clippingAncestors'
126
+ */
127
+ boundary?: InlinePopoverPositionerProps$1['boundary'];
128
+ /**
129
+ * Describes the root boundary that the element will be checked for overflow relative to.
130
+ * Please see https://floating-ui.com/docs/detectoverflow#rootboundary for more information.
131
+ *
132
+ * @default 'viewport'
133
+ */
134
+ rootBoundary?: InlinePopoverPositionerProps$1['rootBoundary'];
135
+ /**
136
+ * The element that will be used to check for overflow. Please see
137
+ * https://floating-ui.com/docs/detectoverflow#elementcontext for more
138
+ * information.
139
+ *
140
+ * @default 'floating'
141
+ */
142
+ elementContext?: InlinePopoverPositionerProps$1['elementContext'];
143
+ /**
144
+ * Whether to check the alternate elementContext's boundary. Please see
145
+ * https://floating-ui.com/docs/detectoverflow#altboundary for more
146
+ * information.
147
+ *
148
+ * @default false
149
+ */
150
+ altBoundary?: InlinePopoverPositionerProps$1['altBoundary'];
151
+ }
152
+ /**
153
+ * A Vue component that renders an `prosekit-inline-popover-positioner` custom element.
154
+ *
155
+ * @public
156
+ */
157
+ declare const InlinePopoverPositioner: DefineSetupFnComponent<InlinePopoverPositionerProps & HTMLAttributes>;
158
+ //#endregion
159
+ //#region src/components/inline-popover/inline-popover-root.gen.d.ts
160
+ /**
161
+ * Props for the {@link InlinePopoverRoot} Vue component.
162
+ *
163
+ * @public
164
+ */
165
+ interface InlinePopoverRootProps {
166
+ /**
167
+ * The ProseKit editor instance.
168
+ *
169
+ * @default null
170
+ * @hidden
171
+ */
172
+ editor?: InlinePopoverRootProps$1['editor'];
173
+ /**
174
+ * Whether the popover is open by default when some inline content is
175
+ * selected.
176
+ *
177
+ * @default true
178
+ */
179
+ defaultOpen?: InlinePopoverRootProps$1['defaultOpen'];
180
+ /**
181
+ * Whether the inline popover should be dismissed when the editor receives an
182
+ * Escape key press.
183
+ *
184
+ * @default true
185
+ */
186
+ dismissOnEscape?: InlinePopoverRootProps$1['dismissOnEscape'];
187
+ /**
188
+ * Whether the overlay is currently open.
189
+ * @default null
190
+ */
191
+ open?: InlinePopoverRootProps$1['open'];
192
+ /**
193
+ * Whether the component should ignore user interaction.
194
+ * @default false
195
+ */
196
+ disabled?: InlinePopoverRootProps$1['disabled'];
197
+ /** */
198
+ onOpenChange?: (event: InlinePopoverRootEvents['openChange']) => void;
199
+ }
200
+ /**
201
+ * A Vue component that renders an `prosekit-inline-popover-root` custom element.
202
+ *
203
+ * @public
204
+ */
205
+ declare const InlinePopoverRoot: DefineSetupFnComponent<InlinePopoverRootProps & HTMLAttributes>;
206
+ //#endregion
207
+ export { InlinePopoverPopup, type InlinePopoverPopupProps, InlinePopoverPositioner, type InlinePopoverPositionerProps, InlinePopoverRoot, type InlinePopoverRootEvents, type InlinePopoverRootProps, OpenChangeEvent };
17
208
  //# sourceMappingURL=prosekit-vue-inline-popover.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"prosekit-vue-inline-popover.d.ts","names":[],"sources":["../src/components/inline-popover/inline-popover.gen.ts"],"mappings":";;;;;;;AAcA;UAAiB,kBAAA,SAA2B,OAAA,CAAQ,oBAAA;;;AAKpD;UAAiB,kBAAA,SAA2B,WAAA,CAAY,mBAAA;AAAA,cAE3C,aAAA,EAAe,sBAAA,CAC1B,kBAAA,GAAqB,cAAA,EACrB,kBAAA"}
1
+ {"version":3,"file":"prosekit-vue-inline-popover.d.ts","names":[],"sources":["../src/components/inline-popover/inline-popover-popup.gen.ts","../src/components/inline-popover/inline-popover-positioner.gen.ts","../src/components/inline-popover/inline-popover-root.gen.ts"],"mappings":";;;;AAYA;;;;;AAAA,UAAiB,uBAAA;;;;;;cAOJ,kBAAA,EAAoB,sBAAA,CAAuB,uBAAA,GAA0B,cAAA;;;;;;;AAAlF;UCPiB,4BAAA;;;;;;EAMf,SAAA,GAAY,8BAAA;EDCmB;;;;;ECK/B,MAAA,GAAS,8BAAA;;;AAZX;;;;EAmBE,IAAA,GAAO,8BAAA;EAAA;;;;;;EAOP,OAAA,GAAU,8BAAA;EA2CH;;;;;;EApCP,MAAA,GAAS,8BAAA;EAqFQ;;;;;EA/EjB,eAAA,GAAkB,8BAAA;EA3BlB;;;;;EAiCA,QAAA,GAAW,8BAAA;EAZX;;;;;;;EAoBA,UAAA,GAAa,8BAAA;EAOb;;;;;;EAAA,KAAA,GAAQ,8BAAA;EAsBM;;;;;;;;EAbd,IAAA,GAAO,8BAAA;EAiDP;;;;;EA3CA,KAAA,GAAQ,8BAAA;EA2DG;;;;;;EApDX,WAAA,GAAc,8BAAA;EAoD4C;;;;;;EA7C1D,SAAA,GAAY,8BAAA;;;ACvFd;;;;ED8FE,UAAA,GAAa,8BAAA;ECzEK;;;;;;EDgFlB,QAAA,GAAW,8BAAA;EC9FF;;;;;;EDqGT,YAAA,GAAe,8BAAA;EC7Ef;;;;;;;EDqFA,cAAA,GAAiB,8BAAA;ECzBlB;;;;;;;EDiCC,WAAA,GAAc,8BAAA;AAAA;;;;;;cAQH,uBAAA,EAAyB,sBAAA,CAAuB,4BAAA,GAA+B,cAAA;;;;;;;AD/H5F;UELiB,sBAAA;;;;;;;EAOf,MAAA,GAAS,wBAAA;EFF6C;;;;;;EEStD,WAAA,GAAc,wBAAA;EDhBC;;;;;;ECuBf,eAAA,GAAkB,wBAAA;EDUT;;;;ECLT,IAAA,GAAO,wBAAA;EDyCA;;;;ECpCP,QAAA,GAAW,wBAAA;EDsEA;ECpEX,YAAA,IAAgB,KAAA,EAAO,uBAAA;AAAA;;;;;;cAQZ,iBAAA,EAAmB,sBAAA,CAAuB,sBAAA,GAAyB,cAAA"}
@@ -1,8 +1,174 @@
1
- import { t as createComponent } from "./create-component.js";
2
- import { inlinePopoverEvents, inlinePopoverProps } from "@prosekit/web/inline-popover";
3
- //#region src/components/inline-popover/inline-popover.gen.ts
4
- const InlinePopover = createComponent("prosekit-inline-popover", "InlinePopover", Object.keys(inlinePopoverProps), Object.keys(inlinePopoverEvents));
1
+ import { n as useEditorContext } from "./editor-context.js";
2
+ import { computed, defineComponent, h, shallowRef, watchEffect } from "vue";
3
+ import { OpenChangeEvent, registerInlinePopoverPopupElement, registerInlinePopoverPositionerElement, registerInlinePopoverRootElement } from "@prosekit/web/inline-popover";
4
+ //#region src/components/inline-popover/inline-popover-popup.gen.ts
5
+ /**
6
+ * This file is auto-generated by the "@aria-ui/cli" tool. Do not edit this file directly.
7
+ */
8
+ /**
9
+ * A Vue component that renders an `prosekit-inline-popover-popup` custom element.
10
+ *
11
+ * @public
12
+ */
13
+ const InlinePopoverPopup = /* @__PURE__ */ defineComponent((props, { slots }) => {
14
+ registerInlinePopoverPopupElement();
15
+ return () => {
16
+ return h("prosekit-inline-popover-popup", props, slots.default?.());
17
+ };
18
+ }, { props: [] });
5
19
  //#endregion
6
- export { InlinePopover };
20
+ //#region src/components/inline-popover/inline-popover-positioner.gen.ts
21
+ /**
22
+ * This file is auto-generated by the "@aria-ui/cli" tool. Do not edit this file directly.
23
+ */
24
+ /**
25
+ * A Vue component that renders an `prosekit-inline-popover-positioner` custom element.
26
+ *
27
+ * @public
28
+ */
29
+ const InlinePopoverPositioner = /* @__PURE__ */ defineComponent((props, { slots }) => {
30
+ registerInlinePopoverPositionerElement();
31
+ const elementRef = shallowRef(null);
32
+ const splittedProps = computed(() => {
33
+ const { altBoundary: p0, autoUpdate: p1, boundary: p2, elementContext: p3, fitViewport: p4, flip: p5, hide: p6, hoist: p7, inline: p8, offset: p9, overflowPadding: p10, overlap: p11, placement: p12, rootBoundary: p13, sameHeight: p14, sameWidth: p15, shift: p16, strategy: p17, ...restProps } = props;
34
+ return [[
35
+ p0,
36
+ p1,
37
+ p2,
38
+ p3,
39
+ p4,
40
+ p5,
41
+ p6,
42
+ p7,
43
+ p8,
44
+ p9,
45
+ p10,
46
+ p11,
47
+ p12,
48
+ p13,
49
+ p14,
50
+ p15,
51
+ p16,
52
+ p17
53
+ ], restProps];
54
+ });
55
+ watchEffect(() => {
56
+ const element = elementRef.value;
57
+ if (!element) return;
58
+ const [p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17] = splittedProps.value[0];
59
+ Object.assign(element, {
60
+ altBoundary: p0,
61
+ autoUpdate: p1,
62
+ boundary: p2,
63
+ elementContext: p3,
64
+ fitViewport: p4,
65
+ flip: p5,
66
+ hide: p6,
67
+ hoist: p7,
68
+ inline: p8,
69
+ offset: p9,
70
+ overflowPadding: p10,
71
+ overlap: p11,
72
+ placement: p12,
73
+ rootBoundary: p13,
74
+ sameHeight: p14,
75
+ sameWidth: p15,
76
+ shift: p16,
77
+ strategy: p17
78
+ });
79
+ });
80
+ return () => {
81
+ const restProps = splittedProps.value[1];
82
+ return h("prosekit-inline-popover-positioner", {
83
+ ...restProps,
84
+ ref: elementRef
85
+ }, slots.default?.());
86
+ };
87
+ }, { props: [
88
+ "altBoundary",
89
+ "autoUpdate",
90
+ "boundary",
91
+ "elementContext",
92
+ "fitViewport",
93
+ "flip",
94
+ "hide",
95
+ "hoist",
96
+ "inline",
97
+ "offset",
98
+ "overflowPadding",
99
+ "overlap",
100
+ "placement",
101
+ "rootBoundary",
102
+ "sameHeight",
103
+ "sameWidth",
104
+ "shift",
105
+ "strategy"
106
+ ] });
107
+ //#endregion
108
+ //#region src/components/inline-popover/inline-popover-root.gen.ts
109
+ /**
110
+ * This file is auto-generated by the "@aria-ui/cli" tool. Do not edit this file directly.
111
+ */
112
+ /**
113
+ * A Vue component that renders an `prosekit-inline-popover-root` custom element.
114
+ *
115
+ * @public
116
+ */
117
+ const InlinePopoverRoot = /* @__PURE__ */ defineComponent((props, { slots }) => {
118
+ registerInlinePopoverRootElement();
119
+ const elementRef = shallowRef(null);
120
+ const p3Fallback = useEditorContext();
121
+ const splittedProps = computed(() => {
122
+ const { defaultOpen: p0, disabled: p1, dismissOnEscape: p2, editor: p3, open: p4, onOpenChange: e0, ...restProps } = props;
123
+ return [[
124
+ p0,
125
+ p1,
126
+ p2,
127
+ p3,
128
+ p4,
129
+ e0
130
+ ], restProps];
131
+ });
132
+ const handlers = [];
133
+ watchEffect(() => {
134
+ const element = elementRef.value;
135
+ if (!element) return;
136
+ const [p0, p1, p2, p3, p4, e0] = splittedProps.value[0];
137
+ Object.assign(element, {
138
+ defaultOpen: p0,
139
+ disabled: p1,
140
+ dismissOnEscape: p2,
141
+ editor: p3 ?? p3Fallback,
142
+ open: p4
143
+ });
144
+ handlers.length = 0;
145
+ handlers.push(e0);
146
+ });
147
+ watchEffect(() => {
148
+ const element = elementRef.value;
149
+ if (!element) return;
150
+ const ac = new AbortController();
151
+ for (const [index, eventName] of ["openChange"].entries()) element.addEventListener(eventName, (event) => {
152
+ handlers[index]?.(event);
153
+ }, { signal: ac.signal });
154
+ return () => ac.abort();
155
+ });
156
+ return () => {
157
+ const restProps = splittedProps.value[1];
158
+ return h("prosekit-inline-popover-root", {
159
+ ...restProps,
160
+ ref: elementRef
161
+ }, slots.default?.());
162
+ };
163
+ }, { props: [
164
+ "defaultOpen",
165
+ "disabled",
166
+ "dismissOnEscape",
167
+ "editor",
168
+ "open",
169
+ "onOpenChange"
170
+ ] });
171
+ //#endregion
172
+ export { InlinePopoverPopup, InlinePopoverPositioner, InlinePopoverRoot, OpenChangeEvent };
7
173
 
8
174
  //# sourceMappingURL=prosekit-vue-inline-popover.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"prosekit-vue-inline-popover.js","names":[],"sources":["../src/components/inline-popover/inline-popover.gen.ts"],"sourcesContent":["import {\n inlinePopoverProps,\n inlinePopoverEvents,\n type InlinePopoverProps as Props,\n type InlinePopoverEvents as Events,\n} from '@prosekit/web/inline-popover'\nimport type { DefineSetupFnComponent, HTMLAttributes } from 'vue'\n\nimport { createComponent } from '../create-component.ts'\nimport type { CreateEmits } from '../create-emits.ts'\n\n/**\n * Props for the {@link InlinePopover} component.\n */\nexport interface InlinePopoverProps extends Partial<Props> {}\n\n/**\n * Emits for the {@link InlinePopover} component.\n */\nexport interface InlinePopoverEmits extends CreateEmits<Events> {}\n\nexport const InlinePopover: DefineSetupFnComponent<\n InlinePopoverProps & HTMLAttributes,\n InlinePopoverEmits\n> = createComponent<\n InlinePopoverProps,\n InlinePopoverEmits\n>(\n 'prosekit-inline-popover',\n 'InlinePopover',\n Object.keys(inlinePopoverProps),\n Object.keys(inlinePopoverEvents),\n)\n"],"mappings":";;;AAqBA,MAAa,gBAGT,gBAIF,2BACA,iBACA,OAAO,KAAK,mBAAmB,EAC/B,OAAO,KAAK,oBAAoB,CACjC"}
1
+ {"version":3,"file":"prosekit-vue-inline-popover.js","names":[],"sources":["../src/components/inline-popover/inline-popover-popup.gen.ts","../src/components/inline-popover/inline-popover-positioner.gen.ts","../src/components/inline-popover/inline-popover-root.gen.ts"],"sourcesContent":["/**\n * This file is auto-generated by the \"@aria-ui/cli\" tool. Do not edit this file directly.\n */\n\nimport { registerInlinePopoverPopupElement } from '@prosekit/web/inline-popover';\nimport { defineComponent, h, type DefineSetupFnComponent, type HTMLAttributes } from 'vue';\n\n/**\n * Props for the {@link InlinePopoverPopup} Vue component.\n *\n * @public\n */\nexport interface InlinePopoverPopupProps {}\n\n/**\n * A Vue component that renders an `prosekit-inline-popover-popup` custom element.\n *\n * @public\n */\nexport const InlinePopoverPopup: DefineSetupFnComponent<InlinePopoverPopupProps & HTMLAttributes> = /* @__PURE__ */ defineComponent<InlinePopoverPopupProps & HTMLAttributes>(\n (props, { slots }) => {\n registerInlinePopoverPopupElement();\n\n return () => {\n return h('prosekit-inline-popover-popup', props, slots.default?.());\n };\n },\n { props: [] },\n);\n","/**\n * This file is auto-generated by the \"@aria-ui/cli\" tool. Do not edit this file directly.\n */\n\nimport { registerInlinePopoverPositionerElement, type InlinePopoverPositionerProps as InlinePopoverPositionerElementProps } from '@prosekit/web/inline-popover';\nimport { defineComponent, h, type DefineSetupFnComponent, type HTMLAttributes, shallowRef, computed, watchEffect } from 'vue';\n\n/**\n * Props for the {@link InlinePopoverPositioner} Vue component.\n *\n * @public\n */\nexport interface InlinePopoverPositionerProps {\n /**\n * The initial placement of the floating element\n *\n * @default \"top\"\n */\n placement?: InlinePopoverPositionerElementProps['placement'];\n /**\n * The distance between the reference and floating element.\n *\n * @default 12\n */\n offset?: InlinePopoverPositionerElementProps['offset'];\n /**\n * Whether to hide the floating element when the reference element or the\n * floating element is fully clipped.\n *\n * @default true\n */\n hide?: InlinePopoverPositionerElementProps['hide'];\n /**\n * Whether the floating element can overlap the reference element to keep it\n * in view.\n *\n * @default true\n */\n overlap?: InlinePopoverPositionerElementProps['overlap'];\n /**\n * Whether to improve positioning for inline reference elements that span over\n * multiple lines.\n *\n * @default true\n */\n inline?: InlinePopoverPositionerElementProps['inline'];\n /**\n * Describes the virtual padding around the boundary to check for overflow.\n *\n * @default 8\n */\n overflowPadding?: InlinePopoverPositionerElementProps['overflowPadding'];\n /**\n * The strategy to use for positioning\n *\n * @default \"absolute\"\n */\n strategy?: InlinePopoverPositionerElementProps['strategy'];\n /**\n * Options to activate auto-update listeners\n *\n * @see https://floating-ui.com/docs/autoUpdate\n *\n * @default true\n */\n autoUpdate?: InlinePopoverPositionerElementProps['autoUpdate'];\n /**\n * Whether to use the browser Popover API to place the floating element on\n * top of other page content.\n *\n * @default true\n */\n hoist?: InlinePopoverPositionerElementProps['hoist'];\n /**\n * Whether to flip the `placement` in order to keep it in view when the\n * preferred placement(s) will overflow the clipping boundary. You can also\n * provide an array of placements to try sequentially if the preferred\n * `placement` does not fit.\n *\n * @default true\n */\n flip?: InlinePopoverPositionerElementProps['flip'];\n /**\n * Whether the floating element should shift to keep it in view.\n *\n * @default true\n */\n shift?: InlinePopoverPositionerElementProps['shift'];\n /**\n * Whether to constrain the floating element's width and height to not exceed\n * the viewport.\n *\n * @default false\n */\n fitViewport?: InlinePopoverPositionerElementProps['fitViewport'];\n /**\n * Whether to constrain the floating element's width so that it matches the\n * reference element.\n *\n * @default false\n */\n sameWidth?: InlinePopoverPositionerElementProps['sameWidth'];\n /**\n * Whether to constrain the floating element's height so that it matches the\n * reference element.\n *\n * @default false\n */\n sameHeight?: InlinePopoverPositionerElementProps['sameHeight'];\n /**\n * Describes the clipping element(s) or area that overflow will be checked relative to.\n * Please see https://floating-ui.com/docs/detectoverflow#boundary for more information.\n *\n * @default 'clippingAncestors'\n */\n boundary?: InlinePopoverPositionerElementProps['boundary'];\n /**\n * Describes the root boundary that the element will be checked for overflow relative to.\n * Please see https://floating-ui.com/docs/detectoverflow#rootboundary for more information.\n *\n * @default 'viewport'\n */\n rootBoundary?: InlinePopoverPositionerElementProps['rootBoundary'];\n /**\n * The element that will be used to check for overflow. Please see\n * https://floating-ui.com/docs/detectoverflow#elementcontext for more\n * information.\n *\n * @default 'floating'\n */\n elementContext?: InlinePopoverPositionerElementProps['elementContext'];\n /**\n * Whether to check the alternate elementContext's boundary. Please see\n * https://floating-ui.com/docs/detectoverflow#altboundary for more\n * information.\n *\n * @default false\n */\n altBoundary?: InlinePopoverPositionerElementProps['altBoundary'];\n}\n\n/**\n * A Vue component that renders an `prosekit-inline-popover-positioner` custom element.\n *\n * @public\n */\nexport const InlinePopoverPositioner: DefineSetupFnComponent<InlinePopoverPositionerProps & HTMLAttributes> = /* @__PURE__ */ defineComponent<InlinePopoverPositionerProps & HTMLAttributes>(\n (props, { slots }) => {\n registerInlinePopoverPositionerElement();\n\n const elementRef = shallowRef<HTMLElement | null>(null);\n\n const splittedProps = computed(() => {\n const { altBoundary: p0, autoUpdate: p1, boundary: p2, elementContext: p3, fitViewport: p4, flip: p5, hide: p6, hoist: p7, inline: p8, offset: p9, overflowPadding: p10, overlap: p11, placement: p12, rootBoundary: p13, sameHeight: p14, sameWidth: p15, shift: p16, strategy: p17, ...restProps } = props;\n return [[p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17], restProps] as const;\n });\n\n watchEffect(() => {\n const element = elementRef.value;\n if (!element) return;\n\n const [p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17] = splittedProps.value[0];\n\n Object.assign(element, { altBoundary: p0, autoUpdate: p1, boundary: p2, elementContext: p3, fitViewport: p4, flip: p5, hide: p6, hoist: p7, inline: p8, offset: p9, overflowPadding: p10, overlap: p11, placement: p12, rootBoundary: p13, sameHeight: p14, sameWidth: p15, shift: p16, strategy: p17 });\n });\n\n return () => {\n const restProps = splittedProps.value[1];\n return h('prosekit-inline-popover-positioner', { ...restProps, ref: elementRef }, slots.default?.());\n };\n },\n { props: ['altBoundary', 'autoUpdate', 'boundary', 'elementContext', 'fitViewport', 'flip', 'hide', 'hoist', 'inline', 'offset', 'overflowPadding', 'overlap', 'placement', 'rootBoundary', 'sameHeight', 'sameWidth', 'shift', 'strategy'] },\n);\n","/**\n * This file is auto-generated by the \"@aria-ui/cli\" tool. Do not edit this file directly.\n */\n\nimport { registerInlinePopoverRootElement, type InlinePopoverRootEvents, type InlinePopoverRootProps as InlinePopoverRootElementProps } from '@prosekit/web/inline-popover';\nimport { defineComponent, h, type DefineSetupFnComponent, type HTMLAttributes, shallowRef, computed, watchEffect } from 'vue';\n\nimport { useEditorContext } from '../../injection/editor-context.ts';\n\n/**\n * Props for the {@link InlinePopoverRoot} Vue component.\n *\n * @public\n */\nexport interface InlinePopoverRootProps {\n /**\n * The ProseKit editor instance.\n *\n * @default null\n * @hidden\n */\n editor?: InlinePopoverRootElementProps['editor'];\n /**\n * Whether the popover is open by default when some inline content is\n * selected.\n *\n * @default true\n */\n defaultOpen?: InlinePopoverRootElementProps['defaultOpen'];\n /**\n * Whether the inline popover should be dismissed when the editor receives an\n * Escape key press.\n *\n * @default true\n */\n dismissOnEscape?: InlinePopoverRootElementProps['dismissOnEscape'];\n /**\n * Whether the overlay is currently open.\n * @default null\n */\n open?: InlinePopoverRootElementProps['open'];\n /**\n * Whether the component should ignore user interaction.\n * @default false\n */\n disabled?: InlinePopoverRootElementProps['disabled'];\n /** */\n onOpenChange?: (event: InlinePopoverRootEvents['openChange']) => void;\n}\n\n/**\n * A Vue component that renders an `prosekit-inline-popover-root` custom element.\n *\n * @public\n */\nexport const InlinePopoverRoot: DefineSetupFnComponent<InlinePopoverRootProps & HTMLAttributes> = /* @__PURE__ */ defineComponent<InlinePopoverRootProps & HTMLAttributes>(\n (props, { slots }) => {\n registerInlinePopoverRootElement();\n\n const elementRef = shallowRef<HTMLElement | null>(null);\n\n const p3Fallback = useEditorContext();\n\n const splittedProps = computed(() => {\n const { defaultOpen: p0, disabled: p1, dismissOnEscape: p2, editor: p3, open: p4, onOpenChange: e0, ...restProps } = props;\n return [[p0, p1, p2, p3, p4, e0], restProps] as const;\n });\n\n const handlers: Array<((event: any) => void) | undefined> = [];\n\n watchEffect(() => {\n const element = elementRef.value;\n if (!element) return;\n\n const [p0, p1, p2, p3, p4, e0] = splittedProps.value[0];\n\n Object.assign(element, { defaultOpen: p0, disabled: p1, dismissOnEscape: p2, editor: p3 ?? p3Fallback, open: p4 });\n\n handlers.length = 0;\n handlers.push(e0);\n });\n\n watchEffect(() => {\n const element = elementRef.value;\n if (!element) return;\n\n const ac = new AbortController();\n for (const [index, eventName] of ['openChange'].entries()) {\n element.addEventListener(\n eventName,\n (event: Event) => {\n handlers[index]?.(event);\n },\n { signal: ac.signal },\n );\n }\n return () => ac.abort();\n });\n\n return () => {\n const restProps = splittedProps.value[1];\n return h('prosekit-inline-popover-root', { ...restProps, ref: elementRef }, slots.default?.());\n };\n },\n { props: ['defaultOpen', 'disabled', 'dismissOnEscape', 'editor', 'open', 'onOpenChange'] },\n);\n\nexport type { InlinePopoverRootEvents };\n"],"mappings":"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"}