create-outsystems-astro 0.6.0 → 0.7.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.
- package/README.md +50 -11
- package/bin/cli.js +66 -5
- package/package.json +1 -1
- package/template/AGENTS.md +91 -4
- package/template/astro.config.mjs +14 -3
- package/template/bun.lock +202 -96
- package/template/deno.json +16 -1
- package/template/deno.lock +571 -309
- package/template/eslint.config.mjs +27 -2
- package/template/package-lock.json +760 -258
- package/template/package.json +38 -29
- package/template/patches/{@angular+build+21.2.0.patch → @angular+build+21.2.1.patch} +1 -10
- package/template/patches-deno/playwright+1.58.2.patch +26 -0
- package/template/playwright.config.ts +1 -1
- package/template/pnpm-lock.yaml +984 -599
- package/template/src/framework/angular/{Counter.component.ts → Demo.component.ts} +12 -5
- package/template/src/framework/angular/Store.component.ts +24 -0
- package/template/src/framework/preact/Demo.tsx +86 -0
- package/template/src/framework/preact/Store.tsx +31 -0
- package/template/src/framework/react/{Counter.tsx → Demo.tsx} +23 -17
- package/template/src/framework/react/Store.tsx +31 -0
- package/template/src/framework/svelte/{Counter.svelte → Demo.svelte} +8 -11
- package/template/src/framework/svelte/Store.svelte +22 -0
- package/template/src/framework/vue/{Counter.vue → Demo.vue} +7 -9
- package/template/src/framework/vue/Store.vue +28 -0
- package/template/src/images/angular.png +0 -0
- package/template/src/images/preact.png +0 -0
- package/template/src/images/react.png +0 -0
- package/template/src/images/svelte.png +0 -0
- package/template/src/images/vue.png +0 -0
- package/template/src/pages/angular/{angular-counter.astro → angular-demo.astro} +12 -5
- package/template/src/pages/multi/store.astro +22 -0
- package/template/src/pages/preact/preact-demo.astro +66 -0
- package/template/src/pages/react/{react-counter.astro → react-demo.astro} +12 -9
- package/template/src/pages/svelte/{svelte-counter.astro → svelte-demo.astro} +9 -9
- package/template/src/pages/vue/{vue-counter.astro → vue-demo.astro} +9 -15
- package/template/src/stores/framework.ts +10 -0
- package/template/src/styles/index.css +4 -0
- package/template/test/e2e/angular/angular-counter.spec.ts +7 -1
- package/template/test/e2e/preact/preact-counter.spec.ts +42 -0
- package/template/test/e2e/react/react-counter.spec.ts +2 -2
- package/template/test/e2e/svelte/svelte-counter.spec.ts +2 -2
- package/template/test/e2e/vue/vue-counter.spec.ts +2 -2
- package/template/test/integration/angular/{Counter.component.spec.ts → Demo.component.spec.ts} +6 -6
- package/template/test/integration/preact/Demo.test.tsx +84 -0
- package/template/test/integration/react/{Counter.test.tsx → Demo.test.tsx} +10 -9
- package/template/test/integration/svelte/{Counter.test.ts → Demo.test.ts} +9 -9
- package/template/test/integration/svelte/{SlotCounter.wrapper.svelte → Demo.wrapper.svelte} +3 -3
- package/template/test/integration/vue/{Counter.test.ts → Demo.test.ts} +9 -9
- package/template/tsconfig.json +0 -1
- package/template/vitest.config.ts +12 -0
- package/template/yarn.lock +572 -234
- /package/template/patches/{@analogjs+astro-angular+2.3.0.patch → @analogjs+astro-angular+2.3.1.patch} +0 -0
|
@@ -10,19 +10,18 @@ import { Operation, setCounterCount } from "../../lib/setCounterCount";
|
|
|
10
10
|
selector: "app-counter",
|
|
11
11
|
standalone: true,
|
|
12
12
|
template: `
|
|
13
|
-
<div class="counter-title" slot="header">
|
|
13
|
+
<div class="counter-title" slot="header">Angular Demo Component</div>
|
|
14
14
|
<div class="card-grid">
|
|
15
15
|
<div class="card">
|
|
16
|
-
|
|
16
|
+
<strong>Angular counter component</strong>
|
|
17
17
|
<div class="card-content">
|
|
18
|
+
Internal counter controls. It keeps state within the component.
|
|
18
19
|
<div class="counter-controls">
|
|
19
20
|
<button (click)="subtract()">-</button>
|
|
20
21
|
<pre>{{ count() }}</pre>
|
|
21
22
|
<button (click)="add()">+</button>
|
|
22
23
|
</div>
|
|
23
24
|
</div>
|
|
24
|
-
</div>
|
|
25
|
-
<div class="card">
|
|
26
25
|
The button sends the current count value to a function in the parent
|
|
27
26
|
component.
|
|
28
27
|
<div class="card-content">
|
|
@@ -33,6 +32,14 @@ import { Operation, setCounterCount } from "../../lib/setCounterCount";
|
|
|
33
32
|
</div>
|
|
34
33
|
</div>
|
|
35
34
|
</div>
|
|
35
|
+
<div class="card unused">
|
|
36
|
+
<strong>Nano Stores (not supported)</strong>
|
|
37
|
+
<div class="card-content"></div>
|
|
38
|
+
</div>
|
|
39
|
+
<div class="card unused">
|
|
40
|
+
<strong>Slot content (not supported)</strong>
|
|
41
|
+
<div class="card-content"></div>
|
|
42
|
+
</div>
|
|
36
43
|
</div>
|
|
37
44
|
<div class="counter-logos">
|
|
38
45
|
<img [src]="outSystemsLogo" alt="OutSystems logo" />
|
|
@@ -40,7 +47,7 @@ import { Operation, setCounterCount } from "../../lib/setCounterCount";
|
|
|
40
47
|
</div>
|
|
41
48
|
`,
|
|
42
49
|
})
|
|
43
|
-
export default class
|
|
50
|
+
export default class DemoComponent implements OnInit {
|
|
44
51
|
astroLogo = AstroLogo;
|
|
45
52
|
count = signal(0);
|
|
46
53
|
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { CommonModule } from "@angular/common";
|
|
2
|
+
import { Component } from "@angular/core";
|
|
3
|
+
|
|
4
|
+
import AngularLogo from "../../images/angular.png?url";
|
|
5
|
+
|
|
6
|
+
@Component({
|
|
7
|
+
imports: [CommonModule],
|
|
8
|
+
selector: "app-counter",
|
|
9
|
+
standalone: true,
|
|
10
|
+
template: `
|
|
11
|
+
<div class="card unused">
|
|
12
|
+
<strong>Angular Store</strong>
|
|
13
|
+
<div class="card-content">
|
|
14
|
+
<img [src]="angularLogo" alt="Angular logo" height="150" />
|
|
15
|
+
<div>
|
|
16
|
+
<strong>Angular 21 does not currently support Nano Stores.</strong>
|
|
17
|
+
</div>
|
|
18
|
+
</div>
|
|
19
|
+
</div>
|
|
20
|
+
`,
|
|
21
|
+
})
|
|
22
|
+
export default class StoreComponent {
|
|
23
|
+
angularLogo = AngularLogo;
|
|
24
|
+
}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
/** @jsxImportSource preact */
|
|
2
|
+
import { useStore } from "@nanostores/preact";
|
|
3
|
+
import type { ComponentChildren } from "preact";
|
|
4
|
+
import { useState } from "preact/hooks";
|
|
5
|
+
|
|
6
|
+
import AstroLogo from "../../images/astro.png?url";
|
|
7
|
+
import OutSystemsLogo from "../../images/outsystems.png?url";
|
|
8
|
+
import { Operation, setCounterCount } from "../../lib/setCounterCount";
|
|
9
|
+
|
|
10
|
+
interface DemoProps {
|
|
11
|
+
children: ComponentChildren;
|
|
12
|
+
header: ComponentChildren;
|
|
13
|
+
initialCount: number;
|
|
14
|
+
showMessage: string;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export default function Demo({
|
|
18
|
+
children,
|
|
19
|
+
header,
|
|
20
|
+
initialCount,
|
|
21
|
+
showMessage,
|
|
22
|
+
}: DemoProps) {
|
|
23
|
+
const [count, setCount] = useState(initialCount);
|
|
24
|
+
|
|
25
|
+
const add = () => setCount((i) => setCounterCount(i, Operation.Add));
|
|
26
|
+
|
|
27
|
+
const subtract = () =>
|
|
28
|
+
setCount((i) => setCounterCount(i, Operation.Subtract));
|
|
29
|
+
|
|
30
|
+
const showParentMessage = () => {
|
|
31
|
+
if (typeof window !== "undefined") {
|
|
32
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
33
|
+
(window as any)[showMessage]?.(count);
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
38
|
+
const nanoStoreValue = useStore((window as any).Stores?.["preactStore"]);
|
|
39
|
+
|
|
40
|
+
return (
|
|
41
|
+
<>
|
|
42
|
+
{header}
|
|
43
|
+
<div className="card-grid">
|
|
44
|
+
<div className="card">
|
|
45
|
+
<strong>Preact counter component</strong>
|
|
46
|
+
<div className="card-content">
|
|
47
|
+
Internal counter controls. It keeps state within the component.
|
|
48
|
+
<div className="counter-controls">
|
|
49
|
+
<button onClick={subtract}>-</button>
|
|
50
|
+
<pre>{count}</pre>
|
|
51
|
+
<button onClick={add}>+</button>
|
|
52
|
+
</div>
|
|
53
|
+
</div>
|
|
54
|
+
The button sends the current count value to a function in the parent
|
|
55
|
+
component.
|
|
56
|
+
<div className="card-content">
|
|
57
|
+
<div>
|
|
58
|
+
<button className="card-btn" onClick={showParentMessage}>
|
|
59
|
+
Send value
|
|
60
|
+
</button>
|
|
61
|
+
</div>
|
|
62
|
+
</div>
|
|
63
|
+
</div>
|
|
64
|
+
<div className="card">
|
|
65
|
+
<strong>Nano Stores</strong>
|
|
66
|
+
<div className="card-content">
|
|
67
|
+
<div>
|
|
68
|
+
<strong>Value:</strong>
|
|
69
|
+
<div id="nanostore">{nanoStoreValue}</div>
|
|
70
|
+
</div>
|
|
71
|
+
</div>
|
|
72
|
+
</div>
|
|
73
|
+
<div className="card">
|
|
74
|
+
<strong>Slot content</strong>
|
|
75
|
+
<div className="card-content">
|
|
76
|
+
<div>{children}</div>
|
|
77
|
+
</div>
|
|
78
|
+
</div>
|
|
79
|
+
</div>
|
|
80
|
+
<div className="counter-logos">
|
|
81
|
+
<img alt="OutSystems logo" src={OutSystemsLogo} />
|
|
82
|
+
<img alt="Astro logo" src={AstroLogo} />
|
|
83
|
+
</div>
|
|
84
|
+
</>
|
|
85
|
+
);
|
|
86
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/** @jsxImportSource react */
|
|
2
|
+
import { useStore } from "@nanostores/preact";
|
|
3
|
+
|
|
4
|
+
import PreactLogo from "../../images/preact.png?url";
|
|
5
|
+
import { framework } from "../../stores/framework";
|
|
6
|
+
|
|
7
|
+
export default function Store() {
|
|
8
|
+
const selectedFramework = useStore(framework);
|
|
9
|
+
|
|
10
|
+
const setFramework = () => {
|
|
11
|
+
framework.set("Preact");
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
return (
|
|
15
|
+
<div className="card">
|
|
16
|
+
<strong>Preact Store</strong>
|
|
17
|
+
<div className="card-content">
|
|
18
|
+
<img alt="Preact logo" height={150} src={PreactLogo} />
|
|
19
|
+
<div>
|
|
20
|
+
<strong>Value:</strong>
|
|
21
|
+
<div id="nanostore">{selectedFramework}</div>
|
|
22
|
+
</div>
|
|
23
|
+
<div>
|
|
24
|
+
<button className="card-btn" onClick={setFramework}>
|
|
25
|
+
Select Preact
|
|
26
|
+
</button>
|
|
27
|
+
</div>
|
|
28
|
+
</div>
|
|
29
|
+
</div>
|
|
30
|
+
);
|
|
31
|
+
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/** @jsxImportSource react */
|
|
1
2
|
import { useStore } from "@nanostores/react";
|
|
2
3
|
import { useState } from "react";
|
|
3
4
|
|
|
@@ -5,23 +6,29 @@ import AstroLogo from "../../images/astro.png?url";
|
|
|
5
6
|
import OutSystemsLogo from "../../images/outsystems.png?url";
|
|
6
7
|
import { Operation, setCounterCount } from "../../lib/setCounterCount";
|
|
7
8
|
|
|
8
|
-
|
|
9
|
-
children,
|
|
10
|
-
header,
|
|
11
|
-
initialCount,
|
|
12
|
-
showMessage,
|
|
13
|
-
}: {
|
|
9
|
+
interface DemoProps {
|
|
14
10
|
children: React.ReactNode;
|
|
15
11
|
header: React.ReactNode;
|
|
16
12
|
initialCount: number;
|
|
17
13
|
showMessage: string;
|
|
18
|
-
}
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export default function Demo({
|
|
17
|
+
children,
|
|
18
|
+
header,
|
|
19
|
+
initialCount,
|
|
20
|
+
showMessage,
|
|
21
|
+
}: DemoProps) {
|
|
19
22
|
const [count, setCount] = useState(initialCount);
|
|
23
|
+
|
|
20
24
|
const add = () => setCount((i) => setCounterCount(i, Operation.Add));
|
|
25
|
+
|
|
21
26
|
const subtract = () =>
|
|
22
27
|
setCount((i) => setCounterCount(i, Operation.Subtract));
|
|
28
|
+
|
|
23
29
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
24
30
|
const showParentMessage = () => (window as any)[showMessage](count);
|
|
31
|
+
|
|
25
32
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
26
33
|
const nanoStoreValue = useStore((window as any).Stores["reactStore"]);
|
|
27
34
|
|
|
@@ -30,16 +37,15 @@ export default function Counter({
|
|
|
30
37
|
{header}
|
|
31
38
|
<div className="card-grid">
|
|
32
39
|
<div className="card">
|
|
33
|
-
|
|
40
|
+
<strong>React counter component</strong>
|
|
34
41
|
<div className="card-content">
|
|
42
|
+
Internal counter controls. It keeps state within the component.
|
|
35
43
|
<div className="counter-controls">
|
|
36
44
|
<button onClick={subtract}>-</button>
|
|
37
45
|
<pre>{count}</pre>
|
|
38
46
|
<button onClick={add}>+</button>
|
|
39
47
|
</div>
|
|
40
48
|
</div>
|
|
41
|
-
</div>
|
|
42
|
-
<div className="card">
|
|
43
49
|
The button sends the current count value to a function in the parent
|
|
44
50
|
component.
|
|
45
51
|
<div className="card-content">
|
|
@@ -51,18 +57,18 @@ export default function Counter({
|
|
|
51
57
|
</div>
|
|
52
58
|
</div>
|
|
53
59
|
<div className="card">
|
|
54
|
-
|
|
60
|
+
<strong>Nano Stores</strong>
|
|
55
61
|
<div className="card-content">
|
|
56
|
-
<div>
|
|
62
|
+
<div>
|
|
63
|
+
<strong>Value:</strong>
|
|
64
|
+
<div id="nanostore">{nanoStoreValue}</div>
|
|
65
|
+
</div>
|
|
57
66
|
</div>
|
|
58
67
|
</div>
|
|
59
68
|
<div className="card">
|
|
60
|
-
|
|
69
|
+
<strong>Slot content</strong>
|
|
61
70
|
<div className="card-content">
|
|
62
|
-
<div>
|
|
63
|
-
<strong>Nano Store value:</strong>
|
|
64
|
-
<div id="nanostore">{nanoStoreValue}</div>
|
|
65
|
-
</div>
|
|
71
|
+
<div>{children}</div>
|
|
66
72
|
</div>
|
|
67
73
|
</div>
|
|
68
74
|
</div>
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/** @jsxImportSource react */
|
|
2
|
+
import { useStore } from "@nanostores/react";
|
|
3
|
+
|
|
4
|
+
import ReactLogo from "../../images/react.png?url";
|
|
5
|
+
import { framework } from "../../stores/framework";
|
|
6
|
+
|
|
7
|
+
export default function Store() {
|
|
8
|
+
const selectedFramework = useStore(framework);
|
|
9
|
+
|
|
10
|
+
const setFramework = () => {
|
|
11
|
+
framework.set("React");
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
return (
|
|
15
|
+
<div className="card">
|
|
16
|
+
<strong>React Store</strong>
|
|
17
|
+
<div className="card-content">
|
|
18
|
+
<img alt="React logo" height={150} src={ReactLogo} />
|
|
19
|
+
<div>
|
|
20
|
+
<strong>Value:</strong>
|
|
21
|
+
<div id="nanostore">{selectedFramework}</div>
|
|
22
|
+
</div>
|
|
23
|
+
<div>
|
|
24
|
+
<button className="card-btn" onClick={setFramework}>
|
|
25
|
+
Select React
|
|
26
|
+
</button>
|
|
27
|
+
</div>
|
|
28
|
+
</div>
|
|
29
|
+
</div>
|
|
30
|
+
);
|
|
31
|
+
}
|
|
@@ -29,19 +29,16 @@
|
|
|
29
29
|
|
|
30
30
|
<div class="card-grid">
|
|
31
31
|
<div class="card">
|
|
32
|
-
|
|
32
|
+
<strong>Svelte counter component</strong>
|
|
33
33
|
<div class="card-content">
|
|
34
|
+
Internal counter controls. It keeps state within the component.
|
|
34
35
|
<div class="counter-controls">
|
|
35
36
|
<button on:click={subtract}>-</button>
|
|
36
37
|
<pre>{count}</pre>
|
|
37
38
|
<button on:click={add}>+</button>
|
|
38
39
|
</div>
|
|
39
40
|
</div>
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
<div class="card">
|
|
43
|
-
The button sends the current count value to a function in the parent
|
|
44
|
-
component.
|
|
41
|
+
The button sends the current count value to a function in the parent component.
|
|
45
42
|
<div class="card-content">
|
|
46
43
|
<div>
|
|
47
44
|
<button class="card-btn" on:click={showParentMessage}>
|
|
@@ -52,20 +49,20 @@
|
|
|
52
49
|
</div>
|
|
53
50
|
|
|
54
51
|
<div class="card">
|
|
55
|
-
|
|
52
|
+
<strong>Nano Stores</strong>
|
|
56
53
|
<div class="card-content">
|
|
57
54
|
<div>
|
|
58
|
-
<
|
|
55
|
+
<strong>Value:</strong>
|
|
56
|
+
<div id="nanostore">{$nanoStoreValue}</div>
|
|
59
57
|
</div>
|
|
60
58
|
</div>
|
|
61
59
|
</div>
|
|
62
60
|
|
|
63
61
|
<div class="card">
|
|
64
|
-
|
|
62
|
+
<strong>Slot content</strong>
|
|
65
63
|
<div class="card-content">
|
|
66
64
|
<div>
|
|
67
|
-
<
|
|
68
|
-
<div id="nanostore">{$nanoStoreValue}</div>
|
|
65
|
+
<slot />
|
|
69
66
|
</div>
|
|
70
67
|
</div>
|
|
71
68
|
</div>
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import SvelteLogo from "../../images/svelte.png?url";
|
|
3
|
+
import { framework } from "../../stores/framework";
|
|
4
|
+
|
|
5
|
+
const setFramework = () => {
|
|
6
|
+
framework.set("Svelte");
|
|
7
|
+
};
|
|
8
|
+
</script>
|
|
9
|
+
|
|
10
|
+
<div class="card">
|
|
11
|
+
<strong>Svelte Store</strong>
|
|
12
|
+
<div class="card-content">
|
|
13
|
+
<img alt="Svelte logo" src={SvelteLogo} height="150" />
|
|
14
|
+
<div>
|
|
15
|
+
<strong>Value:</strong>
|
|
16
|
+
<div id="nanostore">{$framework}</div>
|
|
17
|
+
</div>
|
|
18
|
+
<div>
|
|
19
|
+
<button class="card-btn" on:click={setFramework}>Select Svelte</button>
|
|
20
|
+
</div>
|
|
21
|
+
</div>
|
|
22
|
+
</div>
|
|
@@ -35,17 +35,15 @@ const nanoStoreValue = useStore((window as any).Stores["vueStore"]);
|
|
|
35
35
|
|
|
36
36
|
<div class="card-grid">
|
|
37
37
|
<div class="card">
|
|
38
|
-
|
|
38
|
+
<strong>Vue counter component</strong>
|
|
39
39
|
<div class="card-content">
|
|
40
|
+
Internal counter controls. It keeps state within the component.
|
|
40
41
|
<div class="counter-controls">
|
|
41
42
|
<button @click="subtract">-</button>
|
|
42
43
|
<pre>{{ count }}</pre>
|
|
43
44
|
<button @click="add">+</button>
|
|
44
45
|
</div>
|
|
45
46
|
</div>
|
|
46
|
-
</div>
|
|
47
|
-
|
|
48
|
-
<div class="card">
|
|
49
47
|
The button sends the current count value to a function in the parent
|
|
50
48
|
component.
|
|
51
49
|
<div class="card-content">
|
|
@@ -58,20 +56,20 @@ const nanoStoreValue = useStore((window as any).Stores["vueStore"]);
|
|
|
58
56
|
</div>
|
|
59
57
|
|
|
60
58
|
<div class="card">
|
|
61
|
-
|
|
59
|
+
<strong>Nano Stores</strong>
|
|
62
60
|
<div class="card-content">
|
|
63
61
|
<div>
|
|
64
|
-
<
|
|
62
|
+
<strong>Value:</strong>
|
|
63
|
+
<div id="nanostore">{{ nanoStoreValue }}</div>
|
|
65
64
|
</div>
|
|
66
65
|
</div>
|
|
67
66
|
</div>
|
|
68
67
|
|
|
69
68
|
<div class="card">
|
|
70
|
-
|
|
69
|
+
<strong>Slot content</strong>
|
|
71
70
|
<div class="card-content">
|
|
72
71
|
<div>
|
|
73
|
-
<
|
|
74
|
-
<div id="nanostore">{{ nanoStoreValue }}</div>
|
|
72
|
+
<slot />
|
|
75
73
|
</div>
|
|
76
74
|
</div>
|
|
77
75
|
</div>
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { useStore } from "@nanostores/vue";
|
|
3
|
+
|
|
4
|
+
import VueLogo from "../../images/vue.png?url";
|
|
5
|
+
import { framework } from "../../stores/framework";
|
|
6
|
+
|
|
7
|
+
const selectedFramework = useStore(framework);
|
|
8
|
+
|
|
9
|
+
const setFramework = () => {
|
|
10
|
+
framework.set("Vue");
|
|
11
|
+
};
|
|
12
|
+
</script>
|
|
13
|
+
|
|
14
|
+
<template>
|
|
15
|
+
<div class="card">
|
|
16
|
+
<strong>Vue Store</strong>
|
|
17
|
+
<div class="card-content">
|
|
18
|
+
<img alt="Vue logo" :src="VueLogo" height="150" />
|
|
19
|
+
<div>
|
|
20
|
+
<strong>Value:</strong>
|
|
21
|
+
<div id="nanostore">{{ selectedFramework }}</div>
|
|
22
|
+
</div>
|
|
23
|
+
<div>
|
|
24
|
+
<button class="card-btn" @click="setFramework">Select Vue</button>
|
|
25
|
+
</div>
|
|
26
|
+
</div>
|
|
27
|
+
</div>
|
|
28
|
+
</template>
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
-
import
|
|
2
|
+
import DemoComponent from "../../framework/angular/Demo.component";
|
|
3
3
|
import styles from "../../styles/index.css?url";
|
|
4
4
|
const initialCount = 5;
|
|
5
5
|
const showMessage = "showMessage";
|
|
@@ -14,19 +14,26 @@ const showMessage = "showMessage";
|
|
|
14
14
|
</script>
|
|
15
15
|
</head>
|
|
16
16
|
<body>
|
|
17
|
-
<div class="counter-title">
|
|
17
|
+
<div class="counter-title">Astro Page</div>
|
|
18
18
|
<div class="card-grid">
|
|
19
19
|
<div class="card">
|
|
20
|
-
|
|
20
|
+
<strong>Counter component</strong>
|
|
21
|
+
<div class="card-content">
|
|
22
|
+
<div style="text-align: center; margin-top: 30px;">
|
|
23
|
+
Counter value: <br /><span id="counter"></span>
|
|
24
|
+
</div>
|
|
25
|
+
</div>
|
|
26
|
+
</div>
|
|
27
|
+
<div class="card unused">
|
|
28
|
+
<strong>Nano Stores (not supported)</strong>
|
|
21
29
|
<div class="card-content">
|
|
22
30
|
<div style="text-align: center; margin-top: 30px;">
|
|
23
|
-
Counter value sent back: <br /><span id="counter"></span>
|
|
24
31
|
</div>
|
|
25
32
|
</div>
|
|
26
33
|
</div>
|
|
27
34
|
</div>
|
|
28
35
|
<hr />
|
|
29
|
-
<
|
|
36
|
+
<DemoComponent
|
|
30
37
|
client:visible
|
|
31
38
|
initialCount={initialCount}
|
|
32
39
|
showMessage={showMessage}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
---
|
|
2
|
+
import AngularStore from "../../framework/angular/Store.component"
|
|
3
|
+
import PreactStore from "../../framework/preact/Store";
|
|
4
|
+
import ReactStore from "../../framework/react/Store";
|
|
5
|
+
import SvelteStore from "../../framework/svelte/Store.svelte";
|
|
6
|
+
import VueStore from "../../framework/vue/Store.vue";
|
|
7
|
+
import styles from "../../styles/index.css?url";
|
|
8
|
+
---
|
|
9
|
+
<html lang="en">
|
|
10
|
+
<head>
|
|
11
|
+
<link href={styles} rel="stylesheet" />
|
|
12
|
+
</head>
|
|
13
|
+
<body>
|
|
14
|
+
<div class="card-grid">
|
|
15
|
+
<AngularStore client:visible />
|
|
16
|
+
<PreactStore client:only="preact" />
|
|
17
|
+
<ReactStore client:only="react" />
|
|
18
|
+
<SvelteStore client:only="svelte" />
|
|
19
|
+
<VueStore client:only="vue" />
|
|
20
|
+
</div>
|
|
21
|
+
</body>
|
|
22
|
+
</html>
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
---
|
|
2
|
+
import DemoComponent from "../../framework/preact/Demo";
|
|
3
|
+
import styles from "../../styles/index.css?url";
|
|
4
|
+
const initialCount = 5;
|
|
5
|
+
const showMessage = "showMessage";
|
|
6
|
+
---
|
|
7
|
+
<html lang="en">
|
|
8
|
+
<head>
|
|
9
|
+
<link href={styles} rel="stylesheet" />
|
|
10
|
+
<script>
|
|
11
|
+
import { atom } from "nanostores";
|
|
12
|
+
window["showMessage"] = (count) => {
|
|
13
|
+
document.getElementById("counter").textContent = count;
|
|
14
|
+
};
|
|
15
|
+
window.Stores = [];
|
|
16
|
+
window.Stores["preactStore"] = atom("Test Value");
|
|
17
|
+
document.addEventListener("DOMContentLoaded", function () {
|
|
18
|
+
const input = document.getElementById("store");
|
|
19
|
+
input.value = window.Stores["preactStore"].get();
|
|
20
|
+
});
|
|
21
|
+
</script>
|
|
22
|
+
</head>
|
|
23
|
+
<body>
|
|
24
|
+
<div class="counter-title">Astro Page</div>
|
|
25
|
+
<div class="card-grid">
|
|
26
|
+
<div class="card">
|
|
27
|
+
<strong>Counter component</strong>
|
|
28
|
+
<div class="card-content">
|
|
29
|
+
<div style="text-align: center; margin-top: 30px;">
|
|
30
|
+
Counter value:
|
|
31
|
+
<div>
|
|
32
|
+
<span id="counter"></span>
|
|
33
|
+
</div>
|
|
34
|
+
</div>
|
|
35
|
+
</div>
|
|
36
|
+
</div>
|
|
37
|
+
<div class="card">
|
|
38
|
+
<strong>Nano Stores</strong>
|
|
39
|
+
<div class="card-content">
|
|
40
|
+
<div style="text-align: center; margin-top: 30px;">
|
|
41
|
+
<input
|
|
42
|
+
id="store"
|
|
43
|
+
placeholder="Type something..."
|
|
44
|
+
type="text"
|
|
45
|
+
/><button
|
|
46
|
+
class="card-btn"
|
|
47
|
+
onclick="window.Stores['preactStore'].set(document.getElementById('store').value)"
|
|
48
|
+
>Update Store</button
|
|
49
|
+
>
|
|
50
|
+
</div>
|
|
51
|
+
</div>
|
|
52
|
+
</div>
|
|
53
|
+
</div>
|
|
54
|
+
<hr />
|
|
55
|
+
<DemoComponent
|
|
56
|
+
client:only="preact"
|
|
57
|
+
initialCount={initialCount}
|
|
58
|
+
showMessage={showMessage}
|
|
59
|
+
>
|
|
60
|
+
<div class="counter-title" slot="header">Preact Demo Component</div>
|
|
61
|
+
<div style="text-align: center;">
|
|
62
|
+
<p><em>This is content passed into the component.</em></p>
|
|
63
|
+
</div>
|
|
64
|
+
</DemoComponent>
|
|
65
|
+
</body>
|
|
66
|
+
</html>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
-
import
|
|
2
|
+
import DemoComponent from "../../framework/react/Demo";
|
|
3
3
|
import styles from "../../styles/index.css?url";
|
|
4
4
|
const initialCount = 5;
|
|
5
5
|
const showMessage = "showMessage";
|
|
@@ -21,18 +21,21 @@ const showMessage = "showMessage";
|
|
|
21
21
|
</script>
|
|
22
22
|
</head>
|
|
23
23
|
<body>
|
|
24
|
-
<div class="counter-title">
|
|
24
|
+
<div class="counter-title">Astro Page</div>
|
|
25
25
|
<div class="card-grid">
|
|
26
26
|
<div class="card">
|
|
27
|
-
|
|
27
|
+
<strong>Counter component</strong>
|
|
28
28
|
<div class="card-content">
|
|
29
29
|
<div style="text-align: center; margin-top: 30px;">
|
|
30
|
-
Counter value
|
|
30
|
+
Counter value:
|
|
31
|
+
<div>
|
|
32
|
+
<span id="counter"></span>
|
|
33
|
+
</div>
|
|
31
34
|
</div>
|
|
32
35
|
</div>
|
|
33
36
|
</div>
|
|
34
37
|
<div class="card">
|
|
35
|
-
|
|
38
|
+
<strong>Nano Stores</strong>
|
|
36
39
|
<div class="card-content">
|
|
37
40
|
<div style="text-align: center; margin-top: 30px;">
|
|
38
41
|
<input
|
|
@@ -49,15 +52,15 @@ const showMessage = "showMessage";
|
|
|
49
52
|
</div>
|
|
50
53
|
</div>
|
|
51
54
|
<hr />
|
|
52
|
-
<
|
|
55
|
+
<DemoComponent
|
|
53
56
|
client:only="react"
|
|
54
57
|
initialCount={initialCount}
|
|
55
58
|
showMessage={showMessage}
|
|
56
59
|
>
|
|
57
|
-
<div class="counter-title" slot="header">
|
|
60
|
+
<div class="counter-title" slot="header">React Demo Component</div>
|
|
58
61
|
<div style="text-align: center;">
|
|
59
|
-
<p><
|
|
62
|
+
<p><em>This is content passed into the component.</em></p>
|
|
60
63
|
</div>
|
|
61
|
-
</
|
|
64
|
+
</DemoComponent>
|
|
62
65
|
</body>
|
|
63
66
|
</html>
|