@formsort/custom-question-api
Advanced tools
Comparing version 0.2.1 to 0.2.2
# CHANGELOG | ||
## 0.2.2 | ||
### Various fixes & improvements | ||
- fix: upgrade jest to fix CVE-2022-38900 (#99) by @alikirec | ||
- FLOW-356: generate umd build of custom question api (#97) by @alikirec | ||
## 0.2.1 | ||
@@ -3,0 +10,0 @@ |
@@ -1,2 +0,2 @@ | ||
import { AnswerSemanticType } from '@formsort/constants'; | ||
import { type AnswerSemanticType } from '@formsort/constants'; | ||
export declare type AnswerPrimitiveType = number | string | boolean | object; | ||
@@ -3,0 +3,0 @@ export declare type AnswerType = AnswerPrimitiveType | AnswerPrimitiveType[]; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.setDisableBackNavigation = exports.setAnswerValue = exports.clearAnswerValue = exports.getResponderUuid = exports.getAllAnswerValues = exports.getSemanticAnswerValue = exports.getAnswerValue = exports.setQuestionSize = void 0; | ||
const constants_1 = require("@formsort/constants"); | ||
const tslib_1 = require("tslib"); | ||
// import from directory for tree shaking | ||
const custom_question_message_1 = tslib_1.__importDefault(require("@formsort/constants/lib/custom-question-message")); | ||
const utils_1 = require("./utils"); | ||
const setQuestionSize = (width, height) => { | ||
(0, utils_1.sendMessageToWindowParent)(constants_1.CustomQuestionMessage.SET_QUESTION_SIZE_MSG, { | ||
(0, utils_1.sendMessageToWindowParent)(custom_question_message_1.default.SET_QUESTION_SIZE_MSG, { | ||
width, | ||
@@ -13,20 +15,20 @@ height, | ||
exports.setQuestionSize = setQuestionSize; | ||
const getAnswerValue = () => (0, utils_1.getValueFromWindowParent)(constants_1.CustomQuestionMessage.REQUEST_ANSWER_VALUE_MSG, constants_1.CustomQuestionMessage.SET_ANSWER_VALUE_MSG); | ||
const getAnswerValue = () => (0, utils_1.getValueFromWindowParent)(custom_question_message_1.default.REQUEST_ANSWER_VALUE_MSG, custom_question_message_1.default.SET_ANSWER_VALUE_MSG); | ||
exports.getAnswerValue = getAnswerValue; | ||
const getSemanticAnswerValue = (semanticType) => (0, utils_1.getValueFromWindowParent)(constants_1.CustomQuestionMessage.REQUEST_SEMANTIC_ANSWER_VALUE_MSG, constants_1.CustomQuestionMessage.SET_SEMANTIC_ANSWER_VALUE_MSG, semanticType); | ||
const getSemanticAnswerValue = (semanticType) => (0, utils_1.getValueFromWindowParent)(custom_question_message_1.default.REQUEST_SEMANTIC_ANSWER_VALUE_MSG, custom_question_message_1.default.SET_SEMANTIC_ANSWER_VALUE_MSG, semanticType); | ||
exports.getSemanticAnswerValue = getSemanticAnswerValue; | ||
const getAllAnswerValues = () => (0, utils_1.getValueFromWindowParent)(constants_1.CustomQuestionMessage.REQUEST_ANSWERS_MSG, constants_1.CustomQuestionMessage.SET_ANSWERS_MSG); | ||
const getAllAnswerValues = () => (0, utils_1.getValueFromWindowParent)(custom_question_message_1.default.REQUEST_ANSWERS_MSG, custom_question_message_1.default.SET_ANSWERS_MSG); | ||
exports.getAllAnswerValues = getAllAnswerValues; | ||
const getResponderUuid = () => (0, utils_1.getValueFromWindowParent)(constants_1.CustomQuestionMessage.REQUEST_RESPONDER_UUID_MSG, constants_1.CustomQuestionMessage.SET_RESPONDER_UUID_MSG); | ||
const getResponderUuid = () => (0, utils_1.getValueFromWindowParent)(custom_question_message_1.default.REQUEST_RESPONDER_UUID_MSG, custom_question_message_1.default.SET_RESPONDER_UUID_MSG); | ||
exports.getResponderUuid = getResponderUuid; | ||
const clearAnswerValue = () => { | ||
(0, utils_1.sendMessageToWindowParent)(constants_1.CustomQuestionMessage.CLEAR_ANSWER_VALUE_MSG); | ||
(0, utils_1.sendMessageToWindowParent)(custom_question_message_1.default.CLEAR_ANSWER_VALUE_MSG); | ||
}; | ||
exports.clearAnswerValue = clearAnswerValue; | ||
const setAnswerValue = (value) => { | ||
(0, utils_1.sendMessageToWindowParent)(constants_1.CustomQuestionMessage.SET_ANSWER_VALUE_MSG, value); | ||
(0, utils_1.sendMessageToWindowParent)(custom_question_message_1.default.SET_ANSWER_VALUE_MSG, value); | ||
}; | ||
exports.setAnswerValue = setAnswerValue; | ||
const setDisableBackNavigation = (disable, options) => { | ||
(0, utils_1.sendMessageToWindowParent)(constants_1.CustomQuestionMessage.SET_DISABLE_BACK_NAVIGATION_MSG, { | ||
(0, utils_1.sendMessageToWindowParent)(custom_question_message_1.default.SET_DISABLE_BACK_NAVIGATION_MSG, { | ||
disable, | ||
@@ -33,0 +35,0 @@ beforeUnloadMessage: options === null || options === void 0 ? void 0 : options.beforeUnloadMessage, |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const tslib_1 = require("tslib"); | ||
const events_1 = require("events"); | ||
const constants_1 = require("@formsort/constants"); | ||
// import from directory for tree shaking | ||
const custom_question_message_1 = tslib_1.__importDefault(require("@formsort/constants/lib/custom-question-message")); | ||
const EVENTS_TO_EMIT = new Set([ | ||
constants_1.CustomQuestionMessage.SET_ANSWERS_MSG, | ||
constants_1.CustomQuestionMessage.SET_ANSWER_VALUE_MSG, | ||
constants_1.CustomQuestionMessage.SET_RESPONDER_UUID_MSG, | ||
constants_1.CustomQuestionMessage.SET_SEMANTIC_ANSWER_VALUE_MSG, | ||
custom_question_message_1.default.SET_ANSWERS_MSG, | ||
custom_question_message_1.default.SET_ANSWER_VALUE_MSG, | ||
custom_question_message_1.default.SET_RESPONDER_UUID_MSG, | ||
custom_question_message_1.default.SET_SEMANTIC_ANSWER_VALUE_MSG, | ||
]); | ||
@@ -11,0 +13,0 @@ class WindowMessageEventsEmitter extends events_1.EventEmitter { |
{ | ||
"name": "@formsort/custom-question-api", | ||
"version": "0.2.1", | ||
"version": "0.2.2", | ||
"description": "Helpers for implementing custom questions in Formsort", | ||
@@ -11,4 +11,7 @@ "publishConfig": { | ||
"types": "lib/index.d.ts", | ||
"unpkg": "umd/custom-question-api.min.js", | ||
"scripts": { | ||
"build": "tsc --project tsconfig.build.json", | ||
"build": "yarn build:package && yarn build:umd", | ||
"build:package": "tsc --project tsconfig.build.json", | ||
"build:umd": "vite build", | ||
"format": "eslint --ext .ts,.tsx src --fix", | ||
@@ -21,3 +24,4 @@ "lint": "eslint --ext .ts,.tsx src", | ||
"files": [ | ||
"lib/**/*" | ||
"lib/**/*", | ||
"umd/**/*" | ||
], | ||
@@ -47,4 +51,6 @@ "repository": { | ||
"eslint-plugin-react": "^7.21.5", | ||
"jest-environment-jsdom": "^29.5.0", | ||
"prettier": "^2.2.1", | ||
"typescript": "^4.6.3" | ||
"typescript": "^4.6.3", | ||
"vite": "^4.2.0" | ||
}, | ||
@@ -51,0 +57,0 @@ "dependencies": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
24545
11
161
12