@refrakt-md/react 0.9.3 → 0.9.4

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,10 +1,6 @@
1
1
  import type { ComponentType } from 'react';
2
2
  export type ElementOverrides = Record<string, ComponentType<any>>;
3
- /**
4
- * Default element overrides for the React renderer.
5
- *
6
- * - `table`: Wraps in scrollable container
7
- * - `pre`: Wraps code blocks in rf-codeblock structure for behaviors
8
- */
3
+ /** Base element overrides — empty by default. User-defined overrides can be
4
+ * passed to the Renderer. */
9
5
  export declare const elements: ElementOverrides;
10
6
  //# sourceMappingURL=elements.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"elements.d.ts","sourceRoot":"","sources":["../src/elements.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAI3C,MAAM,MAAM,gBAAgB,GAAG,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,GAAG,CAAC,CAAC,CAAC;AAElE;;;;;GAKG;AACH,eAAO,MAAM,QAAQ,EAAE,gBAGtB,CAAC"}
1
+ {"version":3,"file":"elements.d.ts","sourceRoot":"","sources":["../src/elements.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAE3C,MAAM,MAAM,gBAAgB,GAAG,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,GAAG,CAAC,CAAC,CAAC;AAElE;8BAC8B;AAC9B,eAAO,MAAM,QAAQ,EAAE,gBAAqB,CAAC"}
package/dist/elements.js CHANGED
@@ -1,13 +1,4 @@
1
- import { Table } from './elements/Table.js';
2
- import { Pre } from './elements/Pre.js';
3
- /**
4
- * Default element overrides for the React renderer.
5
- *
6
- * - `table`: Wraps in scrollable container
7
- * - `pre`: Wraps code blocks in rf-codeblock structure for behaviors
8
- */
9
- export const elements = {
10
- table: Table,
11
- pre: Pre,
12
- };
1
+ /** Base element overrides empty by default. User-defined overrides can be
2
+ * passed to the Renderer. */
3
+ export const elements = {};
13
4
  //# sourceMappingURL=elements.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"elements.js","sourceRoot":"","sources":["../src/elements.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAC5C,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAIxC;;;;;GAKG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAqB;IACzC,KAAK,EAAE,KAAK;IACZ,GAAG,EAAE,GAAG;CACR,CAAC"}
1
+ {"version":3,"file":"elements.js","sourceRoot":"","sources":["../src/elements.ts"],"names":[],"mappings":"AAIA;8BAC8B;AAC9B,MAAM,CAAC,MAAM,QAAQ,GAAqB,EAAE,CAAC"}
package/dist/index.d.ts CHANGED
@@ -5,6 +5,4 @@ export { registry } from './registry.js';
5
5
  export type { ComponentRegistry } from './registry.js';
6
6
  export { elements } from './elements.js';
7
7
  export type { ElementOverrides } from './elements.js';
8
- export { Table } from './elements/Table.js';
9
- export { Pre } from './elements/Pre.js';
10
8
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,YAAY,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAGnD,YAAY,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAG7C,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,YAAY,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAGvD,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,YAAY,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAGtD,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAC5C,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,YAAY,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAGnD,YAAY,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAG7C,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,YAAY,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAGvD,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,YAAY,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC"}
package/dist/index.js CHANGED
@@ -4,7 +4,4 @@ export { Renderer } from './Renderer.js';
4
4
  export { registry } from './registry.js';
5
5
  // Element overrides
6
6
  export { elements } from './elements.js';
7
- // Element override components
8
- export { Table } from './elements/Table.js';
9
- export { Pre } from './elements/Pre.js';
10
7
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,WAAW;AACX,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAMzC,qBAAqB;AACrB,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAGzC,oBAAoB;AACpB,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAGzC,8BAA8B;AAC9B,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAC5C,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,WAAW;AACX,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAMzC,qBAAqB;AACrB,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAGzC,oBAAoB;AACpB,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@refrakt-md/react",
3
3
  "description": "React renderer for refrakt.md content — ADR-008 component interface with props and named slots",
4
- "version": "0.9.3",
4
+ "version": "0.9.4",
5
5
  "type": "module",
6
6
  "license": "MIT",
7
7
  "repository": {
@@ -29,8 +29,8 @@
29
29
  "build": "tsc"
30
30
  },
31
31
  "dependencies": {
32
- "@refrakt-md/transform": "0.9.3",
33
- "@refrakt-md/types": "0.9.3"
32
+ "@refrakt-md/transform": "0.9.4",
33
+ "@refrakt-md/types": "0.9.4"
34
34
  },
35
35
  "devDependencies": {
36
36
  "react": "^19.0.0",
@@ -1,15 +0,0 @@
1
- import type { ReactNode } from 'react';
2
- import type { SerializedTag } from '@refrakt-md/types';
3
- interface PreProps {
4
- tag: SerializedTag;
5
- children: ReactNode;
6
- }
7
- /**
8
- * Pre element override — wraps code blocks in the rf-codeblock structure
9
- * that @refrakt-md/behaviors enhances with a copy button.
10
- */
11
- export declare function Pre({ tag, children }: PreProps): import("react").DetailedReactHTMLElement<Record<string, any>, HTMLElement> | import("react").DetailedReactHTMLElement<{
12
- className: string;
13
- }, HTMLElement>;
14
- export {};
15
- //# sourceMappingURL=Pre.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Pre.d.ts","sourceRoot":"","sources":["../../src/elements/Pre.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAEvD,UAAU,QAAQ;IACjB,GAAG,EAAE,aAAa,CAAC;IACnB,QAAQ,EAAE,SAAS,CAAC;CACpB;AAED;;;GAGG;AACH,wBAAgB,GAAG,CAAC,EAAE,GAAG,EAAE,QAAQ,EAAE,EAAE,QAAQ;;gBAY9C"}
@@ -1,27 +0,0 @@
1
- import { createElement } from 'react';
2
- /**
3
- * Pre element override — wraps code blocks in the rf-codeblock structure
4
- * that @refrakt-md/behaviors enhances with a copy button.
5
- */
6
- export function Pre({ tag, children }) {
7
- const isCodeBlock = 'data-language' in (tag.attributes || {});
8
- const attrs = filterAttrs(tag.attributes);
9
- if (isCodeBlock) {
10
- return createElement('div', { className: 'rf-codeblock' }, createElement('pre', attrs, children));
11
- }
12
- return createElement('pre', attrs, children);
13
- }
14
- function filterAttrs(attrs) {
15
- const result = {};
16
- for (const [k, v] of Object.entries(attrs)) {
17
- if (k === '$$mdtype' || v === undefined || v === null || v === false)
18
- continue;
19
- if (k === 'class') {
20
- result.className = v;
21
- continue;
22
- }
23
- result[k] = v === true ? '' : v;
24
- }
25
- return result;
26
- }
27
- //# sourceMappingURL=Pre.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Pre.js","sourceRoot":"","sources":["../../src/elements/Pre.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAStC;;;GAGG;AACH,MAAM,UAAU,GAAG,CAAC,EAAE,GAAG,EAAE,QAAQ,EAAY;IAC9C,MAAM,WAAW,GAAG,eAAe,IAAI,CAAC,GAAG,CAAC,UAAU,IAAI,EAAE,CAAC,CAAC;IAE9D,MAAM,KAAK,GAAG,WAAW,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;IAE1C,IAAI,WAAW,EAAE,CAAC;QACjB,OAAO,aAAa,CAAC,KAAK,EAAE,EAAE,SAAS,EAAE,cAAc,EAAE,EACxD,aAAa,CAAC,KAAK,EAAE,KAAK,EAAE,QAAQ,CAAC,CACrC,CAAC;IACH,CAAC;IAED,OAAO,aAAa,CAAC,KAAK,EAAE,KAAK,EAAE,QAAQ,CAAC,CAAC;AAC9C,CAAC;AAED,SAAS,WAAW,CAAC,KAA0B;IAC9C,MAAM,MAAM,GAAwB,EAAE,CAAC;IACvC,KAAK,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;QAC5C,IAAI,CAAC,KAAK,UAAU,IAAI,CAAC,KAAK,SAAS,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,KAAK,KAAK;YAAE,SAAS;QAC/E,IAAI,CAAC,KAAK,OAAO,EAAE,CAAC;YAAC,MAAM,CAAC,SAAS,GAAG,CAAC,CAAC;YAAC,SAAS;QAAC,CAAC;QACtD,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,KAAK,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;IACjC,CAAC;IACD,OAAO,MAAM,CAAC;AACf,CAAC"}
@@ -1,14 +0,0 @@
1
- import type { ReactNode } from 'react';
2
- import type { SerializedTag } from '@refrakt-md/types';
3
- interface TableProps {
4
- tag: SerializedTag;
5
- children: ReactNode;
6
- }
7
- /**
8
- * Table element override — wraps <table> in a scrollable container.
9
- */
10
- export declare function Table({ tag, children }: TableProps): import("react").DetailedReactHTMLElement<{
11
- className: string;
12
- }, HTMLElement>;
13
- export {};
14
- //# sourceMappingURL=Table.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Table.d.ts","sourceRoot":"","sources":["../../src/elements/Table.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAEvD,UAAU,UAAU;IACnB,GAAG,EAAE,aAAa,CAAC;IACnB,QAAQ,EAAE,SAAS,CAAC;CACpB;AAED;;GAEG;AACH,wBAAgB,KAAK,CAAC,EAAE,GAAG,EAAE,QAAQ,EAAE,EAAE,UAAU;;gBAIlD"}
@@ -1,21 +0,0 @@
1
- import { createElement } from 'react';
2
- /**
3
- * Table element override — wraps <table> in a scrollable container.
4
- */
5
- export function Table({ tag, children }) {
6
- return createElement('div', { className: 'rf-table-wrapper' }, createElement('table', filterAttrs(tag.attributes), children));
7
- }
8
- function filterAttrs(attrs) {
9
- const result = {};
10
- for (const [k, v] of Object.entries(attrs)) {
11
- if (k === '$$mdtype' || v === undefined || v === null || v === false)
12
- continue;
13
- if (k === 'class') {
14
- result.className = v;
15
- continue;
16
- }
17
- result[k] = v === true ? '' : v;
18
- }
19
- return result;
20
- }
21
- //# sourceMappingURL=Table.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Table.js","sourceRoot":"","sources":["../../src/elements/Table.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAStC;;GAEG;AACH,MAAM,UAAU,KAAK,CAAC,EAAE,GAAG,EAAE,QAAQ,EAAc;IAClD,OAAO,aAAa,CAAC,KAAK,EAAE,EAAE,SAAS,EAAE,kBAAkB,EAAE,EAC5D,aAAa,CAAC,OAAO,EAAE,WAAW,CAAC,GAAG,CAAC,UAAU,CAAC,EAAE,QAAQ,CAAC,CAC7D,CAAC;AACH,CAAC;AAED,SAAS,WAAW,CAAC,KAA0B;IAC9C,MAAM,MAAM,GAAwB,EAAE,CAAC;IACvC,KAAK,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;QAC5C,IAAI,CAAC,KAAK,UAAU,IAAI,CAAC,KAAK,SAAS,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,KAAK,KAAK;YAAE,SAAS;QAC/E,IAAI,CAAC,KAAK,OAAO,EAAE,CAAC;YAAC,MAAM,CAAC,SAAS,GAAG,CAAC,CAAC;YAAC,SAAS;QAAC,CAAC;QACtD,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,KAAK,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;IACjC,CAAC;IACD,OAAO,MAAM,CAAC;AACf,CAAC"}