@fluentui/react-utilities 0.0.0-nightly-20230317-1454.1 → 0.0.0-nightly-20230322-0439.1

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.
Files changed (106) hide show
  1. package/.swcrc +2 -11
  2. package/CHANGELOG.json +38 -5
  3. package/CHANGELOG.md +17 -5
  4. package/lib/compose/getSlots.js +7 -6
  5. package/lib/compose/getSlots.js.map +1 -1
  6. package/lib/compose/index.js +4 -4
  7. package/lib/compose/isResolvedShorthand.js +2 -2
  8. package/lib/compose/resolveShorthand.js +3 -3
  9. package/lib/compose/types.js +1 -1
  10. package/lib/events/index.js +1 -1
  11. package/lib/events/mouseTouchHelpers.js +5 -5
  12. package/lib/hooks/index.js +12 -12
  13. package/lib/hooks/useControllableState.js +7 -7
  14. package/lib/hooks/useEventCallback.js +3 -3
  15. package/lib/hooks/useFirstMount.js +1 -1
  16. package/lib/hooks/useForceUpdate.js +1 -1
  17. package/lib/hooks/useId.js +6 -6
  18. package/lib/hooks/useIsomorphicLayoutEffect.js +2 -2
  19. package/lib/hooks/useMergedRefs.js +2 -2
  20. package/lib/hooks/useOnClickOutside.js +30 -20
  21. package/lib/hooks/useOnClickOutside.js.map +1 -1
  22. package/lib/hooks/useOnScrollOutside.js +9 -7
  23. package/lib/hooks/useOnScrollOutside.js.map +1 -1
  24. package/lib/hooks/usePrevious.js +1 -1
  25. package/lib/hooks/useScrollbarWidth.js +5 -5
  26. package/lib/hooks/useTimeout.js +1 -1
  27. package/lib/index.js +6 -6
  28. package/lib/ssr/SSRContext.js +6 -5
  29. package/lib/ssr/SSRContext.js.map +1 -1
  30. package/lib/ssr/canUseDOM.js +1 -1
  31. package/lib/ssr/index.js +2 -2
  32. package/lib/trigger/applyTriggerPropsToChildren.js +4 -4
  33. package/lib/trigger/getTriggerChild.js +2 -2
  34. package/lib/trigger/index.js +4 -4
  35. package/lib/trigger/isFluentTrigger.js +1 -1
  36. package/lib/trigger/types.js +1 -1
  37. package/lib/utils/getNativeElementProps.js +3 -3
  38. package/lib/utils/getRTLSafeKey.js +5 -5
  39. package/lib/utils/getReactCallbackName.js +3 -3
  40. package/lib/utils/index.js +8 -8
  41. package/lib/utils/isHTMLElement.js +3 -1
  42. package/lib/utils/isHTMLElement.js.map +1 -1
  43. package/lib/utils/isInteractiveHTMLElement.js +5 -5
  44. package/lib/utils/mergeCallbacks.js +2 -2
  45. package/lib/utils/mergeCallbacks.js.map +1 -1
  46. package/lib/utils/properties.js +27 -27
  47. package/lib/utils/properties.js.map +1 -1
  48. package/lib-commonjs/compose/getSlots.js +5 -4
  49. package/lib-commonjs/compose/getSlots.js.map +1 -1
  50. package/lib-commonjs/compose/index.js.map +1 -1
  51. package/lib-commonjs/compose/isResolvedShorthand.js +1 -1
  52. package/lib-commonjs/compose/isResolvedShorthand.js.map +1 -1
  53. package/lib-commonjs/compose/resolveShorthand.js +2 -2
  54. package/lib-commonjs/compose/resolveShorthand.js.map +1 -1
  55. package/lib-commonjs/compose/types.js.map +1 -1
  56. package/lib-commonjs/events/index.js.map +1 -1
  57. package/lib-commonjs/events/mouseTouchHelpers.js +7 -7
  58. package/lib-commonjs/events/mouseTouchHelpers.js.map +1 -1
  59. package/lib-commonjs/hooks/index.js.map +1 -1
  60. package/lib-commonjs/hooks/useControllableState.js +10 -10
  61. package/lib-commonjs/hooks/useControllableState.js.map +1 -1
  62. package/lib-commonjs/hooks/useEventCallback.js +1 -1
  63. package/lib-commonjs/hooks/useEventCallback.js.map +1 -1
  64. package/lib-commonjs/hooks/useFirstMount.js.map +1 -1
  65. package/lib-commonjs/hooks/useForceUpdate.js.map +1 -1
  66. package/lib-commonjs/hooks/useId.js +4 -4
  67. package/lib-commonjs/hooks/useId.js.map +1 -1
  68. package/lib-commonjs/hooks/useIsomorphicLayoutEffect.js.map +1 -1
  69. package/lib-commonjs/hooks/useMergedRefs.js +1 -1
  70. package/lib-commonjs/hooks/useMergedRefs.js.map +1 -1
  71. package/lib-commonjs/hooks/useOnClickOutside.js +28 -18
  72. package/lib-commonjs/hooks/useOnClickOutside.js.map +1 -1
  73. package/lib-commonjs/hooks/useOnScrollOutside.js +7 -5
  74. package/lib-commonjs/hooks/useOnScrollOutside.js.map +1 -1
  75. package/lib-commonjs/hooks/usePrevious.js.map +1 -1
  76. package/lib-commonjs/hooks/useScrollbarWidth.js +4 -4
  77. package/lib-commonjs/hooks/useScrollbarWidth.js.map +1 -1
  78. package/lib-commonjs/hooks/useTimeout.js.map +1 -1
  79. package/lib-commonjs/index.js.map +1 -1
  80. package/lib-commonjs/ssr/SSRContext.js +9 -8
  81. package/lib-commonjs/ssr/SSRContext.js.map +1 -1
  82. package/lib-commonjs/ssr/canUseDOM.js +1 -1
  83. package/lib-commonjs/ssr/canUseDOM.js.map +1 -1
  84. package/lib-commonjs/ssr/index.js.map +1 -1
  85. package/lib-commonjs/trigger/applyTriggerPropsToChildren.js +2 -2
  86. package/lib-commonjs/trigger/applyTriggerPropsToChildren.js.map +1 -1
  87. package/lib-commonjs/trigger/getTriggerChild.js.map +1 -1
  88. package/lib-commonjs/trigger/index.js.map +1 -1
  89. package/lib-commonjs/trigger/isFluentTrigger.js.map +1 -1
  90. package/lib-commonjs/trigger/types.js.map +1 -1
  91. package/lib-commonjs/utils/getNativeElementProps.js +2 -2
  92. package/lib-commonjs/utils/getNativeElementProps.js.map +1 -1
  93. package/lib-commonjs/utils/getRTLSafeKey.js +5 -5
  94. package/lib-commonjs/utils/getRTLSafeKey.js.map +1 -1
  95. package/lib-commonjs/utils/getReactCallbackName.js +2 -2
  96. package/lib-commonjs/utils/getReactCallbackName.js.map +1 -1
  97. package/lib-commonjs/utils/index.js.map +1 -1
  98. package/lib-commonjs/utils/isHTMLElement.js +3 -1
  99. package/lib-commonjs/utils/isHTMLElement.js.map +1 -1
  100. package/lib-commonjs/utils/isInteractiveHTMLElement.js +4 -4
  101. package/lib-commonjs/utils/isInteractiveHTMLElement.js.map +1 -1
  102. package/lib-commonjs/utils/mergeCallbacks.js +2 -2
  103. package/lib-commonjs/utils/mergeCallbacks.js.map +1 -1
  104. package/lib-commonjs/utils/properties.js +214 -214
  105. package/lib-commonjs/utils/properties.js.map +1 -1
  106. package/package.json +3 -2
