@webority/ui-react 0.133.0 → 0.134.0
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 +7422 -7338
- package/dist/canvas-kit/manifest.json +7 -1
- package/dist/canvas-kit/release.json +6 -6
- package/dist/components/AppMarkdown.js +1 -1
- package/dist/guidance.json +1 -1
- package/dist/markdown-core/dist/links.js +1 -1
- package/dist/types/components/AppMarkdown.d.ts +3 -0
- package/package.json +7 -7
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"kind": "WeborityWeb",
|
|
3
3
|
"library": {
|
|
4
4
|
"name": "@webority/ui-react",
|
|
5
|
-
"version": "0.
|
|
5
|
+
"version": "0.134.0"
|
|
6
6
|
},
|
|
7
7
|
"rendererProtocolVersion": 13,
|
|
8
8
|
"platform": "Web",
|
|
@@ -13993,6 +13993,12 @@
|
|
|
13993
13993
|
"marker": "AppMarkdown",
|
|
13994
13994
|
"acceptsChildren": false,
|
|
13995
13995
|
"props": [
|
|
13996
|
+
{
|
|
13997
|
+
"name": "base",
|
|
13998
|
+
"type": "string",
|
|
13999
|
+
"required": false,
|
|
14000
|
+
"description": "An https origin such as https://example.com that a relative link resolves against: /pricing opens https://example.com/pricing. Any other value (a path, a query, credentials, http) is ignored with a dev warning."
|
|
14001
|
+
},
|
|
13996
14002
|
{
|
|
13997
14003
|
"name": "className",
|
|
13998
14004
|
"type": "string",
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "webority-web",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.134.0",
|
|
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.134.0"
|
|
10
10
|
},
|
|
11
11
|
"files": {
|
|
12
12
|
"manifest.json": {
|
|
13
|
-
"sha256": "
|
|
14
|
-
"bytes":
|
|
13
|
+
"sha256": "91531e8b00ff9b11e0ae1a82a121f0211b3a89f6ae2ab560b3ced1fb3a3d2d72",
|
|
14
|
+
"bytes": 1005189
|
|
15
15
|
},
|
|
16
16
|
"kit.js": {
|
|
17
|
-
"sha256": "
|
|
18
|
-
"bytes":
|
|
17
|
+
"sha256": "e33f8be217022f1defba348234e2aefc7bfa514e85ce85ecc9be5838951677b1",
|
|
18
|
+
"bytes": 11171178
|
|
19
19
|
},
|
|
20
20
|
"kit.css": {
|
|
21
21
|
"sha256": "13b14f71fb6ea024945f95cba617b4f1d49f44a65ba7c7ed05d2354805539ef6",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{linkBase as e,linkTarget as t,webRoute as n}from"../markdown-core/dist/links.js";import{parseInline as r}from"../markdown-core/dist/inline.js";import{parseMarkdown as i}from"../markdown-core/dist/parse.js";import{devWarn as a}from"../lib/devWarn.js";import{splitMarkerProps as o}from"../lib/wuiMarker.js";import s from"./AppChip.js";import c from"./AppCodeBlock.js";import l from"./AppLink.js";import u from"./warnInvalidValue.js";import d from"./warnUnknownProps.js";import{Fragment as f,useMemo as p}from"react";import{jsx as m,jsxs as h}from"react/jsx-runtime";import"@webority/ui-elements/elements/markdown";var g=[`text`,`json`,`js`,`cs`,`sql`,`bash`,`http`,`html`,`css`],_=/* @__PURE__ */ new Set,v=()=>{try{return process.env.NODE_ENV!==`production`}catch{return!0}};function y(e){v()&&!_.has(e)&&(_.add(e),a(`AppMarkdown ignores base="${e}": a base must be an https origin with no path, query, fragment or credentials.`))}function b(t){let{marker:n,props:r}=o(`AppMarkdown`,t),{value:a,className:s=``,linkComponent:c,resolveLink:l,isCitation:f,figureText:h,onOpenCitation:g,links:_=`web`,headings:v=`outline`,base:b,...x}=r;d(`AppMarkdown`,x),u(`AppMarkdown`,`links`,_,[`app`,`web`,`page`]),u(`AppMarkdown`,`headings`,v,[`outline`,`text`]);let S=b==null?null:e(b);b!=null&&S===null&&y(b);let C=p(()=>i(a),[a]),w={links:_,headings:v,resolveLink:l,linkComponent:c,isCitation:f,figureText:h,onOpenCitation:g,base:S};return/* @__PURE__ */ m(`wui-markdown`,{class:[`wui-markdown`,s].filter(Boolean).join(` `),...n,...x,children:C.map(e=>/* @__PURE__ */ m(O,{block:e,options:w},e.key))})}function x({token:e,options:r}){let i=/* @__PURE__ */ m(S,{tokens:e.children,options:r}),a=t(e.href,r.links,r.resolveLink,globalThis.location?.origin,r.base);if(a?.kind===`app`){let e=n(a.target);if(e)return/* @__PURE__ */ m(l,{href:e,linkComponent:r.linkComponent,animation:`static`,children:i});let o=a.target;if(r.links!==`page`||typeof o!=`string`||!/^https?:\/\//i.test(o))return i;let s=t(o,`web`,void 0,globalThis.location?.origin)?.kind===`web`;return/* @__PURE__ */ m(l,{href:o,external:s,animation:`static`,children:i})}return a?.kind===`page`?/* @__PURE__ */ m(l,{href:a.href,linkComponent:r.linkComponent,animation:`static`,children:i}):a?.kind===`web`?/* @__PURE__ */ m(l,{href:a.href,external:!0,animation:`static`,children:i}):a?.kind===`contact`?/* @__PURE__ */ m(l,{href:a.href,animation:`static`,children:i}):i}function S({tokens:e,options:t}){return e.map(e=>{switch(e.type){case`code`:return/* @__PURE__ */ m(`code`,{children:e.text},e.key);case`strong`:return/* @__PURE__ */ m(`strong`,{children:/* @__PURE__ */ m(S,{tokens:e.children,options:t})},e.key);case`em`:return/* @__PURE__ */ m(`em`,{children:/* @__PURE__ */ m(S,{tokens:e.children,options:t})},e.key);case`strike`:return/* @__PURE__ */ m(`del`,{children:/* @__PURE__ */ m(S,{tokens:e.children,options:t})},e.key);case`image`:return/* @__PURE__ */ h(f,{children:[`[`,/* @__PURE__ */ m(S,{tokens:e.children,options:t}),`]`]},e.key);case`link`:return/* @__PURE__ */ m(x,{token:e,options:t},e.key);case`citation`:return/* @__PURE__ */ m(s,{label:e.text,size:`sm`,tone:`primary`,variant:`outline`,"aria-label":e.text,className:`wui-markdown-citation`,onClick:t.onOpenCitation?()=>t.onOpenCitation(e.text):void 0},e.key);case`text`:return t.figureText?/* @__PURE__ */ m(f,{children:t.figureText(e.text).map((e,t)=>{if(e.kind===`text`)return e.text;let n=e.kind===`sub`?`sub`:`sup`;return/* @__PURE__ */ m(n,{children:e.text},t)})},e.key):/* @__PURE__ */ m(f,{children:e.text},e.key);default:return/* @__PURE__ */ m(f,{children:e.text},e.key)}})}function C({text:e,options:t}){return/* @__PURE__ */ m(S,{tokens:r(e,{isCitation:t.isCitation}),options:t})}function w({lines:e,options:t}){return e.map((e,n)=>/* @__PURE__ */ h(f,{children:[n>0&&/* @__PURE__ */ m(`br`,{}),/* @__PURE__ */ m(C,{text:e,options:t})]},n))}function T({block:e,options:t}){let n=e=>/* @__PURE__ */ m(C,{text:e,options:t});return/* @__PURE__ */ m(`div`,{className:`table-responsive`,children:/* @__PURE__ */ h(`table`,{className:`table`,children:[/* @__PURE__ */ m(`thead`,{children:/* @__PURE__ */ m(`tr`,{children:e.header.map((e,t)=>/* @__PURE__ */ m(`th`,{scope:`col`,children:n(e)},t))})}),/* @__PURE__ */ m(`tbody`,{children:e.rows.map((t,r)=>/* @__PURE__ */ m(`tr`,{children:e.header.map((e,r)=>/* @__PURE__ */ m(`td`,{children:n(t[r]??``)},r))},r))})]})})}function E(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=E(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})=>/* @__PURE__ */ h(`li`,{children:[/* @__PURE__ */ m(C,{text:t.text,options:n}),i]},`${e.key}-${r}`));return{node:a?/* @__PURE__ */ m(`ol`,{start:a&&o!==1?o:void 0,children:l},`${e.key}-${t}`):/* @__PURE__ */ m(`ul`,{children:l},`${e.key}-${t}`),next:c}}function D(e,t){let n=[],r=0;for(;r<e.items.length;){let i=E(e,r,t);n.push(i.node),r=i.next}return n}function O({block:e,options:t}){switch(e.type){case`paragraph`:return/* @__PURE__ */ m(`p`,{children:/* @__PURE__ */ m(w,{lines:e.lines,options:t})});case`quote`:return/* @__PURE__ */ m(`blockquote`,{children:/* @__PURE__ */ m(w,{lines:e.lines,options:t})});case`heading`:{let n=/* @__PURE__ */ m(C,{text:e.text,options:t});return t.headings===`text`?/* @__PURE__ */ m(`p`,{className:`fw-semibold`,children:n}):/* @__PURE__ */ m(`h2`,{children:n})}case`list`:return D(e,t);case`table`:return/* @__PURE__ */ m(T,{block:e,options:t});case`code`:return/* @__PURE__ */ m(c,{code:e.text,language:g.includes(e.language)?e.language:`text`});case`rule`:return/* @__PURE__ */ m(`hr`,{});default:return null}}export{b as default};
|
package/dist/guidance.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var e=/^[a-z][a-z0-9+.-]*:[a-z0-9_-]+\/[a-z0-9_.~-]+$/i,t=/^https?:/i,n=/^(mailto|tel):/i,r=/^(?:\/(?![/\\])|#|\?|\.{1,2}\/)
|
|
1
|
+
var e=/^[a-z][a-z0-9+.-]*:[a-z0-9_-]+\/[a-z0-9_.~-]+$/i,t=/^https?:/i,n=/^(mailto|tel):/i,r=/^(?:\/(?![/\\])|#|\?|\.{1,2}\/)/,i=/^https:\/\/[^/?#@\\\s]+$/i,a=/^[a-z][a-z0-9+.-]*:/i;function o(e){if(typeof e!=`string`)return null;let t=e.endsWith(`/`)?e.slice(0,-1):e;return i.test(t)?t:null}function s(i,a,s,l,d){if(s&&(a===`page`||e.test(i))){let e=s(i);if(e!=null)return{kind:`app`,target:e}}if(a===`app`)return null;let f=d==null?null:o(d),p=f===null?i:c(i,f);return p===null?null:r.test(p)?{kind:`page`,href:p}:a===`page`&&!(t.test(p)&&l&&u(p,l))?null:t.test(p)?{kind:l&&u(p,l)?`page`:`web`,href:p}:n.test(p)?{kind:`contact`,href:p}:null}function c(e,t){if(a.test(e))return e;if(e.startsWith(`//`))return`https:${e}`;if(e===``)return null;let n=e.indexOf(`#`),r=n<0?``:e.slice(n),i=n<0?e:e.slice(0,n),o=i.indexOf(`?`),s=o<0?i:i.slice(0,o),c=o<0?``:i.slice(o);return s===``?`${t}${c}${r}`:`${t}${l(s.startsWith(`/`)?s:`/${s}`)}${c}${r}`}function l(e){let t=e.split(`/`),n=[];return t.forEach((e,r)=>{let i=r===t.length-1;e===`.`?i&&n.push(``):e===`..`?(n.length>1&&n.pop(),i&&n.push(``)):n.push(e)}),n.join(`/`)}function u(e,t){if(e.slice(0,t.length).toLowerCase()!==t.toLowerCase())return!1;let n=e[t.length];return n===void 0||n===`/`||n===`?`||n===`#`}function d(e){return typeof e!=`string`||!e.startsWith(`/`)||e[1]===`/`||e[1]===`\\`?null:e}export{o as linkBase,s as linkTarget,d as webRoute};
|
|
@@ -18,6 +18,7 @@ import "@webority/ui-elements/elements/markdown";
|
|
|
18
18
|
* @param {import('react').ElementType} [props.linkComponent] A router link. It receives `to` for an
|
|
19
19
|
* in-app route. Without it an in-app route renders as a plain anchor.
|
|
20
20
|
* @param {"app"|"web"|"page"} [props.links] "app" opens only routes from `resolveLink`; "web" (default) also opens web, mail and phone addresses; "page" also opens a relative address and a web address on this site, in the same tab, and asks `resolveLink` for every address; an absolute web address it returns opens in a new tab when it leaves this site.
|
|
21
|
+
* @param {string} [props.base] An https origin such as "https://example.com" that a relative link resolves against, so "/pricing" opens "https://example.com/pricing". Any other value is ignored with a dev warning.
|
|
21
22
|
* @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.
|
|
22
23
|
* @param {string} [props.className]
|
|
23
24
|
*/
|
|
@@ -37,6 +38,8 @@ export default function AppMarkdown(props: {
|
|
|
37
38
|
* @default "web"
|
|
38
39
|
*/
|
|
39
40
|
links?: "app" | "web" | "page";
|
|
41
|
+
/** An https origin such as https://example.com that a relative link resolves against: /pricing opens https://example.com/pricing. Any other value (a path, a query, credentials, http) is ignored with a dev warning. */
|
|
42
|
+
base?: string;
|
|
40
43
|
/**
|
|
41
44
|
* Outline draws a heading as an h2 in the page outline. Text draws it as a bold line that stays out of the outline.
|
|
42
45
|
* @default "outline"
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webority/ui-react",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.134.0",
|
|
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,10 +29,10 @@
|
|
|
29
29
|
},
|
|
30
30
|
"sideEffects": false,
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@webority/markdown-core": "0.
|
|
33
|
-
"@webority/theme": "0.
|
|
34
|
-
"@webority/ui-elements": "0.
|
|
35
|
-
"@webority/web-core": "0.
|
|
32
|
+
"@webority/markdown-core": "0.134.0",
|
|
33
|
+
"@webority/theme": "0.134.0",
|
|
34
|
+
"@webority/ui-elements": "0.134.0",
|
|
35
|
+
"@webority/web-core": "0.134.0"
|
|
36
36
|
},
|
|
37
37
|
"peerDependencies": {
|
|
38
38
|
"@webority/analytics": "^0.35.0",
|
|
@@ -50,8 +50,8 @@
|
|
|
50
50
|
"@vitejs/plugin-react": "^6.0.1",
|
|
51
51
|
"@vitest/coverage-v8": "5.0.1",
|
|
52
52
|
"@webority/analytics": "0.35.0",
|
|
53
|
-
"@webority/canvas-kit": "0.
|
|
54
|
-
"@webority/tokens": "0.
|
|
53
|
+
"@webority/canvas-kit": "0.134.0",
|
|
54
|
+
"@webority/tokens": "0.134.0",
|
|
55
55
|
"bootstrap": "5.3.3",
|
|
56
56
|
"jsdom": "30.1.1",
|
|
57
57
|
"react": "^19.2.6",
|