skydancer 2.11.0 → 2.12.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 CHANGED
@@ -4,6 +4,17 @@ Embeds point at `@2`, which follows the newest `v2.x.x` tag, so everything
4
4
  below reaches an existing embed as soon as it is tagged. This is the place to
5
5
  look when a dancer starts looking different.
6
6
 
7
+ ## v2.12.0 — 2026-11-20
8
+
9
+ - Pushing a version tag publishes to npm, with provenance, instead of it
10
+ being done by hand. The tag and `package.json` have to agree or the run
11
+ stops.
12
+ - The package carries its own types, so `querySelector('sky-dancer')` is the
13
+ element rather than a bare `HTMLElement`, and the attributes are written
14
+ down where an editor can offer them. No JSX declaration, since typing an
15
+ intrinsic element means naming a framework's own types and nobody should
16
+ have to carry those to install a tube man.
17
+
7
18
  ## v2.11.0 — 2026-11-20
8
19
 
9
20
  - A dancer with something to `shout` can be poked from a keyboard: it carries
package/README.md CHANGED
@@ -13,19 +13,37 @@ An animated inflatable tube man as an embeddable web widget. It is transparent,
13
13
  <sky-dancer color="#7d3cff" accent="#00e0c6" face="cool" style="height: 500px"></sky-dancer>
14
14
  ```
15
15
 
16
- With a bundler, install it and import it once instead -- for its side effect,
17
- since importing is what registers `<sky-dancer>`:
16
+ ### From npm
18
17
 
19
18
  ```sh
20
19
  npm install skydancer
21
20
  ```
22
21
 
22
+ Import it once, anywhere that runs before the markup does. There is nothing to
23
+ call and nothing to configure: importing is what registers `<sky-dancer>`.
24
+
23
25
  ```js
24
26
  import 'skydancer';
