Browse Source
An Extension logic is implemented. It will replace the earlier introduced - direct implementation of material icons - use CSS-Cals which is not supported by all browsers yet anyway The "packageWithoutFramework" (pwf) which wasn't properly implemented yet, was replaced with a "Framework Management Console" - a panel that can be shown in the (generated) page if desired. It is supposed to provide some controls as well as the "pwf" functionallity. Further there are considerations to extend the pwf further to introduce the opportunity to generate the components into a form that can be used in other frameworks.dev-feat-component_preview
5 changed files with 152 additions and 10 deletions
@ -1,3 +1,4 @@ |
|||
node_modules/ |
|||
samples/*/ |
|||
jpc-like-websites.js |
|||
extensions/ |
|||
|
@ -0,0 +1,63 @@ |
|||
/** |
|||
* |
|||
*/ |
|||
|
|||
function frameworkControlPanel( |
|||
extensions = [] |
|||
) { |
|||
return builder.row() |
|||
.alignment(Alignment.CENTER) |
|||
.arrangement(Arrangement.CENTER) |
|||
.isHigherComponent() |
|||
.setStylingsStorage(ExtStoreType.INTERNALIZED_WITHIN) |
|||
.modifier( |
|||
new Modifier() |
|||
.fillMaxWidth() |
|||
.background(MaterialFiveHundredlColors.ORANGE) |
|||
.dimensions( |
|||
new Dimensions() |
|||
.height(200) |
|||
) |
|||
.border( |
|||
new Border(3) |
|||
.color(Colors.goldenrod_3) |
|||
) |
|||
.linkPadding(4) |
|||
) |
|||
.childContext([ |
|||
builder.column() |
|||
.modifier(new Modifier().fillMaxHeight()) |
|||
.childContext([ |
|||
builder.label().text("Installed Extensions:") |
|||
, |
|||
builder.column() |
|||
.overflow() |
|||
.modifier( |
|||
new Modifier() |
|||
.linkPadding(4).ensureModifier() |
|||
.linkBorder(1) |
|||
) |
|||
.childContext( |
|||
extensions.map( |
|||
/** |
|||
* |
|||
* @param {CompelExtension} ext |
|||
* @returns {Component} |
|||
*/ |
|||
ext => builder.span().text(ext.diplayTitle) |
|||
) |
|||
) |
|||
]) |
|||
, |
|||
builder.div() |
|||
.alignment(Alignment.CENTER) |
|||
.arrangement(Arrangement.CENTER) |
|||
.childContext([ |
|||
builder.label() |
|||
.text("to generate and download page displayed below click on 'generate'") |
|||
, |
|||
builder.button() |
|||
.text("generate") |
|||
]) |
|||
]); |
|||
} |
@ -0,0 +1,44 @@ |
|||
class CompelExtension { |
|||
/** |
|||
* @type {string} |
|||
*/ |
|||
name; |
|||
/** |
|||
* @type {string} |
|||
*/ |
|||
diplayTitle; |
|||
/** |
|||
* @type {Array<SStoreDefinition>} |
|||
*/ |
|||
stylings; |
|||
/** |
|||
* @type {Array<SStoreDefinition>} |
|||
*/ |
|||
functions; |
|||
/** |
|||
* Predefined components. Usually of a higher (constructed) kind. |
|||
* @type {Object} |
|||
*/ |
|||
components; |
|||
/** |
|||
* Extensions for/to the Page or the framework in general. |
|||
* @type {Object} |
|||
*/ |
|||
frameworkControls; |
|||
/** |
|||
* Additional elements for the builder (likely referencing components) |
|||
* @type {Object} |
|||
*/ |
|||
builderElements; |
|||
|
|||
/** |
|||
* defines how jpc-like-websites is to be extended and executes that extension |
|||
*/ |
|||
install() { |
|||
builder.extensions = Object.assign(builder.extensions, this.builderElements); |
|||
|
|||
for (const key of Object.keys(this.stylings)) { |
|||
Page.registerStyling(key, this.stylings[key]); |
|||
} |
|||
} |
|||
} |
Loading…
Reference in new issue