Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@json-layout/core

Package Overview
Dependencies
Maintainers
0
Versions
68
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@json-layout/core - npm Package Compare versions

Comparing version 1.3.0 to 1.4.0

4

package.json
{
"name": "@json-layout/core",
"version": "1.3.0",
"version": "1.4.0",
"description": "Compilation and state management utilities for JSON Layout.",

@@ -62,3 +62,3 @@ "type": "module",

"dependencies": {
"@json-layout/vocabulary": "~1.3.0",
"@json-layout/vocabulary": "~1.4.0",
"ajv": "^8.12.0",

@@ -65,0 +65,0 @@ "ajv-errors": "^3.0.0",

@@ -55,3 +55,6 @@ // eslint-disable-next-line import/no-named-default

const logSelectItems = debug('jl:select-items')
const logActivatedItems = debug('jl:activated-items')
const pathURL = (/** @type {string} */url) => new URL(url.startsWith('/') ? window.location.origin + url : url)
export class StatefulLayout {

@@ -315,2 +318,3 @@ /**

for (const activatedKey in createStateTreeContext.autoActivatedItems) {
logActivatedItems('auto-activated item', activatedKey, createStateTreeContext.autoActivatedItems[activatedKey])
this.activatedItems = produce(this.activatedItems, draft => { draft[activatedKey] = createStateTreeContext.autoActivatedItems[activatedKey] })

@@ -410,2 +414,3 @@ }

if (activateKey !== undefined) {
logActivatedItems('activated item on input', node.fullKey, activateKey)
this.activatedItems = produce(this.activatedItems, draft => { draft[node.fullKey] = activateKey })

@@ -549,3 +554,3 @@ this._autofocusTarget = node.fullKey + '/' + activateKey

logSelectItems(`${node.fullKey} - will fetch raw items from URL`, node.itemsCacheKey)
const url = new URL(node.itemsCacheKey)
const url = pathURL(node.itemsCacheKey)
let qSearchParam = node.layout.getItems.qSearchParam

@@ -650,2 +655,3 @@ if (!qSearchParam) {

activateItem (node, key) {
logActivatedItems('activate item explicitly', node.fullKey, key)
this.activatedItems = produce(this.activatedItems, draft => { draft[node.fullKey] = key })

@@ -660,2 +666,3 @@ this._autofocusTarget = node.fullKey + '/' + key

const newParentData = { ...parentNode.data }
logActivatedItems('remove properties of previous oneOf activated item', node.fullKey, node.children?.[0].fullKey)
for (const propertyKey of node.children?.[0].skeleton.propertyKeys) {

@@ -678,6 +685,10 @@ delete newParentData[propertyKey]

deactivateItem (node) {
logActivatedItems('deactivate item explicitly', node.fullKey)
// also deactivate children oneOf for example
this.activatedItems = produce(this.activatedItems, draft => {
for (const key in draft) {
if (key.startsWith(node.fullKey)) delete draft[key]
if (key.startsWith(node.fullKey)) {
logActivatedItems('item deactivation deletes a key', key)
delete draft[key]
}
}

@@ -684,0 +695,0 @@ })

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc