next-blurhash-previews 0.0.3-beta3 → 0.0.3-beta30
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/bin/generateBlurhash.js +23 -3
- package/bin/markdown-sync.js +7 -0
- package/bin/remark-plugin.js +5 -2
- package/components/ImageWithPreview.tsx +19 -8
- package/components/imagePreviewBootstrap.tsx +1 -3
- package/imagePreviewBootstrap.js +5 -0
- package/index.js +1 -3
- package/package.json +5 -3
- package/.prettierrc +0 -3
- package/img1.png +0 -0
- package/img5.png +0 -0
- package/junk.js +0 -1
- package/next-runner/.eslintrc.json +0 -3
- package/next-runner/README.md +0 -34
- package/next-runner/blog-posts/post1.md +0 -11
- package/next-runner/blog-posts/post2.md +0 -10
- package/next-runner/blog-posts/post3.md +0 -10
- package/next-runner/blog-posts/post4.md +0 -10
- package/next-runner/next.config.js +0 -6
- package/next-runner/package-lock.json +0 -5080
- package/next-runner/package.json +0 -23
- package/next-runner/pages/_app.js +0 -11
- package/next-runner/pages/_document.js +0 -17
- package/next-runner/pages/index.js +0 -47
- package/next-runner/public/dynamo-introduction/img1.png +0 -0
- package/next-runner/public/dynamo-introduction/img10.png +0 -0
- package/next-runner/public/dynamo-introduction/img11.png +0 -0
- package/next-runner/public/dynamo-introduction/img12.png +0 -0
- package/next-runner/public/dynamo-introduction/img13.png +0 -0
- package/next-runner/public/dynamo-introduction/img14.png +0 -0
- package/next-runner/public/dynamo-introduction/img15.png +0 -0
- package/next-runner/public/dynamo-introduction/img2.png +0 -0
- package/next-runner/public/dynamo-introduction/img3.png +0 -0
- package/next-runner/public/dynamo-introduction/img4.png +0 -0
- package/next-runner/public/dynamo-introduction/img5.png +0 -0
- package/next-runner/public/dynamo-introduction/img5a.png +0 -0
- package/next-runner/public/dynamo-introduction/img6.png +0 -0
- package/next-runner/public/dynamo-introduction/img7.png +0 -0
- package/next-runner/public/dynamo-introduction/img8.png +0 -0
- package/next-runner/public/dynamo-introduction/img9.png +0 -0
- package/next-runner/public/favicon.ico +0 -0
- package/next-runner/public/img1.png +0 -0
- package/next-runner/public/img5.png +0 -0
- package/next-runner/public/vercel.svg +0 -4
- package/next-runner/styles/Home.module.css +0 -3
- package/next-runner/styles/globals.css +0 -22
- package/next-runner/yalc.lock +0 -9
- package/next-runner/yarn.lock +0 -1650
- package/tsconfig.json +0 -21
- package/tsconfig.node.json +0 -8
- package/yalc.lock +0 -9
package/bin/generateBlurhash.js
CHANGED
@@ -22,6 +22,20 @@ export async function getBlurhash(path) {
|
|
22
22
|
const dimensions = await blurhashImage.metadata();
|
23
23
|
|
24
24
|
const { width, height } = dimensions;
|
25
|
+
let blurhashW = width;
|
26
|
+
let blurhashH = height;
|
27
|
+
|
28
|
+
if (width > 200) {
|
29
|
+
const newBuffer = await blurhashImage.resize(200).toBuffer();
|
30
|
+
blurhashImage = sharp(newBuffer);
|
31
|
+
|
32
|
+
let newMetadata = await blurhashImage.metadata();
|
33
|
+
blurhashW = newMetadata.width;
|
34
|
+
blurhashH = newMetadata.height;
|
35
|
+
console.log("Adjustied", blurhashW, blurhashH);
|
36
|
+
} else {
|
37
|
+
console.log("Not adjusting", path, width);
|
38
|
+
}
|
25
39
|
|
26
40
|
return new Promise((res, rej) => {
|
27
41
|
blurhashImage
|
@@ -34,13 +48,19 @@ export async function getBlurhash(path) {
|
|
34
48
|
} else {
|
35
49
|
const blurhash = encode(
|
36
50
|
new Uint8ClampedArray(buffer),
|
37
|
-
|
38
|
-
|
51
|
+
blurhashW,
|
52
|
+
blurhashH,
|
39
53
|
4,
|
40
54
|
4
|
41
55
|
);
|
42
56
|
if (isBlurhashValid(blurhash)) {
|
43
|
-
return res({
|
57
|
+
return res({
|
58
|
+
blurhash,
|
59
|
+
dw: width,
|
60
|
+
dh: height,
|
61
|
+
w: blurhashW,
|
62
|
+
h: blurhashH,
|
63
|
+
});
|
44
64
|
} else {
|
45
65
|
console.log("FAIL");
|
46
66
|
return rej("FAIL");
|
package/bin/markdown-sync.js
CHANGED
@@ -6,6 +6,9 @@ import { fileURLToPath } from "url";
|
|
6
6
|
|
7
7
|
import { reporter } from "vfile-reporter";
|
8
8
|
import { remark } from "remark";
|
9
|
+
import remarkFrontmatter from "remark-frontmatter";
|
10
|
+
import remarkStringify from "remark-stringify";
|
11
|
+
|
9
12
|
import glob from "glob";
|
10
13
|
import colors from "colors";
|
11
14
|
|
@@ -37,6 +40,10 @@ async function runFile(file) {
|
|
37
40
|
return new Promise(res => {
|
38
41
|
remark()
|
39
42
|
.use(blurhashPlugin(publicPath))
|
43
|
+
.use(remarkFrontmatter)
|
44
|
+
.use(remarkStringify, {
|
45
|
+
fences: true,
|
46
|
+
})
|
40
47
|
.process(buffer)
|
41
48
|
.then(outputFile => {
|
42
49
|
fs.writeFileSync(file, outputFile.toString());
|
package/bin/remark-plugin.js
CHANGED
@@ -1,6 +1,5 @@
|
|
1
1
|
import path from "path";
|
2
2
|
import { visitParents } from "unist-util-visit-parents";
|
3
|
-
import prettier from "prettier";
|
4
3
|
|
5
4
|
import colors from "colors";
|
6
5
|
|
@@ -15,6 +14,10 @@ export const blurhashPlugin = publicPath => () => {
|
|
15
14
|
|
16
15
|
const originalImg = imagePath;
|
17
16
|
if (!/http/.test(imagePath)) {
|
17
|
+
if (imagePath.startsWith("/")) {
|
18
|
+
imagePath = imagePath.substr(1);
|
19
|
+
}
|
20
|
+
|
18
21
|
imagePath = path.resolve(publicPath, imagePath);
|
19
22
|
}
|
20
23
|
|
@@ -40,7 +43,7 @@ export const blurhashPlugin = publicPath => () => {
|
|
40
43
|
|
41
44
|
parent.children[index] = {
|
42
45
|
type: "html",
|
43
|
-
value:
|
46
|
+
value: newNode,
|
44
47
|
};
|
45
48
|
} catch (er) {
|
46
49
|
console.log(colors.red(`Error processing ${imagePath}\n\t`, er));
|
@@ -1,6 +1,12 @@
|
|
1
1
|
import { decode } from "../node_modules/blurhash/dist/esm/index";
|
2
2
|
|
3
|
-
type blurhash = {
|
3
|
+
type blurhash = {
|
4
|
+
w: number;
|
5
|
+
h: number;
|
6
|
+
dw: number;
|
7
|
+
dh: number;
|
8
|
+
blurhash: string;
|
9
|
+
};
|
4
10
|
|
5
11
|
class ImageWithPreview extends HTMLElement {
|
6
12
|
sd: ShadowRoot;
|
@@ -49,18 +55,23 @@ class ImageWithPreview extends HTMLElement {
|
|
49
55
|
}
|
50
56
|
|
51
57
|
#imgLoad = () => {
|
52
|
-
this.sd.innerHTML = `<slot name="image"></slot>`;
|
58
|
+
//this.sd.innerHTML = `<slot name="image"></slot>`;
|
53
59
|
};
|
54
60
|
|
55
61
|
attributeChangedCallback(name) {
|
56
62
|
if (this.#canvasEl && name === "preview") {
|
57
|
-
this.#updatePreview();
|
63
|
+
const time = this.#updatePreview();
|
64
|
+
console.log(this.getAttribute("preview"), this.getAttribute("url"), time);
|
58
65
|
}
|
59
66
|
}
|
60
67
|
|
61
68
|
#updatePreview() {
|
62
69
|
const previewObj = JSON.parse(this.getAttribute("preview")!);
|
70
|
+
|
71
|
+
const start = +new Date();
|
63
72
|
updateBlurHashPreview(this.#canvasEl, previewObj);
|
73
|
+
const end = +new Date();
|
74
|
+
return end - start;
|
64
75
|
}
|
65
76
|
}
|
66
77
|
|
@@ -69,14 +80,14 @@ if (!customElements.get("blurhash-image")) {
|
|
69
80
|
}
|
70
81
|
|
71
82
|
function updateBlurHashPreview(canvasEl: HTMLCanvasElement, preview: blurhash) {
|
72
|
-
const { w
|
83
|
+
const { w, h, dw, dh } = preview;
|
73
84
|
|
74
|
-
canvasEl.width =
|
75
|
-
canvasEl.height =
|
85
|
+
canvasEl.width = dw;
|
86
|
+
canvasEl.height = dh;
|
76
87
|
|
77
|
-
const pixels = decode(preview.blurhash,
|
88
|
+
const pixels = decode(preview.blurhash, w, h);
|
78
89
|
const ctx = canvasEl.getContext("2d")!;
|
79
|
-
const imageData = ctx.createImageData(
|
90
|
+
const imageData = ctx.createImageData(w, h);
|
80
91
|
imageData.data.set(pixels);
|
81
92
|
ctx.putImageData(imageData, 0, 0);
|
82
93
|
}
|
@@ -1,7 +1,5 @@
|
|
1
1
|
import { createElement } from "react";
|
2
|
-
import Script from "next/script";
|
3
2
|
|
4
|
-
export const imagePreviewBootstrap = createElement(
|
3
|
+
export const imagePreviewBootstrap = createElement("script", {
|
5
4
|
dangerouslySetInnerHTML: { __html: `(() => { /*HERE*/ })();` },
|
6
|
-
strategy: "beforeInteractive",
|
7
5
|
});
|
@@ -0,0 +1,5 @@
|
|
1
|
+
import { createElement } from "react";
|
2
|
+
|
3
|
+
export const imagePreviewBootstrap = createElement("script", {
|
4
|
+
dangerouslySetInnerHTML: { __html: `(() => { "use strict";const R=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","#","$","%","*","+",",","-",".",":",";","=","?","@","[","]","^","_","{","|","}","~"],u=t=>{let e=0;for(let s=0;s<t.length;s++){const n=t[s],r=R.indexOf(n);e=e*83+r}return e},p=t=>{let e=t/255;return e<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)},v=t=>{let e=Math.max(0,Math.min(1,t));return e<=.0031308?Math.round(e*12.92*255+.5):Math.round((1.055*Math.pow(e,.4166666666666667)-.055)*255+.5)},D=t=>t<0?-1:1,x=(t,e)=>D(t)*Math.pow(Math.abs(t),e);class A extends Error{constructor(e){super(e),this.name="ValidationError",this.message=e}}const L=t=>{if(!t||t.length<6)throw new A("The blurhash string must be at least 6 characters");const e=u(t[0]),s=Math.floor(e/9)+1,n=e%9+1;if(t.length!==4+2*n*s)throw new A(\`blurhash length mismatch: length is \${t.length} but it should be \${4+2*n*s}\`)},G=t=>{const e=t>>16,s=t>>8&255,n=t&255;return[p(e),p(s),p(n)]},I=(t,e)=>{const s=Math.floor(t/361),n=Math.floor(t/19)%19,r=t%19;return[x((s-9)/9,2)*e,x((n-9)/9,2)*e,x((r-9)/9,2)*e]},T=(t,e,s,n)=>{L(t),n=n|1;const r=u(t[0]),a=Math.floor(r/9)+1,c=r%9+1,d=(u(t[1])+1)/166,g=new Array(c*a);for(let o=0;o<g.length;o++)if(o===0){const i=u(t.substring(2,6));g[o]=G(i)}else{const i=u(t.substring(4+o*2,6+o*2));g[o]=I(i,d*n)}const l=e*4,h=new Uint8ClampedArray(l*s);for(let o=0;o<s;o++)for(let i=0;i<e;i++){let C=0,q=0,y=0;for(let m=0;m<a;m++)for(let f=0;f<c;f++){const b=Math.cos(Math.PI*i*f/e)*Math.cos(Math.PI*o*m/s);let M=g[f+m*c];C+=M[0]*b,q+=M[1]*b,y+=M[2]*b}let B=v(C),E=v(q),P=v(y);h[4*i+0+o*l]=B,h[4*i+1+o*l]=E,h[4*i+2+o*l]=P,h[4*i+3+o*l]=255}return h};class O extends HTMLElement{sd;mo;static observedAttributes=["preview"];get#t(){return this.querySelector("img")}get#e(){return this.querySelector("canvas")}constructor(){super(),this.sd=this.attachShadow({mode:"open"}),this.sd.innerHTML='<slot name="preview"></slot>'}#s=()=>{if(this.#t&&this.#e)return this.mo?.disconnect(),this.#t.complete?this.#n():(this.#o(),this.#t.addEventListener("load",this.#n)),!0};connectedCallback(){this.#s()||(this.mo=new MutationObserver(this.#s),this.mo.observe(this,{subtree:!0,childList:!0,attributes:!1}))}#n=()=>{};attributeChangedCallback(e){if(this.#e&&e==="preview"){const s=this.#o();console.log(this.getAttribute("preview"),this.getAttribute("url"),s)}}#o(){const e=JSON.parse(this.getAttribute("preview")),s=+new Date;return S(this.#e,e),+new Date-s}}customElements.get("blurhash-image")||customElements.define("blurhash-image",O);function S(t,e){const{w:s,h:n,dw:r,dh:a}=e;t.width=r,t.height=a;const c=T(e.blurhash,s,n),w=t.getContext("2d"),d=w.createImageData(s,n);d.data.set(c),w.putImageData(d,0,0)} })();` },
|
5
|
+
});
|
package/index.js
CHANGED
@@ -1,5 +1,3 @@
|
|
1
|
-
import { imagePreviewBootstrap } from "./imagePreviewBootstrap";
|
1
|
+
import { imagePreviewBootstrap } from "./imagePreviewBootstrap.js";
|
2
2
|
|
3
3
|
export { imagePreviewBootstrap };
|
4
|
-
|
5
|
-
export const src = `(() => { "use strict";var A=Object.defineProperty;var R=(t,e,s)=>e in t?A(t,e,{enumerable:!0,configurable:!0,writable:!0,value:s}):t[e]=s;var u=(t,e,s)=>(R(t,typeof e!="symbol"?e+"":e,s),s);const G=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","#","$","%","*","+",",","-",".",":",";","=","?","@","[","]","^","_","{","|","}","~"],h=t=>{let e=0;for(let s=0;s<t.length;s++){const n=t[s],o=G.indexOf(n);e=e*83+o}return e},p=t=>{let e=t/255;return e<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)},b=t=>{let e=Math.max(0,Math.min(1,t));return e<=.0031308?Math.round(e*12.92*255+.5):Math.round((1.055*Math.pow(e,.4166666666666667)-.055)*255+.5)},P=t=>t<0?-1:1,E=(t,e)=>P(t)*Math.pow(Math.abs(t),e);class v extends Error{constructor(e){super(e),this.name="ValidationError",this.message=e}}const k=t=>{if(!t||t.length<6)throw new v("The blurhash string must be at least 6 characters");const e=h(t[0]),s=Math.floor(e/9)+1,n=e%9+1;if(t.length!==4+2*n*s)throw new v(\`blurhash length mismatch: length is \${t.length} but it should be \${4+2*n*s}\`)},D=t=>{const e=t>>16,s=t>>8&255,n=t&255;return[p(e),p(s),p(n)]},H=(t,e)=>{const s=Math.floor(t/361),n=Math.floor(t/19)%19,o=t%19;return[E((s-9)/9,2)*e,E((n-9)/9,2)*e,E((o-9)/9,2)*e]},S=(t,e,s,n)=>{k(t),n=n|1;const o=h(t[0]),a=Math.floor(o/9)+1,c=o%9+1,q=(h(t[1])+1)/166,g=new Array(c*a);for(let r=0;r<g.length;r++)if(r===0){const i=h(t.substring(2,6));g[r]=D(i)}else{const i=h(t.substring(4+r*2,6+r*2));g[r]=H(i,q*n)}const l=e*4,d=new Uint8ClampedArray(l*s);for(let r=0;r<s;r++)for(let i=0;i<e;i++){let I=0,x=0,C=0;for(let m=0;m<a;m++)for(let f=0;f<c;f++){const M=Math.cos(Math.PI*i*f/e)*Math.cos(Math.PI*r*m/s);let w=g[f+m*c];I+=w[0]*M,x+=w[1]*M,C+=w[2]*M}let B=b(I),T=b(x),y=b(C);d[4*i+0+r*l]=B,d[4*i+1+r*l]=T,d[4*i+2+r*l]=y,d[4*i+3+r*l]=255}return d};class L extends HTMLElement{constructor(){super();u(this,"loaded",!1);u(this,"sd");u(this,"onImageLoad",()=>{this.getAttribute("url")!==this.currentImageEl.src&&setTimeout(()=>{this.loaded=!0,this.render()},1500)});this.sd=this.attachShadow({mode:"open"}),this.sd.innerHTML='<slot name="preview"></slot>'}get currentImageEl(){return this.querySelector("img")}get currentCanvasEl(){return this.querySelector("canvas")}connectedCallback(){this.currentImageEl.complete&&this.onImageLoad(),this.currentImageEl.addEventListener("load",this.onImageLoad)}attributeChangedCallback(s,n,o){if(s==="preview"){const a=JSON.parse(o);O(this.currentCanvasEl,a)}else s==="url"&&o!==this.currentImageEl.getAttribute("src")&&(this.loaded=!1,this.currentImageEl.src=o||"");this.render()}render(){this.sd.innerHTML=\`<slot name="\${this.loaded?"image":"preview"}"></slot>\`}}u(L,"observedAttributes",["preview","url"]);customElements.get("uikit-image")||customElements.define("uikit-image",L);function O(t,e){const{w:s,h:n}=e;t.width=s,t.height=n;const o=S(e.blurhash,s,n),a=t.getContext("2d"),c=a.createImageData(s,n);c.data.set(o),a.putImageData(c,0,0)} })();`;
|
package/package.json
CHANGED
@@ -1,8 +1,9 @@
|
|
1
1
|
{
|
2
2
|
"name": "next-blurhash-previews",
|
3
|
-
"version": "0.0.3-
|
3
|
+
"version": "0.0.3-beta30",
|
4
4
|
"description": "",
|
5
5
|
"main": "index.js",
|
6
|
+
"module": "index.js",
|
6
7
|
"bin": {
|
7
8
|
"blurhash-markdown": "./bin/markdown-sync.js"
|
8
9
|
},
|
@@ -30,10 +31,11 @@
|
|
30
31
|
"blurhash": "^1.1.5",
|
31
32
|
"colors": "^1.4.0",
|
32
33
|
"glob": "^8.0.3",
|
33
|
-
"
|
34
|
+
"install": "^0.13.0",
|
34
35
|
"node-fetch": "^3.2.6",
|
35
|
-
"
|
36
|
+
"npm": "^8.15.1",
|
36
37
|
"remark": "^14.0.2",
|
38
|
+
"remark-frontmatter": "^4.0.1",
|
37
39
|
"retext": "^8.1.0",
|
38
40
|
"sharp": "^0.30.7",
|
39
41
|
"to-vfile": "^7.2.3",
|
package/.prettierrc
DELETED
package/img1.png
DELETED
Binary file
|
package/img5.png
DELETED
Binary file
|
package/junk.js
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
"use strict";var B=Object.defineProperty;var T=(t,e,s)=>e in t?B(t,e,{enumerable:!0,configurable:!0,writable:!0,value:s}):t[e]=s;var a=(t,e,s)=>(T(t,typeof e!="symbol"?e+"":e,s),s);const k=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","#","$","%","*","+",",","-",".",":",";","=","?","@","[","]","^","_","{","|","}","~"],h=t=>{let e=0;for(let s=0;s<t.length;s++){const n=t[s],o=k.indexOf(n);e=e*83+o}return e},p=t=>{let e=t/255;return e<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)},b=t=>{let e=Math.max(0,Math.min(1,t));return e<=.0031308?Math.round(e*12.92*255+.5):Math.round((1.055*Math.pow(e,.4166666666666667)-.055)*255+.5)},A=t=>t<0?-1:1,v=(t,e)=>A(t)*Math.pow(Math.abs(t),e);class C extends Error{constructor(e){super(e),this.name="ValidationError",this.message=e}}const G=t=>{if(!t||t.length<6)throw new C("The blurhash string must be at least 6 characters");const e=h(t[0]),s=Math.floor(e/9)+1,n=e%9+1;if(t.length!==4+2*n*s)throw new C(\`blurhash length mismatch: length is \${t.length} but it should be \${4+2*n*s}\`)},V=t=>{const e=t>>16,s=t>>8&255,n=t&255;return[p(e),p(s),p(n)]},D=(t,e)=>{const s=Math.floor(t/361),n=Math.floor(t/19)%19,o=t%19;return[v((s-9)/9,2)*e,v((n-9)/9,2)*e,v((o-9)/9,2)*e]},H=(t,e,s,n)=>{G(t),n=n|1;const o=h(t[0]),c=Math.floor(o/9)+1,l=o%9+1,x=(h(t[1])+1)/166,g=new Array(l*c);for(let r=0;r<g.length;r++)if(r===0){const i=h(t.substring(2,6));g[r]=V(i)}else{const i=h(t.substring(4+r*2,6+r*2));g[r]=D(i,x*n)}const d=e*4,u=new Uint8ClampedArray(d*s);for(let r=0;r<s;r++)for(let i=0;i<e;i++){let y=0,E=0,I=0;for(let m=0;m<c;m++)for(let f=0;f<l;f++){const w=Math.cos(Math.PI*i*f/e)*Math.cos(Math.PI*r*m/s);let M=g[f+m*l];y+=M[0]*w,E+=M[1]*w,I+=M[2]*w}let L=b(y),P=b(E),q=b(I);u[4*i+0+r*d]=L,u[4*i+1+r*d]=P,u[4*i+2+r*d]=q,u[4*i+3+r*d]=255}return u};class R extends HTMLElement{constructor(){super();a(this,"isReady",!1);a(this,"loaded",!1);a(this,"sd");a(this,"mo");a(this,"checkReady",()=>{this.currentImageEl&&this.currentCanvasEl&&(this.ready(),this.mo.disconnect())});a(this,"onImageLoad",()=>{this.getAttribute("url")!==this.currentImageEl.src&&setTimeout(()=>{this.loaded=!0,this.render()},1500)});this.sd=this.attachShadow({mode:"open"}),this.sd.innerHTML='<slot name="preview"></slot>'}get currentImageEl(){return this.querySelector("img")}get currentCanvasEl(){return this.querySelector("canvas")}connectedCallback(){this.mo=new MutationObserver(this.checkReady),this.mo.observe(this,{subtree:!0,childList:!0,attributes:!1})}ready(){this.isReady=!0,this.currentImageEl.complete&&this.onImageLoad(),this.currentImageEl.addEventListener("load",this.onImageLoad),this.loaded||this.updatePreview()}attributeChangedCallback(s,n,o){!this.isReady||(s==="preview"?this.updatePreview():s==="url"&&(this.loaded=!1),this.render())}updatePreview(){const s=JSON.parse(this.getAttribute("preview"));O(this.currentCanvasEl,s)}render(){this.sd.innerHTML=\`<slot name="\${this.loaded?"image":"preview"}"></slot>\`}}a(R,"observedAttributes",["preview","url"]);customElements.get("uikit-image")||customElements.define("uikit-image",R);function O(t,e){const{w:s,h:n}=e;t.width=s,t.height=n;const o=H(e.blurhash,s,n),c=t.getContext("2d"),l=c.createImageData(s,n);l.data.set(o),c.putImageData(l,0,0)}
|
package/next-runner/README.md
DELETED
@@ -1,34 +0,0 @@
|
|
1
|
-
This is a [Next.js](https://nextjs.org/) project bootstrapped with [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app).
|
2
|
-
|
3
|
-
## Getting Started
|
4
|
-
|
5
|
-
First, run the development server:
|
6
|
-
|
7
|
-
```bash
|
8
|
-
npm run dev
|
9
|
-
# or
|
10
|
-
yarn dev
|
11
|
-
```
|
12
|
-
|
13
|
-
Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.
|
14
|
-
|
15
|
-
You can start editing the page by modifying `pages/index.js`. The page auto-updates as you edit the file.
|
16
|
-
|
17
|
-
[API routes](https://nextjs.org/docs/api-routes/introduction) can be accessed on [http://localhost:3000/api/hello](http://localhost:3000/api/hello). This endpoint can be edited in `pages/api/hello.js`.
|
18
|
-
|
19
|
-
The `pages/api` directory is mapped to `/api/*`. Files in this directory are treated as [API routes](https://nextjs.org/docs/api-routes/introduction) instead of React pages.
|
20
|
-
|
21
|
-
## Learn More
|
22
|
-
|
23
|
-
To learn more about Next.js, take a look at the following resources:
|
24
|
-
|
25
|
-
- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API.
|
26
|
-
- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial.
|
27
|
-
|
28
|
-
You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js/) - your feedback and contributions are welcome!
|
29
|
-
|
30
|
-
## Deploy on Vercel
|
31
|
-
|
32
|
-
The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js.
|
33
|
-
|
34
|
-
Check out our [Next.js deployment documentation](https://nextjs.org/docs/deployment) for more details.
|