@weftly/runtime
v0.2.5
Published
Renderer + built-in component library + schema/registry for the Weftly website builder.
Readme
@weftly/runtime
Renderer + built-in component library + schema/registry for the Weftly website builder.
Install
npm install @weftly/runtimePeer deps: next ^16.2.6, react/react-dom ^19.2.0.
Next.js setup
This package ships precompiled CSS Modules (*.module.css). Add it to
transpilePackages so Next applies CSS-Modules scoping:
// next.config.ts
export default { transpilePackages: ['@weftly/runtime'] }Exports
@weftly/runtime—PageTreeRenderer,WebsiteRenderSurface,componentMap,builtinRegistry, schema/registry helpers.- Deep subpaths, e.g.
@weftly/runtime/lib/component-schema,@weftly/runtime/components/PageTreeRenderer. @weftly/runtime/design-settings(0.2.5+) —createDesignSettings,designStyle,resolveColorValue: standard text colour, alignment, font size/weight and background settings for component schemas. Schema settings also acceptgroup,description,showWhenand colourpalette/allowInherit/allowCustom(0.2.5+). See the element-settings contract in the Weftly repository (docs/element-settings-design.md).
Materialized linked sections
Named slots and linked-section metadata require runtime 0.2.4, host 0.2.5, and loader 0.4.1 or compatible later releases. Update these packages together.
TreeNode.linkedSection optionally records sectionId, a positive integer
revision, an optional variantKey, and a nodeMap from source node IDs to
instance node IDs. It pins the source revision of an already materialized subtree.
The renderer renders the ordinary componentKey, props, and children without
fetching a section definition. Published snapshots therefore keep their materialized
content even when the central section changes. The builder owns synchronization,
local overrides, and access checks. isLinkedSectionInstance validates the metadata
shape; it does not establish ownership or subtree membership.
License
Weftly Community License — see LICENSE. Production use requires a valid Weftly license key.
