@player-ui/reference-assets-plugin 0.4.0-next.3 → 0.4.0-next.5
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.
|
@@ -0,0 +1,595 @@
|
|
|
1
|
+
(function webpackUniversalModuleDefinition(root, factory) {
|
|
2
|
+
if(typeof exports === 'object' && typeof module === 'object')
|
|
3
|
+
module.exports = factory();
|
|
4
|
+
else if(typeof define === 'function' && define.amd)
|
|
5
|
+
define([], factory);
|
|
6
|
+
else if(typeof exports === 'object')
|
|
7
|
+
exports["ReferenceAssetsPlugin"] = factory();
|
|
8
|
+
else
|
|
9
|
+
root["ReferenceAssetsPlugin"] = factory();
|
|
10
|
+
})(this, function() {
|
|
11
|
+
return /******/ (function(modules) { // webpackBootstrap
|
|
12
|
+
/******/ // The module cache
|
|
13
|
+
/******/ var installedModules = {};
|
|
14
|
+
/******/
|
|
15
|
+
/******/ // The require function
|
|
16
|
+
/******/ function __webpack_require__(moduleId) {
|
|
17
|
+
/******/
|
|
18
|
+
/******/ // Check if module is in cache
|
|
19
|
+
/******/ if(installedModules[moduleId]) {
|
|
20
|
+
/******/ return installedModules[moduleId].exports;
|
|
21
|
+
/******/ }
|
|
22
|
+
/******/ // Create a new module (and put it into the cache)
|
|
23
|
+
/******/ var module = installedModules[moduleId] = {
|
|
24
|
+
/******/ i: moduleId,
|
|
25
|
+
/******/ l: false,
|
|
26
|
+
/******/ exports: {}
|
|
27
|
+
/******/ };
|
|
28
|
+
/******/
|
|
29
|
+
/******/ // Execute the module function
|
|
30
|
+
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
|
|
31
|
+
/******/
|
|
32
|
+
/******/ // Flag the module as loaded
|
|
33
|
+
/******/ module.l = true;
|
|
34
|
+
/******/
|
|
35
|
+
/******/ // Return the exports of the module
|
|
36
|
+
/******/ return module.exports;
|
|
37
|
+
/******/ }
|
|
38
|
+
/******/
|
|
39
|
+
/******/
|
|
40
|
+
/******/ // expose the modules object (__webpack_modules__)
|
|
41
|
+
/******/ __webpack_require__.m = modules;
|
|
42
|
+
/******/
|
|
43
|
+
/******/ // expose the module cache
|
|
44
|
+
/******/ __webpack_require__.c = installedModules;
|
|
45
|
+
/******/
|
|
46
|
+
/******/ // define getter function for harmony exports
|
|
47
|
+
/******/ __webpack_require__.d = function(exports, name, getter) {
|
|
48
|
+
/******/ if(!__webpack_require__.o(exports, name)) {
|
|
49
|
+
/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
|
|
50
|
+
/******/ }
|
|
51
|
+
/******/ };
|
|
52
|
+
/******/
|
|
53
|
+
/******/ // define __esModule on exports
|
|
54
|
+
/******/ __webpack_require__.r = function(exports) {
|
|
55
|
+
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
|
|
56
|
+
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
57
|
+
/******/ }
|
|
58
|
+
/******/ Object.defineProperty(exports, '__esModule', { value: true });
|
|
59
|
+
/******/ };
|
|
60
|
+
/******/
|
|
61
|
+
/******/ // create a fake namespace object
|
|
62
|
+
/******/ // mode & 1: value is a module id, require it
|
|
63
|
+
/******/ // mode & 2: merge all properties of value into the ns
|
|
64
|
+
/******/ // mode & 4: return value when already ns object
|
|
65
|
+
/******/ // mode & 8|1: behave like require
|
|
66
|
+
/******/ __webpack_require__.t = function(value, mode) {
|
|
67
|
+
/******/ if(mode & 1) value = __webpack_require__(value);
|
|
68
|
+
/******/ if(mode & 8) return value;
|
|
69
|
+
/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
|
|
70
|
+
/******/ var ns = Object.create(null);
|
|
71
|
+
/******/ __webpack_require__.r(ns);
|
|
72
|
+
/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
|
|
73
|
+
/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
|
|
74
|
+
/******/ return ns;
|
|
75
|
+
/******/ };
|
|
76
|
+
/******/
|
|
77
|
+
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
|
78
|
+
/******/ __webpack_require__.n = function(module) {
|
|
79
|
+
/******/ var getter = module && module.__esModule ?
|
|
80
|
+
/******/ function getDefault() { return module['default']; } :
|
|
81
|
+
/******/ function getModuleExports() { return module; };
|
|
82
|
+
/******/ __webpack_require__.d(getter, 'a', getter);
|
|
83
|
+
/******/ return getter;
|
|
84
|
+
/******/ };
|
|
85
|
+
/******/
|
|
86
|
+
/******/ // Object.prototype.hasOwnProperty.call
|
|
87
|
+
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
|
|
88
|
+
/******/
|
|
89
|
+
/******/ // __webpack_public_path__
|
|
90
|
+
/******/ __webpack_require__.p = "";
|
|
91
|
+
/******/
|
|
92
|
+
/******/
|
|
93
|
+
/******/ // Load entry module and return exports
|
|
94
|
+
/******/ return __webpack_require__(__webpack_require__.s = "./bazel-out/k8-fastbuild/bin/plugins/reference-assets/core/dist/index.esm.js");
|
|
95
|
+
/******/ })
|
|
96
|
+
/************************************************************************/
|
|
97
|
+
/******/ ({
|
|
98
|
+
|
|
99
|
+
/***/ "./bazel-out/k8-fastbuild/bin/core/partial-match-registry/dist/index.esm.js":
|
|
100
|
+
/*!**********************************************************************************!*\
|
|
101
|
+
!*** ./bazel-out/k8-fastbuild/bin/core/partial-match-registry/dist/index.esm.js ***!
|
|
102
|
+
\**********************************************************************************/
|
|
103
|
+
/*! exports provided: Registry, createObjectMatcher */
|
|
104
|
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
105
|
+
|
|
106
|
+
"use strict";
|
|
107
|
+
__webpack_require__.r(__webpack_exports__);
|
|
108
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Registry", function() { return Registry; });
|
|
109
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createObjectMatcher", function() { return createMatcher; });
|
|
110
|
+
/* harmony import */ var sorted_array__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! sorted-array */ "./node_modules/sorted-array/sorted-array.js");
|
|
111
|
+
/* harmony import */ var sorted_array__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(sorted_array__WEBPACK_IMPORTED_MODULE_0__);
|
|
112
|
+
/* harmony import */ var dlv__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! dlv */ "./node_modules/dlv/dist/dlv.umd.js");
|
|
113
|
+
/* harmony import */ var dlv__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(dlv__WEBPACK_IMPORTED_MODULE_1__);
|
|
114
|
+
|
|
115
|
+
|
|
116
|
+
|
|
117
|
+
function traverseObj(object, path = [], pairs = new Map()) {
|
|
118
|
+
for (const key of Object.keys(object)) {
|
|
119
|
+
const val = object[key];
|
|
120
|
+
const nestedPath = [...path, key];
|
|
121
|
+
if (typeof val === "object") {
|
|
122
|
+
traverseObj(val, nestedPath, pairs);
|
|
123
|
+
} else {
|
|
124
|
+
pairs.set(nestedPath, val);
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
return pairs;
|
|
128
|
+
}
|
|
129
|
+
function createMatcher(partialObj) {
|
|
130
|
+
const pairs = traverseObj(partialObj);
|
|
131
|
+
const matchFunction = (searchObj) => {
|
|
132
|
+
for (const entry of pairs) {
|
|
133
|
+
const [path, value] = entry;
|
|
134
|
+
if (dlv__WEBPACK_IMPORTED_MODULE_1___default()(searchObj, path) !== value) {
|
|
135
|
+
return false;
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
return true;
|
|
139
|
+
};
|
|
140
|
+
matchFunction.count = pairs.size;
|
|
141
|
+
return matchFunction;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
function createBasicMatcher(seed) {
|
|
145
|
+
const matcher = (match) => seed === match;
|
|
146
|
+
matcher.count = 1;
|
|
147
|
+
return matcher;
|
|
148
|
+
}
|
|
149
|
+
const createSortedArray = () => new sorted_array__WEBPACK_IMPORTED_MODULE_0___default.a([], (c) => c.matcher.count);
|
|
150
|
+
class Registry {
|
|
151
|
+
constructor(initialSet) {
|
|
152
|
+
this.store = createSortedArray();
|
|
153
|
+
initialSet == null ? void 0 : initialSet.forEach(([match, value]) => {
|
|
154
|
+
this.set(match, value);
|
|
155
|
+
});
|
|
156
|
+
}
|
|
157
|
+
set(match, value) {
|
|
158
|
+
const matcher = typeof match === "object" ? createMatcher(match) : createBasicMatcher(match);
|
|
159
|
+
this.store.insert({
|
|
160
|
+
key: match,
|
|
161
|
+
value,
|
|
162
|
+
matcher
|
|
163
|
+
});
|
|
164
|
+
}
|
|
165
|
+
get(query) {
|
|
166
|
+
for (const entry of this.store.array) {
|
|
167
|
+
if (entry.matcher(query)) {
|
|
168
|
+
return entry.value;
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
forEach(callbackfn) {
|
|
173
|
+
for (const entry of this.store.array) {
|
|
174
|
+
callbackfn(entry);
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
clear() {
|
|
178
|
+
this.store = createSortedArray();
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
|
|
183
|
+
//# sourceMappingURL=index.esm.js.map
|
|
184
|
+
|
|
185
|
+
|
|
186
|
+
/***/ }),
|
|
187
|
+
|
|
188
|
+
/***/ "./bazel-out/k8-fastbuild/bin/plugins/asset-transform/core/dist/index.esm.js":
|
|
189
|
+
/*!***********************************************************************************!*\
|
|
190
|
+
!*** ./bazel-out/k8-fastbuild/bin/plugins/asset-transform/core/dist/index.esm.js ***!
|
|
191
|
+
\***********************************************************************************/
|
|
192
|
+
/*! exports provided: AssetTransformPlugin, compose, composeBefore, propertiesToSkipTransform */
|
|
193
|
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
194
|
+
|
|
195
|
+
"use strict";
|
|
196
|
+
__webpack_require__.r(__webpack_exports__);
|
|
197
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AssetTransformPlugin", function() { return AssetTransformPlugin; });
|
|
198
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "compose", function() { return compose; });
|
|
199
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "composeBefore", function() { return composeBefore; });
|
|
200
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "propertiesToSkipTransform", function() { return propertiesToSkipTransform; });
|
|
201
|
+
/* harmony import */ var _player_ui_partial_match_registry__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @player-ui/partial-match-registry */ "./bazel-out/k8-fastbuild/bin/core/partial-match-registry/dist/index.esm.js");
|
|
202
|
+
|
|
203
|
+
|
|
204
|
+
function composeTransforms(...args) {
|
|
205
|
+
const [fn, ...fns] = args.reverse();
|
|
206
|
+
return (asset, options, store) => {
|
|
207
|
+
const value = fn(asset, options, store);
|
|
208
|
+
if (!fns.length) {
|
|
209
|
+
return value;
|
|
210
|
+
}
|
|
211
|
+
return fns.reduce((prevValue, current) => {
|
|
212
|
+
return current(prevValue, options, store);
|
|
213
|
+
}, value);
|
|
214
|
+
};
|
|
215
|
+
}
|
|
216
|
+
function composeBefore(...args) {
|
|
217
|
+
return {
|
|
218
|
+
beforeResolve: composeTransforms(...args)
|
|
219
|
+
};
|
|
220
|
+
}
|
|
221
|
+
function compose(...args) {
|
|
222
|
+
const beforeResolveFns = [];
|
|
223
|
+
const resolveFns = [];
|
|
224
|
+
for (const arg of args) {
|
|
225
|
+
if (typeof arg === "function") {
|
|
226
|
+
resolveFns.push(arg);
|
|
227
|
+
} else {
|
|
228
|
+
if (arg == null ? void 0 : arg.resolve) {
|
|
229
|
+
resolveFns.push(arg.resolve);
|
|
230
|
+
}
|
|
231
|
+
if (arg == null ? void 0 : arg.beforeResolve) {
|
|
232
|
+
beforeResolveFns.push(arg.beforeResolve);
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
return {
|
|
237
|
+
beforeResolve: beforeResolveFns.length ? composeTransforms(...beforeResolveFns) : void 0,
|
|
238
|
+
resolve: resolveFns.length ? composeTransforms(...resolveFns) : void 0
|
|
239
|
+
};
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
var __defProp = Object.defineProperty;
|
|
243
|
+
var __defProps = Object.defineProperties;
|
|
244
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
245
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
246
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
247
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
248
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
249
|
+
var __spreadValues = (a, b) => {
|
|
250
|
+
for (var prop in b || (b = {}))
|
|
251
|
+
if (__hasOwnProp.call(b, prop))
|
|
252
|
+
__defNormalProp(a, prop, b[prop]);
|
|
253
|
+
if (__getOwnPropSymbols)
|
|
254
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
255
|
+
if (__propIsEnum.call(b, prop))
|
|
256
|
+
__defNormalProp(a, prop, b[prop]);
|
|
257
|
+
}
|
|
258
|
+
return a;
|
|
259
|
+
};
|
|
260
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
261
|
+
const propertiesToSkipTransform = (parameters) => {
|
|
262
|
+
return (asset) => {
|
|
263
|
+
var _a, _b, _c, _d;
|
|
264
|
+
const skipArray = (_c = (_b = (_a = asset.plugins) == null ? void 0 : _a.stringResolver) == null ? void 0 : _b.propertiesToSkip) != null ? _c : [];
|
|
265
|
+
const parameterArray = parameters.filter((element) => {
|
|
266
|
+
return element !== "";
|
|
267
|
+
});
|
|
268
|
+
if (parameterArray.length === 0) {
|
|
269
|
+
return asset;
|
|
270
|
+
}
|
|
271
|
+
if (skipArray.length > 0 && skipArray.every((arr) => parameterArray.includes(arr)) && parameterArray.every((arr) => skipArray.includes(arr))) {
|
|
272
|
+
return asset;
|
|
273
|
+
}
|
|
274
|
+
const addParams = new Set([...skipArray, ...parameterArray]);
|
|
275
|
+
return __spreadProps(__spreadValues({}, asset), {
|
|
276
|
+
plugins: __spreadProps(__spreadValues({}, asset.plugins), {
|
|
277
|
+
stringResolver: __spreadProps(__spreadValues({}, (_d = asset == null ? void 0 : asset.plugins) == null ? void 0 : _d.stringResolver), {
|
|
278
|
+
propertiesToSkip: [...addParams]
|
|
279
|
+
})
|
|
280
|
+
})
|
|
281
|
+
});
|
|
282
|
+
};
|
|
283
|
+
};
|
|
284
|
+
|
|
285
|
+
function maybeCompose(maybeFn) {
|
|
286
|
+
if (typeof maybeFn === "object") {
|
|
287
|
+
return maybeFn;
|
|
288
|
+
}
|
|
289
|
+
return compose(maybeFn);
|
|
290
|
+
}
|
|
291
|
+
function cleanupTransformRegistry(maybeRegistry) {
|
|
292
|
+
if (Array.isArray(maybeRegistry)) {
|
|
293
|
+
const wrappedTransforms = maybeRegistry.map(([key, value]) => {
|
|
294
|
+
return [key, maybeCompose(value)];
|
|
295
|
+
});
|
|
296
|
+
return new _player_ui_partial_match_registry__WEBPACK_IMPORTED_MODULE_0__["Registry"](wrappedTransforms);
|
|
297
|
+
}
|
|
298
|
+
const registry = new _player_ui_partial_match_registry__WEBPACK_IMPORTED_MODULE_0__["Registry"]();
|
|
299
|
+
maybeRegistry.forEach(({ key, value }) => {
|
|
300
|
+
registry.set(key, maybeCompose(value));
|
|
301
|
+
});
|
|
302
|
+
return registry;
|
|
303
|
+
}
|
|
304
|
+
class AssetTransformPlugin {
|
|
305
|
+
constructor(transforms) {
|
|
306
|
+
this.name = "asset-transform";
|
|
307
|
+
this.registry = cleanupTransformRegistry(transforms);
|
|
308
|
+
}
|
|
309
|
+
apply(player) {
|
|
310
|
+
player.hooks.viewController.tap(this.name, (vc) => {
|
|
311
|
+
this.registry.forEach(({ key, value }) => vc.transformRegistry.set(key, maybeCompose(value)));
|
|
312
|
+
});
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
|
|
317
|
+
//# sourceMappingURL=index.esm.js.map
|
|
318
|
+
|
|
319
|
+
|
|
320
|
+
/***/ }),
|
|
321
|
+
|
|
322
|
+
/***/ "./bazel-out/k8-fastbuild/bin/plugins/reference-assets/core/dist/index.esm.js":
|
|
323
|
+
/*!************************************************************************************!*\
|
|
324
|
+
!*** ./bazel-out/k8-fastbuild/bin/plugins/reference-assets/core/dist/index.esm.js ***!
|
|
325
|
+
\************************************************************************************/
|
|
326
|
+
/*! exports provided: ReferenceAssetsPlugin, actionTransform, expPropTransform, inputTransform, isBackAction */
|
|
327
|
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
328
|
+
|
|
329
|
+
"use strict";
|
|
330
|
+
__webpack_require__.r(__webpack_exports__);
|
|
331
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ReferenceAssetsPlugin", function() { return ReferenceAssetsPlugin; });
|
|
332
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "actionTransform", function() { return actionTransform; });
|
|
333
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "expPropTransform", function() { return expPropTransform; });
|
|
334
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "inputTransform", function() { return inputTransform; });
|
|
335
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isBackAction", function() { return isBackAction; });
|
|
336
|
+
/* harmony import */ var _player_ui_asset_transform_plugin__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @player-ui/asset-transform-plugin */ "./bazel-out/k8-fastbuild/bin/plugins/asset-transform/core/dist/index.esm.js");
|
|
337
|
+
|
|
338
|
+
|
|
339
|
+
var __defProp$1 = Object.defineProperty;
|
|
340
|
+
var __defProps$1 = Object.defineProperties;
|
|
341
|
+
var __getOwnPropDescs$1 = Object.getOwnPropertyDescriptors;
|
|
342
|
+
var __getOwnPropSymbols$1 = Object.getOwnPropertySymbols;
|
|
343
|
+
var __hasOwnProp$1 = Object.prototype.hasOwnProperty;
|
|
344
|
+
var __propIsEnum$1 = Object.prototype.propertyIsEnumerable;
|
|
345
|
+
var __defNormalProp$1 = (obj, key, value) => key in obj ? __defProp$1(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
346
|
+
var __spreadValues$1 = (a, b) => {
|
|
347
|
+
for (var prop in b || (b = {}))
|
|
348
|
+
if (__hasOwnProp$1.call(b, prop))
|
|
349
|
+
__defNormalProp$1(a, prop, b[prop]);
|
|
350
|
+
if (__getOwnPropSymbols$1)
|
|
351
|
+
for (var prop of __getOwnPropSymbols$1(b)) {
|
|
352
|
+
if (__propIsEnum$1.call(b, prop))
|
|
353
|
+
__defNormalProp$1(a, prop, b[prop]);
|
|
354
|
+
}
|
|
355
|
+
return a;
|
|
356
|
+
};
|
|
357
|
+
var __spreadProps$1 = (a, b) => __defProps$1(a, __getOwnPropDescs$1(b));
|
|
358
|
+
const inputTransform = (asset, options) => {
|
|
359
|
+
var _a, _b;
|
|
360
|
+
return __spreadProps$1(__spreadValues$1({}, asset), {
|
|
361
|
+
format(val) {
|
|
362
|
+
if (asset.binding === void 0) {
|
|
363
|
+
return val;
|
|
364
|
+
}
|
|
365
|
+
return options.data.format(asset.binding, val);
|
|
366
|
+
},
|
|
367
|
+
set(val) {
|
|
368
|
+
if (asset.binding === void 0) {
|
|
369
|
+
return;
|
|
370
|
+
}
|
|
371
|
+
return options.data.model.set([[asset.binding, val]], {
|
|
372
|
+
formatted: true
|
|
373
|
+
});
|
|
374
|
+
},
|
|
375
|
+
value: asset.binding === void 0 ? "" : options.data.model.get(asset.binding, {
|
|
376
|
+
includeInvalid: true,
|
|
377
|
+
formatted: true
|
|
378
|
+
}),
|
|
379
|
+
validation: asset.binding === void 0 ? void 0 : (_a = options.validation) == null ? void 0 : _a.get(asset.binding, { track: true }),
|
|
380
|
+
dataType: asset.binding === void 0 ? void 0 : (_b = options.validation) == null ? void 0 : _b.type(asset.binding)
|
|
381
|
+
});
|
|
382
|
+
};
|
|
383
|
+
|
|
384
|
+
var __defProp = Object.defineProperty;
|
|
385
|
+
var __defProps = Object.defineProperties;
|
|
386
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
387
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
388
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
389
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
390
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
391
|
+
var __spreadValues = (a, b) => {
|
|
392
|
+
for (var prop in b || (b = {}))
|
|
393
|
+
if (__hasOwnProp.call(b, prop))
|
|
394
|
+
__defNormalProp(a, prop, b[prop]);
|
|
395
|
+
if (__getOwnPropSymbols)
|
|
396
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
397
|
+
if (__propIsEnum.call(b, prop))
|
|
398
|
+
__defNormalProp(a, prop, b[prop]);
|
|
399
|
+
}
|
|
400
|
+
return a;
|
|
401
|
+
};
|
|
402
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
403
|
+
function isBackAction(action) {
|
|
404
|
+
return action.value === "Prev";
|
|
405
|
+
}
|
|
406
|
+
const transform = (action, options) => {
|
|
407
|
+
return __spreadProps(__spreadValues({}, action), {
|
|
408
|
+
run() {
|
|
409
|
+
var _a, _b;
|
|
410
|
+
if (action.exp) {
|
|
411
|
+
options.evaluate(action.exp);
|
|
412
|
+
}
|
|
413
|
+
if (action.value) {
|
|
414
|
+
const skipValidation = (_a = action.metaData) == null ? void 0 : _a.skipValidation;
|
|
415
|
+
(_b = options.transition) == null ? void 0 : _b.call(options, action.value, { force: skipValidation });
|
|
416
|
+
}
|
|
417
|
+
}
|
|
418
|
+
});
|
|
419
|
+
};
|
|
420
|
+
const expPropTransform = (asset) => {
|
|
421
|
+
var _a, _b, _c, _d, _e, _f;
|
|
422
|
+
const skipArray = (_b = (_a = asset.plugins) == null ? void 0 : _a.stringResolver) == null ? void 0 : _b.propertiesToSkip;
|
|
423
|
+
if (skipArray && skipArray.indexOf("exp") > 1) {
|
|
424
|
+
return asset;
|
|
425
|
+
}
|
|
426
|
+
return __spreadProps(__spreadValues({}, asset), {
|
|
427
|
+
plugins: __spreadProps(__spreadValues({}, asset.plugins), {
|
|
428
|
+
stringResolver: __spreadProps(__spreadValues({}, (_c = asset == null ? void 0 : asset.plugins) == null ? void 0 : _c.stringResolver), {
|
|
429
|
+
propertiesToSkip: [
|
|
430
|
+
...(_f = (_e = (_d = asset.plugins) == null ? void 0 : _d.stringResolver) == null ? void 0 : _e.propertiesToSkip) != null ? _f : [],
|
|
431
|
+
"exp"
|
|
432
|
+
]
|
|
433
|
+
})
|
|
434
|
+
})
|
|
435
|
+
});
|
|
436
|
+
};
|
|
437
|
+
const actionTransform = Object(_player_ui_asset_transform_plugin__WEBPACK_IMPORTED_MODULE_0__["compose"])(transform, Object(_player_ui_asset_transform_plugin__WEBPACK_IMPORTED_MODULE_0__["composeBefore"])(expPropTransform));
|
|
438
|
+
|
|
439
|
+
class ReferenceAssetsPlugin {
|
|
440
|
+
constructor() {
|
|
441
|
+
this.name = "reference-assets-transforms";
|
|
442
|
+
}
|
|
443
|
+
apply(player) {
|
|
444
|
+
player.registerPlugin(new _player_ui_asset_transform_plugin__WEBPACK_IMPORTED_MODULE_0__["AssetTransformPlugin"]([
|
|
445
|
+
[{ type: "action" }, actionTransform],
|
|
446
|
+
[{ type: "input" }, inputTransform]
|
|
447
|
+
]));
|
|
448
|
+
}
|
|
449
|
+
}
|
|
450
|
+
|
|
451
|
+
|
|
452
|
+
//# sourceMappingURL=index.esm.js.map
|
|
453
|
+
|
|
454
|
+
|
|
455
|
+
/***/ }),
|
|
456
|
+
|
|
457
|
+
/***/ "./node_modules/dlv/dist/dlv.umd.js":
|
|
458
|
+
/*!******************************************!*\
|
|
459
|
+
!*** ./node_modules/dlv/dist/dlv.umd.js ***!
|
|
460
|
+
\******************************************/
|
|
461
|
+
/*! no static exports found */
|
|
462
|
+
/***/ (function(module, exports, __webpack_require__) {
|
|
463
|
+
|
|
464
|
+
!function(t,n){ true?module.exports=function(t,n,e,i,o){for(n=n.split?n.split("."):n,i=0;i<n.length;i++)t=t?t[n[i]]:o;return t===o?e:t}:undefined}(this);
|
|
465
|
+
//# sourceMappingURL=dlv.umd.js.map
|
|
466
|
+
|
|
467
|
+
|
|
468
|
+
/***/ }),
|
|
469
|
+
|
|
470
|
+
/***/ "./node_modules/sorted-array/sorted-array.js":
|
|
471
|
+
/*!***************************************************!*\
|
|
472
|
+
!*** ./node_modules/sorted-array/sorted-array.js ***!
|
|
473
|
+
\***************************************************/
|
|
474
|
+
/*! no static exports found */
|
|
475
|
+
/***/ (function(module, exports, __webpack_require__) {
|
|
476
|
+
|
|
477
|
+
var __WEBPACK_AMD_DEFINE_RESULT__;var SortedArray = (function () {
|
|
478
|
+
var SortedArray = defclass({
|
|
479
|
+
|
|
480
|
+
constructor: function (array, compare) {
|
|
481
|
+
this.array = [];
|
|
482
|
+
this.compare = compare || compareDefault;
|
|
483
|
+
var length = array.length,
|
|
484
|
+
index = 0;
|
|
485
|
+
while (index < length) this.insert(array[index++]);
|
|
486
|
+
},
|
|
487
|
+
insert: function (element) {
|
|
488
|
+
var array = this.array,
|
|
489
|
+
compare = this.compare,
|
|
490
|
+
high = array.length-1,
|
|
491
|
+
low = 0,
|
|
492
|
+
pos = -1,
|
|
493
|
+
index,
|
|
494
|
+
ordering;
|
|
495
|
+
|
|
496
|
+
// The array is sorted. You must find the position of new element in O(log(n)), not O(n).
|
|
497
|
+
while (high >= low) {
|
|
498
|
+
index = (high + low) / 2 >>> 0;
|
|
499
|
+
ordering = compare(array[index], element);
|
|
500
|
+
if (ordering < 0) low = index + 1;
|
|
501
|
+
else if (ordering > 0) high = index - 1;
|
|
502
|
+
else {
|
|
503
|
+
pos = index;
|
|
504
|
+
break;
|
|
505
|
+
};
|
|
506
|
+
}
|
|
507
|
+
|
|
508
|
+
if (pos === -1) {
|
|
509
|
+
// if element was not found, high < low.
|
|
510
|
+
pos = high;
|
|
511
|
+
}
|
|
512
|
+
// This assures that equal elements inserted after will be in a higher position in array.
|
|
513
|
+
// They can be equal for comparison purposes, but different objects with different data.
|
|
514
|
+
// Respecting the chronological order can be important for many applications.
|
|
515
|
+
pos++;
|
|
516
|
+
high = array.length-1;
|
|
517
|
+
while ((pos < high) && (compare(element, array[pos]) === 0)){
|
|
518
|
+
pos++;
|
|
519
|
+
}
|
|
520
|
+
index = array.length;
|
|
521
|
+
// Just to increase array size.
|
|
522
|
+
array.push(element);
|
|
523
|
+
// Much faster. No need to elements swap.
|
|
524
|
+
while (index > pos) {
|
|
525
|
+
array[index] = array[--index];
|
|
526
|
+
}
|
|
527
|
+
// Set the new element on its correct position.
|
|
528
|
+
array[pos] = element;
|
|
529
|
+
|
|
530
|
+
return this;
|
|
531
|
+
},
|
|
532
|
+
search: function (element) {
|
|
533
|
+
var array = this.array,
|
|
534
|
+
compare = this.compare,
|
|
535
|
+
high = array.length-1,
|
|
536
|
+
low = 0,
|
|
537
|
+
// In most languages, inner variable declaration makes the code slower.
|
|
538
|
+
index,
|
|
539
|
+
ordering;
|
|
540
|
+
|
|
541
|
+
while (high >= low) {
|
|
542
|
+
index = (high + low) / 2 >>> 0;
|
|
543
|
+
ordering = compare(array[index], element);
|
|
544
|
+
|
|
545
|
+
if (ordering < 0) low = index + 1;
|
|
546
|
+
else if (ordering > 0) high = index - 1;
|
|
547
|
+
else return index;
|
|
548
|
+
}
|
|
549
|
+
|
|
550
|
+
return -1;
|
|
551
|
+
},
|
|
552
|
+
remove: function (element) {
|
|
553
|
+
var index = this.search(element);
|
|
554
|
+
if (index >= 0) this.array.splice(index, 1);
|
|
555
|
+
return this;
|
|
556
|
+
}
|
|
557
|
+
});
|
|
558
|
+
|
|
559
|
+
SortedArray.comparing = function (property, array) {
|
|
560
|
+
return new SortedArray(array, function (a, b) {
|
|
561
|
+
// This should be faster than calling functions.
|
|
562
|
+
// Besides, this way it is not needed to create useless function to return property value.
|
|
563
|
+
return compareDefault(a[property], b[property]);
|
|
564
|
+
});
|
|
565
|
+
};
|
|
566
|
+
|
|
567
|
+
return SortedArray;
|
|
568
|
+
|
|
569
|
+
function defclass(prototype) {
|
|
570
|
+
var constructor = prototype.constructor;
|
|
571
|
+
constructor.prototype = prototype;
|
|
572
|
+
return constructor;
|
|
573
|
+
}
|
|
574
|
+
|
|
575
|
+
function compareDefault(a, b) {
|
|
576
|
+
// Equality has a very low chance to happen. It should be the last option.
|
|
577
|
+
if (a < b)
|
|
578
|
+
return -1;
|
|
579
|
+
else if (a > b)
|
|
580
|
+
return 1;
|
|
581
|
+
else
|
|
582
|
+
return 0;
|
|
583
|
+
}
|
|
584
|
+
}());
|
|
585
|
+
|
|
586
|
+
if (true) module.exports = SortedArray;
|
|
587
|
+
if (true)
|
|
588
|
+
!(__WEBPACK_AMD_DEFINE_RESULT__ = (function () { return SortedArray; }).call(exports, __webpack_require__, exports, module),
|
|
589
|
+
__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
|
|
590
|
+
|
|
591
|
+
|
|
592
|
+
/***/ })
|
|
593
|
+
|
|
594
|
+
/******/ });
|
|
595
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
!function(e,t){"object"===typeof exports&&"object"===typeof module?module.exports=t():"function"===typeof define&&define.amd?define([],t):"object"===typeof exports?exports.ReferenceAssetsPlugin=t():e.ReferenceAssetsPlugin=t()}(this,(function(){return function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"===typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=2)}([function(e,t,r){var n,o=function(){var e=function(e){var t=e.constructor;return t.prototype=e,t}({constructor:function(e,r){this.array=[],this.compare=r||t;for(var n=e.length,o=0;o<n;)this.insert(e[o++])},insert:function(e){for(var t,r,n=this.array,o=this.compare,i=n.length-1,s=0,u=-1;i>=s;)if((r=o(n[t=(i+s)/2>>>0],e))<0)s=t+1;else{if(!(r>0)){u=t;break}i=t-1}for(-1===u&&(u=i),u++,i=n.length-1;u<i&&0===o(e,n[u]);)u++;for(t=n.length,n.push(e);t>u;)n[t]=n[--t];return n[u]=e,this},search:function(e){for(var t,r,n=this.array,o=this.compare,i=n.length-1,s=0;i>=s;)if((r=o(n[t=(i+s)/2>>>0],e))<0)s=t+1;else{if(!(r>0))return t;i=t-1}return-1},remove:function(e){var t=this.search(e);return t>=0&&this.array.splice(t,1),this}});return e.comparing=function(r,n){return new e(n,(function(e,n){return t(e[r],n[r])}))},e;function t(e,t){return e<t?-1:e>t?1:0}}();e.exports=o,void 0===(n=function(){return o}.call(t,r,t,e))||(e.exports=n)},function(e,t,r){e.exports=function(e,t,r,n,o){for(t=t.split?t.split("."):t,n=0;n<t.length;n++)e=e?e[t[n]]:o;return e===o?r:e}},function(e,t,r){"use strict";r.r(t),r.d(t,"ReferenceAssetsPlugin",(function(){return z})),r.d(t,"actionTransform",(function(){return I})),r.d(t,"expPropTransform",(function(){return D})),r.d(t,"inputTransform",(function(){return P})),r.d(t,"isBackAction",(function(){return M}));var n=r(0),o=r.n(n),i=r(1),s=r.n(i);function u(e,t=[],r=new Map){for(const n of Object.keys(e)){const o=e[n],i=[...t,n];"object"===typeof o?u(o,i,r):r.set(i,o)}return r}function c(e){const t=u(e),r=e=>{for(const r of t){const[t,n]=r;if(s()(e,t)!==n)return!1}return!0};return r.count=t.size,r}const a=()=>new o.a([],(e=>e.matcher.count));class l{constructor(e){this.store=a(),null==e||e.forEach((([e,t])=>{this.set(e,t)}))}set(e,t){const r="object"===typeof e?c(e):function(e){const t=t=>e===t;return t.count=1,t}(e);this.store.insert({key:e,value:t,matcher:r})}get(e){for(const t of this.store.array)if(t.matcher(e))return t.value}forEach(e){for(const t of this.store.array)e(t)}clear(){this.store=a()}}function f(...e){const[t,...r]=e.reverse();return(e,n,o)=>{const i=t(e,n,o);return r.length?r.reduce(((e,t)=>t(e,n,o)),i):i}}function p(...e){const t=[],r=[];for(const n of e)"function"===typeof n?r.push(n):((null==n?void 0:n.resolve)&&r.push(n.resolve),(null==n?void 0:n.beforeResolve)&&t.push(n.beforeResolve));return{beforeResolve:t.length?f(...t):void 0,resolve:r.length?f(...r):void 0}}Object.defineProperty,Object.defineProperties,Object.getOwnPropertyDescriptors,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;function d(e){return"object"===typeof e?e:p(e)}class v{constructor(e){this.name="asset-transform",this.registry=function(e){if(Array.isArray(e)){const t=e.map((([e,t])=>[e,d(t)]));return new l(t)}const t=new l;return e.forEach((({key:e,value:r})=>{t.set(e,d(r))})),t}(e)}apply(e){e.hooks.viewController.tap(this.name,(e=>{this.registry.forEach((({key:t,value:r})=>e.transformRegistry.set(t,d(r))))}))}}var y=Object.defineProperty,b=Object.defineProperties,g=Object.getOwnPropertyDescriptors,h=Object.getOwnPropertySymbols,m=Object.prototype.hasOwnProperty,O=Object.prototype.propertyIsEnumerable,j=(e,t,r)=>t in e?y(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;const P=(e,t)=>{var r,n,o,i;return o=((e,t)=>{for(var r in t||(t={}))m.call(t,r)&&j(e,r,t[r]);if(h)for(var r of h(t))O.call(t,r)&&j(e,r,t[r]);return e})({},e),i={format:r=>void 0===e.binding?r:t.data.format(e.binding,r),set(r){if(void 0!==e.binding)return t.data.model.set([[e.binding,r]],{formatted:!0})},value:void 0===e.binding?"":t.data.model.get(e.binding,{includeInvalid:!0,formatted:!0}),validation:void 0===e.binding||null==(r=t.validation)?void 0:r.get(e.binding,{track:!0}),dataType:void 0===e.binding||null==(n=t.validation)?void 0:n.type(e.binding)},b(o,g(i))};var w=Object.defineProperty,x=Object.defineProperties,k=Object.getOwnPropertyDescriptors,R=Object.getOwnPropertySymbols,S=Object.prototype.hasOwnProperty,T=Object.prototype.propertyIsEnumerable,E=(e,t,r)=>t in e?w(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,A=(e,t)=>{for(var r in t||(t={}))S.call(t,r)&&E(e,r,t[r]);if(R)for(var r of R(t))T.call(t,r)&&E(e,r,t[r]);return e},_=(e,t)=>x(e,k(t));function M(e){return"Prev"===e.value}const D=e=>{var t,r,n,o,i,s;const u=null==(r=null==(t=e.plugins)?void 0:t.stringResolver)?void 0:r.propertiesToSkip;return u&&u.indexOf("exp")>1?e:_(A({},e),{plugins:_(A({},e.plugins),{stringResolver:_(A({},null==(n=null==e?void 0:e.plugins)?void 0:n.stringResolver),{propertiesToSkip:[...null!=(s=null==(i=null==(o=e.plugins)?void 0:o.stringResolver)?void 0:i.propertiesToSkip)?s:[],"exp"]})})})},I=p(((e,t)=>_(A({},e),{run(){var r,n;if(e.exp&&t.evaluate(e.exp),e.value){const o=null==(r=e.metaData)?void 0:r.skipValidation;null==(n=t.transition)||n.call(t,e.value,{force:o})}}})),function(...e){return{beforeResolve:f(...e)}}(D));class z{constructor(){this.name="reference-assets-transforms"}apply(e){e.registerPlugin(new v([[{type:"action"},I],[{type:"input"},P]]))}}}])}));
|
package/package.json
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@player-ui/reference-assets-plugin",
|
|
3
|
-
"version": "0.4.0-next.
|
|
3
|
+
"version": "0.4.0-next.5",
|
|
4
4
|
"private": false,
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org"
|
|
7
7
|
},
|
|
8
8
|
"peerDependencies": {
|
|
9
|
-
"@player-ui/player": "0.4.0-next.
|
|
9
|
+
"@player-ui/player": "0.4.0-next.5"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"@player-ui/beacon-plugin": "0.4.0-next.
|
|
13
|
-
"@player-ui/asset-transform-plugin": "0.4.0-next.
|
|
12
|
+
"@player-ui/beacon-plugin": "0.4.0-next.5",
|
|
13
|
+
"@player-ui/asset-transform-plugin": "0.4.0-next.5",
|
|
14
14
|
"@babel/runtime": "7.15.4"
|
|
15
15
|
},
|
|
16
16
|
"main": "dist/index.cjs.js",
|