Releases: discoveryjs/discovery
Releases · discoveryjs/discovery
1.0.0-beta.99
- Updated JSONXL:
- Fixed an edge case for signed numbers in the range ±[MAX_SAFE_INTEGER/2 … MAX_SAFE_INTEGER].
- Removed the limitation that could trigger when the total encoded string length exceeded the maximum string length (~500 MB in V8)
1.0.0-beta.98
Highlights
Enhanced computation graph on the Discovery page:
Preview for image-like content strings in the struct view, with new Jora methods and assertions to work with such values:
New Jora methods for JSON, and first-class support for errors:
First-in-class diff view – text-diff:
All the changes
- Bumped jora to 1.0.0-beta.15
- Added
addQueryMethods()andaddQueryAssertions()methods for setup and prepare API - Deprecated
addQueryHelpers(), useaddQueryMethods()instead - Enhancements for value types:
- JSON:
- Added
jsonSafeParse()andjsonSafeStringify()utility functions, which behave likeJSON.parse()andJSON.stringify()but return an error instead of throwing an exception - Added experimental Jora query methods:
jsonParse(),jsonStringify(), andjsonInfo()(the latter based onstringifyInfo()fromjson-ext)
- Added
- Errors:
- Added
isError()utility function, serving as an alias forError.isError()with a fallback if unavailable - Added
errorJora assertion, based onisError(), enabling support forexpr is errorin queries - Added support for displaying error values (where
isError()returnstrue) instructview
- Added
- Images:
- Added utility functions:
isImageContent()returnstrueif value is image-like content strings, e.g. base64-encoded raw content (JPEG, PNG, SVG, GIF or ICO) or SVG-like string, which can be prefixed withimage/*ordata:image/*getImageContent()returns{ type, content }for image-like content strings, ornullisImageDataUri()returnstrueif value is a string starting withdata:image/*,getImageDataUri()produces an image data URI string from a image-like content strings if possible, or returnsundefinedotherwiseisImageSrc()returntrueif value is a path or an URL, including image data URIgetImageSrc()returns value itself if it's already an image-like src, or attempts produce a data URI from image-like content strings, or returnundefinedotherwise
- Added utility functions:
isImageContent()returnstrueif the value is an image-like content string, e.g. base64-encoded raw content (JPEG, PNG, SVG, GIF, ICO) or an SVG-like string, optionally prefixed withimage/*ordata:image/*getImageContent()returns{ type, content }for image-like content strings, ornullif not applicableisImageDataUri()returnstrueif the value is a string starting withdata:image/*,getImageDataUri()produces an image data URI string from image-like content strings if possible, or returnsundefinedotherwiseisImageSrc()returnstrueif the value is a path or URL, including an image data URIgetImageSrc()returns the value itself if it is already an image-like src, or attempts to produce a data URI from image-like content strings; returnsundefinedotherwise
- Added Jora query assertions based on utilities above:
imagecontent,imagedatauriandimagesrc, e.g.expr is imagedatauri - Added Jora query methods:
imagecontent(),imagedatauri()andimagesrc() - Changed
imageview:- When
srcis not explicitly specified in the config and the input data is a string, the data value is processed throughimagesrc()and used as thesrc - Config entries with a value of
undefinedare ignored
- When
- Added a default image-like content string detection annotation in the
structview: when a string value is identified as image-like content, a badgeimageis displayed before the string, showing an image preview on hover
- Added utility functions:
- JSON:
- Added
text-diffview - Added support for
diffsyntax insourceview - Added
hideOnTriggerClickoption for popup and tooltip views - Reworked the computation graph on the discovery page and related features:
- Enhanced the look and feel of the graph
- Improved layout handling for complex graphs
- Added labels to graph nodes, showing a fragment of the node's query or the content of a comment on the first line if it starts with
//! - Added a "new root query" button
- Removed the graph path query stack view above the query editor
- Changed the "clone" and "stash" current query actions to insert a new node immediately after the current node
- Fixed overriding of the parent node’s view config on graph node deletion
- Fixed premature cancellation of a computing node when switching the current node during path computation if the node is part of the new extended path
- Fixed "Copy page as JSON" action to include the graph
- Various minor improvements and fixes
- Changed
tableview to hide footer if no footer cells contain any content - Fixed
tableview footer rendering when cell rendering is disabled using thewhenoption - Fixed
tableview to render the footer after the body. Although this change does not affect the visual presentation, it ensures proper selection of table content - Fixed an exception in
sourceview whenprefixorpostfixis neitherundefinednor a string - Fixed
expandview to ensureexpandedproperty is boolean - Fixed tooltip display with delayed showing by preventing it from appearing if the trigger element has been removed from the document
1.0.0-beta.97
- Updates for
tableview:- Added
table-headerandtable-footerviews - Added
table-header-cellview - Updates for
colsoption:- Added
alignoption for cells and footer - Extended
headerto accept a config object beside a string as a header cell text, including a query string, i.e.header: '=expr ? "foo" : "bar"' - Removed
headerClassNameoption, useheader: { className }instead
- Added
- Added
- Added a second parameter to
onTogglecallback calls inexpandview, providing an object{ el, finish, data, context } - Extended
limitoption for supported web views to accept an object with optional properties:{ start, startTolerance, base, tolerance } - Fixed blockquote kind detection in
markdownview
1.0.0-beta.96
- Fixed the "Show the rest" button on lists to correctly render all remaining elements, instead of just the next N. This regression was introduced in v1.0.0-beta.95
- Added
ViewModel#view.renderError(container, reason, config)method to render an error badge - Added
headerWhenandfooterWhenoptions fortableview to conditionally disable the rendering of the header and footer, respectively - Improved
tableview footer rendering to handle and display errors that occur during cell rendering, instead of silently failing with no output - Added
footeroption forcolsin text-basedtableview - Added
headerWhenandfooterWhenoptions for text-basedtableview - Improved performace for long list rendering with
ViewModel#view.renderList()method - Updated the
ViewModel#view.renderList()method to accept thelimitas a separate argument outside of theoptionsobject:
renderList(container, itemConfig, data, context, offset, limit, options)
1.0.0-beta.95 Introducing gzip/deflate support for input data
- Added built-in support for loading
gzipanddeflateencoded data. Encoding is detected by inspecting the payload header, enabling automatic decoding prior to standard data decoding or parsing. - Added
compressionfield inDatasetResourceobject - Added
useAcceptForFilePickeroption touploadextension, defaulting tofalse. Discovery.js supports a wide range of data formats and encodings, relying on file content rather than extensions. Since many supported files have extensions not effectively handled by theacceptattribute (due to its limited flexibility and inability to inspect file content) usingacceptoften causes more issues than it solves, and is now disabled by default. - Added support for
footeroption incolsdefinition oftableview (see Setup footer cell display) - Fixed displaying object values in the value column of
tableview, it was unexpandable (no details) since refactoring in1.0.0-beta.85 - Fixed sidebar re-rendering on page state changes
- Added
debouceoption forcontent-filterview (#108) - Extended
ViewModel#view.renderList()method to take optionsrenderList(container, itemConfig, data, context, offset, options), options is:type RenderListOptions = { limit: number | false; moreContainer: HTMLElement; onSliceRender: (restCount: number, offset: number, limit: number, totalCount: number) => void }
1.0.0-beta.94 Introducing text rendering
- Implemented experimental text-based rendering
- Added
Model#textViewdictionary which works the same way asViewModel#view, but manage text views - Added initial set of text views, including various blocks, lists,
tableandsource - Added
text-renderview, which renders text content defined bycontentoption - Added
textViewsexport, which provides a list of default text views - Added
Text renderbutton into view presets of view editor on Discovery page - Added a section for demostration of text views on Views showcase page
- Added
- Added
blockquoteview with akindoption supportingnote,tip,important,warning, andcaution. - Added support for alerts (a GitHub's Markdown extension based on the blockquote syntax) in
markdownview - Added
Model#getContext()method - Changed views to no longer treat some properties as a query:
checkedincheckboxviewexpandedinexpandviewdisabledintabviewtabsintabsview
- Changed views to normalize props for render:
checkbox,expand,tabsandtab - Fixed an issue in the
buttonview withhrefin embed mode, ensuring clicks are correctly intercepted so the app state updates as expected - Removed
ViewModel#queryToConfig()method
1.0.0-beta.93
- Added
navbuttons.uploadFromClipboardbutton - Added
marksoption forsourceview, which allows injecting visual or text marks at specific points in the source text - Renamed the
refsoption in thesourceview toranges - Updated the
typefield of entries in therangesoption (previouslyrefs) to be optional. If thehreffield is specified, thetypevalue defaults tolink; otherwise, it defaults tospaninstead ofspotlight. Thespotlighttype is now replaced byspan - Fixed default copy text button action in
sourceview - Changed
structview to avoid auto expading numeric arrays
1.0.0-beta.92
- Fixed missed render on
unloadDataevent whenmodelfreeextension is used - Added visual guide lines for expanded objects in
signatureview, similar tostructview - Added
actionCopySourceoption tosourceview to customise behaviour of "copy to clipboard" button - Fixed rendering of "copy to clipboard" button in
sourceview when a string is passed as data - Fixed
markdownviews to correctly settarget="_blank"for links when thehrefattribute contains an interpolated value - Added propagation of meaningful
sourceview props into nested views rendering (action buttons, prelude, and postlude) through the context assourceViewProps - Standardized monospace font size and line height in
struct,signatureandsourceviews to relay on root settings - Added suggestions toggle in query editor on "discovery" page
- Added view editor visibility toggle when in "custom" mode on "discovery" page
- Added
Cmd+ClickorCtrl+Clickin inspect mode to open hovered view page in view's showcase - Added
computeClassName()andapplyComputedClassName()methods to view render context API - Added root CSS properties:
--discovery-monospace-font-sizeand--discovery-monospace-line-height - Changes in page hash state API:
- Changed processing of page parameters so
!anchoris now treated aspageAnchor. Previously,!anchorwas included inpageParams, now it’s a separate value with its own property and event on theViewModelinstance - Updated
pageStateChangeevent to no longer fire when!anchorin the page hash changes, meaningViewModelwill not initiate a render on!anchorhash parameter changes - Removed
!anchorfromViewModel#pageParams - Added
ViewModel#pageAnchorto store the page’s anchor value (!anchor) ornull - Added
pageAnchorChangeevent forViewModel, which fires whenpageAnchorchanges - Changed
Model#encodePageHash()to acceptpageAnchoras the 4th parameter - Changed
Model#decodePageHash()to returnpageAnchor - Changed
ViewModel#setPage()andViewModel#setParams()to reset the anchor (pageAnchor) sincepageParamscan hold!anchoranymore - Added
ViewModel#setPageHashState(pageState, replace)andViewModel#setPageHashStateWithAnchor(pageStateWithAnchor, replace)methods - Added
ViewModel#overridePageHashState(pageState, replace)andViewModel#overridePageHashStateWithAnchor(pageStateWithAnchor, replace)methods - Added
ViewModel#getPageHashState()andViewModel#getPageHashStateWithAnchor()methods - Extended
ViewModel#setPageHash()to transform hashes starting with#!(e.g.#!{value}) into#{current-hash}&!anchor={value}. Note that a#!hash will reset the anchor (set tonull) but keep other values intact. This change doesn’t conflict with existing logic since a valid encoded anchor uses#&!anchor=... - Added
ViewModel#applyPageAnchor()method to apply currentpageAnchorto rendered page content - Updated the
pageLink()jora query helper to accept apageAnchorparameter - Embed API changes:
- Added
EmbedApp#setPageHashState()andEmbedApp#setPageHashStateWithAnchor()methods - Added
EmbedApp#setPageAnchor()method - Added
EmbedApp#pageAnchorobserver
- Added
- Changed processing of page parameters so
- Changes in
tableview:- Added
headerClassNameoption in col config which behaves the same way asclassNamebut applies to header cell - Added
view-table-header-cellclass to header cell elements - Fixed detail cells to toggle their state when clicked anywhere within the cell, including nested elements, unless the click event's propagation is stopped
- Added
- Changes in
inputview:- Added
htmlStepoption - Added props normalization
- Changed
valueoption to no longer be interpreted as a query
- Added
- Reworked color scheme API (
darkmode) for simplicity and alignment with recent CSS updates and the Embed API:- Renamed
DarkModeControllerclass toColorScheme - Renamed
ViewModeloptionsdarkmodeanddarkmodePersistenttocolorSchemeandcolorSchemePersistent(old options are still supported as fallbacks with a warning if the new options are not specified) - Renamed
ViewModel#darkmodetoViewModel#colorScheme - Renamed
navbuttons.darkmodeToggletonavbuttons.colorSchemeToggle - Changed
ColorScheme#valuefrombooleanto'light'or'dark' - Changed
ColorScheme#modevalues to'auto','manual'and'only' - Changed
ColorScheme#persistentto store a boolean, indicating whetherColorSchemeis backed by a persistent store - Added
ColorScheme#statewith possible values:'auto','light','light-only','dark'and'dark-only' - Changed change handler signature from
(value: boolean, mode: Mode) => voidto(value: ColorSchemeValue, mode: ColorSchemeState) => void - Aligned Embed API with the changes
- Renamed
- Reworked persistent API:
- Renamed
localStorageEntry()togetLocalStorageEntry() - Renamed
sessionStorageEntry()togetSessionStorageEntry() - Added
getLocalStorageValue(key)andgetSessionStorageValue(key)methods to read values directly from storage; these methods returnnullif no entry exists for the specifiedkeyor if the storage is unavailable - Changed storage entry to be an instance of
PersistentStorageEntryclass derived fromObserver
- Renamed
1.0.0-beta.91
- Changes related to
Model#context:- Added
contexttoModeloptions, allowing the model's context to be set and accessible from the beginning (available during setup and in extensions) - Added
Model#setContext(context, replace)method, which extends the current context with the provided value or replaces it ifreplaceistrue - Added
contextevent toModel, withprevContextandnextContextparameters, triggered when the context changes - Changed
Model#contextto be an accessor property, where the setter callsModel#setContext(value, true) - Changed
ViewModel#setData()to no longer accept acontextargument or change the context - Changed
ViewModel#setDataProgress()to no longer change the context, despite acceptingcontextargument - Updated
ViewModelto trigger a render when thecontextevent is fired
- Added
- Added
Model#legacyPreparereadonly property to indicate whether the legacypreparemethod is used or the newsetup()method - Updated
structview to define thesetStructViewAnnotationsaction when using the newsetup()method, allowing custom annotations to be specified across allstructviews - Updated
embedoption ofAppto accept a config - Added
EmbedApp#publicApi.notify(name, details)method for sending notifications - Introduced
onNotify(name, details)option in the embed extension to define a callback for handlingnotificationmessages from the embed host - Added
EmbedApp#publicApi.setLocationSync()method to simplify sync between the embed app and the host location, preventing potential pitfalls - Added
ViewModel#enforceScheduledRenders()to immediately execute scheduled renders - Changed
ViewModel#scheduleRender()to usesetTimeout()instead ofPromise.resolve()to ensure proper processing of event loop tasks, eliminating unnecessary renders - Changed
ViewModelinitialization to minimize unnecessary renders - Marked
ViewModel#renderPage(),ViewModel#renderSidebar(), andViewModel#renderPage()as private methods, as they are not intended for direct invocation anymore - Fixed
ViewModel#setPageParams()to normalize thehashby ensuring it starts with#, preventing unnecessary events; for example, passing#pageandpageinto the method will now consistently result in#pagebeing stored inViewModel#pageHash - Redesigned logging API, the changes allow to see the correct loaction of logging method call instead of a location inside of the
Model#log()method:- Added
Loggerclass to utils - Changed
Model#loggerto hold aLoggerinstance - Removed
Model#logLevel, useModel#logger.logLevelfor getting or setting the log level - Deprecated
Model#log()method, which do nothing but display an error:- Use
Model#logger[level](...args)instead ofModel#log('level', ...args) - Use
Model#logger[level].group(message, fn | array)orModel#logger[level].groupCollapsed(message, fn | array)instead ofModel#logger({ level, message, collapsed: fn | array })
- Use
- Added
1.0.0-beta.90
- Added
@discoveryjs/discovery/embedexport - Changed
applyContainerStyles()to take a singledarkmodevalue instead of "options", with supported values:true,false,'true','false','dark','light'and'auto' - Changed
applyContainerStyles()to avoid applying transition styles to the container, preventing unwanted flashes of opposite colors - Changed
sourceview to takesource,syntax,lineNum,refsandmaxSourceSizeToHighlightoptions. It attempts to derive these values fromdatawhen options are not explicitly provided for backward compatibility. Thesourcecan be derived fromdataascontent(for backward compatibility) orsourceproperty - Removed
mime,binaryandsizedata options forsourceview - Bumped
markedto^14.1.4(used inmarkdownview) - Added styles for
<kbd>inmarkdownview - Improved string rendering in the values popup of
signatureview - Fixed optional values statistics in
signatureview - Fixed navigation history update on the query graph changes on
discoverypage - Fixed scrollbar color schema in darkmode mode




