openscd / open-scd-wizarding Goto Github PK
View Code? Open in Web Editor NEWOpenSCD core extension `Wizarding` including a standard wizard library and SCL related utility functions
License: Apache License 2.0
OpenSCD core extension `Wizarding` including a standard wizard library and SCL related utility functions
License: Apache License 2.0
As a user of OpenSCD I want to know which child elements are allowed within a given element.
Requirements
tagName
sProposed API
function validChildTags(tagName: string, schema: XMLDocument): string[]
As a user of open-scd-core
I want to have an algorithm that returns the definition attributes for a given SCL element including its restriction defined by a given SCL schema.
Background
When receiving a wizard event for an element that is not added to the wizard library, we need to have a fallback mode wizard. Such a wizard is constructed of inputs for each of the attitudes of the element. Each of the attributes can have restriction defined in the schema that shall be added of the inputs in the wizard.
Requirements
Proposed interfaces
function getAttributes(tagName: string, schema:XMLDocument): Record<string, Attribute>
interface Attribute {
base: string;
namespaceURI?: string;
value?: string | null;
defaultValue?: string;
enumeration?: string[];
required?: boolean;
pattern?: string;
maxLength?:string;
minLength?: string;
}
As a user of OpenSCD core, I want to have a simple way to create my own wizards in my plugin.
Requirements
We are thinking about radically changing the WizardEvent
in order to turn it into a pure declaration of intent.
Instead of the API user saying
"Please open a wizard with exactly these inputs, page titles, button labels, icons, etc., and exactly this WizardAction committed at the end.",
the API user would then either say
"Please open some wizard allowing the user to edit this element I have here."
or
"Please open some wizard allowing the user to create a new element of this tagName as a child of this parent element I have here."
In order to enable the API user to add properties from an extension namespace defined in some custom schema, the API user can specify pairs of XML Schema documents and namespace prefix strings to take into consideration. All other work would be done automatically by the core editor.
This would mean reducing the scope of Wizards to creating or editing elements only, while other tasks (e.g. our "select" wizards) would then be done using regular modal dialogues. This makes for a clean, single-purpose API with a clearly defined upgrade path when new versions of the standard schema are released.
interface CustomNamespace {
prefix: string,
schema: XMLDocument
}
interface WizardEventDetail {
element: Element,
tagName?: string,
custom?: CustomNamespace[],
hidden?: string[],
subWizard?: boolean
};
function newEditWizardEvent(element: Element, customNS?: CustomNamespace[]): WizardEvent;
function newCreateWizardEvent(parent: Element, tagName: string, customNS?: CustomNamespace[]): WizardEvent;
As a user of OpenSCD core, I want to know the parents' element tags for a given element and schema.
Requirement
tagName
tagName
sProposed API
function validParentTags(tagName: string, schema: XMLDocument): string[]
Re-use the open-wc recommendation as used in open-scd-core except for importing open-scd
from npm
Re-use CONTRIBUTING.md from open-scd-core
As a plugin author, I want to have a default wizard per given SCL element.
Requirements
<oscd-attribute-input name="desc" attribute="{base: \"xs:normalizedString\"}">
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.