Page Menu
Home
Sealhub
Search
Configure Global Search
Log In
Files
F7187969
all-components.page.tsx
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
all-components.page.tsx
View Options
import
type
{
Context
}
from
"koa"
;
import
{
tempstream
,
TempstreamJSX
}
from
"tempstream"
;
import
{
Page
}
from
"@sealcode/sealgen"
;
import
html
,
{
defaultHead
}
from
"../html.js"
;
import
{
registry
}
from
"../jdd-components/components.js"
;
import
{
documentContainerFromParsed
,
render
,
renderEarlyAssets
}
from
"@sealcode/jdd"
;
import
{
shuffle
}
from
"../util.js"
;
import
{
makeJDDContext
}
from
"../jdd-context.js"
;
export
const
actionName
=
"AllComponents"
;
export
default
new
(
class
AllComponentsPage
extends
Page
{
// eslint-disable-next-line @typescript-eslint/no-unused-vars
async
canAccess
(
_
:
Context
)
{
return
{
canAccess
:
true
,
message
:
""
};
}
async
render
(
ctx
:
Context
)
{
const
components
=
registry
.
getAll
();
const
jdd_context
=
makeJDDContext
(
ctx
);
const
document
=
await
Promise
.
all
(
shuffle
(
Object
.
entries
(
components
)).
map
(
async
([
component_name
,
component
])
=>
{
return
{
component_name
,
args
:
await
component
.
getExampleValues
(
jdd_context
),
};
}
)
);
return
html
(
ctx
,
"AllComponents"
,
<
div
style
=
"max-width: 1024px; margin: 0 auto; container-type: inline-size;"
>
{
render
(
registry
,
documentContainerFromParsed
(
document
),
jdd_context
)}
<
/div>,
{},
(...
args
)
=>
tempstream
`
${
defaultHead
(...
args
)
}${
renderEarlyAssets
(
registry
,
documentContainerFromParsed
(
document
),
jdd_context
)
}
`
);
}
})();
File Metadata
Details
Attached
Mime Type
text/x-java
Expires
Tue, Jul 8, 07:47 (14 h, 30 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
790052
Default Alt Text
all-components.page.tsx (1 KB)
Attached To
Mode
rPLAY Sealious playground
Attached
Detach File
Event Timeline
Log In to Comment