@prosekit/svelte 0.4.0 → 0.4.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 (64) hide show
  1. package/dist/build/components/autocomplete/autocomplete-empty.gen.d.ts +3 -4
  2. package/dist/build/components/autocomplete/autocomplete-empty.gen.d.ts.map +1 -1
  3. package/dist/build/components/autocomplete/autocomplete-empty.gen.svelte +8 -5
  4. package/dist/build/components/autocomplete/autocomplete-empty.gen.svelte.d.ts.map +1 -1
  5. package/dist/build/components/autocomplete/autocomplete-item.gen.d.ts +3 -4
  6. package/dist/build/components/autocomplete/autocomplete-item.gen.d.ts.map +1 -1
  7. package/dist/build/components/autocomplete/autocomplete-item.gen.svelte +8 -5
  8. package/dist/build/components/autocomplete/autocomplete-item.gen.svelte.d.ts.map +1 -1
  9. package/dist/build/components/autocomplete/autocomplete-list.gen.d.ts +3 -4
  10. package/dist/build/components/autocomplete/autocomplete-list.gen.d.ts.map +1 -1
  11. package/dist/build/components/autocomplete/autocomplete-list.gen.svelte +8 -5
  12. package/dist/build/components/autocomplete/autocomplete-list.gen.svelte.d.ts.map +1 -1
  13. package/dist/build/components/autocomplete/autocomplete-popover.gen.d.ts +3 -4
  14. package/dist/build/components/autocomplete/autocomplete-popover.gen.d.ts.map +1 -1
  15. package/dist/build/components/autocomplete/autocomplete-popover.gen.svelte +8 -5
  16. package/dist/build/components/autocomplete/autocomplete-popover.gen.svelte.d.ts.map +1 -1
  17. package/dist/build/components/block-handle/block-drag-handle.gen.d.ts +3 -4
  18. package/dist/build/components/block-handle/block-drag-handle.gen.d.ts.map +1 -1
  19. package/dist/build/components/block-handle/block-drag-handle.gen.svelte +8 -5
  20. package/dist/build/components/block-handle/block-drag-handle.gen.svelte.d.ts.map +1 -1
  21. package/dist/build/components/block-handle/block-popover.gen.d.ts +3 -4
  22. package/dist/build/components/block-handle/block-popover.gen.d.ts.map +1 -1
  23. package/dist/build/components/block-handle/block-popover.gen.svelte +8 -5
  24. package/dist/build/components/block-handle/block-popover.gen.svelte.d.ts.map +1 -1
  25. package/dist/build/components/inline-popover/inline-popover.gen.d.ts +3 -4
  26. package/dist/build/components/inline-popover/inline-popover.gen.d.ts.map +1 -1
  27. package/dist/build/components/inline-popover/inline-popover.gen.svelte +8 -5
  28. package/dist/build/components/inline-popover/inline-popover.gen.svelte.d.ts.map +1 -1
  29. package/dist/build/components/popover/popover-content.gen.d.ts +3 -4
  30. package/dist/build/components/popover/popover-content.gen.d.ts.map +1 -1
  31. package/dist/build/components/popover/popover-content.gen.svelte +8 -5
  32. package/dist/build/components/popover/popover-content.gen.svelte.d.ts.map +1 -1
  33. package/dist/build/components/popover/popover-root.gen.d.ts +3 -4
  34. package/dist/build/components/popover/popover-root.gen.d.ts.map +1 -1
  35. package/dist/build/components/popover/popover-root.gen.svelte +8 -5
  36. package/dist/build/components/popover/popover-root.gen.svelte.d.ts.map +1 -1
  37. package/dist/build/components/popover/popover-trigger.gen.d.ts +3 -4
  38. package/dist/build/components/popover/popover-trigger.gen.d.ts.map +1 -1
  39. package/dist/build/components/popover/popover-trigger.gen.svelte +8 -5
  40. package/dist/build/components/popover/popover-trigger.gen.svelte.d.ts.map +1 -1
  41. package/dist/build/components/resizable/resizable-handle.gen.d.ts +3 -4
  42. package/dist/build/components/resizable/resizable-handle.gen.d.ts.map +1 -1
  43. package/dist/build/components/resizable/resizable-handle.gen.svelte +8 -5
  44. package/dist/build/components/resizable/resizable-handle.gen.svelte.d.ts.map +1 -1
  45. package/dist/build/components/resizable/resizable-root.gen.d.ts +3 -4
  46. package/dist/build/components/resizable/resizable-root.gen.d.ts.map +1 -1
  47. package/dist/build/components/resizable/resizable-root.gen.svelte +8 -5
  48. package/dist/build/components/resizable/resizable-root.gen.svelte.d.ts.map +1 -1
  49. package/dist/build/components/tooltip/tooltip-content.gen.d.ts +3 -4
  50. package/dist/build/components/tooltip/tooltip-content.gen.d.ts.map +1 -1
  51. package/dist/build/components/tooltip/tooltip-content.gen.svelte +8 -5
  52. package/dist/build/components/tooltip/tooltip-content.gen.svelte.d.ts.map +1 -1
  53. package/dist/build/components/tooltip/tooltip-root.gen.d.ts +3 -4
  54. package/dist/build/components/tooltip/tooltip-root.gen.d.ts.map +1 -1
  55. package/dist/build/components/tooltip/tooltip-root.gen.svelte +8 -5
  56. package/dist/build/components/tooltip/tooltip-root.gen.svelte.d.ts.map +1 -1
  57. package/dist/build/components/tooltip/tooltip-trigger.gen.d.ts +3 -4
  58. package/dist/build/components/tooltip/tooltip-trigger.gen.d.ts.map +1 -1
  59. package/dist/build/components/tooltip/tooltip-trigger.gen.svelte +8 -5
  60. package/dist/build/components/tooltip/tooltip-trigger.gen.svelte.d.ts.map +1 -1
  61. package/dist/build/utils/use-web-component.d.ts +2 -0
  62. package/dist/build/utils/use-web-component.d.ts.map +1 -0
  63. package/dist/build/utils/use-web-component.js +36 -0
  64. package/package.json +3 -3
@@ -1,6 +1,5 @@
1
- import type { AutocompleteEmptyProps } from '@prosekit/web/autocomplete';
1
+ import type { AutocompleteEmptyElement, AutocompleteEmptyProps } from '@prosekit/web/autocomplete';
2
2
  import type { SvelteComponent } from 'svelte';
3
- export declare const AutocompleteEmpty: typeof SvelteComponent<Partial<AutocompleteEmptyProps> & {
4
- class?: string;
5
- }>;
3
+ import type { HTMLAttributes } from 'svelte/elements';
4
+ export declare const AutocompleteEmpty: typeof SvelteComponent<Partial<AutocompleteEmptyProps> & HTMLAttributes<AutocompleteEmptyElement>>;
6
5
  //# sourceMappingURL=autocomplete-empty.gen.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"autocomplete-empty.gen.d.ts","sourceRoot":"","sources":["../../../../../src/components/autocomplete/autocomplete-empty.gen.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAA;AACxE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,QAAQ,CAAA;AAI7C,eAAO,MAAM,iBAAiB,EAA+C,OAAO,eAAe,CAAC,OAAO,CAAC,sBAAsB,CAAC,GAAG;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAC,CAAC,CAAA"}
