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

@ones-open/bridge

Package Overview
Dependencies
Maintainers
0
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ones-open/bridge - npm Package Compare versions

Comparing version 0.7.4-27607.928 to 2.1.0

82

dist/index.js

@@ -1,6 +0,8 @@

import { MFDispatch, MFListener } from "@ones-open/event";
import React, { useEffect, useState } from "react";
import { useDashboardCardConfigInfo, useDashboardCardInfo } from "@ones-open/store";
import { MFDispatch, MFListener } from '@ones-open/event';
import { useDashboardCardConfigInfo, useDashboardCardInfo } from '@ones-open/store';
import { useEffect, useState } from 'react';
import { jsx, Fragment } from 'react/jsx-runtime';
const dispatchGlobalEvent = (type, props, config) => {
MFDispatch("invoke:ones:global:event", {
MFDispatch('invoke:ones:global:event', {
type,

@@ -10,6 +12,7 @@ props

};
const modal = {
createTask(modalProps) {
dispatchGlobalEvent("modal", {
type: "CreateTask",
dispatchGlobalEvent('modal', {
type: 'CreateTask',
modalProps

@@ -23,7 +26,7 @@ });

if (!(parentTaskUUID && parentTaskProjectUUID)) {
const requiredProps = [parentTaskUUID ? "" : "parentTask.uuid", parentTaskProjectUUID ? "" : "parentTask.project_uuid"].filter((item) => !!item).join("and");
throw new Error(`[ones-mf] ${requiredProps} ${requiredProps.length > 1 ? "are" : "is"} required when calling modal.createSubTask`);
const requiredProps = [parentTaskUUID ? '' : 'parentTask.uuid', parentTaskProjectUUID ? '' : 'parentTask.project_uuid'].filter(item => !!item).join('and');
throw new Error(`[ones-mf] ${requiredProps} ${requiredProps.length > 1 ? 'are' : 'is'} required when calling modal.createSubTask`);
}
dispatchGlobalEvent("modal", {
type: "CreateSubTask",
dispatchGlobalEvent('modal', {
type: 'CreateSubTask',
modalProps

@@ -37,7 +40,7 @@ });

if (!(relatedTaskUUID && relatedTaskIssueTypeUUID)) {
const requiredProps = [relatedTaskUUID ? "" : "relatedTask.uuid", relatedTaskIssueTypeUUID ? "" : "relatedTask.issue_type_uuid"].filter((item) => !!item).join("and");
throw new Error(`[ones-mf] ${requiredProps} ${requiredProps.length > 1 ? "are" : "is"} required when calling modal.createRelatedTask`);
const requiredProps = [relatedTaskUUID ? '' : 'relatedTask.uuid', relatedTaskIssueTypeUUID ? '' : 'relatedTask.issue_type_uuid'].filter(item => !!item).join('and');
throw new Error(`[ones-mf] ${requiredProps} ${requiredProps.length > 1 ? 'are' : 'is'} required when calling modal.createRelatedTask`);
}
dispatchGlobalEvent("modal", {
type: "CreateRelatedTask",
dispatchGlobalEvent('modal', {
type: 'CreateRelatedTask',
modalProps

@@ -47,8 +50,14 @@ });

};
function invokeProgressManager(config) {
dispatchGlobalEvent("progressManager", void 0, config);
dispatchGlobalEvent('progressManager', undefined, config);
}
// [æĩ‹č¯•įŽĄį†-æĩ‹č¯•čŽĄåˆ’]
// eslint-disable-next-line @typescript-eslint/no-explicit-any
function refreshList(listName, params, config) {
MFDispatch(`ones:event:${listName}:refresh`, params, config);
}
class Lifecycle {

@@ -62,5 +71,5 @@ /**

onDestroy(callback) {
var _window$__ONES_LIFECY, _lifecycle2$onDestroy;
const lifecycle2 = (_window$__ONES_LIFECY = window.__ONES_LIFECYCLE__) !== null && _window$__ONES_LIFECY !== void 0 ? _window$__ONES_LIFECY : window.__ONES_LIFECYCLE__ = {};
const onDestroyCb = (_lifecycle2$onDestroy = lifecycle2.onDestroy) !== null && _lifecycle2$onDestroy !== void 0 ? _lifecycle2$onDestroy : lifecycle2.onDestroy = [];
var _window$__ONES_LIFECY, _lifecycle$onDestroy;
const lifecycle = (_window$__ONES_LIFECY = window.__ONES_LIFECYCLE__) !== null && _window$__ONES_LIFECY !== void 0 ? _window$__ONES_LIFECY : window.__ONES_LIFECYCLE__ = {};
const onDestroyCb = (_lifecycle$onDestroy = lifecycle.onDestroy) !== null && _lifecycle$onDestroy !== void 0 ? _lifecycle$onDestroy : lifecycle.onDestroy = [];
onDestroyCb.push(callback);

@@ -75,4 +84,10 @@ return () => {

}
/**
* Instance of the current plugin module lifecycle
*/
const lifecycle = new Lifecycle();
const useOnSubmitConfig = (callback) => {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const useOnSubmitConfig = callback => {
const {

@@ -88,3 +103,3 @@ modalUUID

};
const useCustomMenus = (menus) => {
const useCustomMenus = menus => {
const {

@@ -94,10 +109,10 @@ setCustomMenus

useEffect(() => {
const menuKeys = /* @__PURE__ */ new Set([]);
setCustomMenus === null || setCustomMenus === void 0 || setCustomMenus(menus.filter((item) => {
const menuKeys = new Set([]);
setCustomMenus === null || setCustomMenus === void 0 || setCustomMenus(menus.filter(item => {
if (!item.key) {
console.error("[ones-mf]", "menu.key is required");
console.error('[ones-mf]', 'menu.key is required');
return false;
}
if (menuKeys.has(item.key)) {
console.error("[ones-mf]", "menu.key must be unique");
console.error('[ones-mf]', 'menu.key must be unique');
return false;

@@ -118,6 +133,7 @@ }

};
function Provider(props) {
const [destroyed, setDestroyed] = useState(false);
useEffect(() => {
const clean = MFListener(`ones:event:inner:destroy:${window.__ONES_MF_NAME__}`, function() {
const clean = MFListener(`ones:event:inner:destroy:${window.__ONES_MF_NAME__}`, function () {
setDestroyed(true);

@@ -127,12 +143,8 @@ });

}, []);
return /* @__PURE__ */ React.createElement(React.Fragment, null, destroyed ? null : props.children);
return /*#__PURE__*/jsx(Fragment, {
children: destroyed ? null : props.children
});
}
Provider.displayName = "OPProvider";
export {
Provider as OPProvider,
dashboardCard,
invokeProgressManager,
lifecycle,
modal,
refreshList
};
Provider.displayName = 'OPProvider';
export { Provider as OPProvider, dashboardCard, invokeProgressManager, lifecycle, modal, refreshList };
{
"name": "@ones-open/bridge",
"version": "0.7.4-27607.928+cb600015",
"version": "2.1.0",
"description": "",

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

"tsc": "tsc && tsc-alias",
"build": "pnpm run tsc && vite build"
"build": "vite build --emptyOutDir && pnpm run tsc"
},

@@ -38,12 +38,11 @@ "keywords": [

"peerDependencies": {
"react": "^16.9.0 || ^17.0.0"
"react": "^16.14.0 || ^17.0.0"
},
"dependencies": {
"@babel/runtime-corejs3": "~7.22.6",
"@ones-open/event": "0.13.1-27607.928+cb600015",
"@ones-open/store": "0.14.3-27607.928+cb600015",
"@types/lodash-es": "^4.17.6",
"lodash-es": "~4.17.21"
"@babel/runtime-corejs3": "^7.22.15",
"@ones-open/event": "^2.1.0",
"@ones-open/store": "^2.1.0",
"@senojs/lodash": "^1.0.2"
},
"gitHead": "cb6000157b4647ed4df97f24aedf38390684dd63"
"gitHead": "a15f5cf783067b23ff384818c3270eabc8675d5c"
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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