1.0.0-beta.37
·
1126 commits
to master
since this release
- Extended
preparehandler to take extension API as a second parameter. For now API contains following methods:addValueAnnotation()to define a value annotation used mostly instructview. The first argument should be a handler: a function or a string query. Handler takes a value and context, which contains properties:host(an object or an array that includes a value),key,indexandparent(a reference to parent context). The handler should return falsy value (when no annotation needed) or an object with following fields (all fields are optional):place–'after'(by default) or'before', where to place annotation before or after a valuestyle–'default'(by default),'none'(no any visual styles for annotation block) or'badge'(uses for object markers)className- additional CSS classes that should be added to annotation blocktext– annotation texttitle– value fortitleattributeicon- url, dataURI or class name withicon-prefixhref- annotation is a linkexternal- when annotation is a link, open in new window when true
defineObjectMarker(name, options)to define an object marker, which returns a function to wrap objects, i.e.object.forEach(defineObjectMarker('foo', { /* options */ })). Options (all are optional):refs– a list of string (a field name) or function (getter), which values should refer to an object beside direct reference to object. Uses for unique object values, e.g.idlookupRefs- a list of string (a field name) or function (getter), that uses to retrieve additional values to identify original objectpage- a string, marker should be a link to specified pageref- a string (a field name) or a function (getter), a value that uses in link to page to identify objecttitle- astring (a field name) or a function (getter), a text that represent an object, e.g. inauto-link
addQueryHelpers()method the same asWidget#addQueryHelpers()
- Added a set of default methods:
marker(type?)– returns any marker associated with a value, whentypeis specified only this type of marker may be returnedmarkerAll()– returns all markers associated with a value
- Removed
Widget#addEntityResolver()method, usedefineObjectMarker()instead - Removed
Widget#addValueLinkResolver()method, usedefineObjectMarker()withpageoption instead - Removed
Widget#addQueryHelpers()method, useaddQueryHelpers()instead - Removed
resolveLinkoption forpage.define(), usepageoption indefineObjectMarker()instead