@atlaskit/react-ufo 2.0.9 → 2.2.0
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/CHANGELOG.md +22 -0
- package/dist/cjs/vc/vc-observer/media-wrapper/MediaWrapper.js +16 -0
- package/dist/cjs/vc/vc-observer/media-wrapper/index.js +22 -10
- package/dist/cjs/vc/vc-observer/observers/index.js +46 -1
- package/dist/es2019/vc/vc-observer/media-wrapper/MediaWrapper.js +10 -0
- package/dist/es2019/vc/vc-observer/media-wrapper/index.js +1 -9
- package/dist/es2019/vc/vc-observer/observers/index.js +26 -1
- package/dist/esm/vc/vc-observer/media-wrapper/MediaWrapper.js +8 -0
- package/dist/esm/vc/vc-observer/media-wrapper/index.js +1 -7
- package/dist/esm/vc/vc-observer/observers/index.js +46 -1
- package/dist/types/vc/vc-observer/media-wrapper/MediaWrapper.d.ts +10 -0
- package/dist/types/vc/vc-observer/media-wrapper/index.d.ts +1 -7
- package/dist/types/vc/vc-observer/observers/index.d.ts +2 -1
- package/dist/types/vc/vc-observer/observers/types.d.ts +2 -1
- package/dist/types-ts4.5/vc/vc-observer/media-wrapper/MediaWrapper.d.ts +10 -0
- package/dist/types-ts4.5/vc/vc-observer/media-wrapper/index.d.ts +1 -7
- package/dist/types-ts4.5/vc/vc-observer/observers/index.d.ts +2 -1
- package/dist/types-ts4.5/vc/vc-observer/observers/types.d.ts +2 -1
- package/package.json +2 -2
- package/vc-media/package.json +15 -0
- package/vc/media/package.json +0 -15
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,27 @@
|
|
|
1
1
|
# @atlaskit/ufo-interaction-ignore
|
|
2
2
|
|
|
3
|
+
## 2.2.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#160594](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/160594)
|
|
8
|
+
[`4a91df26ce837`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/4a91df26ce837) -
|
|
9
|
+
Capture Style display changes
|
|
10
|
+
|
|
11
|
+
## 2.1.0
|
|
12
|
+
|
|
13
|
+
### Minor Changes
|
|
14
|
+
|
|
15
|
+
- [#160884](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/160884)
|
|
16
|
+
[`52e16a1e398bf`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/52e16a1e398bf) -
|
|
17
|
+
Exposing VC Media Wrapper Props object
|
|
18
|
+
|
|
19
|
+
### Patch Changes
|
|
20
|
+
|
|
21
|
+
- [#160884](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/160884)
|
|
22
|
+
[`52e16a1e398bf`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/52e16a1e398bf) -
|
|
23
|
+
Renamed entry point for VC Media export
|
|
24
|
+
|
|
3
25
|
## 2.0.9
|
|
4
26
|
|
|
5
27
|
### Patch Changes
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.VcMediaWrapperProps = exports.MEDIA_WRAPPER_TAG = void 0;
|
|
8
|
+
exports.default = MediaWrapper;
|
|
9
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
10
|
+
var _react = _interopRequireDefault(require("react"));
|
|
11
|
+
var MEDIA_WRAPPER_TAG = exports.MEDIA_WRAPPER_TAG = 'data-media-vc-wrapper';
|
|
12
|
+
var VcMediaWrapperProps = exports.VcMediaWrapperProps = (0, _defineProperty2.default)({}, MEDIA_WRAPPER_TAG, true);
|
|
13
|
+
function MediaWrapper(_ref) {
|
|
14
|
+
var children = _ref.children;
|
|
15
|
+
return /*#__PURE__*/_react.default.createElement("div", VcMediaWrapperProps, children);
|
|
16
|
+
}
|
|
@@ -1,15 +1,27 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
-
exports
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
7
|
+
Object.defineProperty(exports, "MEDIA_WRAPPER_TAG", {
|
|
8
|
+
enumerable: true,
|
|
9
|
+
get: function get() {
|
|
10
|
+
return _MediaWrapper.MEDIA_WRAPPER_TAG;
|
|
11
|
+
}
|
|
12
|
+
});
|
|
13
|
+
Object.defineProperty(exports, "VcMediaWrapperProps", {
|
|
14
|
+
enumerable: true,
|
|
15
|
+
get: function get() {
|
|
16
|
+
return _MediaWrapper.VcMediaWrapperProps;
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
Object.defineProperty(exports, "default", {
|
|
20
|
+
enumerable: true,
|
|
21
|
+
get: function get() {
|
|
22
|
+
return _MediaWrapper.default;
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
var _MediaWrapper = _interopRequireWildcard(require("./MediaWrapper"));
|
|
26
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
27
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
@@ -5,11 +5,15 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
exports.Observers = void 0;
|
|
8
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
8
9
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
9
10
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
10
11
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
11
12
|
var _vcUtils = require("../media-wrapper/vc-utils");
|
|
12
13
|
var _ssrPlaceholders = require("./ssr-placeholders");
|
|
14
|
+
function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t.return || t.return(); } finally { if (u) throw o; } } }; }
|
|
15
|
+
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
16
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
13
17
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
14
18
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
15
19
|
var state = {
|
|
@@ -179,13 +183,54 @@ var Observers = exports.Observers = /*#__PURE__*/function () {
|
|
|
179
183
|
});
|
|
180
184
|
} else if (mutation.type === 'attributes') {
|
|
181
185
|
if (mutation.target instanceof HTMLElement) {
|
|
182
|
-
|
|
186
|
+
// Commenting the following line temporarily.
|
|
187
|
+
// this.observeElement(mutation.target, mutation, 'attr', ignoreReason);
|
|
188
|
+
|
|
189
|
+
// using the if below to collect data
|
|
190
|
+
// how would VC90 changes if only style display changes are accounted for
|
|
191
|
+
if (mutation.attributeName === 'style' && _this2.getStyleDisplay(mutation.target.getAttribute('style')) !== _this2.getStyleDisplay(mutation.oldValue)) {
|
|
192
|
+
_this2.observeElement(mutation.target, mutation, 'attr', ignoreReason);
|
|
193
|
+
}
|
|
183
194
|
}
|
|
184
195
|
}
|
|
185
196
|
});
|
|
186
197
|
_this2.measureStop();
|
|
187
198
|
}) : null;
|
|
188
199
|
}
|
|
200
|
+
}, {
|
|
201
|
+
key: "getStyleDisplay",
|
|
202
|
+
value: function getStyleDisplay(styleAttributeValue) {
|
|
203
|
+
if (!styleAttributeValue) {
|
|
204
|
+
return undefined;
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
// Split the style string into individual declarations
|
|
208
|
+
var declarations = styleAttributeValue.split(';');
|
|
209
|
+
// Iterate over each declaration
|
|
210
|
+
var _iterator = _createForOfIteratorHelper(declarations),
|
|
211
|
+
_step;
|
|
212
|
+
try {
|
|
213
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
214
|
+
var declaration = _step.value;
|
|
215
|
+
// Trim whitespace and split into property and value
|
|
216
|
+
var _declaration$split$ma = declaration.split(':').map(function (part) {
|
|
217
|
+
return part.trim();
|
|
218
|
+
}),
|
|
219
|
+
_declaration$split$ma2 = (0, _slicedToArray2.default)(_declaration$split$ma, 2),
|
|
220
|
+
property = _declaration$split$ma2[0],
|
|
221
|
+
value = _declaration$split$ma2[1];
|
|
222
|
+
// Check if the property is 'display'
|
|
223
|
+
if (property && property.toLowerCase() === 'display') {
|
|
224
|
+
return value;
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
} catch (err) {
|
|
228
|
+
_iterator.e(err);
|
|
229
|
+
} finally {
|
|
230
|
+
_iterator.f();
|
|
231
|
+
}
|
|
232
|
+
return undefined;
|
|
233
|
+
}
|
|
189
234
|
}, {
|
|
190
235
|
key: "getElementName",
|
|
191
236
|
value: function getElementName(element) {
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export const MEDIA_WRAPPER_TAG = 'data-media-vc-wrapper';
|
|
3
|
+
export const VcMediaWrapperProps = {
|
|
4
|
+
[MEDIA_WRAPPER_TAG]: true
|
|
5
|
+
};
|
|
6
|
+
export default function MediaWrapper({
|
|
7
|
+
children
|
|
8
|
+
}) {
|
|
9
|
+
return /*#__PURE__*/React.createElement("div", VcMediaWrapperProps, children);
|
|
10
|
+
}
|
|
@@ -1,9 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export const MEDIA_WRAPPER_TAG = 'data-media-vc-wrapper';
|
|
3
|
-
export default function MediaWrapper({
|
|
4
|
-
children
|
|
5
|
-
}) {
|
|
6
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
7
|
-
[MEDIA_WRAPPER_TAG]: true
|
|
8
|
-
}, children);
|
|
9
|
-
}
|
|
1
|
+
export { default, MEDIA_WRAPPER_TAG, VcMediaWrapperProps } from './MediaWrapper';
|
|
@@ -150,13 +150,38 @@ export class Observers {
|
|
|
150
150
|
});
|
|
151
151
|
} else if (mutation.type === 'attributes') {
|
|
152
152
|
if (mutation.target instanceof HTMLElement) {
|
|
153
|
-
|
|
153
|
+
// Commenting the following line temporarily.
|
|
154
|
+
// this.observeElement(mutation.target, mutation, 'attr', ignoreReason);
|
|
155
|
+
|
|
156
|
+
// using the if below to collect data
|
|
157
|
+
// how would VC90 changes if only style display changes are accounted for
|
|
158
|
+
if (mutation.attributeName === 'style' && this.getStyleDisplay(mutation.target.getAttribute('style')) !== this.getStyleDisplay(mutation.oldValue)) {
|
|
159
|
+
this.observeElement(mutation.target, mutation, 'attr', ignoreReason);
|
|
160
|
+
}
|
|
154
161
|
}
|
|
155
162
|
}
|
|
156
163
|
});
|
|
157
164
|
this.measureStop();
|
|
158
165
|
}) : null;
|
|
159
166
|
}
|
|
167
|
+
getStyleDisplay(styleAttributeValue) {
|
|
168
|
+
if (!styleAttributeValue) {
|
|
169
|
+
return undefined;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
// Split the style string into individual declarations
|
|
173
|
+
const declarations = styleAttributeValue.split(';');
|
|
174
|
+
// Iterate over each declaration
|
|
175
|
+
for (const declaration of declarations) {
|
|
176
|
+
// Trim whitespace and split into property and value
|
|
177
|
+
const [property, value] = declaration.split(':').map(part => part.trim());
|
|
178
|
+
// Check if the property is 'display'
|
|
179
|
+
if (property && property.toLowerCase() === 'display') {
|
|
180
|
+
return value;
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
return undefined;
|
|
184
|
+
}
|
|
160
185
|
getElementName(element) {
|
|
161
186
|
try {
|
|
162
187
|
const tagName = element.localName;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
+
import React from 'react';
|
|
3
|
+
export var MEDIA_WRAPPER_TAG = 'data-media-vc-wrapper';
|
|
4
|
+
export var VcMediaWrapperProps = _defineProperty({}, MEDIA_WRAPPER_TAG, true);
|
|
5
|
+
export default function MediaWrapper(_ref) {
|
|
6
|
+
var children = _ref.children;
|
|
7
|
+
return /*#__PURE__*/React.createElement("div", VcMediaWrapperProps, children);
|
|
8
|
+
}
|
|
@@ -1,7 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import React from 'react';
|
|
3
|
-
export var MEDIA_WRAPPER_TAG = 'data-media-vc-wrapper';
|
|
4
|
-
export default function MediaWrapper(_ref) {
|
|
5
|
-
var children = _ref.children;
|
|
6
|
-
return /*#__PURE__*/React.createElement("div", _defineProperty({}, MEDIA_WRAPPER_TAG, true), children);
|
|
7
|
-
}
|
|
1
|
+
export { default, MEDIA_WRAPPER_TAG, VcMediaWrapperProps } from './MediaWrapper';
|
|
@@ -1,6 +1,10 @@
|
|
|
1
|
+
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
1
2
|
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
2
3
|
import _createClass from "@babel/runtime/helpers/createClass";
|
|
3
4
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
5
|
+
function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t.return || t.return(); } finally { if (u) throw o; } } }; }
|
|
6
|
+
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
7
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
4
8
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
5
9
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
6
10
|
import { isContainedWithinMediaWrapper } from '../media-wrapper/vc-utils';
|
|
@@ -172,13 +176,54 @@ export var Observers = /*#__PURE__*/function () {
|
|
|
172
176
|
});
|
|
173
177
|
} else if (mutation.type === 'attributes') {
|
|
174
178
|
if (mutation.target instanceof HTMLElement) {
|
|
175
|
-
|
|
179
|
+
// Commenting the following line temporarily.
|
|
180
|
+
// this.observeElement(mutation.target, mutation, 'attr', ignoreReason);
|
|
181
|
+
|
|
182
|
+
// using the if below to collect data
|
|
183
|
+
// how would VC90 changes if only style display changes are accounted for
|
|
184
|
+
if (mutation.attributeName === 'style' && _this2.getStyleDisplay(mutation.target.getAttribute('style')) !== _this2.getStyleDisplay(mutation.oldValue)) {
|
|
185
|
+
_this2.observeElement(mutation.target, mutation, 'attr', ignoreReason);
|
|
186
|
+
}
|
|
176
187
|
}
|
|
177
188
|
}
|
|
178
189
|
});
|
|
179
190
|
_this2.measureStop();
|
|
180
191
|
}) : null;
|
|
181
192
|
}
|
|
193
|
+
}, {
|
|
194
|
+
key: "getStyleDisplay",
|
|
195
|
+
value: function getStyleDisplay(styleAttributeValue) {
|
|
196
|
+
if (!styleAttributeValue) {
|
|
197
|
+
return undefined;
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
// Split the style string into individual declarations
|
|
201
|
+
var declarations = styleAttributeValue.split(';');
|
|
202
|
+
// Iterate over each declaration
|
|
203
|
+
var _iterator = _createForOfIteratorHelper(declarations),
|
|
204
|
+
_step;
|
|
205
|
+
try {
|
|
206
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
207
|
+
var declaration = _step.value;
|
|
208
|
+
// Trim whitespace and split into property and value
|
|
209
|
+
var _declaration$split$ma = declaration.split(':').map(function (part) {
|
|
210
|
+
return part.trim();
|
|
211
|
+
}),
|
|
212
|
+
_declaration$split$ma2 = _slicedToArray(_declaration$split$ma, 2),
|
|
213
|
+
property = _declaration$split$ma2[0],
|
|
214
|
+
value = _declaration$split$ma2[1];
|
|
215
|
+
// Check if the property is 'display'
|
|
216
|
+
if (property && property.toLowerCase() === 'display') {
|
|
217
|
+
return value;
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
} catch (err) {
|
|
221
|
+
_iterator.e(err);
|
|
222
|
+
} finally {
|
|
223
|
+
_iterator.f();
|
|
224
|
+
}
|
|
225
|
+
return undefined;
|
|
226
|
+
}
|
|
182
227
|
}, {
|
|
183
228
|
key: "getElementName",
|
|
184
229
|
value: function getElementName(element) {
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
type Props = {
|
|
3
|
+
children: React.ReactNode;
|
|
4
|
+
};
|
|
5
|
+
export declare const MEDIA_WRAPPER_TAG = "data-media-vc-wrapper";
|
|
6
|
+
export declare const VcMediaWrapperProps: {
|
|
7
|
+
"data-media-vc-wrapper": boolean;
|
|
8
|
+
};
|
|
9
|
+
export default function MediaWrapper({ children }: Props): JSX.Element;
|
|
10
|
+
export {};
|
|
@@ -1,7 +1 @@
|
|
|
1
|
-
|
|
2
|
-
type Props = {
|
|
3
|
-
children: React.ReactNode;
|
|
4
|
-
};
|
|
5
|
-
export declare const MEDIA_WRAPPER_TAG = "data-media-vc-wrapper";
|
|
6
|
-
export default function MediaWrapper({ children }: Props): JSX.Element;
|
|
7
|
-
export {};
|
|
1
|
+
export { default, MEDIA_WRAPPER_TAG, VcMediaWrapperProps } from './MediaWrapper';
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { BrowserObservers, Callback } from './types';
|
|
2
|
+
export type { ObservedMutationType } from './types';
|
|
2
3
|
export type SelectorConfig = {
|
|
3
4
|
id: boolean;
|
|
4
5
|
testId: boolean;
|
|
@@ -31,9 +32,9 @@ export declare class Observers implements BrowserObservers {
|
|
|
31
32
|
setReactRootRenderStop(stopTime?: number): void;
|
|
32
33
|
private observeElement;
|
|
33
34
|
private getMutationObserver;
|
|
35
|
+
private getStyleDisplay;
|
|
34
36
|
private getElementName;
|
|
35
37
|
private getIntersectionObserver;
|
|
36
38
|
private measureStart;
|
|
37
39
|
private measureStop;
|
|
38
40
|
}
|
|
39
|
-
export {};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { type VCIgnoreReason } from '../../../common/vc/types';
|
|
2
|
-
export type
|
|
2
|
+
export type ObservedMutationType = 'html' | 'attr' | 'text';
|
|
3
|
+
export type Callback = (time: number, box: DOMRectReadOnly, targetName: string, node: HTMLElement, type: ObservedMutationType, ignoreReason?: VCIgnoreReason) => void;
|
|
3
4
|
export type MutationRecordWithTimestamp = MutationRecord & {
|
|
4
5
|
timestamp?: number;
|
|
5
6
|
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
type Props = {
|
|
3
|
+
children: React.ReactNode;
|
|
4
|
+
};
|
|
5
|
+
export declare const MEDIA_WRAPPER_TAG = "data-media-vc-wrapper";
|
|
6
|
+
export declare const VcMediaWrapperProps: {
|
|
7
|
+
"data-media-vc-wrapper": boolean;
|
|
8
|
+
};
|
|
9
|
+
export default function MediaWrapper({ children }: Props): JSX.Element;
|
|
10
|
+
export {};
|
|
@@ -1,7 +1 @@
|
|
|
1
|
-
|
|
2
|
-
type Props = {
|
|
3
|
-
children: React.ReactNode;
|
|
4
|
-
};
|
|
5
|
-
export declare const MEDIA_WRAPPER_TAG = "data-media-vc-wrapper";
|
|
6
|
-
export default function MediaWrapper({ children }: Props): JSX.Element;
|
|
7
|
-
export {};
|
|
1
|
+
export { default, MEDIA_WRAPPER_TAG, VcMediaWrapperProps } from './MediaWrapper';
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { BrowserObservers, Callback } from './types';
|
|
2
|
+
export type { ObservedMutationType } from './types';
|
|
2
3
|
export type SelectorConfig = {
|
|
3
4
|
id: boolean;
|
|
4
5
|
testId: boolean;
|
|
@@ -31,9 +32,9 @@ export declare class Observers implements BrowserObservers {
|
|
|
31
32
|
setReactRootRenderStop(stopTime?: number): void;
|
|
32
33
|
private observeElement;
|
|
33
34
|
private getMutationObserver;
|
|
35
|
+
private getStyleDisplay;
|
|
34
36
|
private getElementName;
|
|
35
37
|
private getIntersectionObserver;
|
|
36
38
|
private measureStart;
|
|
37
39
|
private measureStop;
|
|
38
40
|
}
|
|
39
|
-
export {};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { type VCIgnoreReason } from '../../../common/vc/types';
|
|
2
|
-
export type
|
|
2
|
+
export type ObservedMutationType = 'html' | 'attr' | 'text';
|
|
3
|
+
export type Callback = (time: number, box: DOMRectReadOnly, targetName: string, node: HTMLElement, type: ObservedMutationType, ignoreReason?: VCIgnoreReason) => void;
|
|
3
4
|
export type MutationRecordWithTimestamp = MutationRecord & {
|
|
4
5
|
timestamp?: number;
|
|
5
6
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/react-ufo",
|
|
3
|
-
"version": "2.0
|
|
3
|
+
"version": "2.2.0",
|
|
4
4
|
"description": "Parts of React UFO that are publicly available",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -69,7 +69,7 @@
|
|
|
69
69
|
"./typing-performance-tracing": "./src/typing-performance-tracing/index.ts",
|
|
70
70
|
"./use-press-tracing": "./src/use-press-tracing/index.ts",
|
|
71
71
|
"./vc": "./src/vc/index.ts",
|
|
72
|
-
"./vc
|
|
72
|
+
"./vc-media": "./src/vc/vc-observer/media-wrapper/index.ts",
|
|
73
73
|
".": "./src/index.ts"
|
|
74
74
|
},
|
|
75
75
|
"dependencies": {
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@atlaskit/react-ufo/vc-media",
|
|
3
|
+
"main": "../dist/cjs/vc/vc-observer/media-wrapper/index.js",
|
|
4
|
+
"module": "../dist/esm/vc/vc-observer/media-wrapper/index.js",
|
|
5
|
+
"module:es2019": "../dist/es2019/vc/vc-observer/media-wrapper/index.js",
|
|
6
|
+
"sideEffects": false,
|
|
7
|
+
"types": "../dist/types/vc/vc-observer/media-wrapper/index.d.ts",
|
|
8
|
+
"typesVersions": {
|
|
9
|
+
">=4.5 <5.4": {
|
|
10
|
+
"*": [
|
|
11
|
+
"../dist/types-ts4.5/vc/vc-observer/media-wrapper/index.d.ts"
|
|
12
|
+
]
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
}
|
package/vc/media/package.json
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@atlaskit/react-ufo/vc/media",
|
|
3
|
-
"main": "../../dist/cjs/vc/vc-observer/media-wrapper/index.js",
|
|
4
|
-
"module": "../../dist/esm/vc/vc-observer/media-wrapper/index.js",
|
|
5
|
-
"module:es2019": "../../dist/es2019/vc/vc-observer/media-wrapper/index.js",
|
|
6
|
-
"sideEffects": false,
|
|
7
|
-
"types": "../../dist/types/vc/vc-observer/media-wrapper/index.d.ts",
|
|
8
|
-
"typesVersions": {
|
|
9
|
-
">=4.5 <5.4": {
|
|
10
|
-
"*": [
|
|
11
|
-
"../../dist/types-ts4.5/vc/vc-observer/media-wrapper/index.d.ts"
|
|
12
|
-
]
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
}
|