1
+ {"version":3,"file":"autocomplete-empty.gen.d.ts","sourceRoot":"","sources":["../../../../../src/components/autocomplete/autocomplete-empty.gen.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAA;AAClG,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,QAAQ,CAAA;AAC7C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAA;AAIrD,eAAO,MAAM,iBAAiB,EAAgB,OAAO,eAAe,CAAC,OAAO,CAAC,sBAAsB,CAAC,GAAG,cAAc,CAAC,wBAAwB,CAAC,CAAC,CAAA"}
@@ -1,14 +1,17 @@
1
1
  <script lang="ts">
2
2
  import '@prosekit/web/autocomplete'
3
3
  import { defaultAutocompleteEmptyProps } from '@prosekit/web/autocomplete'
4
+ import { useWebComponent } from '../../utils/use-web-component'
4
5
 
5
- import { useEditorContext } from '../../contexts/editor-context'
6
+ let attributes: Record<string, unknown> = {}
7
+ let element: HTMLElement | undefined = undefined
8
+ const handleChange = useWebComponent(defaultAutocompleteEmptyProps)
6
9
 
7
- const hasEditor = Object.hasOwn(defaultAutocompleteEmptyProps, 'editor')
8
- const editorContext = useEditorContext()
9
- const editor = hasEditor ? editorContext : undefined
10
+ $: {
11
+ attributes = handleChange(element, $$props)
12
+ }
10
13
  </script>
11
14
 
12
- <prosekit-autocomplete-empty {editor} {...$$props}>
15
+ <prosekit-autocomplete-empty {...attributes} bind:this={element}>
13
16
  <slot />
14
17
  </prosekit-autocomplete-empty>
@@ -1 +1 @@
1
- {"version":3,"file":"autocomplete-empty.gen.svelte.d.ts","sourceRoot":"","sources":["../../../../../src/components/autocomplete/autocomplete-empty.gen.svelte"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,QAAQ,CAE5C;AACD,OAAO,4BAA4B,CAAA;AAsBnC,QAAA,MAAM,SAAS;;;;;;;;;;CAA+D,CAAC;AAC/E,MAAM,MAAM,sBAAsB,GAAG,OAAO,SAAS,CAAC,KAAK,CAAC;AAC5D,MAAM,MAAM,uBAAuB,GAAG,OAAO,SAAS,CAAC,MAAM,CAAC;AAC9D,MAAM,MAAM,sBAAsB,GAAG,OAAO,SAAS,CAAC,KAAK,CAAC;AAE5D,MAAM,CAAC,OAAO,OAAO,iBAAkB,SAAQ,oBAAoB,CAAC,sBAAsB,EAAE,uBAAuB,EAAE,sBAAsB,CAAC;CAC3I"}
1
+ {"version":3,"file":"autocomplete-empty.gen.svelte.d.ts","sourceRoot":"","sources":["../../../../../src/components/autocomplete/autocomplete-empty.gen.svelte"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,QAAQ,CAE5C;AACD,OAAO,4BAA4B,CAAA;AAwBnC,QAAA,MAAM,SAAS;;;;;;;;;;CAA+D,CAAC;AAC/E,MAAM,MAAM,sBAAsB,GAAG,OAAO,SAAS,CAAC,KAAK,CAAC;AAC5D,MAAM,MAAM,uBAAuB,GAAG,OAAO,SAAS,CAAC,MAAM,CAAC;AAC9D,MAAM,MAAM,sBAAsB,GAAG,OAAO,SAAS,CAAC,KAAK,CAAC;AAE5D,MAAM,CAAC,OAAO,OAAO,iBAAkB,SAAQ,oBAAoB,CAAC,sBAAsB,EAAE,uBAAuB,EAAE,sBAAsB,CAAC;CAC3I"}
@@ -1,6 +1,5 @@
1
- import type { AutocompleteItemProps } from '@prosekit/web/autocomplete';
1
+ import type { AutocompleteItemElement, AutocompleteItemProps } from '@prosekit/web/autocomplete';
2
2
  import type { SvelteComponent } from 'svelte';
3
- export declare const AutocompleteItem: typeof SvelteComponent<Partial<AutocompleteItemProps> & {
4
- class?: string;
5
- }>;
3
+ import type { HTMLAttributes } from 'svelte/elements';
4
+ export declare const AutocompleteItem: typeof SvelteComponent<Partial<AutocompleteItemProps> & HTMLAttributes<AutocompleteItemElement>>;
6
5
  //# sourceMappingURL=autocomplete-item.gen.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"autocomplete-item.gen.d.ts","sourceRoot":"","sources":["../../../../../src/components/autocomplete/autocomplete-item.gen.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAA;AACvE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,QAAQ,CAAA;AAI7C,eAAO,MAAM,gBAAgB,EAA+C,OAAO,eAAe,CAAC,OAAO,CAAC,qBAAqB,CAAC,GAAG;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAC,CAAC,CAAA"}
1
+ {"version":3,"file":"autocomplete-item.gen.d.ts","sourceRoot":"","sources":["../../../../../src/components/autocomplete/autocomplete-item.gen.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,uBAAuB,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAA;AAChG,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,QAAQ,CAAA;AAC7C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAA;AAIrD,eAAO,MAAM,gBAAgB,EAAgB,OAAO,eAAe,CAAC,OAAO,CAAC,qBAAqB,CAAC,GAAG,cAAc,CAAC,uBAAuB,CAAC,CAAC,CAAA"}
@@ -1,14 +1,17 @@
1
1
  <script lang="ts">
2
2
  import '@prosekit/web/autocomplete'
3
3
  import { defaultAutocompleteItemProps } from '@prosekit/web/autocomplete'
4
+ import { useWebComponent } from '../../utils/use-web-component'
4
5
 
5
- import { useEditorContext } from '../../contexts/editor-context'
6
+ let attributes: Record<string, unknown> = {}
7
+ let element: HTMLElement | undefined = undefined
8
+ const handleChange = useWebComponent(defaultAutocompleteItemProps)
6
9
 
7
- const hasEditor = Object.hasOwn(defaultAutocompleteItemProps, 'editor')
8
- const editorContext = useEditorContext()
9
- const editor = hasEditor ? editorContext : undefined
10
+ $: {
11
+ attributes = handleChange(element, $$props)
12
+ }
10
13
  </script>
11
14
 
12
- <prosekit-autocomplete-item {editor} {...$$props}>
15
+ <prosekit-autocomplete-item {...attributes} bind:this={element}>
13
16
  <slot />
14
17
  </prosekit-autocomplete-item>
@@ -1 +1 @@
1
- {"version":3,"file":"autocomplete-item.gen.svelte.d.ts","sourceRoot":"","sources":["../../../../../src/components/autocomplete/autocomplete-item.gen.svelte"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,QAAQ,CAE5C;AACD,OAAO,4BAA4B,CAAA;AAsBnC,QAAA,MAAM,SAAS;;;;;;;;;;CAA+D,CAAC;AAC/E,MAAM,MAAM,qBAAqB,GAAG,OAAO,SAAS,CAAC,KAAK,CAAC;AAC3D,MAAM,MAAM,sBAAsB,GAAG,OAAO,SAAS,CAAC,MAAM,CAAC;AAC7D,MAAM,MAAM,qBAAqB,GAAG,OAAO,SAAS,CAAC,KAAK,CAAC;AAE3D,MAAM,CAAC,OAAO,OAAO,gBAAiB,SAAQ,oBAAoB,CAAC,qBAAqB,EAAE,sBAAsB,EAAE,qBAAqB,CAAC;CACvI"}
1
+ {"version":3,"file":"autocomplete-item.gen.svelte.d.ts","sourceRoot":"","sources":["../../../../../src/components/autocomplete/autocomplete-item.gen.svelte"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,QAAQ,CAE5C;AACD,OAAO,4BAA4B,CAAA;AAwBnC,QAAA,MAAM,SAAS;;;;;;;;;;CAA+D,CAAC;AAC/E,MAAM,MAAM,qBAAqB,GAAG,OAAO,SAAS,CAAC,KAAK,CAAC;AAC3D,MAAM,MAAM,sBAAsB,GAAG,OAAO,SAAS,CAAC,MAAM,CAAC;AAC7D,MAAM,MAAM,qBAAqB,GAAG,OAAO,SAAS,CAAC,KAAK,CAAC;AAE3D,MAAM,CAAC,OAAO,OAAO,gBAAiB,SAAQ,oBAAoB,CAAC,qBAAqB,EAAE,sBAAsB,EAAE,qBAAqB,CAAC;CACvI"}
@@ -1,6 +1,5 @@
1
- import type { AutocompleteListProps } from '@prosekit/web/autocomplete';
1
+ import type { AutocompleteListElement, AutocompleteListProps } from '@prosekit/web/autocomplete';
2
2
  import type { SvelteComponent } from 'svelte';
3
- export declare const AutocompleteList: typeof SvelteComponent<Partial<AutocompleteListProps> & {
4
- class?: string;
5
- }>;
3
+ import type { HTMLAttributes } from 'svelte/elements';
4
+ export declare const AutocompleteList: typeof SvelteComponent<Partial<AutocompleteListProps> & HTMLAttributes<AutocompleteListElement>>;
6
5
  //# sourceMappingURL=autocomplete-list.gen.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"autocomplete-list.gen.d.ts","sourceRoot":"","sources":["../../../../../src/components/autocomplete/autocomplete-list.gen.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAA;AACvE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,QAAQ,CAAA;AAI7C,eAAO,MAAM,gBAAgB,EAA+C,OAAO,eAAe,CAAC,OAAO,CAAC,qBAAqB,CAAC,GAAG;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAC,CAAC,CAAA"}
1
+ {"version":3,"file":"autocomplete-list.gen.d.ts","sourceRoot":"","sources":["../../../../../src/components/autocomplete/autocomplete-list.gen.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,uBAAuB,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAA;AAChG,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,QAAQ,CAAA;AAC7C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAA;AAIrD,eAAO,MAAM,gBAAgB,EAAgB,OAAO,eAAe,CAAC,OAAO,CAAC,qBAAqB,CAAC,GAAG,cAAc,CAAC,uBAAuB,CAAC,CAAC,CAAA"}
@@ -1,14 +1,17 @@
1
1
  <script lang="ts">
2
2
  import '@prosekit/web/autocomplete'
3
3
  import { defaultAutocompleteListProps } from '@prosekit/web/autocomplete'
4
+ import { useWebComponent } from '../../utils/use-web-component'
4
5
 
5
- import { useEditorContext } from '../../contexts/editor-context'
6
+ let attributes: Record<string, unknown> = {}
7
+ let element: HTMLElement | undefined = undefined
8
+ const handleChange = useWebComponent(defaultAutocompleteListProps)
6
9
 
7
- const hasEditor = Object.hasOwn(defaultAutocompleteListProps, 'editor')
8
- const editorContext = useEditorContext()
9
- const editor = hasEditor ? editorContext : undefined
10
+ $: {
11
+ attributes = handleChange(element, $$props)
12
+ }
10
13
  </script>
11
14
 
12
- <prosekit-autocomplete-list {editor} {...$$props}>
15
+ <prosekit-autocomplete-list {...attributes} bind:this={element}>
13
16
  <slot />
14
17
  </prosekit-autocomplete-list>
@@ -1 +1 @@
1
- {"version":3,"file":"autocomplete-list.gen.svelte.d.ts","sourceRoot":"","sources":["../../../../../src/components/autocomplete/autocomplete-list.gen.svelte"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,QAAQ,CAE5C;AACD,OAAO,4BAA4B,CAAA;AAsBnC,QAAA,MAAM,SAAS;;;;;;;;;;CAA+D,CAAC;AAC/E,MAAM,MAAM,qBAAqB,GAAG,OAAO,SAAS,CAAC,KAAK,CAAC;AAC3D,MAAM,MAAM,sBAAsB,GAAG,OAAO,SAAS,CAAC,MAAM,CAAC;AAC7D,MAAM,MAAM,qBAAqB,GAAG,OAAO,SAAS,CAAC,KAAK,CAAC;AAE3D,MAAM,CAAC,OAAO,OAAO,gBAAiB,SAAQ,oBAAoB,CAAC,qBAAqB,EAAE,sBAAsB,EAAE,qBAAqB,CAAC;CACvI"}
1
+ {"version":3,"file":"autocomplete-list.gen.svelte.d.ts","sourceRoot":"","sources":["../../../../../src/components/autocomplete/autocomplete-list.gen.svelte"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,QAAQ,CAE5C;AACD,OAAO,4BAA4B,CAAA;AAwBnC,QAAA,MAAM,SAAS;;;;;;;;;;CAA+D,CAAC;AAC/E,MAAM,MAAM,qBAAqB,GAAG,OAAO,SAAS,CAAC,KAAK,CAAC;AAC3D,MAAM,MAAM,sBAAsB,GAAG,OAAO,SAAS,CAAC,MAAM,CAAC;AAC7D,MAAM,MAAM,qBAAqB,GAAG,OAAO,SAAS,CAAC,KAAK,CAAC;AAE3D,MAAM,CAAC,OAAO,OAAO,gBAAiB,SAAQ,oBAAoB,CAAC,qBAAqB,EAAE,sBAAsB,EAAE,qBAAqB,CAAC;CACvI"}
@@ -1,6 +1,5 @@
1
- import type { AutocompletePopoverProps } from '@prosekit/web/autocomplete';
1
+ import type { AutocompletePopoverElement, AutocompletePopoverProps } from '@prosekit/web/autocomplete';
2
2
  import type { SvelteComponent } from 'svelte';
3
- export declare const AutocompletePopover: typeof SvelteComponent<Partial<AutocompletePopoverProps> & {
4
- class?: string;
5
- }>;
3
+ import type { HTMLAttributes } from 'svelte/elements';
4
+ export declare const AutocompletePopover: typeof SvelteComponent<Partial<AutocompletePopoverProps> & HTMLAttributes<AutocompletePopoverElement>>;
6
5
  //# sourceMappingURL=autocomplete-popover.gen.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"autocomplete-popover.gen.d.ts","sourceRoot":"","sources":["../../../../../src/components/autocomplete/autocomplete-popover.gen.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAA;AAC1E,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,QAAQ,CAAA;AAI7C,eAAO,MAAM,mBAAmB,EAA+C,OAAO,eAAe,CAAC,OAAO,CAAC,wBAAwB,CAAC,GAAG;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAC,CAAC,CAAA"}
1
+ {"version":3,"file":"autocomplete-popover.gen.d.ts","sourceRoot":"","sources":["../../../../../src/components/autocomplete/autocomplete-popover.gen.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,0BAA0B,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAA;AACtG,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,QAAQ,CAAA;AAC7C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAA;AAIrD,eAAO,MAAM,mBAAmB,EAAgB,OAAO,eAAe,CAAC,OAAO,CAAC,wBAAwB,CAAC,GAAG,cAAc,CAAC,0BAA0B,CAAC,CAAC,CAAA"}
@@ -1,14 +1,17 @@
1
1
  <script lang="ts">
2
2
  import '@prosekit/web/autocomplete'
3
3
  import { defaultAutocompletePopoverProps } from '@prosekit/web/autocomplete'
4
+ import { useWebComponent } from '../../utils/use-web-component'
4
5
 
5
- import { useEditorContext } from '../../contexts/editor-context'
6
+ let attributes: Record<string, unknown> = {}
7
+ let element: HTMLElement | undefined = undefined
8
+ const handleChange = useWebComponent(defaultAutocompletePopoverProps)
6
9
 
7
- const hasEditor = Object.hasOwn(defaultAutocompletePopoverProps, 'editor')
8
- const editorContext = useEditorContext()
9
- const editor = hasEditor ? editorContext : undefined
10
+ $: {
11
+ attributes = handleChange(element, $$props)
12
+ }
10
13
  </script>
11
14
 
12
- <prosekit-autocomplete-popover {editor} {...$$props}>
15
+ <prosekit-autocomplete-popover {...attributes} bind:this={element}>
13
16
  <slot />
14
17
  </prosekit-autocomplete-popover>
@@ -1 +1 @@
1
- {"version":3,"file":"autocomplete-popover.gen.svelte.d.ts","sourceRoot":"","sources":["../../../../../src/components/autocomplete/autocomplete-popover.gen.svelte"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,QAAQ,CAE5C;AACD,OAAO,4BAA4B,CAAA;AAsBnC,QAAA,MAAM,SAAS;;;;;;;;;;CAA+D,CAAC;AAC/E,MAAM,MAAM,wBAAwB,GAAG,OAAO,SAAS,CAAC,KAAK,CAAC;AAC9D,MAAM,MAAM,yBAAyB,GAAG,OAAO,SAAS,CAAC,MAAM,CAAC;AAChE,MAAM,MAAM,wBAAwB,GAAG,OAAO,SAAS,CAAC,KAAK,CAAC;AAE9D,MAAM,CAAC,OAAO,OAAO,mBAAoB,SAAQ,oBAAoB,CAAC,wBAAwB,EAAE,yBAAyB,EAAE,wBAAwB,CAAC;CACnJ"}
1
+ {"version":3,"file":"autocomplete-popover.gen.svelte.d.ts","sourceRoot":"","sources":["../../../../../src/components/autocomplete/autocomplete-popover.gen.svelte"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,QAAQ,CAE5C;AACD,OAAO,4BAA4B,CAAA;AAwBnC,QAAA,MAAM,SAAS;;;;;;;;;;CAA+D,CAAC;AAC/E,MAAM,MAAM,wBAAwB,GAAG,OAAO,SAAS,CAAC,KAAK,CAAC;AAC9D,MAAM,MAAM,yBAAyB,GAAG,OAAO,SAAS,CAAC,MAAM,CAAC;AAChE,MAAM,MAAM,wBAAwB,GAAG,OAAO,SAAS,CAAC,KAAK,CAAC;AAE9D,MAAM,CAAC,OAAO,OAAO,mBAAoB,SAAQ,oBAAoB,CAAC,wBAAwB,EAAE,yBAAyB,EAAE,wBAAwB,CAAC;CACnJ"}
@@ -1,6 +1,5 @@
1
- import type { BlockDragHandleProps } from '@prosekit/web/block-handle';
1
+ import type { BlockDragHandleElement, BlockDragHandleProps } from '@prosekit/web/block-handle';
2
2
  import type { SvelteComponent } from 'svelte';
3
- export declare const BlockDragHandle: typeof SvelteComponent<Partial<BlockDragHandleProps> & {
4
- class?: string;
5
- }>;
3
+ import type { HTMLAttributes } from 'svelte/elements';
4
+ export declare const BlockDragHandle: typeof SvelteComponent<Partial<BlockDragHandleProps> & HTMLAttributes<BlockDragHandleElement>>;
6
5
  //# sourceMappingURL=block-drag-handle.gen.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"block-drag-handle.gen.d.ts","sourceRoot":"","sources":["../../../../../src/components/block-handle/block-drag-handle.gen.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAA;AACtE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,QAAQ,CAAA;AAI7C,eAAO,MAAM,eAAe,EAA+C,OAAO,eAAe,CAAC,OAAO,CAAC,oBAAoB,CAAC,GAAG;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAC,CAAC,CAAA"}
1
+ {"version":3,"file":"block-drag-handle.gen.d.ts","sourceRoot":"","sources":["../../../../../src/components/block-handle/block-drag-handle.gen.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAA;AAC9F,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,QAAQ,CAAA;AAC7C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAA;AAIrD,eAAO,MAAM,eAAe,EAAgB,OAAO,eAAe,CAAC,OAAO,CAAC,oBAAoB,CAAC,GAAG,cAAc,CAAC,sBAAsB,CAAC,CAAC,CAAA"}
@@ -1,14 +1,17 @@
1
1
  <script lang="ts">
2
2
  import '@prosekit/web/block-handle'
3
3
  import { defaultBlockDragHandleProps } from '@prosekit/web/block-handle'
4
+ import { useWebComponent } from '../../utils/use-web-component'
4
5
 
5
- import { useEditorContext } from '../../contexts/editor-context'
6
+ let attributes: Record<string, unknown> = {}
7
+ let element: HTMLElement | undefined = undefined
8
+ const handleChange = useWebComponent(defaultBlockDragHandleProps)
6
9
 
7
- const hasEditor = Object.hasOwn(defaultBlockDragHandleProps, 'editor')
8
- const editorContext = useEditorContext()
9
- const editor = hasEditor ? editorContext : undefined
10
+ $: {
11
+ attributes = handleChange(element, $$props)
12
+ }
10
13
  </script>
11
14
 
12
- <prosekit-block-drag-handle {editor} {...$$props}>
15
+ <prosekit-block-drag-handle {...attributes} bind:this={element}>
13
16
  <slot />
14
17
  </prosekit-block-drag-handle>
@@ -1 +1 @@
1
- {"version":3,"file":"block-drag-handle.gen.svelte.d.ts","sourceRoot":"","sources":["../../../../../src/components/block-handle/block-drag-handle.gen.svelte"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,QAAQ,CAE5C;AACD,OAAO,4BAA4B,CAAA;AAsBnC,QAAA,MAAM,SAAS;;;;;;;;;;CAA+D,CAAC;AAC/E,MAAM,MAAM,oBAAoB,GAAG,OAAO,SAAS,CAAC,KAAK,CAAC;AAC1D,MAAM,MAAM,qBAAqB,GAAG,OAAO,SAAS,CAAC,MAAM,CAAC;AAC5D,MAAM,MAAM,oBAAoB,GAAG,OAAO,SAAS,CAAC,KAAK,CAAC;AAE1D,MAAM,CAAC,OAAO,OAAO,eAAgB,SAAQ,oBAAoB,CAAC,oBAAoB,EAAE,qBAAqB,EAAE,oBAAoB,CAAC;CACnI"}
1
+ {"version":3,"file":"block-drag-handle.gen.svelte.d.ts","sourceRoot":"","sources":["../../../../../src/components/block-handle/block-drag-handle.gen.svelte"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,QAAQ,CAE5C;AACD,OAAO,4BAA4B,CAAA;AAwBnC,QAAA,MAAM,SAAS;;;;;;;;;;CAA+D,CAAC;AAC/E,MAAM,MAAM,oBAAoB,GAAG,OAAO,SAAS,CAAC,KAAK,CAAC;AAC1D,MAAM,MAAM,qBAAqB,GAAG,OAAO,SAAS,CAAC,MAAM,CAAC;AAC5D,MAAM,MAAM,oBAAoB,GAAG,OAAO,SAAS,CAAC,KAAK,CAAC;AAE1D,MAAM,CAAC,OAAO,OAAO,eAAgB,SAAQ,oBAAoB,CAAC,oBAAoB,EAAE,qBAAqB,EAAE,oBAAoB,CAAC;CACnI"}
@@ -1,6 +1,5 @@
1
- import type { BlockPopoverProps } from '@prosekit/web/block-handle';
1
+ import type { BlockPopoverElement, BlockPopoverProps } from '@prosekit/web/block-handle';
2
2
  import type { SvelteComponent } from 'svelte';
3
- export declare const BlockPopover: typeof SvelteComponent<Partial<BlockPopoverProps> & {
4
- class?: string;
5
- }>;
3
+ import type { HTMLAttributes } from 'svelte/elements';
4
+ export declare const BlockPopover: typeof SvelteComponent<Partial<BlockPopoverProps> & HTMLAttributes<BlockPopoverElement>>;
6
5
  //# sourceMappingURL=block-popover.gen.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"block-popover.gen.d.ts","sourceRoot":"","sources":["../../../../../src/components/block-handle/block-popover.gen.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAA;AACnE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,QAAQ,CAAA;AAI7C,eAAO,MAAM,YAAY,EAA+C,OAAO,eAAe,CAAC,OAAO,CAAC,iBAAiB,CAAC,GAAG;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAC,CAAC,CAAA"}
1
+ {"version":3,"file":"block-popover.gen.d.ts","sourceRoot":"","sources":["../../../../../src/components/block-handle/block-popover.gen.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAA;AACxF,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,QAAQ,CAAA;AAC7C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAA;AAIrD,eAAO,MAAM,YAAY,EAAgB,OAAO,eAAe,CAAC,OAAO,CAAC,iBAAiB,CAAC,GAAG,cAAc,CAAC,mBAAmB,CAAC,CAAC,CAAA"}
@@ -1,14 +1,17 @@
1
1
  <script lang="ts">
2
2
  import '@prosekit/web/block-handle'
3
3
  import { defaultBlockPopoverProps } from '@prosekit/web/block-handle'
4
+ import { useWebComponent } from '../../utils/use-web-component'
4
5
 
5
- import { useEditorContext } from '../../contexts/editor-context'
6
+ let attributes: Record<string, unknown> = {}
7
+ let element: HTMLElement | undefined = undefined
8
+ const handleChange = useWebComponent(defaultBlockPopoverProps)
6
9
 
7
- const hasEditor = Object.hasOwn(defaultBlockPopoverProps, 'editor')
8
- const editorContext = useEditorContext()
9
- const editor = hasEditor ? editorContext : undefined
10
+ $: {
11
+ attributes = handleChange(element, $$props)
12
+ }
10
13
  </script>
11
14
 
12
- <prosekit-block-popover {editor} {...$$props}>
15
+ <prosekit-block-popover {...attributes} bind:this={element}>
13
16
  <slot />
14
17
  </prosekit-block-popover>
@@ -1 +1 @@
1
- {"version":3,"file":"block-popover.gen.svelte.d.ts","sourceRoot":"","sources":["../../../../../src/components/block-handle/block-popover.gen.svelte"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,QAAQ,CAE5C;AACD,OAAO,4BAA4B,CAAA;AAsBnC,QAAA,MAAM,SAAS;;;;;;;;;;CAA+D,CAAC;AAC/E,MAAM,MAAM,iBAAiB,GAAG,OAAO,SAAS,CAAC,KAAK,CAAC;AACvD,MAAM,MAAM,kBAAkB,GAAG,OAAO,SAAS,CAAC,MAAM,CAAC;AACzD,MAAM,MAAM,iBAAiB,GAAG,OAAO,SAAS,CAAC,KAAK,CAAC;AAEvD,MAAM,CAAC,OAAO,OAAO,YAAa,SAAQ,oBAAoB,CAAC,iBAAiB,EAAE,kBAAkB,EAAE,iBAAiB,CAAC;CACvH"}
1
+ {"version":3,"file":"block-popover.gen.svelte.d.ts","sourceRoot":"","sources":["../../../../../src/components/block-handle/block-popover.gen.svelte"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,QAAQ,CAE5C;AACD,OAAO,4BAA4B,CAAA;AAwBnC,QAAA,MAAM,SAAS;;;;;;;;;;CAA+D,CAAC;AAC/E,MAAM,MAAM,iBAAiB,GAAG,OAAO,SAAS,CAAC,KAAK,CAAC;AACvD,MAAM,MAAM,kBAAkB,GAAG,OAAO,SAAS,CAAC,MAAM,CAAC;AACzD,MAAM,MAAM,iBAAiB,GAAG,OAAO,SAAS,CAAC,KAAK,CAAC;AAEvD,MAAM,CAAC,OAAO,OAAO,YAAa,SAAQ,oBAAoB,CAAC,iBAAiB,EAAE,kBAAkB,EAAE,iBAAiB,CAAC;CACvH"}
@@ -1,6 +1,5 @@
1
- import type { InlinePopoverProps } from '@prosekit/web/inline-popover';
1
+ import type { InlinePopoverElement, InlinePopoverProps } from '@prosekit/web/inline-popover';
2
2
  import type { SvelteComponent } from 'svelte';
3
- export declare const InlinePopover: typeof SvelteComponent<Partial<InlinePopoverProps> & {
4
- class?: string;
5
- }>;
3
+ import type { HTMLAttributes } from 'svelte/elements';
4
+ export declare const InlinePopover: typeof SvelteComponent<Partial<InlinePopoverProps> & HTMLAttributes<InlinePopoverElement>>;
6
5
  //# sourceMappingURL=inline-popover.gen.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"inline-popover.gen.d.ts","sourceRoot":"","sources":["../../../../../src/components/inline-popover/inline-popover.gen.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAA;AACtE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,QAAQ,CAAA;AAI7C,eAAO,MAAM,aAAa,EAA+C,OAAO,eAAe,CAAC,OAAO,CAAC,kBAAkB,CAAC,GAAG;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAC,CAAC,CAAA"}
1
+ {"version":3,"file":"inline-popover.gen.d.ts","sourceRoot":"","sources":["../../../../../src/components/inline-popover/inline-popover.gen.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAA;AAC5F,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,QAAQ,CAAA;AAC7C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAA;AAIrD,eAAO,MAAM,aAAa,EAAgB,OAAO,eAAe,CAAC,OAAO,CAAC,kBAAkB,CAAC,GAAG,cAAc,CAAC,oBAAoB,CAAC,CAAC,CAAA"}
@@ -1,14 +1,17 @@
1
1
  <script lang="ts">
2
2
  import '@prosekit/web/inline-popover'
3
3
  import { defaultInlinePopoverProps } from '@prosekit/web/inline-popover'
4
+ import { useWebComponent } from '../../utils/use-web-component'
4
5
 
5
- import { useEditorContext } from '../../contexts/editor-context'
6
+ let attributes: Record<string, unknown> = {}
7
+ let element: HTMLElement | undefined = undefined
8
+ const handleChange = useWebComponent(defaultInlinePopoverProps)
6
9
 
7
- const hasEditor = Object.hasOwn(defaultInlinePopoverProps, 'editor')
8
- const editorContext = useEditorContext()
9
- const editor = hasEditor ? editorContext : undefined
10
+ $: {
11
+ attributes = handleChange(element, $$props)
12
+ }
10
13
  </script>
11
14
 
12
- <prosekit-inline-popover {editor} {...$$props}>
15
+ <prosekit-inline-popover {...attributes} bind:this={element}>
13
16
  <slot />
14
17
  </prosekit-inline-popover>
@@ -1 +1 @@
1
- {"version":3,"file":"inline-popover.gen.svelte.d.ts","sourceRoot":"","sources":["../../../../../src/components/inline-popover/inline-popover.gen.svelte"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,QAAQ,CAE5C;AACD,OAAO,8BAA8B,CAAA;AAsBrC,QAAA,MAAM,SAAS;;;;;;;;;;CAA+D,CAAC;AAC/E,MAAM,MAAM,kBAAkB,GAAG,OAAO,SAAS,CAAC,KAAK,CAAC;AACxD,MAAM,MAAM,mBAAmB,GAAG,OAAO,SAAS,CAAC,MAAM,CAAC;AAC1D,MAAM,MAAM,kBAAkB,GAAG,OAAO,SAAS,CAAC,KAAK,CAAC;AAExD,MAAM,CAAC,OAAO,OAAO,aAAc,SAAQ,oBAAoB,CAAC,kBAAkB,EAAE,mBAAmB,EAAE,kBAAkB,CAAC;CAC3H"}
1
+ {"version":3,"file":"inline-popover.gen.svelte.d.ts","sourceRoot":"","sources":["../../../../../src/components/inline-popover/inline-popover.gen.svelte"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,QAAQ,CAE5C;AACD,OAAO,8BAA8B,CAAA;AAwBrC,QAAA,MAAM,SAAS;;;;;;;;;;CAA+D,CAAC;AAC/E,MAAM,MAAM,kBAAkB,GAAG,OAAO,SAAS,CAAC,KAAK,CAAC;AACxD,MAAM,MAAM,mBAAmB,GAAG,OAAO,SAAS,CAAC,MAAM,CAAC;AAC1D,MAAM,MAAM,kBAAkB,GAAG,OAAO,SAAS,CAAC,KAAK,CAAC;AAExD,MAAM,CAAC,OAAO,OAAO,aAAc,SAAQ,oBAAoB,CAAC,kBAAkB,EAAE,mBAAmB,EAAE,kBAAkB,CAAC;CAC3H"}
@@ -1,6 +1,5 @@
1
- import type { PopoverContentProps } from '@prosekit/web/popover';
1
+ import type { PopoverContentElement, PopoverContentProps } from '@prosekit/web/popover';
2
2
  import type { SvelteComponent } from 'svelte';
3
- export declare const PopoverContent: typeof SvelteComponent<Partial<PopoverContentProps> & {
4
- class?: string;
5
- }>;
3
+ import type { HTMLAttributes } from 'svelte/elements';
4
+ export declare const PopoverContent: typeof SvelteComponent<Partial<PopoverContentProps> & HTMLAttributes<PopoverContentElement>>;
6
5
  //# sourceMappingURL=popover-content.gen.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"popover-content.gen.d.ts","sourceRoot":"","sources":["../../../../../src/components/popover/popover-content.gen.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAA;AAChE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,QAAQ,CAAA;AAI7C,eAAO,MAAM,cAAc,EAA+C,OAAO,eAAe,CAAC,OAAO,CAAC,mBAAmB,CAAC,GAAG;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAC,CAAC,CAAA"}
1
+ {"version":3,"file":"popover-content.gen.d.ts","sourceRoot":"","sources":["../../../../../src/components/popover/popover-content.gen.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAA;AACvF,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,QAAQ,CAAA;AAC7C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAA;AAIrD,eAAO,MAAM,cAAc,EAAgB,OAAO,eAAe,CAAC,OAAO,CAAC,mBAAmB,CAAC,GAAG,cAAc,CAAC,qBAAqB,CAAC,CAAC,CAAA"}
@@ -1,14 +1,17 @@
1
1
  <script lang="ts">
2
2
  import '@prosekit/web/popover'
3
3
  import { defaultPopoverContentProps } from '@prosekit/web/popover'
4
+ import { useWebComponent } from '../../utils/use-web-component'
4
5
 
5
- import { useEditorContext } from '../../contexts/editor-context'
6
+ let attributes: Record<string, unknown> = {}
7
+ let element: HTMLElement | undefined = undefined
8
+ const handleChange = useWebComponent(defaultPopoverContentProps)
6
9
 
7
- const hasEditor = Object.hasOwn(defaultPopoverContentProps, 'editor')
8
- const editorContext = useEditorContext()
9
- const editor = hasEditor ? editorContext : undefined
10
+ $: {
11
+ attributes = handleChange(element, $$props)
12
+ }
10
13
  </script>
11
14
 
12
- <prosekit-popover-content {editor} {...$$props}>
15
+ <prosekit-popover-content {...attributes} bind:this={element}>
13
16
  <slot />
14
17
  </prosekit-popover-content>
@@ -1 +1 @@
1
- {"version":3,"file":"popover-content.gen.svelte.d.ts","sourceRoot":"","sources":["../../../../../src/components/popover/popover-content.gen.svelte"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,QAAQ,CAE5C;AACD,OAAO,uBAAuB,CAAA;AAsB9B,QAAA,MAAM,SAAS;;;;;;;;;;CAA+D,CAAC;AAC/E,MAAM,MAAM,mBAAmB,GAAG,OAAO,SAAS,CAAC,KAAK,CAAC;AACzD,MAAM,MAAM,oBAAoB,GAAG,OAAO,SAAS,CAAC,MAAM,CAAC;AAC3D,MAAM,MAAM,mBAAmB,GAAG,OAAO,SAAS,CAAC,KAAK,CAAC;AAEzD,MAAM,CAAC,OAAO,OAAO,cAAe,SAAQ,oBAAoB,CAAC,mBAAmB,EAAE,oBAAoB,EAAE,mBAAmB,CAAC;CAC/H"}
1
+ {"version":3,"file":"popover-content.gen.svelte.d.ts","sourceRoot":"","sources":["../../../../../src/components/popover/popover-content.gen.svelte"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,QAAQ,CAE5C;AACD,OAAO,uBAAuB,CAAA;AAwB9B,QAAA,MAAM,SAAS;;;;;;;;;;CAA+D,CAAC;AAC/E,MAAM,MAAM,mBAAmB,GAAG,OAAO,SAAS,CAAC,KAAK,CAAC;AACzD,MAAM,MAAM,oBAAoB,GAAG,OAAO,SAAS,CAAC,MAAM,CAAC;AAC3D,MAAM,MAAM,mBAAmB,GAAG,OAAO,SAAS,CAAC,KAAK,CAAC;AAEzD,MAAM,CAAC,OAAO,OAAO,cAAe,SAAQ,oBAAoB,CAAC,mBAAmB,EAAE,oBAAoB,EAAE,mBAAmB,CAAC;CAC/H"}
@@ -1,6 +1,5 @@
1
- import type { PopoverRootProps } from '@prosekit/web/popover';
1
+ import type { PopoverRootElement, PopoverRootProps } from '@prosekit/web/popover';
2
2
  import type { SvelteComponent } from 'svelte';
3
- export declare const PopoverRoot: typeof SvelteComponent<Partial<PopoverRootProps> & {
4
- class?: string;
5
- }>;
3
+ import type { HTMLAttributes } from 'svelte/elements';
4
+ export declare const PopoverRoot: typeof SvelteComponent<Partial<PopoverRootProps> & HTMLAttributes<PopoverRootElement>>;
6
5
  //# sourceMappingURL=popover-root.gen.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"popover-root.gen.d.ts","sourceRoot":"","sources":["../../../../../src/components/popover/popover-root.gen.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAA;AAC7D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,QAAQ,CAAA;AAI7C,eAAO,MAAM,WAAW,EAA+C,OAAO,eAAe,CAAC,OAAO,CAAC,gBAAgB,CAAC,GAAG;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAC,CAAC,CAAA"}
1
+ {"version":3,"file":"popover-root.gen.d.ts","sourceRoot":"","sources":["../../../../../src/components/popover/popover-root.gen.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAA;AACjF,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,QAAQ,CAAA;AAC7C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAA;AAIrD,eAAO,MAAM,WAAW,EAAgB,OAAO,eAAe,CAAC,OAAO,CAAC,gBAAgB,CAAC,GAAG,cAAc,CAAC,kBAAkB,CAAC,CAAC,CAAA"}
@@ -1,14 +1,17 @@
1
1
  <script lang="ts">
2
2
  import '@prosekit/web/popover'
3
3
  import { defaultPopoverRootProps } from '@prosekit/web/popover'
4
+ import { useWebComponent } from '../../utils/use-web-component'
4
5
 
5
- import { useEditorContext } from '../../contexts/editor-context'
6
+ let attributes: Record<string, unknown> = {}
7
+ let element: HTMLElement | undefined = undefined
8
+ const handleChange = useWebComponent(defaultPopoverRootProps)
6
9
 
7
- const hasEditor = Object.hasOwn(defaultPopoverRootProps, 'editor')
8
- const editorContext = useEditorContext()
9
- const editor = hasEditor ? editorContext : undefined
10
+ $: {
11
+ attributes = handleChange(element, $$props)
12
+ }
10
13
  </script>
11
14
 
12
- <prosekit-popover-root {editor} {...$$props}>
15
+ <prosekit-popover-root {...attributes} bind:this={element}>
13
16
  <slot />
14
17
  </prosekit-popover-root>
@@ -1 +1 @@
1
- {"version":3,"file":"popover-root.gen.svelte.d.ts","sourceRoot":"","sources":["../../../../../src/components/popover/popover-root.gen.svelte"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,QAAQ,CAE5C;AACD,OAAO,uBAAuB,CAAA;AAsB9B,QAAA,MAAM,SAAS;;;;;;;;;;CAA+D,CAAC;AAC/E,MAAM,MAAM,gBAAgB,GAAG,OAAO,SAAS,CAAC,KAAK,CAAC;AACtD,MAAM,MAAM,iBAAiB,GAAG,OAAO,SAAS,CAAC,MAAM,CAAC;AACxD,MAAM,MAAM,gBAAgB,GAAG,OAAO,SAAS,CAAC,KAAK,CAAC;AAEtD,MAAM,CAAC,OAAO,OAAO,WAAY,SAAQ,oBAAoB,CAAC,gBAAgB,EAAE,iBAAiB,EAAE,gBAAgB,CAAC;CACnH"}
1
+ {"version":3,"file":"popover-root.gen.svelte.d.ts","sourceRoot":"","sources":["../../../../../src/components/popover/popover-root.gen.svelte"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,QAAQ,CAE5C;AACD,OAAO,uBAAuB,CAAA;AAwB9B,QAAA,MAAM,SAAS;;;;;;;;;;CAA+D,CAAC;AAC/E,MAAM,MAAM,gBAAgB,GAAG,OAAO,SAAS,CAAC,KAAK,CAAC;AACtD,MAAM,MAAM,iBAAiB,GAAG,OAAO,SAAS,CAAC,MAAM,CAAC;AACxD,MAAM,MAAM,gBAAgB,GAAG,OAAO,SAAS,CAAC,KAAK,CAAC;AAEtD,MAAM,CAAC,OAAO,OAAO,WAAY,SAAQ,oBAAoB,CAAC,gBAAgB,EAAE,iBAAiB,EAAE,gBAAgB,CAAC;CACnH"}
@@ -1,6 +1,5 @@
1
- import type { PopoverTriggerProps } from '@prosekit/web/popover';
1
+ import type { PopoverTriggerElement, PopoverTriggerProps } from '@prosekit/web/popover';
2
2
  import type { SvelteComponent } from 'svelte';
3
- export declare const PopoverTrigger: typeof SvelteComponent<Partial<PopoverTriggerProps> & {
4
- class?: string;
5
- }>;
3
+ import type { HTMLAttributes } from 'svelte/elements';
4
+ export declare const PopoverTrigger: typeof SvelteComponent<Partial<PopoverTriggerProps> & HTMLAttributes<PopoverTriggerElement>>;
6
5
  //# sourceMappingURL=popover-trigger.gen.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"popover-trigger.gen.d.ts","sourceRoot":"","sources":["../../../../../src/components/popover/popover-trigger.gen.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAA;AAChE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,QAAQ,CAAA;AAI7C,eAAO,MAAM,cAAc,EAA+C,OAAO,eAAe,CAAC,OAAO,CAAC,mBAAmB,CAAC,GAAG;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAC,CAAC,CAAA"}
1
+ {"version":3,"file":"popover-trigger.gen.d.ts","sourceRoot":"","sources":["../../../../../src/components/popover/popover-trigger.gen.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAA;AACvF,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,QAAQ,CAAA;AAC7C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAA;AAIrD,eAAO,MAAM,cAAc,EAAgB,OAAO,eAAe,CAAC,OAAO,CAAC,mBAAmB,CAAC,GAAG,cAAc,CAAC,qBAAqB,CAAC,CAAC,CAAA"}
@@ -1,14 +1,17 @@
1
1
  <script lang="ts">
2
2
  import '@prosekit/web/popover'
3
3
  import { defaultPopoverTriggerProps } from '@prosekit/web/popover'
4
+ import { useWebComponent } from '../../utils/use-web-component'
4
5
 
5
- import { useEditorContext } from '../../contexts/editor-context'
6
+ let attributes: Record<string, unknown> = {}
7
+ let element: HTMLElement | undefined = undefined
8
+ const handleChange = useWebComponent(defaultPopoverTriggerProps)
6
9
 
7
- const hasEditor = Object.hasOwn(defaultPopoverTriggerProps, 'editor')
8
- const editorContext = useEditorContext()
9
- const editor = hasEditor ? editorContext : undefined
10
+ $: {
11
+ attributes = handleChange(element, $$props)
12
+ }
10
13
  </script>
11
14
 
12
- <prosekit-popover-trigger {editor} {...$$props}>
15
+ <prosekit-popover-trigger {...attributes} bind:this={element}>
13
16
  <slot />
14
17
  </prosekit-popover-trigger>
@@ -1 +1 @@
1
- {"version":3,"file":"popover-trigger.gen.svelte.d.ts","sourceRoot":"","sources":["../../../../../src/components/popover/popover-trigger.gen.svelte"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,QAAQ,CAE5C;AACD,OAAO,uBAAuB,CAAA;AAsB9B,QAAA,MAAM,SAAS;;;;;;;;;;CAA+D,CAAC;AAC/E,MAAM,MAAM,mBAAmB,GAAG,OAAO,SAAS,CAAC,KAAK,CAAC;AACzD,MAAM,MAAM,oBAAoB,GAAG,OAAO,SAAS,CAAC,MAAM,CAAC;AAC3D,MAAM,MAAM,mBAAmB,GAAG,OAAO,SAAS,CAAC,KAAK,CAAC;AAEzD,MAAM,CAAC,OAAO,OAAO,cAAe,SAAQ,oBAAoB,CAAC,mBAAmB,EAAE,oBAAoB,EAAE,mBAAmB,CAAC;CAC/H"}
1
+ {"version":3,"file":"popover-trigger.gen.svelte.d.ts","sourceRoot":"","sources":["../../../../../src/components/popover/popover-trigger.gen.svelte"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,QAAQ,CAE5C;AACD,OAAO,uBAAuB,CAAA;AAwB9B,QAAA,MAAM,SAAS;;;;;;;;;;CAA+D,CAAC;AAC/E,MAAM,MAAM,mBAAmB,GAAG,OAAO,SAAS,CAAC,KAAK,CAAC;AACzD,MAAM,MAAM,oBAAoB,GAAG,OAAO,SAAS,CAAC,MAAM,CAAC;AAC3D,MAAM,MAAM,mBAAmB,GAAG,OAAO,SAAS,CAAC,KAAK,CAAC;AAEzD,MAAM,CAAC,OAAO,OAAO,cAAe,SAAQ,oBAAoB,CAAC,mBAAmB,EAAE,oBAAoB,EAAE,mBAAmB,CAAC;CAC/H"}
@@ -1,6 +1,5 @@
1
- import type { ResizableHandleProps } from '@prosekit/web/resizable';
1
+ import type { ResizableHandleElement, ResizableHandleProps } from '@prosekit/web/resizable';
2
2
  import type { SvelteComponent } from 'svelte';
3
- export declare const ResizableHandle: typeof SvelteComponent<Partial<ResizableHandleProps> & {
4
- class?: string;
5
- }>;
3
+ import type { HTMLAttributes } from 'svelte/elements';
4
+ export declare const ResizableHandle: typeof SvelteComponent<Partial<ResizableHandleProps> & HTMLAttributes<ResizableHandleElement>>;
6
5
  //# sourceMappingURL=resizable-handle.gen.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"resizable-handle.gen.d.ts","sourceRoot":"","sources":["../../../../../src/components/resizable/resizable-handle.gen.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAA;AACnE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,QAAQ,CAAA;AAI7C,eAAO,MAAM,eAAe,EAA+C,OAAO,eAAe,CAAC,OAAO,CAAC,oBAAoB,CAAC,GAAG;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAC,CAAC,CAAA"}
1
+ {"version":3,"file":"resizable-handle.gen.d.ts","sourceRoot":"","sources":["../../../../../src/components/resizable/resizable-handle.gen.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAA;AAC3F,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,QAAQ,CAAA;AAC7C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAA;AAIrD,eAAO,MAAM,eAAe,EAAgB,OAAO,eAAe,CAAC,OAAO,CAAC,oBAAoB,CAAC,GAAG,cAAc,CAAC,sBAAsB,CAAC,CAAC,CAAA"}
@@ -1,14 +1,17 @@
1
1
  <script lang="ts">
2
2
  import '@prosekit/web/resizable'
3
3
  import { defaultResizableHandleProps } from '@prosekit/web/resizable'
4
+ import { useWebComponent } from '../../utils/use-web-component'
4
5
 
5
- import { useEditorContext } from '../../contexts/editor-context'
6
+ let attributes: Record<string, unknown> = {}
7
+ let element: HTMLElement | undefined = undefined
8
+ const handleChange = useWebComponent(defaultResizableHandleProps)
6
9
 
7
- const hasEditor = Object.hasOwn(defaultResizableHandleProps, 'editor')
8
- const editorContext = useEditorContext()
9
- const editor = hasEditor ? editorContext : undefined
10
+ $: {
11
+ attributes = handleChange(element, $$props)
12
+ }
10
13
  </script>
11
14
 
12
- <prosekit-resizable-handle {editor} {...$$props}>
15
+ <prosekit-resizable-handle {...attributes} bind:this={element}>
13
16
  <slot />
14
17
  </prosekit-resizable-handle>
@@ -1 +1 @@
1
- {"version":3,"file":"resizable-handle.gen.svelte.d.ts","sourceRoot":"","sources":["../../../../../src/components/resizable/resizable-handle.gen.svelte"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,QAAQ,CAE5C;AACD,OAAO,yBAAyB,CAAA;AAsBhC,QAAA,MAAM,SAAS;;;;;;;;;;CAA+D,CAAC;AAC/E,MAAM,MAAM,oBAAoB,GAAG,OAAO,SAAS,CAAC,KAAK,CAAC;AAC1D,MAAM,MAAM,qBAAqB,GAAG,OAAO,SAAS,CAAC,MAAM,CAAC;AAC5D,MAAM,MAAM,oBAAoB,GAAG,OAAO,SAAS,CAAC,KAAK,CAAC;AAE1D,MAAM,CAAC,OAAO,OAAO,eAAgB,SAAQ,oBAAoB,CAAC,oBAAoB,EAAE,qBAAqB,EAAE,oBAAoB,CAAC;CACnI"}
1
+ {"version":3,"file":"resizable-handle.gen.svelte.d.ts","sourceRoot":"","sources":["../../../../../src/components/resizable/resizable-handle.gen.svelte"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,QAAQ,CAE5C;AACD,OAAO,yBAAyB,CAAA;AAwBhC,QAAA,MAAM,SAAS;;;;;;;;;;CAA+D,CAAC;AAC/E,MAAM,MAAM,oBAAoB,GAAG,OAAO,SAAS,CAAC,KAAK,CAAC;AAC1D,MAAM,MAAM,qBAAqB,GAAG,OAAO,SAAS,CAAC,MAAM,CAAC;AAC5D,MAAM,MAAM,oBAAoB,GAAG,OAAO,SAAS,CAAC,KAAK,CAAC;AAE1D,MAAM,CAAC,OAAO,OAAO,eAAgB,SAAQ,oBAAoB,CAAC,oBAAoB,EAAE,qBAAqB,EAAE,oBAAoB,CAAC;CACnI"}
@@ -1,6 +1,5 @@
1
- import type { ResizableRootProps } from '@prosekit/web/resizable';
1
+ import type { ResizableRootElement, ResizableRootProps } from '@prosekit/web/resizable';
2
2
  import type { SvelteComponent } from 'svelte';
3
- export declare const ResizableRoot: typeof SvelteComponent<Partial<ResizableRootProps> & {
4
- class?: string;
5
- }>;
3
+ import type { HTMLAttributes } from 'svelte/elements';
4
+ export declare const ResizableRoot: typeof SvelteComponent<Partial<ResizableRootProps> & HTMLAttributes<ResizableRootElement>>;
6
5
  //# sourceMappingURL=resizable-root.gen.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"resizable-root.gen.d.ts","sourceRoot":"","sources":["../../../../../src/components/resizable/resizable-root.gen.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAA;AACjE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,QAAQ,CAAA;AAI7C,eAAO,MAAM,aAAa,EAA+C,OAAO,eAAe,CAAC,OAAO,CAAC,kBAAkB,CAAC,GAAG;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAC,CAAC,CAAA"}
1
+ {"version":3,"file":"resizable-root.gen.d.ts","sourceRoot":"","sources":["../../../../../src/components/resizable/resizable-root.gen.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAA;AACvF,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,QAAQ,CAAA;AAC7C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAA;AAIrD,eAAO,MAAM,aAAa,EAAgB,OAAO,eAAe,CAAC,OAAO,CAAC,kBAAkB,CAAC,GAAG,cAAc,CAAC,oBAAoB,CAAC,CAAC,CAAA"}
@@ -1,14 +1,17 @@
1
1
  <script lang="ts">
2
2
  import '@prosekit/web/resizable'
3
3
  import { defaultResizableRootProps } from '@prosekit/web/resizable'
4
+ import { useWebComponent } from '../../utils/use-web-component'
4
5
 
5
- import { useEditorContext } from '../../contexts/editor-context'
6
+ let attributes: Record<string, unknown> = {}
7
+ let element: HTMLElement | undefined = undefined
8
+ const handleChange = useWebComponent(defaultResizableRootProps)
6
9
 
7
- const hasEditor = Object.hasOwn(defaultResizableRootProps, 'editor')
8
- const editorContext = useEditorContext()
9
- const editor = hasEditor ? editorContext : undefined
10
+ $: {
11
+ attributes = handleChange(element, $$props)
12
+ }
10
13
  </script>
11
14
 
12
- <prosekit-resizable-root {editor} {...$$props}>
15
+ <prosekit-resizable-root {...attributes} bind:this={element}>
13
16
  <slot />
14
17
  </prosekit-resizable-root>
@@ -1 +1 @@
1
- {"version":3,"file":"resizable-root.gen.svelte.d.ts","sourceRoot":"","sources":["../../../../../src/components/resizable/resizable-root.gen.svelte"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,QAAQ,CAE5C;AACD,OAAO,yBAAyB,CAAA;AAsBhC,QAAA,MAAM,SAAS;;;;;;;;;;CAA+D,CAAC;AAC/E,MAAM,MAAM,kBAAkB,GAAG,OAAO,SAAS,CAAC,KAAK,CAAC;AACxD,MAAM,MAAM,mBAAmB,GAAG,OAAO,SAAS,CAAC,MAAM,CAAC;AAC1D,MAAM,MAAM,kBAAkB,GAAG,OAAO,SAAS,CAAC,KAAK,CAAC;AAExD,MAAM,CAAC,OAAO,OAAO,aAAc,SAAQ,oBAAoB,CAAC,kBAAkB,EAAE,mBAAmB,EAAE,kBAAkB,CAAC;CAC3H"}
1
+ {"version":3,"file":"resizable-root.gen.svelte.d.ts","sourceRoot":"","sources":["../../../../../src/components/resizable/resizable-root.gen.svelte"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,QAAQ,CAE5C;AACD,OAAO,yBAAyB,CAAA;AAwBhC,QAAA,MAAM,SAAS;;;;;;;;;;CAA+D,CAAC;AAC/E,MAAM,MAAM,kBAAkB,GAAG,OAAO,SAAS,CAAC,KAAK,CAAC;AACxD,MAAM,MAAM,mBAAmB,GAAG,OAAO,SAAS,CAAC,MAAM,CAAC;AAC1D,MAAM,MAAM,kBAAkB,GAAG,OAAO,SAAS,CAAC,KAAK,CAAC;AAExD,MAAM,CAAC,OAAO,OAAO,aAAc,SAAQ,oBAAoB,CAAC,kBAAkB,EAAE,mBAAmB,EAAE,kBAAkB,CAAC;CAC3H"}
@@ -1,6 +1,5 @@
1
- import type { TooltipContentProps } from '@prosekit/web/tooltip';
1
+ import type { TooltipContentElement, TooltipContentProps } from '@prosekit/web/tooltip';
2
2
  import type { SvelteComponent } from 'svelte';
3
- export declare const TooltipContent: typeof SvelteComponent<Partial<TooltipContentProps> & {
4
- class?: string;
5
- }>;
3
+ import type { HTMLAttributes } from 'svelte/elements';
4
+ export declare const TooltipContent: typeof SvelteComponent<Partial<TooltipContentProps> & HTMLAttributes<TooltipContentElement>>;
6
5
  //# sourceMappingURL=tooltip-content.gen.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"tooltip-content.gen.d.ts","sourceRoot":"","sources":["../../../../../src/components/tooltip/tooltip-content.gen.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAA;AAChE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,QAAQ,CAAA;AAI7C,eAAO,MAAM,cAAc,EAA+C,OAAO,eAAe,CAAC,OAAO,CAAC,mBAAmB,CAAC,GAAG;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAC,CAAC,CAAA"}
1
+ {"version":3,"file":"tooltip-content.gen.d.ts","sourceRoot":"","sources":["../../../../../src/components/tooltip/tooltip-content.gen.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAA;AACvF,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,QAAQ,CAAA;AAC7C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAA;AAIrD,eAAO,MAAM,cAAc,EAAgB,OAAO,eAAe,CAAC,OAAO,CAAC,mBAAmB,CAAC,GAAG,cAAc,CAAC,qBAAqB,CAAC,CAAC,CAAA"}
@@ -1,14 +1,17 @@
1
1
  <script lang="ts">
2
2
  import '@prosekit/web/tooltip'
3
3
  import { defaultTooltipContentProps } from '@prosekit/web/tooltip'
4
+ import { useWebComponent } from '../../utils/use-web-component'
4
5
 
5
- import { useEditorContext } from '../../contexts/editor-context'
6
+ let attributes: Record<string, unknown> = {}
7
+ let element: HTMLElement | undefined = undefined
8
+ const handleChange = useWebComponent(defaultTooltipContentProps)
6
9
 
7
- const hasEditor = Object.hasOwn(defaultTooltipContentProps, 'editor')
8
- const editorContext = useEditorContext()
9
- const editor = hasEditor ? editorContext : undefined
10
+ $: {
11
+ attributes = handleChange(element, $$props)
12
+ }
10
13
  </script>
11
14
 
12
- <prosekit-tooltip-content {editor} {...$$props}>
15
+ <prosekit-tooltip-content {...attributes} bind:this={element}>
13
16
  <slot />
14
17
  </prosekit-tooltip-content>
@@ -1 +1 @@
1
- {"version":3,"file":"tooltip-content.gen.svelte.d.ts","sourceRoot":"","sources":["../../../../../src/components/tooltip/tooltip-content.gen.svelte"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,QAAQ,CAE5C;AACD,OAAO,uBAAuB,CAAA;AAsB9B,QAAA,MAAM,SAAS;;;;;;;;;;CAA+D,CAAC;AAC/E,MAAM,MAAM,mBAAmB,GAAG,OAAO,SAAS,CAAC,KAAK,CAAC;AACzD,MAAM,MAAM,oBAAoB,GAAG,OAAO,SAAS,CAAC,MAAM,CAAC;AAC3D,MAAM,MAAM,mBAAmB,GAAG,OAAO,SAAS,CAAC,KAAK,CAAC;AAEzD,MAAM,CAAC,OAAO,OAAO,cAAe,SAAQ,oBAAoB,CAAC,mBAAmB,EAAE,oBAAoB,EAAE,mBAAmB,CAAC;CAC/H"}
1
+ {"version":3,"file":"tooltip-content.gen.svelte.d.ts","sourceRoot":"","sources":["../../../../../src/components/tooltip/tooltip-content.gen.svelte"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,QAAQ,CAE5C;AACD,OAAO,uBAAuB,CAAA;AAwB9B,QAAA,MAAM,SAAS;;;;;;;;;;CAA+D,CAAC;AAC/E,MAAM,MAAM,mBAAmB,GAAG,OAAO,SAAS,CAAC,KAAK,CAAC;AACzD,MAAM,MAAM,oBAAoB,GAAG,OAAO,SAAS,CAAC,MAAM,CAAC;AAC3D,MAAM,MAAM,mBAAmB,GAAG,OAAO,SAAS,CAAC,KAAK,CAAC;AAEzD,MAAM,CAAC,OAAO,OAAO,cAAe,SAAQ,oBAAoB,CAAC,mBAAmB,EAAE,oBAAoB,EAAE,mBAAmB,CAAC;CAC/H"}
@@ -1,6 +1,5 @@
1
- import type { TooltipRootProps } from '@prosekit/web/tooltip';
1
+ import type { TooltipRootElement, TooltipRootProps } from '@prosekit/web/tooltip';
2
2
  import type { SvelteComponent } from 'svelte';
3
- export declare const TooltipRoot: typeof SvelteComponent<Partial<TooltipRootProps> & {
4
- class?: string;
5
- }>;
3
+ import type { HTMLAttributes } from 'svelte/elements';
4
+ export declare const TooltipRoot: typeof SvelteComponent<Partial<TooltipRootProps> & HTMLAttributes<TooltipRootElement>>;
6
5
  //# sourceMappingURL=tooltip-root.gen.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"tooltip-root.gen.d.ts","sourceRoot":"","sources":["../../../../../src/components/tooltip/tooltip-root.gen.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAA;AAC7D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,QAAQ,CAAA;AAI7C,eAAO,MAAM,WAAW,EAA+C,OAAO,eAAe,CAAC,OAAO,CAAC,gBAAgB,CAAC,GAAG;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAC,CAAC,CAAA"}
1
+ {"version":3,"file":"tooltip-root.gen.d.ts","sourceRoot":"","sources":["../../../../../src/components/tooltip/tooltip-root.gen.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAA;AACjF,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,QAAQ,CAAA;AAC7C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAA;AAIrD,eAAO,MAAM,WAAW,EAAgB,OAAO,eAAe,CAAC,OAAO,CAAC,gBAAgB,CAAC,GAAG,cAAc,CAAC,kBAAkB,CAAC,CAAC,CAAA"}
@@ -1,14 +1,17 @@
1
1
  <script lang="ts">
2
2
  import '@prosekit/web/tooltip'
3
3
  import { defaultTooltipRootProps } from '@prosekit/web/tooltip'
4
+ import { useWebComponent } from '../../utils/use-web-component'
4
5
 
5
- import { useEditorContext } from '../../contexts/editor-context'
6
+ let attributes: Record<string, unknown> = {}
7
+ let element: HTMLElement | undefined = undefined
8
+ const handleChange = useWebComponent(defaultTooltipRootProps)
6
9
 
7
- const hasEditor = Object.hasOwn(defaultTooltipRootProps, 'editor')
8
- const editorContext = useEditorContext()
9
- const editor = hasEditor ? editorContext : undefined
10
+ $: {
11
+ attributes = handleChange(element, $$props)
12
+ }
10
13
  </script>
11
14
 
12
- <prosekit-tooltip-root {editor} {...$$props}>
15
+ <prosekit-tooltip-root {...attributes} bind:this={element}>
13
16
  <slot />
14
17
  </prosekit-tooltip-root>
@@ -1 +1 @@
1
- {"version":3,"file":"tooltip-root.gen.svelte.d.ts","sourceRoot":"","sources":["../../../../../src/components/tooltip/tooltip-root.gen.svelte"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,QAAQ,CAE5C;AACD,OAAO,uBAAuB,CAAA;AAsB9B,QAAA,MAAM,SAAS;;;;;;;;;;CAA+D,CAAC;AAC/E,MAAM,MAAM,gBAAgB,GAAG,OAAO,SAAS,CAAC,KAAK,CAAC;AACtD,MAAM,MAAM,iBAAiB,GAAG,OAAO,SAAS,CAAC,MAAM,CAAC;AACxD,MAAM,MAAM,gBAAgB,GAAG,OAAO,SAAS,CAAC,KAAK,CAAC;AAEtD,MAAM,CAAC,OAAO,OAAO,WAAY,SAAQ,oBAAoB,CAAC,gBAAgB,EAAE,iBAAiB,EAAE,gBAAgB,CAAC;CACnH"}
1
+ {"version":3,"file":"tooltip-root.gen.svelte.d.ts","sourceRoot":"","sources":["../../../../../src/components/tooltip/tooltip-root.gen.svelte"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,QAAQ,CAE5C;AACD,OAAO,uBAAuB,CAAA;AAwB9B,QAAA,MAAM,SAAS;;;;;;;;;;CAA+D,CAAC;AAC/E,MAAM,MAAM,gBAAgB,GAAG,OAAO,SAAS,CAAC,KAAK,CAAC;AACtD,MAAM,MAAM,iBAAiB,GAAG,OAAO,SAAS,CAAC,MAAM,CAAC;AACxD,MAAM,MAAM,gBAAgB,GAAG,OAAO,SAAS,CAAC,KAAK,CAAC;AAEtD,MAAM,CAAC,OAAO,OAAO,WAAY,SAAQ,oBAAoB,CAAC,gBAAgB,EAAE,iBAAiB,EAAE,gBAAgB,CAAC;CACnH"}
@@ -1,6 +1,5 @@
1
- import type { TooltipTriggerProps } from '@prosekit/web/tooltip';
1
+ import type { TooltipTriggerElement, TooltipTriggerProps } from '@prosekit/web/tooltip';
2
2
  import type { SvelteComponent } from 'svelte';
3
- export declare const TooltipTrigger: typeof SvelteComponent<Partial<TooltipTriggerProps> & {
4
- class?: string;
5
- }>;
3
+ import type { HTMLAttributes } from 'svelte/elements';
4
+ export declare const TooltipTrigger: typeof SvelteComponent<Partial<TooltipTriggerProps> & HTMLAttributes<TooltipTriggerElement>>;
6
5
  //# sourceMappingURL=tooltip-trigger.gen.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"tooltip-trigger.gen.d.ts","sourceRoot":"","sources":["../../../../../src/components/tooltip/tooltip-trigger.gen.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAA;AAChE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,QAAQ,CAAA;AAI7C,eAAO,MAAM,cAAc,EAA+C,OAAO,eAAe,CAAC,OAAO,CAAC,mBAAmB,CAAC,GAAG;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAC,CAAC,CAAA"}
1
+ {"version":3,"file":"tooltip-trigger.gen.d.ts","sourceRoot":"","sources":["../../../../../src/components/tooltip/tooltip-trigger.gen.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAA;AACvF,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,QAAQ,CAAA;AAC7C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAA;AAIrD,eAAO,MAAM,cAAc,EAAgB,OAAO,eAAe,CAAC,OAAO,CAAC,mBAAmB,CAAC,GAAG,cAAc,CAAC,qBAAqB,CAAC,CAAC,CAAA"}
@@ -1,14 +1,17 @@
1
1
  <script lang="ts">
2
2
  import '@prosekit/web/tooltip'
3
3
  import { defaultTooltipTriggerProps } from '@prosekit/web/tooltip'
4
+ import { useWebComponent } from '../../utils/use-web-component'
4
5
 
5
- import { useEditorContext } from '../../contexts/editor-context'
6
+ let attributes: Record<string, unknown> = {}
7
+ let element: HTMLElement | undefined = undefined
8
+ const handleChange = useWebComponent(defaultTooltipTriggerProps)
6
9
 
7
- const hasEditor = Object.hasOwn(defaultTooltipTriggerProps, 'editor')
8
- const editorContext = useEditorContext()
9
- const editor = hasEditor ? editorContext : undefined
10
+ $: {
11
+ attributes = handleChange(element, $$props)
12
+ }
10
13
  </script>
11
14
 
12
- <prosekit-tooltip-trigger {editor} {...$$props}>
15
+ <prosekit-tooltip-trigger {...attributes} bind:this={element}>
13
16
  <slot />
14
17
  </prosekit-tooltip-trigger>
@@ -1 +1 @@
1
- {"version":3,"file":"tooltip-trigger.gen.svelte.d.ts","sourceRoot":"","sources":["../../../../../src/components/tooltip/tooltip-trigger.gen.svelte"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,QAAQ,CAE5C;AACD,OAAO,uBAAuB,CAAA;AAsB9B,QAAA,MAAM,SAAS;;;;;;;;;;CAA+D,CAAC;AAC/E,MAAM,MAAM,mBAAmB,GAAG,OAAO,SAAS,CAAC,KAAK,CAAC;AACzD,MAAM,MAAM,oBAAoB,GAAG,OAAO,SAAS,CAAC,MAAM,CAAC;AAC3D,MAAM,MAAM,mBAAmB,GAAG,OAAO,SAAS,CAAC,KAAK,CAAC;AAEzD,MAAM,CAAC,OAAO,OAAO,cAAe,SAAQ,oBAAoB,CAAC,mBAAmB,EAAE,oBAAoB,EAAE,mBAAmB,CAAC;CAC/H"}
1
+ {"version":3,"file":"tooltip-trigger.gen.svelte.d.ts","sourceRoot":"","sources":["../../../../../src/components/tooltip/tooltip-trigger.gen.svelte"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,QAAQ,CAE5C;AACD,OAAO,uBAAuB,CAAA;AAwB9B,QAAA,MAAM,SAAS;;;;;;;;;;CAA+D,CAAC;AAC/E,MAAM,MAAM,mBAAmB,GAAG,OAAO,SAAS,CAAC,KAAK,CAAC;AACzD,MAAM,MAAM,oBAAoB,GAAG,OAAO,SAAS,CAAC,MAAM,CAAC;AAC3D,MAAM,MAAM,mBAAmB,GAAG,OAAO,SAAS,CAAC,KAAK,CAAC;AAEzD,MAAM,CAAC,OAAO,OAAO,cAAe,SAAQ,oBAAoB,CAAC,mBAAmB,EAAE,oBAAoB,EAAE,mBAAmB,CAAC;CAC/H"}
@@ -0,0 +1,2 @@
1
+ export declare function useWebComponent(defaultProps: Readonly<Record<string, unknown>>): (element: HTMLElement | undefined, $$props: Record<string, unknown>) => Record<string, unknown>;
2
+ //# sourceMappingURL=use-web-component.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-web-component.d.ts","sourceRoot":"","sources":["../../../../src/utils/use-web-component.ts"],"names":[],"mappings":"AAMA,wBAAgB,eAAe,CAC7B,YAAY,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,aAQpC,WAAW,GAAG,SAAS,WACvB,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,6BA6BnC"}
@@ -0,0 +1,36 @@
1
+ import { useEditorContext } from '../contexts/editor-context';
2
+ // For unknown reason, Svelte v4 cannot set properties on a web component
3
+ // when I directly use `{...$$props}`. It seems that Svelte v4 recognizes
4
+ // the properties as attributes. Here is a workaround to set the properties
5
+ // on the element manually and only let Svelte set the attributes.
6
+ export function useWebComponent(defaultProps) {
7
+ const propertyNames = Object.keys(defaultProps);
8
+ const hasEditor = propertyNames.includes('editor');
9
+ const editorContext = useEditorContext();
10
+ function handleChange(element, $$props) {
11
+ const properties = {};
12
+ const attributes = {};
13
+ for (const [key, value] of Object.entries($$props)) {
14
+ if (value === undefined || key.startsWith('$')) {
15
+ continue;
16
+ }
17
+ else if (propertyNames.includes(key)) {
18
+ properties[key] = value;
19
+ }
20
+ else {
21
+ attributes[key] = value;
22
+ }
23
+ }
24
+ if (hasEditor && !properties.editor && editorContext) {
25
+ properties.editor = editorContext;
26
+ }
27
+ if (element) {
28
+ for (const [key, value] of Object.entries(properties)) {
29
+ ;
30
+ element[key] = value;
31
+ }
32
+ }
33
+ return attributes;
34
+ }
35
+ return handleChange;
36
+ }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@prosekit/svelte",
3
3
  "type": "module",
4
- "version": "0.4.0",
4
+ "version": "0.4.2",
5
5
  "private": false,
6
6
  "author": {
7
7
  "name": "ocavue",
@@ -73,7 +73,7 @@
73
73
  "dependencies": {
74
74
  "@prosemirror-adapter/svelte": "^0.2.6",
75
75
  "@prosekit/core": "^0.7.1",
76
- "@prosekit/web": "^0.2.3",
76
+ "@prosekit/web": "^0.3.0",
77
77
  "@prosekit/pm": "^0.1.5"
78
78
  },
79
79
  "peerDependencies": {
@@ -86,7 +86,7 @@
86
86
  },
87
87
  "devDependencies": {
88
88
  "@sveltejs/package": "^2.3.2",
89
- "@types/node": "^20.14.9",
89
+ "@types/node": "^20.14.10",
90
90
  "read-pkg": "^9.0.1",
91
91
  "svelte": "^4.2.18",
92
92
  "svelte-check": "^3.8.4",