prosekit-registry 0.0.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/LICENSE +21 -0
- package/README.md +241 -0
- package/dist/r/lit-example-minimal.json +36 -0
- package/dist/r/lit-example-slash-menu.json +55 -0
- package/dist/r/lit-example-table.json +56 -0
- package/dist/r/lit-example-toolbar.json +60 -0
- package/dist/r/lit-sample-sample-doc-table.json +29 -0
- package/dist/r/lit-sample-sample-uploader.json +29 -0
- package/dist/r/lit-ui-button.json +36 -0
- package/dist/r/lit-ui-editor-context.json +30 -0
- package/dist/r/lit-ui-image-upload-popover.json +42 -0
- package/dist/r/lit-ui-slash-menu.json +56 -0
- package/dist/r/lit-ui-table-handle.json +47 -0
- package/dist/r/lit-ui-toolbar.json +55 -0
- package/dist/r/preact-example-block-handle.json +60 -0
- package/dist/r/preact-example-blockquote.json +53 -0
- package/dist/r/preact-example-bold.json +56 -0
- package/dist/r/preact-example-change-tracking.json +50 -0
- package/dist/r/preact-example-code-block-themes.json +66 -0
- package/dist/r/preact-example-code-block.json +60 -0
- package/dist/r/preact-example-code.json +56 -0
- package/dist/r/preact-example-drop-cursor.json +48 -0
- package/dist/r/preact-example-emoji-rules.json +50 -0
- package/dist/r/preact-example-full.json +106 -0
- package/dist/r/preact-example-gap-cursor.json +48 -0
- package/dist/r/preact-example-hard-break.json +59 -0
- package/dist/r/preact-example-heading.json +56 -0
- package/dist/r/preact-example-horizontal-rule.json +53 -0
- package/dist/r/preact-example-image-view.json +55 -0
- package/dist/r/preact-example-inline-menu.json +54 -0
- package/dist/r/preact-example-italic.json +56 -0
- package/dist/r/preact-example-keymap.json +63 -0
- package/dist/r/preact-example-link-mark-view.json +55 -0
- package/dist/r/preact-example-link.json +54 -0
- package/dist/r/preact-example-list-custom-checkbox.json +63 -0
- package/dist/r/preact-example-list.json +56 -0
- package/dist/r/preact-example-loro.json +62 -0
- package/dist/r/preact-example-mark-rule.json +50 -0
- package/dist/r/preact-example-minimal.json +36 -0
- package/dist/r/preact-example-page.json +49 -0
- package/dist/r/preact-example-placeholder.json +43 -0
- package/dist/r/preact-example-readonly.json +66 -0
- package/dist/r/preact-example-rtl.json +74 -0
- package/dist/r/preact-example-save-html.json +36 -0
- package/dist/r/preact-example-save-json.json +36 -0
- package/dist/r/preact-example-save-markdown.json +50 -0
- package/dist/r/preact-example-search.json +54 -0
- package/dist/r/preact-example-slash-menu.json +51 -0
- package/dist/r/preact-example-strike.json +59 -0
- package/dist/r/preact-example-table.json +52 -0
- package/dist/r/preact-example-temml.json +51 -0
- package/dist/r/preact-example-text-align.json +59 -0
- package/dist/r/preact-example-text-color.json +59 -0
- package/dist/r/preact-example-toolbar.json +56 -0
- package/dist/r/preact-example-typography.json +59 -0
- package/dist/r/preact-example-underline.json +56 -0
- package/dist/r/preact-example-unmount.json +58 -0
- package/dist/r/preact-example-user-menu-dynamic.json +67 -0
- package/dist/r/preact-example-user-menu.json +59 -0
- package/dist/r/preact-example-view-adapter.json +58 -0
- package/dist/r/preact-example-word-counter.json +52 -0
- package/dist/r/preact-example-yjs.json +62 -0
- package/dist/r/preact-sample-define-atom-block.json +29 -0
- package/dist/r/preact-sample-katex.json +29 -0
- package/dist/r/preact-sample-sample-doc-block-handle.json +29 -0
- package/dist/r/preact-sample-sample-doc-bold.json +29 -0
- package/dist/r/preact-sample-sample-doc-code-block.json +29 -0
- package/dist/r/preact-sample-sample-doc-code.json +29 -0
- package/dist/r/preact-sample-sample-doc-drop-cursor.json +29 -0
- package/dist/r/preact-sample-sample-doc-full.json +29 -0
- package/dist/r/preact-sample-sample-doc-gap-cursor.json +29 -0
- package/dist/r/preact-sample-sample-doc-hard-break.json +29 -0
- package/dist/r/preact-sample-sample-doc-heading.json +29 -0
- package/dist/r/preact-sample-sample-doc-image.json +29 -0
- package/dist/r/preact-sample-sample-doc-inline-menu.json +29 -0
- package/dist/r/preact-sample-sample-doc-italic.json +29 -0
- package/dist/r/preact-sample-sample-doc-link-mark-view.json +29 -0
- package/dist/r/preact-sample-sample-doc-link.json +29 -0
- package/dist/r/preact-sample-sample-doc-list-custom-checkbox.json +29 -0
- package/dist/r/preact-sample-sample-doc-list.json +29 -0
- package/dist/r/preact-sample-sample-doc-page.json +29 -0
- package/dist/r/preact-sample-sample-doc-readonly.json +29 -0
- package/dist/r/preact-sample-sample-doc-rtl.json +29 -0
- package/dist/r/preact-sample-sample-doc-search.json +29 -0
- package/dist/r/preact-sample-sample-doc-strike.json +29 -0
- package/dist/r/preact-sample-sample-doc-table.json +29 -0
- package/dist/r/preact-sample-sample-doc-tex.json +29 -0
- package/dist/r/preact-sample-sample-doc-text-align.json +29 -0
- package/dist/r/preact-sample-sample-doc-text-color.json +29 -0
- package/dist/r/preact-sample-sample-doc-typography.json +29 -0
- package/dist/r/preact-sample-sample-doc-underline.json +29 -0
- package/dist/r/preact-sample-sample-doc-view-adapter.json +29 -0
- package/dist/r/preact-sample-sample-doc-word-counter.json +29 -0
- package/dist/r/preact-sample-sample-query-users.json +32 -0
- package/dist/r/preact-sample-sample-tag-data.json +27 -0
- package/dist/r/preact-sample-sample-uploader.json +29 -0
- package/dist/r/preact-sample-sample-user-data.json +27 -0
- package/dist/r/preact-sample-temml.json +29 -0
- package/dist/r/preact-ui-block-handle.json +41 -0
- package/dist/r/preact-ui-button.json +36 -0
- package/dist/r/preact-ui-code-block-view.json +36 -0
- package/dist/r/preact-ui-drop-indicator.json +36 -0
- package/dist/r/preact-ui-image-upload-popover.json +42 -0
- package/dist/r/preact-ui-image-view.json +41 -0
- package/dist/r/preact-ui-inline-menu.json +47 -0
- package/dist/r/preact-ui-search.json +47 -0
- package/dist/r/preact-ui-slash-menu.json +50 -0
- package/dist/r/preact-ui-table-handle.json +41 -0
- package/dist/r/preact-ui-tag-menu.json +36 -0
- package/dist/r/preact-ui-toolbar.json +51 -0
- package/dist/r/preact-ui-user-menu.json +36 -0
- package/dist/r/preact-ui-word-counter.json +36 -0
- package/dist/r/react-example-block-handle.json +60 -0
- package/dist/r/react-example-blockquote.json +53 -0
- package/dist/r/react-example-bold.json +56 -0
- package/dist/r/react-example-change-tracking.json +50 -0
- package/dist/r/react-example-code-block-themes.json +66 -0
- package/dist/r/react-example-code-block.json +60 -0
- package/dist/r/react-example-code.json +56 -0
- package/dist/r/react-example-drop-cursor.json +48 -0
- package/dist/r/react-example-emoji-rules.json +50 -0
- package/dist/r/react-example-full.json +113 -0
- package/dist/r/react-example-gap-cursor.json +48 -0
- package/dist/r/react-example-hard-break.json +59 -0
- package/dist/r/react-example-heading.json +56 -0
- package/dist/r/react-example-horizontal-rule.json +53 -0
- package/dist/r/react-example-image-view.json +55 -0
- package/dist/r/react-example-inline-menu.json +54 -0
- package/dist/r/react-example-italic.json +56 -0
- package/dist/r/react-example-keymap.json +63 -0
- package/dist/r/react-example-link-mark-view.json +55 -0
- package/dist/r/react-example-link.json +54 -0
- package/dist/r/react-example-list-custom-checkbox.json +63 -0
- package/dist/r/react-example-list.json +56 -0
- package/dist/r/react-example-loro.json +62 -0
- package/dist/r/react-example-mark-rule.json +50 -0
- package/dist/r/react-example-minimal.json +36 -0
- package/dist/r/react-example-notion.json +166 -0
- package/dist/r/react-example-page.json +62 -0
- package/dist/r/react-example-placeholder.json +43 -0
- package/dist/r/react-example-readonly.json +66 -0
- package/dist/r/react-example-rtl.json +74 -0
- package/dist/r/react-example-save-html.json +36 -0
- package/dist/r/react-example-save-json.json +36 -0
- package/dist/r/react-example-save-markdown.json +50 -0
- package/dist/r/react-example-search.json +54 -0
- package/dist/r/react-example-slash-menu.json +51 -0
- package/dist/r/react-example-strike.json +59 -0
- package/dist/r/react-example-table.json +52 -0
- package/dist/r/react-example-temml.json +51 -0
- package/dist/r/react-example-text-align.json +59 -0
- package/dist/r/react-example-text-color.json +59 -0
- package/dist/r/react-example-toolbar.json +56 -0
- package/dist/r/react-example-tweet.json +63 -0
- package/dist/r/react-example-typography.json +59 -0
- package/dist/r/react-example-underline.json +56 -0
- package/dist/r/react-example-unmount.json +58 -0
- package/dist/r/react-example-user-menu-dynamic.json +67 -0
- package/dist/r/react-example-user-menu.json +59 -0
- package/dist/r/react-example-view-adapter.json +58 -0
- package/dist/r/react-example-word-counter.json +52 -0
- package/dist/r/react-example-yjs.json +62 -0
- package/dist/r/react-sample-define-atom-block.json +29 -0
- package/dist/r/react-sample-katex.json +29 -0
- package/dist/r/react-sample-sample-doc-block-handle.json +29 -0
- package/dist/r/react-sample-sample-doc-bold.json +29 -0
- package/dist/r/react-sample-sample-doc-code-block.json +29 -0
- package/dist/r/react-sample-sample-doc-code.json +29 -0
- package/dist/r/react-sample-sample-doc-drop-cursor.json +29 -0
- package/dist/r/react-sample-sample-doc-full.json +29 -0
- package/dist/r/react-sample-sample-doc-gap-cursor.json +29 -0
- package/dist/r/react-sample-sample-doc-hard-break.json +29 -0
- package/dist/r/react-sample-sample-doc-heading.json +29 -0
- package/dist/r/react-sample-sample-doc-image.json +29 -0
- package/dist/r/react-sample-sample-doc-inline-menu.json +29 -0
- package/dist/r/react-sample-sample-doc-italic.json +29 -0
- package/dist/r/react-sample-sample-doc-link-mark-view.json +29 -0
- package/dist/r/react-sample-sample-doc-link.json +29 -0
- package/dist/r/react-sample-sample-doc-list-custom-checkbox.json +29 -0
- package/dist/r/react-sample-sample-doc-list.json +29 -0
- package/dist/r/react-sample-sample-doc-notion.json +29 -0
- package/dist/r/react-sample-sample-doc-page.json +29 -0
- package/dist/r/react-sample-sample-doc-readonly.json +29 -0
- package/dist/r/react-sample-sample-doc-rtl.json +29 -0
- package/dist/r/react-sample-sample-doc-search.json +29 -0
- package/dist/r/react-sample-sample-doc-strike.json +29 -0
- package/dist/r/react-sample-sample-doc-table.json +29 -0
- package/dist/r/react-sample-sample-doc-tex.json +29 -0
- package/dist/r/react-sample-sample-doc-text-align.json +29 -0
- package/dist/r/react-sample-sample-doc-text-color.json +29 -0
- package/dist/r/react-sample-sample-doc-tweet.json +29 -0
- package/dist/r/react-sample-sample-doc-typography.json +29 -0
- package/dist/r/react-sample-sample-doc-underline.json +29 -0
- package/dist/r/react-sample-sample-doc-view-adapter.json +29 -0
- package/dist/r/react-sample-sample-doc-word-counter.json +29 -0
- package/dist/r/react-sample-sample-query-users.json +32 -0
- package/dist/r/react-sample-sample-tag-data.json +27 -0
- package/dist/r/react-sample-sample-uploader.json +29 -0
- package/dist/r/react-sample-sample-user-data.json +27 -0
- package/dist/r/react-sample-temml.json +29 -0
- package/dist/r/react-ui-block-handle.json +41 -0
- package/dist/r/react-ui-button.json +36 -0
- package/dist/r/react-ui-code-block-view.json +36 -0
- package/dist/r/react-ui-drop-indicator.json +36 -0
- package/dist/r/react-ui-image-upload-popover.json +42 -0
- package/dist/r/react-ui-image-view.json +41 -0
- package/dist/r/react-ui-inline-menu.json +47 -0
- package/dist/r/react-ui-search.json +47 -0
- package/dist/r/react-ui-slash-menu.json +50 -0
- package/dist/r/react-ui-table-handle.json +41 -0
- package/dist/r/react-ui-tag-menu.json +36 -0
- package/dist/r/react-ui-toolbar.json +51 -0
- package/dist/r/react-ui-user-menu.json +36 -0
- package/dist/r/react-ui-word-counter.json +36 -0
- package/dist/r/registry.json +20642 -0
- package/dist/r/solid-example-block-handle.json +60 -0
- package/dist/r/solid-example-blockquote.json +53 -0
- package/dist/r/solid-example-bold.json +56 -0
- package/dist/r/solid-example-change-tracking.json +50 -0
- package/dist/r/solid-example-code-block-themes.json +66 -0
- package/dist/r/solid-example-code-block.json +60 -0
- package/dist/r/solid-example-code.json +56 -0
- package/dist/r/solid-example-drop-cursor.json +48 -0
- package/dist/r/solid-example-emoji-rules.json +50 -0
- package/dist/r/solid-example-full.json +106 -0
- package/dist/r/solid-example-gap-cursor.json +48 -0
- package/dist/r/solid-example-hard-break.json +59 -0
- package/dist/r/solid-example-heading.json +56 -0
- package/dist/r/solid-example-horizontal-rule.json +53 -0
- package/dist/r/solid-example-image-view.json +55 -0
- package/dist/r/solid-example-inline-menu.json +54 -0
- package/dist/r/solid-example-italic.json +56 -0
- package/dist/r/solid-example-keymap.json +63 -0
- package/dist/r/solid-example-link-mark-view.json +55 -0
- package/dist/r/solid-example-link.json +54 -0
- package/dist/r/solid-example-list-custom-checkbox.json +63 -0
- package/dist/r/solid-example-list.json +56 -0
- package/dist/r/solid-example-loro.json +62 -0
- package/dist/r/solid-example-mark-rule.json +50 -0
- package/dist/r/solid-example-minimal.json +36 -0
- package/dist/r/solid-example-placeholder.json +43 -0
- package/dist/r/solid-example-readonly.json +66 -0
- package/dist/r/solid-example-rtl.json +74 -0
- package/dist/r/solid-example-save-html.json +36 -0
- package/dist/r/solid-example-save-json.json +36 -0
- package/dist/r/solid-example-save-markdown.json +50 -0
- package/dist/r/solid-example-search.json +54 -0
- package/dist/r/solid-example-slash-menu.json +51 -0
- package/dist/r/solid-example-strike.json +59 -0
- package/dist/r/solid-example-table.json +52 -0
- package/dist/r/solid-example-temml.json +51 -0
- package/dist/r/solid-example-text-align.json +59 -0
- package/dist/r/solid-example-text-color.json +59 -0
- package/dist/r/solid-example-toolbar.json +56 -0
- package/dist/r/solid-example-typography.json +59 -0
- package/dist/r/solid-example-underline.json +56 -0
- package/dist/r/solid-example-unmount.json +58 -0
- package/dist/r/solid-example-user-menu-dynamic.json +67 -0
- package/dist/r/solid-example-user-menu.json +59 -0
- package/dist/r/solid-example-view-adapter.json +58 -0
- package/dist/r/solid-example-word-counter.json +52 -0
- package/dist/r/solid-example-yjs.json +62 -0
- package/dist/r/solid-sample-define-atom-block.json +29 -0
- package/dist/r/solid-sample-katex.json +29 -0
- package/dist/r/solid-sample-sample-doc-block-handle.json +29 -0
- package/dist/r/solid-sample-sample-doc-bold.json +29 -0
- package/dist/r/solid-sample-sample-doc-code-block.json +29 -0
- package/dist/r/solid-sample-sample-doc-code.json +29 -0
- package/dist/r/solid-sample-sample-doc-drop-cursor.json +29 -0
- package/dist/r/solid-sample-sample-doc-full.json +29 -0
- package/dist/r/solid-sample-sample-doc-gap-cursor.json +29 -0
- package/dist/r/solid-sample-sample-doc-hard-break.json +29 -0
- package/dist/r/solid-sample-sample-doc-heading.json +29 -0
- package/dist/r/solid-sample-sample-doc-image.json +29 -0
- package/dist/r/solid-sample-sample-doc-inline-menu.json +29 -0
- package/dist/r/solid-sample-sample-doc-italic.json +29 -0
- package/dist/r/solid-sample-sample-doc-link-mark-view.json +29 -0
- package/dist/r/solid-sample-sample-doc-link.json +29 -0
- package/dist/r/solid-sample-sample-doc-list-custom-checkbox.json +29 -0
- package/dist/r/solid-sample-sample-doc-list.json +29 -0
- package/dist/r/solid-sample-sample-doc-readonly.json +29 -0
- package/dist/r/solid-sample-sample-doc-rtl.json +29 -0
- package/dist/r/solid-sample-sample-doc-search.json +29 -0
- package/dist/r/solid-sample-sample-doc-strike.json +29 -0
- package/dist/r/solid-sample-sample-doc-table.json +29 -0
- package/dist/r/solid-sample-sample-doc-tex.json +29 -0
- package/dist/r/solid-sample-sample-doc-text-align.json +29 -0
- package/dist/r/solid-sample-sample-doc-text-color.json +29 -0
- package/dist/r/solid-sample-sample-doc-typography.json +29 -0
- package/dist/r/solid-sample-sample-doc-underline.json +29 -0
- package/dist/r/solid-sample-sample-doc-view-adapter.json +29 -0
- package/dist/r/solid-sample-sample-doc-word-counter.json +29 -0
- package/dist/r/solid-sample-sample-query-users.json +32 -0
- package/dist/r/solid-sample-sample-tag-data.json +27 -0
- package/dist/r/solid-sample-sample-uploader.json +29 -0
- package/dist/r/solid-sample-sample-user-data.json +27 -0
- package/dist/r/solid-sample-temml.json +29 -0
- package/dist/r/solid-ui-block-handle.json +41 -0
- package/dist/r/solid-ui-button.json +36 -0
- package/dist/r/solid-ui-code-block-view.json +36 -0
- package/dist/r/solid-ui-drop-indicator.json +36 -0
- package/dist/r/solid-ui-image-upload-popover.json +42 -0
- package/dist/r/solid-ui-image-view.json +41 -0
- package/dist/r/solid-ui-inline-menu.json +47 -0
- package/dist/r/solid-ui-search.json +47 -0
- package/dist/r/solid-ui-slash-menu.json +50 -0
- package/dist/r/solid-ui-table-handle.json +41 -0
- package/dist/r/solid-ui-tag-menu.json +36 -0
- package/dist/r/solid-ui-toolbar.json +51 -0
- package/dist/r/solid-ui-user-menu.json +36 -0
- package/dist/r/solid-ui-word-counter.json +36 -0
- package/dist/r/svelte-example-block-handle.json +60 -0
- package/dist/r/svelte-example-blockquote.json +53 -0
- package/dist/r/svelte-example-bold.json +56 -0
- package/dist/r/svelte-example-change-tracking.json +50 -0
- package/dist/r/svelte-example-code-block-themes.json +66 -0
- package/dist/r/svelte-example-code-block.json +60 -0
- package/dist/r/svelte-example-code.json +56 -0
- package/dist/r/svelte-example-drop-cursor.json +48 -0
- package/dist/r/svelte-example-emoji-rules.json +50 -0
- package/dist/r/svelte-example-full.json +106 -0
- package/dist/r/svelte-example-gap-cursor.json +48 -0
- package/dist/r/svelte-example-hard-break.json +59 -0
- package/dist/r/svelte-example-heading.json +56 -0
- package/dist/r/svelte-example-horizontal-rule.json +53 -0
- package/dist/r/svelte-example-image-view.json +55 -0
- package/dist/r/svelte-example-inline-menu.json +54 -0
- package/dist/r/svelte-example-italic.json +56 -0
- package/dist/r/svelte-example-katex.json +51 -0
- package/dist/r/svelte-example-keymap.json +56 -0
- package/dist/r/svelte-example-link-mark-view.json +55 -0
- package/dist/r/svelte-example-link.json +54 -0
- package/dist/r/svelte-example-list-custom-checkbox.json +63 -0
- package/dist/r/svelte-example-list.json +56 -0
- package/dist/r/svelte-example-loro.json +62 -0
- package/dist/r/svelte-example-mark-rule.json +50 -0
- package/dist/r/svelte-example-minimal.json +36 -0
- package/dist/r/svelte-example-page.json +62 -0
- package/dist/r/svelte-example-placeholder.json +43 -0
- package/dist/r/svelte-example-readonly.json +59 -0
- package/dist/r/svelte-example-rtl.json +74 -0
- package/dist/r/svelte-example-save-html.json +36 -0
- package/dist/r/svelte-example-save-json.json +36 -0
- package/dist/r/svelte-example-save-markdown.json +50 -0
- package/dist/r/svelte-example-search.json +54 -0
- package/dist/r/svelte-example-slash-menu.json +51 -0
- package/dist/r/svelte-example-strike.json +59 -0
- package/dist/r/svelte-example-table.json +52 -0
- package/dist/r/svelte-example-text-align.json +59 -0
- package/dist/r/svelte-example-text-color.json +59 -0
- package/dist/r/svelte-example-toolbar.json +56 -0
- package/dist/r/svelte-example-typography.json +59 -0
- package/dist/r/svelte-example-underline.json +56 -0
- package/dist/r/svelte-example-unmount.json +58 -0
- package/dist/r/svelte-example-user-menu-dynamic.json +67 -0
- package/dist/r/svelte-example-user-menu.json +59 -0
- package/dist/r/svelte-example-view-adapter.json +58 -0
- package/dist/r/svelte-example-word-counter.json +52 -0
- package/dist/r/svelte-example-yjs.json +62 -0
- package/dist/r/svelte-sample-define-atom-block.json +29 -0
- package/dist/r/svelte-sample-katex.json +29 -0
- package/dist/r/svelte-sample-sample-doc-block-handle.json +29 -0
- package/dist/r/svelte-sample-sample-doc-bold.json +29 -0
- package/dist/r/svelte-sample-sample-doc-code-block.json +29 -0
- package/dist/r/svelte-sample-sample-doc-code.json +29 -0
- package/dist/r/svelte-sample-sample-doc-drop-cursor.json +29 -0
- package/dist/r/svelte-sample-sample-doc-full.json +29 -0
- package/dist/r/svelte-sample-sample-doc-gap-cursor.json +29 -0
- package/dist/r/svelte-sample-sample-doc-hard-break.json +29 -0
- package/dist/r/svelte-sample-sample-doc-heading.json +29 -0
- package/dist/r/svelte-sample-sample-doc-image.json +29 -0
- package/dist/r/svelte-sample-sample-doc-inline-menu.json +29 -0
- package/dist/r/svelte-sample-sample-doc-italic.json +29 -0
- package/dist/r/svelte-sample-sample-doc-link-mark-view.json +29 -0
- package/dist/r/svelte-sample-sample-doc-link.json +29 -0
- package/dist/r/svelte-sample-sample-doc-list-custom-checkbox.json +29 -0
- package/dist/r/svelte-sample-sample-doc-list.json +29 -0
- package/dist/r/svelte-sample-sample-doc-page.json +29 -0
- package/dist/r/svelte-sample-sample-doc-readonly.json +29 -0
- package/dist/r/svelte-sample-sample-doc-rtl.json +29 -0
- package/dist/r/svelte-sample-sample-doc-search.json +29 -0
- package/dist/r/svelte-sample-sample-doc-strike.json +29 -0
- package/dist/r/svelte-sample-sample-doc-table.json +29 -0
- package/dist/r/svelte-sample-sample-doc-tex.json +29 -0
- package/dist/r/svelte-sample-sample-doc-text-align.json +29 -0
- package/dist/r/svelte-sample-sample-doc-text-color.json +29 -0
- package/dist/r/svelte-sample-sample-doc-typography.json +29 -0
- package/dist/r/svelte-sample-sample-doc-underline.json +29 -0
- package/dist/r/svelte-sample-sample-doc-view-adapter.json +29 -0
- package/dist/r/svelte-sample-sample-doc-word-counter.json +29 -0
- package/dist/r/svelte-sample-sample-query-users.json +32 -0
- package/dist/r/svelte-sample-sample-tag-data.json +27 -0
- package/dist/r/svelte-sample-sample-uploader.json +29 -0
- package/dist/r/svelte-sample-sample-user-data.json +27 -0
- package/dist/r/svelte-ui-block-handle.json +41 -0
- package/dist/r/svelte-ui-button.json +36 -0
- package/dist/r/svelte-ui-code-block-view.json +36 -0
- package/dist/r/svelte-ui-drop-indicator.json +36 -0
- package/dist/r/svelte-ui-image-upload-popover.json +42 -0
- package/dist/r/svelte-ui-image-view.json +41 -0
- package/dist/r/svelte-ui-inline-menu.json +47 -0
- package/dist/r/svelte-ui-search.json +47 -0
- package/dist/r/svelte-ui-slash-menu.json +50 -0
- package/dist/r/svelte-ui-table-handle.json +41 -0
- package/dist/r/svelte-ui-tag-menu.json +36 -0
- package/dist/r/svelte-ui-toolbar.json +51 -0
- package/dist/r/svelte-ui-user-menu.json +36 -0
- package/dist/r/svelte-ui-word-counter.json +36 -0
- package/dist/r/vanilla-example-minimal.json +36 -0
- package/dist/r/vanilla-example-slash-menu.json +51 -0
- package/dist/r/vanilla-ui-slash-menu.json +50 -0
- package/dist/r/vue-example-block-handle.json +60 -0
- package/dist/r/vue-example-blockquote.json +53 -0
- package/dist/r/vue-example-bold.json +56 -0
- package/dist/r/vue-example-change-tracking.json +50 -0
- package/dist/r/vue-example-code-block-themes.json +66 -0
- package/dist/r/vue-example-code-block.json +60 -0
- package/dist/r/vue-example-code.json +56 -0
- package/dist/r/vue-example-drop-cursor.json +48 -0
- package/dist/r/vue-example-emoji-rules.json +50 -0
- package/dist/r/vue-example-full.json +106 -0
- package/dist/r/vue-example-gap-cursor.json +48 -0
- package/dist/r/vue-example-hard-break.json +59 -0
- package/dist/r/vue-example-heading.json +56 -0
- package/dist/r/vue-example-horizontal-rule.json +53 -0
- package/dist/r/vue-example-image-view.json +55 -0
- package/dist/r/vue-example-inline-menu.json +54 -0
- package/dist/r/vue-example-italic.json +56 -0
- package/dist/r/vue-example-katex.json +51 -0
- package/dist/r/vue-example-keymap.json +63 -0
- package/dist/r/vue-example-link-mark-view.json +55 -0
- package/dist/r/vue-example-link.json +54 -0
- package/dist/r/vue-example-list-custom-checkbox.json +63 -0
- package/dist/r/vue-example-list.json +56 -0
- package/dist/r/vue-example-loro.json +62 -0
- package/dist/r/vue-example-mark-rule.json +50 -0
- package/dist/r/vue-example-minimal.json +36 -0
- package/dist/r/vue-example-placeholder.json +43 -0
- package/dist/r/vue-example-readonly.json +66 -0
- package/dist/r/vue-example-rtl.json +74 -0
- package/dist/r/vue-example-save-html.json +36 -0
- package/dist/r/vue-example-save-json.json +36 -0
- package/dist/r/vue-example-save-markdown.json +50 -0
- package/dist/r/vue-example-search.json +54 -0
- package/dist/r/vue-example-slash-menu.json +51 -0
- package/dist/r/vue-example-strike.json +59 -0
- package/dist/r/vue-example-table.json +52 -0
- package/dist/r/vue-example-text-align.json +59 -0
- package/dist/r/vue-example-text-color.json +59 -0
- package/dist/r/vue-example-toolbar.json +56 -0
- package/dist/r/vue-example-tweet.json +63 -0
- package/dist/r/vue-example-typography.json +59 -0
- package/dist/r/vue-example-underline.json +56 -0
- package/dist/r/vue-example-unmount.json +58 -0
- package/dist/r/vue-example-user-menu-dynamic.json +67 -0
- package/dist/r/vue-example-user-menu.json +59 -0
- package/dist/r/vue-example-view-adapter.json +58 -0
- package/dist/r/vue-example-word-counter.json +52 -0
- package/dist/r/vue-example-yjs.json +62 -0
- package/dist/r/vue-sample-define-atom-block.json +29 -0
- package/dist/r/vue-sample-katex.json +29 -0
- package/dist/r/vue-sample-sample-doc-block-handle.json +29 -0
- package/dist/r/vue-sample-sample-doc-bold.json +29 -0
- package/dist/r/vue-sample-sample-doc-code-block.json +29 -0
- package/dist/r/vue-sample-sample-doc-code.json +29 -0
- package/dist/r/vue-sample-sample-doc-drop-cursor.json +29 -0
- package/dist/r/vue-sample-sample-doc-full.json +29 -0
- package/dist/r/vue-sample-sample-doc-gap-cursor.json +29 -0
- package/dist/r/vue-sample-sample-doc-hard-break.json +29 -0
- package/dist/r/vue-sample-sample-doc-heading.json +29 -0
- package/dist/r/vue-sample-sample-doc-image.json +29 -0
- package/dist/r/vue-sample-sample-doc-inline-menu.json +29 -0
- package/dist/r/vue-sample-sample-doc-italic.json +29 -0
- package/dist/r/vue-sample-sample-doc-link-mark-view.json +29 -0
- package/dist/r/vue-sample-sample-doc-link.json +29 -0
- package/dist/r/vue-sample-sample-doc-list-custom-checkbox.json +29 -0
- package/dist/r/vue-sample-sample-doc-list.json +29 -0
- package/dist/r/vue-sample-sample-doc-readonly.json +29 -0
- package/dist/r/vue-sample-sample-doc-rtl.json +29 -0
- package/dist/r/vue-sample-sample-doc-search.json +29 -0
- package/dist/r/vue-sample-sample-doc-strike.json +29 -0
- package/dist/r/vue-sample-sample-doc-table.json +29 -0
- package/dist/r/vue-sample-sample-doc-tex.json +29 -0
- package/dist/r/vue-sample-sample-doc-text-align.json +29 -0
- package/dist/r/vue-sample-sample-doc-text-color.json +29 -0
- package/dist/r/vue-sample-sample-doc-tweet.json +29 -0
- package/dist/r/vue-sample-sample-doc-typography.json +29 -0
- package/dist/r/vue-sample-sample-doc-underline.json +29 -0
- package/dist/r/vue-sample-sample-doc-view-adapter.json +29 -0
- package/dist/r/vue-sample-sample-doc-word-counter.json +29 -0
- package/dist/r/vue-sample-sample-query-users.json +32 -0
- package/dist/r/vue-sample-sample-tag-data.json +27 -0
- package/dist/r/vue-sample-sample-uploader.json +29 -0
- package/dist/r/vue-sample-sample-user-data.json +27 -0
- package/dist/r/vue-ui-block-handle.json +41 -0
- package/dist/r/vue-ui-button.json +36 -0
- package/dist/r/vue-ui-code-block-view.json +36 -0
- package/dist/r/vue-ui-drop-indicator.json +36 -0
- package/dist/r/vue-ui-image-upload-popover.json +42 -0
- package/dist/r/vue-ui-image-view.json +41 -0
- package/dist/r/vue-ui-inline-menu.json +47 -0
- package/dist/r/vue-ui-search.json +47 -0
- package/dist/r/vue-ui-slash-menu.json +50 -0
- package/dist/r/vue-ui-table-handle.json +41 -0
- package/dist/r/vue-ui-tag-menu.json +36 -0
- package/dist/r/vue-ui-toolbar.json +51 -0
- package/dist/r/vue-ui-user-menu.json +36 -0
- package/dist/r/vue-ui-word-counter.json +36 -0
- package/package.json +353 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2023 ocavue
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,241 @@
|
|
|
1
|
+
# ProseKit Registry
|
|
2
|
+
|
|
3
|
+
The registry contains framework examples and shared UI components. Source files are organized in `registry/src`, with dedicated directories for each supported framework: `react`, `vue`, `svelte`, `solid`, and `preact`.
|
|
4
|
+
|
|
5
|
+
## Common Guidelines
|
|
6
|
+
|
|
7
|
+
### Same DOM Across Frameworks
|
|
8
|
+
|
|
9
|
+
All framework implementations of the same example must render identical DOM structures.
|
|
10
|
+
|
|
11
|
+
### No Props Destructuring
|
|
12
|
+
|
|
13
|
+
Avoid destructuring component props across all frameworks. Destructuring breaks reactivity in frameworks like Solid. Maintaining consistent syntax across frameworks also improves code maintainability.
|
|
14
|
+
|
|
15
|
+
**Correct:**
|
|
16
|
+
|
|
17
|
+
```tsx
|
|
18
|
+
function Foo(props: FooProps) {
|
|
19
|
+
return <div>{props.foo}</div>;
|
|
20
|
+
}
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
**Incorrect:**
|
|
24
|
+
|
|
25
|
+
```tsx
|
|
26
|
+
function Foo({ foo }: FooProps) {
|
|
27
|
+
return <div>{foo}</div>;
|
|
28
|
+
}
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
### Union Call Convention
|
|
32
|
+
|
|
33
|
+
The `union` function should be called with individual arguments, not an array.
|
|
34
|
+
|
|
35
|
+
**Correct:**
|
|
36
|
+
|
|
37
|
+
```ts
|
|
38
|
+
return union(defineBasicExtension(), defineCodeBlockView());
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
**Incorrect:**
|
|
42
|
+
|
|
43
|
+
```ts
|
|
44
|
+
return union([defineBasicExtension(), defineCodeBlockView()]);
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
### Default Content Location
|
|
48
|
+
|
|
49
|
+
To provide default content for an example, create a file at `registry/src/<framework>/sample/sample-doc-<example-name>.ts` and export the content using the following format:
|
|
50
|
+
|
|
51
|
+
```ts
|
|
52
|
+
import type { NodeJSON } from "prosekit/core";
|
|
53
|
+
|
|
54
|
+
export const sampleContent: NodeJSON = {
|
|
55
|
+
/* ... */
|
|
56
|
+
};
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
### 'use client' Directive
|
|
60
|
+
|
|
61
|
+
Only use the `'use client'` directive in React framework index files. Do not use it in Vue, Svelte, Solid, Preact, or other frameworks as it is specific to React Server Components.
|
|
62
|
+
|
|
63
|
+
## Vue-Specific Guidelines
|
|
64
|
+
|
|
65
|
+
### Event Handlers
|
|
66
|
+
|
|
67
|
+
Use `@event-name` syntax instead of `:on-event-name` for event handlers in Vue templates.
|
|
68
|
+
|
|
69
|
+
**Good:**
|
|
70
|
+
|
|
71
|
+
```
|
|
72
|
+
<Component @query-change="handleQueryChange" />
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
**Bad:**
|
|
76
|
+
|
|
77
|
+
```
|
|
78
|
+
<Component :on-query-change="handleQueryChange" />
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
### Props Declaration
|
|
82
|
+
|
|
83
|
+
Use `const props = defineProps<Props>()` to declare component props. This provides better clarity and consistency with other frameworks' patterns.
|
|
84
|
+
|
|
85
|
+
**Good:**
|
|
86
|
+
|
|
87
|
+
```vue
|
|
88
|
+
<script setup lang="ts">
|
|
89
|
+
interface Props {
|
|
90
|
+
name: string
|
|
91
|
+
age?: number
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
const props = defineProps<Props>()
|
|
95
|
+
</script>
|
|
96
|
+
|
|
97
|
+
<template>
|
|
98
|
+
<div>{{ props.name }}</div>
|
|
99
|
+
</template>
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
**Bad:**
|
|
103
|
+
|
|
104
|
+
```vue
|
|
105
|
+
<script setup lang="ts">
|
|
106
|
+
interface Props {
|
|
107
|
+
name: string
|
|
108
|
+
age?: number
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
defineProps<Props>()
|
|
112
|
+
</script>
|
|
113
|
+
|
|
114
|
+
<template>
|
|
115
|
+
<div>{{ name }}</div>
|
|
116
|
+
</template>
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
### Side Effects with Cleanup
|
|
120
|
+
|
|
121
|
+
Prefer `watchEffect` over `watch` to track reactive dependencies automatically.
|
|
122
|
+
|
|
123
|
+
**Good:**
|
|
124
|
+
|
|
125
|
+
```ts
|
|
126
|
+
watchEffect((onCleanup) => {
|
|
127
|
+
const value = valueRef.value;
|
|
128
|
+
// do something with value
|
|
129
|
+
onCleanup(() => {
|
|
130
|
+
// cleanup logic
|
|
131
|
+
});
|
|
132
|
+
});
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
**Bad:**
|
|
136
|
+
|
|
137
|
+
```ts
|
|
138
|
+
watch([valueRef], (newValue, oldValue, onCleanup) => {
|
|
139
|
+
// do something with newValue
|
|
140
|
+
onCleanup(() => {
|
|
141
|
+
// cleanup logic
|
|
142
|
+
});
|
|
143
|
+
});
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
## Svelte-Specific Guidelines
|
|
147
|
+
|
|
148
|
+
### Syntax
|
|
149
|
+
|
|
150
|
+
Use Svelte v5 runes syntax (`$state`, `$derived`, `$props`, `$effect`) instead of legacy syntax.
|
|
151
|
+
|
|
152
|
+
**Good:**
|
|
153
|
+
|
|
154
|
+
```svelte
|
|
155
|
+
<script lang="ts">
|
|
156
|
+
interface Props {
|
|
157
|
+
name: string;
|
|
158
|
+
}
|
|
159
|
+
const props: Props = $props();
|
|
160
|
+
let count = $state(0);
|
|
161
|
+
let doubled = $derived(count * 2);
|
|
162
|
+
</script>
|
|
163
|
+
|
|
164
|
+
<div>{props.name} {doubled}</div>
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
**Bad:**
|
|
168
|
+
|
|
169
|
+
```svelte
|
|
170
|
+
<script lang="ts">
|
|
171
|
+
export let name = 'World';
|
|
172
|
+
let count = 0;
|
|
173
|
+
$: doubled = count * 2;
|
|
174
|
+
</script>
|
|
175
|
+
|
|
176
|
+
<div>{name} {doubled}</div>
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
## Solid-Specific Guidelines
|
|
180
|
+
|
|
181
|
+
### Use `attr:` for data attributes
|
|
182
|
+
|
|
183
|
+
Use `attr:` for data attributes
|
|
184
|
+
|
|
185
|
+
**Good:**
|
|
186
|
+
|
|
187
|
+
```tsx
|
|
188
|
+
<SolidComponent
|
|
189
|
+
attr:data-testid="test-id"
|
|
190
|
+
attr:data-selected={selected ? "" : undefined}
|
|
191
|
+
/>
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
**Bad:**
|
|
195
|
+
|
|
196
|
+
```tsx
|
|
197
|
+
<SolidComponent
|
|
198
|
+
data-testid="test-id"
|
|
199
|
+
data-selected={selected ? "" : undefined}
|
|
200
|
+
/>
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
### Explicitly specify the return type of components
|
|
204
|
+
|
|
205
|
+
**Good:**
|
|
206
|
+
|
|
207
|
+
```tsx
|
|
208
|
+
import type { JSX } from 'solid-js'
|
|
209
|
+
|
|
210
|
+
export default function Foo(): JSX.Element {
|
|
211
|
+
return <div>Foo</div>
|
|
212
|
+
}
|
|
213
|
+
```
|
|
214
|
+
|
|
215
|
+
**Bad:**
|
|
216
|
+
|
|
217
|
+
```tsx
|
|
218
|
+
export default function Foo() {
|
|
219
|
+
return <div>Foo</div>
|
|
220
|
+
}
|
|
221
|
+
```
|
|
222
|
+
|
|
223
|
+
### Use `For` instead of `.map()`
|
|
224
|
+
|
|
225
|
+
**Good:**
|
|
226
|
+
|
|
227
|
+
```tsx
|
|
228
|
+
<div>
|
|
229
|
+
<For each={items}>
|
|
230
|
+
{(item) => <div>{item}</div>}
|
|
231
|
+
</For>
|
|
232
|
+
</div>
|
|
233
|
+
```
|
|
234
|
+
|
|
235
|
+
**Bad:**
|
|
236
|
+
|
|
237
|
+
```tsx
|
|
238
|
+
<div>{items.map((item) => (
|
|
239
|
+
<div>{item}</div>)
|
|
240
|
+
)}</div>
|
|
241
|
+
```
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "lit-example-minimal",
|
|
3
|
+
"title": "lit-example-minimal",
|
|
4
|
+
"type": "registry:block",
|
|
5
|
+
"description": "Minimal editor setup with basic functionality.",
|
|
6
|
+
"registryDependencies": [],
|
|
7
|
+
"dependencies": [
|
|
8
|
+
"prosekit"
|
|
9
|
+
],
|
|
10
|
+
"files": [
|
|
11
|
+
{
|
|
12
|
+
"path": "registry/src/lit/examples/minimal/editor.ts",
|
|
13
|
+
"type": "registry:component",
|
|
14
|
+
"target": "components/editor/examples/minimal/editor.ts",
|
|
15
|
+
"content": "import 'prosekit/basic/style.css'\nimport 'prosekit/basic/typography.css'\n\nimport { html, LitElement, type PropertyDeclaration, type PropertyValues } from 'lit'\nimport { createRef, ref, type Ref } from 'lit/directives/ref.js'\nimport { defineBasicExtension } from 'prosekit/basic'\nimport type { Editor } from 'prosekit/core'\nimport { createEditor } from 'prosekit/core'\n\nexport class LitEditor extends LitElement {\n static override properties = {\n editor: { state: true, attribute: false } satisfies PropertyDeclaration<Editor>,\n }\n\n private editor: Editor\n private ref: Ref<HTMLDivElement>\n\n constructor() {\n super()\n\n const extension = defineBasicExtension()\n this.editor = createEditor({ extension })\n this.ref = createRef<HTMLDivElement>()\n }\n\n override createRenderRoot() {\n return this\n }\n\n override disconnectedCallback() {\n this.editor.unmount()\n super.disconnectedCallback()\n }\n\n override updated(changedProperties: PropertyValues) {\n super.updated(changedProperties)\n this.editor.mount(this.ref.value)\n }\n\n override render() {\n return html`<div class=\"outline-solid p-4\" ${ref(this.ref)}></div>`\n }\n}\n\nexport function registerLitEditor() {\n if (customElements.get('lit-editor-example-minimal')) return\n customElements.define('lit-editor-example-minimal', LitEditor)\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'lit-editor-example-minimal': LitEditor\n }\n}\n"
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
"path": "registry/src/lit/examples/minimal/index.ts",
|
|
19
|
+
"type": "registry:component",
|
|
20
|
+
"target": "components/editor/examples/minimal/index.ts",
|
|
21
|
+
"content": "export { LitEditor as ExampleEditor, registerLitEditor } from './editor'\n"
|
|
22
|
+
}
|
|
23
|
+
],
|
|
24
|
+
"meta": {
|
|
25
|
+
"hasIcons": false,
|
|
26
|
+
"hidden": false,
|
|
27
|
+
"story": "minimal",
|
|
28
|
+
"framework": "lit",
|
|
29
|
+
"accumulatedFiles": [
|
|
30
|
+
"registry/src/lit/examples/minimal/editor.ts",
|
|
31
|
+
"registry/src/lit/examples/minimal/index.ts"
|
|
32
|
+
],
|
|
33
|
+
"internalDependencies": []
|
|
34
|
+
},
|
|
35
|
+
"$schema": "https://ui.shadcn.com/schema/registry-item.json"
|
|
36
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "lit-example-slash-menu",
|
|
3
|
+
"title": "lit-example-slash-menu",
|
|
4
|
+
"type": "registry:block",
|
|
5
|
+
"description": "Command menu triggered by typing slash (/).",
|
|
6
|
+
"registryDependencies": [
|
|
7
|
+
"https://prosekit.dev/r/lit-ui-editor-context.json",
|
|
8
|
+
"https://prosekit.dev/r/lit-ui-slash-menu.json"
|
|
9
|
+
],
|
|
10
|
+
"dependencies": [
|
|
11
|
+
"@lit/context",
|
|
12
|
+
"prosekit"
|
|
13
|
+
],
|
|
14
|
+
"files": [
|
|
15
|
+
{
|
|
16
|
+
"path": "registry/src/lit/examples/slash-menu/editor.ts",
|
|
17
|
+
"type": "registry:component",
|
|
18
|
+
"target": "components/editor/examples/slash-menu/editor.ts",
|
|
19
|
+
"content": "import 'prosekit/basic/style.css'\nimport 'prosekit/basic/typography.css'\n\nimport '../../ui/slash-menu/index'\n\nimport { ContextProvider } from '@lit/context'\nimport { html, LitElement, type PropertyDeclaration, type PropertyValues } from 'lit'\nimport { createRef, ref, type Ref } from 'lit/directives/ref.js'\nimport type { Editor } from 'prosekit/core'\nimport { createEditor } from 'prosekit/core'\n\nimport { editorContext } from '../../ui/editor-context'\n\nimport { defineExtension } from './extension'\n\nexport class LitEditor extends LitElement {\n static override properties = {\n editor: {\n state: true,\n attribute: false,\n } satisfies PropertyDeclaration<Editor>,\n }\n\n private editor: Editor\n private ref: Ref<HTMLDivElement>\n constructor() {\n super()\n\n const extension = defineExtension()\n this.editor = createEditor({ extension })\n this.ref = createRef<HTMLDivElement>()\n new ContextProvider(this, {\n context: editorContext,\n initialValue: this.editor,\n })\n }\n\n override createRenderRoot() {\n return this\n }\n\n override disconnectedCallback() {\n this.editor.unmount()\n super.disconnectedCallback()\n }\n\n override updated(changedProperties: PropertyValues) {\n super.updated(changedProperties)\n this.editor.mount(this.ref.value)\n }\n\n override render() {\n return html`<div class=\"box-border h-full w-full min-h-36 overflow-y-hidden overflow-x-hidden rounded-md border border-solid border-gray-200 dark:border-gray-700 shadow-sm flex flex-col bg-white dark:bg-gray-950 text-black dark:text-white\">\n <div class=\"relative w-full flex-1 box-border overflow-y-auto\">\n <div ${ref(this.ref)} class=\"ProseMirror box-border min-h-full px-[max(4rem,calc(50%-20rem))] py-8 outline-hidden outline-0 [&_span[data-mention=user]]:text-blue-500 [&_span[data-mention=tag]]:text-violet-500\"></div>\n <lit-editor-slash-menu style=\"display: contents;\"></lit-editor-slash-menu>\n </div>\n </div>`\n }\n}\n\nexport function registerLitEditor() {\n if (customElements.get('lit-editor-example-slash-menu')) return\n customElements.define('lit-editor-example-slash-menu', LitEditor)\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'lit-editor-example-slash-menu': LitEditor\n }\n}\n"
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
"path": "registry/src/lit/examples/slash-menu/extension.ts",
|
|
23
|
+
"type": "registry:component",
|
|
24
|
+
"target": "components/editor/examples/slash-menu/extension.ts",
|
|
25
|
+
"content": "import { defineBasicExtension } from 'prosekit/basic'\nimport { union } from 'prosekit/core'\nimport { definePlaceholder } from 'prosekit/extensions/placeholder'\n\nexport function defineExtension() {\n return union(\n defineBasicExtension(),\n definePlaceholder({ placeholder: 'Press / for commands...' }),\n )\n}\n\nexport type EditorExtension = ReturnType<typeof defineExtension>\n"
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
"path": "registry/src/lit/examples/slash-menu/index.ts",
|
|
29
|
+
"type": "registry:component",
|
|
30
|
+
"target": "components/editor/examples/slash-menu/index.ts",
|
|
31
|
+
"content": "export { LitEditor as ExampleEditor, registerLitEditor } from './editor'\n"
|
|
32
|
+
}
|
|
33
|
+
],
|
|
34
|
+
"meta": {
|
|
35
|
+
"hasIcons": false,
|
|
36
|
+
"hidden": false,
|
|
37
|
+
"story": "slash-menu",
|
|
38
|
+
"framework": "lit",
|
|
39
|
+
"accumulatedFiles": [
|
|
40
|
+
"registry/src/lit/examples/slash-menu/editor.ts",
|
|
41
|
+
"registry/src/lit/examples/slash-menu/extension.ts",
|
|
42
|
+
"registry/src/lit/examples/slash-menu/index.ts",
|
|
43
|
+
"registry/src/lit/ui/editor-context.ts",
|
|
44
|
+
"registry/src/lit/ui/slash-menu/index.ts",
|
|
45
|
+
"registry/src/lit/ui/slash-menu/slash-menu-empty.ts",
|
|
46
|
+
"registry/src/lit/ui/slash-menu/slash-menu-item.ts",
|
|
47
|
+
"registry/src/lit/ui/slash-menu/slash-menu.ts"
|
|
48
|
+
],
|
|
49
|
+
"internalDependencies": [
|
|
50
|
+
"lit-ui-editor-context",
|
|
51
|
+
"lit-ui-slash-menu"
|
|
52
|
+
]
|
|
53
|
+
},
|
|
54
|
+
"$schema": "https://ui.shadcn.com/schema/registry-item.json"
|
|
55
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "lit-example-table",
|
|
3
|
+
"title": "lit-example-table",
|
|
4
|
+
"type": "registry:block",
|
|
5
|
+
"description": "Table node with row and column operations.",
|
|
6
|
+
"registryDependencies": [
|
|
7
|
+
"https://prosekit.dev/r/lit-sample-sample-doc-table.json",
|
|
8
|
+
"https://prosekit.dev/r/lit-ui-editor-context.json",
|
|
9
|
+
"https://prosekit.dev/r/lit-ui-table-handle.json"
|
|
10
|
+
],
|
|
11
|
+
"dependencies": [
|
|
12
|
+
"@lit/context",
|
|
13
|
+
"prosekit"
|
|
14
|
+
],
|
|
15
|
+
"files": [
|
|
16
|
+
{
|
|
17
|
+
"path": "registry/src/lit/examples/table/editor.ts",
|
|
18
|
+
"type": "registry:component",
|
|
19
|
+
"target": "components/editor/examples/table/editor.ts",
|
|
20
|
+
"content": "import 'prosekit/basic/style.css'\nimport 'prosekit/basic/typography.css'\n\nimport '../../ui/table-handle/index'\n\nimport { ContextProvider } from '@lit/context'\nimport { html, LitElement, type PropertyDeclaration, type PropertyValues } from 'lit'\nimport { createRef, ref, type Ref } from 'lit/directives/ref.js'\nimport type { Editor } from 'prosekit/core'\nimport { createEditor } from 'prosekit/core'\n\nimport { sampleContent } from '../../sample/sample-doc-table'\nimport { editorContext } from '../../ui/editor-context'\n\nimport { defineExtension } from './extension'\n\nexport class LitEditor extends LitElement {\n static override properties = {\n editor: { state: true, attribute: false } satisfies PropertyDeclaration<Editor>,\n }\n\n private editor: Editor\n private ref: Ref<HTMLDivElement>\n constructor() {\n super()\n\n const extension = defineExtension()\n this.editor = createEditor({ extension, defaultContent: sampleContent })\n this.ref = createRef<HTMLDivElement>()\n new ContextProvider(this, {\n context: editorContext,\n initialValue: this.editor,\n })\n }\n\n override createRenderRoot() {\n return this\n }\n\n override updated(changedProperties: PropertyValues) {\n super.updated(changedProperties)\n this.editor.mount(this.ref.value)\n }\n\n override render() {\n return html`<div class=\"box-border h-full w-full min-h-36 overflow-y-hidden overflow-x-hidden rounded-md border border-solid border-gray-200 dark:border-gray-700 shadow-sm flex flex-col bg-white dark:bg-gray-950 text-black dark:text-white\">\n <div class=\"relative w-full flex-1 box-border overflow-y-auto\">\n <div ${ref(this.ref)} class=\"ProseMirror box-border min-h-full px-[max(4rem,calc(50%-20rem))] py-8 outline-hidden outline-0 [&_span[data-mention=user]]:text-blue-500 [&_span[data-mention=tag]]:text-violet-500\"></div>\n <lit-editor-table-handle></lit-editor-table-handle>\n </div>\n </div>`\n }\n}\n\nexport function registerLitEditor() {\n if (customElements.get('lit-editor-example-table')) return\n customElements.define('lit-editor-example-table', LitEditor)\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'lit-editor-example-table': LitEditor\n }\n}\n"
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
"path": "registry/src/lit/examples/table/extension.ts",
|
|
24
|
+
"type": "registry:component",
|
|
25
|
+
"target": "components/editor/examples/table/extension.ts",
|
|
26
|
+
"content": "import { defineBaseKeymap, defineHistory, union } from 'prosekit/core'\nimport { defineDoc } from 'prosekit/extensions/doc'\nimport { defineGapCursor } from 'prosekit/extensions/gap-cursor'\nimport { defineParagraph } from 'prosekit/extensions/paragraph'\nimport { defineTable } from 'prosekit/extensions/table'\nimport { defineText } from 'prosekit/extensions/text'\n\nexport function defineExtension() {\n return union(\n defineBaseKeymap(),\n defineDoc(),\n defineText(),\n defineParagraph(),\n defineTable(),\n defineHistory(),\n defineGapCursor(),\n )\n}\n\nexport type EditorExtension = ReturnType<typeof defineExtension>\n"
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
"path": "registry/src/lit/examples/table/index.ts",
|
|
30
|
+
"type": "registry:component",
|
|
31
|
+
"target": "components/editor/examples/table/index.ts",
|
|
32
|
+
"content": "export { LitEditor as ExampleEditor, registerLitEditor } from './editor'\n"
|
|
33
|
+
}
|
|
34
|
+
],
|
|
35
|
+
"meta": {
|
|
36
|
+
"hasIcons": false,
|
|
37
|
+
"hidden": false,
|
|
38
|
+
"story": "table",
|
|
39
|
+
"framework": "lit",
|
|
40
|
+
"accumulatedFiles": [
|
|
41
|
+
"registry/src/lit/examples/table/editor.ts",
|
|
42
|
+
"registry/src/lit/examples/table/extension.ts",
|
|
43
|
+
"registry/src/lit/examples/table/index.ts",
|
|
44
|
+
"registry/src/lit/sample/sample-doc-table.ts",
|
|
45
|
+
"registry/src/lit/ui/editor-context.ts",
|
|
46
|
+
"registry/src/lit/ui/table-handle/index.ts",
|
|
47
|
+
"registry/src/lit/ui/table-handle/table-handle.ts"
|
|
48
|
+
],
|
|
49
|
+
"internalDependencies": [
|
|
50
|
+
"lit-sample-sample-doc-table",
|
|
51
|
+
"lit-ui-editor-context",
|
|
52
|
+
"lit-ui-table-handle"
|
|
53
|
+
]
|
|
54
|
+
},
|
|
55
|
+
"$schema": "https://ui.shadcn.com/schema/registry-item.json"
|
|
56
|
+
}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "lit-example-toolbar",
|
|
3
|
+
"title": "lit-example-toolbar",
|
|
4
|
+
"type": "registry:block",
|
|
5
|
+
"description": "Formatting toolbar with common editing actions.",
|
|
6
|
+
"registryDependencies": [
|
|
7
|
+
"https://prosekit.dev/r/lit-sample-sample-uploader.json",
|
|
8
|
+
"https://prosekit.dev/r/lit-ui-editor-context.json",
|
|
9
|
+
"https://prosekit.dev/r/lit-ui-toolbar.json"
|
|
10
|
+
],
|
|
11
|
+
"dependencies": [
|
|
12
|
+
"@lit/context",
|
|
13
|
+
"prosekit"
|
|
14
|
+
],
|
|
15
|
+
"files": [
|
|
16
|
+
{
|
|
17
|
+
"path": "registry/src/lit/examples/toolbar/editor.ts",
|
|
18
|
+
"type": "registry:component",
|
|
19
|
+
"target": "components/editor/examples/toolbar/editor.ts",
|
|
20
|
+
"content": "import 'prosekit/basic/style.css'\nimport 'prosekit/basic/typography.css'\n\nimport '../../ui/toolbar/index'\n\nimport { ContextProvider } from '@lit/context'\nimport { html, LitElement, type PropertyDeclaration, type PropertyValues } from 'lit'\nimport { createRef, ref, type Ref } from 'lit/directives/ref.js'\nimport type { Editor } from 'prosekit/core'\nimport { createEditor } from 'prosekit/core'\n\nimport { sampleUploader } from '../../sample/sample-uploader'\nimport { editorContext } from '../../ui/editor-context'\n\nimport { defineExtension } from './extension'\n\nexport class LitEditor extends LitElement {\n static override properties = {\n editor: {\n state: true,\n attribute: false,\n } satisfies PropertyDeclaration<Editor>,\n }\n\n private editor: Editor\n private ref: Ref<HTMLDivElement>\n constructor() {\n super()\n\n const extension = defineExtension()\n this.editor = createEditor({ extension })\n this.ref = createRef<HTMLDivElement>()\n new ContextProvider(this, {\n context: editorContext,\n initialValue: this.editor,\n })\n }\n\n override createRenderRoot() {\n return this\n }\n\n override disconnectedCallback() {\n this.editor.unmount()\n super.disconnectedCallback()\n }\n\n override updated(changedProperties: PropertyValues) {\n super.updated(changedProperties)\n this.editor.mount(this.ref.value)\n }\n\n override render() {\n return html`<div class=\"box-border h-full w-full min-h-36 overflow-y-hidden overflow-x-hidden rounded-md border border-solid border-gray-200 dark:border-gray-700 shadow-sm flex flex-col bg-white dark:bg-gray-950 text-black dark:text-white\">\n <lit-editor-toolbar .uploader=${sampleUploader}></lit-editor-toolbar>\n <div class=\"relative w-full flex-1 box-border overflow-y-auto\">\n <div ${ref(this.ref)} class=\"ProseMirror box-border min-h-full px-[max(4rem,calc(50%-20rem))] py-8 outline-hidden outline-0 [&_span[data-mention=user]]:text-blue-500 [&_span[data-mention=tag]]:text-violet-500\"></div>\n </div>\n </div>`\n }\n}\n\nexport function registerLitEditor() {\n if (customElements.get('lit-editor-example-toolbar')) return\n customElements.define('lit-editor-example-toolbar', LitEditor)\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'lit-editor-example-toolbar': LitEditor\n }\n}\n"
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
"path": "registry/src/lit/examples/toolbar/extension.ts",
|
|
24
|
+
"type": "registry:component",
|
|
25
|
+
"target": "components/editor/examples/toolbar/extension.ts",
|
|
26
|
+
"content": "import { defineBasicExtension } from 'prosekit/basic'\nimport { union } from 'prosekit/core'\n\nexport function defineExtension() {\n return union(defineBasicExtension())\n}\n\nexport type EditorExtension = ReturnType<typeof defineExtension>\n"
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
"path": "registry/src/lit/examples/toolbar/index.ts",
|
|
30
|
+
"type": "registry:component",
|
|
31
|
+
"target": "components/editor/examples/toolbar/index.ts",
|
|
32
|
+
"content": "export { LitEditor as ExampleEditor, registerLitEditor } from './editor'\n"
|
|
33
|
+
}
|
|
34
|
+
],
|
|
35
|
+
"meta": {
|
|
36
|
+
"hasIcons": false,
|
|
37
|
+
"hidden": false,
|
|
38
|
+
"story": "toolbar",
|
|
39
|
+
"framework": "lit",
|
|
40
|
+
"accumulatedFiles": [
|
|
41
|
+
"registry/src/lit/examples/toolbar/editor.ts",
|
|
42
|
+
"registry/src/lit/examples/toolbar/extension.ts",
|
|
43
|
+
"registry/src/lit/examples/toolbar/index.ts",
|
|
44
|
+
"registry/src/lit/sample/sample-uploader.ts",
|
|
45
|
+
"registry/src/lit/ui/button/button.ts",
|
|
46
|
+
"registry/src/lit/ui/button/index.ts",
|
|
47
|
+
"registry/src/lit/ui/editor-context.ts",
|
|
48
|
+
"registry/src/lit/ui/image-upload-popover/image-upload-popover.ts",
|
|
49
|
+
"registry/src/lit/ui/image-upload-popover/index.ts",
|
|
50
|
+
"registry/src/lit/ui/toolbar/index.ts",
|
|
51
|
+
"registry/src/lit/ui/toolbar/toolbar.ts"
|
|
52
|
+
],
|
|
53
|
+
"internalDependencies": [
|
|
54
|
+
"lit-sample-sample-uploader",
|
|
55
|
+
"lit-ui-editor-context",
|
|
56
|
+
"lit-ui-toolbar"
|
|
57
|
+
]
|
|
58
|
+
},
|
|
59
|
+
"$schema": "https://ui.shadcn.com/schema/registry-item.json"
|
|
60
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "lit-sample-sample-doc-table",
|
|
3
|
+
"title": "lit-sample-sample-doc-table",
|
|
4
|
+
"type": "registry:component",
|
|
5
|
+
"description": "",
|
|
6
|
+
"registryDependencies": [],
|
|
7
|
+
"dependencies": [
|
|
8
|
+
"prosekit"
|
|
9
|
+
],
|
|
10
|
+
"files": [
|
|
11
|
+
{
|
|
12
|
+
"path": "registry/src/lit/sample/sample-doc-table.ts",
|
|
13
|
+
"type": "registry:component",
|
|
14
|
+
"target": "components/editor/sample/sample-doc-table.ts",
|
|
15
|
+
"content": "import type { NodeJSON } from 'prosekit/core'\n\nexport const sampleContent: NodeJSON = {\n type: 'doc',\n content: [\n {\n type: 'table',\n content: [\n {\n type: 'tableRow',\n content: [\n {\n type: 'tableCell',\n attrs: {\n colspan: 1,\n rowspan: 1,\n colwidth: null,\n },\n content: [\n {\n type: 'paragraph',\n content: [\n {\n type: 'text',\n text: 'A1',\n },\n ],\n },\n ],\n },\n {\n type: 'tableCell',\n attrs: {\n colspan: 1,\n rowspan: 1,\n colwidth: null,\n },\n content: [\n {\n type: 'paragraph',\n content: [\n {\n type: 'text',\n text: 'B1',\n },\n ],\n },\n ],\n },\n {\n type: 'tableCell',\n attrs: {\n colspan: 1,\n rowspan: 1,\n colwidth: null,\n },\n content: [\n {\n type: 'paragraph',\n content: [\n {\n type: 'text',\n text: 'C1',\n },\n ],\n },\n ],\n },\n {\n type: 'tableCell',\n attrs: {\n colspan: 1,\n rowspan: 1,\n colwidth: null,\n },\n content: [\n {\n type: 'paragraph',\n content: [\n {\n type: 'text',\n text: 'D1',\n },\n ],\n },\n ],\n },\n ],\n },\n {\n type: 'tableRow',\n content: [\n {\n type: 'tableCell',\n attrs: {\n colspan: 1,\n rowspan: 1,\n colwidth: null,\n },\n content: [\n {\n type: 'paragraph',\n content: [\n {\n type: 'text',\n text: 'A2',\n },\n ],\n },\n ],\n },\n {\n type: 'tableCell',\n attrs: {\n colspan: 1,\n rowspan: 1,\n colwidth: null,\n },\n content: [\n {\n type: 'paragraph',\n content: [\n {\n type: 'text',\n text: 'B2',\n },\n ],\n },\n ],\n },\n {\n type: 'tableCell',\n attrs: {\n colspan: 1,\n rowspan: 1,\n colwidth: null,\n },\n content: [\n {\n type: 'paragraph',\n content: [\n {\n type: 'text',\n text: 'C2',\n },\n ],\n },\n ],\n },\n {\n type: 'tableCell',\n attrs: {\n colspan: 1,\n rowspan: 1,\n colwidth: null,\n },\n content: [\n {\n type: 'paragraph',\n content: [\n {\n type: 'text',\n text: 'D2',\n },\n ],\n },\n ],\n },\n ],\n },\n ],\n },\n ],\n}\n"
|
|
16
|
+
}
|
|
17
|
+
],
|
|
18
|
+
"meta": {
|
|
19
|
+
"hasIcons": false,
|
|
20
|
+
"hidden": false,
|
|
21
|
+
"story": "",
|
|
22
|
+
"framework": "lit",
|
|
23
|
+
"accumulatedFiles": [
|
|
24
|
+
"registry/src/lit/sample/sample-doc-table.ts"
|
|
25
|
+
],
|
|
26
|
+
"internalDependencies": []
|
|
27
|
+
},
|
|
28
|
+
"$schema": "https://ui.shadcn.com/schema/registry-item.json"
|
|
29
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "lit-sample-sample-uploader",
|
|
3
|
+
"title": "lit-sample-sample-uploader",
|
|
4
|
+
"type": "registry:component",
|
|
5
|
+
"description": "",
|
|
6
|
+
"registryDependencies": [],
|
|
7
|
+
"dependencies": [
|
|
8
|
+
"prosekit"
|
|
9
|
+
],
|
|
10
|
+
"files": [
|
|
11
|
+
{
|
|
12
|
+
"path": "registry/src/lit/sample/sample-uploader.ts",
|
|
13
|
+
"type": "registry:component",
|
|
14
|
+
"target": "components/editor/sample/sample-uploader.ts",
|
|
15
|
+
"content": "import type { Uploader } from 'prosekit/extensions/file'\n\n/**\n * Uploads the given file to https://tmpfiles.org/ and returns the URL of the\n * uploaded file.\n *\n * This function is only for demonstration purposes. All uploaded files will be\n * deleted by the server after 1 hour.\n */\nexport const sampleUploader: Uploader<string> = ({ file, onProgress }): Promise<string> => {\n return new Promise((resolve, reject) => {\n const xhr = new XMLHttpRequest()\n const formData = new FormData()\n formData.append('file', file)\n\n xhr.upload.addEventListener('progress', (event) => {\n if (event.lengthComputable) {\n onProgress({\n loaded: event.loaded,\n total: event.total,\n })\n }\n })\n\n xhr.addEventListener('load', () => {\n if (xhr.status === 200) {\n try {\n const json = JSON.parse(xhr.responseText) as { data: { url: string } }\n const url: string = json.data.url.replace('tmpfiles.org/', 'tmpfiles.org/dl/')\n\n // Simulate a larger delay\n setTimeout(() => resolve(url), 1000)\n } catch (error) {\n reject(new Error('Failed to parse response', { cause: error }))\n }\n } else {\n reject(new Error(`Upload failed with status ${xhr.status}`))\n }\n })\n\n xhr.addEventListener('error', () => {\n reject(new Error('Upload failed'))\n })\n\n xhr.open('POST', 'https://tmpfiles.org/api/v1/upload', true)\n xhr.send(formData)\n })\n}\n"
|
|
16
|
+
}
|
|
17
|
+
],
|
|
18
|
+
"meta": {
|
|
19
|
+
"hasIcons": false,
|
|
20
|
+
"hidden": false,
|
|
21
|
+
"story": "",
|
|
22
|
+
"framework": "lit",
|
|
23
|
+
"accumulatedFiles": [
|
|
24
|
+
"registry/src/lit/sample/sample-uploader.ts"
|
|
25
|
+
],
|
|
26
|
+
"internalDependencies": []
|
|
27
|
+
},
|
|
28
|
+
"$schema": "https://ui.shadcn.com/schema/registry-item.json"
|
|
29
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "lit-ui-button",
|
|
3
|
+
"title": "lit-ui-button",
|
|
4
|
+
"type": "registry:component",
|
|
5
|
+
"description": "",
|
|
6
|
+
"registryDependencies": [],
|
|
7
|
+
"dependencies": [
|
|
8
|
+
"prosekit"
|
|
9
|
+
],
|
|
10
|
+
"files": [
|
|
11
|
+
{
|
|
12
|
+
"path": "registry/src/lit/ui/button/button.ts",
|
|
13
|
+
"type": "registry:component",
|
|
14
|
+
"target": "components/editor/ui/button/button.ts",
|
|
15
|
+
"content": "import 'prosekit/lit/tooltip'\n\nimport { html, LitElement, nothing, type PropertyDeclaration } from 'lit'\n\nclass LitButton extends LitElement {\n static override properties = {\n pressed: { type: Boolean },\n disabled: { type: Boolean },\n tooltip: { type: String },\n icon: { type: String },\n } satisfies Record<string, PropertyDeclaration>\n\n pressed = false\n disabled = false\n tooltip = ''\n icon = ''\n\n override createRenderRoot() {\n return this\n }\n\n override connectedCallback() {\n super.connectedCallback()\n this.classList.add('contents')\n }\n\n private handleMouseDown = (event: MouseEvent) => {\n // Prevent the editor from being blurred when the button is clicked\n event.preventDefault()\n }\n\n override render() {\n const tooltip = this.tooltip\n\n return html`\n <prosekit-tooltip-root>\n <prosekit-tooltip-trigger class=\"block\">\n <button\n data-state=${this.pressed ? 'on' : 'off'}\n class=\"outline-unset focus-visible:outline-unset flex items-center justify-center rounded-md p-2 font-medium transition focus-visible:ring-2 text-sm focus-visible:ring-gray-900 dark:focus-visible:ring-gray-300 disabled:pointer-events-none min-w-9 min-h-9 text-gray-900 dark:text-gray-50 disabled:text-gray-900/50 dark:disabled:text-gray-50/50 bg-transparent hover:bg-gray-100 dark:hover:bg-gray-800 data-[state=on]:bg-gray-200 dark:data-[state=on]:bg-gray-700\"\n ?disabled=${this.disabled}\n @mousedown=${this.handleMouseDown}\n >\n ${this.icon ? html`<div class=\"${this.icon}\"></div>` : nothing}\n ${tooltip ? html`<span class=\"sr-only\">${tooltip}</span>` : nothing}\n </button>\n </prosekit-tooltip-trigger>\n ${tooltip\n ? html`\n <prosekit-tooltip-positioner class=\"block overflow-visible bg-transparent w-min h-min z-50 motion-safe:ease-out motion-safe:transition-transform motion-safe:duration-100\">\n <prosekit-tooltip-popup class=\"flex box-border motion-safe:duration-100 data-[state=closed]:motion-safe:duration-150 motion-safe:transition-discrete motion-safe:transition-all data-[state=closed]:opacity-0 starting:opacity-0 opacity-100 data-[state=closed]:scale-95 starting:scale-95 scale-100 overflow-hidden rounded-md border border-solid bg-gray-900 dark:bg-gray-50 px-3 py-1.5 text-xs text-gray-50 dark:text-gray-900 shadow-xs text-nowrap\">\n ${tooltip}\n </prosekit-tooltip-popup>\n </prosekit-tooltip-positioner>\n `\n : nothing}\n </prosekit-tooltip-root>\n `\n }\n}\n\ncustomElements.define('lit-editor-button', LitButton)\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'lit-editor-button': LitButton\n }\n}\n"
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
"path": "registry/src/lit/ui/button/index.ts",
|
|
19
|
+
"type": "registry:component",
|
|
20
|
+
"target": "components/editor/ui/button/index.ts",
|
|
21
|
+
"content": "import './button'\n"
|
|
22
|
+
}
|
|
23
|
+
],
|
|
24
|
+
"meta": {
|
|
25
|
+
"hasIcons": false,
|
|
26
|
+
"hidden": false,
|
|
27
|
+
"story": "",
|
|
28
|
+
"framework": "lit",
|
|
29
|
+
"accumulatedFiles": [
|
|
30
|
+
"registry/src/lit/ui/button/button.ts",
|
|
31
|
+
"registry/src/lit/ui/button/index.ts"
|
|
32
|
+
],
|
|
33
|
+
"internalDependencies": []
|
|
34
|
+
},
|
|
35
|
+
"$schema": "https://ui.shadcn.com/schema/registry-item.json"
|
|
36
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "lit-ui-editor-context",
|
|
3
|
+
"title": "lit-ui-editor-context",
|
|
4
|
+
"type": "registry:component",
|
|
5
|
+
"description": "",
|
|
6
|
+
"registryDependencies": [],
|
|
7
|
+
"dependencies": [
|
|
8
|
+
"@lit/context",
|
|
9
|
+
"prosekit"
|
|
10
|
+
],
|
|
11
|
+
"files": [
|
|
12
|
+
{
|
|
13
|
+
"path": "registry/src/lit/ui/editor-context.ts",
|
|
14
|
+
"type": "registry:component",
|
|
15
|
+
"target": "components/editor/ui/editor-context.ts",
|
|
16
|
+
"content": "import { createContext } from '@lit/context'\nimport type { Editor } from 'prosekit/core'\n\nexport const editorContext = createContext<Editor | undefined>('prosekit-editor')\n"
|
|
17
|
+
}
|
|
18
|
+
],
|
|
19
|
+
"meta": {
|
|
20
|
+
"hasIcons": false,
|
|
21
|
+
"hidden": false,
|
|
22
|
+
"story": "",
|
|
23
|
+
"framework": "lit",
|
|
24
|
+
"accumulatedFiles": [
|
|
25
|
+
"registry/src/lit/ui/editor-context.ts"
|
|
26
|
+
],
|
|
27
|
+
"internalDependencies": []
|
|
28
|
+
},
|
|
29
|
+
"$schema": "https://ui.shadcn.com/schema/registry-item.json"
|
|
30
|
+
}
|