@substrate-system/blur-hash 0.0.7 → 0.0.8

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.
Files changed (2) hide show
  1. package/README.md +19 -2
  2. package/package.json +3 -2
package/README.md CHANGED
@@ -25,7 +25,8 @@ with the [blur-hash algorithm](https://blurha.sh/), as a [web component](https:/
25
25
  * [CJS](#cjs)
26
26
  * [Bundler](#bundler)
27
27
  * [pre-built JS](#pre-built-js)
28
- - [use](#use)
28
+ - [Use](#use)
29
+ * [Server-side rendering](#server-side-rendering)
29
30
  - [API](#api)
30
31
  * [Attributes](#attributes)
31
32
  * [`.reset`](#reset)
@@ -92,7 +93,7 @@ Use the tag in HTML.
92
93
  </div>
93
94
  ```
94
95
 
95
- ## use
96
+ ## Use
96
97
  Call the static method `.define` in JS, then use the tag in HTML.
97
98
 
98
99
  ```js
@@ -111,6 +112,22 @@ BlurHash.define()
111
112
  ></blur-hash>
112
113
  ```
113
114
 
115
+ ### Server-side rendering
116
+ Following convention, this module exposes an `html` function at `/ssr`. It
117
+ returns a plain string of appropriate markup in Node.
118
+
119
+ ```js
120
+ import { html } from '@substrate-system/blur-hash/ssr'
121
+
122
+ const htmlString = html({
123
+ alt: 'hello',
124
+ width: 30,
125
+ height: 30,
126
+ placeholder: 'UHGIM_X900xC~XWFE0xt00o3%1oz-;t7i|IV',
127
+ src: 'abc.jpg'
128
+ })
129
+ ```
130
+
114
131
  ## API
115
132
 
116
133
  ### Attributes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@substrate-system/blur-hash",
3
- "version": "0.0.7",
3
+ "version": "0.0.8",
4
4
  "type": "module",
5
5
  "description": "A blurry placeholder image web component",
6
6
  "main": "dist/index.js",
@@ -49,8 +49,9 @@
49
49
  "build": "mkdir -p ./dist && rm -rf ./dist/* && npm run build-cjs && npm run build-esm && npm run build-esm:min && npm run build-bin && npm run build-css && npm run build-css:min",
50
50
  "build-bin": "mkdir -p dist/bin && esbuild --platform=node ./bin/index.ts > ./dist/bin/index.js",
51
51
  "start": "vite",
52
+ "toc": "markdown-toc --maxdepth 3 -i README.md",
52
53
  "preversion": "npm run lint",
53
- "version": "markdown-toc --maxdepth 3 -i README.md && auto-changelog -p --template keepachangelog --breaking-pattern 'BREAKING CHANGE:' && git add CHANGELOG.md README.md",
54
+ "version": "npm run toc && auto-changelog -p --template keepachangelog --breaking-pattern 'BREAKING CHANGE:' && git add CHANGELOG.md README.md",
54
55
  "postversion": "git push --follow-tags && npm publish",
55
56
  "prepublishOnly": "npm run build"
56
57
  },