@object-ui/plugin-markdown 17.2.0 → 17.5.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/CHANGELOG.md +151 -0
- package/README.md +0 -11
- package/dist/index.js +9 -1
- package/dist/index.umd.cjs +2 -2
- package/package.json +10 -10
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,152 @@
|
|
|
1
1
|
# @object-ui/plugin-markdown
|
|
2
2
|
|
|
3
|
+
## 17.5.0
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies [ceccdcf]
|
|
8
|
+
- Updated dependencies [d6e5124]
|
|
9
|
+
- Updated dependencies [debad27]
|
|
10
|
+
- Updated dependencies [dc2aa3e]
|
|
11
|
+
- Updated dependencies [ee66e2e]
|
|
12
|
+
- Updated dependencies [ee26e65]
|
|
13
|
+
- Updated dependencies [5900ac5]
|
|
14
|
+
- Updated dependencies [f650253]
|
|
15
|
+
- Updated dependencies [3d9769a]
|
|
16
|
+
- Updated dependencies [8f85f8b]
|
|
17
|
+
- Updated dependencies [d0c3b26]
|
|
18
|
+
- Updated dependencies [3fc2971]
|
|
19
|
+
- Updated dependencies [aca27fa]
|
|
20
|
+
- Updated dependencies [dde7283]
|
|
21
|
+
- Updated dependencies [4dadf0d]
|
|
22
|
+
- Updated dependencies [ae10a01]
|
|
23
|
+
- Updated dependencies [92876f0]
|
|
24
|
+
- Updated dependencies [f279deb]
|
|
25
|
+
- Updated dependencies [4b70d28]
|
|
26
|
+
- Updated dependencies [eb7f586]
|
|
27
|
+
- Updated dependencies [e901131]
|
|
28
|
+
- Updated dependencies [d9d3463]
|
|
29
|
+
- Updated dependencies [2a40f69]
|
|
30
|
+
- Updated dependencies [bec3e14]
|
|
31
|
+
- Updated dependencies [613b167]
|
|
32
|
+
- Updated dependencies [b4d3c22]
|
|
33
|
+
- Updated dependencies [1f9b905]
|
|
34
|
+
- Updated dependencies [cb13400]
|
|
35
|
+
- Updated dependencies [bc64bfe]
|
|
36
|
+
- Updated dependencies [abb0f81]
|
|
37
|
+
- Updated dependencies [38ab505]
|
|
38
|
+
- Updated dependencies [3e19fe7]
|
|
39
|
+
- Updated dependencies [b953a97]
|
|
40
|
+
- Updated dependencies [d7f3e30]
|
|
41
|
+
- Updated dependencies [7e4f0e5]
|
|
42
|
+
- Updated dependencies [a84385b]
|
|
43
|
+
- Updated dependencies [45e1949]
|
|
44
|
+
- Updated dependencies [92250d6]
|
|
45
|
+
- Updated dependencies [c1d939f]
|
|
46
|
+
- Updated dependencies [49ae9f4]
|
|
47
|
+
- Updated dependencies [a3ae404]
|
|
48
|
+
- Updated dependencies [bfdf3d4]
|
|
49
|
+
- Updated dependencies [bb68488]
|
|
50
|
+
- Updated dependencies [b1e42d0]
|
|
51
|
+
- Updated dependencies [2459a3e]
|
|
52
|
+
- Updated dependencies [d6aa172]
|
|
53
|
+
- Updated dependencies [fe52a04]
|
|
54
|
+
- Updated dependencies [3f5f87c]
|
|
55
|
+
- Updated dependencies [f5e1143]
|
|
56
|
+
- Updated dependencies [f148a64]
|
|
57
|
+
- Updated dependencies [bb68488]
|
|
58
|
+
- Updated dependencies [9461dd3]
|
|
59
|
+
- Updated dependencies [47f551b]
|
|
60
|
+
- Updated dependencies [ab04728]
|
|
61
|
+
- Updated dependencies [5bf09fd]
|
|
62
|
+
- @object-ui/react@17.5.0
|
|
63
|
+
- @object-ui/components@17.5.0
|
|
64
|
+
- @object-ui/core@17.5.0
|
|
65
|
+
- @object-ui/types@17.5.0
|
|
66
|
+
|
|
67
|
+
## 17.4.0
|
|
68
|
+
|
|
69
|
+
### Patch Changes
|
|
70
|
+
|
|
71
|
+
- Updated dependencies [794c497]
|
|
72
|
+
- Updated dependencies [993336f]
|
|
73
|
+
- Updated dependencies [f0a625a]
|
|
74
|
+
- Updated dependencies [b5980f4]
|
|
75
|
+
- Updated dependencies [8aad9fd]
|
|
76
|
+
- Updated dependencies [6719877]
|
|
77
|
+
- Updated dependencies [56ff091]
|
|
78
|
+
- Updated dependencies [0cbdca8]
|
|
79
|
+
- Updated dependencies [d229dfa]
|
|
80
|
+
- Updated dependencies [ecae400]
|
|
81
|
+
- Updated dependencies [4bc6c23]
|
|
82
|
+
- Updated dependencies [d3e738a]
|
|
83
|
+
- Updated dependencies [c3b01a7]
|
|
84
|
+
- Updated dependencies [7ed3360]
|
|
85
|
+
- Updated dependencies [0fa5e4d]
|
|
86
|
+
- Updated dependencies [5bfaabd]
|
|
87
|
+
- Updated dependencies [e06810e]
|
|
88
|
+
- Updated dependencies [ab3ad4f]
|
|
89
|
+
- Updated dependencies [c2fd122]
|
|
90
|
+
- Updated dependencies [e24d767]
|
|
91
|
+
- Updated dependencies [aca561a]
|
|
92
|
+
- Updated dependencies [48132f7]
|
|
93
|
+
- Updated dependencies [0ef9dfd]
|
|
94
|
+
- Updated dependencies [1d723e3]
|
|
95
|
+
- Updated dependencies [0109f54]
|
|
96
|
+
- Updated dependencies [7e5bb5d]
|
|
97
|
+
- Updated dependencies [fbc23e0]
|
|
98
|
+
- Updated dependencies [e6fdbdc]
|
|
99
|
+
- Updated dependencies [54233b1]
|
|
100
|
+
- Updated dependencies [97b63d7]
|
|
101
|
+
- Updated dependencies [6bb454a]
|
|
102
|
+
- Updated dependencies [523be48]
|
|
103
|
+
- Updated dependencies [7e2b7e9]
|
|
104
|
+
- Updated dependencies [c1e1e6b]
|
|
105
|
+
- @object-ui/components@17.4.0
|
|
106
|
+
- @object-ui/react@17.4.0
|
|
107
|
+
- @object-ui/core@17.4.0
|
|
108
|
+
- @object-ui/types@17.4.0
|
|
109
|
+
|
|
110
|
+
## 17.3.0
|
|
111
|
+
|
|
112
|
+
### Patch Changes
|
|
113
|
+
|
|
114
|
+
- Updated dependencies [18cd432]
|
|
115
|
+
- Updated dependencies [532cf8b]
|
|
116
|
+
- Updated dependencies [680080a]
|
|
117
|
+
- Updated dependencies [a7651e6]
|
|
118
|
+
- Updated dependencies [d915c47]
|
|
119
|
+
- Updated dependencies [b71fc92]
|
|
120
|
+
- Updated dependencies [34595eb]
|
|
121
|
+
- Updated dependencies [3889ffb]
|
|
122
|
+
- Updated dependencies [5781fb1]
|
|
123
|
+
- Updated dependencies [9e9e9a9]
|
|
124
|
+
- Updated dependencies [56409c2]
|
|
125
|
+
- Updated dependencies [042e09d]
|
|
126
|
+
- Updated dependencies [9cbcbf4]
|
|
127
|
+
- Updated dependencies [85c4c9c]
|
|
128
|
+
- Updated dependencies [fd54c3e]
|
|
129
|
+
- Updated dependencies [4eeb932]
|
|
130
|
+
- Updated dependencies [23018cc]
|
|
131
|
+
- Updated dependencies [53811d1]
|
|
132
|
+
- Updated dependencies [d915c47]
|
|
133
|
+
- Updated dependencies [f44d872]
|
|
134
|
+
- Updated dependencies [509104a]
|
|
135
|
+
- Updated dependencies [825bbe3]
|
|
136
|
+
- Updated dependencies [5dd0127]
|
|
137
|
+
- Updated dependencies [06632e9]
|
|
138
|
+
- Updated dependencies [a4cff5b]
|
|
139
|
+
- Updated dependencies [175bd79]
|
|
140
|
+
- Updated dependencies [f833d3a]
|
|
141
|
+
- Updated dependencies [2a9513d]
|
|
142
|
+
- Updated dependencies [71be406]
|
|
143
|
+
- Updated dependencies [d22ae31]
|
|
144
|
+
- Updated dependencies [8d8094a]
|
|
145
|
+
- @object-ui/core@17.3.0
|
|
146
|
+
- @object-ui/components@17.3.0
|
|
147
|
+
- @object-ui/types@17.3.0
|
|
148
|
+
- @object-ui/react@17.3.0
|
|
149
|
+
|
|
3
150
|
## 17.2.0
|
|
4
151
|
|
|
5
152
|
### Patch Changes
|
|
@@ -907,6 +1054,7 @@
|
|
|
907
1054
|
Library builds (vite lib mode) now externalize every non-relative import instead of bundling third-party CJS dependencies into the published dist. This avoids inlined `require("react")` / `require("react-dom")` calls that cause `Calling \`require\` for "react" in an environment that doesn't expose the \`require\` function` runtime errors when consumer apps re-bundle the published dist.
|
|
908
1055
|
|
|
909
1056
|
Specifically fixes:
|
|
1057
|
+
|
|
910
1058
|
- `@object-ui/plugin-dashboard` no longer inlines `react-grid-layout` (and its transitive `react-draggable` / `react-resizable` CJS bundles). `react-grid-layout` is now declared as a peer dependency so consumers install a single ESM-friendly copy.
|
|
911
1059
|
- `@object-ui/components`, `@object-ui/plugin-calendar`, `@object-ui/plugin-charts`, `@object-ui/plugin-designer` no longer inline `react-i18next` / `i18next` / `use-sync-external-store` CJS shims.
|
|
912
1060
|
- All plugin packages now use a unified `external: (id) => !/^[./]/.test(id) && !id.startsWith(__dirname)` rule, ensuring future additions of CJS deps are automatically externalized.
|
|
@@ -1135,6 +1283,7 @@
|
|
|
1135
1283
|
- New plugin-object and ObjectQL SDK updates
|
|
1136
1284
|
|
|
1137
1285
|
**Added:**
|
|
1286
|
+
|
|
1138
1287
|
- New Plugin: @object-ui/plugin-object - ObjectQL plugin for automatic table and form generation
|
|
1139
1288
|
- ObjectTable: Auto-generates tables from ObjectQL object schemas
|
|
1140
1289
|
- ObjectForm: Auto-generates forms from ObjectQL object schemas with create/edit/view modes
|
|
@@ -1143,6 +1292,7 @@
|
|
|
1143
1292
|
- ObjectQL Integration: Enhanced ObjectQLDataSource with getObjectSchema() method using MetadataApiClient
|
|
1144
1293
|
|
|
1145
1294
|
**Changed:**
|
|
1295
|
+
|
|
1146
1296
|
- Updated @objectql/sdk from ^1.8.3 to ^1.9.1
|
|
1147
1297
|
- Updated @objectql/types from ^1.8.3 to ^1.9.1
|
|
1148
1298
|
|
|
@@ -1159,6 +1309,7 @@
|
|
|
1159
1309
|
- Patch release: Add automated changeset workflow and CI/CD improvements
|
|
1160
1310
|
|
|
1161
1311
|
This release includes infrastructure improvements:
|
|
1312
|
+
|
|
1162
1313
|
- Added changeset-based version management
|
|
1163
1314
|
- Enhanced CI/CD workflows with GitHub Actions
|
|
1164
1315
|
- Improved documentation for contributing and releasing
|
package/README.md
CHANGED
|
@@ -110,17 +110,6 @@ pnpm build
|
|
|
110
110
|
# The package will generate proper ESM and UMD builds with lazy loading preserved
|
|
111
111
|
```
|
|
112
112
|
|
|
113
|
-
<!-- release-metadata:v3.3.0 -->
|
|
114
|
-
|
|
115
|
-
## Compatibility
|
|
116
|
-
|
|
117
|
-
- **React:** 18.x or 19.x
|
|
118
|
-
- **Node.js:** ≥ 18
|
|
119
|
-
- **TypeScript:** ≥ 5.0 (strict mode)
|
|
120
|
-
- **`@objectstack/spec`:** ^3.3.0
|
|
121
|
-
- **`@objectstack/client`:** ^3.3.0
|
|
122
|
-
- **Tailwind CSS:** ≥ 3.4 (for packages with UI)
|
|
123
|
-
|
|
124
113
|
## Links
|
|
125
114
|
|
|
126
115
|
- 📚 [Documentation](https://www.objectui.org/docs/plugins/plugin-markdown)
|
package/dist/index.js
CHANGED
|
@@ -221,7 +221,15 @@ var I, L, R, z, B, V = g((() => {
|
|
|
221
221
|
[u, L]
|
|
222
222
|
], B = { pre({ node: t, children: n, ...r }) {
|
|
223
223
|
let i = e.Children.toArray(n)[0], o = e.isValidElement(i) && typeof i.props.className == "string" ? i.props.className : "";
|
|
224
|
-
|
|
224
|
+
if (/\blanguage-mermaid\b/.test(o)) {
|
|
225
|
+
let e = M(i.props.children);
|
|
226
|
+
return /* @__PURE__ */ a(S, { chart: e });
|
|
227
|
+
}
|
|
228
|
+
if (/\blanguage-metadata\b/.test(o)) {
|
|
229
|
+
let e = M(i.props.children);
|
|
230
|
+
return /* @__PURE__ */ a(P, { source: e });
|
|
231
|
+
}
|
|
232
|
+
return /* @__PURE__ */ a("pre", {
|
|
225
233
|
...r,
|
|
226
234
|
children: n
|
|
227
235
|
});
|
package/dist/index.umd.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(e,t){typeof exports==`object`&&typeof module<`u`?t(exports,require("react"),require("@object-ui/core"),require("@object-ui/components"),require("react/jsx-runtime"),require("github-slugger"),require("react-markdown"),require("remark-gfm"),require("remark-github-blockquote-alert"),require("rehype-sanitize"),require("rehype-slug"),require("rehype-highlight"),require("rehype-autolink-headings")):typeof define==`function`&&define.amd?define([`exports`,`react`,`@object-ui/core`,`@object-ui/components`,`react/jsx-runtime`,`github-slugger`,`react-markdown`,`remark-gfm`,`remark-github-blockquote-alert`,`rehype-sanitize`,`rehype-slug`,`rehype-highlight`,`rehype-autolink-headings`],t):(e=typeof globalThis<`u`?globalThis:e||self,t(e.ObjectUIPluginMarkdown={},e.React,e.ObjectUICore,e.ObjectUIComponents,e.react_jsx_runtime,e.github_slugger,e.ReactMarkdown,e.remarkGfm,e.remarkGithubBlockquoteAlert,e.rehypeSanitize,e.rehypeSlug,e.rehypeHighlight,e.rehypeAutolinkHeadings))})(this,function(e,t,n,r,i,a,o,s,c,l,u,d,f){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var p=Object.create,m=Object.defineProperty,h=Object.getOwnPropertyDescriptor,g=Object.getOwnPropertyNames,_=Object.getPrototypeOf,v=Object.prototype.hasOwnProperty,y=(e,t,n)=>()=>{if(n)throw n[0];try{return e&&(t=e(e=0)),t}catch(e){throw n=[e],e}},b=(e,t)=>{let n={};for(var r in e)m(n,r,{get:e[r],enumerable:!0});return t||m(n,Symbol.toStringTag,{value:`Module`}),n},x=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var i=g(t),a=0,o=i.length,s;a<o;a++)s=i[a],!v.call(e,s)&&s!==n&&m(e,s,{get:(e=>t[e]).bind(null,s),enumerable:!(r=h(t,s))||r.enumerable});return e},S=(e,t,n)=>(n=e==null?{}:p(_(e)),x(t||!e||!e.__esModule?m(n,`default`,{value:e,enumerable:!0}):n,e));t=S(t,1),a=S(a,1),o=S(o,1),s=S(s,1),l=S(l,1),u=S(u,1),d=S(d,1),f=S(f,1);function C(e){return e.replace(/!\[[^\]]*\]\([^)]*\)/g,``).replace(/\[([^\]]+)\]\([^)]*\)/g,`$1`).replace(/`([^`]+)`/g,`$1`).replace(/(\*\*|__)(.*?)\1/g,`$2`).replace(/(\*|_)(.*?)\1/g,`$2`).replace(/<[^>]+>/g,``).trim()}function w(e,t){let n=t?.minDepth??2,r=t?.maxDepth??3,i=new a.default,o=[],s=null;for(let t of(e??``).split(/\r?\n/)){let e=t.match(/^\s{0,3}(`{3,}|~{3,})/);if(e){let t=e[1][0];s===null?s=t:t===s&&(s=null);continue}if(s!==null)continue;let a=t.match(/^(#{1,6})\s+(.+?)\s*#*\s*$/);if(!a)continue;let c=a[1].length,l=C(a[2]);if(!l)continue;let u=i.slug(l);c>=n&&c<=r&&o.push({depth:c,text:l,id:u})}return o}function T(){return O||=import(`mermaid`).then(e=>e.default),O}function E(){return typeof document<`u`&&document.documentElement.classList.contains(`dark`)}function D({chart:e}){let[n,r]=t.useState(``),[a,o]=t.useState(null),[s,c]=t.useState(E);return t.useEffect(()=>{if(typeof document>`u`)return;let e=document.documentElement,t=new MutationObserver(()=>c(E()));return t.observe(e,{attributes:!0,attributeFilter:[`class`]}),()=>t.disconnect()},[]),t.useEffect(()=>{let t=!1,n=e.trim();if(!n){r(``),o(null);return}return T().then(async e=>{e.initialize({startOnLoad:!1,securityLevel:`strict`,theme:s?`dark`:`default`});let i=`os-mermaid-${k+=1}`,{svg:a}=await e.render(i,n);t||(r(a),o(null))}).catch(e=>{t||o(e instanceof Error?e.message:String(e))}),()=>{t=!0}},[e,s]),a?(0,i.jsx)(`pre`,{"data-mermaid":!0,"data-mermaid-error":!0,className:`my-4 overflow-auto rounded border border-destructive/40 bg-muted p-3 text-xs`,children:(0,i.jsx)(`code`,{children:e})}):n?(0,i.jsx)(`div`,{"data-mermaid":!0,role:`img`,className:`my-4 flex justify-center overflow-auto [&_svg]:h-auto [&_svg]:max-w-full`,dangerouslySetInnerHTML:{__html:n}}):(0,i.jsx)(`div`,{"data-mermaid":!0,"data-mermaid-pending":!0,className:`my-4 text-sm text-muted-foreground`,children:(0,i.jsx)(`pre`,{className:`sr-only`,children:e})})}var O,k,A=y((()=>{O=null,k=0}));function j(){if(typeof document>`u`||document.getElementById(M))return;let e=document.createElement(`style`);e.id=M,e.textContent=N,document.head.appendChild(e)}var M,N,P=y((()=>{M=`os-markdown-styles`,N=`
|
|
1
|
+
(function(e,t){typeof exports==`object`&&typeof module<`u`?t(exports,require("react"),require("@object-ui/core"),require("@object-ui/components"),require("react/jsx-runtime"),require("github-slugger"),require("react-markdown"),require("remark-gfm"),require("remark-github-blockquote-alert"),require("rehype-sanitize"),require("rehype-slug"),require("rehype-highlight"),require("rehype-autolink-headings")):typeof define==`function`&&define.amd?define([`exports`,`react`,`@object-ui/core`,`@object-ui/components`,`react/jsx-runtime`,`github-slugger`,`react-markdown`,`remark-gfm`,`remark-github-blockquote-alert`,`rehype-sanitize`,`rehype-slug`,`rehype-highlight`,`rehype-autolink-headings`],t):(e=typeof globalThis<`u`?globalThis:e||self,t(e.ObjectUIPluginMarkdown={},e.React,e.ObjectUICore,e.ObjectUIComponents,e.react_jsx_runtime,e.github_slugger,e.ReactMarkdown,e.remarkGfm,e.remarkGithubBlockquoteAlert,e.rehypeSanitize,e.rehypeSlug,e.rehypeHighlight,e.rehypeAutolinkHeadings))})(this,function(e,t,n,r,i,a,o,s,c,l,u,d,f){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var p=Object.create,m=Object.defineProperty,h=Object.getOwnPropertyDescriptor,g=Object.getOwnPropertyNames,_=Object.getPrototypeOf,v=Object.prototype.hasOwnProperty,y=(e,t,n)=>()=>{if(n)throw n[0];try{return e&&(t=e(e=0)),t}catch(e){throw n=[e],e}},b=(e,t)=>{let n={};for(var r in e)m(n,r,{get:e[r],enumerable:!0});return t||m(n,Symbol.toStringTag,{value:`Module`}),n},x=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var i=g(t),a=0,o=i.length,s;a<o;a++)s=i[a],!v.call(e,s)&&s!==n&&m(e,s,{get:(e=>t[e]).bind(null,s),enumerable:!(r=h(t,s))||r.enumerable});return e},S=(e,t,n)=>(n=e==null?{}:p(_(e)),x(t||!e||!e.__esModule||!v.call(e,`default`)?m(n,`default`,{value:e,enumerable:!0}):n,e));t=S(t,1),a=S(a,1),o=S(o,1),s=S(s,1),l=S(l,1),u=S(u,1),d=S(d,1),f=S(f,1);function C(e){return e.replace(/!\[[^\]]*\]\([^)]*\)/g,``).replace(/\[([^\]]+)\]\([^)]*\)/g,`$1`).replace(/`([^`]+)`/g,`$1`).replace(/(\*\*|__)(.*?)\1/g,`$2`).replace(/(\*|_)(.*?)\1/g,`$2`).replace(/<[^>]+>/g,``).trim()}function w(e,t){let n=t?.minDepth??2,r=t?.maxDepth??3,i=new a.default,o=[],s=null;for(let t of(e??``).split(/\r?\n/)){let e=t.match(/^\s{0,3}(`{3,}|~{3,})/);if(e){let t=e[1][0];s===null?s=t:t===s&&(s=null);continue}if(s!==null)continue;let a=t.match(/^(#{1,6})\s+(.+?)\s*#*\s*$/);if(!a)continue;let c=a[1].length,l=C(a[2]);if(!l)continue;let u=i.slug(l);c>=n&&c<=r&&o.push({depth:c,text:l,id:u})}return o}function T(){return O||=import(`mermaid`).then(e=>e.default),O}function E(){return typeof document<`u`&&document.documentElement.classList.contains(`dark`)}function D({chart:e}){let[n,r]=t.useState(``),[a,o]=t.useState(null),[s,c]=t.useState(E);return t.useEffect(()=>{if(typeof document>`u`)return;let e=document.documentElement,t=new MutationObserver(()=>c(E()));return t.observe(e,{attributes:!0,attributeFilter:[`class`]}),()=>t.disconnect()},[]),t.useEffect(()=>{let t=!1,n=e.trim();if(!n){r(``),o(null);return}return T().then(async e=>{e.initialize({startOnLoad:!1,securityLevel:`strict`,theme:s?`dark`:`default`});let i=`os-mermaid-${k+=1}`,{svg:a}=await e.render(i,n);t||(r(a),o(null))}).catch(e=>{t||o(e instanceof Error?e.message:String(e))}),()=>{t=!0}},[e,s]),a?(0,i.jsx)(`pre`,{"data-mermaid":!0,"data-mermaid-error":!0,className:`my-4 overflow-auto rounded border border-destructive/40 bg-muted p-3 text-xs`,children:(0,i.jsx)(`code`,{children:e})}):n?(0,i.jsx)(`div`,{"data-mermaid":!0,role:`img`,className:`my-4 flex justify-center overflow-auto [&_svg]:h-auto [&_svg]:max-w-full`,dangerouslySetInnerHTML:{__html:n}}):(0,i.jsx)(`div`,{"data-mermaid":!0,"data-mermaid-pending":!0,className:`my-4 text-sm text-muted-foreground`,children:(0,i.jsx)(`pre`,{className:`sr-only`,children:e})})}var O,k,A=y((()=>{O=null,k=0}));function j(){if(typeof document>`u`||document.getElementById(M))return;let e=document.createElement(`style`);e.id=M,e.textContent=N,document.head.appendChild(e)}var M,N,P=y((()=>{M=`os-markdown-styles`,N=`
|
|
2
2
|
.os-markdown .md-anchor {
|
|
3
3
|
margin-left: 0.4ch;
|
|
4
4
|
color: var(--muted-foreground);
|
|
@@ -117,7 +117,7 @@
|
|
|
117
117
|
.os-markdown table th:last-child,
|
|
118
118
|
.os-markdown table td:last-child { padding-inline-end: 0.6666667em; }
|
|
119
119
|
`})),F=b({default:()=>B,parseMetadataFence:()=>R});function I(){let e=e=>typeof e==`string`?e.split(/\s+/).filter(Boolean):Array.isArray(e)?e:[],t=n=>{if(!n||typeof n!=`object`)return;let r=n.properties;if(r&&(typeof r.class==`string`||typeof r.className==`string`)&&(r.className=[...e(r.className),...e(r.class)],delete r.class),Array.isArray(n.children))for(let e of n.children)t(e)};return e=>t(e)}function L(e){return typeof e==`string`?e:typeof e==`number`?String(e):Array.isArray(e)?e.map(L).join(``):t.isValidElement(e)?L(e.props.children):``}function R(e){let t={};for(let n of e.split(`
|
|
120
|
-
`)){let e=n.trim();if(!e||e.startsWith(`#`))continue;let r=e.indexOf(`:`);if(r<1)continue;let i=e.slice(0,r).trim(),a=e.slice(r+1).trim();(a.startsWith(`"`)&&a.endsWith(`"`)||a.startsWith(`'`)&&a.endsWith(`'`))&&(a=a.slice(1,-1)),i&&(t[i]=a)}return t}function z({source:e}){let r=t.useMemo(()=>R(e),[e]),a=n.ComponentRegistry.get(`element:metadata_viewer`);return a?(0,i.jsx)(`div`,{className:`not-prose my-4`,children:(0,i.jsx)(a,{schema:{type:`element:metadata_viewer`,properties:r}})}):(0,i.jsx)(`pre`,{children:(0,i.jsx)(`code`,{children:e})})}function B({content:e,className:t}){return j(),(0,i.jsx)(`div`,{"data-slot":`markdown`,className:((...e)=>e.filter(Boolean).join(` `))(`prose prose-sm dark:prose-invert max-w-none`,`prose-headings:font-semibold prose-headings:tracking-tight`,`prose-h1:text-3xl prose-h2:text-2xl prose-h3:text-xl`,`prose-p:leading-relaxed prose-p:text-foreground`,`prose-a:text-primary prose-a:no-underline hover:prose-a:underline`,`prose-code:text-foreground prose-code:bg-muted prose-code:px-1 prose-code:py-0.5 prose-code:rounded prose-code:before:content-none prose-code:after:content-none`,`prose-pre:bg-muted prose-pre:text-foreground prose-pre:border`,`prose-blockquote:border-l-primary prose-blockquote:text-muted-foreground`,`prose-strong:text-foreground prose-strong:font-semibold`,`prose-ul:list-disc prose-ol:list-decimal`,`prose-li:text-foreground prose-li:marker:text-muted-foreground`,`prose-table:border prose-th:border prose-th:bg-muted prose-td:border`,`prose-img:rounded-md prose-img:border`,`os-markdown`,t),children:(0,i.jsx)(o.default,{remarkPlugins:U,rehypePlugins:W,components:G,disallowedElements:[`script`,`style`,`iframe`,`object`,`embed`],unwrapDisallowed:!0,children:e})})}var V,H,U,W,G,K=y((()=>{P(),A(),V=e=>(e??[]).filter(e=>!(Array.isArray(e)&&e[0]===`className`)),H={...l.defaultSchema,clobberPrefix:``,tagNames:[...l.defaultSchema.tagNames??[],`span`,`div`],attributes:{...l.defaultSchema.attributes,"*":[...l.defaultSchema.attributes?.[`*`]??[],`className`],a:[...V(l.defaultSchema.attributes?.a),`ariaHidden`,`tabIndex`]}},U=[s.default,c.remarkAlert],W=[u.default,I,[d.default,{detect:!0,ignoreMissing:!0,plainText:[`mermaid`,`metadata`]}],[f.default,{behavior:`append`,properties:{className:[`md-anchor`],ariaHidden:!0,tabIndex:-1},content:{type:`text`,value:`#`}}],[l.default,H]],G={pre({node:e,children:n,...r}){let a=t.Children.toArray(n)[0],o=t.isValidElement(a)&&typeof a.props.className==`string`?a.props.className:``;
|
|
120
|
+
`)){let e=n.trim();if(!e||e.startsWith(`#`))continue;let r=e.indexOf(`:`);if(r<1)continue;let i=e.slice(0,r).trim(),a=e.slice(r+1).trim();(a.startsWith(`"`)&&a.endsWith(`"`)||a.startsWith(`'`)&&a.endsWith(`'`))&&(a=a.slice(1,-1)),i&&(t[i]=a)}return t}function z({source:e}){let r=t.useMemo(()=>R(e),[e]),a=n.ComponentRegistry.get(`element:metadata_viewer`);return a?(0,i.jsx)(`div`,{className:`not-prose my-4`,children:(0,i.jsx)(a,{schema:{type:`element:metadata_viewer`,properties:r}})}):(0,i.jsx)(`pre`,{children:(0,i.jsx)(`code`,{children:e})})}function B({content:e,className:t}){return j(),(0,i.jsx)(`div`,{"data-slot":`markdown`,className:((...e)=>e.filter(Boolean).join(` `))(`prose prose-sm dark:prose-invert max-w-none`,`prose-headings:font-semibold prose-headings:tracking-tight`,`prose-h1:text-3xl prose-h2:text-2xl prose-h3:text-xl`,`prose-p:leading-relaxed prose-p:text-foreground`,`prose-a:text-primary prose-a:no-underline hover:prose-a:underline`,`prose-code:text-foreground prose-code:bg-muted prose-code:px-1 prose-code:py-0.5 prose-code:rounded prose-code:before:content-none prose-code:after:content-none`,`prose-pre:bg-muted prose-pre:text-foreground prose-pre:border`,`prose-blockquote:border-l-primary prose-blockquote:text-muted-foreground`,`prose-strong:text-foreground prose-strong:font-semibold`,`prose-ul:list-disc prose-ol:list-decimal`,`prose-li:text-foreground prose-li:marker:text-muted-foreground`,`prose-table:border prose-th:border prose-th:bg-muted prose-td:border`,`prose-img:rounded-md prose-img:border`,`os-markdown`,t),children:(0,i.jsx)(o.default,{remarkPlugins:U,rehypePlugins:W,components:G,disallowedElements:[`script`,`style`,`iframe`,`object`,`embed`],unwrapDisallowed:!0,children:e})})}var V,H,U,W,G,K=y((()=>{P(),A(),V=e=>(e??[]).filter(e=>!(Array.isArray(e)&&e[0]===`className`)),H={...l.defaultSchema,clobberPrefix:``,tagNames:[...l.defaultSchema.tagNames??[],`span`,`div`],attributes:{...l.defaultSchema.attributes,"*":[...l.defaultSchema.attributes?.[`*`]??[],`className`],a:[...V(l.defaultSchema.attributes?.a),`ariaHidden`,`tabIndex`]}},U=[s.default,c.remarkAlert],W=[u.default,I,[d.default,{detect:!0,ignoreMissing:!0,plainText:[`mermaid`,`metadata`]}],[f.default,{behavior:`append`,properties:{className:[`md-anchor`],ariaHidden:!0,tabIndex:-1},content:{type:`text`,value:`#`}}],[l.default,H]],G={pre({node:e,children:n,...r}){let a=t.Children.toArray(n)[0],o=t.isValidElement(a)&&typeof a.props.className==`string`?a.props.className:``;if(/\blanguage-mermaid\b/.test(o)){let e=L(a.props.children);return(0,i.jsx)(D,{chart:e})}if(/\blanguage-metadata\b/.test(o)){let e=L(a.props.children);return(0,i.jsx)(z,{source:e})}return(0,i.jsx)(`pre`,{...r,children:n})}}}));A();var q=t.default.lazy(()=>Promise.resolve().then(()=>(K(),F))),J=({schema:e})=>(0,i.jsx)(t.Suspense,{fallback:(0,i.jsx)(r.Skeleton,{className:`w-full h-[200px]`}),children:(0,i.jsx)(q,{content:e.content||``,className:e.className})});n.ComponentRegistry.register(`markdown`,J,{namespace:`plugin-markdown`,label:`Markdown`,category:`plugin`,inputs:[{name:`content`,type:`string`,label:`Markdown Content`,required:!0,inputType:`textarea`},{name:`className`,type:`string`,label:`CSS Class`}],defaultProps:{content:`# Hello World
|
|
121
121
|
|
|
122
122
|
This is a **markdown** component with *formatting* support.
|
|
123
123
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@object-ui/plugin-markdown",
|
|
3
|
-
"version": "17.
|
|
3
|
+
"version": "17.5.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"description": "Markdown rendering plugin for Object UI, powered by react-markdown",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
27
|
"github-slugger": "^2.0.0",
|
|
28
|
-
"mermaid": "^11.16.
|
|
28
|
+
"mermaid": "^11.16.1",
|
|
29
29
|
"react-markdown": "^10.1.0",
|
|
30
30
|
"rehype-autolink-headings": "^7.1.0",
|
|
31
31
|
"rehype-highlight": "^7.0.2",
|
|
@@ -33,21 +33,21 @@
|
|
|
33
33
|
"rehype-slug": "^6.0.0",
|
|
34
34
|
"remark-gfm": "^4.0.1",
|
|
35
35
|
"remark-github-blockquote-alert": "^2.1.0",
|
|
36
|
-
"@object-ui/components": "17.
|
|
37
|
-
"@object-ui/
|
|
38
|
-
"@object-ui/
|
|
39
|
-
"@object-ui/
|
|
36
|
+
"@object-ui/components": "17.5.0",
|
|
37
|
+
"@object-ui/core": "17.5.0",
|
|
38
|
+
"@object-ui/types": "17.5.0",
|
|
39
|
+
"@object-ui/react": "17.5.0"
|
|
40
40
|
},
|
|
41
41
|
"peerDependencies": {
|
|
42
42
|
"react": "^18.0.0 || ^19.0.0",
|
|
43
43
|
"react-dom": "^18.0.0 || ^19.0.0"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
|
-
"@types/react": "19.2.
|
|
47
|
-
"@types/react-dom": "19.2.
|
|
48
|
-
"@vitejs/plugin-react": "^6.0.
|
|
46
|
+
"@types/react": "19.2.18",
|
|
47
|
+
"@types/react-dom": "19.2.4",
|
|
48
|
+
"@vitejs/plugin-react": "^6.0.5",
|
|
49
49
|
"typescript": "^6.0.3",
|
|
50
|
-
"vite": "^8.1
|
|
50
|
+
"vite": "^8.2.1",
|
|
51
51
|
"vite-plugin-dts": "^5.0.3"
|
|
52
52
|
},
|
|
53
53
|
"keywords": [
|