Update Tempstream
This commit is contained in:
parent
106fcc86c8
commit
33ad8760eb
24
package-lock.json
generated
24
package-lock.json
generated
@ -30,7 +30,7 @@
|
|||||||
"qs": "^6.12.0",
|
"qs": "^6.12.0",
|
||||||
"sealious": "^0.19.9",
|
"sealious": "^0.19.9",
|
||||||
"stimulus": "^3.2.2",
|
"stimulus": "^3.2.2",
|
||||||
"tempstream": "^0.3.16",
|
"tempstream": "^0.4.1",
|
||||||
"throttle-debounce": "^5.0.2",
|
"throttle-debounce": "^5.0.2",
|
||||||
"turndown": "^7.2.0"
|
"turndown": "^7.2.0"
|
||||||
},
|
},
|
||||||
@ -857,6 +857,14 @@
|
|||||||
"version": "0.5.3",
|
"version": "0.5.3",
|
||||||
"license": "ISC"
|
"license": "ISC"
|
||||||
},
|
},
|
||||||
|
"node_modules/@sealcode/jdd/node_modules/tempstream": {
|
||||||
|
"version": "0.3.18",
|
||||||
|
"resolved": "https://registry.npmjs.org/tempstream/-/tempstream-0.3.18.tgz",
|
||||||
|
"integrity": "sha512-0V/efjocOnjQtBFC6tR8twlI+ygRNgpisOLneVd+Uma9Oic6fo67OqCwEdrIN2DHs3H72St4ACPqHmnlI1YRag==",
|
||||||
|
"dependencies": {
|
||||||
|
"classnames": "^2.5.1"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/@sealcode/sealgen": {
|
"node_modules/@sealcode/sealgen": {
|
||||||
"version": "0.15.45",
|
"version": "0.15.45",
|
||||||
"resolved": "https://registry.npmjs.org/@sealcode/sealgen/-/sealgen-0.15.45.tgz",
|
"resolved": "https://registry.npmjs.org/@sealcode/sealgen/-/sealgen-0.15.45.tgz",
|
||||||
@ -897,14 +905,6 @@
|
|||||||
"resolved": "https://registry.npmjs.org/@sealcode/ts-predicates/-/ts-predicates-0.4.3.tgz",
|
"resolved": "https://registry.npmjs.org/@sealcode/ts-predicates/-/ts-predicates-0.4.3.tgz",
|
||||||
"integrity": "sha512-UNSEacu7Ye8q0N8AJCJy37oJvv3w2OXKGkUnP7xO5lOY9DQviDPRDQhVaZdJ3/xMzXLm4UE3389ihctrPaov/A=="
|
"integrity": "sha512-UNSEacu7Ye8q0N8AJCJy37oJvv3w2OXKGkUnP7xO5lOY9DQviDPRDQhVaZdJ3/xMzXLm4UE3389ihctrPaov/A=="
|
||||||
},
|
},
|
||||||
"node_modules/@sealcode/sealgen/node_modules/tempstream": {
|
|
||||||
"version": "0.4.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/tempstream/-/tempstream-0.4.0.tgz",
|
|
||||||
"integrity": "sha512-NkO6l6LUvZEnxTicz143PbHHHLLJvp8yQy1UgIkNU5S0eGxyf0eKv2C81rAnyrff1Ehk8KzqDOhjaMTa6U0N4w==",
|
|
||||||
"dependencies": {
|
|
||||||
"classnames": "^2.5.1"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/@sealcode/ts-predicates": {
|
"node_modules/@sealcode/ts-predicates": {
|
||||||
"version": "0.6.2",
|
"version": "0.6.2",
|
||||||
"license": "ISC",
|
"license": "ISC",
|
||||||
@ -9539,9 +9539,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/tempstream": {
|
"node_modules/tempstream": {
|
||||||
"version": "0.3.18",
|
"version": "0.4.1",
|
||||||
"resolved": "https://registry.npmjs.org/tempstream/-/tempstream-0.3.18.tgz",
|
"resolved": "https://registry.npmjs.org/tempstream/-/tempstream-0.4.1.tgz",
|
||||||
"integrity": "sha512-0V/efjocOnjQtBFC6tR8twlI+ygRNgpisOLneVd+Uma9Oic6fo67OqCwEdrIN2DHs3H72St4ACPqHmnlI1YRag==",
|
"integrity": "sha512-b+UkHLO4CVVgDH01aZzbJO8vEAQaGBizYwDt7vCxWJZU1YXay/Hz/4oIlEgANlfuyuKnJpo5aFFGONXto6fatg==",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"classnames": "^2.5.1"
|
"classnames": "^2.5.1"
|
||||||
}
|
}
|
||||||
|
@ -61,7 +61,7 @@
|
|||||||
"qs": "^6.12.0",
|
"qs": "^6.12.0",
|
||||||
"sealious": "^0.19.9",
|
"sealious": "^0.19.9",
|
||||||
"stimulus": "^3.2.2",
|
"stimulus": "^3.2.2",
|
||||||
"tempstream": "^0.3.16",
|
"tempstream": "^0.4.1",
|
||||||
"throttle-debounce": "^5.0.2",
|
"throttle-debounce": "^5.0.2",
|
||||||
"turndown": "^7.2.0"
|
"turndown": "^7.2.0"
|
||||||
},
|
},
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import type { FlatTemplatable, Templatable } from "tempstream";
|
import type { FlatTemplatable, Templatable } from "tempstream";
|
||||||
import { tempstream } from "tempstream";
|
import { tempstreamAsync } from "tempstream";
|
||||||
import type { Readable } from "stream";
|
import type { Readable } from "stream";
|
||||||
import type { BaseContext } from "koa";
|
import type { BaseContext } from "koa";
|
||||||
import { toKebabCase } from "js-convert-case";
|
import { toKebabCase } from "js-convert-case";
|
||||||
@ -53,7 +53,7 @@ export default function html(
|
|||||||
controllers.push("refresh-styles");
|
controllers.push("refresh-styles");
|
||||||
controllers.push("refresh-on-ts-changes");
|
controllers.push("refresh-on-ts-changes");
|
||||||
}
|
}
|
||||||
return tempstream/* HTML */ ` <!DOCTYPE html>
|
return tempstreamAsync/* HTML */ ` <!DOCTYPE html>
|
||||||
<html
|
<html
|
||||||
lang="${htmlOptions.language || DEFAULT_HTML_LANG}"
|
lang="${htmlOptions.language || DEFAULT_HTML_LANG}"
|
||||||
class="title--${toKebabCase(title)}"
|
class="title--${toKebabCase(title)}"
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
import { TempstreamJSX } from "tempstream";
|
import { TempstreamJSX } from "tempstream";
|
||||||
import type { ComponentToHTMLArgs } from "@sealcode/jdd";
|
import type { ComponentToHTMLArgs } from "@sealcode/jdd";
|
||||||
import { Component, ComponentArguments } from "@sealcode/jdd";
|
import { Component, ComponentArguments } from "@sealcode/jdd";
|
||||||
import type { Readable } from "stream";
|
|
||||||
|
|
||||||
const component_arguments = {
|
const component_arguments = {
|
||||||
title: new ComponentArguments.ShortText(),
|
title: new ComponentArguments.ShortText(),
|
||||||
@ -23,7 +22,7 @@ export class NiceBox extends Component<typeof component_arguments> {
|
|||||||
args: { title, content, images },
|
args: { title, content, images },
|
||||||
classes,
|
classes,
|
||||||
jdd_context: { render_markdown, render_image, language },
|
jdd_context: { render_markdown, render_image, language },
|
||||||
}: ComponentToHTMLArgs<typeof component_arguments>): Promise<Readable> {
|
}: ComponentToHTMLArgs<typeof component_arguments>): Promise<string> {
|
||||||
return (
|
return (
|
||||||
<div class={["nice-box", ...classes]}>
|
<div class={["nice-box", ...classes]}>
|
||||||
<h2>{title}</h2>
|
<h2>{title}</h2>
|
||||||
|
@ -3,7 +3,6 @@ import { TempstreamJSX } from "tempstream";
|
|||||||
import type { ComponentArgument, List } from "@sealcode/jdd";
|
import type { ComponentArgument, List } from "@sealcode/jdd";
|
||||||
import type { JDDPageState } from "./jdd-page.js";
|
import type { JDDPageState } from "./jdd-page.js";
|
||||||
import type { StatefulPage } from "@sealcode/sealgen";
|
import type { StatefulPage } from "@sealcode/sealgen";
|
||||||
import type { Readable } from "node:stream";
|
|
||||||
import { ComponentInput } from "./component-input.js";
|
import { ComponentInput } from "./component-input.js";
|
||||||
import type { ComponentPreviewActions } from "./component-preview-actions.js";
|
import type { ComponentPreviewActions } from "./component-preview-actions.js";
|
||||||
|
|
||||||
@ -25,7 +24,7 @@ export async function ComponentInputList<
|
|||||||
arg: List<T, any>;
|
arg: List<T, any>;
|
||||||
value: T[];
|
value: T[];
|
||||||
page: StatefulPage<JDDPageState, typeof ComponentPreviewActions>;
|
page: StatefulPage<JDDPageState, typeof ComponentPreviewActions>;
|
||||||
}): Promise<Readable> {
|
}): Promise<string> {
|
||||||
if (!value) {
|
if (!value) {
|
||||||
value = [];
|
value = [];
|
||||||
}
|
}
|
||||||
|
@ -21,7 +21,7 @@ export async function ComponentInputSingleReference<
|
|||||||
arg: T;
|
arg: T;
|
||||||
value: string;
|
value: string;
|
||||||
onchange?: string;
|
onchange?: string;
|
||||||
}): Promise<import("stream").Readable> {
|
}): Promise<string> {
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<label>
|
<label>
|
||||||
|
@ -33,7 +33,7 @@ export async function ComponentInputTable<
|
|||||||
arg: Table<CellType, HeaderType>;
|
arg: Table<CellType, HeaderType>;
|
||||||
value: TableData<CellType, HeaderType>;
|
value: TableData<CellType, HeaderType>;
|
||||||
page: StatefulPage<JDDPageState, typeof ComponentPreviewActions>;
|
page: StatefulPage<JDDPageState, typeof ComponentPreviewActions>;
|
||||||
}): Promise<import("stream").Readable> {
|
}): Promise<string> {
|
||||||
if (!value) {
|
if (!value) {
|
||||||
value = await arg.getEmptyValue(makeJDDContext(ctx));
|
value = await arg.getEmptyValue(makeJDDContext(ctx));
|
||||||
}
|
}
|
||||||
|
@ -6,7 +6,6 @@ import { ComponentArguments, Enum, Image, List, Structured, Table } from "@sealc
|
|||||||
import { ComponentInputStructured } from "./component-input-structured.js";
|
import { ComponentInputStructured } from "./component-input-structured.js";
|
||||||
import type { StatefulPage } from "@sealcode/sealgen";
|
import type { StatefulPage } from "@sealcode/sealgen";
|
||||||
import type { ComponentPreviewActions } from "./component-preview-actions.js";
|
import type { ComponentPreviewActions } from "./component-preview-actions.js";
|
||||||
import type { Readable } from "node:stream";
|
|
||||||
import { ComponentInputList } from "./component-input-list.js";
|
import { ComponentInputList } from "./component-input-list.js";
|
||||||
import type { JDDPageState } from "./jdd-page.js";
|
import type { JDDPageState } from "./jdd-page.js";
|
||||||
import { ComponentInputEnum } from "./component-input-enum.js";
|
import { ComponentInputEnum } from "./component-input-enum.js";
|
||||||
@ -35,7 +34,7 @@ export async function ComponentInput<State extends JDDPageState, T>({
|
|||||||
arg: ComponentArgument<T>;
|
arg: ComponentArgument<T>;
|
||||||
value: T;
|
value: T;
|
||||||
page: StatefulPage<JDDPageState, typeof ComponentPreviewActions>;
|
page: StatefulPage<JDDPageState, typeof ComponentPreviewActions>;
|
||||||
}): Promise<Readable> {
|
}): Promise<string> {
|
||||||
if (value === undefined) {
|
if (value === undefined) {
|
||||||
value = await arg.getEmptyValue(makeJDDContext(ctx));
|
value = await arg.getEmptyValue(makeJDDContext(ctx));
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user