Skip to content

Latest commit

 

History

234 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

jpui-text

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.

Fork changes

Bindable HTML tag

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 tag with for attribute

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.

Installation

Install dependencies with npm install.

Start

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.

Build

npm run build -- --name=jpui-text --type=wwobject

The -- 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.

Syncing with upstream

git fetch upstream
git rebase upstream/main

Fork commits are prefixed [FORK]; replay them on top of upstream and check the [FORK] comment markers still sit in the right place.

About

A WeWeb element that displays text with a rich text editor.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages