Vuex Actions

Modules

component-datadecoratorsdeep-linkingdrawersformslayout-statelistsnavpage-datapage-statepreloadertoolbarundovalidators

Functions

isPageSpecific(uri, store)boolean

is uri page spectific

component-data

component-data.updateSchemaProp(store, schemaName, inputName, prop, value)

update a property value on a component schema

Kind: static method of component-data Return{promise}:

component-data.triggerModelSave(uri, data) ⇒ promise

trigger a the model.save of a component

Kind: static method of component-data

component-data.triggerModelRender(store, uri, data) ⇒ promise

trigger a the model.render of a component

Kind: static method of component-data

component-data.saveComponent(store, uri, data, [eventID], [snapshot], [prevData], forceSave) ⇒ Promise

save a component's data and re-render

Kind: static method of component-data

component-data.removeComponent(store, data) ⇒ Promise

remove a component from its parent note: removes from parent component OR page

Kind: static method of component-data

component-data.removeHeadComponent(store, startNode) ⇒ Promise

remove head components (from page or layout)

Kind: static method of component-data

component-data.addCreatedComponentsToPageArea(store, newComponents, currentURI, path, replace, number, array, boolean) ⇒ Promise

add components to a page area

Kind: static method of component-data

component-data.addComponents(store, [currentURI], parentURI, path, [replace], components) ⇒ 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)

Kind: static method of component-data Returns: Promise - with the last added component's el

component-data.openAddComponent(store, [currentURI], parentURI, path) ⇒ Promise

open the add components pane, or add a new components

Kind: static method of component-data

component-data.componentAdded(store, componentName, uri)

Store the last item added

Kind: static method of component-data

component-data.closeAddComponent(store)

Close the add component

Kind: static method of component-data

component-data.currentlyRestoring(store, restoring)

open the add components pane, or add a new components

Kind: static method of component-data

component-data~logSaveError(uri, e, data, [eventID], [snapshot], store)

log errors when components save and display them to the user

Kind: inner method of component-data

component-data~revertReject(uri, data, [snapshot], paths, store) ⇒ Promise

re-render (reverting) a component and stop the saving promise chain

Kind: inner method of component-data

component-data~clientSave(uri, data, oldData, store, [eventID], [snapshot], paths) ⇒ 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

Kind: inner method of component-data

component-data~findIndex(data, [uri]) ⇒ 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

Kind: inner method of component-data

component-data~addComponentsToComponentList(store, data, [currentURI], parentURI, path, [replace], components) ⇒ Promise

add one or more components to a component list

Kind: inner method of component-data

component-data~addComponentsToComponentProp(store, data, parentURI, path, components) ⇒ Promise

replace a single component in another component's property

Kind: inner method of component-data

component-data~addComponentsToPageArea(store, currentURI, path, replace, components) ⇒ Promise

create components to be added to a page area (i.e. head, main, etc.)

Kind: inner method of component-data

decorators

decorators.unselect(store)

unselect currently-selected component

Kind: static method of decorators

decorators.select(store, el)

select a component

Kind: static method of decorators

decorators.scrollToComponent(store, el)

Scroll user to the component. "Weeee!" or "What the?"

Kind: static method of decorators

decorators.navigateComponents(store, direction) ⇒ Promise

navigate to the previous or next component

Kind: static method of decorators

decorators.unfocus(store) ⇒ Promise

unfocus currently-focused field/group

Kind: static method of decorators

deep-linking

deep-linking.parseURLHash(store) ⇒ Promise

parse url hash, opening form or clay menu as necessary

Kind: static method of deep-linking

deep-linking.setHash(commit, [uri], [path], [initialFocus], [menu])

set hash in window and store

Kind: static method of deep-linking

deep-linking.clearHash(commit)

clear hash in window and store

Kind: static method of deep-linking

drawers

drawers.closeDrawer(store)

close drawer without toggling a new drawer

Kind: static method of drawers

drawers.openDrawer(store, nameOrConfig)

open drawer

Kind: static method of drawers

forms

forms.updateFormData(store, path, val)

Update form data

Kind: static method of forms

forms.openForm(store, uri, path, [el], [offset], [appendText], [initialFocus], pos)

open form

Kind: static method of forms

forms.closeForm(store) ⇒ promise

Close a form

Kind: static method of forms

forms~hasDataChanged(newData, oldData) ⇒ Boolean

determine if data in form has changed note: convert data to plain objects, since they're reactive

Kind: inner method of forms

layout-state

layout-state.fetchLayoutState(store, [preloadOptions]) ⇒ 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

Kind: static method of layout-state

layout-state.updateLayout(store, [data], [preloadOptions]) ⇒ Promise

update a layout's title, or just the latest timestamp + user

Kind: static method of layout-state

layout-state.scheduleLayout(store, timestamp) ⇒ Promise

schedule the layout and update its index

Kind: static method of layout-state

layout-state.unscheduleLayout(store, [publishing]) ⇒ Promise

unschedule the layout get updated layout state if the call wasn't made during layout publish

Kind: static method of layout-state

layout-state.publishLayout(store) ⇒ 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

Kind: static method of layout-state

lists

open nav tab

Kind: static method of nav

page-data

page-data.savePage(store, data, [snapshot]) ⇒ Promise

save a page's data, but do not re-render because, uh, that would just be reloading the page

Kind: static method of page-data

page-data.createPage(store, id) ⇒ Promise

create a new page, then return its editable link

Kind: static method of page-data

page-data.isPublishing(store, isPublishing)

set currentlyPublishing in state

Kind: static method of page-data

page-data.publishPage(store, uri) ⇒ Promise

manually publish the page

