@object-ui/plugin-markdown 0.3.0 → 0.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.
@@ -1,3 +1,10 @@
1
+ /**
2
+ * ObjectUI
3
+ * Copyright (c) 2024-present ObjectStack Inc.
4
+ *
5
+ * This source code is licensed under the MIT license found in the
6
+ * LICENSE file in the root directory of this source tree.
7
+ */
1
8
  /**
2
9
  * Props for the Markdown component implementation.
3
10
  *
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MarkdownImpl.d.ts","sourceRoot":"","sources":["../../src/MarkdownImpl.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAOH;;;;;GAKG;AACH,MAAM,WAAW,iBAAiB;IAChC;;OAEG;IACH,OAAO,EAAE,MAAM,CAAA;IAEf;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AAED;;;GAGG;AACH,MAAM,CAAC,OAAO,UAAU,YAAY,CAAC,EAAE,OAAO,EAAE,SAAS,EAAE,EAAE,iBAAiB,2CAoC7E"}
@@ -0,0 +1,19 @@
1
+ import { default as React } from 'react';
2
+ export type { MarkdownSchema } from './types';
3
+ export interface MarkdownRendererProps {
4
+ schema: {
5
+ type: string;
6
+ id?: string;
7
+ className?: string;
8
+ content?: string;
9
+ };
10
+ }
11
+ /**
12
+ * MarkdownRenderer - The public API for the markdown component
13
+ * This wrapper handles lazy loading internally using React.Suspense
14
+ */
15
+ export declare const MarkdownRenderer: React.FC<MarkdownRendererProps>;
16
+ export declare const markdownComponents: {
17
+ markdown: React.FC<MarkdownRendererProps>;
18
+ };
19
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAmB,MAAM,OAAO,CAAC;AAKxC,YAAY,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAM9C,MAAM,WAAW,qBAAqB;IACpC,MAAM,EAAE;QACN,IAAI,EAAE,MAAM,CAAC;QACb,EAAE,CAAC,EAAE,MAAM,CAAC;QACZ,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,OAAO,CAAC,EAAE,MAAM,CAAC;KAClB,CAAC;CACH;AAED;;;GAGG;AACH,eAAO,MAAM,gBAAgB,EAAE,KAAK,CAAC,EAAE,CAAC,qBAAqB,CAS5D,CAAC;AA2BF,eAAO,MAAM,kBAAkB;;CAE9B,CAAC"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAEnD;;;GAGG;AACH,MAAM,WAAW,cAAe,SAAQ,UAAU;IAChD,IAAI,EAAE,UAAU,CAAC;IAEjB;;;;;;;;;;;OAWG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB"}
package/package.json CHANGED
@@ -1,8 +1,18 @@
1
1
  {
2
2
  "name": "@object-ui/plugin-markdown",
3
- "version": "0.3.0",
3
+ "version": "0.5.0",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
+ "description": "Markdown rendering plugin for Object UI, powered by react-markdown",
7
+ "homepage": "https://www.objectui.org",
8
+ "repository": {
9
+ "type": "git",
10
+ "url": "https://github.com/objectstack-ai/objectui.git",
11
+ "directory": "packages/plugin-markdown"
12
+ },
13
+ "bugs": {
14
+ "url": "https://github.com/objectstack-ai/objectui/issues"
15
+ },
6
16
  "main": "dist/index.umd.cjs",
7
17
  "module": "dist/index.js",
8
18
  "types": "dist/index.d.ts",
@@ -17,19 +27,19 @@
17
27
  "react-markdown": "^10.1.0",
18
28
  "remark-gfm": "^4.0.1",
19
29
  "rehype-sanitize": "^6.0.0",
20
- "@object-ui/components": "0.3.0",
21
- "@object-ui/core": "0.3.0",
22
- "@object-ui/react": "0.3.0",
23
- "@object-ui/types": "0.3.0"
30
+ "@object-ui/components": "0.5.0",
31
+ "@object-ui/core": "0.5.0",
32
+ "@object-ui/react": "0.5.0",
33
+ "@object-ui/types": "0.5.0"
24
34
  },
25
35
  "peerDependencies": {
26
36
  "react": "^18.0.0 || ^19.0.0",
27
37
  "react-dom": "^18.0.0 || ^19.0.0"
28
38
  },
