@johnmorrisdotca/wakusei-planets 0.13.0 → 0.15.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/CHANGELOG.md +18 -0
- package/README.md +4 -4
- package/dist/element.d.ts +2 -2
- package/dist/embed.js +3 -30
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.15.0 - 2026-11-04
|
|
4
|
+
|
|
5
|
+
The family's embed panel on the code builder and the portrait builder (MODULES-380).
|
|
6
|
+
|
|
7
|
+
- **`builder.html`'s code section is kazoku-ui's `<kazoku-embed-panel>`**, with the builder's own choices inside it: which planet's system and the body in the `picker` slot; the look, the sky and the turning in the `options` slot; the size is the panel's own (160, 240, 320, 480). Nothing it had is gone, and a test counts it: the twelve groups and ten bodies, the look, sky and turning rows, the seven tabs (HTML, ES module, React, Vue, Angular, Svelte, iframe), the four sizes, the picture made from the same choices (the picture now fits its box at every size), Copy (now "Copy code", in a button that can be read), Open the embed page and the credit line (which names NASA, USGS and JPL for the painted look and NASA for the Earth). Added by the panel: Read the docs, Home and End on the tabs.
|
|
8
|
+
- **`portrait.html`'s Share tab is the panel too**, with Save PNG, Save SVG and Copy link and their status line in the `actions` slot, and the credit line as before. It has `no-preview` and `no-size`: the portrait is the picture on the page, so the panel adds no second WebGL context and no frame loop. The tab and the code stay in the address as `?embed=`. A test counts the seven tabs, the code, Copy, the three actions, the embed page link, the docs link and the credit.
|
|
9
|
+
- `scripts/check-standard.mjs` is kazoku-ui 0.15's (it has the `embed-panel` item; this package passes).
|
|
10
|
+
- Guides (English and Japanese) say so. Tests: `e2e/builder.demo.ts` and `e2e/portrait.demo.ts` (desk and phone, Chromium and WebKit).
|
|
11
|
+
|
|
12
|
+
## 0.14.0 - 2026-11-04
|
|
13
|
+
|
|
14
|
+
The family's one "Put it in your page" panel, wakusei-planets first (KAZOKU-UI-40).
|
|
15
|
+
|
|
16
|
+
- **The demo's "Put it in your page" is kazoku-ui's `<kazoku-embed-panel>`** (kazoku-ui 0.15), filled with wakusei's own choices and code. Nothing it had is gone, and a test counts it: the body picker (tiles by group, planet and moon, in the panel's `picker` slot), the four sizes, the seven tabs (HTML, ES module, React, Vue, Angular, Svelte, iframe; the arrow keys, `?embed=`, `?size=`), the picture made from the same choices, Copy, Open the embed page, Read the docs and the credit line. What changed: the picture always fits its box (Venus was cut off on the right), Copy says "Copy code" in a button that can be read (MODULES-286), Home and End work on the tabs, and the panel is the same one every package of the family now gets.
|
|
17
|
+
- `embedCode` writes its seven tabs through kazoku-ui's `embedSnippet`; the text is unchanged (the package's tests build and parse every tab as before).
|
|
18
|
+
- `kazoku-ui` is `^0.15.1` (the panel asks for one animation frame at a time; the freeze test holds it). Tests: `e2e/embed-builder.demo.ts` (the code for each tab, the picture, Copy, the picker, "nothing is gone", the picture fits at every size; desk and phone, Chromium and WebKit).
|
|
19
|
+
- Left for a follow-up: the code panels of `builder.html` and `portrait.html` still use the earlier markup.
|
|
20
|
+
|
|
3
21
|
## 0.13.0 - 2026-11-04
|
|
4
22
|
|
|
5
23
|
The wheel zooms (KAZOKU-UI-45).
|
package/README.md
CHANGED
|
@@ -13,9 +13,9 @@ A clean line drawing, a shaded realistic drawing, or a painted surface map, with
|
|
|
13
13
|
|
|
14
14
|
<p align="center"><a href="https://johnmorrisdotca.github.io/wakusei-planets/"><strong>Open the demo →</strong></a> · <a href="https://johnmorrisdotca.github.io/wakusei-planets/embed.html">Embed page</a> · <a href="https://johnmorrisdotca.github.io/wakusei-planets/docs/">Docs</a></p>
|
|
15
15
|
|
|
16
|
-
<p align="center"><img alt="Jupiter and Saturn drawn in the realistic look, and Saturn as a line drawing" src="https://raw.githubusercontent.com/johnmorrisdotca/wakusei-planets/v0.
|
|
16
|
+
<p align="center"><img alt="Jupiter and Saturn drawn in the realistic look, and Saturn as a line drawing" src="https://raw.githubusercontent.com/johnmorrisdotca/wakusei-planets/v0.15.0/docs/images/hero-desk.png" width="640"></p>
|
|
17
17
|
|
|
18
|
-
<p align="center"><img alt="Every body at one scale, the Earth among them: each small body has a magnified picture joined by a line, and the Sun shows only its edge" src="https://raw.githubusercontent.com/johnmorrisdotca/wakusei-planets/v0.
|
|
18
|
+
<p align="center"><img alt="Every body at one scale, the Earth among them: each small body has a magnified picture joined by a line, and the Sun shows only its edge" src="https://raw.githubusercontent.com/johnmorrisdotca/wakusei-planets/v0.15.0/docs/images/lineup-desk.png" width="640"></p>
|
|
19
19
|
|
|
20
20
|
## One minute
|
|
21
21
|
|
|
@@ -269,11 +269,11 @@ A body that turns by itself and a moving sky, in HTML:
|
|
|
269
269
|
|
|
270
270
|
## The code builder
|
|
271
271
|
|
|
272
|
-
[The code builder](https://johnmorrisdotca.github.io/wakusei-planets/builder.html) is one screen: choose which planet's system, the body, the look, the size, the sky and the turning, then pick how your page is made and copy the code. It is built from `embedCode`, so it writes what the package writes. [Put it in your page](docs/guides/put-it-in-your-page.md) is its guide.
|
|
272
|
+
[The code builder](https://johnmorrisdotca.github.io/wakusei-planets/builder.html) is one screen: choose which planet's system, the body, the look, the size, the sky and the turning, then pick how your page is made and copy the code. It is the family's embed panel with those choices inside it, built from `embedCode`, so it writes what the package writes. [Put it in your page](docs/guides/put-it-in-your-page.md) is its guide.
|
|
273
273
|
|
|
274
274
|
## The portrait builder
|
|
275
275
|
|
|
276
|
-
<p align="center"><img alt="The Sun and the planets in an arc, painted, with their names, in the portrait builder" src="https://raw.githubusercontent.com/johnmorrisdotca/wakusei-planets/v0.
|
|
276
|
+
<p align="center"><img alt="The Sun and the planets in an arc, painted, with their names, in the portrait builder" src="https://raw.githubusercontent.com/johnmorrisdotca/wakusei-planets/v0.15.0/docs/images/portrait-family.png" width="640"></p>
|
|
277
277
|
|
|
278
278
|
[The portrait builder](https://johnmorrisdotca.github.io/wakusei-planets/portrait.html) puts any bodies in one picture: drag them, size them, turn them, order them front to back, arrange them in a row, an arc, a grid or at true orbit distance (true or readable sizes, a planet's moons round it in orbit order), light them from one direction, and take the code, a PNG or an SVG. The scene is kept in the address, and every body is drawn in one WebGL scene, so the page holds one WebGL context. [The portrait builder](docs/guides/portrait-builder.md) is its guide.
|
|
279
279
|
|
package/dist/element.d.ts
CHANGED
|
@@ -25,7 +25,7 @@ export type WakuseiState = "line" | "loading" | "still" | "live" | "lost" | "una
|
|
|
25
25
|
* console.log(TEXTURE_BASE);
|
|
26
26
|
* ```
|
|
27
27
|
*/
|
|
28
|
-
export declare const TEXTURE_BASE = "https://cdn.jsdelivr.net/npm/@johnmorrisdotca/wakusei-planets@0.
|
|
28
|
+
export declare const TEXTURE_BASE = "https://cdn.jsdelivr.net/npm/@johnmorrisdotca/wakusei-planets@0.15.0/dist/textures/";
|
|
29
29
|
/**
|
|
30
30
|
* Where the sharpest surface pictures are: the files of this exact version in the repository, on jsDelivr's GitHub address. The npm package holds only the two smaller widths, so a page that
|
|
31
31
|
* never zooms in never fetches them. Set `texture-far-base` on an element to serve them yourself.
|
|
@@ -37,7 +37,7 @@ export declare const TEXTURE_BASE = "https://cdn.jsdelivr.net/npm/@johnmorrisdot
|
|
|
37
37
|
* console.log(TEXTURE_FAR_BASE);
|
|
38
38
|
* ```
|
|
39
39
|
*/
|
|
40
|
-
export declare const TEXTURE_FAR_BASE = "https://cdn.jsdelivr.net/gh/johnmorrisdotca/wakusei-planets@v0.
|
|
40
|
+
export declare const TEXTURE_FAR_BASE = "https://cdn.jsdelivr.net/gh/johnmorrisdotca/wakusei-planets@v0.15.0/textures/";
|
|
41
41
|
/**
|
|
42
42
|
* The `<wakusei-body>` custom element: a body of the solar system, drawn in a look.
|
|
43
43
|
*
|
package/dist/embed.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
// The text to put a body in a page, for each way a page is made: a script tag from a CDN, an ES module, React, Vue, Angular, Svelte, or an iframe of `embed.html`. The demo's "Put it in your page"
|
|
2
2
|
// section shows these as the reader changes a choice, and the tests build or parse every one. Pure: no DOM.
|
|
3
|
+
import { embedSnippet } from "@johnmorrisdotca/kazoku-ui/embed-panel";
|
|
3
4
|
import { BODIES, DWARF_IDS } from "./facts.js";
|
|
4
5
|
import { decodeScene } from "./portrait/model.js";
|
|
5
6
|
import { VERSION } from "./version.js";
|
|
@@ -37,37 +38,9 @@ function attributesOf(o) {
|
|
|
37
38
|
out.push(["turn", String(o.turn)]);
|
|
38
39
|
return out;
|
|
39
40
|
}
|
|
40
|
-
const quote = (v) => `"${v.replace(/&/g, "&").replace(/"/g, """)}"`;
|
|
41
41
|
const needsShading = (o) => (o.look ?? "realistic") !== "line";
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
const Name = spec.name.charAt(0).toUpperCase() + spec.name.slice(1);
|
|
45
|
-
const tagAttrs2 = attrText(spec.attrs);
|
|
46
|
-
if (kind === "iframe") {
|
|
47
|
-
const f = spec.iframe;
|
|
48
|
-
return `<iframe\n src=${quote(f.src)}\n title=${quote(f.title)}\n width="${f.width}"\n height="${f.height}"\n loading="lazy"\n style="border: 0"\n></iframe>`;
|
|
49
|
-
}
|
|
50
|
-
if (kind === "html") {
|
|
51
|
-
const scripts = [`<script type="module" src="${cdn}/${spec.element}/+esm"></script>`, ...spec.entries.map((e) => `<script type="module" src="${cdn}/${e}/+esm"></script>`)];
|
|
52
|
-
return `${scripts.join("\n")}\n\n<${spec.tag} ${tagAttrs2}></${spec.tag}>`;
|
|
53
|
-
}
|
|
54
|
-
const imports = [`import "${PACKAGE}/${spec.element}";`, ...spec.entries.map((e) => `import "${PACKAGE}/${e}";`)];
|
|
55
|
-
if (kind === "module") {
|
|
56
|
-
const sets = spec.attrs.map(([k, v]) => `${spec.name}.setAttribute(${JSON.stringify(k)}, ${JSON.stringify(v)});`);
|
|
57
|
-
return `${imports.join("\n")}\n\nconst ${spec.name} = document.createElement("${spec.tag}");\n${sets.join("\n")}\ndocument.querySelector("#${spec.name}").append(${spec.name});`;
|
|
58
|
-
}
|
|
59
|
-
const dynamic = [`void import("${PACKAGE}/${spec.element}");`, ...spec.entries.map((e) => `void import("${PACKAGE}/${e}");`)];
|
|
60
|
-
if (kind === "react") {
|
|
61
|
-
return `import { useEffect } from "react";\n\nexport function ${Name}() {\n useEffect(() => {\n // The element needs a browser, so it is imported in an effect, never at the top of the file.\n${dynamic.map((l) => ` ${l}`).join("\n")}\n }, []);\n return <${spec.tag} ${tagAttrs2} />;\n}`;
|
|
62
|
-
}
|
|
63
|
-
if (kind === "vue") {
|
|
64
|
-
return `<script setup lang="ts">\nimport { onMounted } from "vue";\n\nonMounted(() => {\n${dynamic.map((l) => ` ${l}`).join("\n")}\n});\n</script>\n\n<template>\n <${spec.tag} ${tagAttrs2}></${spec.tag}>\n</template>`;
|
|
65
|
-
}
|
|
66
|
-
if (kind === "angular") {
|
|
67
|
-
return `import { Component, CUSTOM_ELEMENTS_SCHEMA, OnInit } from "@angular/core";\n\n@Component({\n selector: "app-${spec.name}",\n standalone: true,\n schemas: [CUSTOM_ELEMENTS_SCHEMA],\n template: \`<${spec.tag} ${tagAttrs2}></${spec.tag}>\`,\n})\nexport class ${Name}Component implements OnInit {\n ngOnInit(): void {\n // The element needs a browser: ngOnInit also runs when a server renders.\n if (typeof window !== "undefined") {\n${dynamic.map((l) => ` ${l}`).join("\n")}\n }\n }\n}`;
|
|
68
|
-
}
|
|
69
|
-
return `<script lang="ts">\n import { onMount } from "svelte";\n\n onMount(() => {\n${dynamic.map((l) => ` ${l}`).join("\n")}\n });\n</script>\n\n<${spec.tag} ${tagAttrs2}></${spec.tag}>`;
|
|
70
|
-
}
|
|
42
|
+
/** The seven ways are kazoku-ui's: one description of the element gives every one of them. */
|
|
43
|
+
const snippet = (kind, spec, cdn) => embedSnippet(kind, { ...spec, package: PACKAGE, cdn });
|
|
71
44
|
/**
|
|
72
45
|
* The text that puts a body in a page, for one way of making the page. Each way is built, parsed or run by the package's tests: the plain HTML one with a script tag from jsDelivr, an ES module, a React component,
|
|
73
46
|
* a Vue single-file component, an Angular standalone component, a Svelte component, and an iframe of the demo's `embed.html`.
|
package/dist/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const VERSION = "0.
|
|
1
|
+
export declare const VERSION = "0.15.0";
|
package/dist/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const VERSION = "0.
|
|
1
|
+
export const VERSION = "0.15.0";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@johnmorrisdotca/wakusei-planets",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.15.0",
|
|
4
4
|
"description": "Wakusei Planets 惑星 — The Sun, planets and moons for the web: each as a clean line drawing, a shaded realistic drawing or a painted surface map, with real sizes, axial tilt and rotation as data, and positions of the moons for any date and time. SVG for the lines, three.js (optional) for the rest.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"planets",
|
|
@@ -240,7 +240,7 @@
|
|
|
240
240
|
},
|
|
241
241
|
"packageManager": "pnpm@10.28.0",
|
|
242
242
|
"dependencies": {
|
|
243
|
-
"@johnmorrisdotca/kazoku-ui": "^0.
|
|
243
|
+
"@johnmorrisdotca/kazoku-ui": "^0.15.1"
|
|
244
244
|
},
|
|
245
245
|
"peerDependencies": {
|
|
246
246
|
"@johnmorrisdotca/chikyu-earth": ">=0.10.0",
|