@thebes/cadmea 1.2.0 → 1.4.0
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/RichTextEditor-CPQTvhQD.js +190 -0
- package/dist/RichTextEditor-CPQTvhQD.js.map +1 -0
- package/dist/RichTextEditor-ComcBFfl.js +334 -0
- package/dist/RichTextEditor-ComcBFfl.js.map +1 -0
- package/dist/index/index.d.ts +9 -0
- package/dist/index/index.js +228 -182
- package/dist/index/index.js.map +1 -1
- package/dist/index/server.js +99 -52
- package/dist/index/server.js.map +1 -1
- package/dist/tanstack-start/index.d.ts +9 -0
- package/dist/tanstack-start/index.js +229 -183
- package/dist/tanstack-start/index.js.map +1 -1
- package/dist/tanstack-start/server.js +100 -53
- package/dist/tanstack-start/server.js.map +1 -1
- package/package.json +2 -1
- package/dist/RichTextEditor-BPilh7Pw.js +0 -36
- package/dist/RichTextEditor-BPilh7Pw.js.map +0 -1
- package/dist/RichTextEditor-DcLqdFY7.js +0 -15
- package/dist/RichTextEditor-DcLqdFY7.js.map +0 -1
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { escape, ssr, ssrAttribute } from "solid-js/web";
|
|
2
|
-
import { onCleanup, onMount } from "solid-js";
|
|
3
|
-
import "@tiptap/core";
|
|
4
|
-
import "@tiptap/starter-kit";
|
|
5
|
-
//#region src/RichTextEditor.tsx
|
|
6
|
-
var _tmpl$ = ["<div", " class=\"textarea h-auto min-h-32 w-full\"></div>"];
|
|
7
|
-
function RichTextEditor(props) {
|
|
8
|
-
onMount(() => {});
|
|
9
|
-
onCleanup(() => {});
|
|
10
|
-
return ssr(_tmpl$, ssrAttribute("id", escape(props.id, true), false));
|
|
11
|
-
}
|
|
12
|
-
//#endregion
|
|
13
|
-
export { RichTextEditor };
|
|
14
|
-
|
|
15
|
-
//# sourceMappingURL=RichTextEditor-DcLqdFY7.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"RichTextEditor-DcLqdFY7.js","names":["Editor","StarterKit","onCleanup","onMount","RichTextEditorProps","id","content","onChange","doc","RichTextEditor","props","container","HTMLDivElement","editor","element","extensions","onUpdate","current","getJSON","destroy","_$ssr","_tmpl$","_$ssrAttribute","_$escape"],"sources":["../src/RichTextEditor.tsx"],"sourcesContent":["import { Editor } from \"@tiptap/core\";\nimport StarterKit from \"@tiptap/starter-kit\";\nimport { onCleanup, onMount } from \"solid-js\";\n\nexport interface RichTextEditorProps {\n id?: string;\n /** TipTap's native JSON document shape — stored as-is, no transform layer. */\n content?: object;\n onChange: (doc: object) => void;\n}\n\n// No official Solid binding for TipTap exists, so this wraps @tiptap/core's\n// vanilla `Editor` class directly in Solid's onMount/onCleanup lifecycle —\n// per CLAUDE.md's preference for the framework-agnostic core API over an\n// unofficial community port (same reasoning already applied to Phosphor\n// icons). `content` is only read once at mount, matching how this form's\n// other fields are initialized from `initialValues` rather than reacting\n// to prop changes after the fact — there is no live re-sync if `content`\n// changes out from under an already-mounted editor.\nexport function RichTextEditor(props: RichTextEditorProps) {\n let container: HTMLDivElement | undefined;\n let editor: Editor | undefined;\n\n onMount(() => {\n if (!container) return;\n editor = new Editor({\n element: container,\n extensions: [StarterKit],\n content: props.content ?? \"\",\n onUpdate: ({ editor: current }) => {\n props.onChange(current.getJSON());\n },\n });\n });\n\n onCleanup(() => {\n editor?.destroy();\n });\n\n return (\n <div\n id={props.id}\n class=\"textarea h-auto min-h-32 w-full\"\n ref={(el) => {\n container = el;\n }}\n />\n );\n}\n"],"mappings":";;;;;;AAmBA,SAAgBS,eAAeC,OAA4B;CAIzDP,cAAc,CAUd,CAAC;CAEDD,gBAAgB,CAEhB,CAAC;CAED,OAAAkB,IAAAC,QAAAC,aAAA,MAAAC,OAEQb,MAAML,IAAE,IAAA,GAAA,KAAA,CAAA;AAOlB"}
|