Vuex Actions
Last updated
Last updated
⇒ boolean
is uri page spectific
static
⇒ promise
⇒ promise
⇒ Promise
⇒ Promise
⇒ Promise
⇒ Promise
⇒ Promise
⇒ Promise
inner
⇒ Promise
⇒ Promise
⇒ number
⇒ Promise
⇒ Promise
⇒ Promise
update a property value on a component schema
Param
Type
store
object
schemaName
string
inputName
string
prop
string
value
object
| string
| number
promise
trigger a the model.save of a component
Param
Type
uri
string
data
object
promise
trigger a the model.render of a component
Param
Type
store
object
uri
string
data
object
Promise
save a component's data and re-render
Param
Type
Description
store
object
uri
string
data
object
(may be a subset of the data)
[eventID]
string
when saving from a pubsub subscription
[snapshot]
boolean
set to false if save is triggered by undo/redo
[prevData]
object
manually passed in when undoing/redoing (because the store has already been updated)
forceSave
boolean
if true, component will be saved even if it doesn't appear to have changed
Promise
remove a component from its parent note: removes from parent component OR page
Param
Type
Description
store
object
data
Element
el
{el, msg} where el is the component to delete
Promise
remove head components (from page or layout)
Param
Type
Description
store
object
startNode
Node
comment with data-uri
Promise
add components to a page area
Param
Type
store
object
newComponents
array
currentURI
string
path
string
replace
boolean
number
index
array
data
boolean
forceRender
Promise
add components to a parent component (or page) note: allows multiple components to be added at once note: always creates new instances of the components you're adding note: allows you to replace a specific uri, or add components after it note: if no currentURI passed in, it will add new components to the end (and won't replace anything)
Param
Type
Description
store
object
[currentURI]
string
if adding after / replacing a specific component
parentURI
string
path
string
[replace]
boolean
to replace the current URI
components
array
to add (object with name and [data])
Promise
open the add components pane, or add a new components
Param
Type
Description
store
object
[currentURI]
string
if we're inserting after a specific component
parentURI
string
path
string
Store the last item added
Param
Type
store
object
componentName
string
uri
string
Close the add component
Param
Type
store
object
open the add components pane, or add a new components
Param
Type
Description
store
object
restoring
boolean
if we're currently restoring a page
log errors when components save and display them to the user
Param
Type
uri
string
e
Error
data
object
[eventID]
string
[snapshot]
boolean
store
object
Promise
re-render (reverting) a component and stop the saving promise chain
Param
Type
uri
string
data
object
[snapshot]
boolean
paths
array
store
object
Promise
save data client-side and queue up api call for the server note: this uses the components' model.js (if it exists) and handlebars template note: server-side saving and/or re-rendering has been removed in kiln v4.x
Param
Type
Description
uri
string
data
object
oldData
object
store
object
[eventID]
string
[snapshot]
boolean
passed through to render
paths
array
number
find the index of a uri in a list this is broken out into a separate function so we don't assume an index of 0 is falsy
Param
Type
data
array
[uri]
string
Promise
add one or more components to a component list
Param
Type
Description
store
object
data
array
list data
[currentURI]
string
if you want to add after / replace a specific current component
parentURI
string
path
string
of the list
[replace]
boolean
to replace currentURI
components
array
with { name, [data] }
Promise
replace a single component in another component's property
Param
Type
Description
store
object
data
object
parentURI
string
path
string
components
array
note: it'll only replace using the first thing in this array
Promise
create components to be added to a page area (i.e. head, main, etc.)
Param
Type
store
object
currentURI
string
path
string
replace
boolean
components
array
unselect currently-selected component
Param
Type
store
object
select a component
Param
Type
store
object
el
element
Scroll user to the component. "Weeee!" or "What the?"
Param
Type
store
object
el
Element
Promise
navigate to the previous or next component
Param
Type
Description
store
object
direction
string
'prev' or 'next'
Promise
unfocus currently-focused field/group
Param
Type
store
object
Promise
parse url hash, opening form or clay menu as necessary
Param
Type
store
object
set hash in window and store
Param
Type
commit
function
[uri]
string
[path]
string
[initialFocus]
string
[menu]
object
clear hash in window and store
Param
Type
commit
function
close drawer without toggling a new drawer
Param
Type
store
Object
open drawer
Param
Type
Description
store
Object
nameOrConfig
string
| object
either just the tab name or a json object for deeper linking
static
inner
Update form data
Param
Type
store
object
path
string
val
string
| number
open form
Param
Type
Description
store
object
uri
string
component uri
path
string
field/form path
[el]
Element
parent element (for inline forms)
[offset]
number
caret offset (for text inputs)
[appendText]
string
text to append (for text inputs, used when splitting/merging components with text fields)
[initialFocus]
string
if focusing on a specific field when opening the form
pos
object
x/y coordinates used to position overlay forms
promise
Close a form
Param
Type
store
object
Boolean
determine if data in form has changed note: convert data to plain objects, since they're reactive
Param
Type
Description
newData
object
from form
oldData
object
from store
Promise
get the list data for a specific layout note: if prefix / uri is specified, this does NOT commit the data (only returns it), allowing the preloader to use it when doing the initial preload of data
Param
Type
store
object
[preloadOptions]
object
[preloadOptions.uri]
string
[preloadOptions.prefix]
string
[preloadOptions.user]
object
Promise
update a layout's title, or just the latest timestamp + user
Param
Type
store
object
[data]
object
[data.title]
string
[preloadOptions]
object
Promise
schedule the layout and update its index
Param
Type
store
object
timestamp
Date
Promise
unschedule the layout get updated layout state if the call wasn't made during layout publish
Param
Type
store
object
[publishing]
Boolean
Promise
publish layout note: layouts index is updated server-side, including unscheduling the layout if it's currently scheduled also note: this will trigger a fetch of the updated (published) layout state
Param
Type
store
object
open nav tab
Param
Type
Description
store
object
nameOrConfig
string
| object
tab name, or clay menu config openNav sets the ui.currentDrawer vuex variable, this allows drawers (the right slide-in menus) as well as the "nav" (the left slide-in menu) to be deep linked to. The openNav/closeNav are functions are depreciated. Should use the openDrawer/closeDrawer/toggleDrawer actions Just leaving these here in case any legacy plugins are still calling these functions
static
inner
Promise
save a page's data, but do not re-render because, uh, that would just be reloading the page
Param
Type
Description
store
object
data
*
to save
[snapshot]
boolean
false if we're undoing/redoing
Promise
create a new page, then return its editable link
Param
Type
store
object
id
string
set currentlyPublishing in state
Param
Type
store
object
isPublishing
boolean
Promise
manually publish the page
Param
Type
store
object
uri
string
Promise
remove uri from /uris/
Param
Type
store
object
uri
string
Promise
schedule the page to publish
Param
Type
store
object
uri
string
timestamp
Date
Promise
unschedule the page get updated page state if the call wasn't made during a page publish
Param
Type
store
object
[publishing]
Boolean
boolean
iterate through the paths we're saving if one of them ISN'T in the internalPageProps, we should re-render
Param
Type
paths
array
Promise
remove uri from /uris/
Param
Type
uri
String
store
Object
static
inner
Promise
update page list with data provided from pubsub note: if called without data, this just updates the updateTime and user (e.g. when saving components in the page) note: if called with a user, it adds the user (with updateTime) to the page (instead of current user)
Param
Type
store
object
[data]
object
Promise
get the list data for a specific page note: if prefix is specified, this does NOT commit the data (only returns it), allowing the preloader to use it when doing the initial preload of data
Param
Type
Description
store
object
uri
string
[prefix]
string
passed in when preloading (e.g. if site isn't in store yet)
Promise
run page list updates sequentially, grabbing from the store after each to prevent race conditions
Param
Type
prefix
string
uri
string
data
object
object
get component models so we can mount them on window.kiln.componentModels if they aren't already mounted (backwards-compatability)
object
get component kiln files so we can mount them on window.kiln.componentKilnjs
obj
extract component data from preloadData obj
Param
Type
result
obj
val
obj
object
extract layout data from original data
Param
Type
Description
layoutSchema
object
schema for layout
components
object
key/value store of components
original
object
original preloaded data
obj
make precompiled hbs templates ready for user
Param
Type
result
obj
val
obj
key
string
string
get string state to pass to progress bar
Param
Type
state
object
object
run a copy of the schema through its kiln.js file (if it has one)
Param
Type
schemas
object
kilnjs
function
start progress bar. if already started, this will cause a slight pause before continuing the progress bar
Param
Type
Description
commit
function
type
string
e.g. 'save' or 'publish'
finish the progress bar.
Param
Type
Description
commit
function
type
string
e.g. 'save' or 'publish'
add alert to the array
Param
Type
Description
store
object
config
string
| object
the text of the alert (for info), or an object with { type, text }
remove an alert from the array, specifying the index
Param
Type
Description
store
object
config
number
| object
index or an equivalent config object
trigger a new snackbar. note: this happens imperatively (toolbar handles the actual creation, by watching this value) note: if you want the snackbar to have an action, pass in both action
(the text of the button) and onActionClick
(a reference to the function you want invoked)
Param
Type
Description
store
object
config
string
| object
message or full config object
static
inner
create snapshot. called from the plugin listening to batched renders
Param
Type
store
object
"You're a fixed point in time and space. You're a fact. That's never meant to happen." when doing a manual save from some point in history, we need to remove snapshots after that point (to preserve the expected undo functionality)
Param
Type
store
object
undo: sets cursor back one, re-saves affected components with old data
Param
Type
store
object
redo: sets cursor forward one, re-saves affected components with new data
Param
Type
store
object
object
get changed components, used by undo and redo
Param
Type
Description
current
object
compare
object
(prev/next components object)
render multiple components at once
Param
Type
changedComponents
object
store
object
static
inner
function
run an metadata validator. if it returns items, add the label and description and items
Param
Type
metadata
object
Promise
run a list of validators using page metadata
Param
Type
Description
uri
uri
page uri
errorValidators
array
validators for errors
warningValidators
array
validators for warnings
array
Run the kilnjsValidators
Param
Type
schemas
object
components
object
object
Get the schemas that have a validation property
Param
Type
schemas
object
boolean
Check whether is a metadata error
Param
Type
scope
string
type
string
boolean
Check whether is a metadata warning
Param
Type
scope
string
type
string
boolean
Check whether is a metadata error
Param
Type
validator
object
validator.scope
string
validator.type
string
validator.uri
string
boolean
Check whether is a metadata error
Param
Type
validator
object
validator.scope
string
validator.type
string
validator.uri
string
boolean
Check whether is a metadata warning for specific page
Param
Type
validator
object
validator.scope
string
validator.type
string
validator.uri
string
pageUri
string
boolean
Check whether is a metadata error for specific page
Param
Type
validator
object
validator.scope
string
validator.type
string
validator.uri
string
pageUri
string
Promise
trigger validation
Param
Type
store
object
Boolean
determine if a component is in a page-specific head list
Param
Type
uri
string
state
object
function
run an individual validator. if it returns items, add the label and description
Param
Type
state
object
Promise
run a list of validators
Param
Type
validators
array
state
object
Boolean
make sure that all errors have items that can display. some may have been parsed out by the isActive check in runValidator, above
Param
Type
error
object
boolean
Check if the validationRule has the correct properties to run validation with
Param
Type
validators
object
validationRule
object
object
Get the inputs from a validationRule, either as a string or as an array the fieldName is the name of the input that will have the focus when the user clicks to that error from the Health Tab the value is what will be tested by the rule
Param
Type
validationRule
object
component
object
array
Add error to Errors, either as a completely new error, or as an entry in an existing error
Param
Type
validationError
object
errorItem
object
errors
array
boolean
is uri page spectific
Kind: global function
Param
Type
uri
string
store
object
Kind: static method of Return{promise}:
Kind: static method of
Kind: static method of
Kind: static method of
Kind: static method of
Kind: static method of
Kind: static method of
Kind: static method of
Returns: Promise
- with the last added component's el
Kind: static method of
Kind: static method of
Kind: static method of
Kind: static method of
Kind: inner method of
Kind: inner method of
Kind: inner method of
Kind: inner method of
Kind: inner method of
Kind: inner method of
Kind: inner method of
⇒ Promise
⇒ Promise
Kind: static method of
Kind: static method of
Kind: static method of
Kind: static method of
Kind: static method of
⇒ Promise
Kind: static method of
Kind: static method of
Kind: static method of
Kind: static method of
Kind: static method of
⇒ promise
⇒ Boolean
Kind: static method of
Kind: static method of
Kind: static method of
Kind: inner method of
⇒ Promise
⇒ Promise
⇒ Promise
⇒ Promise
⇒ Promise
Kind: static method of
Kind: static method of
Kind: static method of
Kind: static method of
Kind: static method of
Kind: static method of
⇒ Promise
⇒ Promise
⇒ Promise
⇒ Promise
⇒ Promise
⇒ Promise
⇒ boolean
⇒ Promise
Kind: static method of
Kind: static method of
Kind: static method of
Kind: static method of
Kind: static method of
Kind: static method of
Kind: static method of
Kind: inner method of
Kind: inner method of
⇒ Promise
⇒ Promise
⇒ Promise
Kind: static method of
Kind: static method of
Kind: inner method of
⇒ object
⇒ object
⇒ obj
⇒ object
⇒ obj
⇒ string
⇒ object
Kind: inner method of
Kind: inner method of
Kind: inner method of
Kind: inner method of
Kind: inner method of
Kind: inner method of
Kind: inner method of
Kind: static method of
Kind: static method of
Kind: static method of
Kind: static method of
Kind: static method of
⇒ object
Kind: static method of
Kind: static method of
Kind: static method of
Kind: static method of
Kind: inner method of
Kind: inner method of
⇒ function
⇒ Promise
⇒ array
⇒ object
⇒ boolean
⇒ boolean
⇒ boolean
⇒ boolean
⇒ boolean
⇒ boolean
⇒ Promise
⇒ Boolean
⇒ function
⇒ Promise
⇒ Boolean
⇒ boolean
⇒ object
⇒ array
Kind: static method of
Kind: static method of
Kind: static method of
Kind: static method of
Kind: static method of
Kind: static method of
Kind: static method of
Kind: static method of
Kind: static method of
Kind: static method of
Kind: static method of
Kind: inner method of
Kind: inner method of
Kind: inner method of
Kind: inner method of
Kind: inner method of
Kind: inner method of
Kind: inner method of