@compiiile/compiiile 2.9.2 → 2.10.1
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/.compiiile/src/layouts/ThemeLoader.astro +4 -0
- package/README.md +3 -1
- package/bin/.compiiile/node_modules/.vite/deps_temp_6e4c3b91/@astrojs_vue_client__js.js +62 -0
- package/bin/.compiiile/node_modules/.vite/deps_temp_6e4c3b91/@astrojs_vue_client__js.js.map +7 -0
- package/bin/.compiiile/node_modules/.vite/deps_temp_6e4c3b91/astro___aria-query.js +7084 -0
- package/bin/.compiiile/node_modules/.vite/deps_temp_6e4c3b91/astro___aria-query.js.map +7 -0
- package/bin/.compiiile/node_modules/.vite/deps_temp_6e4c3b91/astro___axobject-query.js +3862 -0
- package/bin/.compiiile/node_modules/.vite/deps_temp_6e4c3b91/astro___axobject-query.js.map +7 -0
- package/bin/.compiiile/node_modules/.vite/deps_temp_6e4c3b91/chunk-5RSW42KR.js +45 -0
- package/bin/.compiiile/node_modules/.vite/deps_temp_6e4c3b91/chunk-5RSW42KR.js.map +7 -0
- package/bin/.compiiile/node_modules/.vite/deps_temp_6e4c3b91/chunk-MBCBSM2B.js +11402 -0
- package/bin/.compiiile/node_modules/.vite/deps_temp_6e4c3b91/chunk-MBCBSM2B.js.map +7 -0
- package/bin/.compiiile/node_modules/.vite/deps_temp_6e4c3b91/chunk-Y2F7D3TJ.js +9 -0
- package/bin/.compiiile/node_modules/.vite/deps_temp_6e4c3b91/chunk-Y2F7D3TJ.js.map +7 -0
- package/bin/.compiiile/node_modules/.vite/deps_temp_6e4c3b91/package.json +3 -0
- package/bin/.compiiile/node_modules/.vite/deps_temp_6e4c3b91/vue.js +324 -0
- package/bin/.compiiile/node_modules/.vite/deps_temp_6e4c3b91/vue.js.map +7 -0
- package/bin/.compiiile/node_modules/.vite/deps_temp_c6d3f53d/@astrojs_vue_client__js.js +62 -0
- package/bin/.compiiile/node_modules/.vite/deps_temp_c6d3f53d/@astrojs_vue_client__js.js.map +7 -0
- package/bin/.compiiile/node_modules/.vite/deps_temp_c6d3f53d/astro___aria-query.js +7084 -0
- package/bin/.compiiile/node_modules/.vite/deps_temp_c6d3f53d/astro___aria-query.js.map +7 -0
- package/bin/.compiiile/node_modules/.vite/deps_temp_c6d3f53d/astro___axobject-query.js +3862 -0
- package/bin/.compiiile/node_modules/.vite/deps_temp_c6d3f53d/astro___axobject-query.js.map +7 -0
- package/bin/.compiiile/node_modules/.vite/deps_temp_c6d3f53d/chunk-5RSW42KR.js +45 -0
- package/bin/.compiiile/node_modules/.vite/deps_temp_c6d3f53d/chunk-5RSW42KR.js.map +7 -0
- package/bin/.compiiile/node_modules/.vite/deps_temp_c6d3f53d/chunk-MBCBSM2B.js +11402 -0
- package/bin/.compiiile/node_modules/.vite/deps_temp_c6d3f53d/chunk-MBCBSM2B.js.map +7 -0
- package/bin/.compiiile/node_modules/.vite/deps_temp_c6d3f53d/chunk-Y2F7D3TJ.js +9 -0
- package/bin/.compiiile/node_modules/.vite/deps_temp_c6d3f53d/chunk-Y2F7D3TJ.js.map +7 -0
- package/bin/.compiiile/node_modules/.vite/deps_temp_c6d3f53d/package.json +3 -0
- package/bin/.compiiile/node_modules/.vite/deps_temp_c6d3f53d/vue.js +324 -0
- package/bin/.compiiile/node_modules/.vite/deps_temp_c6d3f53d/vue.js.map +7 -0
- package/bin/.compiiile/src/env.d.ts +1 -0
- package/bin/config.js +7 -6
- package/bin/vitePluginCompiiile/models/Context.js +14 -3
- package/package.json +1 -1
|
@@ -4,6 +4,10 @@ const { defaultTheme } = Astro.props
|
|
|
4
4
|
|
|
5
5
|
<script is:inline define:vars={{ defaultTheme }}>
|
|
6
6
|
const theme = (() => {
|
|
7
|
+
const themeQueryParameter = new URLSearchParams(window.location.search).get("theme")
|
|
8
|
+
if(themeQueryParameter && ["light", "dark"].includes(themeQueryParameter)){
|
|
9
|
+
return themeQueryParameter
|
|
10
|
+
}
|
|
7
11
|
if (typeof localStorage !== 'undefined' && localStorage.getItem('COMPIIILE_THEME')) {
|
|
8
12
|
return localStorage.getItem('COMPIIILE_THEME');
|
|
9
13
|
}
|
package/README.md
CHANGED
|
@@ -30,7 +30,7 @@ That's what Compiiile does. And it does it hassle-free !
|
|
|
30
30
|
- [x] :mag: **Full-text quick search with content preview**
|
|
31
31
|
- [x] :zap: Hot-reload content preview as you edit it
|
|
32
32
|
- [x] :tada: Supports MDX files: add your own components to your documentation
|
|
33
|
-
- [x] :bulb: Can serve as knowledge base
|
|
33
|
+
- [x] :bulb: Can serve as knowledge base, and handles symlinks to reuse content
|
|
34
34
|
- [x] :wrench: Customizable by env variables or config file, it's up to you
|
|
35
35
|
- [x] :star2: You get it, it simply does the job, period.
|
|
36
36
|
|
|
@@ -184,6 +184,8 @@ Other frontmatter keys are handled:
|
|
|
184
184
|
are [CSS text-align values](https://developer.mozilla.org/en-US/docs/Web/CSS/text-align) (`left`, `center`, ...). This
|
|
185
185
|
changes the default text alignment in slides. The default value is `center`.
|
|
186
186
|
|
|
187
|
+
> :bulb: You can override slides theme by passing it to a `theme` query parameter in your slide url (for example `/s/slides?theme=light`). See the `theme` config parameter below for valid values.
|
|
188
|
+
|
|
187
189
|
### Routing
|
|
188
190
|
|
|
189
191
|
The home page of Compiiile (`/`) points to a `README.md` file located at the root of your folder, or fallbacks to an `index.md` file.
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Suspense,
|
|
3
|
+
createApp,
|
|
4
|
+
createSSRApp,
|
|
5
|
+
defineComponent,
|
|
6
|
+
h
|
|
7
|
+
} from "./chunk-MBCBSM2B.js";
|
|
8
|
+
import "./chunk-Y2F7D3TJ.js";
|
|
9
|
+
|
|
10
|
+
// node_modules/@astrojs/vue/static-html.js
|
|
11
|
+
var StaticHtml = defineComponent({
|
|
12
|
+
props: {
|
|
13
|
+
value: String,
|
|
14
|
+
name: String,
|
|
15
|
+
hydrate: {
|
|
16
|
+
type: Boolean,
|
|
17
|
+
default: true
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
setup({ name, value, hydrate }) {
|
|
21
|
+
if (!value)
|
|
22
|
+
return () => null;
|
|
23
|
+
let tagName = hydrate ? "astro-slot" : "astro-static-slot";
|
|
24
|
+
return () => h(tagName, { name, innerHTML: value });
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
var static_html_default = StaticHtml;
|
|
28
|
+
|
|
29
|
+
// node_modules/@astrojs/vue/client.js
|
|
30
|
+
import { setup } from "virtual:@astrojs/vue/app";
|
|
31
|
+
var client_default = (element) => async (Component, props, slotted, { client }) => {
|
|
32
|
+
if (!element.hasAttribute("ssr"))
|
|
33
|
+
return;
|
|
34
|
+
const name = Component.name ? `${Component.name} Host` : void 0;
|
|
35
|
+
const slots = {};
|
|
36
|
+
for (const [key, value] of Object.entries(slotted)) {
|
|
37
|
+
slots[key] = () => h(static_html_default, { value, name: key === "default" ? void 0 : key });
|
|
38
|
+
}
|
|
39
|
+
const isHydrate = client !== "only";
|
|
40
|
+
const bootstrap = isHydrate ? createSSRApp : createApp;
|
|
41
|
+
const app = bootstrap({
|
|
42
|
+
name,
|
|
43
|
+
render() {
|
|
44
|
+
let content = h(Component, props, slots);
|
|
45
|
+
if (isAsync(Component.setup)) {
|
|
46
|
+
content = h(Suspense, null, content);
|
|
47
|
+
}
|
|
48
|
+
return content;
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
await setup(app);
|
|
52
|
+
app.mount(element, isHydrate);
|
|
53
|
+
element.addEventListener("astro:unmount", () => app.unmount(), { once: true });
|
|
54
|
+
};
|
|
55
|
+
function isAsync(fn) {
|
|
56
|
+
const constructor = fn == null ? void 0 : fn.constructor;
|
|
57
|
+
return constructor && constructor.name === "AsyncFunction";
|
|
58
|
+
}
|
|
59
|
+
export {
|
|
60
|
+
client_default as default
|
|
61
|
+
};
|
|
62
|
+
//# sourceMappingURL=@astrojs_vue_client__js.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../node_modules/@astrojs/vue/static-html.js", "../../../../../node_modules/@astrojs/vue/client.js"],
|
|
4
|
+
"sourcesContent": ["import { defineComponent, h } from 'vue';\n\n/**\n * Astro passes `children` as a string of HTML, so we need\n * a wrapper `div` to render that content as VNodes.\n *\n * This is the Vue + JSX equivalent of using `<div v-html=\"value\" />`\n */\nconst StaticHtml = defineComponent({\n\tprops: {\n\t\tvalue: String,\n\t\tname: String,\n\t\thydrate: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: true,\n\t\t},\n\t},\n\tsetup({ name, value, hydrate }) {\n\t\tif (!value) return () => null;\n\t\tlet tagName = hydrate ? 'astro-slot' : 'astro-static-slot';\n\t\treturn () => h(tagName, { name, innerHTML: value });\n\t},\n});\n\n/**\n * Other frameworks have `shouldComponentUpdate` in order to signal\n * that this subtree is entirely static and will not be updated\n *\n * Fortunately, Vue is smart enough to figure that out without any\n * help from us, so this just works out of the box!\n */\n\nexport default StaticHtml;\n", "import { Suspense, createApp, createSSRApp, h } from 'vue';\nimport StaticHtml from './static-html.js';\nimport { setup } from 'virtual:@astrojs/vue/app';\n\nexport default (element) =>\n\tasync (Component, props, slotted, { client }) => {\n\t\tif (!element.hasAttribute('ssr')) return;\n\n\t\t// Expose name on host component for Vue devtools\n\t\tconst name = Component.name ? `${Component.name} Host` : undefined;\n\t\tconst slots = {};\n\t\tfor (const [key, value] of Object.entries(slotted)) {\n\t\t\tslots[key] = () => h(StaticHtml, { value, name: key === 'default' ? undefined : key });\n\t\t}\n\n\t\tconst isHydrate = client !== 'only';\n\t\tconst bootstrap = isHydrate ? createSSRApp : createApp;\n\t\tconst app = bootstrap({\n\t\t\tname,\n\t\t\trender() {\n\t\t\t\tlet content = h(Component, props, slots);\n\t\t\t\t// related to https://github.com/withastro/astro/issues/6549\n\t\t\t\t// if the component is async, wrap it in a Suspense component\n\t\t\t\tif (isAsync(Component.setup)) {\n\t\t\t\t\tcontent = h(Suspense, null, content);\n\t\t\t\t}\n\t\t\t\treturn content;\n\t\t\t},\n\t\t});\n\t\tawait setup(app);\n\t\tapp.mount(element, isHydrate);\n\n\t\telement.addEventListener('astro:unmount', () => app.unmount(), { once: true });\n\t};\n\nfunction isAsync(fn) {\n\tconst constructor = fn?.constructor;\n\treturn constructor && constructor.name === 'AsyncFunction';\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;AAQA,IAAM,aAAa,gBAAgB;AAAA,EAClC,OAAO;AAAA,IACN,OAAO;AAAA,IACP,MAAM;AAAA,IACN,SAAS;AAAA,MACR,MAAM;AAAA,MACN,SAAS;AAAA,IACV;AAAA,EACD;AAAA,EACA,MAAM,EAAE,MAAM,OAAO,QAAQ,GAAG;AAC/B,QAAI,CAAC;AAAO,aAAO,MAAM;AACzB,QAAI,UAAU,UAAU,eAAe;AACvC,WAAO,MAAM,EAAE,SAAS,EAAE,MAAM,WAAW,MAAM,CAAC;AAAA,EACnD;AACD,CAAC;AAUD,IAAO,sBAAQ;;;AC9Bf,SAAS,aAAa;AAEtB,IAAO,iBAAQ,CAAC,YACf,OAAO,WAAW,OAAO,SAAS,EAAE,OAAO,MAAM;AAChD,MAAI,CAAC,QAAQ,aAAa,KAAK;AAAG;AAGlC,QAAM,OAAO,UAAU,OAAO,GAAG,UAAU,IAAI,UAAU;AACzD,QAAM,QAAQ,CAAC;AACf,aAAW,CAAC,KAAK,KAAK,KAAK,OAAO,QAAQ,OAAO,GAAG;AACnD,UAAM,GAAG,IAAI,MAAM,EAAE,qBAAY,EAAE,OAAO,MAAM,QAAQ,YAAY,SAAY,IAAI,CAAC;AAAA,EACtF;AAEA,QAAM,YAAY,WAAW;AAC7B,QAAM,YAAY,YAAY,eAAe;AAC7C,QAAM,MAAM,UAAU;AAAA,IACrB;AAAA,IACA,SAAS;AACR,UAAI,UAAU,EAAE,WAAW,OAAO,KAAK;AAGvC,UAAI,QAAQ,UAAU,KAAK,GAAG;AAC7B,kBAAU,EAAE,UAAU,MAAM,OAAO;AAAA,MACpC;AACA,aAAO;AAAA,IACR;AAAA,EACD,CAAC;AACD,QAAM,MAAM,GAAG;AACf,MAAI,MAAM,SAAS,SAAS;AAE5B,UAAQ,iBAAiB,iBAAiB,MAAM,IAAI,QAAQ,GAAG,EAAE,MAAM,KAAK,CAAC;AAC9E;AAED,SAAS,QAAQ,IAAI;AACpB,QAAM,cAAc,yBAAI;AACxB,SAAO,eAAe,YAAY,SAAS;AAC5C;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|