@@ -50,268 +50,268 @@ const toObjectMap = (...items)=>{
50
50
  return result;
51
51
  };
52
52
  const baseElementEvents = /*#__PURE__*/ toObjectMap([
53
- "onAuxClick",
54
- "onCopy",
55
- "onCut",
56
- "onPaste",
57
- "onCompositionEnd",
58
- "onCompositionStart",
59
- "onCompositionUpdate",
60
- "onFocus",
61
- "onFocusCapture",
62
- "onBlur",
63
- "onBlurCapture",
64
- "onChange",
65
- "onInput",
66
- "onSubmit",
67
- "onLoad",
68
- "onError",
69
- "onKeyDown",
70
- "onKeyDownCapture",
71
- "onKeyPress",
72
- "onKeyUp",
73
- "onAbort",
74
- "onCanPlay",
75
- "onCanPlayThrough",
76
- "onDurationChange",
77
- "onEmptied",
78
- "onEncrypted",
79
- "onEnded",
80
- "onLoadedData",
81
- "onLoadedMetadata",
82
- "onLoadStart",
83
- "onPause",
84
- "onPlay",
85
- "onPlaying",
86
- "onProgress",
87
- "onRateChange",
88
- "onSeeked",
89
- "onSeeking",
90
- "onStalled",
91
- "onSuspend",
92
- "onTimeUpdate",
93
- "onVolumeChange",
94
- "onWaiting",
95
- "onClick",
96
- "onClickCapture",
97
- "onContextMenu",
98
- "onDoubleClick",
99
- "onDrag",
100
- "onDragEnd",
101
- "onDragEnter",
102
- "onDragExit",
103
- "onDragLeave",
104
- "onDragOver",
105
- "onDragStart",
106
- "onDrop",
107
- "onMouseDown",
108
- "onMouseDownCapture",
109
- "onMouseEnter",
110
- "onMouseLeave",
111
- "onMouseMove",
112
- "onMouseOut",
113
- "onMouseOver",
114
- "onMouseUp",
115
- "onMouseUpCapture",
116
- "onSelect",
117
- "onTouchCancel",
118
- "onTouchEnd",
119
- "onTouchMove",
120
- "onTouchStart",
121
- "onScroll",
122
- "onWheel",
123
- "onPointerCancel",
124
- "onPointerDown",
125
- "onPointerEnter",
126
- "onPointerLeave",
127
- "onPointerMove",
128
- "onPointerOut",
129
- "onPointerOver",
130
- "onPointerUp",
131
- "onGotPointerCapture",
132
- "onLostPointerCapture"
53
+ 'onAuxClick',
54
+ 'onCopy',
55
+ 'onCut',
56
+ 'onPaste',
57
+ 'onCompositionEnd',
58
+ 'onCompositionStart',
59
+ 'onCompositionUpdate',
60
+ 'onFocus',
61
+ 'onFocusCapture',
62
+ 'onBlur',
63
+ 'onBlurCapture',
64
+ 'onChange',
65
+ 'onInput',
66
+ 'onSubmit',
67
+ 'onLoad',
68
+ 'onError',
69
+ 'onKeyDown',
70
+ 'onKeyDownCapture',
71
+ 'onKeyPress',
72
+ 'onKeyUp',
73
+ 'onAbort',
74
+ 'onCanPlay',
75
+ 'onCanPlayThrough',
76
+ 'onDurationChange',
77
+ 'onEmptied',
78
+ 'onEncrypted',
79
+ 'onEnded',
80
+ 'onLoadedData',
81
+ 'onLoadedMetadata',
82
+ 'onLoadStart',
83
+ 'onPause',
84
+ 'onPlay',
85
+ 'onPlaying',
86
+ 'onProgress',
87
+ 'onRateChange',
88
+ 'onSeeked',
89
+ 'onSeeking',
90
+ 'onStalled',
91
+ 'onSuspend',
92
+ 'onTimeUpdate',
93
+ 'onVolumeChange',
94
+ 'onWaiting',
95
+ 'onClick',
96
+ 'onClickCapture',
97
+ 'onContextMenu',
98
+ 'onDoubleClick',
99
+ 'onDrag',
100
+ 'onDragEnd',
101
+ 'onDragEnter',
102
+ 'onDragExit',
103
+ 'onDragLeave',
104
+ 'onDragOver',
105
+ 'onDragStart',
106
+ 'onDrop',
107
+ 'onMouseDown',
108
+ 'onMouseDownCapture',
109
+ 'onMouseEnter',
110
+ 'onMouseLeave',
111
+ 'onMouseMove',
112
+ 'onMouseOut',
113
+ 'onMouseOver',
114
+ 'onMouseUp',
115
+ 'onMouseUpCapture',
116
+ 'onSelect',
117
+ 'onTouchCancel',
118
+ 'onTouchEnd',
119
+ 'onTouchMove',
120
+ 'onTouchStart',
121
+ 'onScroll',
122
+ 'onWheel',
123
+ 'onPointerCancel',
124
+ 'onPointerDown',
125
+ 'onPointerEnter',
126
+ 'onPointerLeave',
127
+ 'onPointerMove',
128
+ 'onPointerOut',
129
+ 'onPointerOver',
130
+ 'onPointerUp',
131
+ 'onGotPointerCapture',
132
+ 'onLostPointerCapture'
133
133
  ]);
