diff --git a/src/back/routes/component-preview/component-input.tsx b/src/back/routes/component-preview/component-input.tsx index f391ff4..980a7c5 100644 --- a/src/back/routes/component-preview/component-input.tsx +++ b/src/back/routes/component-preview/component-input.tsx @@ -1,4 +1,4 @@ -import { Enum, Image, List, Structured, Table, TableData } from "@sealcode/jdd"; +import { ComponentArguments, Enum, Image, List, Structured, Table, TableData } from "@sealcode/jdd"; import { ComponentArgument } from "@sealcode/jdd"; import { StatefulPage } from "@sealcode/sealgen"; import { TempstreamJSX } from "tempstream"; @@ -10,6 +10,9 @@ import { ComponentInputStructured } from "./component-input-structured.js"; import { ComponentInputTable } from "./component-input-table.js"; import { printArgPath } from "./print-arg-path.js"; +export const actionName = "Components"; +const absoluteUrlPattern = "http(s?)(://)((www.)?)(([^.]+).)?([a-zA-z0-9-_]+)"; + export function ComponentInput({ state, arg_path, @@ -30,6 +33,12 @@ export function ComponentInput({ return ComponentInputList({ state, arg_path, arg, value: value as T[], page }); } + const argType = arg.getTypeName(); + const isUrlAbsolute = + arg instanceof ComponentArguments.URL && + arg.urlType === "absolute"; + const inputType = isUrlAbsolute ? "url" : "text"; + if (arg instanceof Structured) { return ComponentInputStructured({ state, @@ -74,7 +83,7 @@ export function ComponentInput({