@webority/ui-react 0.111.0 → 0.112.3
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/canvas-kit/kit.js +7047 -6776
- package/dist/canvas-kit/manifest.json +24 -2
- package/dist/canvas-kit/release.json +6 -6
- package/dist/components/AppMarkdown.js +1 -1
- package/dist/guidance.json +2 -2
- package/dist/markdown-core/dist/inline.js +1 -0
- package/dist/markdown-core/dist/links.js +1 -0
- package/dist/markdown-core/dist/parse.js +4 -0
- package/dist/types/components/AppMarkdown.d.ts +16 -4
- package/package.json +8 -7
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"kind": "WeborityWeb",
|
|
3
3
|
"library": {
|
|
4
4
|
"name": "@webority/ui-react",
|
|
5
|
-
"version": "0.
|
|
5
|
+
"version": "0.112.3"
|
|
6
6
|
},
|
|
7
7
|
"rendererProtocolVersion": 13,
|
|
8
8
|
"platform": "Web",
|
|
@@ -11768,6 +11768,28 @@
|
|
|
11768
11768
|
"description": "Extra classes on the root element.",
|
|
11769
11769
|
"default": ""
|
|
11770
11770
|
},
|
|
11771
|
+
{
|
|
11772
|
+
"name": "headings",
|
|
11773
|
+
"type": "enum",
|
|
11774
|
+
"enum": [
|
|
11775
|
+
"outline",
|
|
11776
|
+
"text"
|
|
11777
|
+
],
|
|
11778
|
+
"required": false,
|
|
11779
|
+
"description": "Outline draws a heading as an h2 in the page outline. Text draws it as a bold line that stays out of the outline.",
|
|
11780
|
+
"default": "outline"
|
|
11781
|
+
},
|
|
11782
|
+
{
|
|
11783
|
+
"name": "links",
|
|
11784
|
+
"type": "enum",
|
|
11785
|
+
"enum": [
|
|
11786
|
+
"app",
|
|
11787
|
+
"web"
|
|
11788
|
+
],
|
|
11789
|
+
"required": false,
|
|
11790
|
+
"description": "App opens only routes from resolveLink. Web also opens web, mail and phone addresses in a new tab.",
|
|
11791
|
+
"default": "web"
|
|
11792
|
+
},
|
|
11771
11793
|
{
|
|
11772
11794
|
"name": "value",
|
|
11773
11795
|
"type": "string",
|
|
@@ -11801,7 +11823,7 @@
|
|
|
11801
11823
|
"dont": [],
|
|
11802
11824
|
"a11y": [
|
|
11803
11825
|
"Raw markup never reaches the page as elements: it shows as text, and an image shows as its alt text in brackets, so no picture is requested or announced.",
|
|
11804
|
-
"
|
|
11826
|
+
"By default a link opens only for an in-app route, a web address (in a new tab) or a mail or phone address. With links app, only the in-app route opens. Any other link shows its label as plain text."
|
|
11805
11827
|
]
|
|
11806
11828
|
}
|
|
11807
11829
|
},
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "webority-web",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.112.3",
|
|
4
4
|
"platform": "Web",
|
|
5
5
|
"kitModuleVersion": 2,
|
|
6
6
|
"rendererProtocolVersion": 13,
|
|
7
7
|
"library": {
|
|
8
8
|
"name": "@webority/ui-react",
|
|
9
|
-
"version": "0.
|
|
9
|
+
"version": "0.112.3"
|
|
10
10
|
},
|
|
11
11
|
"files": {
|
|
12
12
|
"manifest.json": {
|
|
13
|
-
"sha256": "
|
|
14
|
-
"bytes":
|
|
13
|
+
"sha256": "9e08c0d55fbc86f082ba6d5f35eacf6153b31f74097b2eae611c7f1488e41b93",
|
|
14
|
+
"bytes": 857685
|
|
15
15
|
},
|
|
16
16
|
"kit.js": {
|
|
17
|
-
"sha256": "
|
|
18
|
-
"bytes":
|
|
17
|
+
"sha256": "76d84b194bb320fe0b2472de363952d0cf230800974a73c327b8d12bc049c83a",
|
|
18
|
+
"bytes": 10907236
|
|
19
19
|
},
|
|
20
20
|
"kit.css": {
|
|
21
21
|
"sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{splitMarkerProps as e}from"../lib/wuiMarker.js";import t from"./
|
|
1
|
+
import{splitMarkerProps as e}from"../lib/wuiMarker.js";import t from"./warnInvalidValue.js";import n from"./warnUnknownProps.js";import r from"./AppCodeBlock.js";import i from"./AppLink.js";import{parseInline as a}from"../markdown-core/dist/inline.js";import{linkTarget as o,webRoute as s}from"../markdown-core/dist/links.js";import{parseMarkdown as c}from"../markdown-core/dist/parse.js";import{Fragment as l,useMemo as u}from"react";import{jsx as d,jsxs as f}from"react/jsx-runtime";import"@webority/ui-elements/elements/markdown";var p=[`text`,`json`,`js`,`cs`,`sql`,`bash`,`http`,`html`,`css`];function m(r){let{marker:i,props:a}=e(`AppMarkdown`,r),{value:o,className:s=``,linkComponent:l,resolveLink:f,links:p=`web`,headings:m=`outline`,...h}=a;n(`AppMarkdown`,h),t(`AppMarkdown`,`links`,p,[`app`,`web`]),t(`AppMarkdown`,`headings`,m,[`outline`,`text`]);let g=u(()=>c(o),[o]),_={links:p,headings:m,resolveLink:f,linkComponent:l};return d(`wui-markdown`,{class:[`wui-markdown`,s].filter(Boolean).join(` `),...i,...h,children:g.map(e=>d(S,{block:e,options:_},e.key))})}function h({token:e,options:t}){let n=d(g,{tokens:e.children,options:t}),r=o(e.href,t.links,t.resolveLink);if(r?.kind===`app`){let e=s(r.target);return e?d(i,{href:e,linkComponent:t.linkComponent,animation:`static`,children:n}):n}return r?.kind===`web`?d(i,{href:r.href,external:!0,animation:`static`,children:n}):r?.kind===`contact`?d(i,{href:r.href,animation:`static`,children:n}):n}function g({tokens:e,options:t}){return e.map(e=>{switch(e.type){case`code`:return d(`code`,{children:e.text},e.key);case`strong`:return d(`strong`,{children:d(g,{tokens:e.children,options:t})},e.key);case`em`:return d(`em`,{children:d(g,{tokens:e.children,options:t})},e.key);case`strike`:return d(`del`,{children:d(g,{tokens:e.children,options:t})},e.key);case`image`:return f(l,{children:[`[`,d(g,{tokens:e.children,options:t}),`]`]},e.key);case`link`:return d(h,{token:e,options:t},e.key);default:return d(l,{children:e.text},e.key)}})}function _({text:e,options:t}){return d(g,{tokens:a(e),options:t})}function v({lines:e,options:t}){return e.map((e,n)=>f(l,{children:[n>0&&d(`br`,{}),d(_,{text:e,options:t})]},n))}function y({block:e,options:t}){let n=e=>d(_,{text:e,options:t});return d(`div`,{className:`table-responsive`,children:f(`table`,{className:`table`,children:[d(`thead`,{children:d(`tr`,{children:e.header.map((e,t)=>d(`th`,{scope:`col`,children:n(e)},t))})}),d(`tbody`,{children:e.rows.map((t,r)=>d(`tr`,{children:e.header.map((e,r)=>d(`td`,{children:n(t[r]??``)},r))},r))})]})})}function b(e,t,n){let{items:r}=e,{depth:i,ordered:a,number:o}=r[t],s=[],c=t;for(;c<r.length&&r[c].depth>=i;)if(r[c].depth>i){let t=b(e,c,n);s[s.length-1].nested=t.node,c=t.next}else s.push({item:r[c],index:c,nested:null}),c+=1;let l=s.map(({item:t,index:r,nested:i})=>f(`li`,{children:[d(_,{text:t.text,options:n}),i]},`${e.key}-${r}`));return{node:a?d(`ol`,{start:a&&o!==1?o:void 0,children:l},`${e.key}-${t}`):d(`ul`,{children:l},`${e.key}-${t}`),next:c}}function x(e,t){let n=[],r=0;for(;r<e.items.length;){let i=b(e,r,t);n.push(i.node),r=i.next}return n}function S({block:e,options:t}){switch(e.type){case`paragraph`:return d(`p`,{children:d(v,{lines:e.lines,options:t})});case`quote`:return d(`blockquote`,{children:d(v,{lines:e.lines,options:t})});case`heading`:{let n=d(_,{text:e.text,options:t});return t.headings===`text`?d(`p`,{className:`fw-semibold`,children:n}):d(`h2`,{children:n})}case`list`:return x(e,t);case`table`:return d(y,{block:e,options:t});case`code`:return d(r,{code:e.text,language:p.includes(e.language)?e.language:`text`});case`rule`:return d(`hr`,{});default:return null}}export{m as default};
|
package/dist/guidance.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"format": "webority-guidance/1",
|
|
3
3
|
"package": {
|
|
4
4
|
"name": "@webority/ui-react",
|
|
5
|
-
"version": "0.
|
|
5
|
+
"version": "0.112.3"
|
|
6
6
|
},
|
|
7
7
|
"components": [
|
|
8
8
|
{
|
|
@@ -4339,7 +4339,7 @@
|
|
|
4339
4339
|
"dont": [],
|
|
4340
4340
|
"a11y": [
|
|
4341
4341
|
"Raw markup never reaches the page as elements: it shows as text, and an image shows as its alt text in brackets, so no picture is requested or announced.",
|
|
4342
|
-
"
|
|
4342
|
+
"By default a link opens only for an in-app route, a web address (in a new tab) or a mail or phone address. With links app, only the in-app route opens. Any other link shows its label as plain text."
|
|
4343
4343
|
]
|
|
4344
4344
|
}
|
|
4345
4345
|
},
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e=new Set(`!"#$%&'()*+,-./:;<=>?@[\\]^_\`{|}~`),t=/\[([^\]\n]+)\]\(((?:[^()\s]|\([^()\s]*\))+)\)/y,n=/!\[([^\]\n]*)\]\(((?:[^()\s]|\([^()\s]*\))+)\)/y,r=e=>/[\p{L}\p{N}]/u.test(e);function i(e,t){let n=0;for(let r=t-1;r>=0&&e.charAt(r)===`\\`;--r)n+=1;return n%2==1}function a(e,t,n){let a=n.length===1;for(let o=e.indexOf(n,t);o!==-1;o=e.indexOf(n,o+1)){let s=o>t&&!/\s/.test(e.charAt(t))&&!/\s/.test(e.charAt(o-1)),c=a&&(e.charAt(o+1)===n||e.charAt(o-1)===n),l=n===`_`&&r(e.charAt(o+n.length));if(s&&!c&&!l&&!i(e,o))return o}return-1}function o(i){let s=[],c=``,l=()=>{c&&=(s.push({type:`text`,text:c}),``)},u=0;for(;u<i.length;){let d=i.charAt(u),f=i.charAt(u+1);if(d===`\\`&&e.has(f)){c+=f,u+=2;continue}if(d==="`"){let e=i.indexOf("`",u+1);if(e>u+1){l(),s.push({type:`code`,text:i.slice(u+1,e)}),u=e+1;continue}}let p=d+f;if(p===`**`||p===`__`||p===`~~`){let e=a(i,u+2,p);if(e!==-1&&!(p===`__`&&r(i.charAt(u-1)))){l();let t=o(i.slice(u+2,e));p===`~~`?s.push({type:`strike`,children:t}):s.push({type:`strong`,children:t}),u=e+2;continue}c+=p,u+=2;continue}if(d===`*`||d===`_`){let e=a(i,u+1,d);if(e!==-1&&!(d===`_`&&r(i.charAt(u-1)))){l(),s.push({type:`em`,children:o(i.slice(u+1,e))}),u=e+1;continue}}if(d===`[`){t.lastIndex=u;let e=t.exec(i);if(e){l(),s.push({type:`link`,href:e[2],children:o(e[1])}),u+=e[0].length;continue}}if(d===`!`){n.lastIndex=u;let e=n.exec(i);if(e){l(),s.push({type:`image`,children:o(e[1])}),u+=e[0].length;continue}}c+=d,u+=1}return l(),s.map((e,t)=>({...e,key:t}))}export{o as parseInline};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e=/^[a-z][a-z0-9+.-]*:[a-z0-9_-]+\/[a-z0-9_.~-]+$/i,t=/^https?:/i,n=/^(mailto|tel):/i;function r(r,i,a){if(a&&e.test(r)){let e=a(r);if(e!=null)return{kind:`app`,target:e}}return i===`app`?null:t.test(r)?{kind:`web`,href:r}:n.test(r)?{kind:`contact`,href:r}:null}function i(e){return typeof e!=`string`||!e.startsWith(`/`)||e[1]===`/`||e[1]===`\\`?null:e}export{r as linkTarget,i as webRoute};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
var e=/^\s*```/,t=/^\s*```\s*(\S*)/,n=/^\s{0,3}(#{1,6})\s+(.*?)(?:\s+#+)?\s*$/,r=/^\s*([-*_])(\s*\1){2,}\s*$/,i=/^(\s*)[-*+]\s+(.*)$/,a=/^(\s*)(\d{1,9})[.)]\s+(.*)$/,o=/^\s*>\s?(.*)$/,s=/^\s*\|?\s*:?-{3,}:?\s*(\|\s*:?-{3,}:?\s*)*\|?\s*$/,c=e=>e.includes(`|`);function l(e){let t=e.trim();return t.startsWith(`|`)&&(t=t.slice(1)),t.endsWith(`|`)&&(t=t.slice(0,-1)),t.split(`|`).map(e=>e.trim())}function u(e,t){return c(e[t])&&t+1<e.length&&e[t+1].includes(`|`)&&s.test(e[t+1])}function d(t,s){let c=t[s];return e.test(c)||o.test(c)||i.test(c)||a.test(c)||n.test(c)||r.test(c)||u(t,s)}function f(e){let t=e.replace(/\t/g,` `).length;return Math.min(Math.floor(t/2),4)}function p(e){let t=a.exec(e);if(t)return{text:t[3],depth:f(t[1]),ordered:!0,number:Number(t[2])};let n=i.exec(e);return n?{text:n[2],depth:f(n[1]),ordered:!1,number:0}:null}function m(i){let a=(i??``).replace(/\r\n?/g,`
|
|
2
|
+
`).split(`
|
|
3
|
+
`),s=[],f=0;for(;f<a.length;){let i=a[f];if(!i.trim()){f+=1;continue}if(e.test(i)){let n=t.exec(i)?.[1]||null,r=[];for(f+=1;f<a.length&&!e.test(a[f]);)r.push(a[f]),f+=1;f+=1,s.push({type:`code`,text:r.join(`
|
|
4
|
+
`),language:n});continue}if(u(a,f)){let e=l(i),t=[];for(f+=2;f<a.length&&a[f].trim()&&c(a[f]);)t.push(l(a[f])),f+=1;s.push({type:`table`,header:e,rows:t});continue}if(r.test(i)){s.push({type:`rule`}),f+=1;continue}let m=n.exec(i);if(m){s.push({type:`heading`,level:m[1].length,text:m[2]}),f+=1;continue}if(o.test(i)){let e=[];for(;f<a.length;){let t=o.exec(a[f]);if(!t)break;e.push(t[1]),f+=1}s.push({type:`quote`,lines:e});continue}let h=p(i);if(h){let e=[];for(;f<a.length&&a[f].trim();){let t=p(a[f]);if(t){if(t.depth===0&&t.ordered!==h.ordered)break;e.push(t)}else if(d(a,f))break;else e[e.length-1].text+=` ${a[f].trim()}`;f+=1}s.push({type:`list`,ordered:h.ordered,start:h.ordered?h.number:1,items:e});continue}let g=[i];for(f+=1;f<a.length&&a[f].trim()&&!d(a,f);)g.push(a[f]),f+=1;s.push({type:`paragraph`,lines:g})}return s.map((e,t)=>({...e,key:t}))}export{m as parseMarkdown};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import "@webority/ui-elements/elements/markdown";
|
|
2
2
|
/**
|
|
3
3
|
* Markdown a person or the server wrote (a brief, a comment, a work-item text), shown with the kit's
|
|
4
|
-
* typography: paragraphs, headings, bullet and numbered lists, tables, rules, code blocks,
|
|
5
|
-
* italics and inline code. It never renders HTML: raw markup shows as text, and
|
|
6
|
-
* its alt text in brackets.
|
|
7
|
-
*
|
|
4
|
+
* typography: paragraphs, quotes, headings, bullet and numbered lists, tables, rules, code blocks,
|
|
5
|
+
* bold, italics, strikethrough and inline code. It never renders HTML: raw markup shows as text, and
|
|
6
|
+
* an image shows as its alt text in brackets. `links` decides which links open; any other link shows
|
|
7
|
+
* its label as text.
|
|
8
8
|
*
|
|
9
9
|
* The root is the shared `<wui-markdown>` element that Razor `<app-markdown>` writes, so both draw the same markup.
|
|
10
10
|
*
|
|
@@ -14,6 +14,8 @@ import "@webority/ui-elements/elements/markdown";
|
|
|
14
14
|
* to an in-app route such as "/support?ticket=3f2a", or null to show its label as text.
|
|
15
15
|
* @param {import('react').ElementType} [props.linkComponent] A router link. It receives `to` for an
|
|
16
16
|
* in-app route. Without it an in-app route renders as a plain anchor.
|
|
17
|
+
* @param {"app"|"web"} [props.links] "app" opens only routes from `resolveLink`; "web" (default) also opens web, mail and phone addresses.
|
|
18
|
+
* @param {"outline"|"text"} [props.headings] "text" draws a heading as a bold line that stays out of the page outline; "outline" (default) draws an h2.
|
|
17
19
|
* @param {string} [props.className]
|
|
18
20
|
*/
|
|
19
21
|
export default function AppMarkdown(props: {
|
|
@@ -21,6 +23,16 @@ export default function AppMarkdown(props: {
|
|
|
21
23
|
value?: string;
|
|
22
24
|
resolveLink?: (href: string) => string | null | undefined;
|
|
23
25
|
linkComponent?: import('react').ElementType;
|
|
26
|
+
/**
|
|
27
|
+
* App opens only routes from resolveLink. Web also opens web, mail and phone addresses in a new tab.
|
|
28
|
+
* @default "web"
|
|
29
|
+
*/
|
|
30
|
+
links?: "app" | "web";
|
|
31
|
+
/**
|
|
32
|
+
* Outline draws a heading as an h2 in the page outline. Text draws it as a bold line that stays out of the outline.
|
|
33
|
+
* @default "outline"
|
|
34
|
+
*/
|
|
35
|
+
headings?: "outline" | "text";
|
|
24
36
|
/**
|
|
25
37
|
* Extra classes on the root element.
|
|
26
38
|
* @default ""
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webority/ui-react",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.112.3",
|
|
4
4
|
"description": "Webority shared React component library — App* primitives on react-bootstrap + the @webority/theme design system.",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE",
|
|
6
6
|
"type": "module",
|
|
@@ -29,11 +29,12 @@
|
|
|
29
29
|
},
|
|
30
30
|
"sideEffects": false,
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@webority/
|
|
33
|
-
"@webority/
|
|
32
|
+
"@webority/markdown-core": "0.112.3",
|
|
33
|
+
"@webority/theme": "0.112.3",
|
|
34
|
+
"@webority/ui-elements": "0.112.3"
|
|
34
35
|
},
|
|
35
36
|
"peerDependencies": {
|
|
36
|
-
"@webority/analytics": "^0.
|
|
37
|
+
"@webority/analytics": "^0.30.0",
|
|
37
38
|
"bootstrap": "5.3.3",
|
|
38
39
|
"react": "^19.0.0",
|
|
39
40
|
"react-bootstrap": "^2.10.0",
|
|
@@ -47,7 +48,7 @@
|
|
|
47
48
|
"@types/react": "^19.2.17",
|
|
48
49
|
"@vitejs/plugin-react": "^6.0.1",
|
|
49
50
|
"@vitest/coverage-v8": "5.0.1",
|
|
50
|
-
"@webority/analytics": "0.
|
|
51
|
+
"@webority/analytics": "^0.30.0",
|
|
51
52
|
"bootstrap": "5.3.3",
|
|
52
53
|
"jsdom": "30.1.1",
|
|
53
54
|
"react": "^19.2.6",
|
|
@@ -56,8 +57,8 @@
|
|
|
56
57
|
"typescript": "^7.0.2",
|
|
57
58
|
"vite": "^8.0.12",
|
|
58
59
|
"vitest": "5.0.1",
|
|
59
|
-
"@webority/canvas-kit": "0.
|
|
60
|
-
"@webority/tokens": "0.
|
|
60
|
+
"@webority/canvas-kit": "0.112.3",
|
|
61
|
+
"@webority/tokens": "0.112.3"
|
|
61
62
|
},
|
|
62
63
|
"scripts": {
|
|
63
64
|
"build": "vite build && tsc -p tsconfig.json && node ../../scripts/inject-meta-docs.mjs && node ../canvas-kit/dist/cli.js build --config canvas-kit.json --out dist/canvas-kit && node ../canvas-kit/dist/cli.js guidance --config canvas-kit.json --out dist/guidance.json && node ../../scripts/sync-rcl-assets.mjs analytics",
|