134
134
  const baseElementProperties = /*#__PURE__*/ toObjectMap([
135
- "accessKey",
136
- "children",
137
- "className",
138
- "contentEditable",
139
- "dir",
140
- "draggable",
141
- "hidden",
142
- "htmlFor",
143
- "id",
144
- "lang",
145
- "ref",
146
- "role",
147
- "style",
148
- "tabIndex",
149
- "title",
150
- "translate",
151
- "spellCheck",
152
- "name"
135
+ 'accessKey',
136
+ 'children',
137
+ 'className',
138
+ 'contentEditable',
139
+ 'dir',
140
+ 'draggable',
141
+ 'hidden',
142
+ 'htmlFor',
143
+ 'id',
144
+ 'lang',
145
+ 'ref',
146
+ 'role',
147
+ 'style',
148
+ 'tabIndex',
149
+ 'title',
150
+ 'translate',
151
+ 'spellCheck',
152
+ 'name'
153
153
  ]);
154
154
  const microdataProperties = /*#__PURE__*/ toObjectMap([
155
- "itemID",
156
- "itemProp",
157
- "itemRef",
158
- "itemScope",
159
- "itemType"
155
+ 'itemID',
156
+ 'itemProp',
157
+ 'itemRef',
158
+ 'itemScope',
159
+ 'itemType'
160
160
  ]);
161
161
  const htmlElementProperties = /*#__PURE__*/ toObjectMap(baseElementProperties, baseElementEvents, microdataProperties);
162
162
  const labelProperties = /*#__PURE__*/ toObjectMap(htmlElementProperties, [
163
- "form"
163
+ 'form'
164
164
  ]);
165
165
  const audioProperties = /*#__PURE__*/ toObjectMap(htmlElementProperties, [
166
- "height",
167
- "loop",
168
- "muted",
169
- "preload",
170
- "src",
171
- "width"
166
+ 'height',
167
+ 'loop',
168
+ 'muted',
169
+ 'preload',
170
+ 'src',
171
+ 'width'
172
172
  ]);
173
173
  const videoProperties = /*#__PURE__*/ toObjectMap(audioProperties, [
174
- "poster"
174
+ 'poster'
175
175
  ]);
176
176
  const olProperties = /*#__PURE__*/ toObjectMap(htmlElementProperties, [
177
- "start"
177
+ 'start'
178
178
  ]);
179
179
  const liProperties = /*#__PURE__*/ toObjectMap(htmlElementProperties, [
180
- "value"
180
+ 'value'
181
181
  ]);
182
182
  const anchorProperties = /*#__PURE__*/ toObjectMap(htmlElementProperties, [
183
- "download",
184
- "href",
185
- "hrefLang",
186
- "media",
187
- "rel",
188
- "target",
189
- "type"
183
+ 'download',
184
+ 'href',
185
+ 'hrefLang',
186
+ 'media',
187
+ 'rel',
188
+ 'target',
189
+ 'type'
190
190
  ]);
191
191
  const timeProperties = /*#__PURE__*/ toObjectMap(htmlElementProperties, [
192
- "dateTime"
192
+ 'dateTime'
193
193
  ]);
194
194
  const buttonProperties = /*#__PURE__*/ toObjectMap(htmlElementProperties, [
195
- "autoFocus",
196
- "disabled",
197
- "form",
198
- "formAction",
199
- "formEncType",
200
- "formMethod",
201
- "formNoValidate",
202
- "formTarget",
203
- "type",
204
- "value"
195
+ 'autoFocus',
196
+ 'disabled',
197
+ 'form',
198
+ 'formAction',
199
+ 'formEncType',
200
+ 'formMethod',
201
+ 'formNoValidate',
202
+ 'formTarget',
203
+ 'type',
204
+ 'value'
205
205
  ]);
206
206
  const inputProperties = /*#__PURE__*/ toObjectMap(buttonProperties, [
207
- "accept",
208
- "alt",
209
- "autoCapitalize",
210
- "autoComplete",
211
- "checked",
212
- "dirname",
213
- "form",
214
- "height",
215
- "inputMode",
216
- "list",
217
- "max",
218
- "maxLength",
219
- "min",
220
- "multiple",
221
- "pattern",
222
- "placeholder",
223
- "readOnly",
224
- "required",
225
- "src",
226
- "step",
227
- "size",
228
- "type",
229
- "value",
230
- "width"
207
+ 'accept',
208
+ 'alt',
209
+ 'autoCapitalize',
210
+ 'autoComplete',
211
+ 'checked',
212
+ 'dirname',
213
+ 'form',
214
+ 'height',
215
+ 'inputMode',
216
+ 'list',
217
+ 'max',
218
+ 'maxLength',
219
+ 'min',
220
+ 'multiple',
221
+ 'pattern',
222
+ 'placeholder',
223
+ 'readOnly',
224
+ 'required',
225
+ 'src',
226
+ 'step',
227
+ 'size',
228
+ 'type',
229
+ 'value',
230
+ 'width'
231
231
  ]);
232
232
  const textAreaProperties = /*#__PURE__*/ toObjectMap(buttonProperties, [
233
- "autoCapitalize",
234
- "cols",
235
- "dirname",
236
- "form",
237
- "maxLength",
238
- "placeholder",
239
- "readOnly",
240
- "required",
241
- "rows",
242
- "wrap"
233
+ 'autoCapitalize',
234
+ 'cols',
235
+ 'dirname',
236
+ 'form',
237
+ 'maxLength',
238
+ 'placeholder',
239
+ 'readOnly',
240
+ 'required',
241
+ 'rows',
242
+ 'wrap'
243
243
  ]);
244
244
  const selectProperties = /*#__PURE__*/ toObjectMap(buttonProperties, [
245
- "form",
246
- "multiple",
247
- "required"
245
+ 'form',
246
+ 'multiple',
247
+ 'required'
248
248
  ]);
249
249
  const optionProperties = /*#__PURE__*/ toObjectMap(htmlElementProperties, [
250
- "selected",
251
- "value"
250
+ 'selected',
251
+ 'value'
252
252
  ]);
253
253
  const tableProperties = /*#__PURE__*/ toObjectMap(htmlElementProperties, [
254
- "cellPadding",
255
- "cellSpacing"
254
+ 'cellPadding',
255
+ 'cellSpacing'
256
256
  ]);
257
257
  const trProperties = htmlElementProperties;
258
258
  const thProperties = /*#__PURE__*/ toObjectMap(htmlElementProperties, [
259
- "colSpan",
260
- "rowSpan",
261
- "scope"
259
+ 'colSpan',
260
+ 'rowSpan',
261
+ 'scope'
262
262
  ]);
263
263
  const tdProperties = /*#__PURE__*/ toObjectMap(htmlElementProperties, [
264
- "colSpan",
265
- "headers",
266
- "rowSpan",
267
- "scope"
264
+ 'colSpan',
265
+ 'headers',
266
+ 'rowSpan',
267
+ 'scope'
268
268
  ]);
