@sealcode/jdd-editor 0.1.1 → 0.1.2
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.
|
@@ -11,7 +11,7 @@ async function ComponentInputStructured({
|
|
|
11
11
|
return `<fieldset
|
|
12
12
|
id="${`component-input-structured-${arg_path.join("-")}`}"
|
|
13
13
|
>
|
|
14
|
-
<legend
|
|
14
|
+
<legend>${arg_path.at(-1)}</legend>
|
|
15
15
|
${(await Promise.all(
|
|
16
16
|
Object.entries(arg.structure).map(async ([arg_name, arg2]) => {
|
|
17
17
|
const ret = `<div>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/inputs/component-input-structured.ts"],
|
|
4
|
-
"sourcesContent": ["import type { Context } from \"koa\";\nimport type { ComponentArgument, JDDContext, Structured } from \"@sealcode/jdd\";\nimport type { StatefulPage } from \"@sealcode/sealgen\";\nimport { ComponentInput } from \"./component-input.js\";\nimport type { JDDPageState } from \"../jdd-page.js\";\nimport type { ComponentPreviewActions } from \"../component-preview-actions.js\";\n\nexport async function ComponentInputStructured<\n\tT extends Structured<Record<string, ComponentArgument<unknown>>>\n>({\n\tstate,\n\tctx,\n\targ_path,\n\targ,\n\tvalue,\n\tpage,\n\t...rest\n}: {\n\tstate: JDDPageState;\n\tctx: Context;\n\targ_path: string[];\n\targ: T;\n\tvalue: Record<string, unknown>;\n\tpage: StatefulPage<JDDPageState, typeof ComponentPreviewActions>;\n\tmakeJDDContext: (ctx: Context) => JDDContext;\n\tmakeAssetURL: (asset: string) => string;\n}) {\n\treturn /* HTML */ `<fieldset\n\t\tid=\"${`component-input-structured-${arg_path.join(\"-\")}`}\"\n\t>\n\t\t<legend
|
|
5
|
-
"mappings": "AAGA,SAAS,sBAAsB;AAI/B,eAAsB,yBAEpB;AAAA,EACD;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,KACG;AACJ,GASG;AACF,SAAkB;AAAA,QACX,8BAA8B,SAAS,KAAK,GAAG;AAAA;AAAA;AAAA,
|
|
4
|
+
"sourcesContent": ["import type { Context } from \"koa\";\nimport type { ComponentArgument, JDDContext, Structured } from \"@sealcode/jdd\";\nimport type { StatefulPage } from \"@sealcode/sealgen\";\nimport { ComponentInput } from \"./component-input.js\";\nimport type { JDDPageState } from \"../jdd-page.js\";\nimport type { ComponentPreviewActions } from \"../component-preview-actions.js\";\n\nexport async function ComponentInputStructured<\n\tT extends Structured<Record<string, ComponentArgument<unknown>>>\n>({\n\tstate,\n\tctx,\n\targ_path,\n\targ,\n\tvalue,\n\tpage,\n\t...rest\n}: {\n\tstate: JDDPageState;\n\tctx: Context;\n\targ_path: string[];\n\targ: T;\n\tvalue: Record<string, unknown>;\n\tpage: StatefulPage<JDDPageState, typeof ComponentPreviewActions>;\n\tmakeJDDContext: (ctx: Context) => JDDContext;\n\tmakeAssetURL: (asset: string) => string;\n}) {\n\treturn /* HTML */ `<fieldset\n\t\tid=\"${`component-input-structured-${arg_path.join(\"-\")}`}\"\n\t>\n\t\t<legend>${arg_path.at(-1)}</legend>\n\t\t${(\n\t\t\tawait Promise.all(\n\t\t\t\tObject.entries(arg.structure).map(async ([arg_name, arg]) => {\n\t\t\t\t\tconst ret = `<div>\n\t\t\t\t\t\t${await ComponentInput({\n\t\t\t\t\t\t\tctx,\n\t\t\t\t\t\t\tstate,\n\t\t\t\t\t\t\targ_path: [...arg_path, arg_name],\n\t\t\t\t\t\t\targ,\n\t\t\t\t\t\t\tvalue: value[arg_name],\n\t\t\t\t\t\t\tpage,\n\t\t\t\t\t\t\t...rest,\n\t\t\t\t\t\t})}\n\t\t\t\t\t</div>`;\n\t\t\t\t\treturn ret;\n\t\t\t\t})\n\t\t\t)\n\t\t).join(\"\")}\n\t</fieldset>`;\n}\n"],
|
|
5
|
+
"mappings": "AAGA,SAAS,sBAAsB;AAI/B,eAAsB,yBAEpB;AAAA,EACD;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,KACG;AACJ,GASG;AACF,SAAkB;AAAA,QACX,8BAA8B,SAAS,KAAK,GAAG;AAAA;AAAA,YAE3C,SAAS,GAAG,EAAE;AAAA,KAEvB,MAAM,QAAQ;AAAA,IACb,OAAO,QAAQ,IAAI,SAAS,EAAE,IAAI,OAAO,CAAC,UAAUA,IAAG,MAAM;AAC5D,YAAM,MAAM;AAAA,QACT,MAAM,eAAe;AAAA,QACtB;AAAA,QACA;AAAA,QACA,UAAU,CAAC,GAAG,UAAU,QAAQ;AAAA,QAChC,KAAAA;AAAA,QACA,OAAO,MAAM;AAAA,QACb;AAAA,QACA,GAAG;AAAA,MACJ,CAAC;AAAA;AAEF,aAAO;AAAA,IACR,CAAC;AAAA,EACF,GACC,KAAK,EAAE;AAAA;AAEX;",
|
|
6
6
|
"names": ["arg"]
|
|
7
7
|
}
|
package/package.json
CHANGED
|
@@ -28,7 +28,7 @@ export async function ComponentInputStructured<
|
|
|
28
28
|
return /* HTML */ `<fieldset
|
|
29
29
|
id="${`component-input-structured-${arg_path.join("-")}`}"
|
|
30
30
|
>
|
|
31
|
-
<legend
|
|
31
|
+
<legend>${arg_path.at(-1)}</legend>
|
|
32
32
|
${(
|
|
33
33
|
await Promise.all(
|
|
34
34
|
Object.entries(arg.structure).map(async ([arg_name, arg]) => {
|