@refrakt-md/astro 0.9.2 → 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 +1 @@
1
- {"version":3,"file":"integration.d.ts","sourceRoot":"","sources":["../src/integration.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,OAAO,CAAC;AAG9C,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAEtD;;;;;GAKG;AACH,wBAAgB,OAAO,CAAC,OAAO,GAAE,mBAAwB,GAAG,gBAAgB,CAiC3E"}
1
+ {"version":3,"file":"integration.d.ts","sourceRoot":"","sources":["../src/integration.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,OAAO,CAAC;AAG9C,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAEtD;;;;;GAKG;AACH,wBAAgB,OAAO,CAAC,OAAO,GAAE,mBAAwB,GAAG,gBAAgB,CAoC3E"}
@@ -12,7 +12,7 @@ export function refrakt(options = {}) {
12
12
  return {
13
13
  name: '@refrakt-md/astro',
14
14
  hooks: {
15
- 'astro:config:setup'({ config, updateConfig, addWatchFile }) {
15
+ 'astro:config:setup'({ config, updateConfig, addWatchFile, injectScript }) {
16
16
  const refraktConfig = loadRefraktConfig(configPath);
17
17
  const noExternal = [
18
18
  ...CORE_PACKAGES,
@@ -30,6 +30,8 @@ export function refrakt(options = {}) {
30
30
  },
31
31
  },
32
32
  });
33
+ // Inject theme CSS so page templates don't hardcode a theme package
34
+ injectScript('page-ssr', `import '${refraktConfig.theme}';`);
33
35
  // Watch content directory for changes in dev mode
34
36
  const contentDir = resolve(config.root.pathname, refraktConfig.contentDir);
35
37
  addWatchFile(contentDir);
@@ -1 +1 @@
1
- {"version":3,"file":"integration.js","sourceRoot":"","sources":["../src/integration.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO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D,MAAM,UAAU,GAAG,OAAO,CAAC,UAAU,IAAI,uBAAuB,CAAC;IAEjE,OAAO;QACN,IAAI,EAAE,mBAAmB;QACzB,KAAK,EAAE;YACN,oBAAoB,CAAC,EAAE,MAAM,EAAE,YAAY,EAAE,YAAY,EAAE,YAAY,EAAE;gBACxE,MAAM,aAAa,GAAG,iBAAiB,CAAC,UAAU,CAAC,CAAC;gBAEpD,MAAM,UAAU,GAAG;oBAClB,GAAG,aAAa;oBAChB,mBAAmB;oBACnB,aAAa,CAAC,KAAK;oBACnB,GAAG,CAAC,aAAa,CAAC,QAAQ,IAAI,EAAE,CAAC;iBACjC,CAAC;gBAEF,YAAY,CAAC;oBACZ,IAAI,EAAE;wBACL,GAAG,EAAE;4BACJ,UAAU;4BACV,YAAY,EAAE;gCACb,OAAO,EAAE,CAAC,kBAAkB,CAAC;6BAC7B;yBACD;qBACD;iBACD,CAAC,CAAC;gBAEH,oEAAoE;gBACpE,YAAY,CAAC,UAAU,EAAE,WAAW,aAAa,CAAC,KAAK,IAAI,CAAC,CAAC;gBAE7D,kDAAkD;gBAClD,MAAM,UAAU,GAAG,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,QAAQ,EAAE,aAAa,CAAC,UAAU,CAAC,CAAC;gBAC3E,YAAY,CAAC,UAAU,CAAC,CAAC;YAC1B,CAAC;SACD;KACD,CAAC;AACH,CAAC"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@refrakt-md/astro",
3
3
  "description": "Astro integration for refrakt.md — render Markdoc runes in Astro projects",
4
- "version": "0.9.2",
4
+ "version": "0.9.4",
5
5
  "type": "module",
6
6
  "license": "MIT",
7
7
  "repository": {
@@ -22,24 +22,21 @@
22
22
  "default": "./dist/index.js"
23
23
  },
24
24
  "./BaseLayout.astro": "./src/BaseLayout.astro",
25
- "./RfRenderer.astro": "./src/RfRenderer.astro",
26
- "./elements/Table.astro": "./src/elements/Table.astro",
27
- "./elements/Pre.astro": "./src/elements/Pre.astro"
25
+ "./RfRenderer.astro": "./src/RfRenderer.astro"
28
26
  },
29
27
  "files": [
30
28
  "dist",
31
29
  "src/BaseLayout.astro",
32
- "src/RfRenderer.astro",
33
- "src/elements"
30
+ "src/RfRenderer.astro"
34
31
  ],
35
32
  "scripts": {
36
33
  "build": "tsc"
37
34
  },
38
35
  "dependencies": {
39
- "@refrakt-md/behaviors": "0.9.2",
40
- "@refrakt-md/content": "0.9.2",
41
- "@refrakt-md/transform": "0.9.2",
42
- "@refrakt-md/types": "0.9.2"
36
+ "@refrakt-md/behaviors": "0.9.4",
37
+ "@refrakt-md/content": "0.9.4",
38
+ "@refrakt-md/transform": "0.9.4",
39
+ "@refrakt-md/types": "0.9.4"
43
40
  },
44
41
  "devDependencies": {
45
42
  "astro": "^5.0.0"
@@ -1,22 +0,0 @@
1
- ---
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
- import type { SerializedTag } from '@refrakt-md/types';
7
-
8
- interface Props {
9
- tag: SerializedTag;
10
- }
11
-
12
- const { tag } = Astro.props;
13
- const isCodeBlock = 'data-language' in (tag.attributes || {});
14
- ---
15
-
16
- {isCodeBlock ? (
17
- <div class="rf-codeblock">
18
- <pre {...tag.attributes}><slot /></pre>
19
- </div>
20
- ) : (
21
- <pre {...tag.attributes}><slot /></pre>
22
- )}
@@ -1,24 +0,0 @@
1
- ---
2
- /**
3
- * Table element override — wraps <table> in a scrollable container.
4
- */
5
- import type { SerializedTag } from '@refrakt-md/types';
6
-
7
- interface Props {
8
- tag: SerializedTag;
9
- }
10
-
11
- const { tag } = Astro.props;
12
-
13
- // Filter attributes for HTML output
14
- const attrs = Object.entries(tag.attributes)
15
- .filter(([k, v]) => k !== '$$mdtype' && v !== undefined && v !== null && v !== false)
16
- .map(([k, v]) => `${k}="${String(v === true ? '' : v).replace(/"/g, '&quot;')}"`)
17
- .join(' ');
18
- ---
19
-
20
- <div class="rf-table-wrapper">
21
- <table {...tag.attributes}>
22
- <slot />
23
- </table>
24
- </div>