269
269
  const colGroupProperties = /*#__PURE__*/ toObjectMap(htmlElementProperties, [
270
- "span"
270
+ 'span'
271
271
  ]);
272
272
  const colProperties = /*#__PURE__*/ toObjectMap(htmlElementProperties, [
273
- "span"
273
+ 'span'
274
274
  ]);
275
275
  const fieldsetProperties = /*#__PURE__*/ toObjectMap(htmlElementProperties, [
276
- "disabled",
277
- "form"
276
+ 'disabled',
277
+ 'form'
278
278
  ]);
279
279
  const formProperties = /*#__PURE__*/ toObjectMap(htmlElementProperties, [
280
- "acceptCharset",
281
- "action",
282
- "encType",
283
- "encType",
284
- "method",
285
- "noValidate",
286
- "target"
280
+ 'acceptCharset',
281
+ 'action',
282
+ 'encType',
283
+ 'encType',
284
+ 'method',
285
+ 'noValidate',
286
+ 'target'
287
287
  ]);
288
288
  const iframeProperties = /*#__PURE__*/ toObjectMap(htmlElementProperties, [
289
- "allow",
290
- "allowFullScreen",
291
- "allowPaymentRequest",
292
- "allowTransparency",
293
- "csp",
294
- "height",
295
- "importance",
296
- "referrerPolicy",
297
- "sandbox",
298
- "src",
299
- "srcDoc",
300
- "width"
289
+ 'allow',
290
+ 'allowFullScreen',
291
+ 'allowPaymentRequest',
292
+ 'allowTransparency',
293
+ 'csp',
294
+ 'height',
295
+ 'importance',
296
+ 'referrerPolicy',
297
+ 'sandbox',
298
+ 'src',
299
+ 'srcDoc',
300
+ 'width'
301
301
  ]);
302
302
  const imgProperties = /*#__PURE__*/ toObjectMap(htmlElementProperties, [
303
- "alt",
304
- "crossOrigin",
305
- "height",
306
- "src",
307
- "srcSet",
308
- "useMap",
309
- "width"
303
+ 'alt',
304
+ 'crossOrigin',
305
+ 'height',
306
+ 'src',
307
+ 'srcSet',
308
+ 'useMap',
309
+ 'width'
310
310
  ]);
311
311
  const dialogProperties = /*#__PURE__*/ toObjectMap(htmlElementProperties, [
312
- "open",
313
- "onCancel",
314
- "onClose"
312
+ 'open',
313
+ 'onCancel',
314
+ 'onClose'
315
315
  ]);
316
316
  const divProperties = htmlElementProperties;
