Extension:WikiLambda/Frontend Architecture
The Frontend layer of the WikiLambda extension consists on a Vue app that allows easy visualization and manipulation of ZObjects in the most convenient available human language.
This app is written for Vue.js, using Pinia and Codex component library, and is fully available in the WikiLambda resource module, ext.wikilambda.app
The basic functions:
- Load the ZObject requested in the URL for viewing or editing purposes.
- Translate all ZObject ids (Zn) and ZKey ids (ZnKm) into a human readable string in the user preferred language or its closest available fallback language.
- Render different parts of the ZObject with template components that allow users to view or edit them more intuitively.
- Provide additional widgets that enrich the viewing and editing experience.
Entry point and Views
The Vue entry point is the base component, App.vue. Given the values passed by the config variable wgWikiLambda
and in the URL parameters, this component:
- Requests for the necessary data
- Initializes the internal state
- Loads the appropriate view
(Details on initializing the page data are in Page initialization section below.)
The views define the structure of each page, applying and placing widgets and content section. The components are stored in the views directory and are the following:
Function Editor
The FunctionEditor.vue view loads when we create a new ZObject of type Function/Z8 or edit an existing one. The App entry point renders Function Editor when we:
- Create a new Function: Opening the special page
Special:CreateObject
with the URL parameterzid=Z8
. E.g. https://www.wikifunctions.org/wiki/Special:CreateObject?zid=Z8 - Edit an existing Function: Opening the wiki page for a Zid that belongs to a function with the URL parameter
action=edit
. E.g. https://www.wikifunctions.org/wiki/Z802?action=edit
The Function Editor content consists of a simple form page having no additional widgets.
Function Viewer
The FunctionViewer.vue view loads when we view an existing Function/Z8 object. The App entrypoint renders Function Viewer when we:
- View a Function: Opening the wiki page for a Zid that belongs to a function. E.g. https://www.wikifunctions.org/wiki/Z802
The Function Viewer page accommodates the widgets: About, Function Evaluator, Implementations Table and Tests Table.
Default View
The DefaultView.vue view is loaded when creating, editing, or viewing all objects that are not a Function/Z8. The App entry point renders Default View when we:
- Create a new object: Opening the special page
Special:CreateObject
without thezid
URL parameter. E.g. https://www.wikifunctions.org/wiki/Special:CreateObject - Create a new object of a given type: Opening the special page
Special:CreateObject
with thezid
parameter set to other than Z8. E.g. https://www.wikifunctions.org/wiki/Special:CreateObject?zid=Z14 - View an object: Opening the wiki page for a Zid that belongs to an object that's not a function. E.g. https://www.wikifunctions.org/wiki/Z11
- Edit an object: Opening the wiki page for a Zid that belongs to an object that's not a function with the URL parameter
action=edit
. E.g. https://www.wikifunctions.org/wiki/Z8020?action=edit&uselang=en
The page is formed by a central Content section and the About widget. And specifically, when viewing or editing objects of type Implementation/Z14 or Test/Z20, it also adds the Function Explorer, Function Evaluator, and Function Report widgets.
Function Evaluator
The FunctionEvaluator.vue view is loaded when opening the Special:RunFunction page. E.g. https://www.wikifunctions.org/wiki/Special:RunFunction
Data Flows
ZObject Initialization
Every Create, Edit or View page represents an object of type Persistent Object/Z2. When we create a new ZObject, the initialization process creates a blank Persistent Object/Z2, and when we edit or view an existing one, the initialization flow requests it via the MediaWiki API and sets it as the page root ZObject.
As persisted, ZObjects are valid JSON objects and they are stored in their canonical (or short) form. However, while initializing the Frontend app, objects undergo two transformations:
- Transform from canonical to hybrid form: Terminal nodes (Strings/Z6 and References/Z9) are transformed into their normal (or long) form. Lists are left as arrays, in their canonical form (aka. Benjamin Arrays).
- Missing keys are initialized to their blank values, so that editors can see them and edit them to valid values. Some commonly missing keys are Description/Z2K5, Aliases/Z2K4, the Key/Z3 property Is identity/Z3K4, and the Type/Z4 properties for its Equality function/Z4K4, Display function/Z4K5 or Reading function/Z4K6.
Namespaced ZObjects
On occasions, it is necessary to use the Default component tree (initiated by an instance of the ZObjectKeyValue.vue
component) to represent additional ZObjects in the page. For example, when seeing the Function Evaluator widget in a Test/Z20 page (E.g. https://www.wikifunctions.org/view/en/Z8021), the Default component is representing the following independent ZObjects:
- The main ZObject (in this case, the test Z8021) represented by the page.
- The Function Call/Z7 object built by the widget for it to be called, always editable.
- The Evaluation result/Z22 object returned after the call, not editable.
All the ZObjects are stored in the Pinia store in their parsed JSON format, under the store property jsonObject
from the zobject.js
store module. This object contains the different ZObjects stored under different namespaces, which currently are:
jsonObject.main
: Contains the page ZObject. This object is always a Persistent Object/Z2.jsonObject.call
: Contains the function call created and executed by the Function Evaluator widget. This object is always a Function Call/Z7 object.jsonObject.response
: Contains the response object after executing the function call from the Function Evaluator widget. This object is always an Evaluator Result/Z22.
Label Data Initialization
Once the main ZObject is requested, transformed and stored as as described in the section above, we have a locally accessible, easily editable representation of all its nodes. However, the object is still represented in its non-readable form (with language-independent Zids and ZKey ids instead of human-readable labels).
The final step of initialization is to make sure that all the ZObject and ZKey ids are shown in the user language, if available, or in their closest available fallback language:
Before label data | For English | For Spanish |
---|---|---|
![]() | ![]() | ![]() |
To accomplish this, the global store keeps a glossary of labels and their translations to the user language, stored in the module library.js, and all of the components request the translations to this module.
Details on how to use the library module are below in the Library module section.
Page Submission
Before the final submission, the main ZObject undergoes a series of validations and, if those are successful, a series of transformations. All of these are placed in the submissions module.
The component that handles, triggers and orchestrates all the submission-related actions is the Publish widget detailed below.
Validations
When creating a new ZObject or editing an existing one, the "Publish" button is enabled. Clicking this publish button triggers the validateZObject
action. This action performs a series of superficial validations for different ZObject types, which must pass before the ZObject is submitted. These validations are the following:
- For a Function/Z8 page:
- The output type must be set,
- For every input, if any, its type must be set.
- For an Implementation/Z14 page:
- The implementation function field must be set,
- If the implementation is a composition, the composition function call must be defined,
- If the implementation is code, the programming language must be defined and the code string must contain something.
- For a Test/Z20 page:
- The test function field must be set,
- The test function call must be configured,
- The test validation call must be also configured.
Failure to pass these validations will render error messages in the fields that are missing.
If the validation passes, the publishing process will proceed by showing the Publish dialog.
Transformations
After adding an edit message and clicking the final "Publish" in the dialog, the submitZObject
action in the submission module is triggered, which first does the transformations listed in the transformZObjectForSubmission
action:
- For all objects:
- Removes empty monolingual values from the Persistent object name/Z2K3: An empty monolingual value that has either unset Language/Z11K1 or Text/Z11K2 fields.
- Removes empty monolingual values from the Persistent object description/Z2K5
- Removes empty alias sets from the Persistent object alias/Z2K4: An empty alias set has either an empty language value, or an empty list of strings, after removing the empty strings from the list. (E.g. [ "Z6", "" ] and [ "Z6" ] are both considered empty alias lists)
- Remove any Typed list items marked for deletion: Items are marked for deletion when a Typed list that contains items has its type changed, so their items don't match the type anymore.
- For Function/Z8 objects:
- Clear empty monolingual strings in the argument labels.
- Remove empty arguments: An empty argument is one that has no label and no type.
- Rename argument key Ids following a sequential order (Z*Kn, Z*Kn+1, etc.)
- Disconnect all its implementations and tests if the Function signature has changed: The function signature changes when either the inputs (number of inputs or their types) or the output type has changed.
- For Type/Z4 objects:
- Remove the keys that have non-set functions (Equality/Z4K4, Display function/Z4K5 and Reading function/Z4K6 functions). Even if these fields are ultimately mandatory, it's important to allow Types with empty fields to be saved, as contributors must add the Type before creating the Functions.
- Rename type key Ids following sequential order (Z*Kn, Z*Kn+1, etc.)
- Set to false all the Is identity/Z3K4 keys which are not set.
- Clear empty monolingual strings in the key labels.
- For Error Type/Z50 objects:
- Rename type key Ids following sequential order (Z*Kn, Z*Kn+1, etc.)
- Set to false all the Is identity/Z3K4 keys which are not set.
- Clear empty monolingual strings in the key labels.
Once all these transformations have successfully gone through, the ZObject is then fully canonicalized and submitted for creation or edition to the wikilambda_edit API.
Pinia Global State
The WikiLambda Vue app uses Pinia for storing, accessing, and handling the global state.
The basic functions:
- Store the main ZObject for the given page, and the other accessory ZObjects needed from the Function Evaluator widget.
- Store the necessary auxiliary data to enrich the experience in the UI. For example, the human-readable translations of all the Zids and ZKey ids.
- Provide the necessary actions to modify safely the main ZObject.
The state is divided into modules that handle different features, but the most important modules are: zobject.js
and library.js
, which are described below along with their most important actions and getters.
Notes on Getters
Pinia getters work as computed properties. After requesting the getter in the component using mapGetters
like this:
computed: $.extend( {}, mapGetters( [
'getCurrentZObjectId',
'getZObjectByKeyPath'
] ), {
...
} ),
The getter getCurrentZObjectId
is already computed and can be used anywhere in the component without having to invoke it as a function.
zobjectId: function() {
return this.getCurrentZObjectId;
}
However, some getters need an input. In these cases, getters will return a function which needs to be invoked from the component. This is the case of getters like getZObjectByKeyPath
, which needs the full array of keys passed as an input:
exampleMainZObjectType: function() {
return this.getZObjectByKeyPath( [ 'main', 'Z2K2', 'Z1K1' ] );
}
This needs to be taken into consideration when mocking the store getters in the jest unit tests, and every getter needs to be mocked to return either a value or a function.
Library module
The library module requests, transforms and stores all the auxiliary information that the UI needs from other ZObjects that are not the main one. The library module stores two main collections:
- labels: Glossary of all ZObject and ZKey ids in their abstract form and their most relevant available label. Each value contains the human-readable label, the language of the label, and the Zid, and the objects are indexed by Zid.
{ "Z1": { "label": "Object", "lang": "Z1002", "zid": "Z1" }, "Z1K1": { "label": "type", "lang": "Z1002", "zid": "Z1K1" }, "Z1002": { "label": "Inglés", "lang": "Z1003", "zid": "Z1002" }, "Z1003": { "label": "Spanish", "lang": "Z1002", "zid": "Z1003" }, }
- objects: Cached ZObjects that were requested by the library module and might be needed in the future.
Getters
The library store has a number of useful getters which return functions and allow us to reactively look into the objects stored in the module. Some of the things we look from stored objects are:
- Details of a given function: their inputs and output types and their connected tests and implementations.
- Details of a type: their keys and key types.
- Multilingual data from all Objects, Type key labels and Function argument labels. This is the most important part of this module, and it is widely used to transform all ZObject and ZKey ids into human-readable form.
The most widely used getters are:
- getLabelData: Returns the LabelData object saved for a given Zid or ZKey id. The LabelData object contains information of the requested Zid, the label in the user language or its closest fallback, and the language this label is in (its language Zid, language code and language directionality). This getter will always return a LabelData object, even if the requested Zid doesn't have any human-redable label. In these cases, the value under
LabelData.label
will also be the untranslated Zid. Whenever LabelData also provides other getters to identify and adapt to such cases, likeLabelData.isUntitled
which returns a boolean, andLabelData.labelOrUntitled
, which returns the human-readable label if available, or the messages "Untitled" or "Unlabelled" if there's no label. See the LabelData class for more details. - getStoredObject: Returns the stored ZObject given its Zid, in canonical form. This will only return objects that have been previously been fetched with the action fetchZids, and will return undefined if the object has not yet been fetched.
Actions
Whenever the UI needs additional information from non-root objects, it must trigger the action fetchZids (see more details in the inline documentation), which will:
- Check if the requested object has been fetched and hence is already cached.
- If not, request the object to the
wikilambdaload_zobjects
API with the parameterslanguage
set to the user language, andget_dependencies
set to true. - For each object in the response, do:
- Save the object in the cached objects collection
- Save its label in the labels collection
- If it's a Function: save its argument labels in the labels collection
- If it's a Type: save its key labels in the labels collection
- Perform the action fetchZids again with all the returned languages that were not observed before.
The action fetchZids returns a Promise that is resolved as soon as the initially requested zids are available in the store. This can be used to make sure that certain actions that need to inspect ZObject properties are not run without the necessary objects. For example, when setting a new function call, once the Function Call Function/Z7K1 is selected, the arguments for the selected function are set automatically to their blank values depending on their expected types. To create the blank values for each type, the type needs to be available, so it becomes necessary to wait for the fetch call to return:
// Given the function Id, get a list of the argument types
const newArgs = this.getInputsOfFunctionZid( functionZid );
const argTypes = newArgs.map( ( arg ) => arg[ Constants.Z_ARGUMENT_TYPE ] );
// Fetch all argument type Zids first, before the creation of the blank objects
this.fetchZids( { zids: argTypes } ).then( () => {
// Now we know that all arg types will be available on this.getStoredObject( argType )
// We can safely initialize the function call arguments:
newArgs.forEach( ( arg ) => {
const key = arg[ Constants.Z_ARGUMENT_KEY ];
const type = arg[ Constants.Z_ARGUMENT_TYPE ];
// We create the blank value of the given type:
const value = this.createObjectByType( { type } );
// Then set the argument blank value on its key:
this.setValueByKeyPath( {
keyPath: [ ...keyPath, key ],
value
} );
} );
} );
ZObject module
The ZObject module stores the page ZObjects under their specific namespace (main
, call
or response
), and provides a collection of getters and actions to navigate and mutate them.
Some getters and actions are specific to certain namespaces and object types, for example, getCurrentZObjectType
will always return the type of the ZObject stored in the main
namespace, under the Persistent Object Value/Z2K2 key, so it doesn't require a path as an input (in other words, the path is always main.Z2K2). Other getters or actions are more generic and can be used to inspect or mutate different nodes. In these cases, the getters and actions require keyPath
as an input, which should be an array of strings describing the path to walk, starting from the namespace name. For example, the keyPath to the main inner object type would be [ 'main', 'Z2K2', 'Z1K1' ]
Getters
Getters return common values with predictable paths, or direct references to the stored ZObject given a path. Some common getters are:
- getCurrentZObjectType: which returns the type of the ZObject stored at main.Z2K2.
- getZObjectByKeyPath: which returns a reference to the stored ZObject given an input path.
Actions
All mutations of the ZObjects stored in the Pinia store are handled by the actions in this module. To do this, all these actions require, as an input, the full key path to the mutating value. The most widely used actions are:
setValueByKeyPath
Given a path of keys, sets the final node to the given value. For example, assuming that the ZObject stored under the main
namespace contains the following Monolingual String object (in hybrid form):
main: {
Z2K2: {
Z1K1: {
Z1K1: "Z9",
Z9K1: "Z11"
},
Z11K1: {
Z1K1: "Z9",
Z9K1: "Z1002"
},
Z11K2: {
Z1K1: "Z6",
Z6K1: "old string"
}
}
}
We can use this action to change the value of the string by invoking it with the full key path and the final value to set:
setValueByKeyPath( [ "main", "Z2K2", "Z11K2", "Z6K1" ], "new string" );
changeTypeByKeyPath
Given a key path and a new type, initializes the value under that row Id to a new object of the given type. For example, if we look again at the previous Monolingual String object, we can change the type of its language key/Z11K1 to a literal Language/Z60 object by calling the changeTypeByKeyPath
with the full key path and the new type:
changeTypeByKeyPath( {
keyPath: [ 'main', 'Z2K2', 'Z11K1' ],
type: 'Z60'
} );
This action will first create a blank structure for an object of type Z60, convert it into in hybrid form, and insert it at the given path, discarding its previous value. This would result in the object:
main: {
Z2K2: {
Z1K1: {
Z1K1: "Z9",
Z9K1: "Z11"
},
Z11K1: {
Z1K1: {
Z1K1: "Z9",
Z9K1: "Z60"
},
Z60K1: {
Z1K1: "Z6",
Z6K1: "" // blank value
}
},
Z11K2: {
Z1K1: "Z6",
Z6K1: "old string"
}
}
}
Other actions
Other (less widely used, but also important) actions are:
- setFunctionCallArguments: When changing a Function call Function ID/Z7K1, this action clears the arguments of the previous Function ID, looks for the input keys and types of the new Function Id, and sets the necessary keys initialized to their blank values.
- setImplementationContentType: When changing an Implementation/Z14 from one content type to another, this action clears the key from the previous configuration and sets the new key. For example, when changing from Composition to Code, removes the key
Z14K2
and its child nodes, and setsZ14K3
initialized to a blank Code/Z16 object.
Default View and Component tree
A ZObject is a JSON object that follows the Wikifunctions Function Model structure specifications.
ZObjects are essentially trees, where at every level:
- There is one key
Z1K1
that defines the type of the object represented at that level. This type also defines the rest of the keys that will be found in this ZObject. - Keys are unique for that level, and have the shape
ZnKm
whereZn
is the type, andKm
is the m'th key. - The values of these keys are also ZObjects, which can be:
- Terminal ZObjects: Z6/String or Z9/Reference
- Objects of any other type: Their type will, again, be specified under their own
Z1K1
keys.
- The values for each key are generally bound to be of a specific type. E.g. In an object of type Monolingual text/Z11, the value of its key
Z11K1
must be a Human language/Z60, and the value of its keyZ11K2
must be a String/Z6
To accommodate this structure, ZObject components in the front-end should:
- Have a nested structure, so that contributors can explore and edit the ZObject in depth till reaching the terminal values.
- Provide a collection of builtin components for most common types, that can render a user friendly interface for viewing or editing these objects.
- Provide a fallback experience for any other types even if they don't have builtin components, which allows contributors to view and edit their values.
The Default View is a Vue page view that can accommodate any possible ZObject, allowing anyone to create, view or edit any kind of ZObject. The content section renders the main component tree, using the structural component ZObjectKeyValue.
The components needed for the Default View tree are:
- Structural Components:
ZObjectKeyValue
ZObjectKeyValueSet
- Utility Components:
ModeSelector
ExpandedToggle
- Non-typed Components:
ZObjectToString
- Typed Components:
- For terminal types:
ZString
ZReference
- For other types:
ZBoolean
ZMonolingualString
ZFunctionCall
ZTypedList
ZImplementation
ZArgumentReference
ZCode
ZTester
- And more...
- For terminal types:
This documentation will cover the structural and utility components, a few of the most important non-typed and typed components, and a guide on how to create new components for a given type.
ZObjectKeyValue
The component ZObjectKeyValue.vue
is the most important piece of the Default View as it represents every key-value pair and provides the following functionality:
- It renders the key in the preferred user language, or in the closest fallback language. E.g. Instead of "Z1K1", it shows "type" or "(en) type"
- It figures out the ZObject type of its value
- It figures out the layout configuration for each type, which determines whether the type has a built-in component and whether it has both expanded and collapsed states.
- It allows switching between collapsed and expanded mode if the component allows so (wee ExpandedToggle section below)
- Depending on the layout configuration and on the current state of the expansion toggle, it decides what component to render.
- Depending on the type specification for the given key, it restricts the changes that a contributor can make to the value.
- It allows changing the mode of the value, between literal ZObject, a referenced ZObject, or a ZObject produced by a function call. (See ModeSelector section below)
- It handles changes in the value by catching and handling
set-value
andset-type
events from the value. (See Data modification events section below)
The ZObjectKeyValue
component acts as the main functional node for the whole tree, while the typed components just handle the rendering of the HTML elements.
Every ZObjectKeyValue component will render:
- ExpandedToggle component
- ModeSelector component
- LocalizedLabel component
- A dynamically rendered component for the value. This component may be terminal, or a continuation of the component tree.
ExpandedToggle
This component precedes every key-value, and it is a button with three states:
- Bullet point: The value for this key doesn't have a double state (collapsed and expanded views). This can be either because the type doesn't have a built-in component and will always be rendered with the fallback
ZObjectKeyValueSet
, or because it has a built-in component but the layout configuration specifies that this component should nevery be expanded and shown usingZObjectKeyValueSet
. - Collapsed, or right chevron: The value for this key is rendered with its collapsed view, which is a builtin component specific for its type. By clicking it, it will switch to expanded.
- Expanded, or down chevron: The value for this key has a collapsed view (or a builtin component for its type), but it's currently shown in its expanded view (with the fallback
ZObjectKeyValueSet
component). By clicking it, it will switch to collapsed.
ModeSelector

