New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@blac/react

Package Overview
Dependencies
Maintainers
1
Versions
41
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@blac/react - npm Package Compare versions

Comparing version 0.0.20 to 0.0.21

40

dist/blac-react.esm.js

@@ -1,2 +0,2 @@

import { useId, useMemo, useSyncExternalStore, useEffect } from 'react';
import { useId, useMemo, useSyncExternalStore } from 'react';

@@ -122,3 +122,2 @@ var externalBlocStore = function (bloc, dependencySelector) {

this.pluginList = [];
this.customPropsMap = new Map();
this.postChangesToDocument = false;

@@ -235,16 +234,6 @@ this.addPlugin = function (plugin) {

};
Blac.prototype.setCustomProps = function (blocClass, props) {
if (!props)
return;
this.customPropsMap.set(blocClass, props);
};
Blac.prototype.getCustomProps = function (blocClass) {
var props = this.customPropsMap.get(blocClass);
this.customPropsMap.delete(blocClass);
return props;
};
Blac.prototype.createNewBlocInstance = function (blocClass, id, props) {
var base = blocClass;
var hasCreateMethod = Object.prototype.hasOwnProperty.call(blocClass, 'create');
this.setCustomProps(base, props);
base._propsOnInit = props;
var newBloc = hasCreateMethod ? base.create() : new blocClass();

@@ -321,3 +310,3 @@ newBloc.updateId(id);

this.blac = Blac.getInstance();
this.props = {};
// public props: P = {} as P;
this.createdAt = Date.now();

@@ -344,4 +333,13 @@ this.updateId = function (id) {

this.isolated = this.constructor.isolated;
// this.onConnect?.();
}
Object.defineProperty(BlocBase.prototype, "props", {
get: function () {
var p = this.constructor._propsOnInit;
if (!p)
return {};
return p;
},
enumerable: false,
configurable: true
});
Object.defineProperty(BlocBase.prototype, "state", {

@@ -376,7 +374,3 @@ get: function () {

function Cubit(initialState) {
var _this = _super.call(this, initialState) || this;
_this.props = {};
var newProps = Blac.getInstance().getCustomProps(_this.constructor);
_this.props = __assign(__assign({}, _this.props), newProps);
return _this;
return _super.call(this, initialState) || this;
}

@@ -494,5 +488,5 @@ /**

var state = useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot);
useEffect(function () {
resolvedBloc.props = props;
}, [props]);
// useEffect(() => {
// resolvedBloc.props = props;
// }, [props]);
return [state, resolvedBloc];

@@ -499,0 +493,0 @@ };

@@ -124,3 +124,2 @@ 'use strict';

this.pluginList = [];
this.customPropsMap = new Map();
this.postChangesToDocument = false;

@@ -237,16 +236,6 @@ this.addPlugin = function (plugin) {

};
Blac.prototype.setCustomProps = function (blocClass, props) {
if (!props)
return;
this.customPropsMap.set(blocClass, props);
};
Blac.prototype.getCustomProps = function (blocClass) {
var props = this.customPropsMap.get(blocClass);
this.customPropsMap.delete(blocClass);
return props;
};
Blac.prototype.createNewBlocInstance = function (blocClass, id, props) {
var base = blocClass;
var hasCreateMethod = Object.prototype.hasOwnProperty.call(blocClass, 'create');
this.setCustomProps(base, props);
base._propsOnInit = props;
var newBloc = hasCreateMethod ? base.create() : new blocClass();

@@ -323,3 +312,3 @@ newBloc.updateId(id);

this.blac = Blac.getInstance();
this.props = {};
// public props: P = {} as P;
this.createdAt = Date.now();

@@ -346,4 +335,13 @@ this.updateId = function (id) {

this.isolated = this.constructor.isolated;
// this.onConnect?.();
}
Object.defineProperty(BlocBase.prototype, "props", {
get: function () {
var p = this.constructor._propsOnInit;
if (!p)
return {};
return p;
},
enumerable: false,
configurable: true
});
Object.defineProperty(BlocBase.prototype, "state", {

@@ -378,7 +376,3 @@ get: function () {

function Cubit(initialState) {
var _this = _super.call(this, initialState) || this;
_this.props = {};
var newProps = Blac.getInstance().getCustomProps(_this.constructor);
_this.props = __assign(__assign({}, _this.props), newProps);
return _this;
return _super.call(this, initialState) || this;
}

@@ -496,5 +490,5 @@ /**

var state = react.useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot);
react.useEffect(function () {
resolvedBloc.props = props;
}, [props]);
// useEffect(() => {
// resolvedBloc.props = props;
// }, [props]);
return [state, resolvedBloc];

@@ -501,0 +495,0 @@ };

{
"name": "@blac/react",
"version": "0.0.20",
"version": "0.0.21",
"license": "MIT",

@@ -22,3 +22,4 @@ "main": "dist/blac-react.js",

"prettier": "prettier --write ./src",
"test": "vitest run --coverage"
"test": "vitest run --coverage",
"pub": "npm run build && npm publish"
},

@@ -25,0 +26,0 @@ "dependencies": {

Sorry, the diff of this file is not supported yet

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