317
317
  function getNativeProps(// eslint-disable-next-line @typescript-eslint/no-explicit-any
@@ -326,8 +326,8 @@ props, allowedPropNames, excludedPropNames) {
326
326
  const result = {};
327
327
  const keys = Object.keys(props);
328
328
  for (const key of keys){
329
- const isNativeProp = !isArray && allowedPropNames[key] || isArray && allowedPropNames.indexOf(key) >= 0 || key.indexOf("data-") === 0 || key.indexOf("aria-") === 0;
330
- if (isNativeProp && (!excludedPropNames || excludedPropNames?.indexOf(key) === -1)) {
329
+ const isNativeProp = !isArray && allowedPropNames[key] || isArray && allowedPropNames.indexOf(key) >= 0 || key.indexOf('data-') === 0 || key.indexOf('aria-') === 0;
330
+ if (isNativeProp && (!excludedPropNames || (excludedPropNames === null || excludedPropNames === void 0 ? void 0 : excludedPropNames.indexOf(key)) === -1)) {
331
331
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
332
332
  result[key] = props[key];
333
333
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["../../lib/utils/properties.js"],"sourcesContent":["const toObjectMap = (...items) => {\n const result = {};\n for (const item of items) {\n const keys = Array.isArray(item) ? item : Object.keys(item);\n for (const key of keys) {\n result[key] = 1;\n }\n }\n return result;\n};\n/**\n * An array of events that are allowed on every html element type.\n *\n * @public\n */\nexport const baseElementEvents = /*#__PURE__*/toObjectMap([\"onAuxClick\", \"onCopy\", \"onCut\", \"onPaste\", \"onCompositionEnd\", \"onCompositionStart\", \"onCompositionUpdate\", \"onFocus\", \"onFocusCapture\", \"onBlur\", \"onBlurCapture\", \"onChange\", \"onInput\", \"onSubmit\", \"onLoad\", \"onError\", \"onKeyDown\", \"onKeyDownCapture\", \"onKeyPress\", \"onKeyUp\", \"onAbort\", \"onCanPlay\", \"onCanPlayThrough\", \"onDurationChange\", \"onEmptied\", \"onEncrypted\", \"onEnded\", \"onLoadedData\", \"onLoadedMetadata\", \"onLoadStart\", \"onPause\", \"onPlay\", \"onPlaying\", \"onProgress\", \"onRateChange\", \"onSeeked\", \"onSeeking\", \"onStalled\", \"onSuspend\", \"onTimeUpdate\", \"onVolumeChange\", \"onWaiting\", \"onClick\", \"onClickCapture\", \"onContextMenu\", \"onDoubleClick\", \"onDrag\", \"onDragEnd\", \"onDragEnter\", \"onDragExit\", \"onDragLeave\", \"onDragOver\", \"onDragStart\", \"onDrop\", \"onMouseDown\", \"onMouseDownCapture\", \"onMouseEnter\", \"onMouseLeave\", \"onMouseMove\", \"onMouseOut\", \"onMouseOver\", \"onMouseUp\", \"onMouseUpCapture\", \"onSelect\", \"onTouchCancel\", \"onTouchEnd\", \"onTouchMove\", \"onTouchStart\", \"onScroll\", \"onWheel\", \"onPointerCancel\", \"onPointerDown\", \"onPointerEnter\", \"onPointerLeave\", \"onPointerMove\", \"onPointerOut\", \"onPointerOver\", \"onPointerUp\", \"onGotPointerCapture\", \"onLostPointerCapture\"]);\n/**\n * An array of element attributes which are allowed on every html element type.\n *\n * @public\n */\nexport const baseElementProperties = /*#__PURE__*/toObjectMap([\"accessKey\", \"children\", \"className\", \"contentEditable\", \"dir\", \"draggable\", \"hidden\", \"htmlFor\", \"id\", \"lang\", \"ref\", \"role\", \"style\", \"tabIndex\", \"title\", \"translate\", \"spellCheck\", \"name\"]);\n/**\n * An array of microdata attributes that are allowed on every html element type.\n *\n * @public\n */\nexport const microdataProperties = /*#__PURE__*/toObjectMap([\"itemID\", \"itemProp\", \"itemRef\", \"itemScope\", \"itemType\"]);\n/**\n * An array of HTML element properties and events.\n *\n * @public\n */\nexport const htmlElementProperties = /*#__PURE__*/toObjectMap(baseElementProperties, baseElementEvents, microdataProperties);\n/**\n * An array of LABEL tag properties and events.\n *\n * @public\n */\nexport const labelProperties = /*#__PURE__*/toObjectMap(htmlElementProperties, [\"form\"]);\n/**\n * An array of AUDIO tag properties and events.\n\n * @public\n */\nexport const audioProperties = /*#__PURE__*/toObjectMap(htmlElementProperties, [\"height\", \"loop\", \"muted\", \"preload\", \"src\", \"width\"]);\n/**\n * An array of VIDEO tag properties and events.\n *\n * @public\n */\nexport const videoProperties = /*#__PURE__*/toObjectMap(audioProperties, [\"poster\"]);\n/**\n * An array of OL tag properties and events.\n *\n * @public\n */\nexport const olProperties = /*#__PURE__*/toObjectMap(htmlElementProperties, [\"start\"]);\n/**\n * An array of LI tag properties and events.\n *\n * @public\n */\nexport const liProperties = /*#__PURE__*/toObjectMap(htmlElementProperties, [\"value\"]);\n/**\n * An array of A tag properties and events.\n *\n * @public\n */\nexport const anchorProperties = /*#__PURE__*/toObjectMap(htmlElementProperties, [\"download\", \"href\", \"hrefLang\", \"media\", \"rel\", \"target\", \"type\"]);\n/**\n * An array of TIME tag properties and events.\n *\n * @public\n */\nexport const timeProperties = /*#__PURE__*/toObjectMap(htmlElementProperties, [\"dateTime\"]);\n/**\n * An array of BUTTON tag properties and events.\n *\n * @public\n */\nexport const buttonProperties = /*#__PURE__*/toObjectMap(htmlElementProperties, [\"autoFocus\", \"disabled\", \"form\", \"formAction\", \"formEncType\", \"formMethod\", \"formNoValidate\", \"formTarget\", \"type\", \"value\"]);\n/**\n * An array of INPUT tag properties and events.\n *\n * @public\n */\nexport const inputProperties = /*#__PURE__*/toObjectMap(buttonProperties, [\"accept\", \"alt\", \"autoCapitalize\", \"autoComplete\", \"checked\", \"dirname\", \"form\", \"height\", \"inputMode\", \"list\", \"max\", \"maxLength\", \"min\", \"multiple\", \"pattern\", \"placeholder\", \"readOnly\", \"required\", \"src\", \"step\", \"size\", \"type\", \"value\", \"width\"]);\n/**\n * An array of TEXTAREA tag properties and events.\n *\n * @public\n */\nexport const textAreaProperties = /*#__PURE__*/toObjectMap(buttonProperties, [\"autoCapitalize\", \"cols\", \"dirname\", \"form\", \"maxLength\", \"placeholder\", \"readOnly\", \"required\", \"rows\", \"wrap\"]);\n/**\n * An array of SELECT tag properties and events.\n *\n * @public\n */\nexport const selectProperties = /*#__PURE__*/toObjectMap(buttonProperties, [\"form\", \"multiple\", \"required\"]);\nexport const optionProperties = /*#__PURE__*/toObjectMap(htmlElementProperties, [\"selected\", \"value\"]);\n/**\n * An array of TABLE tag properties and events.\n *\n * @public\n */\nexport const tableProperties = /*#__PURE__*/toObjectMap(htmlElementProperties, [\"cellPadding\", \"cellSpacing\"]);\n/**\n * An array of TR tag properties and events.\n *\n * @public\n */\nexport const trProperties = htmlElementProperties;\n/**\n * An array of TH tag properties and events.\n *\n * @public\n */\nexport const thProperties = /*#__PURE__*/toObjectMap(htmlElementProperties, [\"colSpan\", \"rowSpan\", \"scope\"]);\n/**\n * An array of TD tag properties and events.\n *\n * @public\n */\nexport const tdProperties = /*#__PURE__*/toObjectMap(htmlElementProperties, [\"colSpan\", \"headers\", \"rowSpan\", \"scope\"]);\nexport const colGroupProperties = /*#__PURE__*/toObjectMap(htmlElementProperties, [\"span\"]);\nexport const colProperties = /*#__PURE__*/toObjectMap(htmlElementProperties, [\"span\"]);\n/**\n * An array of FIELDSET tag properties and events.\n *\n * @public\n */\nexport const fieldsetProperties = /*#__PURE__*/toObjectMap(htmlElementProperties, [\"disabled\", \"form\"]);\n/**\n * An array of FORM tag properties and events.\n *\n * @public\n */\nexport const formProperties = /*#__PURE__*/toObjectMap(htmlElementProperties, [\"acceptCharset\", \"action\", \"encType\", \"encType\", \"method\", \"noValidate\", \"target\"]);\n/**\n * An array of IFRAME tag properties and events.\n *\n * @public\n */\nexport const iframeProperties = /*#__PURE__*/toObjectMap(htmlElementProperties, [\"allow\", \"allowFullScreen\", \"allowPaymentRequest\", \"allowTransparency\", \"csp\", \"height\", \"importance\", \"referrerPolicy\", \"sandbox\", \"src\", \"srcDoc\", \"width\"]);\n/**\n * An array of IMAGE tag properties and events.\n *\n * @public\n */\nexport const imgProperties = /*#__PURE__*/toObjectMap(htmlElementProperties, [\"alt\", \"crossOrigin\", \"height\", \"src\", \"srcSet\", \"useMap\", \"width\"]);\n/**\n * An array of DIALOG tag properties and events.\n *\n * @public\n */\nexport const dialogProperties = /*#__PURE__*/toObjectMap(htmlElementProperties, [\"open\", \"onCancel\", \"onClose\"]);\n/**\n * An array of DIV tag properties and events.\n *\n * @public\n */\nexport const divProperties = htmlElementProperties;\n/**\n * Gets native supported props for an html element provided the allowance set. Use one of the property\n * sets defined (divProperties, buttonPropertes, etc) to filter out supported properties from a given\n * props set. Note that all data- and aria- prefixed attributes will be allowed.\n * NOTE: getNativeProps should always be applied first when adding props to a react component. The\n * non-native props should be applied second. This will prevent getNativeProps from overriding your custom props.\n * For example, if props passed to getNativeProps has an onClick function and getNativeProps is added to\n * the component after an onClick function is added, then the getNativeProps onClick will override it.\n *\n * @public\n * @param props - The unfiltered input props\n * @param allowedPropNames - The array or record of allowed prop names.\n * @param excludedPropNames\n * @returns The filtered props\n */ // eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport function getNativeProps(\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nprops, allowedPropNames, excludedPropNames) {\n // It'd be great to properly type this while allowing 'aria-` and 'data-' attributes like TypeScript does for\n // JSX attributes, but that ability is hardcoded into the TS compiler with no analog in TypeScript typings.\n // Then we'd be able to enforce props extends native props (including aria- and data- attributes), and then\n // return native props.\n // We should be able to do this once this PR is merged: https://github.com/microsoft/TypeScript/pull/26797\n const isArray = Array.isArray(allowedPropNames);\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const result = {};\n const keys = Object.keys(props);\n for (const key of keys) {\n const isNativeProp = !isArray && allowedPropNames[key] || isArray && allowedPropNames.indexOf(key) >= 0 || key.indexOf(\"data-\") === 0 || key.indexOf(\"aria-\") === 0;\n if (isNativeProp && (!excludedPropNames || excludedPropNames?.indexOf(key) === -1)) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n result[key] = props[key];\n }\n }\n return result;\n}\n//# sourceMappingURL=properties.js.map"],"names":["baseElementEvents","baseElementProperties","microdataProperties","htmlElementProperties","labelProperties","audioProperties","videoProperties","olProperties","liProperties","anchorProperties","timeProperties","buttonProperties","inputProperties","textAreaProperties","selectProperties","optionProperties","tableProperties","trProperties","thProperties","tdProperties","colGroupProperties","colProperties","fieldsetProperties","formProperties","iframeProperties","imgProperties","dialogProperties","divProperties","getNativeProps","toObjectMap","items","result","item","keys","Array","isArray","Object","key","props","allowedProp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AW,GAAEI,YAAY1B,uBAAuB;IAAC;IAAO;IAAe;IAAU;IAAO;IAAU;IAAU;CAAQ;AAM1I,MAAMuB,mBAAmB,WAAW,GAAEG,YAAY1B,uBAAuB;IAAC;IAAQ;IAAY;CAAU;AAMxG,MAAMwB,gBAAgBxB;AAgBtB,SAASyB,eAChB,8DAA8D;AAC9DU,KAAK,EAAEC,gBAAgB,EAAEC,iBAAiB,EAAE;IAC1C,6GAA6G;IAC7G,2GAA2G;IAC3G,2GAA2G;IAC3G,uBAAuB;IACvB,0GAA0G;IAC1G,MAAML,UAAUD,MAAMC,OAAO,CAACI;IAC9B,8DAA8D;IAC9D,MAAMR,SAAS,CAAC;IAChB,MAAME,OAAOG,OAAOH,IAAI,CAACK;IACzB,KAAK,MAAMD,OAAOJ,KAAM;QACtB,MAAMQ,eAAe,CAACN,WAAWI,gBAAgB,CAACF,IAAI,IAAIF,WAAWI,iBAAiBG,OAAO,CAACL,QAAQ,KAAKA,IAAIK,OAAO,CAAC,aAAa,KAAKL,IAAIK,OAAO,CAAC,aAAa;QAClK,IAAID,gBAAiB,CAAA,CAACD,qBAAqBA,mBAAmBE,QAAQL,SAAS,CAAC,CAAA,GAAI;YAClF,8DAA8D;YAC9DN,MAAM,CAACM,IAAI,GAAGC,KAAK,CAACD,IAAI;QAC1B,CAAC;IACH;IACA,OAAON;AACT,EACA,sCAAsC"}
1
+ {"version":3,"sources":["../../lib/utils/properties.js"],"sourcesContent":["const toObjectMap = (...items) => {\n const result = {};\n for (const item of items) {\n const keys = Array.isArray(item) ? item : Object.keys(item);\n for (const key of keys) {\n result[key] = 1;\n }\n }\n return result;\n};\n/**\n * An array of events that are allowed on every html element type.\n *\n * @public\n */\nexport const baseElementEvents = /*#__PURE__*/toObjectMap(['onAuxClick', 'onCopy', 'onCut', 'onPaste', 'onCompositionEnd', 'onCompositionStart', 'onCompositionUpdate', 'onFocus', 'onFocusCapture', 'onBlur', 'onBlurCapture', 'onChange', 'onInput', 'onSubmit', 'onLoad', 'onError', 'onKeyDown', 'onKeyDownCapture', 'onKeyPress', 'onKeyUp', 'onAbort', 'onCanPlay', 'onCanPlayThrough', 'onDurationChange', 'onEmptied', 'onEncrypted', 'onEnded', 'onLoadedData', 'onLoadedMetadata', 'onLoadStart', 'onPause', 'onPlay', 'onPlaying', 'onProgress', 'onRateChange', 'onSeeked', 'onSeeking', 'onStalled', 'onSuspend', 'onTimeUpdate', 'onVolumeChange', 'onWaiting', 'onClick', 'onClickCapture', 'onContextMenu', 'onDoubleClick', 'onDrag', 'onDragEnd', 'onDragEnter', 'onDragExit', 'onDragLeave', 'onDragOver', 'onDragStart', 'onDrop', 'onMouseDown', 'onMouseDownCapture', 'onMouseEnter', 'onMouseLeave', 'onMouseMove', 'onMouseOut', 'onMouseOver', 'onMouseUp', 'onMouseUpCapture', 'onSelect', 'onTouchCancel', 'onTouchEnd', 'onTouchMove', 'onTouchStart', 'onScroll', 'onWheel', 'onPointerCancel', 'onPointerDown', 'onPointerEnter', 'onPointerLeave', 'onPointerMove', 'onPointerOut', 'onPointerOver', 'onPointerUp', 'onGotPointerCapture', 'onLostPointerCapture']);\n/**\n * An array of element attributes which are allowed on every html element type.\n *\n * @public\n */\nexport const baseElementProperties = /*#__PURE__*/toObjectMap(['accessKey', 'children', 'className', 'contentEditable', 'dir', 'draggable', 'hidden', 'htmlFor', 'id', 'lang', 'ref', 'role', 'style', 'tabIndex', 'title', 'translate', 'spellCheck', 'name']);\n/**\n * An array of microdata attributes that are allowed on every html element type.\n *\n * @public\n */\nexport const microdataProperties = /*#__PURE__*/toObjectMap(['itemID', 'itemProp', 'itemRef', 'itemScope', 'itemType']);\n/**\n * An array of HTML element properties and events.\n *\n * @public\n */\nexport const htmlElementProperties = /*#__PURE__*/toObjectMap(baseElementProperties, baseElementEvents, microdataProperties);\n/**\n * An array of LABEL tag properties and events.\n *\n * @public\n */\nexport const labelProperties = /*#__PURE__*/toObjectMap(htmlElementProperties, ['form']);\n/**\n * An array of AUDIO tag properties and events.\n\n * @public\n */\nexport const audioProperties = /*#__PURE__*/toObjectMap(htmlElementProperties, ['height', 'loop', 'muted', 'preload', 'src', 'width']);\n/**\n * An array of VIDEO tag properties and events.\n *\n * @public\n */\nexport const videoProperties = /*#__PURE__*/toObjectMap(audioProperties, ['poster']);\n/**\n * An array of OL tag properties and events.\n *\n * @public\n */\nexport const olProperties = /*#__PURE__*/toObjectMap(htmlElementProperties, ['start']);\n/**\n * An array of LI tag properties and events.\n *\n * @public\n */\nexport const liProperties = /*#__PURE__*/toObjectMap(htmlElementProperties, ['value']);\n/**\n * An array of A tag properties and events.\n *\n * @public\n */\nexport const anchorProperties = /*#__PURE__*/toObjectMap(htmlElementProperties, ['download', 'href', 'hrefLang', 'media', 'rel', 'target', 'type']);\n/**\n * An array of TIME tag properties and events.\n *\n * @public\n */\nexport const timeProperties = /*#__PURE__*/toObjectMap(htmlElementProperties, ['dateTime']);\n/**\n * An array of BUTTON tag properties and events.\n *\n * @public\n */\nexport const buttonProperties = /*#__PURE__*/toObjectMap(htmlElementProperties, ['autoFocus', 'disabled', 'form', 'formAction', 'formEncType', 'formMethod', 'formNoValidate', 'formTarget', 'type', 'value']);\n/**\n * An array of INPUT tag properties and events.\n *\n * @public\n */\nexport const inputProperties = /*#__PURE__*/toObjectMap(buttonProperties, ['accept', 'alt', 'autoCapitalize', 'autoComplete', 'checked', 'dirname', 'form', 'height', 'inputMode', 'list', 'max', 'maxLength', 'min', 'multiple', 'pattern', 'placeholder', 'readOnly', 'required', 'src', 'step', 'size', 'type', 'value', 'width']);\n/**\n * An array of TEXTAREA tag properties and events.\n *\n * @public\n */\nexport const textAreaProperties = /*#__PURE__*/toObjectMap(buttonProperties, ['autoCapitalize', 'cols', 'dirname', 'form', 'maxLength', 'placeholder', 'readOnly', 'required', 'rows', 'wrap']);\n/**\n * An array of SELECT tag properties and events.\n *\n * @public\n */\nexport const selectProperties = /*#__PURE__*/toObjectMap(buttonProperties, ['form', 'multiple', 'required']);\nexport const optionProperties = /*#__PURE__*/toObjectMap(htmlElementProperties, ['selected', 'value']);\n/**\n * An array of TABLE tag properties and events.\n *\n * @public\n */\nexport const tableProperties = /*#__PURE__*/toObjectMap(htmlElementProperties, ['cellPadding', 'cellSpacing']);\n/**\n * An array of TR tag properties and events.\n *\n * @public\n */\nexport const trProperties = htmlElementProperties;\n/**\n * An array of TH tag properties and events.\n *\n * @public\n */\nexport const thProperties = /*#__PURE__*/toObjectMap(htmlElementProperties, ['colSpan', 'rowSpan', 'scope']);\n/**\n * An array of TD tag properties and events.\n *\n * @public\n */\nexport const tdProperties = /*#__PURE__*/toObjectMap(htmlElementProperties, ['colSpan', 'headers', 'rowSpan', 'scope']);\nexport const colGroupProperties = /*#__PURE__*/toObjectMap(htmlElementProperties, ['span']);\nexport const colProperties = /*#__PURE__*/toObjectMap(htmlElementProperties, ['span']);\n/**\n * An array of FIELDSET tag properties and events.\n *\n * @public\n */\nexport const fieldsetProperties = /*#__PURE__*/toObjectMap(htmlElementProperties, ['disabled', 'form']);\n/**\n * An array of FORM tag properties and events.\n *\n * @public\n */\nexport const formProperties = /*#__PURE__*/toObjectMap(htmlElementProperties, ['acceptCharset', 'action', 'encType', 'encType', 'method', 'noValidate', 'target']);\n/**\n * An array of IFRAME tag properties and events.\n *\n * @public\n */\nexport const iframeProperties = /*#__PURE__*/toObjectMap(htmlElementProperties, ['allow', 'allowFullScreen', 'allowPaymentRequest', 'allowTransparency', 'csp', 'height', 'importance', 'referrerPolicy', 'sandbox', 'src', 'srcDoc', 'width']);\n/**\n * An array of IMAGE tag properties and events.\n *\n * @public\n */\nexport const imgProperties = /*#__PURE__*/toObjectMap(htmlElementProperties, ['alt', 'crossOrigin', 'height', 'src', 'srcSet', 'useMap', 'width']);\n/**\n * An array of DIALOG tag properties and events.\n *\n * @public\n */\nexport const dialogProperties = /*#__PURE__*/toObjectMap(htmlElementProperties, ['open', 'onCancel', 'onClose']);\n/**\n * An array of DIV tag properties and events.\n *\n * @public\n */\nexport const divProperties = htmlElementProperties;\n/**\n * Gets native supported props for an html element provided the allowance set. Use one of the property\n * sets defined (divProperties, buttonPropertes, etc) to filter out supported properties from a given\n * props set. Note that all data- and aria- prefixed attributes will be allowed.\n * NOTE: getNativeProps should always be applied first when adding props to a react component. The\n * non-native props should be applied second. This will prevent getNativeProps from overriding your custom props.\n * For example, if props passed to getNativeProps has an onClick function and getNativeProps is added to\n * the component after an onClick function is added, then the getNativeProps onClick will override it.\n *\n * @public\n * @param props - The unfiltered input props\n * @param allowedPropNames - The array or record of allowed prop names.\n * @param excludedPropNames\n * @returns The filtered props\n */ // eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport function getNativeProps(\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nprops, allowedPropNames, excludedPropNames) {\n // It'd be great to properly type this while allowing 'aria-` and 'data-' attributes like TypeScript does for\n // JSX attributes, but that ability is hardcoded into the TS compiler with no analog in TypeScript typings.\n // Then we'd be able to enforce props extends native props (including aria- and data- attributes), and then\n // return native props.\n // We should be able to do this once this PR is merged: https://github.com/microsoft/TypeScript/pull/26797\n const isArray = Array.isArray(allowedPropNames);\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const result = {};\n const keys = Object.keys(props);\n for (const key of keys) {\n const isNativeProp = !isArray && allowedPropNames[key] || isArray && allowedPropNames.indexOf(key) >= 0 || key.indexOf('data-') === 0 || key.indexOf('aria-') === 0;\n if (isNativeProp && (!excludedPropNames || (excludedPropNames === null || excludedPropNames === void 0 ? void 0 : excludedPropNames.indexOf(key)) === -1)) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n result[key] = props[key];\n }\n }\n return result;\n}\n//# sourceMappingURL=properties.js.map"],"names":["baseElementEvents","baseElementProperties","microdataProperties","htmlElementProperties","labelProperties","audioProperties","videoProperties","olProperties","liProperties","anchorProperties","timeProperties","buttonProperties","inputProperties","textAreaProperties","selectProperties","optionProperties","tableProperties","trProperties","thProperties","tdProperties","colGroupProperties","colProperties","fieldsetProperties","formProperties","iframeProperties","imgProperties","dialogProperties","divProperties","getNativeProps","toObjectMap","items","result","item","keys","Array","isArray","Object","key","props","allowedPropNames","excludedPropNames","isNativeProp","indexOf"],"mappings":";;;;;;;;;;;IAeaA,iBAAiB,MAAjBA;IAMAC,qBAAqB,MAArBA;IAMAC,mBAAmB,MAAnBA;IAMAC,qBAAqB,MAArBA;IAMAC,eAAe,MAAfA;IAMAC,eAAe,MAAfA;IAMAC,eAAe,MAAfA;IAMAC,YAAY,MAAZA;IAMAC,YAAY,MAAZA;IAMAC,gBAAgB,MAAhBA;IAMAC,cAAc,MAAdA;IAMAC,gBAAgB,MAAhBA;IAMAC,eAAe,MAAfA;IAMAC,kBAAkB,MAAlBA;IAMAC,gBAAgB,MAAhBA;IACAC,gBAAgB,MAAhBA;IAMAC,eAAe,MAAfA;IAMAC,YAAY,MAAZA;IAMAC,YAAY,MAAZA;IAMAC,YAAY,MAAZA;IACAC,kBAAkB,MAAlBA;IACAC,aAAa,MAAbA;IAMAC,kBAAkB,MAAlBA;IAMAC,cAAc,MAAdA;IAMAC,gBAAgB,MAAhBA;IAMAC,aAAa,MAAbA;IAMAC,gBAAgB,MAAhBA;IAMAC,aAAa,MAAbA;IAgBGC,cAAc,MAAdA;;AAlLhB,MAAMC,cAAc,CAAC,GAAGC,QAAU;IAChC,MAAMC,SAAS,CAAC;IAChB,KAAK,MAAMC,QAAQF,MAAO;QACxB,MAAMG,OAAOC,MAAMC,OAAO,CAACH,QAAQA,OAAOI,OAAOH,IAAI,CAACD,KAAK;QAC3D,KAAK,MAAMK,OAAOJ,KAAM;YACtBF,MAAM,CAACM,IAAI,GAAG;QAChB;IACF;IACA,OAAON;AACT;AAMO,MAAM/B,oBAAoB,WAAW,GAAE6B,YAAY;IAAC;IAAc;IAAU;IAAS;IAAW;IAAoB;IAAsB;IAAuB;IAAW;IAAkB;IAAU;IAAiB;IAAY;IAAW;IAAY;IAAU;IAAW;IAAa;IAAoB;IAAc;IAAW;IAAW;IAAa;IAA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IAAqB;IAAO;IAAU;IAAc;IAAkB;IAAW;IAAO;IAAU;CAAQ;AAMvO,MAAMsB,gBAAgB,WAAW,GAAEI,YAAY1B,uBAAuB;IAAC;IAAO;IAAe;IAAU;IAAO;IAAU;IAAU;CAAQ;AAM1I,MAAMuB,mBAAmB,WAAW,GAAEG,YAAY1B,uBAAuB;IAAC;IAAQ;IAAY;CAAU;AAMxG,MAAMwB,gBAAgBxB;AAgBtB,SAASyB,eAChB,8DAA8D;AAC9DU,KAAK,EAAEC,gBAAgB,EAAEC,iBAAiB,EAAE;IAC1C,6GAA6G;IAC7G,2GAA2G;IAC3G,2GAA2G;IAC3G,uBAAuB;IACvB,0GAA0G;IAC1G,MAAML,UAAUD,MAAMC,OAAO,CAACI;IAC9B,8DAA8D;IAC9D,MAAMR,SAAS,CAAC;IAChB,MAAME,OAAOG,OAAOH,IAAI,CAACK;IACzB,KAAK,MAAMD,OAAOJ,KAAM;QACtB,MAAMQ,eAAe,CAACN,WAAWI,gBAAgB,CAACF,IAAI,IAAIF,WAAWI,iBAAiBG,OAAO,CAACL,QAAQ,KAAKA,IAAIK,OAAO,CAAC,aAAa,KAAKL,IAAIK,OAAO,CAAC,aAAa;QAClK,IAAID,gBAAiB,CAAA,CAACD,qBAAqB,AAACA,CAAAA,sBAAsB,IAAI,IAAIA,sBAAsB,KAAK,IAAI,KAAK,IAAIA,kBAAkBE,OAAO,CAACL,IAAI,AAAD,MAAO,CAAC,CAAA,GAAI;YACzJ,8DAA8D;YAC9DN,MAAM,CAACM,IAAI,GAAGC,KAAK,CAACD,IAAI;QAC1B,CAAC;IACH;IACA,OAAON;AACT,EACA,sCAAsC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluentui/react-utilities",
3
- "version": "0.0.0-nightly-20230317-1454.1",
3
+ "version": "0.0.0-nightly-20230322-0439.1",
4
4
  "description": "A set of general React-specific utilities.",
5
5
  "main": "lib-commonjs/index.js",
6
6
  "module": "lib/index.js",
@@ -28,7 +28,7 @@
28
28
  "@fluentui/scripts-tasks": "*"
29
29
  },
30
30
  "dependencies": {
31
- "@fluentui/keyboard-keys": "0.0.0-nightly-20230317-1454.1",
31
+ "@fluentui/keyboard-keys": "0.0.0-nightly-20230322-0439.1",
32
32
  "@swc/helpers": "^0.4.14"
33
33
  },
34
34
  "peerDependencies": {
@@ -39,6 +39,7 @@
39
39
  "exports": {
40
40
  ".": {
41
41
  "types": "./dist/index.d.ts",
42
+ "node": "./lib-commonjs/index.js",
42
43
  "import": "./lib/index.js",
43
44
  "require": "./lib-commonjs/index.js"
44
45
  },