A WeWeb element that displays text with a rich text editor.
Fork of weweb-assets/ww-text (upstream 3.1.0), kept in sync with upstream and adding the changes below. Fork-specific code is marked with a [FORK] comment so it survives future rebases.
The Html tag property is bindable, so the rendered tag can come from a formula (bind content.default.tag to something returning a tag name string, e.g. "h2"). Useful for a single component that renders h1 as a page hero and h2 when reused in a section.
Any valid tag name is accepted, not just the ones in the dropdown. The resolved value must look like a tag name (/^[a-z][a-z0-9-]*$/i) and must not be one of script, style, iframe, object, embed, link, meta, base, html, head, body; anything else falls back to p.
label is available in the tag dropdown. When it is selected — or when the tag is bound — a For (input id) property appears; its value is rendered as the label's for attribute, so clicking the label focuses the form control with that id.
Install dependencies with npm install.
Serve locally with npm run serve --port=[PORT], then open the WeWeb editor, open the developer popup, and add localhost:[PORT] as a custom element.
npm run build -- --name=jpui-text --type=wwobjectThe -- is required. Without it npm swallows --name and the CLI fails while still exiting 0, so read the output rather than trusting the exit code. This produces dist/manager.js, the editor bundle (wwFront blocks stripped, wwEditor blocks kept). WeWeb builds the production bundle on publish, so a green local build does not exercise the front-end path.
git fetch upstream
git rebase upstream/mainFork commits are prefixed [FORK]; replay them on top of upstream and check the [FORK] comment markers still sit in the right place.