Even when a given key must contain a value of a bound type (E.g. the key Z11K1 must only contain values of type Language/Z60), this value could be passed in different ways (or modes):
- The value can be a literal object of the required type.
- The value can be a link (or a reference) to an object of the required type.
- The value can be a function call that returns an object of the required type.
- Inside an implementation composition, the value can be a reference to one of the inputs passed when calling this function.
The ModeSelector
component follows every key, and is a button with the icon of an ellipsis ...
, with a dropdown menu with all the possible representations of the value. Clicking on any of these options, will fully change the shape of the value under this key to the selected one.
The available values are specific to the key, its required type and its context. This component is not rendered when:
- It is a Read page.
- The key is hidden in the parent
ZObjectKeyValue
component by settingskipKey=true
.
Additionally to the mode editing options, when the key belongs to a list item, it adds additional menu options to:
- delete this item from the list,
- move this item up in the list, and
- move this item down in the list.
ZObjectKeyValueSet
The ZObjectKeyValueSet
component renders the collection of key-value pairs of a ZObject. Whenever showing a given ZObject using this component, it will iterate through all its keys, and render a ZObjectKeyValue
component for each one of them.
This component is the fallback option when:
- There is no builtin component associated with its type. E.g. An object of type Key/Z3 has no builtin component, so it will be rendered using
ZObjectKeyValueSet
, which will render aZObjectKeyValue
for each of its keys (Z1K1, Z3K1, Z3K2 and Z3K3). - There is a builtin component for this type, but the
ZObjectKeyValue
component is on expanded mode.
Typed components
Some common types have their own builtin components that understand the existing keys, can initialize values, and can render HTML elements that allow for easy viewing and editing of their values.
The components ZString
and ZReference
are terminal, and hence will not allow further expansion into ZObjectKeyValueSet
. All the other typed components can be switched to expanded mode.
Every typed component should have as input properties:
- keyPath: which contains a string representation of the path of keys up to this value. This will be mostly used for mutation operations, which are handled by the
zobject.js
store actions, and need a full path to reach the target object. - objectValue: a reference to the ZObject node in the store. This will be used for reading and extracting the relevant values of each ZObject in order to build the appropriate template.
Every typed component should at least:
- Implement a template that adapts to both Read and Edit pages.
- Use the utility functions provided in the
zobjectMixin.js
to extract the necessary values from the objectValue object. - React to change events in the relevant template elements, and emit
setValue
events with the correct payload, so that theZObjectKeyValue
parent component updates the state. - Additionally, any typed component should be able to handle an empty state.
For a good example, we can take a look at the ZMonolingualString
component. The following figures show a list of Monolingual string/Z11 objects. The one for the Edit page also showcases the component blank state:
Read page | Edit source page |
![]() |
![]() |
This is how the ZMonolingualString
component solves the points listed above:
- The template adds a chip for the language ISO code (corresponds to the key Z11K1), and a text for the string value (corresponds to the key Z11K2) for Read mode. In Edit mode, the string value is instead shown in an Input component, for it to be editable.
- The utility function
getZMonolingualTextValue( objectValue )
returns the terminal value of the Language/Z11K1 key, which is used to build the language chip element. The utility functiongetZMonolingualTextValue( objectValue )
returns the value of the Text/Z11K2 key, which is set as the text or input field in the template. - The component observes changes in the input field, and when it changes, it emits the event
setValue
with the whole keyPath and the new value to set. The whole keyPath is built by concatenating the component keyPath (e.g.'main.Z2K3.Z12K1.1'
) and the partial keyPath that describes the particular inner change (e.g.'Z11K2.Z6K1'
):{ keyPath: 'main.Z2K3.Z12K1.1.Z11K2.Z6K1', value: "new value" }
- The blank state of the monolingual string has a special style as seen in the image.
The Component Tree
Let's look at an example of the component tree putting all of these together. Assuming a Persistent Object/Z2 containing a Monolingual text/Z11 as shown below (only the content key, for simplicity):
{
"Z2K2": {
"Z1K1": "Z11",
"Z11K1": "Z1002",
"Z11K2": "new string"
}
}
This is the tree of components that would be rendered:
ZObjectKeyValue
component for the keyZ2K2
:- properties:
- key:
Z2K2
- expected type for key: Object/Z1 (anything)
- value type: Monolingual text/Z11
- key:
- component rendered for the value:
ZMonolingualString
component, if expanded is false, orZObjectKeyValueSet
component, if expanded is true.ZObjectKeyValue
component for the keyZ1K1
- properties:
- key:
Z1K1
- expected type for key: Type/Z4
- value type: Reference/Z9
- key:
- component rendered for the value:
ZReference
component
- properties:
ZObjectKeyValue
component for the keyZ11K1
- properties:
- key:
Z11K1
- expected type for key: Language/Z60
- value type: Reference/Z9
- key:
- component rendered for the value:
ZReference
component
- properties:
ZObjectKeyValue
component for the keyZ11K2
- properties:
- key:
Z11K2
- expected type for key: String/Z6
- value type: String/Z6
- key:
- component rendered for the value:
ZString
component
- properties:
- properties:
Data modification events
When a template component in edit mode detects an update in one of its input fields, it emits a mutation event that is then handled by its parent ZObjectKeyValue
component who, as explained above, contains all the state modification logic and calls the state mutation actions. There are two mutation events that are handled by this component:
set-value
event: Thrown by every component whenever a value is being changed. While handling this event, theZObjectKeyValue
component will make the required mutation using thesetValueByKeyPath
action and, additionally, make different alterations depending on the type or key updated. For example, when the value of a Function Call Function/Z7K1 key changes, it will also remove the old function call arguments (if any) and set the new ones for the newly updated Function Call Function Id.
set-type
event: Mainly thrown by the Mode Selector component, which handles type modifications of each key between its literal type or any of the other resolver types (function call, reference, or argument reference). Any type mutations requires a special behavior, as it should initialize the object with a blank version of the given type.
Widgets
Page widgets are independent components that are part of the Views and provide an enrich experience to the main representation of the ZObject content. All Widgets are stored in the components/widgets directory, and use the base component Widget Base as base component.
About widget



