@prosekit/svelte 0.3.10 → 0.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/build/components/autocomplete/autocomplete-empty.gen.svelte +8 -5
- package/dist/build/components/autocomplete/autocomplete-empty.gen.svelte.d.ts.map +1 -1
- package/dist/build/components/autocomplete/autocomplete-item.gen.svelte +8 -5
- package/dist/build/components/autocomplete/autocomplete-item.gen.svelte.d.ts.map +1 -1
- package/dist/build/components/autocomplete/autocomplete-list.gen.svelte +8 -5
- package/dist/build/components/autocomplete/autocomplete-list.gen.svelte.d.ts.map +1 -1
- package/dist/build/components/autocomplete/autocomplete-popover.gen.svelte +8 -5
- package/dist/build/components/autocomplete/autocomplete-popover.gen.svelte.d.ts.map +1 -1
- package/dist/build/components/block-handle/block-drag-handle.gen.svelte +8 -5
- package/dist/build/components/block-handle/block-drag-handle.gen.svelte.d.ts.map +1 -1
- package/dist/build/components/block-handle/block-popover.gen.svelte +8 -5
- package/dist/build/components/block-handle/block-popover.gen.svelte.d.ts.map +1 -1
- package/dist/build/components/inline-popover/inline-popover.gen.svelte +8 -5
- package/dist/build/components/inline-popover/inline-popover.gen.svelte.d.ts.map +1 -1
- package/dist/build/components/node-view-consumer/index.d.ts +6 -0
- package/dist/build/components/node-view-consumer/index.d.ts.map +1 -0
- package/dist/build/components/node-view-consumer/index.js +5 -0
- package/dist/build/components/node-view-consumer/node-view-consumer.svelte +15 -0
- package/dist/build/components/node-view-consumer/node-view-consumer.svelte.d.ts +17 -0
- package/dist/build/components/node-view-consumer/node-view-consumer.svelte.d.ts.map +1 -0
- package/dist/build/components/node-view-wrapper/index.d.ts +6 -0
- package/dist/build/components/node-view-wrapper/index.d.ts.map +1 -0
- package/dist/build/components/node-view-wrapper/index.js +2 -0
- package/dist/build/components/node-view-wrapper/node-view-wrapper.svelte +20 -0
- package/dist/build/components/node-view-wrapper/node-view-wrapper.svelte.d.ts +19 -0
- package/dist/build/components/node-view-wrapper/node-view-wrapper.svelte.d.ts.map +1 -0
- package/dist/build/components/popover/popover-content.gen.svelte +8 -5
- package/dist/build/components/popover/popover-content.gen.svelte.d.ts.map +1 -1
- package/dist/build/components/popover/popover-root.gen.svelte +8 -5
- package/dist/build/components/popover/popover-root.gen.svelte.d.ts.map +1 -1
- package/dist/build/components/popover/popover-trigger.gen.svelte +8 -5
- package/dist/build/components/popover/popover-trigger.gen.svelte.d.ts.map +1 -1
- package/dist/build/components/{prosekit.d.ts → prosekit/index.d.ts} +1 -1
- package/dist/build/components/prosekit/index.d.ts.map +1 -0
- package/dist/build/components/prosekit/index.js +7 -0
- package/dist/build/components/prosekit/prosekit.svelte +14 -0
- package/dist/build/components/prosekit/prosekit.svelte.d.ts.map +1 -0
- package/dist/build/components/resizable/resizable-handle.gen.svelte +8 -5
- package/dist/build/components/resizable/resizable-handle.gen.svelte.d.ts.map +1 -1
- package/dist/build/components/resizable/resizable-root.gen.svelte +8 -5
- package/dist/build/components/resizable/resizable-root.gen.svelte.d.ts.map +1 -1
- package/dist/build/components/tooltip/tooltip-content.gen.svelte +8 -5
- package/dist/build/components/tooltip/tooltip-content.gen.svelte.d.ts.map +1 -1
- package/dist/build/components/tooltip/tooltip-root.gen.svelte +8 -5
- package/dist/build/components/tooltip/tooltip-root.gen.svelte.d.ts.map +1 -1
- package/dist/build/components/tooltip/tooltip-trigger.gen.svelte +8 -5
- package/dist/build/components/tooltip/tooltip-trigger.gen.svelte.d.ts.map +1 -1
- package/dist/build/index.d.ts +4 -2
- package/dist/build/index.d.ts.map +1 -1
- package/dist/build/index.js +2 -1
- package/dist/build/node-view/define-svelte-node-view-factory.d.ts +4 -0
- package/dist/build/node-view/define-svelte-node-view-factory.d.ts.map +1 -0
- package/dist/build/node-view/define-svelte-node-view-factory.js +7 -0
- package/dist/build/node-view/define-svelte-node-view.d.ts +9 -0
- package/dist/build/node-view/define-svelte-node-view.d.ts.map +1 -0
- package/dist/build/node-view/define-svelte-node-view.js +26 -0
- package/dist/build/node-view/types.d.ts +38 -0
- package/dist/build/node-view/types.d.ts.map +1 -0
- package/dist/build/node-view/types.js +1 -0
- package/dist/build/utils/use-web-component.d.ts +2 -0
- package/dist/build/utils/use-web-component.d.ts.map +1 -0
- package/dist/build/utils/use-web-component.js +36 -0
- package/package.json +5 -4
- package/dist/build/components/prosekit.d.ts.map +0 -1
- package/dist/build/components/prosekit.js +0 -7
- package/dist/build/components/prosekit.svelte +0 -10
- package/dist/build/components/prosekit.svelte.d.ts.map +0 -1
- package/dist/build/utils/remove-undefined.d.ts +0 -2
- package/dist/build/utils/remove-undefined.d.ts.map +0 -1
- package/dist/build/utils/remove-undefined.js +0 -10
- /package/dist/build/components/{prosekit.svelte.d.ts → prosekit/prosekit.svelte.d.ts} +0 -0
@@ -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
|
-
|
6
|
+
let attributes: Record<string, unknown> = {}
|
7
|
+
let element: HTMLElement | undefined = undefined
|
8
|
+
const handleChange = useWebComponent(defaultAutocompleteEmptyProps)
|
6
9
|
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
+
$: {
|
11
|
+
attributes = handleChange(element, $$props)
|
12
|
+
}
|
10
13
|
</script>
|
11
14
|
|
12
|
-
<prosekit-autocomplete-empty {
|
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;
|
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,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
|
-
|
6
|
+
let attributes: Record<string, unknown> = {}
|
7
|
+
let element: HTMLElement | undefined = undefined
|
8
|
+
const handleChange = useWebComponent(defaultAutocompleteItemProps)
|
6
9
|
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
+
$: {
|
11
|
+
attributes = handleChange(element, $$props)
|
12
|
+
}
|
10
13
|
</script>
|
11
14
|
|
12
|
-
<prosekit-autocomplete-item {
|
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;
|
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,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
|
-
|
6
|
+
let attributes: Record<string, unknown> = {}
|
7
|
+
let element: HTMLElement | undefined = undefined
|
8
|
+
const handleChange = useWebComponent(defaultAutocompleteListProps)
|
6
9
|
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
+
$: {
|
11
|
+
attributes = handleChange(element, $$props)
|
12
|
+
}
|
10
13
|
</script>
|
11
14
|
|
12
|
-
<prosekit-autocomplete-list {
|
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;
|
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,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
|
-
|
6
|
+
let attributes: Record<string, unknown> = {}
|
7
|
+
let element: HTMLElement | undefined = undefined
|
8
|
+
const handleChange = useWebComponent(defaultAutocompletePopoverProps)
|
6
9
|
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
+
$: {
|
11
|
+
attributes = handleChange(element, $$props)
|
12
|
+
}
|
10
13
|
</script>
|
11
14
|
|
12
|
-
<prosekit-autocomplete-popover {
|
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;
|
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,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
|
-
|
6
|
+
let attributes: Record<string, unknown> = {}
|
7
|
+
let element: HTMLElement | undefined = undefined
|
8
|
+
const handleChange = useWebComponent(defaultBlockDragHandleProps)
|
6
9
|
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
+
$: {
|
11
|
+
attributes = handleChange(element, $$props)
|
12
|
+
}
|
10
13
|
</script>
|
11
14
|
|
12
|
-
<prosekit-block-drag-handle {
|
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;
|
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,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
|
-
|
6
|
+
let attributes: Record<string, unknown> = {}
|
7
|
+
let element: HTMLElement | undefined = undefined
|
8
|
+
const handleChange = useWebComponent(defaultBlockPopoverProps)
|
6
9
|
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
+
$: {
|
11
|
+
attributes = handleChange(element, $$props)
|
12
|
+
}
|
10
13
|
</script>
|
11
14
|
|
12
|
-
<prosekit-block-popover {
|
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;
|
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,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
|
-
|
6
|
+
let attributes: Record<string, unknown> = {}
|
7
|
+
let element: HTMLElement | undefined = undefined
|
8
|
+
const handleChange = useWebComponent(defaultInlinePopoverProps)
|
6
9
|
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
+
$: {
|
11
|
+
attributes = handleChange(element, $$props)
|
12
|
+
}
|
10
13
|
</script>
|
11
14
|
|
12
|
-
<prosekit-inline-popover {
|
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;
|
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"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/node-view-consumer/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,QAAQ,CAAA;AAI7C;;GAEG;AACH,eAAO,MAAM,gBAAgB,EAAW,OAAO,eAAe,CAC5D,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,CACtB,CAAA"}
|
@@ -0,0 +1,15 @@
|
|
1
|
+
<script lang="ts">
|
2
|
+
import {
|
3
|
+
useNodeViewFactory,
|
4
|
+
type NodeViewFactory,
|
5
|
+
} from '@prosemirror-adapter/svelte'
|
6
|
+
import { readable } from 'svelte/store'
|
7
|
+
import { useExtension } from '../../hooks/use-extension'
|
8
|
+
import { defineSvelteNodeViewFactory } from '../../node-view/define-svelte-node-view-factory'
|
9
|
+
|
10
|
+
const nodeViewFactory: NodeViewFactory = useNodeViewFactory()
|
11
|
+
const extension = defineSvelteNodeViewFactory(nodeViewFactory)
|
12
|
+
useExtension(readable(extension))
|
13
|
+
</script>
|
14
|
+
|
15
|
+
<slot />
|
@@ -0,0 +1,17 @@
|
|
1
|
+
import { SvelteComponentTyped } from "svelte";
|
2
|
+
declare const __propDef: {
|
3
|
+
props: Record<string, never>;
|
4
|
+
events: {
|
5
|
+
[evt: string]: CustomEvent<any>;
|
6
|
+
};
|
7
|
+
slots: {
|
8
|
+
default: {};
|
9
|
+
};
|
10
|
+
};
|
11
|
+
export type NodeViewConsumerProps = typeof __propDef.props;
|
12
|
+
export type NodeViewConsumerEvents = typeof __propDef.events;
|
13
|
+
export type NodeViewConsumerSlots = typeof __propDef.slots;
|
14
|
+
export default class NodeViewConsumer extends SvelteComponentTyped<NodeViewConsumerProps, NodeViewConsumerEvents, NodeViewConsumerSlots> {
|
15
|
+
}
|
16
|
+
export {};
|
17
|
+
//# sourceMappingURL=node-view-consumer.svelte.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"node-view-consumer.svelte.d.ts","sourceRoot":"","sources":["../../../../../src/components/node-view-consumer/node-view-consumer.svelte"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,QAAQ,CAE5C;AAwBD,QAAA,MAAM,SAAS;;;;;;;;CAAwC,CAAC;AACxD,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"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/node-view-wrapper/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,QAAQ,CAAA;AAE7C,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,uBAAuB,CAAA;AAIpE,eAAO,MAAM,eAAe,EAAW,OAAO,eAAe,CAAC;IAC5D,SAAS,EAAE,uBAAuB,CAAA;CACnC,CAAC,CAAA"}
|
@@ -0,0 +1,20 @@
|
|
1
|
+
<script lang="ts">
|
2
|
+
import { useNodeViewContext } from '@prosemirror-adapter/svelte'
|
3
|
+
import type { SvelteNodeViewProps } from '../../node-view/types'
|
4
|
+
import type { SvelteComponent } from 'svelte'
|
5
|
+
|
6
|
+
export let component: SvelteComponent<SvelteNodeViewProps>
|
7
|
+
|
8
|
+
const nodeViewProps: SvelteNodeViewProps = {
|
9
|
+
contentRef: useNodeViewContext('contentRef'),
|
10
|
+
view: useNodeViewContext('view'),
|
11
|
+
getPos: useNodeViewContext('getPos'),
|
12
|
+
setAttrs: useNodeViewContext('setAttrs'),
|
13
|
+
node: useNodeViewContext('node'),
|
14
|
+
selected: useNodeViewContext('selected'),
|
15
|
+
decorations: useNodeViewContext('decorations'),
|
16
|
+
innerDecorations: useNodeViewContext('innerDecorations'),
|
17
|
+
}
|
18
|
+
</script>
|
19
|
+
|
20
|
+
<svelte:component this={component} {...nodeViewProps} />
|
@@ -0,0 +1,19 @@
|
|
1
|
+
import { SvelteComponentTyped } from "svelte";
|
2
|
+
import type { SvelteNodeViewProps } from '../../node-view/types';
|
3
|
+
import type { SvelteComponent } from 'svelte';
|
4
|
+
declare const __propDef: {
|
5
|
+
props: {
|
6
|
+
component: SvelteComponent<SvelteNodeViewProps>;
|
7
|
+
};
|
8
|
+
events: {
|
9
|
+
[evt: string]: CustomEvent<any>;
|
10
|
+
};
|
11
|
+
slots: {};
|
12
|
+
};
|
13
|
+
export type NodeViewWrapperProps = typeof __propDef.props;
|
14
|
+
export type NodeViewWrapperEvents = typeof __propDef.events;
|
15
|
+
export type NodeViewWrapperSlots = typeof __propDef.slots;
|
16
|
+
export default class NodeViewWrapper extends SvelteComponentTyped<NodeViewWrapperProps, NodeViewWrapperEvents, NodeViewWrapperSlots> {
|
17
|
+
}
|
18
|
+
export {};
|
19
|
+
//# sourceMappingURL=node-view-wrapper.svelte.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"node-view-wrapper.svelte.d.ts","sourceRoot":"","sources":["../../../../../src/components/node-view-wrapper/node-view-wrapper.svelte"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,QAAQ,CAE5C;AAED,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAA;AAChE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,QAAQ,CAAA;AAyB7C,QAAA,MAAM,SAAS;;mBADuC,eAAe,CAAC,mBAAmB,CAAC;;;;;;CACnC,CAAC;AACxD,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,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
|
-
|
6
|
+
let attributes: Record<string, unknown> = {}
|
7
|
+
let element: HTMLElement | undefined = undefined
|
8
|
+
const handleChange = useWebComponent(defaultPopoverContentProps)
|
6
9
|
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
+
$: {
|
11
|
+
attributes = handleChange(element, $$props)
|
12
|
+
}
|
10
13
|
</script>
|
11
14
|
|
12
|
-
<prosekit-popover-content {
|
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;
|
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,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
|
-
|
6
|
+
let attributes: Record<string, unknown> = {}
|
7
|
+
let element: HTMLElement | undefined = undefined
|
8
|
+
const handleChange = useWebComponent(defaultPopoverRootProps)
|
6
9
|
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
+
$: {
|
11
|
+
attributes = handleChange(element, $$props)
|
12
|
+
}
|
10
13
|
</script>
|
11
14
|
|
12
|
-
<prosekit-popover-root {
|
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;
|
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,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
|
-
|
6
|
+
let attributes: Record<string, unknown> = {}
|
7
|
+
let element: HTMLElement | undefined = undefined
|
8
|
+
const handleChange = useWebComponent(defaultPopoverTriggerProps)
|
6
9
|
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
+
$: {
|
11
|
+
attributes = handleChange(element, $$props)
|
12
|
+
}
|
10
13
|
</script>
|
11
14
|
|
12
|
-
<prosekit-popover-trigger {
|
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;
|
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"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/prosekit/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAA;AAC5C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,QAAQ,CAAA;AAI7C,MAAM,WAAW,aAAa;IAC5B,MAAM,EAAE,MAAM,CAAA;CACf;AAED;;;;GAIG;AACH,eAAO,MAAM,QAAQ,EACoB,OAAO,eAAe,CAAC,aAAa,CAAC,CAAA"}
|
@@ -0,0 +1,14 @@
|
|
1
|
+
<script lang="ts">
|
2
|
+
import type { Editor } from '@prosekit/core'
|
3
|
+
import { useProsemirrorAdapterProvider } from '@prosemirror-adapter/svelte'
|
4
|
+
import { setEditorContext } from '../../contexts/editor-context'
|
5
|
+
import { NodeViewConsumer } from '../node-view-consumer'
|
6
|
+
|
7
|
+
export let editor: Editor
|
8
|
+
|
9
|
+
setEditorContext(editor)
|
10
|
+
useProsemirrorAdapterProvider()
|
11
|
+
</script>
|
12
|
+
|
13
|
+
<slot />
|
14
|
+
<NodeViewConsumer />
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"prosekit.svelte.d.ts","sourceRoot":"","sources":["../../../../../src/components/prosekit/prosekit.svelte"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,QAAQ,CAE5C;AACD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAA;AAsB5C,QAAA,MAAM,SAAS;;gBAD8B,MAAM;;;;;;;;CACI,CAAC;AACxD,MAAM,MAAM,aAAa,GAAG,OAAO,SAAS,CAAC,KAAK,CAAC;AACnD,MAAM,MAAM,cAAc,GAAG,OAAO,SAAS,CAAC,MAAM,CAAC;AACrD,MAAM,MAAM,aAAa,GAAG,OAAO,SAAS,CAAC,KAAK,CAAC;AAEnD,MAAM,CAAC,OAAO,OAAO,QAAS,SAAQ,oBAAoB,CAAC,aAAa,EAAE,cAAc,EAAE,aAAa,CAAC;CACvG"}
|
@@ -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
|
-
|
6
|
+
let attributes: Record<string, unknown> = {}
|
7
|
+
let element: HTMLElement | undefined = undefined
|
8
|
+
const handleChange = useWebComponent(defaultResizableHandleProps)
|
6
9
|
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
+
$: {
|
11
|
+
attributes = handleChange(element, $$props)
|
12
|
+
}
|
10
13
|
</script>
|
11
14
|
|
12
|
-
<prosekit-resizable-handle {
|
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;
|
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,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
|
-
|
6
|
+
let attributes: Record<string, unknown> = {}
|
7
|
+
let element: HTMLElement | undefined = undefined
|
8
|
+
const handleChange = useWebComponent(defaultResizableRootProps)
|
6
9
|
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
+
$: {
|
11
|
+
attributes = handleChange(element, $$props)
|
12
|
+
}
|
10
13
|
</script>
|
11
14
|
|
12
|
-
<prosekit-resizable-root {
|
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;
|
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,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
|
-
|
6
|
+
let attributes: Record<string, unknown> = {}
|
7
|
+
let element: HTMLElement | undefined = undefined
|
8
|
+
const handleChange = useWebComponent(defaultTooltipContentProps)
|
6
9
|
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
+
$: {
|
11
|
+
attributes = handleChange(element, $$props)
|
12
|
+
}
|
10
13
|
</script>
|
11
14
|
|
12
|
-
<prosekit-tooltip-content {
|
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;
|
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,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
|
-
|
6
|
+
let attributes: Record<string, unknown> = {}
|
7
|
+
let element: HTMLElement | undefined = undefined
|
8
|
+
const handleChange = useWebComponent(defaultTooltipRootProps)
|
6
9
|
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
+
$: {
|
11
|
+
attributes = handleChange(element, $$props)
|
12
|
+
}
|
10
13
|
</script>
|
11
14
|
|
12
|
-
<prosekit-tooltip-root {
|
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;
|
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,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
|
-
|
6
|
+
let attributes: Record<string, unknown> = {}
|
7
|
+
let element: HTMLElement | undefined = undefined
|
8
|
+
const handleChange = useWebComponent(defaultTooltipTriggerProps)
|
6
9
|
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
+
$: {
|
11
|
+
attributes = handleChange(element, $$props)
|
12
|
+
}
|
10
13
|
</script>
|
11
14
|
|
12
|
-
<prosekit-tooltip-trigger {
|
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;
|
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"}
|
package/dist/build/index.d.ts
CHANGED
@@ -1,8 +1,10 @@
|
|
1
|
-
export { ProseKit } from './components/prosekit';
|
1
|
+
export { ProseKit, type ProseKitProps } from './components/prosekit';
|
2
|
+
export { useDocChange } from './hooks/use-doc-change';
|
2
3
|
export { useEditor } from './hooks/use-editor';
|
3
4
|
export { useExtension, type UseExtensionOptions } from './hooks/use-extension';
|
4
5
|
export { useKeymap } from './hooks/use-keymap';
|
5
6
|
export { useStateUpdate } from './hooks/use-state-update';
|
6
|
-
export {
|
7
|
+
export { defineSvelteNodeView } from './node-view/define-svelte-node-view';
|
8
|
+
export type { SvelteNodeViewComponent, SvelteNodeViewOptions, SvelteNodeViewProps, } from './node-view/types';
|
7
9
|
export type { PropsWithClass } from './types';
|
8
10
|
//# sourceMappingURL=index.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAA;
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,KAAK,aAAa,EAAE,MAAM,uBAAuB,CAAA;AACpE,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAA;AACrD,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAA;AAC9C,OAAO,EAAE,YAAY,EAAE,KAAK,mBAAmB,EAAE,MAAM,uBAAuB,CAAA;AAC9E,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAA;AAC9C,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAA;AACzD,OAAO,EAAE,oBAAoB,EAAE,MAAM,qCAAqC,CAAA;AAC1E,YAAY,EACV,uBAAuB,EACvB,qBAAqB,EACrB,mBAAmB,GACpB,MAAM,mBAAmB,CAAA;AAC1B,YAAY,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA"}
|
package/dist/build/index.js
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
export { ProseKit } from './components/prosekit';
|
2
|
+
export { useDocChange } from './hooks/use-doc-change';
|
2
3
|
export { useEditor } from './hooks/use-editor';
|
3
4
|
export { useExtension } from './hooks/use-extension';
|
4
5
|
export { useKeymap } from './hooks/use-keymap';
|
5
6
|
export { useStateUpdate } from './hooks/use-state-update';
|
6
|
-
export {
|
7
|
+
export { defineSvelteNodeView } from './node-view/define-svelte-node-view';
|
@@ -0,0 +1,4 @@
|
|
1
|
+
import type { NodeViewConstructor } from '@prosekit/pm/view';
|
2
|
+
import type { SvelteNodeViewUserOptions } from '@prosemirror-adapter/svelte';
|
3
|
+
export declare function defineSvelteNodeViewFactory(factory: (options: SvelteNodeViewUserOptions) => NodeViewConstructor): import("@prosekit/core").Extension<import("@prosekit/core").ExtensionTyping<any, any, any>>;
|
4
|
+
//# sourceMappingURL=define-svelte-node-view-factory.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"define-svelte-node-view-factory.d.ts","sourceRoot":"","sources":["../../../../src/node-view/define-svelte-node-view-factory.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAA;AAC5D,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAA;AAE5E,wBAAgB,2BAA2B,CACzC,OAAO,EAAE,CAAC,OAAO,EAAE,yBAAyB,KAAK,mBAAmB,+FAMrE"}
|
@@ -0,0 +1,9 @@
|
|
1
|
+
import { type Extension } from '@prosekit/core';
|
2
|
+
import type { SvelteNodeViewOptions } from './types';
|
3
|
+
/**
|
4
|
+
* Defines a node view using a Svelte component.
|
5
|
+
*
|
6
|
+
* @public
|
7
|
+
*/
|
8
|
+
export declare function defineSvelteNodeView(options: SvelteNodeViewOptions): Extension;
|
9
|
+
//# sourceMappingURL=define-svelte-node-view.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"define-svelte-node-view.d.ts","sourceRoot":"","sources":["../../../../src/node-view/define-svelte-node-view.ts"],"names":[],"mappings":"AAAA,OAAO,EAA2B,KAAK,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAMxE,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAA;AAEpD;;;;GAIG;AACH,wBAAgB,oBAAoB,CAClC,OAAO,EAAE,qBAAqB,GAC7B,SAAS,CAoBX"}
|
@@ -0,0 +1,26 @@
|
|
1
|
+
import { defineNodeViewComponent } from '@prosekit/core';
|
2
|
+
import { NodeViewWrapper } from '../components/node-view-wrapper';
|
3
|
+
/**
|
4
|
+
* Defines a node view using a Svelte component.
|
5
|
+
*
|
6
|
+
* @public
|
7
|
+
*/
|
8
|
+
export function defineSvelteNodeView(options) {
|
9
|
+
const { name, component, ...userOptions } = options;
|
10
|
+
const args = {
|
11
|
+
...userOptions,
|
12
|
+
component: class NodeViewPropsWrapper extends NodeViewWrapper {
|
13
|
+
constructor(options) {
|
14
|
+
super({
|
15
|
+
...options,
|
16
|
+
props: { ...options.props, component },
|
17
|
+
});
|
18
|
+
}
|
19
|
+
},
|
20
|
+
};
|
21
|
+
return defineNodeViewComponent({
|
22
|
+
group: 'svelte',
|
23
|
+
name,
|
24
|
+
args,
|
25
|
+
});
|
26
|
+
}
|
@@ -0,0 +1,38 @@
|
|
1
|
+
import type { BaseNodeViewOptions } from '@prosekit/core';
|
2
|
+
import type { Attrs, ProseMirrorNode } from '@prosekit/pm/model';
|
3
|
+
import type { Decoration, DecorationSource, EditorView } from '@prosekit/pm/view';
|
4
|
+
import type { ComponentType, SvelteComponent } from 'svelte';
|
5
|
+
import type { Writable } from 'svelte/store';
|
6
|
+
/**
|
7
|
+
* @public
|
8
|
+
*/
|
9
|
+
export interface SvelteNodeViewProps {
|
10
|
+
contentRef: (node: HTMLElement | null) => void;
|
11
|
+
view: EditorView;
|
12
|
+
getPos: () => number | undefined;
|
13
|
+
setAttrs: (attrs: Attrs) => void;
|
14
|
+
node: Writable<ProseMirrorNode>;
|
15
|
+
selected: Writable<boolean>;
|
16
|
+
decorations: Writable<readonly Decoration[]>;
|
17
|
+
innerDecorations: Writable<DecorationSource>;
|
18
|
+
}
|
19
|
+
/**
|
20
|
+
* @public
|
21
|
+
*/
|
22
|
+
export type SvelteNodeViewComponent = ComponentType<SvelteComponent<SvelteNodeViewProps>>;
|
23
|
+
/**
|
24
|
+
* Options for {@link defineSvelteNodeView}.
|
25
|
+
*
|
26
|
+
* @public
|
27
|
+
*/
|
28
|
+
export interface SvelteNodeViewOptions extends BaseNodeViewOptions {
|
29
|
+
/**
|
30
|
+
* The name of the node type.
|
31
|
+
*/
|
32
|
+
name: string;
|
33
|
+
/**
|
34
|
+
* The Svelte component to render the node.
|
35
|
+
*/
|
36
|
+
component: SvelteNodeViewComponent;
|
37
|
+
}
|
38
|
+
//# sourceMappingURL=types.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/node-view/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAA;AACzD,OAAO,KAAK,EAAE,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAA;AAChE,OAAO,KAAK,EACV,UAAU,EACV,gBAAgB,EAChB,UAAU,EACX,MAAM,mBAAmB,CAAA;AAC1B,OAAO,KAAK,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,QAAQ,CAAA;AAC5D,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAA;AAE5C;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAElC,UAAU,EAAE,CAAC,IAAI,EAAE,WAAW,GAAG,IAAI,KAAK,IAAI,CAAA;IAC9C,IAAI,EAAE,UAAU,CAAA;IAChB,MAAM,EAAE,MAAM,MAAM,GAAG,SAAS,CAAA;IAChC,QAAQ,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAA;IAGhC,IAAI,EAAE,QAAQ,CAAC,eAAe,CAAC,CAAA;IAC/B,QAAQ,EAAE,QAAQ,CAAC,OAAO,CAAC,CAAA;IAC3B,WAAW,EAAE,QAAQ,CAAC,SAAS,UAAU,EAAE,CAAC,CAAA;IAC5C,gBAAgB,EAAE,QAAQ,CAAC,gBAAgB,CAAC,CAAA;CAC7C;AAED;;GAEG;AACH,MAAM,MAAM,uBAAuB,GAAG,aAAa,CACjD,eAAe,CAAC,mBAAmB,CAAC,CACrC,CAAA;AAED;;;;GAIG;AACH,MAAM,WAAW,qBAAsB,SAAQ,mBAAmB;IAChE;;OAEG;IACH,IAAI,EAAE,MAAM,CAAA;IAEZ;;OAEG;IACH,SAAS,EAAE,uBAAuB,CAAA;CACnC"}
|
@@ -0,0 +1 @@
|
|
1
|
+
export {};
|
@@ -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
|
+
"version": "0.4.1",
|
5
5
|
"private": false,
|
6
6
|
"author": {
|
7
7
|
"name": "ocavue",
|
@@ -71,9 +71,10 @@
|
|
71
71
|
"dist"
|
72
72
|
],
|
73
73
|
"dependencies": {
|
74
|
+
"@prosemirror-adapter/svelte": "^0.2.6",
|
74
75
|
"@prosekit/core": "^0.7.1",
|
75
|
-
"@prosekit/
|
76
|
-
"@prosekit/
|
76
|
+
"@prosekit/web": "^0.2.3",
|
77
|
+
"@prosekit/pm": "^0.1.5"
|
77
78
|
},
|
78
79
|
"peerDependencies": {
|
79
80
|
"svelte": ">= 3.0.0"
|
@@ -85,7 +86,7 @@
|
|
85
86
|
},
|
86
87
|
"devDependencies": {
|
87
88
|
"@sveltejs/package": "^2.3.2",
|
88
|
-
"@types/node": "^20.14.
|
89
|
+
"@types/node": "^20.14.10",
|
89
90
|
"read-pkg": "^9.0.1",
|
90
91
|
"svelte": "^4.2.18",
|
91
92
|
"svelte-check": "^3.8.4",
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"prosekit.d.ts","sourceRoot":"","sources":["../../../../src/components/prosekit.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAA;AAC5C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,QAAQ,CAAA;AAI7C,MAAM,WAAW,aAAa;IAC5B,MAAM,EAAE,MAAM,CAAA;CACf;AAED;;;;GAIG;AACH,eAAO,MAAM,QAAQ,EACiC,OAAO,eAAe,CAAC,aAAa,CAAC,CAAA"}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"prosekit.svelte.d.ts","sourceRoot":"","sources":["../../../../src/components/prosekit.svelte"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,QAAQ,CAE5C;AACD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAA;AAgB5C,QAAA,MAAM,SAAS;;gBAD8B,MAAM;;;;;;;;CACI,CAAC;AACxD,MAAM,MAAM,aAAa,GAAG,OAAO,SAAS,CAAC,KAAK,CAAC;AACnD,MAAM,MAAM,cAAc,GAAG,OAAO,SAAS,CAAC,MAAM,CAAC;AACrD,MAAM,MAAM,aAAa,GAAG,OAAO,SAAS,CAAC,KAAK,CAAC;AAEnD,MAAM,CAAC,OAAO,OAAO,QAAS,SAAQ,oBAAoB,CAAC,aAAa,EAAE,cAAc,EAAE,aAAa,CAAC;CACvG"}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"remove-undefined.d.ts","sourceRoot":"","sources":["../../../../src/utils/remove-undefined.ts"],"names":[],"mappings":"AACA,wBAAgB,eAAe,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,CAQ5E"}
|
File without changes
|