@sealcode/jdd-editor 0.1.20 → 0.1.22
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/.nyc_output/cfebf13d-f940-426b-a4d3-af28d17bb6b8.json +1 -0
- package/.nyc_output/processinfo/2ad4e34c-cebb-4299-9698-08eccbbe71f7.json +1 -0
- package/.nyc_output/processinfo/71f2685b-e2c9-4db2-9f31-0dbdcacfcea1.json +1 -0
- package/.nyc_output/processinfo/cfebf13d-f940-426b-a4d3-af28d17bb6b8.json +1 -0
- package/.nyc_output/processinfo/index.json +1 -1
- package/.xunit +1 -1
- package/@types/test.test.d.ts +0 -0
- package/coverage/clover.xml +279 -259
- package/dist/src/components.sreact.js +1 -1
- package/dist/src/components.sreact.js.map +2 -2
- package/dist/src/controllers/autogrow-textarea.stimulus.js.map +2 -2
- package/dist/src/controllers/markdown-textarea.stimulus.js +1 -1
- package/dist/src/controllers/markdown-textarea.stimulus.js.map +2 -2
- package/dist/src/controllers/refresh-styles.stimulus.js +1 -1
- package/dist/src/controllers/refresh-styles.stimulus.js.map +2 -2
- package/dist/src/inputs/component-input-single-reference.js +1 -1
- package/dist/src/inputs/component-input-single-reference.js.map +2 -2
- package/dist/src/inputs/component-input-structured.js +1 -1
- package/dist/src/inputs/component-input-structured.js.map +2 -2
- package/dist/src/inputs/component-input.js +30 -7
- package/dist/src/inputs/component-input.js.map +2 -2
- package/dist/src/jdd-page.js +1 -1
- package/dist/src/jdd-page.js.map +2 -2
- package/{lib → dist}/src/test.test.js +1 -1
- package/dist/src/test.test.js.map +7 -0
- package/package.json +6 -5
- package/src/components.sreact.ts +1 -1
- package/src/controllers/autogrow-textarea.stimulus.ts +2 -1
- package/src/controllers/markdown-textarea.stimulus.ts +1 -1
- package/src/controllers/refresh-styles.stimulus.ts +3 -1
- package/src/inputs/component-input-single-reference.ts +1 -1
- package/src/inputs/component-input-structured.ts +1 -1
- package/src/inputs/component-input.ts +31 -9
- package/src/jdd-page.ts +1 -1
- package/src/test.test.ts +3 -0
- package/test.cjs +53 -0
- package/.mocharc.js +0 -6
- package/.nyc_output/9bfa248d-4f8e-4d29-9c47-d1a3961c5254.json +0 -1
- package/.nyc_output/processinfo/29e7bb87-9f10-462e-84d8-ec620cfa9e6b.json +0 -1
- package/.nyc_output/processinfo/7d7104e8-f179-427b-b4bd-30f78397e4f1.json +0 -1
- package/.nyc_output/processinfo/9bfa248d-4f8e-4d29-9c47-d1a3961c5254.json +0 -1
- package/esbuild.js +0 -23
- package/lib/src/component-preview-actions.js +0 -377
- package/lib/src/component-preview-actions.js.map +0 -7
- package/lib/src/components.sreact.js +0 -93
- package/lib/src/components.sreact.js.map +0 -7
- package/lib/src/controllers/autogrow-textarea.stimulus.js +0 -13
- package/lib/src/controllers/autogrow-textarea.stimulus.js.map +0 -7
- package/lib/src/controllers/component-debugger.stimulus.js +0 -193
- package/lib/src/controllers/component-debugger.stimulus.js.map +0 -7
- package/lib/src/controllers/exportable-textarea.stimulus.js +0 -71
- package/lib/src/controllers/exportable-textarea.stimulus.js.map +0 -7
- package/lib/src/controllers/input-image-preview.stimulus.js +0 -30
- package/lib/src/controllers/input-image-preview.stimulus.js.map +0 -7
- package/lib/src/controllers/jdd-table-paste.stimulus.js +0 -78
- package/lib/src/controllers/jdd-table-paste.stimulus.js.map +0 -7
- package/lib/src/controllers/json-editor.stimulus.js +0 -114
- package/lib/src/controllers/json-editor.stimulus.js.map +0 -7
- package/lib/src/controllers/markdown-textarea.stimulus.js +0 -174
- package/lib/src/controllers/markdown-textarea.stimulus.js.map +0 -7
- package/lib/src/controllers/refresh-on-ts-changes.stimulus.js +0 -90
- package/lib/src/controllers/refresh-on-ts-changes.stimulus.js.map +0 -7
- package/lib/src/controllers/refresh-styles.stimulus.js +0 -67
- package/lib/src/controllers/refresh-styles.stimulus.js.map +0 -7
- package/lib/src/controllers/submit-on-input.stimulus.js +0 -55
- package/lib/src/controllers/submit-on-input.stimulus.js.map +0 -7
- package/lib/src/controllers/toast.stimulus.js +0 -19
- package/lib/src/controllers/toast.stimulus.js.map +0 -7
- package/lib/src/edit-jdd-field.js +0 -94
- package/lib/src/edit-jdd-field.js.map +0 -7
- package/lib/src/index.js +0 -3
- package/lib/src/index.js.map +0 -7
- package/lib/src/inputs/component-input-enum.js +0 -30
- package/lib/src/inputs/component-input-enum.js.map +0 -7
- package/lib/src/inputs/component-input-image.js +0 -63
- package/lib/src/inputs/component-input-image.js.map +0 -7
- package/lib/src/inputs/component-input-list.js +0 -74
- package/lib/src/inputs/component-input-list.js.map +0 -7
- package/lib/src/inputs/component-input-single-reference.js +0 -31
- package/lib/src/inputs/component-input-single-reference.js.map +0 -7
- package/lib/src/inputs/component-input-structured.js +0 -36
- package/lib/src/inputs/component-input-structured.js.map +0 -7
- package/lib/src/inputs/component-input-table.js +0 -228
- package/lib/src/inputs/component-input-table.js.map +0 -7
- package/lib/src/inputs/component-input.js +0 -164
- package/lib/src/inputs/component-input.js.map +0 -7
- package/lib/src/inputs/print-arg-path.js +0 -7
- package/lib/src/inputs/print-arg-path.js.map +0 -7
- package/lib/src/jdd-creator.js +0 -131
- package/lib/src/jdd-creator.js.map +0 -7
- package/lib/src/jdd-page.js +0 -339
- package/lib/src/jdd-page.js.map +0 -7
- package/lib/src/test.test.js.map +0 -7
- /package/{.eslintrc.js → .eslintrc.cjs} +0 -0
- /package/.nyc_output/{29e7bb87-9f10-462e-84d8-ec620cfa9e6b.json → 2ad4e34c-cebb-4299-9698-08eccbbe71f7.json} +0 -0
- /package/.nyc_output/{7d7104e8-f179-427b-b4bd-30f78397e4f1.json → 71f2685b-e2c9-4db2-9f31-0dbdcacfcea1.json} +0 -0
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
import { tempstream } from "tempstream";
|
|
2
|
-
import { printArgPath } from "./print-arg-path.js";
|
|
3
|
-
import { htmlEscape } from "escape-goat";
|
|
4
|
-
function ComponentInputImage({
|
|
5
|
-
arg_path,
|
|
6
|
-
arg,
|
|
7
|
-
value,
|
|
8
|
-
ctx,
|
|
9
|
-
page,
|
|
10
|
-
state,
|
|
11
|
-
makeJDDContext
|
|
12
|
-
}) {
|
|
13
|
-
const jdd_context = makeJDDContext(ctx);
|
|
14
|
-
return tempstream`<div style="margin-bottom: 10px">
|
|
15
|
-
<label
|
|
16
|
-
style="display: flex; align-items: center; column-gap: 10px;"
|
|
17
|
-
data-controller="input-image-preview"
|
|
18
|
-
>
|
|
19
|
-
${arg_path.at(-1) || ""}
|
|
20
|
-
<div class="image-preview-container">
|
|
21
|
-
${value && jdd_context.render_image(value, {
|
|
22
|
-
container: {
|
|
23
|
-
width: 40,
|
|
24
|
-
height: 40,
|
|
25
|
-
objectFit: "cover"
|
|
26
|
-
},
|
|
27
|
-
crop: { width: 40, height: 40 },
|
|
28
|
-
style: "height: 40px; width: 40px;",
|
|
29
|
-
alt: ""
|
|
30
|
-
})}
|
|
31
|
-
</div>
|
|
32
|
-
|
|
33
|
-
<input
|
|
34
|
-
type="file"
|
|
35
|
-
name="${`$${printArgPath(arg_path)}.new`}"
|
|
36
|
-
value=""
|
|
37
|
-
autocomplete="off"
|
|
38
|
-
data-action="change->input-image-preview#handleChange"
|
|
39
|
-
${arg.hasParent("list") ? "multiple" : ""}
|
|
40
|
-
/>
|
|
41
|
-
</label>
|
|
42
|
-
<div>
|
|
43
|
-
<input
|
|
44
|
-
type="hidden"
|
|
45
|
-
name="${`$${printArgPath(arg_path)}.old`}"
|
|
46
|
-
value="${htmlEscape((value == null ? void 0 : value.token) || "")}"
|
|
47
|
-
autocomplete="off"
|
|
48
|
-
/>
|
|
49
|
-
</div>
|
|
50
|
-
${page.makeActionButton(
|
|
51
|
-
state,
|
|
52
|
-
{
|
|
53
|
-
action: "remove_file",
|
|
54
|
-
label: "\u274C"
|
|
55
|
-
},
|
|
56
|
-
arg_path
|
|
57
|
-
)}
|
|
58
|
-
</div>`;
|
|
59
|
-
}
|
|
60
|
-
export {
|
|
61
|
-
ComponentInputImage
|
|
62
|
-
};
|
|
63
|
-
//# sourceMappingURL=component-input-image.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/inputs/component-input-image.ts"],
|
|
4
|
-
"sourcesContent": ["import type { Context } from \"koa\";\nimport type { FilePointer } from \"@sealcode/file-manager\";\nimport type { Image, JDDContext } from \"@sealcode/jdd\";\nimport type { StatefulPage } from \"@sealcode/sealgen\";\nimport type { ComponentPreviewActions } from \"../component-preview-actions.js\";\nimport type { JDDPageState } from \"../jdd-page.js\";\nimport { tempstream } from \"tempstream\";\nimport { printArgPath } from \"./print-arg-path.js\";\nimport { htmlEscape } from \"escape-goat\";\n\nexport function ComponentInputImage<State extends JDDPageState>({\n\targ_path,\n\targ,\n\tvalue,\n\tctx,\n\tpage,\n\tstate,\n\tmakeJDDContext,\n}: {\n\tstate: State;\n\targ_path: string[];\n\targ: Image;\n\tvalue: FilePointer | null;\n\tpage: StatefulPage<JDDPageState, typeof ComponentPreviewActions>;\n\tctx: Context;\n\tmakeJDDContext: (ctx: Context) => JDDContext;\n}): JSX.Element {\n\tconst jdd_context = makeJDDContext(ctx);\n\treturn tempstream/* HTML */ `<div style=\"margin-bottom: 10px\">\n\t\t<label\n\t\t\tstyle=\"display: flex; align-items: center; column-gap: 10px;\"\n\t\t\tdata-controller=\"input-image-preview\"\n\t\t>\n\t\t\t${arg_path.at(-1) || \"\"}\n\t\t\t<div class=\"image-preview-container\">\n\t\t\t\t${value &&\n\t\t\t\tjdd_context.render_image(value, {\n\t\t\t\t\tcontainer: {\n\t\t\t\t\t\twidth: 40,\n\t\t\t\t\t\theight: 40,\n\t\t\t\t\t\tobjectFit: \"cover\",\n\t\t\t\t\t},\n\t\t\t\t\tcrop: { width: 40, height: 40 },\n\t\t\t\t\tstyle: \"height: 40px; width: 40px;\",\n\t\t\t\t\talt: \"\",\n\t\t\t\t})}\n\t\t\t</div>\n\n\t\t\t<input\n\t\t\t\ttype=\"file\"\n\t\t\t\tname=\"${`$${printArgPath(arg_path)}.new`}\"\n\t\t\t\tvalue=\"\"\n\t\t\t\tautocomplete=\"off\"\n\t\t\t\tdata-action=\"change->input-image-preview#handleChange\"\n\t\t\t\t${arg.hasParent(\"list\") ? \"multiple\" : \"\"}\n\t\t\t/>\n\t\t</label>\n\t\t<div>\n\t\t\t<input\n\t\t\t\ttype=\"hidden\"\n\t\t\t\tname=\"${`$${printArgPath(arg_path)}.old`}\"\n\t\t\t\tvalue=\"${htmlEscape(value?.token || \"\")}\"\n\t\t\t\tautocomplete=\"off\"\n\t\t\t/>\n\t\t</div>\n\t\t${page.makeActionButton(\n\t\t\tstate,\n\t\t\t{\n\t\t\t\taction: \"remove_file\",\n\t\t\t\tlabel: \"\u274C\",\n\t\t\t},\n\t\t\targ_path\n\t\t)}\n\t</div>`;\n}\n"],
|
|
5
|
-
"mappings": "AAMA,SAAS,kBAAkB;AAC3B,SAAS,oBAAoB;AAC7B,SAAS,kBAAkB;AAEpB,SAAS,oBAAgD;AAAA,EAC/D;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACD,GAQgB;AACf,QAAM,cAAc,eAAe,GAAG;AACtC,SAAO;AAAA;AAAA;AAAA;AAAA;AAAA,KAKH,SAAS,GAAG,EAAE,KAAK;AAAA;AAAA,MAElB,SACF,YAAY,aAAa,OAAO;AAAA,IAC/B,WAAW;AAAA,MACV,OAAO;AAAA,MACP,QAAQ;AAAA,MACR,WAAW;AAAA,IACZ;AAAA,IACA,MAAM,EAAE,OAAO,IAAI,QAAQ,GAAG;AAAA,IAC9B,OAAO;AAAA,IACP,KAAK;AAAA,EACN,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA,YAKO,IAAI,aAAa,QAAQ;AAAA;AAAA;AAAA;AAAA,MAI/B,IAAI,UAAU,MAAM,IAAI,aAAa;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,YAM/B,IAAI,aAAa,QAAQ;AAAA,aACxB,YAAW,+BAAO,UAAS,EAAE;AAAA;AAAA;AAAA;AAAA,IAItC,KAAK;AAAA,IACN;AAAA,IACA;AAAA,MACC,QAAQ;AAAA,MACR,OAAO;AAAA,IACR;AAAA,IACA;AAAA,EACD;AAAA;AAEF;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
import { ComponentInput } from "./component-input.js";
|
|
2
|
-
import { tempstream } from "tempstream";
|
|
3
|
-
async function ComponentInputList({
|
|
4
|
-
state,
|
|
5
|
-
ctx,
|
|
6
|
-
arg_path,
|
|
7
|
-
arg,
|
|
8
|
-
value,
|
|
9
|
-
page,
|
|
10
|
-
makeJDDContext,
|
|
11
|
-
...rest
|
|
12
|
-
}) {
|
|
13
|
-
if (!value) {
|
|
14
|
-
value = [];
|
|
15
|
-
}
|
|
16
|
-
return tempstream`<fieldset
|
|
17
|
-
id="${`component-input-list-${arg_path.join("-")}`}"
|
|
18
|
-
>
|
|
19
|
-
<legend>${arg_path.at(-1)}</legend>
|
|
20
|
-
${value.map(
|
|
21
|
-
(value2, i, all_values) => tempstream`<div style="display: flex">
|
|
22
|
-
${ComponentInput({
|
|
23
|
-
...rest,
|
|
24
|
-
ctx,
|
|
25
|
-
state,
|
|
26
|
-
arg_path: [...arg_path, i.toString()],
|
|
27
|
-
arg: arg.item_type,
|
|
28
|
-
value: value2,
|
|
29
|
-
page,
|
|
30
|
-
makeJDDContext
|
|
31
|
-
})}
|
|
32
|
-
${page.makeActionButton(
|
|
33
|
-
state,
|
|
34
|
-
{
|
|
35
|
-
action: "move_array_item_down",
|
|
36
|
-
label: "\u2193",
|
|
37
|
-
disabled: i == all_values.length - 1
|
|
38
|
-
},
|
|
39
|
-
arg_path,
|
|
40
|
-
i
|
|
41
|
-
)}
|
|
42
|
-
${page.makeActionButton(
|
|
43
|
-
state,
|
|
44
|
-
{
|
|
45
|
-
action: "move_array_item_up",
|
|
46
|
-
label: "\u2191",
|
|
47
|
-
disabled: i == 0
|
|
48
|
-
},
|
|
49
|
-
arg_path,
|
|
50
|
-
i
|
|
51
|
-
)}
|
|
52
|
-
|
|
53
|
-
${page.makeActionButton(
|
|
54
|
-
state,
|
|
55
|
-
{ action: "remove_array_item", label: "\u274C" },
|
|
56
|
-
arg_path,
|
|
57
|
-
i
|
|
58
|
-
)}
|
|
59
|
-
</div>`
|
|
60
|
-
)}
|
|
61
|
-
${page.makeActionButton(
|
|
62
|
-
state,
|
|
63
|
-
{
|
|
64
|
-
action: "add_array_item",
|
|
65
|
-
label: "\u2795"
|
|
66
|
-
},
|
|
67
|
-
arg_path
|
|
68
|
-
)}
|
|
69
|
-
</fieldset>`;
|
|
70
|
-
}
|
|
71
|
-
export {
|
|
72
|
-
ComponentInputList
|
|
73
|
-
};
|
|
74
|
-
//# sourceMappingURL=component-input-list.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/inputs/component-input-list.ts"],
|
|
4
|
-
"sourcesContent": ["/* eslint-disable @typescript-eslint/no-non-null-assertion */\nimport type { Context } from \"koa\";\nimport type { ComponentArgument, JDDContext, List } from \"@sealcode/jdd\";\nimport type { JDDPageState } from \"../jdd-page.js\";\nimport type { StatefulPage } from \"@sealcode/sealgen\";\nimport { ComponentInput } from \"./component-input.js\";\nimport type { ComponentPreviewActions } from \"../component-preview-actions.js\";\nimport { tempstream } from \"tempstream\";\n\nexport async function ComponentInputList<\n\tState extends JDDPageState,\n\tT extends ComponentArgument<unknown>\n>({\n\tstate,\n\tctx,\n\targ_path,\n\targ,\n\tvalue,\n\tpage,\n\tmakeJDDContext,\n\t...rest\n}: {\n\tstate: State;\n\tctx: Context;\n\targ_path: string[];\n\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\targ: List<T, any>;\n\tvalue: T[];\n\tpage: StatefulPage<JDDPageState, typeof ComponentPreviewActions>;\n\tmakeJDDContext: (ctx: Context) => JDDContext;\n\tmakeAssetURL: (asset: string) => string;\n}): Promise<string> {\n\tif (!value) {\n\t\tvalue = [];\n\t}\n\treturn tempstream/* HTML */ `<fieldset\n\t\tid=\"${`component-input-list-${arg_path.join(\"-\")}`}\"\n\t>\n\t\t<legend>${arg_path.at(-1)!}</legend>\n\t\t${value.map(\n\t\t\t(value, i, all_values) =>\n\t\t\t\ttempstream`<div style=\"display: flex\">\n\t\t\t\t\t${ComponentInput({\n\t\t\t\t\t\t...rest,\n\t\t\t\t\t\tctx,\n\t\t\t\t\t\tstate,\n\t\t\t\t\t\targ_path: [...arg_path, i.toString()],\n\t\t\t\t\t\targ: arg.item_type,\n\t\t\t\t\t\tvalue,\n\t\t\t\t\t\tpage,\n\t\t\t\t\t\tmakeJDDContext,\n\t\t\t\t\t})}\n\t\t\t\t\t${page.makeActionButton(\n\t\t\t\t\t\tstate,\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\taction: \"move_array_item_down\",\n\t\t\t\t\t\t\tlabel: \"\u2193\",\n\t\t\t\t\t\t\tdisabled: i == all_values.length - 1,\n\t\t\t\t\t\t},\n\t\t\t\t\t\targ_path,\n\t\t\t\t\t\ti\n\t\t\t\t\t)}\n\t\t\t\t\t${page.makeActionButton(\n\t\t\t\t\t\tstate,\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\taction: \"move_array_item_up\",\n\t\t\t\t\t\t\tlabel: \"\u2191\",\n\t\t\t\t\t\t\tdisabled: i == 0,\n\t\t\t\t\t\t},\n\t\t\t\t\t\targ_path,\n\t\t\t\t\t\ti\n\t\t\t\t\t)}\n\n\t\t\t\t\t${page.makeActionButton(\n\t\t\t\t\t\tstate,\n\t\t\t\t\t\t{ action: \"remove_array_item\", label: \"\u274C\" },\n\t\t\t\t\t\targ_path,\n\t\t\t\t\t\ti\n\t\t\t\t\t)}\n\t\t\t\t</div>`\n\t\t)}\n\t\t${page.makeActionButton(\n\t\t\tstate,\n\t\t\t{\n\t\t\t\taction: \"add_array_item\",\n\t\t\t\tlabel: \"\u2795\",\n\t\t\t},\n\t\t\targ_path\n\t\t)}\n\t</fieldset>`;\n}\n"],
|
|
5
|
-
"mappings": "AAKA,SAAS,sBAAsB;AAE/B,SAAS,kBAAkB;AAE3B,eAAsB,mBAGpB;AAAA,EACD;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,KACG;AACJ,GAUoB;AACnB,MAAI,CAAC,OAAO;AACX,YAAQ,CAAC;AAAA,EACV;AACA,SAAO;AAAA,QACA,wBAAwB,SAAS,KAAK,GAAG;AAAA;AAAA,YAErC,SAAS,GAAG,EAAE;AAAA,IACtB,MAAM;AAAA,IACP,CAACA,QAAO,GAAG,eACV;AAAA,OACG,eAAe;AAAA,MAChB,GAAG;AAAA,MACH;AAAA,MACA;AAAA,MACA,UAAU,CAAC,GAAG,UAAU,EAAE,SAAS,CAAC;AAAA,MACpC,KAAK,IAAI;AAAA,MACT,OAAAA;AAAA,MACA;AAAA,MACA;AAAA,IACD,CAAC;AAAA,OACC,KAAK;AAAA,MACN;AAAA,MACA;AAAA,QACC,QAAQ;AAAA,QACR,OAAO;AAAA,QACP,UAAU,KAAK,WAAW,SAAS;AAAA,MACpC;AAAA,MACA;AAAA,MACA;AAAA,IACD;AAAA,OACE,KAAK;AAAA,MACN;AAAA,MACA;AAAA,QACC,QAAQ;AAAA,QACR,OAAO;AAAA,QACP,UAAU,KAAK;AAAA,MAChB;AAAA,MACA;AAAA,MACA;AAAA,IACD;AAAA;AAAA,OAEE,KAAK;AAAA,MACN;AAAA,MACA,EAAE,QAAQ,qBAAqB,OAAO,SAAI;AAAA,MAC1C;AAAA,MACA;AAAA,IACD;AAAA;AAAA,EAEH;AAAA,IACE,KAAK;AAAA,IACN;AAAA,IACA;AAAA,MACC,QAAQ;AAAA,MACR,OAAO;AAAA,IACR;AAAA,IACA;AAAA,EACD;AAAA;AAEF;",
|
|
6
|
-
"names": ["value"]
|
|
7
|
-
}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { printArgPath } from "./print-arg-path.js";
|
|
2
|
-
async function ComponentInputSingleReference({
|
|
3
|
-
ctx,
|
|
4
|
-
arg_path,
|
|
5
|
-
arg,
|
|
6
|
-
value,
|
|
7
|
-
onchange,
|
|
8
|
-
makeJDDContext
|
|
9
|
-
}) {
|
|
10
|
-
const values = await arg.getValues(makeJDDContext(ctx));
|
|
11
|
-
const ret = `<div>
|
|
12
|
-
<label>
|
|
13
|
-
${arg_path.at(-1) || ""}
|
|
14
|
-
<select name="${`$${printArgPath(arg_path)}`}" onchange="${onchange}">
|
|
15
|
-
${values.sort((v1, v2) => v1.label > v2.label ? 1 : -1).map(
|
|
16
|
-
(v) => `<option
|
|
17
|
-
value="${v.value}"
|
|
18
|
-
${value == v.value ? "selected" : ""}
|
|
19
|
-
>
|
|
20
|
-
${v.label}
|
|
21
|
-
</option>`
|
|
22
|
-
).join("")}
|
|
23
|
-
</select>
|
|
24
|
-
</label>
|
|
25
|
-
</div>`;
|
|
26
|
-
return ret;
|
|
27
|
-
}
|
|
28
|
-
export {
|
|
29
|
-
ComponentInputSingleReference
|
|
30
|
-
};
|
|
31
|
-
//# sourceMappingURL=component-input-single-reference.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/inputs/component-input-single-reference.ts"],
|
|
4
|
-
"sourcesContent": ["import type { Context } from \"koa\";\nimport type { JDDContext, SingleReference } from \"@sealcode/jdd\";\nimport { printArgPath } from \"./print-arg-path.js\";\n\nexport async function ComponentInputSingleReference<\n\tState,\n\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\tT extends SingleReference<any>\n>({\n\tctx,\n\targ_path,\n\targ,\n\tvalue,\n\tonchange,\n\tmakeJDDContext,\n}: {\n\tctx: Context;\n\tstate: State;\n\targ_path: string[];\n\targ: T;\n\tvalue: string;\n\tonchange?: string;\n\tmakeJDDContext: (ctx: Context) => JDDContext;\n}): Promise<string> {\n\tconst values = await arg.getValues(makeJDDContext(ctx));\n\tconst ret = `<div>\n\t\t\t<label>\n\t\t\t\t${arg_path.at(-1) || \"\"}\n\t\t\t\t<select name=\"${`$${printArgPath(arg_path)}`}\" onchange=\"${onchange}\">\n\t\t\t\t\t${values\n\t\t\t\t\t\t.sort((v1, v2) => (v1.label > v2.label ? 1 : -1))\n\t\t\t\t\t\t.map(\n\t\t\t\t\t\t\t(v) => /* HTML */ `<option\n\t\t\t\t\t\t\t\tvalue=\"${v.value}\"\n\t\t\t\t\t\t\t\t${value == v.value ? \"selected\" : \"\"}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t${v.label}\n\t\t\t\t\t\t\t</option>`\n\t\t\t\t\t\t)\n\t\t\t\t\t\t.join(\"\")}\n\t\t\t\t</select>\n\t\t\t</label>\n\t\t</div>`;\n\treturn ret;\n}\n"],
|
|
5
|
-
"mappings": "AAEA,SAAS,oBAAoB;AAE7B,eAAsB,8BAIpB;AAAA,EACD;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACD,GAQoB;AACnB,QAAM,SAAS,MAAM,IAAI,UAAU,eAAe,GAAG,CAAC;AACtD,QAAM,MAAM;AAAA;AAAA,MAEP,SAAS,GAAG,EAAE,KAAK;AAAA,oBACL,IAAI,aAAa,QAAQ,kBAAkB;AAAA,OACxD,OACA,KAAK,CAAC,IAAI,OAAQ,GAAG,QAAQ,GAAG,QAAQ,IAAI,EAAG,EAC/C;AAAA,IACA,CAAC,MAAiB;AAAA,iBACR,EAAE;AAAA,UACT,SAAS,EAAE,QAAQ,aAAa;AAAA;AAAA,UAEhC,EAAE;AAAA;AAAA,EAEN,EACC,KAAK,EAAE;AAAA;AAAA;AAAA;AAIb,SAAO;AACR;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { ComponentInput } from "./component-input.js";
|
|
2
|
-
async function ComponentInputStructured({
|
|
3
|
-
state,
|
|
4
|
-
ctx,
|
|
5
|
-
arg_path,
|
|
6
|
-
arg,
|
|
7
|
-
value,
|
|
8
|
-
page,
|
|
9
|
-
...rest
|
|
10
|
-
}) {
|
|
11
|
-
return `<fieldset
|
|
12
|
-
id="${`component-input-structured-${arg_path.join("-")}`}"
|
|
13
|
-
>
|
|
14
|
-
<legend>${arg_path.at(-1)}</legend>
|
|
15
|
-
${(await Promise.all(
|
|
16
|
-
Object.entries(arg.structure).map(async ([arg_name, arg2]) => {
|
|
17
|
-
const ret = `<div>
|
|
18
|
-
${await ComponentInput({
|
|
19
|
-
ctx,
|
|
20
|
-
state,
|
|
21
|
-
arg_path: [...arg_path, arg_name],
|
|
22
|
-
arg: arg2,
|
|
23
|
-
value: value[arg_name],
|
|
24
|
-
page,
|
|
25
|
-
...rest
|
|
26
|
-
})}
|
|
27
|
-
</div>`;
|
|
28
|
-
return ret;
|
|
29
|
-
})
|
|
30
|
-
)).join("")}
|
|
31
|
-
</fieldset>`;
|
|
32
|
-
}
|
|
33
|
-
export {
|
|
34
|
-
ComponentInputStructured
|
|
35
|
-
};
|
|
36
|
-
//# sourceMappingURL=component-input-structured.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 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>${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
|
-
"names": ["arg"]
|
|
7
|
-
}
|
|
@@ -1,228 +0,0 @@
|
|
|
1
|
-
import { Markdown } from "@sealcode/jdd";
|
|
2
|
-
import { isTableHeader } from "@sealcode/jdd";
|
|
3
|
-
import { tempstream } from "tempstream";
|
|
4
|
-
import { ComponentInput } from "./component-input.js";
|
|
5
|
-
async function ComponentInputTable({
|
|
6
|
-
state,
|
|
7
|
-
arg_path,
|
|
8
|
-
ctx,
|
|
9
|
-
arg,
|
|
10
|
-
value,
|
|
11
|
-
page,
|
|
12
|
-
makeJDDContext,
|
|
13
|
-
makeAssetURL
|
|
14
|
-
}) {
|
|
15
|
-
if (!value) {
|
|
16
|
-
value = await arg.getEmptyValue(makeJDDContext(ctx));
|
|
17
|
-
}
|
|
18
|
-
const show_paste = arg.cell_type instanceof Markdown && arg.header_type instanceof Markdown;
|
|
19
|
-
return tempstream`<fieldset>
|
|
20
|
-
<legend>${arg_path.at(-1)}</legend>
|
|
21
|
-
<div>
|
|
22
|
-
${show_paste ? `<input
|
|
23
|
-
type="button"
|
|
24
|
-
value="paste"
|
|
25
|
-
placeholder="paste table here"
|
|
26
|
-
data-jdd-table-paste-argpath-value="${arg_path.join(
|
|
27
|
-
"."
|
|
28
|
-
)}"
|
|
29
|
-
data-controller="jdd-table-paste"
|
|
30
|
-
/>` : ""}
|
|
31
|
-
<table
|
|
32
|
-
class="jdd-component-input--table"
|
|
33
|
-
style="position: relative; /* necessary for sticky th*/"
|
|
34
|
-
>
|
|
35
|
-
<tbody>
|
|
36
|
-
<tr>
|
|
37
|
-
<td></td>
|
|
38
|
-
${[...Array(arg.getColumnsCount(value)).keys()].map(
|
|
39
|
-
(column_index) => `<th
|
|
40
|
-
class="sticky sticky--top subdued"
|
|
41
|
-
>
|
|
42
|
-
${page.makeActionButton(
|
|
43
|
-
state,
|
|
44
|
-
{
|
|
45
|
-
action: "remove_table_column",
|
|
46
|
-
label: "Remove column",
|
|
47
|
-
content: `<img
|
|
48
|
-
width="20"
|
|
49
|
-
height="20"
|
|
50
|
-
src="${makeAssetURL(
|
|
51
|
-
"icons/table-delete-column.svg"
|
|
52
|
-
)}"
|
|
53
|
-
/>`
|
|
54
|
-
},
|
|
55
|
-
arg_path,
|
|
56
|
-
column_index
|
|
57
|
-
)}
|
|
58
|
-
${column_index >= arg.getColumnsCount(value) - 1 ? "" : page.makeActionButton(
|
|
59
|
-
state,
|
|
60
|
-
{
|
|
61
|
-
action: "move_table_column_right",
|
|
62
|
-
label: "Move column to the right",
|
|
63
|
-
content: `<img
|
|
64
|
-
width="20"
|
|
65
|
-
height="20"
|
|
66
|
-
src="${makeAssetURL(
|
|
67
|
-
"icons/table-move-column-right.svg"
|
|
68
|
-
)}"
|
|
69
|
-
/>`
|
|
70
|
-
},
|
|
71
|
-
arg_path,
|
|
72
|
-
column_index
|
|
73
|
-
)}
|
|
74
|
-
</th>`
|
|
75
|
-
).join("")}
|
|
76
|
-
</tr>
|
|
77
|
-
${value.rows.map(
|
|
78
|
-
(row, row_index) => tempstream`<tr>
|
|
79
|
-
<td class="sticky sticky--left subdued">
|
|
80
|
-
<div
|
|
81
|
-
style="display: flex; flex-flow: column; row-gap: 5px;"
|
|
82
|
-
>
|
|
83
|
-
${page.makeActionButton(
|
|
84
|
-
state,
|
|
85
|
-
{
|
|
86
|
-
action: "remove_table_row",
|
|
87
|
-
label: "Remove row",
|
|
88
|
-
content: `<img
|
|
89
|
-
width="20"
|
|
90
|
-
height="20"
|
|
91
|
-
src="${makeAssetURL(
|
|
92
|
-
"icons/table-delete-row.svg"
|
|
93
|
-
)}"
|
|
94
|
-
/>`
|
|
95
|
-
},
|
|
96
|
-
arg_path,
|
|
97
|
-
row_index
|
|
98
|
-
)}
|
|
99
|
-
${page.makeActionButton(
|
|
100
|
-
state,
|
|
101
|
-
{
|
|
102
|
-
action: "move_table_row_down",
|
|
103
|
-
label: "Move this row down",
|
|
104
|
-
content: `<img
|
|
105
|
-
width="20"
|
|
106
|
-
height="20"
|
|
107
|
-
src="${makeAssetURL(
|
|
108
|
-
"icons/table-move-row-down.svg"
|
|
109
|
-
)}"
|
|
110
|
-
/>`
|
|
111
|
-
},
|
|
112
|
-
arg_path,
|
|
113
|
-
row_index
|
|
114
|
-
)}
|
|
115
|
-
</div>
|
|
116
|
-
</td>
|
|
117
|
-
${isTableHeader(row) ? tempstream`<th
|
|
118
|
-
colspan="${arg.getColumnsCount(value).toString()}"
|
|
119
|
-
>
|
|
120
|
-
${ComponentInput({
|
|
121
|
-
state,
|
|
122
|
-
ctx,
|
|
123
|
-
arg_path: [
|
|
124
|
-
...arg_path,
|
|
125
|
-
"rows",
|
|
126
|
-
row_index.toString(),
|
|
127
|
-
"header_content"
|
|
128
|
-
],
|
|
129
|
-
arg: arg.header_type,
|
|
130
|
-
value: row.header_content,
|
|
131
|
-
page,
|
|
132
|
-
makeJDDContext,
|
|
133
|
-
makeAssetURL
|
|
134
|
-
})}
|
|
135
|
-
</th>` : row.cells.map(
|
|
136
|
-
(cell, cell_index) => tempstream`<td>
|
|
137
|
-
${ComponentInput({
|
|
138
|
-
ctx,
|
|
139
|
-
state,
|
|
140
|
-
arg_path: [
|
|
141
|
-
...arg_path,
|
|
142
|
-
"rows",
|
|
143
|
-
row_index.toString(),
|
|
144
|
-
"cells",
|
|
145
|
-
cell_index.toString()
|
|
146
|
-
],
|
|
147
|
-
arg: arg.cell_type,
|
|
148
|
-
value: cell,
|
|
149
|
-
page,
|
|
150
|
-
makeJDDContext,
|
|
151
|
-
makeAssetURL
|
|
152
|
-
})}
|
|
153
|
-
</td>`
|
|
154
|
-
)}
|
|
155
|
-
${row_index == 0 ? `<td
|
|
156
|
-
class="subdued"
|
|
157
|
-
rowspan="${value.rows.length.toString()}"
|
|
158
|
-
>
|
|
159
|
-
${page.makeActionButton(
|
|
160
|
-
state,
|
|
161
|
-
{
|
|
162
|
-
action: "add_table_column",
|
|
163
|
-
label: "Add column",
|
|
164
|
-
content: `<img
|
|
165
|
-
width="20"
|
|
166
|
-
height="20"
|
|
167
|
-
src="${makeAssetURL(
|
|
168
|
-
"icons/table-add-column-right.svg"
|
|
169
|
-
)}"
|
|
170
|
-
/>`
|
|
171
|
-
},
|
|
172
|
-
arg_path
|
|
173
|
-
)}
|
|
174
|
-
</td>` : ""}
|
|
175
|
-
</tr>`
|
|
176
|
-
)}
|
|
177
|
-
<tr>
|
|
178
|
-
<td
|
|
179
|
-
class="subdued"
|
|
180
|
-
colspan="{(arg.getColumnsCount(value)"
|
|
181
|
-
+
|
|
182
|
-
1).toString()}
|
|
183
|
-
>
|
|
184
|
-
${page.makeActionButton(
|
|
185
|
-
state,
|
|
186
|
-
{
|
|
187
|
-
action: "add_table_row",
|
|
188
|
-
label: "Add table row",
|
|
189
|
-
content: `<img
|
|
190
|
-
width="20"
|
|
191
|
-
height="20"
|
|
192
|
-
src="${makeAssetURL(
|
|
193
|
-
"icons/table-add-row-below.svg"
|
|
194
|
-
)}"
|
|
195
|
-
/>`
|
|
196
|
-
},
|
|
197
|
-
arg_path,
|
|
198
|
-
arg.getColumnsCount(value),
|
|
199
|
-
void 0
|
|
200
|
-
)}
|
|
201
|
-
${page.makeActionButton(
|
|
202
|
-
state,
|
|
203
|
-
{
|
|
204
|
-
action: "add_table_row",
|
|
205
|
-
label: "Add table header",
|
|
206
|
-
content: `<img
|
|
207
|
-
width="20"
|
|
208
|
-
height="20"
|
|
209
|
-
src="${makeAssetURL(
|
|
210
|
-
"icons/table-add-column-header-below.svg"
|
|
211
|
-
)}"
|
|
212
|
-
/>`
|
|
213
|
-
},
|
|
214
|
-
arg_path,
|
|
215
|
-
arg.getColumnsCount(value),
|
|
216
|
-
"header"
|
|
217
|
-
)}
|
|
218
|
-
</td>
|
|
219
|
-
</tr>
|
|
220
|
-
</tbody>
|
|
221
|
-
</table>
|
|
222
|
-
</div>
|
|
223
|
-
</fieldset>`;
|
|
224
|
-
}
|
|
225
|
-
export {
|
|
226
|
-
ComponentInputTable
|
|
227
|
-
};
|
|
228
|
-
//# sourceMappingURL=component-input-table.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/inputs/component-input-table.ts"],
|
|
4
|
-
"sourcesContent": ["/* eslint-disable @typescript-eslint/no-non-null-assertion */\nimport type { JDDContext, Table, TableData } from \"@sealcode/jdd\";\nimport { Markdown } from \"@sealcode/jdd\";\nimport { isTableHeader } from \"@sealcode/jdd\";\nimport type { StatefulPage } from \"@sealcode/sealgen\";\nimport type { Context } from \"koa\";\nimport { tempstream } from \"tempstream\";\nimport { ComponentInput } from \"./component-input.js\";\nimport type { ComponentPreviewActions } from \"../component-preview-actions.js\";\nimport type { JDDPageState } from \"../jdd-page.js\";\n\nexport async function ComponentInputTable<\n\tState extends JDDPageState,\n\tCellType,\n\tHeaderType\n>({\n\tstate,\n\targ_path,\n\tctx,\n\targ,\n\tvalue,\n\tpage,\n\tmakeJDDContext,\n\tmakeAssetURL,\n}: {\n\tstate: State;\n\tctx: Context;\n\targ_path: string[];\n\targ: Table<CellType, HeaderType>;\n\tvalue: TableData<CellType, HeaderType>;\n\tpage: StatefulPage<JDDPageState, typeof ComponentPreviewActions>;\n\tmakeJDDContext: (ctx: Context) => JDDContext;\n\tmakeAssetURL: (asset: string) => string;\n}): Promise<string> {\n\tif (!value) {\n\t\tvalue = await arg.getEmptyValue(makeJDDContext(ctx));\n\t}\n\n\tconst show_paste =\n\t\targ.cell_type instanceof Markdown &&\n\t\targ.header_type instanceof Markdown;\n\n\treturn tempstream/* HTML */ `<fieldset>\n\t\t<legend>${arg_path.at(-1)!}</legend>\n\t\t<div>\n\t\t\t${show_paste\n\t\t\t\t? /* HTML */ `<input\n\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\tvalue=\"paste\"\n\t\t\t\t\t\tplaceholder=\"paste table here\"\n\t\t\t\t\t\tdata-jdd-table-paste-argpath-value=\"${arg_path.join(\n\t\t\t\t\t\t\t\".\"\n\t\t\t\t\t\t)}\"\n\t\t\t\t\t\tdata-controller=\"jdd-table-paste\"\n\t\t\t\t />`\n\t\t\t\t: \"\"}\n\t\t\t<table\n\t\t\t\tclass=\"jdd-component-input--table\"\n\t\t\t\tstyle=\"position: relative; /* necessary for sticky th*/\"\n\t\t\t>\n\t\t\t\t<tbody>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td></td>\n\t\t\t\t\t\t${[...Array(arg.getColumnsCount(value)).keys()]\n\t\t\t\t\t\t\t.map(\n\t\t\t\t\t\t\t\t(column_index) => /* HTML */ `<th\n\t\t\t\t\t\t\t\t\tclass=\"sticky sticky--top subdued\"\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t${page.makeActionButton(\n\t\t\t\t\t\t\t\t\t\tstate,\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\taction: \"remove_table_column\",\n\t\t\t\t\t\t\t\t\t\t\tlabel: \"Remove column\",\n\t\t\t\t\t\t\t\t\t\t\tcontent: /* HTML */ `<img\n\t\t\t\t\t\t\t\t\t\t\t\twidth=\"20\"\n\t\t\t\t\t\t\t\t\t\t\t\theight=\"20\"\n\t\t\t\t\t\t\t\t\t\t\t\tsrc=\"${makeAssetURL(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\"icons/table-delete-column.svg\"\n\t\t\t\t\t\t\t\t\t\t\t\t)}\"\n\t\t\t\t\t\t\t\t\t\t\t/>`,\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\targ_path,\n\t\t\t\t\t\t\t\t\t\tcolumn_index\n\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t\t${column_index >=\n\t\t\t\t\t\t\t\t\targ.getColumnsCount(value) - 1\n\t\t\t\t\t\t\t\t\t\t? \"\"\n\t\t\t\t\t\t\t\t\t\t: page.makeActionButton(\n\t\t\t\t\t\t\t\t\t\t\t\tstate,\n\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\taction: \"move_table_column_right\",\n\t\t\t\t\t\t\t\t\t\t\t\t\tlabel: \"Move column to the right\",\n\t\t\t\t\t\t\t\t\t\t\t\t\tcontent: /* HTML */ `<img\n\t\t\t\t\t\t\t\t\t\t\t\t\t\twidth=\"20\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\theight=\"20\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tsrc=\"${makeAssetURL(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"icons/table-move-column-right.svg\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t)}\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t/>`,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\targ_path,\n\t\t\t\t\t\t\t\t\t\t\t\tcolumn_index\n\t\t\t\t\t\t\t\t\t\t )}\n\t\t\t\t\t\t\t\t</th>`\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t.join(\"\")}\n\t\t\t\t\t</tr>\n\t\t\t\t\t${value.rows.map(\n\t\t\t\t\t\t(row, row_index) => tempstream/* HTML */ `<tr>\n\t\t\t\t\t\t\t<td class=\"sticky sticky--left subdued\">\n\t\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\t\tstyle=\"display: flex; flex-flow: column; row-gap: 5px;\"\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t${page.makeActionButton(\n\t\t\t\t\t\t\t\t\t\tstate,\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\taction: \"remove_table_row\",\n\t\t\t\t\t\t\t\t\t\t\tlabel: \"Remove row\",\n\t\t\t\t\t\t\t\t\t\t\tcontent: /* HTML */ `<img\n\t\t\t\t\t\t\t\t\t\t\t\twidth=\"20\"\n\t\t\t\t\t\t\t\t\t\t\t\theight=\"20\"\n\t\t\t\t\t\t\t\t\t\t\t\tsrc=\"${makeAssetURL(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\"icons/table-delete-row.svg\"\n\t\t\t\t\t\t\t\t\t\t\t\t)}\"\n\t\t\t\t\t\t\t\t\t\t\t/>`,\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\targ_path,\n\t\t\t\t\t\t\t\t\t\trow_index\n\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t\t${page.makeActionButton(\n\t\t\t\t\t\t\t\t\t\tstate,\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\taction: \"move_table_row_down\",\n\t\t\t\t\t\t\t\t\t\t\tlabel: \"Move this row down\",\n\t\t\t\t\t\t\t\t\t\t\tcontent: /* HTML */ `<img\n\t\t\t\t\t\t\t\t\t\t\t\twidth=\"20\"\n\t\t\t\t\t\t\t\t\t\t\t\theight=\"20\"\n\t\t\t\t\t\t\t\t\t\t\t\tsrc=\"${makeAssetURL(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\"icons/table-move-row-down.svg\"\n\t\t\t\t\t\t\t\t\t\t\t\t)}\"\n\t\t\t\t\t\t\t\t\t\t\t/>`,\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\targ_path,\n\t\t\t\t\t\t\t\t\t\trow_index\n\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t${isTableHeader(row)\n\t\t\t\t\t\t\t\t? /* HTML */ tempstream`<th\n\t\t\t\t\t\t\t\t\t\tcolspan=\"${arg.getColumnsCount(value).toString()}\"\n\t\t\t\t\t\t\t\t >\n\t\t\t\t\t\t\t\t\t\t${ComponentInput({\n\t\t\t\t\t\t\t\t\t\t\tstate,\n\t\t\t\t\t\t\t\t\t\t\tctx,\n\t\t\t\t\t\t\t\t\t\t\targ_path: [\n\t\t\t\t\t\t\t\t\t\t\t\t...arg_path,\n\t\t\t\t\t\t\t\t\t\t\t\t\"rows\",\n\t\t\t\t\t\t\t\t\t\t\t\trow_index.toString(),\n\t\t\t\t\t\t\t\t\t\t\t\t\"header_content\",\n\t\t\t\t\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\t\t\t\t\targ: arg.header_type,\n\t\t\t\t\t\t\t\t\t\t\tvalue: row.header_content,\n\t\t\t\t\t\t\t\t\t\t\tpage,\n\t\t\t\t\t\t\t\t\t\t\tmakeJDDContext,\n\t\t\t\t\t\t\t\t\t\t\tmakeAssetURL,\n\t\t\t\t\t\t\t\t\t\t})}\n\t\t\t\t\t\t\t\t </th>`\n\t\t\t\t\t\t\t\t: row.cells.map(\n\t\t\t\t\t\t\t\t\t\t(\n\t\t\t\t\t\t\t\t\t\t\tcell,\n\t\t\t\t\t\t\t\t\t\t\tcell_index\n\t\t\t\t\t\t\t\t\t\t) => tempstream/* HTML */ `<td>\n\t\t\t\t\t\t\t\t\t\t\t${ComponentInput({\n\t\t\t\t\t\t\t\t\t\t\t\tctx,\n\t\t\t\t\t\t\t\t\t\t\t\tstate,\n\t\t\t\t\t\t\t\t\t\t\t\targ_path: [\n\t\t\t\t\t\t\t\t\t\t\t\t\t...arg_path,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\"rows\",\n\t\t\t\t\t\t\t\t\t\t\t\t\trow_index.toString(),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\"cells\",\n\t\t\t\t\t\t\t\t\t\t\t\t\tcell_index.toString(),\n\t\t\t\t\t\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\t\t\t\t\t\targ: arg.cell_type,\n\t\t\t\t\t\t\t\t\t\t\t\tvalue: cell,\n\t\t\t\t\t\t\t\t\t\t\t\tpage,\n\t\t\t\t\t\t\t\t\t\t\t\tmakeJDDContext,\n\t\t\t\t\t\t\t\t\t\t\t\tmakeAssetURL,\n\t\t\t\t\t\t\t\t\t\t\t})}\n\t\t\t\t\t\t\t\t\t\t</td>`\n\t\t\t\t\t\t\t\t )}\n\t\t\t\t\t\t\t${row_index == 0\n\t\t\t\t\t\t\t\t? /* HTML */ `<td\n\t\t\t\t\t\t\t\t\t\tclass=\"subdued\"\n\t\t\t\t\t\t\t\t\t\trowspan=\"${value.rows.length.toString()}\"\n\t\t\t\t\t\t\t\t >\n\t\t\t\t\t\t\t\t\t\t${page.makeActionButton(\n\t\t\t\t\t\t\t\t\t\t\tstate,\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\taction: \"add_table_column\",\n\t\t\t\t\t\t\t\t\t\t\t\tlabel: \"Add column\",\n\t\t\t\t\t\t\t\t\t\t\t\tcontent: /* HTML */ `<img\n\t\t\t\t\t\t\t\t\t\t\t\t\twidth=\"20\"\n\t\t\t\t\t\t\t\t\t\t\t\t\theight=\"20\"\n\t\t\t\t\t\t\t\t\t\t\t\t\tsrc=\"${makeAssetURL(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"icons/table-add-column-right.svg\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t)}\"\n\t\t\t\t\t\t\t\t\t\t\t\t/>`,\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\targ_path\n\t\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t </td>`\n\t\t\t\t\t\t\t\t: \"\"}\n\t\t\t\t\t\t</tr>`\n\t\t\t\t\t)}\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td\n\t\t\t\t\t\t\tclass=\"subdued\"\n\t\t\t\t\t\t\tcolspan=\"{(arg.getColumnsCount(value)\"\n\t\t\t\t\t\t\t+\n\t\t\t\t\t\t\t1).toString()}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t${page.makeActionButton(\n\t\t\t\t\t\t\t\tstate,\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\taction: \"add_table_row\",\n\t\t\t\t\t\t\t\t\tlabel: \"Add table row\",\n\t\t\t\t\t\t\t\t\tcontent: /* HTML */ `<img\n\t\t\t\t\t\t\t\t\t\twidth=\"20\"\n\t\t\t\t\t\t\t\t\t\theight=\"20\"\n\t\t\t\t\t\t\t\t\t\tsrc=\"${makeAssetURL(\n\t\t\t\t\t\t\t\t\t\t\t\"icons/table-add-row-below.svg\"\n\t\t\t\t\t\t\t\t\t\t)}\"\n\t\t\t\t\t\t\t\t\t/>`,\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\targ_path,\n\t\t\t\t\t\t\t\targ.getColumnsCount(value),\n\t\t\t\t\t\t\t\tundefined\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t${page.makeActionButton(\n\t\t\t\t\t\t\t\tstate,\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\taction: \"add_table_row\",\n\t\t\t\t\t\t\t\t\tlabel: \"Add table header\",\n\t\t\t\t\t\t\t\t\tcontent: /* HTML */ `<img\n\t\t\t\t\t\t\t\t\t\twidth=\"20\"\n\t\t\t\t\t\t\t\t\t\theight=\"20\"\n\t\t\t\t\t\t\t\t\t\tsrc=\"${makeAssetURL(\n\t\t\t\t\t\t\t\t\t\t\t\"icons/table-add-column-header-below.svg\"\n\t\t\t\t\t\t\t\t\t\t)}\"\n\t\t\t\t\t\t\t\t\t/>`,\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\targ_path,\n\t\t\t\t\t\t\t\targ.getColumnsCount(value),\n\t\t\t\t\t\t\t\t\"header\"\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t</td>\n\t\t\t\t\t</tr>\n\t\t\t\t</tbody>\n\t\t\t</table>\n\t\t</div>\n\t</fieldset>`;\n}\n"],
|
|
5
|
-
"mappings": "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",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,164 +0,0 @@
|
|
|
1
|
-
import { printArgPath } from "./print-arg-path.js";
|
|
2
|
-
import { SingleReference } from "@sealcode/jdd";
|
|
3
|
-
import {
|
|
4
|
-
ComponentArguments,
|
|
5
|
-
Enum,
|
|
6
|
-
Image,
|
|
7
|
-
List,
|
|
8
|
-
Structured,
|
|
9
|
-
Table
|
|
10
|
-
} from "@sealcode/jdd";
|
|
11
|
-
import { ComponentInputStructured } from "./component-input-structured.js";
|
|
12
|
-
import { ComponentInputList } from "./component-input-list.js";
|
|
13
|
-
import { ComponentInputEnum } from "./component-input-enum.js";
|
|
14
|
-
import { ComponentInputImage } from "./component-input-image.js";
|
|
15
|
-
import { ComponentInputTable } from "./component-input-table.js";
|
|
16
|
-
import { ComponentInputSingleReference } from "./component-input-single-reference.js";
|
|
17
|
-
import { is, predicates } from "@sealcode/ts-predicates";
|
|
18
|
-
import { tempstream } from "tempstream";
|
|
19
|
-
const actionName = "Components";
|
|
20
|
-
const absoluteUrlPattern = "http(s?)(://)((www.)?)(([^.]+).)?([a-zA-z0-9-_]+)";
|
|
21
|
-
async function ComponentInput({
|
|
22
|
-
ctx,
|
|
23
|
-
state,
|
|
24
|
-
arg_path,
|
|
25
|
-
arg,
|
|
26
|
-
value,
|
|
27
|
-
page,
|
|
28
|
-
makeJDDContext,
|
|
29
|
-
makeAssetURL
|
|
30
|
-
}) {
|
|
31
|
-
if (value === void 0) {
|
|
32
|
-
value = await arg.getEmptyValue(makeJDDContext(ctx));
|
|
33
|
-
}
|
|
34
|
-
if (arg instanceof List) {
|
|
35
|
-
return ComponentInputList({
|
|
36
|
-
ctx,
|
|
37
|
-
state,
|
|
38
|
-
arg_path,
|
|
39
|
-
arg,
|
|
40
|
-
value,
|
|
41
|
-
page,
|
|
42
|
-
makeJDDContext,
|
|
43
|
-
makeAssetURL
|
|
44
|
-
});
|
|
45
|
-
}
|
|
46
|
-
const argType = arg.getTypeName();
|
|
47
|
-
const isUrlAbsolute = arg instanceof ComponentArguments.URL && arg.urlType === "absolute";
|
|
48
|
-
const inputType = isUrlAbsolute ? "url" : "text";
|
|
49
|
-
if (arg instanceof Structured) {
|
|
50
|
-
return ComponentInputStructured({
|
|
51
|
-
ctx,
|
|
52
|
-
state,
|
|
53
|
-
arg_path,
|
|
54
|
-
arg,
|
|
55
|
-
value,
|
|
56
|
-
page,
|
|
57
|
-
makeJDDContext,
|
|
58
|
-
makeAssetURL
|
|
59
|
-
});
|
|
60
|
-
}
|
|
61
|
-
if (arg instanceof SingleReference) {
|
|
62
|
-
return ComponentInputSingleReference({
|
|
63
|
-
ctx,
|
|
64
|
-
state,
|
|
65
|
-
arg_path,
|
|
66
|
-
arg,
|
|
67
|
-
value,
|
|
68
|
-
onchange: page.rerender(),
|
|
69
|
-
makeJDDContext
|
|
70
|
-
});
|
|
71
|
-
}
|
|
72
|
-
if (arg instanceof Enum) {
|
|
73
|
-
return ComponentInputEnum({
|
|
74
|
-
state,
|
|
75
|
-
arg_path,
|
|
76
|
-
arg,
|
|
77
|
-
value,
|
|
78
|
-
onchange: page.rerender()
|
|
79
|
-
});
|
|
80
|
-
}
|
|
81
|
-
if (arg instanceof Image) {
|
|
82
|
-
return ComponentInputImage({
|
|
83
|
-
ctx,
|
|
84
|
-
state,
|
|
85
|
-
arg_path,
|
|
86
|
-
arg,
|
|
87
|
-
value,
|
|
88
|
-
page,
|
|
89
|
-
makeJDDContext
|
|
90
|
-
});
|
|
91
|
-
}
|
|
92
|
-
if (arg instanceof Table) {
|
|
93
|
-
return ComponentInputTable({
|
|
94
|
-
ctx,
|
|
95
|
-
state,
|
|
96
|
-
arg_path,
|
|
97
|
-
arg,
|
|
98
|
-
value,
|
|
99
|
-
page,
|
|
100
|
-
makeJDDContext,
|
|
101
|
-
makeAssetURL
|
|
102
|
-
});
|
|
103
|
-
}
|
|
104
|
-
const inputElement = () => {
|
|
105
|
-
switch (argType) {
|
|
106
|
-
case "url":
|
|
107
|
-
return tempstream`
|
|
108
|
-
<input
|
|
109
|
-
type="url"
|
|
110
|
-
name="{$.component_args${printArgPath(arg_path)}}"
|
|
111
|
-
value="{value"
|
|
112
|
-
as
|
|
113
|
-
string}
|
|
114
|
-
size="40"
|
|
115
|
-
pattern="{isUrlAbsolute"
|
|
116
|
-
?
|
|
117
|
-
absoluteUrlPattern
|
|
118
|
-
:
|
|
119
|
-
undefined}
|
|
120
|
-
/>
|
|
121
|
-
`;
|
|
122
|
-
case "number":
|
|
123
|
-
return tempstream`
|
|
124
|
-
<input type="number"
|
|
125
|
-
name={$.component_args${printArgPath(arg_path)}}
|
|
126
|
-
value={(value || "").toString()} min={ arg instanceof Number
|
|
127
|
-
? arg.min.toString() : undefined } max={ arg instanceof
|
|
128
|
-
Number ? arg.max.toString() : undefined } step={ arg
|
|
129
|
-
instanceof Number ? arg.step.toString() : undefined } />
|
|
130
|
-
`;
|
|
131
|
-
default:
|
|
132
|
-
return tempstream`
|
|
133
|
-
<input type="${inputType}"
|
|
134
|
-
name="${`$${printArgPath(arg_path)}`}"
|
|
135
|
-
value="${is(value, predicates.string) ? value : ""}"
|
|
136
|
-
size="40"
|
|
137
|
-
${isUrlAbsolute ? `pattern="${absoluteUrlPattern}"` : ""}"
|
|
138
|
-
/>
|
|
139
|
-
`;
|
|
140
|
-
}
|
|
141
|
-
};
|
|
142
|
-
return `<div>
|
|
143
|
-
<label>
|
|
144
|
-
${arg_path.at(-1) || ""}
|
|
145
|
-
${argType == "markdown" ? `<div class="grow-wrap">
|
|
146
|
-
<textarea
|
|
147
|
-
name="${`$${printArgPath(arg_path)}`}"
|
|
148
|
-
onblur="${page.rerender()}"
|
|
149
|
-
cols="40"
|
|
150
|
-
data-controller="markdown-textarea submit-on-input"
|
|
151
|
-
data-action="autogrow-textarea#autogrow blur->autogrow-textarea#autogrow resize->autogrow-textarea#autogrow submit-on-input#sendValues focus->submit-on-input#makePermanent blur->submit-on-input#makeNotPermanent"
|
|
152
|
-
autocomplete="off"
|
|
153
|
-
>
|
|
154
|
-
${is(value, predicates.string) ? value : ""}</textarea
|
|
155
|
-
>
|
|
156
|
-
</div>` : inputElement()}
|
|
157
|
-
</label>
|
|
158
|
-
</div>`;
|
|
159
|
-
}
|
|
160
|
-
export {
|
|
161
|
-
ComponentInput,
|
|
162
|
-
actionName
|
|
163
|
-
};
|
|
164
|
-
//# sourceMappingURL=component-input.js.map
|