The About widget is present in all view and edit pages, except for the Function Editor. It provides a way to view, navigate and edit multilingual information to the page ZObject.
When in the Function Viewer page, the About widget also displays information about the function inputs, their types and labels, and the function output type. Similarly, the About widget from the Function page also allows editing or adding input labels.
On load, the About widget will display as many languages as necessary to cover the ZObject information in the user's language or closest fallback languages. For example, if the whole information (name, description, aliases, input labels) is available in the user's language, the widget will present one language block with the user language. However, if the user's language information is incomplete, the About widget will be initialized with both the user's language block and the next fallback language which contains name, description, aliases and input labels for the object. Additionally, the user can select any other languages to add to the display.
Even when the page is in Read mode, the About widget allows edition of multilingual data. However, the edit and submission flows are slightly different:
- When in Edit mode:
- Language blocks are shown in an editable form—with editable input fields.
- Name, description, aliases and input labels can be edited cumulatively.
- More languages can be added to the display, by clicking on the "n languages" button and selecting a new language (with or without data.)
- Only when clicking the page "Publish" button, all the changes will be submitted.
- When in Read mode:
- Language blocks are shown in a readable form—with text instead of fields.
- Each language block has an "edit" (pencil) icon that sets the block state to its editable mode—with editable input fields. A "Cancel" and a "Publish" button will appear in the widget header.
- Users can make changes to the multilingual data without leaving the Read page.
- Once the edits are done, users can press the widget "Publish" button, which will trigger a publishing dialog asking for the change summary.
Publish widget
The Publish widget is rendered in all edit pages and initiates validation, transformation and submission of edited or newly created ZObject. It is formed by the components:
Publish.vue
: The base widget which renders the Cancel and Publish buttons. The "Publish" button is initially disabled, and is enabled only when changes are observed. It also triggers the validateZObject action when this button is clicked.PublishDialog.vue
: Dialog component that's shown if the validation is passed successfully. Displays any warning messages that might be relevant to the user's edit, the text field to add a publish summary, and the final submission or cancellation buttons. This triggers the final ZObject transformations and submission as detailed in the transformations section. If the submission is unsuccessful, this dialog will show any errors returned by the edit API.
Function Evaluator widget

