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

digirati-annotation-redux

Package Overview
Dependencies
Maintainers
1
Versions
147
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

digirati-annotation-redux - npm Package Compare versions

Comparing version 0.2.20-alpha.5892bb78 to 0.2.20-alpha.86622e37

es/query/selectorQuery.js

3

es/actions/drafts.js

@@ -19,6 +19,7 @@ import uuid from 'uuid/v4';

var motivation = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'tagging';
var selectors = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null;
return function (dispatch, state) {
var id = uuid();
dispatch({ type: DRAFT_CREATE, payload: { id: id, input: input, template: template, selectors: input, motivation: motivation } });
dispatch({ type: DRAFT_CREATE, payload: { id: id, input: input, template: template, selectors: selectors ? selectors : input, motivation: motivation } });
dispatch(selectDraft(id));

@@ -25,0 +26,0 @@ var currentTemplate = getCurrentResourceTemplate(state());

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

import { addSelectorToDraft } from './drafts';
import _extends from 'babel-runtime/helpers/extends';
import { addSelectorToDraft, addSelectorToDraftField } from './drafts';

@@ -7,2 +8,3 @@ export var SELECTOR_SET_AVAILABLE = 'SELECTOR_SET_AVAILABLE';

export var SELECTOR_COMMIT_TO_DRAFT = 'SELECTOR_COMMIT_TO_DRAFT';
export var SELECTOR_COMMIT_TO_DRAFT_FIELD = 'SELECTOR_COMMIT_TO_DRAFT_FIELD';

@@ -17,2 +19,6 @@ export function setAvailableSelectors(selectors) {

export function chooseSecondarySelector(type, defaults) {
return { type: SELECTOR_CHOOSE, payload: { type: type, defaults: _extends({}, defaults, { secondary: true }) } };
}
export function updateSelector(data) {

@@ -22,2 +28,9 @@ return { type: SELECTOR_UPDATE, payload: { data: data } };

export function commitToCurrentDraftField(fieldId) {
return function (dispatch, getState) {
dispatch(addSelectorToDraftField(getState().drafts.currentDraft, getState().selector.currentSelector, fieldId));
dispatch({ type: SELECTOR_COMMIT_TO_DRAFT_FIELD });
};
}
export function commitToCurrentDraft() {

@@ -24,0 +37,0 @@ return function (dispatch, getState) {

@@ -11,3 +11,3 @@ import { connect } from 'react-redux';

import { setViewer, withViewer } from './actions/viewer';
import { isSelecting, currentSelectorIsSecondary } from './query/selectorQuery';
export default connect(function (state) {

@@ -18,2 +18,5 @@ var annotationList = richAnnotationList(state);

state: state,
isSelecting: isSelecting(state),
isSelectingPrimary: isSelecting(state) && currentSelectorIsSecondary(state) === false,
isSelectingSecondary: isSelecting(state) && currentSelectorIsSecondary(state) === true,
currentSelector: state.selector && state.selector.currentSelector ? state.selector.currentSelector : null,

@@ -20,0 +23,0 @@ currentDraft: getCurrentDraft(state),

import _extends from 'babel-runtime/helpers/extends';
import { SELECTOR_CHOOSE, SELECTOR_COMMIT_TO_DRAFT, SELECTOR_SET_AVAILABLE, SELECTOR_UPDATE } from '../actions/selectors';
import { SELECTOR_CHOOSE, SELECTOR_COMMIT_TO_DRAFT, SELECTOR_SET_AVAILABLE, SELECTOR_UPDATE, SELECTOR_COMMIT_TO_DRAFT_FIELD } from '../actions/selectors';
import update from 'immutability-helper';

@@ -36,2 +36,3 @@

case SELECTOR_COMMIT_TO_DRAFT:
case SELECTOR_COMMIT_TO_DRAFT_FIELD:
return update(state, {

@@ -38,0 +39,0 @@ currentSelector: { $set: {} }

@@ -41,6 +41,7 @@ 'use strict';

var motivation = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'tagging';
var selectors = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null;
return function (dispatch, state) {
var id = (0, _v2.default)();
dispatch({ type: DRAFT_CREATE, payload: { id: id, input: input, template: template, selectors: input, motivation: motivation } });
dispatch({ type: DRAFT_CREATE, payload: { id: id, input: input, template: template, selectors: selectors ? selectors : input, motivation: motivation } });
dispatch(selectDraft(id));

@@ -47,0 +48,0 @@ var currentTemplate = (0, _resourceTemplateQuery.getCurrentResourceTemplate)(state());

'use strict';
exports.__esModule = true;
exports.SELECTOR_COMMIT_TO_DRAFT = exports.SELECTOR_UPDATE = exports.SELECTOR_CHOOSE = exports.SELECTOR_SET_AVAILABLE = undefined;
exports.SELECTOR_COMMIT_TO_DRAFT_FIELD = exports.SELECTOR_COMMIT_TO_DRAFT = exports.SELECTOR_UPDATE = exports.SELECTOR_CHOOSE = exports.SELECTOR_SET_AVAILABLE = undefined;
var _extends2 = require('babel-runtime/helpers/extends');
var _extends3 = _interopRequireDefault(_extends2);
exports.setAvailableSelectors = setAvailableSelectors;
exports.chooseSelector = chooseSelector;
exports.chooseSecondarySelector = chooseSecondarySelector;
exports.updateSelector = updateSelector;
exports.commitToCurrentDraftField = commitToCurrentDraftField;
exports.commitToCurrentDraft = commitToCurrentDraft;

@@ -12,2 +19,4 @@

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var SELECTOR_SET_AVAILABLE = exports.SELECTOR_SET_AVAILABLE = 'SELECTOR_SET_AVAILABLE';

@@ -17,2 +26,3 @@ var SELECTOR_CHOOSE = exports.SELECTOR_CHOOSE = 'SELECTOR_CHOOSE';

var SELECTOR_COMMIT_TO_DRAFT = exports.SELECTOR_COMMIT_TO_DRAFT = 'SELECTOR_COMMIT_TO_DRAFT';
var SELECTOR_COMMIT_TO_DRAFT_FIELD = exports.SELECTOR_COMMIT_TO_DRAFT_FIELD = 'SELECTOR_COMMIT_TO_DRAFT_FIELD';

@@ -27,2 +37,6 @@ function setAvailableSelectors(selectors) {

function chooseSecondarySelector(type, defaults) {
return { type: SELECTOR_CHOOSE, payload: { type: type, defaults: (0, _extends3.default)({}, defaults, { secondary: true }) } };
}
function updateSelector(data) {

@@ -32,2 +46,9 @@ return { type: SELECTOR_UPDATE, payload: { data: data } };

function commitToCurrentDraftField(fieldId) {
return function (dispatch, getState) {
dispatch((0, _drafts.addSelectorToDraftField)(getState().drafts.currentDraft, getState().selector.currentSelector, fieldId));
dispatch({ type: SELECTOR_COMMIT_TO_DRAFT_FIELD });
};
}
function commitToCurrentDraft() {

@@ -34,0 +55,0 @@ return function (dispatch, getState) {

@@ -25,2 +25,4 @@ 'use strict';

var _selectorQuery = require('./query/selectorQuery');
exports.default = (0, _reactRedux.connect)(function (state) {

@@ -31,2 +33,5 @@ var annotationList = (0, _elucidateQuery.richAnnotationList)(state);

state: state,
isSelecting: (0, _selectorQuery.isSelecting)(state),
isSelectingPrimary: (0, _selectorQuery.isSelecting)(state) && (0, _selectorQuery.currentSelectorIsSecondary)(state) === false,
isSelectingSecondary: (0, _selectorQuery.isSelecting)(state) && (0, _selectorQuery.currentSelectorIsSecondary)(state) === true,
currentSelector: state.selector && state.selector.currentSelector ? state.selector.currentSelector : null,

@@ -33,0 +38,0 @@ currentDraft: (0, _draftQuery.getCurrentDraft)(state),

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

case _selectors.SELECTOR_COMMIT_TO_DRAFT:
case _selectors.SELECTOR_COMMIT_TO_DRAFT_FIELD:
return (0, _immutabilityHelper2.default)(state, {

@@ -52,0 +53,0 @@ currentSelector: { $set: {} }

{
"name": "digirati-annotation-redux",
"version": "0.2.20-alpha.5892bb78",
"version": "0.2.20-alpha.86622e37",
"description": "Describe annotation-redux here",

@@ -5,0 +5,0 @@ "main": "es/index.js",

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