@webround/core 0.3.11 → 0.3.13

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.
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import type { WrTextTag } from './kinds.js';
2
+ import { type WrTextTag } from './kinds.js';
3
3
  export interface WrTextViewProps extends Omit<React.HTMLAttributes<HTMLElement>, 'id' | 'dangerouslySetInnerHTML' | 'children'> {
4
4
  id: string;
5
5
  /** The container: `div` (default) or `span`. */
@@ -7,5 +7,5 @@ export interface WrTextViewProps extends Omit<React.HTMLAttributes<HTMLElement>,
7
7
  /** The HTML of the text, as it is to be drawn. */
8
8
  html: string;
9
9
  }
10
- export declare function WrTextView({ id, tag: Tag, html, style, ...props }: WrTextViewProps): React.JSX.Element;
10
+ export declare function WrTextView({ id, tag, html, style, ...props }: WrTextViewProps): React.JSX.Element;
11
11
  //# sourceMappingURL=text-react.d.ts.map
@@ -1,5 +1,9 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
- export function WrTextView({ id, tag: Tag = 'div', html, style, ...props }) {
2
+ import { wrTagOf } from './kinds.js';
3
+ export function WrTextView({ id, tag, html, style, ...props }) {
4
+ // The types say `div` or `span`, but a site that builds with a type error can say another (`p`, whose paragraphs would be a `<p>` inside a `<p>`, which a parser splits: the saved page and the one the app draws
5
+ // would differ). Whatever is said, the element is one of the two: the one `wrTagOf` gives, which is also what the checks believe it is.
6
+ const Tag = wrTagOf('text', tag);
3
7
  return (_jsx(Tag, { ...props, "data-wr-id": id, "data-wr-type": "text", dangerouslySetInnerHTML: { __html: html }, style: { wordBreak: 'break-word', ...style } }));
4
8
  }
5
9
  //# sourceMappingURL=text-react.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webround/core",
3
- "version": "0.3.11",
3
+ "version": "0.3.13",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",