The Function Evaluator widget is shown in the Function Viewer page, and in the edit and view pages for Test/Z20 and Implementation/Z14 objects. It allows the user to try the function relevant to the page, as long as the Function is runnable (it has attached implementations) and the user has the right execute permissions.
The Function Evaluator widget runs the preferred implementation of the given function, except when in the Implementation view or edit page. In these cases, the Function Evaluator widget runs the particular Implementation represented in the page.
The widget uses the ZObjectKeyValue.vue
default component which to create a component representation of both the function call and the returned result, stored under the namespaces of call
and response
, respectively.
The store module functionCall.js contains the actions necessary to initialize the widget and perform the function call.
Function Explorer widget
The Function Explorer widget allows users to see details of a Function definition, explore existing persisted Functions and see relevant details while writing an Implementation.
The widget is shown in the Read and Edit pages for Implementation/Z14 and Test/Z20 objects, and it has two different modes:
- In Read mode: the widget shows information of the current Implementation's target Function. E.g. If we are viewing an Implementation for the function "If", the Function explorer shows the signature details of the function "If".
- In Edit mode: the widget renders a search box where the user can search and select already existing functions, and see their signature details.
Function Report widget
The Function Report widget displays the current Test/Implementation status for the current Function. This widget is rendered in the Read and Edit pages for Implementation/Z14 and Test/Z20 objects:
- In an Implementation/Z14 page: The Function Report widget shows the state of all the available Tests of the current function, running against the given Implementation.
- In a Test/Z20 page: The Function Report widget shows the state of all the available Implementations for the current function, running the given Test.