29
39
  "devDependencies": {
30
- "@types/react": "^18.3.12",
31
- "@types/react-dom": "^18.3.1",
32
- "@vitejs/plugin-react": "^4.2.1",
40
+ "@types/react": "^19.2.10",
41
+ "@types/react-dom": "^19.2.3",
42
+ "@vitejs/plugin-react": "^5.1.3",
33
43
  "typescript": "^5.9.3",
34
44
  "vite": "^7.3.1",
35
45
  "vite-plugin-dts": "^4.5.4"
@@ -1,3 +1,11 @@
1
+ /**
2
+ * ObjectUI
3
+ * Copyright (c) 2024-present ObjectStack Inc.
4
+ *
5
+ * This source code is licensed under the MIT license found in the
6
+ * LICENSE file in the root directory of this source tree.
7
+ */
8
+
1
9
  import * as React from "react"
2
10
  import ReactMarkdown from "react-markdown"
3
11
  import remarkGfm from "remark-gfm"
package/src/index.test.ts CHANGED
@@ -1,3 +1,11 @@
1
+ /**
2
+ * ObjectUI
3
+ * Copyright (c) 2024-present ObjectStack Inc.
4
+ *
5
+ * This source code is licensed under the MIT license found in the
6
+ * LICENSE file in the root directory of this source tree.
7
+ */
8
+
1
9
  import { describe, it, expect, beforeAll } from 'vitest';
2
10
  import { ComponentRegistry } from '@object-ui/core';
3
11
 
@@ -5,7 +13,7 @@ describe('Plugin Markdown', () => {
5
13
  // Import all renderers to register them
6
14
  beforeAll(async () => {
7
15
  await import('./index');
8
- });
16
+ }, 15000); // Increase timeout to 15 seconds for async import
9
17
 
10
18
  describe('markdown component', () => {
11
19
  it('should be registered in ComponentRegistry', () => {
package/src/index.tsx CHANGED
@@ -1,3 +1,11 @@
1
+ /**
2
+ * ObjectUI
3
+ * Copyright (c) 2024-present ObjectStack Inc.
4
+ *
5
+ * This source code is licensed under the MIT license found in the
6
+ * LICENSE file in the root directory of this source tree.
7
+ */
8
+
1
9
  import React, { Suspense } from 'react';
2
10
  import { ComponentRegistry } from '@object-ui/core';
3
11
  import { Skeleton } from '@object-ui/components';
@@ -38,6 +46,7 @@ ComponentRegistry.register(
38
46
  'markdown',
39
47
  MarkdownRenderer,
40
48
  {
49
+ namespace: 'plugin-markdown',
41
50
  label: 'Markdown',
42
51
  category: 'plugin',
43
52
  inputs: [
package/src/types.ts CHANGED
@@ -1,3 +1,11 @@
1
+ /**
2
+ * ObjectUI
3
+ * Copyright (c) 2024-present ObjectStack Inc.
4
+ *
5
+ * This source code is licensed under the MIT license found in the
6
+ * LICENSE file in the root directory of this source tree.
7
+ */
8
+
1
9
  import type { BaseSchema } from '@object-ui/types';
2
10
 
3
11
  /**
package/tsconfig.json CHANGED
@@ -1,11 +1,19 @@
1
1
  {
2
2
  "extends": "../../tsconfig.json",
3
3
  "compilerOptions": {
4
- "outDir": "./dist",
5
- "rootDir": "./src",
4
+ "outDir": "dist",
5
+ "jsx": "react-jsx",
6
+ "baseUrl": ".",
7
+ "paths": {
8
+ "@/*": ["src/*"]
9
+ },
10
+ // Removed rootDir to prevent file not under rootDir errors when importing from workspace dependencies
11
+ "noEmit": false,
12
+ "declaration": true,
6
13
  "composite": true,
7
- "declarationMap": true
14
+ "declarationMap": true,
15
+ "skipLibCheck": true
8
16
  },
9
- "include": ["src/**/*"],
17
+ "include": ["src"],
10
18
  "exclude": ["node_modules", "dist", "**/*.test.ts", "**/*.test.tsx"]
11
19
  }
package/vite.config.ts CHANGED
@@ -1,3 +1,11 @@
1
+ /**
2
+ * ObjectUI
3
+ * Copyright (c) 2024-present ObjectStack Inc.
4
+ *
5
+ * This source code is licensed under the MIT license found in the
6
+ * LICENSE file in the root directory of this source tree.
7
+ */
8
+
1
9
  import { defineConfig } from 'vite';
2
10
  import react from '@vitejs/plugin-react';
3
11
  import dts from 'vite-plugin-dts';
@@ -14,6 +22,13 @@ export default defineConfig({
14
22
  resolve: {
15
23
  alias: {
16
24
  '@': resolve(__dirname, './src'),
25
+ '@object-ui/core': resolve(__dirname, '../core/src'),
26
+ '@object-ui/types': resolve(__dirname, '../types/src'),
27
+ '@object-ui/react': resolve(__dirname, '../react/src'),
28
+ '@object-ui/components': resolve(__dirname, '../components/src'),
29
+ '@object-ui/fields': resolve(__dirname, '../fields/src'),
30
+ '@object-ui/plugin-dashboard': resolve(__dirname, '../plugin-dashboard/src'),
31
+ '@object-ui/plugin-grid': resolve(__dirname, '../plugin-grid/src'),
17
32
  },
18
33
  },
19
34
  build: {
@@ -35,4 +50,10 @@ export default defineConfig({
35
50
  },
36
51
  },
37
52
  },
53
+ test: {
54
+ globals: true,
55
+ environment: 'happy-dom',
56
+ setupFiles: ['../../vitest.setup.tsx'],
57
+ passWithNoTests: true,
58
+ },
38
59
  });
@@ -1 +0,0 @@
1
- {"version":3,"file":"MarkdownImpl.d.ts","sourceRoot":"","sources":["../src/MarkdownImpl.tsx"],"names":[],"mappings":"AAKA;;;;;GAKG;AACH,MAAM,WAAW,iBAAiB;IAChC;;OAEG;IACH,OAAO,EAAE,MAAM,CAAA;IAEf;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AAED;;;GAGG;AACH,MAAM,CAAC,OAAO,UAAU,YAAY,CAAC,EAAE,OAAO,EAAE,SAAS,EAAE,EAAE,iBAAiB,2CAoC7E"}