25
27
  ```
26
28
 
27
- It is the same file either way: no build step, no dependencies, and nothing to
28
- call once it is in.
29
+ After that it is an ordinary tag, so it works in whatever renders your HTML:
30
+
31
+ ```html
32
+ <sky-dancer color="#e8452c" accent="#ffd60a" print="SALE"
33
+ placard="Open till 8" hours="9-17" style="height: 420px"></sky-dancer>
34
+ ```
35
+
36
+ ```js
37
+ // the methods are on the element, so a reference to it is all you need
38
+ document.querySelector('sky-dancer').cheer();
39
+ ```
40
+
41
+ Every attribute is a plain string, so nothing needs a wrapper to pass one.
42
+ Importing where there is no browser, as when a page is rendered on a server,
43
+ does nothing rather than throwing.
44
+
45
+ It is the same file either way: no build step, no dependencies. Types come
46
+ with it, so `querySelector('sky-dancer')` knows what it has found.
29
47
 
30
48
  The widget is 400px tall by default and crops to the dancer: its width follows its height (1.4x, plus a little per extra dancer), so it sits inline like an image rather than filling the page. Size it with CSS -- set the height and the width follows, or set both to override the crop. The dancer scales with the height and keeps its proportions.
31
49
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "skydancer",
3
- "version": "2.11.0",
3
+ "version": "2.12.0",
4
4
  "description": "An embeddable inflatable tube dancer, as a custom element. Vanilla canvas, no dependencies.",
5
5
  "keywords": [
6
6
  "custom-element",
@@ -21,7 +21,10 @@
21
21
  "author": "Marjan Bajc",
22
22
  "type": "module",
23
23
  "exports": {
24
- ".": "./skydancer.js"
24
+ ".": {
25
+ "types": "./skydancer.d.ts",
26
+ "default": "./skydancer.js"
27
+ }
25
28
  },
26
29
  "main": "./skydancer.js",
27
30
  "module": "./skydancer.js",
@@ -29,6 +32,7 @@
29
32
  "jsdelivr": "./skydancer.js",
30
33
  "files": [
31
34
  "skydancer.js",
35
+ "skydancer.d.ts",
32
36
  "README.md",
33
37
  "CHANGELOG.md",
34
38
  "LICENSE"
@@ -36,5 +40,6 @@
36
40
  "sideEffects": true,
37
41
  "engines": {
38
42
  "node": ">=18"
39
- }
43
+ },
44
+ "types": "./skydancer.d.ts"
40
45
  }
package/skydancer.d.ts ADDED
@@ -0,0 +1,98 @@
1
+ // Types for <sky-dancer>. Importing the package registers the element and
2
+ // nothing else, so there is no value to type -- what these describe is the
3
+ // element you then write in your markup.
4
+
5
+ export {};
6
+
7
+ /** A face to wear. */
8
+ export type SkyDancerFace =
9
+ | 'happy' | 'surprised' | 'cool' | 'wink' | 'joy' | 'sleepy' | 'angry';
10
+
11
+ /** Markings down the body. */
12
+ export type SkyDancerPattern = 'none' | 'rings' | 'spiral';
13
+
14
+ /** The shape of the speech balloon. */
15
+ export type SkyDancerBubble = 'drawn' | 'box' | 'burst';
16
+
17
+ /**
18
+ * The element itself. Every setting is an attribute, so the methods below are
19
+ * the whole of the interface.
20
+ */
21
+ export interface SkyDancerElement extends HTMLElement {
22
+ /** Set it off: the same burst a poke gives it. A held pose stays still. */
23
+ cheer(): void;
24
+ /** Let the air out. It stays on show -- this is a mood, not `hide()`. */
25
+ deflate(): void;
26
+ /** Put the air back. */
27
+ inflate(): void;
28
+ /** Take it off the page. */
29
+ hide(): void;
30
+ /** Put it back. */
31
+ show(): void;
32
+ }
33
+
34
+ /**
35
+ * What a dancer can be told, as attributes. Everything is optional, and
36
+ * everything is written as a string the way an attribute always is -- the
37
+ * numbers included.
38
+ */
39
+ export interface SkyDancerAttributes {
40
+ /** Body colour. Any CSS colour. Default `#ff3b30`. */
41
+ color?: string;
42
+ /** Arms and hair colour. Default `#ffd60a`. */
43
+ accent?: string;
44
+ /** How fat the tube is, in px at a 1000px reference height. Default `64`. */
45
+ girth?: string | number;
46
+ /** Arm length as a fraction of body height. Default `0.32`. */
47
+ 'arm-length'?: string | number;
48
+ /** How fast it dances. `0` holds the pose. Default `1`. */
49
+ speed?: string | number;
50
+ /** How much it flails. Default `1`. */
51
+ wildness?: string | number;
52
+ /** Wind strength; `0` is calm. Scales gusts, the pointer and the page's
53
+ * scrolling. Default `1`. */
54
+ wind?: string | number;
55
+ /** Which face it wears. Default `happy`. */
56
+ face?: SkyDancerFace;
57
+ /** `false` hides the hair. Default `true`. */
58
+ hair?: string | boolean;
59
+ /** How many stand together, 1 to 6. Default `1`. */
60
+ count?: string | number;
61
+ /** Give a crowd a colour, face and build each. Default `false`. */
62
+ variety?: string | boolean;
63
+ /** Hold the pose. It stays on show, it simply stops. Default `false`. */
64
+ paused?: string | boolean;
65
+ /** Markings on the body. Default `none`. */
66
+ pattern?: SkyDancerPattern;
67
+ /** Words printed down the body, bending with the tube. */
68
+ print?: string;
69
+ /** Words on a board staked at its feet, which hold still. */
70
+ placard?: string;
71
+ /** What it blurts when poked. Divide several with `|`, `||` for a literal
72
+ * pipe; each poke takes one, never the one it took last. */
73
+ shout?: string;
74
+ /** Where a click leads, opened in a new tab. Only `http`, `https`, `mailto`
75
+ * and `tel` are followed. */
76
+ href?: string;
77
+ /** Words in a speech balloon. Divide several with `|` and it works through
78
+ * them in turn; `||` writes a literal pipe. */
79
+ sign?: string;
80
+ /** The balloon's shape. Default `drawn`. */
81
+ bubble?: SkyDancerBubble;
82
+ /** When it is worth dancing, as `9-17`; `22-6` runs through midnight.
83
+ * Outside them the air is out and it lies flat. Read from the reader's own
84
+ * clock. Empty means always. */
85
+ hours?: string;
86
+ }
87
+
88
+ declare global {
89
+ // So `document.querySelector('sky-dancer')` and `createElement` are typed.
90
+ interface HTMLElementTagNameMap {
91
+ 'sky-dancer': SkyDancerElement;
92
+ }
93
+ }
94
+
95
+ // No JSX declaration here on purpose: typing an intrinsic element means
96
+ // naming a framework's own JSX types, and this package should not make
97
+ // everyone who installs it carry React's. A JSX user can write their own in
98
+ // a few lines, from `SkyDancerAttributes` above.