Page Menu
Home
Sealhub
Search
Configure Global Search
Log In
Files
F22418230
jdd-html.tsx
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Authored By
Unknown
Size
1003 B
Referenced Files
None
Subscribers
None
jdd-html.tsx
View Options
import
{
JDD
,
type
RawJDDocument
}
from
"@sealcode/jdd"
;
import
html
from
"./html.js"
;
import
{
makeJDDContext
}
from
"./jdd-context.js"
;
import
{
registry
}
from
"./jdd-components/registry.js"
;
import
{
tempstream
}
from
"tempstream"
;
export
type
JDDHtmlArgs
=
Omit
<
Parameters
<
typeof
html
>
[
"0"
],
"body"
>
&
{
raw_jdds
:
RawJDDocument
[];
construct_body
:
(
built_jdd_html
:
JSX
.
Element
)
=>
JSX
.
Element
;
};
export
default
async
function
jdd_html
(
args
:
JDDHtmlArgs
)
{
const
jdd_context
=
makeJDDContext
(
args
.
ctx
);
const
jdds
=
await
Promise
.
all
(
args
.
raw_jdds
.
map
((
raw_jdd
)
=>
JDD
.
fromStorage
(
registry
,
jdd_context
,
raw_jdd
))
);
const
css_clumps
=
Array
.
from
(
new
Set
([
...(
args
?
.
css_clumps
||
[]),
...
jdds
.
map
((
jdd
)
=>
jdd
.
getAllCSSClumps
()).
flat
(),
]).
values
()
);
let
built_jdd_html
=
tempstream
``
;
for
(
const
jdd
of
jdds
)
{
built_jdd_html
=
tempstream
`
${
built_jdd_html
}${
jdd
.
render
()
}
`
;
}
return
html
({
css_clumps
,
...
args
,
body
:
args
.
construct_body
(
built_jdd_html
),
});
}
File Metadata
Details
Attached
Mime Type
application/javascript
Expires
Sat, Nov 28, 02:11 (1 d, 9 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1192315
Default Alt Text
jdd-html.tsx (1003 B)
Attached To
Mode
rREWRITE Configurable rewriter
Attached
Detach File
Event Timeline