@valiantys/atlassian-app 3.2.0-alpha-19 → 3.2.0-alpha-20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +6 -1
- package/shared/frontend-ui-debounce-hook/src/lib/shared-frontend-ui-debounce-hook/index.cjs.js +1 -0
- package/shared/frontend-ui-debounce-hook/src/lib/shared-frontend-ui-debounce-hook/index.es.js +14 -0
- package/ui-debounce-hook/atlassian-app-ui-debounce-hook.api.json +248 -0
- package/ui-debounce-hook/atlassian-app.api.md +14 -0
- package/ui-debounce-hook/index.cjs.js +1 -0
- package/ui-debounce-hook/index.d.ts +16 -0
- package/ui-debounce-hook/index.es.js +4 -0
- package/ui-debounce-hook/tsdoc-metadata.json +11 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@valiantys/atlassian-app",
|
|
3
|
-
"version": "3.2.0-alpha-
|
|
3
|
+
"version": "3.2.0-alpha-20",
|
|
4
4
|
"description": "This library provides Atlassian Forge components, wrappers, and utilities to support writing Forge apps that can run deployed or in standalone mode",
|
|
5
5
|
"exports": {
|
|
6
6
|
"./frontend-app": {
|
|
@@ -178,6 +178,11 @@
|
|
|
178
178
|
"require": "./ui-forge-feature-flags/index.cjs.js",
|
|
179
179
|
"types": "./ui-forge-feature-flags/index.d.ts"
|
|
180
180
|
},
|
|
181
|
+
"./ui-debounce-hook": {
|
|
182
|
+
"import": "./ui-debounce-hook/index.es.js",
|
|
183
|
+
"require": "./ui-debounce-hook/index.cjs.js",
|
|
184
|
+
"types": "./ui-debounce-hook/index.d.ts"
|
|
185
|
+
},
|
|
181
186
|
"./ui-drop-target": {
|
|
182
187
|
"import": "./ui-drop-target/index.es.js",
|
|
183
188
|
"require": "./ui-drop-target/index.cjs.js",
|
package/shared/frontend-ui-debounce-hook/src/lib/shared-frontend-ui-debounce-hook/index.cjs.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("lodash/debounce"),u=require("react");function o(n,r=600){const e=u.useRef();return u.useEffect(()=>{e.current=n},[n]),u.useMemo(()=>c(()=>{var t;(t=e.current)==null||t.call(e)},r),[r])}exports.useDebounce=o;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import o from "lodash/debounce";
|
|
2
|
+
import { useRef as t, useEffect as c, useMemo as f } from "react";
|
|
3
|
+
function i(u, n = 600) {
|
|
4
|
+
const e = t();
|
|
5
|
+
return c(() => {
|
|
6
|
+
e.current = u;
|
|
7
|
+
}, [u]), f(() => o(() => {
|
|
8
|
+
var r;
|
|
9
|
+
(r = e.current) == null || r.call(e);
|
|
10
|
+
}, n), [n]);
|
|
11
|
+
}
|
|
12
|
+
export {
|
|
13
|
+
i as useDebounce
|
|
14
|
+
};
|
|
@@ -0,0 +1,248 @@
|
|
|
1
|
+
{
|
|
2
|
+
"metadata": {
|
|
3
|
+
"toolPackage": "@microsoft/api-extractor",
|
|
4
|
+
"toolVersion": "7.52.8",
|
|
5
|
+
"schemaVersion": 1011,
|
|
6
|
+
"oldestForwardsCompatibleVersion": 1001,
|
|
7
|
+
"tsdocConfig": {
|
|
8
|
+
"$schema": "https://developer.microsoft.com/json-schemas/tsdoc/v0/tsdoc.schema.json",
|
|
9
|
+
"noStandardTags": true,
|
|
10
|
+
"tagDefinitions": [
|
|
11
|
+
{
|
|
12
|
+
"tagName": "@alpha",
|
|
13
|
+
"syntaxKind": "modifier"
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
"tagName": "@beta",
|
|
17
|
+
"syntaxKind": "modifier"
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"tagName": "@defaultValue",
|
|
21
|
+
"syntaxKind": "block"
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
"tagName": "@decorator",
|
|
25
|
+
"syntaxKind": "block",
|
|
26
|
+
"allowMultiple": true
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
"tagName": "@deprecated",
|
|
30
|
+
"syntaxKind": "block"
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
"tagName": "@eventProperty",
|
|
34
|
+
"syntaxKind": "modifier"
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
"tagName": "@example",
|
|
38
|
+
"syntaxKind": "block",
|
|
39
|
+
"allowMultiple": true
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
"tagName": "@experimental",
|
|
43
|
+
"syntaxKind": "modifier"
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
"tagName": "@inheritDoc",
|
|
47
|
+
"syntaxKind": "inline"
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
"tagName": "@internal",
|
|
51
|
+
"syntaxKind": "modifier"
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
"tagName": "@label",
|
|
55
|
+
"syntaxKind": "inline"
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
"tagName": "@link",
|
|
59
|
+
"syntaxKind": "inline",
|
|
60
|
+
"allowMultiple": true
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
"tagName": "@override",
|
|
64
|
+
"syntaxKind": "modifier"
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
"tagName": "@packageDocumentation",
|
|
68
|
+
"syntaxKind": "modifier"
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
"tagName": "@param",
|
|
72
|
+
"syntaxKind": "block",
|
|
73
|
+
"allowMultiple": true
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
"tagName": "@privateRemarks",
|
|
77
|
+
"syntaxKind": "block"
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
"tagName": "@public",
|
|
81
|
+
"syntaxKind": "modifier"
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
"tagName": "@readonly",
|
|
85
|
+
"syntaxKind": "modifier"
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
"tagName": "@remarks",
|
|
89
|
+
"syntaxKind": "block"
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
"tagName": "@returns",
|
|
93
|
+
"syntaxKind": "block"
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
"tagName": "@sealed",
|
|
97
|
+
"syntaxKind": "modifier"
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
"tagName": "@see",
|
|
101
|
+
"syntaxKind": "block"
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
"tagName": "@throws",
|
|
105
|
+
"syntaxKind": "block",
|
|
106
|
+
"allowMultiple": true
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
"tagName": "@typeParam",
|
|
110
|
+
"syntaxKind": "block",
|
|
111
|
+
"allowMultiple": true
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
"tagName": "@virtual",
|
|
115
|
+
"syntaxKind": "modifier"
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
"tagName": "@betaDocumentation",
|
|
119
|
+
"syntaxKind": "modifier"
|
|
120
|
+
},
|
|
121
|
+
{
|
|
122
|
+
"tagName": "@internalRemarks",
|
|
123
|
+
"syntaxKind": "block"
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
"tagName": "@preapproved",
|
|
127
|
+
"syntaxKind": "modifier"
|
|
128
|
+
}
|
|
129
|
+
],
|
|
130
|
+
"supportForTags": {
|
|
131
|
+
"@alpha": true,
|
|
132
|
+
"@beta": true,
|
|
133
|
+
"@defaultValue": true,
|
|
134
|
+
"@decorator": true,
|
|
135
|
+
"@deprecated": true,
|
|
136
|
+
"@eventProperty": true,
|
|
137
|
+
"@example": true,
|
|
138
|
+
"@experimental": true,
|
|
139
|
+
"@inheritDoc": true,
|
|
140
|
+
"@internal": true,
|
|
141
|
+
"@label": true,
|
|
142
|
+
"@link": true,
|
|
143
|
+
"@override": true,
|
|
144
|
+
"@packageDocumentation": true,
|
|
145
|
+
"@param": true,
|
|
146
|
+
"@privateRemarks": true,
|
|
147
|
+
"@public": true,
|
|
148
|
+
"@readonly": true,
|
|
149
|
+
"@remarks": true,
|
|
150
|
+
"@returns": true,
|
|
151
|
+
"@sealed": true,
|
|
152
|
+
"@see": true,
|
|
153
|
+
"@throws": true,
|
|
154
|
+
"@typeParam": true,
|
|
155
|
+
"@virtual": true,
|
|
156
|
+
"@betaDocumentation": true,
|
|
157
|
+
"@internalRemarks": true,
|
|
158
|
+
"@preapproved": true
|
|
159
|
+
},
|
|
160
|
+
"reportUnsupportedHtmlElements": false
|
|
161
|
+
}
|
|
162
|
+
},
|
|
163
|
+
"kind": "Package",
|
|
164
|
+
"canonicalReference": "@valiantys/atlassian-app!",
|
|
165
|
+
"docComment": "",
|
|
166
|
+
"name": "@valiantys/atlassian-app",
|
|
167
|
+
"preserveMemberOrder": false,
|
|
168
|
+
"members": [
|
|
169
|
+
{
|
|
170
|
+
"kind": "EntryPoint",
|
|
171
|
+
"canonicalReference": "@valiantys/atlassian-app!",
|
|
172
|
+
"name": "",
|
|
173
|
+
"preserveMemberOrder": false,
|
|
174
|
+
"members": [
|
|
175
|
+
{
|
|
176
|
+
"kind": "Function",
|
|
177
|
+
"canonicalReference": "@valiantys/atlassian-app!useDebounce:function(1)",
|
|
178
|
+
"docComment": "/**\n * Debounce calls to a function on some change.\n *\n * @param callback - The function to call after the debounce time has elapsed.\n *\n * @param wait - How many seconds to wait before invoking callback. @return A wrapped version of the callback function that will handle the details of debouncing. You may call this wrapper on every change.\n */\n",
|
|
179
|
+
"excerptTokens": [
|
|
180
|
+
{
|
|
181
|
+
"kind": "Content",
|
|
182
|
+
"text": "export declare function useDebounce(callback: "
|
|
183
|
+
},
|
|
184
|
+
{
|
|
185
|
+
"kind": "Content",
|
|
186
|
+
"text": "() => void"
|
|
187
|
+
},
|
|
188
|
+
{
|
|
189
|
+
"kind": "Content",
|
|
190
|
+
"text": ", wait?: "
|
|
191
|
+
},
|
|
192
|
+
{
|
|
193
|
+
"kind": "Content",
|
|
194
|
+
"text": "number"
|
|
195
|
+
},
|
|
196
|
+
{
|
|
197
|
+
"kind": "Content",
|
|
198
|
+
"text": "): "
|
|
199
|
+
},
|
|
200
|
+
{
|
|
201
|
+
"kind": "Content",
|
|
202
|
+
"text": "import('lodash')."
|
|
203
|
+
},
|
|
204
|
+
{
|
|
205
|
+
"kind": "Reference",
|
|
206
|
+
"text": "DebouncedFunc",
|
|
207
|
+
"canonicalReference": "@types/lodash!\"\\\"../index\\\"\".DebouncedFunc:interface"
|
|
208
|
+
},
|
|
209
|
+
{
|
|
210
|
+
"kind": "Content",
|
|
211
|
+
"text": "<() => void>"
|
|
212
|
+
},
|
|
213
|
+
{
|
|
214
|
+
"kind": "Content",
|
|
215
|
+
"text": ";"
|
|
216
|
+
}
|
|
217
|
+
],
|
|
218
|
+
"fileUrlPath": "../../../shared/frontend-ui-debounce-hook/src/lib/shared-frontend-ui-debounce-hook.d.ts",
|
|
219
|
+
"returnTypeTokenRange": {
|
|
220
|
+
"startIndex": 5,
|
|
221
|
+
"endIndex": 8
|
|
222
|
+
},
|
|
223
|
+
"releaseTag": "Public",
|
|
224
|
+
"overloadIndex": 1,
|
|
225
|
+
"parameters": [
|
|
226
|
+
{
|
|
227
|
+
"parameterName": "callback",
|
|
228
|
+
"parameterTypeTokenRange": {
|
|
229
|
+
"startIndex": 1,
|
|
230
|
+
"endIndex": 2
|
|
231
|
+
},
|
|
232
|
+
"isOptional": false
|
|
233
|
+
},
|
|
234
|
+
{
|
|
235
|
+
"parameterName": "wait",
|
|
236
|
+
"parameterTypeTokenRange": {
|
|
237
|
+
"startIndex": 3,
|
|
238
|
+
"endIndex": 4
|
|
239
|
+
},
|
|
240
|
+
"isOptional": true
|
|
241
|
+
}
|
|
242
|
+
],
|
|
243
|
+
"name": "useDebounce"
|
|
244
|
+
}
|
|
245
|
+
]
|
|
246
|
+
}
|
|
247
|
+
]
|
|
248
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
## API Report File for "@valiantys/atlassian-app"
|
|
2
|
+
|
|
3
|
+
> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
|
|
4
|
+
|
|
5
|
+
```ts
|
|
6
|
+
|
|
7
|
+
import { DebouncedFunc } from 'lodash';
|
|
8
|
+
|
|
9
|
+
// @public
|
|
10
|
+
export function useDebounce(callback: () => void, wait?: number): DebouncedFunc<() => void>;
|
|
11
|
+
|
|
12
|
+
// (No @packageDocumentation comment for this package)
|
|
13
|
+
|
|
14
|
+
```
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../shared/frontend-ui-debounce-hook/src/lib/shared-frontend-ui-debounce-hook/index.cjs.js");exports.useDebounce=e.useDebounce;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { DebouncedFunc } from 'lodash';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* This hook is taken from an example by Nadia Makarevich:
|
|
5
|
+
* https://www.developerway.com/posts/debouncing-in-react
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Debounce calls to a function on some change.
|
|
9
|
+
* @param callback The function to call after the debounce time has elapsed.
|
|
10
|
+
* @param wait How many seconds to wait before invoking callback.
|
|
11
|
+
* @return A wrapped version of the callback function that will handle the details
|
|
12
|
+
* of debouncing. You may call this wrapper on every change.
|
|
13
|
+
*/
|
|
14
|
+
export declare function useDebounce(callback: () => void, wait?: number): DebouncedFunc<() => void>;
|
|
15
|
+
|
|
16
|
+
export { }
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
// This file is read by tools that parse documentation comments conforming to the TSDoc standard.
|
|
2
|
+
// It should be published with your NPM package. It should not be tracked by Git.
|
|
3
|
+
{
|
|
4
|
+
"tsdocVersion": "0.12",
|
|
5
|
+
"toolPackages": [
|
|
6
|
+
{
|
|
7
|
+
"packageName": "@microsoft/api-extractor",
|
|
8
|
+
"packageVersion": "7.52.8"
|
|
9
|
+
}
|
|
10
|
+
]
|
|
11
|
+
}
|