Kind: static method of page-data

page-data.unpublishPage(store, uri) ⇒ Promise

remove uri from /uris/

Kind: static method of page-data

page-data.schedulePage(store, uri, timestamp) ⇒ Promise

schedule the page to publish

Kind: static method of page-data

page-data.unschedulePage(store, [publishing]) ⇒ Promise

unschedule the page get updated page state if the call wasn't made during a page publish

Kind: static method of page-data

page-data~shouldRender(paths) ⇒ boolean

iterate through the paths we're saving if one of them ISN'T in the internalPageProps, we should re-render

Kind: inner method of page-data

page-data~removeURI(uri, store) ⇒ Promise

remove uri from /uris/

Kind: inner method of page-data

page-state

page-state.updatePageList(store, [data]) ⇒ 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)

Kind: static method of page-state

page-state.getListData(store, uri, [prefix]) ⇒ 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

Kind: static method of page-state

page-state~sequentialUpdate(prefix, uri, data) ⇒ Promise

run page list updates sequentially, grabbing from the store after each to prevent race conditions

Kind: inner method of page-state

preloader

preloader~getComponentModels() ⇒ object

get component models so we can mount them on window.kiln.componentModels if they aren't already mounted (backwards-compatability)

Kind: inner method of preloader

preloader~getComponentKilnjs() ⇒ object

get component kiln files so we can mount them on window.kiln.componentKilnjs

Kind: inner method of preloader

preloader~reduceComponents(result, val) ⇒ obj

extract component data from preloadData obj

Kind: inner method of preloader

preloader~composeLayoutData(layoutSchema, components, original) ⇒ object

extract layout data from original data

Kind: inner method of preloader

preloader~reduceTemplates(result, val, key) ⇒ obj

make precompiled hbs templates ready for user

Kind: inner method of preloader

preloader~getPageStatus(state) ⇒ string

get string state to pass to progress bar

Kind: inner method of preloader

preloader~getSchemas(schemas, kilnjs) ⇒ object

run a copy of the schema through its kiln.js file (if it has one)

Kind: inner method of preloader

toolbar

toolbar.startProgress(commit, type)

start progress bar. if already started, this will cause a slight pause before continuing the progress bar

Kind: static method of toolbar

toolbar.finishProgress(commit, type)

finish the progress bar.

Kind: static method of toolbar

toolbar.addAlert(store, config)

add alert to the array

Kind: static method of toolbar

toolbar.removeAlert(store, config)

remove an alert from the array, specifying the index

Kind: static method of toolbar

toolbar.showSnackbar(store, config)

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)

Kind: static method of toolbar

undo

undo.createSnapshot(store)

create snapshot. called from the plugin listening to batched renders

Kind: static method of undo

undo.setFixedPoint(store)

"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)

Kind: static method of undo

undo.undo(store)

undo: sets cursor back one, re-saves affected components with old data

Kind: static method of undo

undo.redo(store)

redo: sets cursor forward one, re-saves affected components with new data

Kind: static method of undo

undo~getChangedComponents(current, compare) ⇒ object

get changed components, used by undo and redo

Kind: inner method of undo

undo~saveChangedComponents(changedComponents, store)

render multiple components at once

Kind: inner method of undo

validators

validators.runMetaValidator(metadata) ⇒ function

run an metadata validator. if it returns items, add the label and description and items

Kind: static method of validators

validators.runMetaValidators(uri, errorValidators, warningValidators) ⇒ Promise

run a list of validators using page metadata

Kind: static method of validators

validators.runKilnjsValidators(schemas, components) ⇒ array

Run the kilnjsValidators

Kind: static method of validators

validators.getSchemasWithValidationRules(schemas) ⇒ object

Get the schemas that have a validation property

Kind: static method of validators

validators.isMetadataError(scope, type) ⇒ boolean

Check whether is a metadata error

Kind: static method of validators

validators.isMetadataWarning(scope, type) ⇒ boolean

Check whether is a metadata warning

Kind: static method of validators

validators.isGlobalMetadataError(validator) ⇒ boolean

Check whether is a metadata error

Kind: static method of validators

validators.isGlobalMetadataWarning(validator) ⇒ boolean

Check whether is a metadata error

Kind: static method of validators

validators.isSpecificMetadataWarning(validator, pageUri) ⇒ boolean

Check whether is a metadata warning for specific page

Kind: static method of validators

validators.isSpecificMetadataError(validator, pageUri) ⇒ boolean

Check whether is a metadata error for specific page

Kind: static method of validators

validators.validate(store) ⇒ Promise

trigger validation

Kind: static method of validators

validators~isComponentInPageHeadList(uri, state) ⇒ Boolean

determine if a component is in a page-specific head list

Kind: inner method of validators

validators~runValidator(state) ⇒ function

run an individual validator. if it returns items, add the label and description

Kind: inner method of validators

validators~runValidators(validators, state) ⇒ Promise

run a list of validators

Kind: inner method of validators

validators~hasItems(error) ⇒ Boolean

make sure that all errors have items that can display. some may have been parsed out by the isActive check in runValidator, above

Kind: inner method of validators

validators~validKilnjsValidator(validators, validationRule) ⇒ boolean

Check if the validationRule has the correct properties to run validation with

Kind: inner method of validators

validators~getKilnJsFieldAndValue(validationRule, component) ⇒ 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

Kind: inner method of validators

validators~getKilnJsError(validationError, errorItem, errors) ⇒ array

Add error to Errors, either as a completely new error, or as an entry in an existing error

Kind: inner method of validators

isPageSpecific(uri, store) ⇒ boolean

is uri page spectific

Kind: global function

Last updated