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

@formsort/custom-question-api

Package Overview
Dependencies
Maintainers
6
Versions
30
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@formsort/custom-question-api - npm Package Compare versions

Comparing version 0.1.1 to 0.2.1

6

CHANGELOG.md
# CHANGELOG
## 0.2.1
### Various fixes & improvements
- FLOW-370: set disable back navigation in custom question api (#95) by @alikirec
## 0.1.1

@@ -3,0 +9,0 @@

@@ -13,1 +13,6 @@ import { AnswerSemanticType } from '@formsort/constants';

export declare const setAnswerValue: (value: AnswerType) => void;
interface IDisableBackNavigationOptions {
beforeUnloadMessage?: string;
}
export declare const setDisableBackNavigation: (disable: boolean, options?: IDisableBackNavigationOptions | undefined) => void;
export {};

9

lib/index.js
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.setAnswerValue = exports.clearAnswerValue = exports.getResponderUuid = exports.getAllAnswerValues = exports.getSemanticAnswerValue = exports.getAnswerValue = exports.setQuestionSize = void 0;
exports.setDisableBackNavigation = exports.setAnswerValue = exports.clearAnswerValue = exports.getResponderUuid = exports.getAllAnswerValues = exports.getSemanticAnswerValue = exports.getAnswerValue = exports.setQuestionSize = void 0;
const constants_1 = require("@formsort/constants");

@@ -29,1 +29,8 @@ const utils_1 = require("./utils");

exports.setAnswerValue = setAnswerValue;
const setDisableBackNavigation = (disable, options) => {
(0, utils_1.sendMessageToWindowParent)(constants_1.CustomQuestionMessage.SET_DISABLE_BACK_NAVIGATION_MSG, {
disable,
beforeUnloadMessage: options === null || options === void 0 ? void 0 : options.beforeUnloadMessage,
});
};
exports.setDisableBackNavigation = setDisableBackNavigation;

4

package.json
{
"name": "@formsort/custom-question-api",
"version": "0.1.1",
"version": "0.2.1",
"description": "Helpers for implementing custom questions in Formsort",

@@ -49,5 +49,5 @@ "publishConfig": {

"dependencies": {
"@formsort/constants": "^1.7.0",
"@formsort/constants": "^1.8.0",
"events": "^3.2.0"
}
}

@@ -112,2 +112,8 @@ # @formsort/custom-question-api

```tsx
setDisableBackNavigation(disable: boolean, options?: { beforeUnloadMessage?: string }) => void;
```
Disable/enable back navigation in parent form. If you want to prompt a message when user clicks on browser's back button, like [`window.confirm`](https://developer.mozilla.org/en-US/docs/Web/API/Window/confirm), you can set `beforeUnloadMessage`.
```tsx
setQuestionSize(width?: number | string, height?: number | string) => void

@@ -121,3 +127,2 @@ ```

For example, if you implement your custom question as a React component, you may want to measure the component once it's rendered and tell Formsort its height and width:

@@ -124,0 +129,0 @@

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