@yoamigo.com/core 0.1.15 → 0.2.2
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/{MarkdownText-BUTYfqXS.d.ts → MarkdownText-kV5IiAma.d.ts} +3 -3
- package/dist/index.d.ts +183 -6
- package/dist/index.js +1203 -138
- package/dist/plugin.js +31 -0
- package/dist/prod.d.ts +4 -4
- package/package.json +1 -1
package/dist/plugin.js
CHANGED
|
@@ -6,6 +6,37 @@ function yoamigoPlugin(options = {}) {
|
|
|
6
6
|
const templateDir = process.cwd();
|
|
7
7
|
const resolveFromTemplate = (relativePath) => path.resolve(templateDir, relativePath);
|
|
8
8
|
return [
|
|
9
|
+
// Content HMR plugin - enables hot reloading of content.ts without full page refresh
|
|
10
|
+
{
|
|
11
|
+
name: "yoamigo:content-hmr",
|
|
12
|
+
handleHotUpdate({ file, server }) {
|
|
13
|
+
if (!file.endsWith("/content.ts") && !file.endsWith("\\content.ts")) return;
|
|
14
|
+
server.ws.send({
|
|
15
|
+
type: "custom",
|
|
16
|
+
event: "yoamigo:content-update"
|
|
17
|
+
});
|
|
18
|
+
return [];
|
|
19
|
+
},
|
|
20
|
+
transform(code, id) {
|
|
21
|
+
if (!id.match(/\/main\.tsx?$/) && !id.match(/\\main\.tsx?$/)) return;
|
|
22
|
+
const hmrCode = `
|
|
23
|
+
// YoAmigo Content HMR - injected by yoamigo:content-hmr plugin
|
|
24
|
+
if (import.meta.hot) {
|
|
25
|
+
import.meta.hot.on('yoamigo:content-update', async () => {
|
|
26
|
+
try {
|
|
27
|
+
const { default: newContent } = await import('./content?t=' + Date.now())
|
|
28
|
+
const { registerContent } = await import('@yoamigo.com/core')
|
|
29
|
+
registerContent(newContent)
|
|
30
|
+
window.dispatchEvent(new CustomEvent('content-updated'))
|
|
31
|
+
} catch (err) {
|
|
32
|
+
console.error('[yoamigo:content-hmr] Failed to hot reload content:', err)
|
|
33
|
+
}
|
|
34
|
+
})
|
|
35
|
+
}
|
|
36
|
+
`;
|
|
37
|
+
return { code: code + "\n" + hmrCode, map: null };
|
|
38
|
+
}
|
|
39
|
+
},
|
|
9
40
|
{
|
|
10
41
|
name: "yoamigo:config",
|
|
11
42
|
config(config, { mode }) {
|
package/dist/prod.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export { a as ContentStore, E as ContentStoreMode, C as ContentStoreProvider, d as MarkdownText, e as MarkdownTextProps, P as PageInfo, b as StaticImage, c as StaticImageProps, M as StaticText, S as StaticTextProps, b as YaImage, c as YaImageProps, M as YaText, S as YaTextProps, u as useContentStore } from './MarkdownText-
|
|
1
|
+
export { a as ContentStore, E as ContentStoreMode, C as ContentStoreProvider, d as MarkdownText, e as MarkdownTextProps, P as PageInfo, b as StaticImage, c as StaticImageProps, M as StaticText, S as StaticTextProps, b as YaImage, c as YaImageProps, M as YaText, S as YaTextProps, u as useContentStore } from './MarkdownText-kV5IiAma.js';
|
|
2
2
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
3
|
-
import
|
|
3
|
+
import React__default from 'react';
|
|
4
4
|
export { Link, LinkProps, NavigateFunction, Router, RouterProps, useNavigate } from './router.js';
|
|
5
5
|
export { Route, Switch, useParams } from 'wouter';
|
|
6
6
|
export { A as AssetResolverFn, C as ContentRegistry, c as contentRegistry, a as getAllContent, g as getContent, h as hasContent, r as registerContent, b as resolveAssetUrl, s as setAssetResolver } from './asset-resolver-BnIvDkVv.js';
|
|
@@ -10,9 +10,9 @@ interface StaticLinkProps {
|
|
|
10
10
|
href?: string;
|
|
11
11
|
className?: string;
|
|
12
12
|
/** Inline styles to apply to the link element */
|
|
13
|
-
style?:
|
|
13
|
+
style?: React__default.CSSProperties;
|
|
14
14
|
as?: 'a' | 'span';
|
|
15
|
-
children?:
|
|
15
|
+
children?: React__default.ReactNode;
|
|
16
16
|
/** Optional click handler called after navigation */
|
|
17
17
|
onClick?: () => void;
|
|
18
18
|
}
|