From 2461177f4ff1a1595549dd6e901cf8bc212adbb4 Mon Sep 17 00:00:00 2001 From: smhigley Date: Fri, 20 Jul 2018 09:48:12 -0700 Subject: [PATCH] remove local framework deps --- deps/framework/core/DateObject.d.ts | 71 -- deps/framework/core/DateObject.js | 316 ------ deps/framework/core/DateObject.js.map | 1 - deps/framework/core/DateObject.mjs | 253 ----- deps/framework/core/DateObject.mjs.map | 1 - deps/framework/core/Destroyable.d.ts | 25 - deps/framework/core/Destroyable.js | 72 -- deps/framework/core/Destroyable.js.map | 1 - deps/framework/core/Destroyable.mjs | 56 - deps/framework/core/Destroyable.mjs.map | 1 - deps/framework/core/Evented.d.ts | 65 -- deps/framework/core/Evented.js | 93 -- deps/framework/core/Evented.js.map | 1 - deps/framework/core/Evented.mjs | 72 -- deps/framework/core/Evented.mjs.map | 1 - deps/framework/core/IdentityRegistry.d.ts | 66 -- deps/framework/core/IdentityRegistry.js | 152 --- deps/framework/core/IdentityRegistry.js.map | 1 - deps/framework/core/IdentityRegistry.mjs | 137 --- deps/framework/core/IdentityRegistry.mjs.map | 1 - deps/framework/core/List.d.ts | 22 - deps/framework/core/List.js | 118 --- deps/framework/core/List.js.map | 1 - deps/framework/core/List.mjs | 81 -- deps/framework/core/List.mjs.map | 1 - deps/framework/core/MatchRegistry.d.ts | 35 - deps/framework/core/MatchRegistry.js | 79 -- deps/framework/core/MatchRegistry.js.map | 1 - deps/framework/core/MatchRegistry.mjs | 61 -- deps/framework/core/MatchRegistry.mjs.map | 1 - deps/framework/core/MultiMap.d.ts | 86 -- deps/framework/core/MultiMap.js | 254 ----- deps/framework/core/MultiMap.js.map | 1 - deps/framework/core/MultiMap.mjs | 208 ---- deps/framework/core/MultiMap.mjs.map | 1 - deps/framework/core/Observable.d.ts | 13 - deps/framework/core/Observable.js | 176 ---- deps/framework/core/Observable.js.map | 1 - deps/framework/core/Observable.mjs | 153 --- deps/framework/core/Observable.mjs.map | 1 - deps/framework/core/QueuingEvented.d.ts | 18 - deps/framework/core/QueuingEvented.js | 70 -- deps/framework/core/QueuingEvented.js.map | 1 - deps/framework/core/QueuingEvented.mjs | 53 - deps/framework/core/QueuingEvented.mjs.map | 1 - deps/framework/core/Scheduler.d.ts | 29 - deps/framework/core/Scheduler.js | 88 -- deps/framework/core/Scheduler.js.map | 1 - deps/framework/core/Scheduler.mjs | 74 -- deps/framework/core/Scheduler.mjs.map | 1 - deps/framework/core/UrlSearchParams.d.ts | 65 -- deps/framework/core/UrlSearchParams.js | 180 ---- deps/framework/core/UrlSearchParams.js.map | 1 - deps/framework/core/UrlSearchParams.mjs | 166 --- deps/framework/core/UrlSearchParams.mjs.map | 1 - deps/framework/core/aspect.d.ts | 146 --- deps/framework/core/aspect.js | 352 ------- deps/framework/core/aspect.js.map | 1 - deps/framework/core/aspect.mjs | 327 ------ deps/framework/core/aspect.mjs.map | 1 - .../core/async/ExtensiblePromise.d.ts | 139 --- .../framework/core/async/ExtensiblePromise.js | 168 --- .../core/async/ExtensiblePromise.js.map | 1 - .../core/async/ExtensiblePromise.mjs | 140 --- .../core/async/ExtensiblePromise.mjs.map | 1 - deps/framework/core/async/Task.d.ts | 163 --- deps/framework/core/async/Task.js | 284 ----- deps/framework/core/async/Task.js.map | 1 - deps/framework/core/async/Task.mjs | 244 ----- deps/framework/core/async/Task.mjs.map | 1 - deps/framework/core/async/iteration.d.ts | 56 - deps/framework/core/async/iteration.js | 244 ----- deps/framework/core/async/iteration.js.map | 1 - deps/framework/core/async/iteration.mjs | 222 ---- deps/framework/core/async/iteration.mjs.map | 1 - deps/framework/core/async/timing.d.ts | 32 - deps/framework/core/async/timing.js | 72 -- deps/framework/core/async/timing.js.map | 1 - deps/framework/core/async/timing.mjs | 54 - deps/framework/core/async/timing.mjs.map | 1 - deps/framework/core/base64.d.ts | 10 - deps/framework/core/base64.js | 45 - deps/framework/core/base64.js.map | 1 - deps/framework/core/base64.mjs | 31 - deps/framework/core/base64.mjs.map | 1 - deps/framework/core/compare.d.ts | 191 ---- deps/framework/core/compare.js | 504 --------- deps/framework/core/compare.js.map | 1 - deps/framework/core/compare.mjs | 480 --------- deps/framework/core/compare.mjs.map | 1 - deps/framework/core/global.d.ts | 2 - deps/framework/core/global.js | 21 - deps/framework/core/global.js.map | 1 - deps/framework/core/global.mjs | 9 - deps/framework/core/global.mjs.map | 1 - deps/framework/core/has.d.ts | 3 - deps/framework/core/has.js | 59 -- deps/framework/core/has.js.map | 1 - deps/framework/core/has.mjs | 55 - deps/framework/core/has.mjs.map | 1 - deps/framework/core/instrument.d.ts | 43 - deps/framework/core/instrument.js | 100 -- deps/framework/core/instrument.js.map | 1 - deps/framework/core/instrument.mjs | 75 -- deps/framework/core/instrument.mjs.map | 1 - deps/framework/core/interfaces.d.ts | 249 ----- deps/framework/core/interfaces.js | 13 - deps/framework/core/interfaces.js.map | 1 - deps/framework/core/interfaces.mjs | 1 - deps/framework/core/interfaces.mjs.map | 1 - deps/framework/core/lang.d.ts | 110 -- deps/framework/core/lang.js | 248 ----- deps/framework/core/lang.js.map | 1 - deps/framework/core/lang.mjs | 196 ---- deps/framework/core/lang.mjs.map | 1 - deps/framework/core/load.d.ts | 12 - deps/framework/core/load.js | 113 -- deps/framework/core/load.js.map | 1 - deps/framework/core/load.mjs | 86 -- deps/framework/core/load.mjs.map | 1 - deps/framework/core/load/util.d.ts | 30 - deps/framework/core/load/util.js | 51 - deps/framework/core/load/util.js.map | 1 - deps/framework/core/load/util.mjs | 25 - deps/framework/core/load/util.mjs.map | 1 - deps/framework/core/load/webpack.d.ts | 19 - deps/framework/core/load/webpack.js | 107 -- deps/framework/core/load/webpack.js.map | 1 - deps/framework/core/load/webpack.mjs | 88 -- deps/framework/core/load/webpack.mjs.map | 1 - deps/framework/core/main.d.ts | 25 - deps/framework/core/main.js | 55 - deps/framework/core/main.js.map | 1 - deps/framework/core/main.mjs | 26 - deps/framework/core/main.mjs.map | 1 - deps/framework/core/on.d.ts | 60 -- deps/framework/core/on.js | 103 -- deps/framework/core/on.js.map | 1 - deps/framework/core/on.mjs | 86 -- deps/framework/core/on.mjs.map | 1 - deps/framework/core/queue.d.ts | 1 - deps/framework/core/queue.js | 15 - deps/framework/core/queue.js.map | 1 - deps/framework/core/queue.mjs | 2 - deps/framework/core/queue.mjs.map | 1 - deps/framework/core/request.d.ts | 19 - deps/framework/core/request.js | 65 -- deps/framework/core/request.js.map | 1 - deps/framework/core/request.mjs | 47 - deps/framework/core/request.mjs.map | 1 - deps/framework/core/request/Headers.d.ts | 20 - deps/framework/core/request/Headers.js | 138 --- deps/framework/core/request/Headers.js.map | 1 - deps/framework/core/request/Headers.mjs | 87 -- deps/framework/core/request/Headers.mjs.map | 1 - .../core/request/ProviderRegistry.d.ts | 8 - .../core/request/ProviderRegistry.js | 42 - .../core/request/ProviderRegistry.js.map | 1 - .../core/request/ProviderRegistry.mjs | 23 - .../core/request/ProviderRegistry.mjs.map | 1 - deps/framework/core/request/Response.d.ts | 28 - deps/framework/core/request/Response.js | 57 -- deps/framework/core/request/Response.js.map | 1 - deps/framework/core/request/Response.mjs | 38 - deps/framework/core/request/Response.mjs.map | 1 - .../core/request/SubscriptionPool.d.ts | 11 - .../core/request/SubscriptionPool.js | 51 - .../core/request/SubscriptionPool.js.map | 1 - .../core/request/SubscriptionPool.mjs | 35 - .../core/request/SubscriptionPool.mjs.map | 1 - deps/framework/core/request/TimeoutError.d.ts | 6 - deps/framework/core/request/TimeoutError.js | 29 - .../core/request/TimeoutError.js.map | 1 - deps/framework/core/request/TimeoutError.mjs | 11 - .../core/request/TimeoutError.mjs.map | 1 - deps/framework/core/request/interfaces.d.ts | 84 -- .../core/request/providers/node.d.ts | 134 --- deps/framework/core/request/providers/node.js | 472 --------- .../core/request/providers/node.js.map | 1 - .../framework/core/request/providers/node.mjs | 425 -------- .../core/request/providers/node.mjs.map | 1 - .../framework/core/request/providers/xhr.d.ts | 46 - deps/framework/core/request/providers/xhr.js | 288 ------ .../core/request/providers/xhr.js.map | 1 - deps/framework/core/request/providers/xhr.mjs | 233 ----- .../core/request/providers/xhr.mjs.map | 1 - deps/framework/core/request/util.d.ts | 9 - deps/framework/core/request/util.js | 51 - deps/framework/core/request/util.js.map | 1 - deps/framework/core/request/util.mjs | 24 - deps/framework/core/request/util.mjs.map | 1 - deps/framework/core/stringExtras.d.ts | 13 - deps/framework/core/stringExtras.js | 49 - deps/framework/core/stringExtras.js.map | 1 - deps/framework/core/stringExtras.mjs | 34 - deps/framework/core/stringExtras.mjs.map | 1 - deps/framework/core/text.d.ts | 4 - deps/framework/core/text.js | 118 --- deps/framework/core/text.js.map | 1 - deps/framework/core/text.mjs | 103 -- deps/framework/core/text.mjs.map | 1 - deps/framework/core/util.d.ts | 35 - deps/framework/core/util.js | 123 --- deps/framework/core/util.js.map | 1 - deps/framework/core/util.mjs | 106 -- deps/framework/core/util.mjs.map | 1 - deps/framework/core/uuid.d.ts | 6 - deps/framework/core/uuid.js | 25 - deps/framework/core/uuid.js.map | 1 - deps/framework/core/uuid.mjs | 12 - deps/framework/core/uuid.mjs.map | 1 - deps/framework/has/has.d.ts | 80 -- deps/framework/has/has.js | 214 ---- deps/framework/has/has.js.map | 1 - deps/framework/has/has.mjs | 196 ---- deps/framework/has/has.mjs.map | 1 - deps/framework/has/loader.d.ts | 50 - deps/framework/has/loader.js | 13 - deps/framework/has/loader.js.map | 1 - deps/framework/has/loader.mjs | 1 - deps/framework/has/loader.mjs.map | 1 - deps/framework/has/main.d.ts | 3 - deps/framework/has/main.js | 17 - deps/framework/has/main.js.map | 1 - deps/framework/has/main.mjs | 4 - deps/framework/has/main.mjs.map | 1 - deps/framework/i18n/cldr/load.d.ts | 48 - deps/framework/i18n/cldr/load.js | 234 ----- deps/framework/i18n/cldr/load.js.map | 1 - deps/framework/i18n/cldr/load.mjs | 215 ---- deps/framework/i18n/cldr/load.mjs.map | 1 - deps/framework/i18n/cldr/locales.d.ts | 5 - deps/framework/i18n/cldr/locales.js | 533 ---------- deps/framework/i18n/cldr/locales.js.map | 1 - deps/framework/i18n/cldr/locales.mjs | 521 ---------- deps/framework/i18n/cldr/locales.mjs.map | 1 - deps/framework/i18n/date.d.ts | 146 --- deps/framework/i18n/date.js | 65 -- deps/framework/i18n/date.js.map | 1 - deps/framework/i18n/date.mjs | 47 - deps/framework/i18n/date.mjs.map | 1 - deps/framework/i18n/i18n.d.ts | 177 ---- deps/framework/i18n/i18n.js | 394 ------- deps/framework/i18n/i18n.js.map | 1 - deps/framework/i18n/i18n.mjs | 363 ------- deps/framework/i18n/i18n.mjs.map | 1 - deps/framework/i18n/main.d.ts | 8 - deps/framework/i18n/main.js | 46 - deps/framework/i18n/main.js.map | 1 - deps/framework/i18n/main.mjs | 9 - deps/framework/i18n/main.mjs.map | 1 - deps/framework/i18n/number.d.ts | 223 ---- deps/framework/i18n/number.js | 80 -- deps/framework/i18n/number.js.map | 1 - deps/framework/i18n/number.mjs | 60 -- deps/framework/i18n/number.mjs.map | 1 - deps/framework/i18n/unit.d.ts | 53 - deps/framework/i18n/unit.js | 35 - deps/framework/i18n/unit.js.map | 1 - deps/framework/i18n/unit.mjs | 21 - deps/framework/i18n/unit.mjs.map | 1 - deps/framework/i18n/util/globalize.d.ts | 35 - deps/framework/i18n/util/globalize.js | 64 -- deps/framework/i18n/util/globalize.js.map | 1 - deps/framework/i18n/util/globalize.mjs | 50 - deps/framework/i18n/util/globalize.mjs.map | 1 - deps/framework/i18n/util/main.d.ts | 36 - deps/framework/i18n/util/main.js | 88 -- deps/framework/i18n/util/main.js.map | 1 - deps/framework/i18n/util/main.mjs | 74 -- deps/framework/i18n/util/main.mjs.map | 1 - deps/framework/package.json | 76 -- deps/framework/routing/Link.d.ts | 10 - deps/framework/routing/Link.js | 60 -- deps/framework/routing/Link.js.map | 1 - deps/framework/routing/Link.mjs | 36 - deps/framework/routing/Link.mjs.map | 1 - deps/framework/routing/Outlet.d.ts | 9 - deps/framework/routing/Outlet.js | 108 -- deps/framework/routing/Outlet.js.map | 1 - deps/framework/routing/Outlet.mjs | 89 -- deps/framework/routing/Outlet.mjs.map | 1 - deps/framework/routing/Router.d.ts | 70 -- deps/framework/routing/Router.js | 271 ----- deps/framework/routing/Router.js.map | 1 - deps/framework/routing/Router.mjs | 248 ----- deps/framework/routing/Router.mjs.map | 1 - deps/framework/routing/RouterInjector.d.ts | 20 - deps/framework/routing/RouterInjector.js | 37 - deps/framework/routing/RouterInjector.js.map | 1 - deps/framework/routing/RouterInjector.mjs | 23 - deps/framework/routing/RouterInjector.mjs.map | 1 - .../routing/history/HashHistory.d.ts | 14 - deps/framework/routing/history/HashHistory.js | 54 - .../routing/history/HashHistory.js.map | 1 - .../framework/routing/history/HashHistory.mjs | 34 - .../routing/history/HashHistory.mjs.map | 1 - .../routing/history/MemoryHistory.d.ts | 11 - .../routing/history/MemoryHistory.js | 44 - .../routing/history/MemoryHistory.js.map | 1 - .../routing/history/MemoryHistory.mjs | 25 - .../routing/history/MemoryHistory.mjs.map | 1 - .../routing/history/StateHistory.d.ts | 13 - .../framework/routing/history/StateHistory.js | 82 -- .../routing/history/StateHistory.js.map | 1 - .../routing/history/StateHistory.mjs | 62 -- .../routing/history/StateHistory.mjs.map | 1 - deps/framework/routing/interfaces.d.ts | 227 ---- deps/framework/shim/Map.d.ts | 105 -- deps/framework/shim/Map.js | 126 --- deps/framework/shim/Map.js.map | 1 - deps/framework/shim/Map.mjs | 96 -- deps/framework/shim/Map.mjs.map | 1 - deps/framework/shim/Observable.d.ts | 155 --- deps/framework/shim/Observable.js | 348 ------- deps/framework/shim/Observable.js.map | 1 - deps/framework/shim/Observable.mjs | 305 ------ deps/framework/shim/Observable.mjs.map | 1 - deps/framework/shim/Promise.d.ts | 16 - deps/framework/shim/Promise.js | 236 ----- deps/framework/shim/Promise.js.map | 1 - deps/framework/shim/Promise.mjs | 199 ---- deps/framework/shim/Promise.mjs.map | 1 - deps/framework/shim/Set.d.ts | 86 -- deps/framework/shim/Set.js | 103 -- deps/framework/shim/Set.js.map | 1 - deps/framework/shim/Set.mjs | 74 -- deps/framework/shim/Set.mjs.map | 1 - deps/framework/shim/Symbol.d.ts | 14 - deps/framework/shim/Symbol.js | 158 --- deps/framework/shim/Symbol.js.map | 1 - deps/framework/shim/Symbol.mjs | 145 --- deps/framework/shim/Symbol.mjs.map | 1 - deps/framework/shim/WeakMap.d.ts | 61 -- deps/framework/shim/WeakMap.js | 136 --- deps/framework/shim/WeakMap.js.map | 1 - deps/framework/shim/WeakMap.mjs | 111 -- deps/framework/shim/WeakMap.mjs.map | 1 - deps/framework/shim/array.d.ts | 94 -- deps/framework/shim/array.js | 219 ---- deps/framework/shim/array.js.map | 1 - deps/framework/shim/array.mjs | 248 ----- deps/framework/shim/array.mjs.map | 1 - deps/framework/shim/browser.d.ts | 3 - deps/framework/shim/browser.js | 19 - deps/framework/shim/browser.js.map | 1 - deps/framework/shim/browser.mjs | 7 - deps/framework/shim/browser.mjs.map | 1 - deps/framework/shim/global.d.ts | 2 - deps/framework/shim/global.js | 30 - deps/framework/shim/global.js.map | 1 - deps/framework/shim/global.mjs | 18 - deps/framework/shim/global.mjs.map | 1 - deps/framework/shim/interfaces.d.ts | 12 - deps/framework/shim/iterator.d.ts | 66 -- deps/framework/shim/iterator.js | 129 --- deps/framework/shim/iterator.js.map | 1 - deps/framework/shim/iterator.mjs | 111 -- deps/framework/shim/iterator.mjs.map | 1 - deps/framework/shim/main.d.ts | 14 - deps/framework/shim/main.js | 38 - deps/framework/shim/main.js.map | 1 - deps/framework/shim/main.mjs | 17 - deps/framework/shim/main.mjs.map | 1 - deps/framework/shim/math.d.ts | 123 --- deps/framework/shim/math.js | 243 ----- deps/framework/shim/math.js.map | 1 - deps/framework/shim/math.mjs | 215 ---- deps/framework/shim/math.mjs.map | 1 - deps/framework/shim/number.d.ts | 44 - deps/framework/shim/number.js | 70 -- deps/framework/shim/number.js.map | 1 - deps/framework/shim/number.mjs | 54 - deps/framework/shim/number.mjs.map | 1 - deps/framework/shim/object.d.ts | 103 -- deps/framework/shim/object.js | 92 -- deps/framework/shim/object.js.map | 1 - deps/framework/shim/object.mjs | 111 -- deps/framework/shim/object.mjs.map | 1 - deps/framework/shim/string.d.ts | 117 --- deps/framework/shim/string.js | 242 ----- deps/framework/shim/string.js.map | 1 - deps/framework/shim/string.mjs | 297 ------ deps/framework/shim/string.mjs.map | 1 - deps/framework/shim/support/decorators.d.ts | 8 - deps/framework/shim/support/decorators.js | 28 - deps/framework/shim/support/decorators.js.map | 1 - deps/framework/shim/support/decorators.mjs | 15 - .../framework/shim/support/decorators.mjs.map | 1 - deps/framework/shim/support/has.d.ts | 3 - deps/framework/shim/support/has.js | 184 ---- deps/framework/shim/support/has.js.map | 1 - deps/framework/shim/support/has.mjs | 166 --- deps/framework/shim/support/has.mjs.map | 1 - deps/framework/shim/support/queue.d.ts | 33 - deps/framework/shim/support/queue.js | 198 ---- deps/framework/shim/support/queue.js.map | 1 - deps/framework/shim/support/queue.mjs | 186 ---- deps/framework/shim/support/queue.mjs.map | 1 - deps/framework/shim/support/util.d.ts | 21 - deps/framework/shim/support/util.js | 44 - deps/framework/shim/support/util.js.map | 1 - deps/framework/shim/support/util.mjs | 23 - deps/framework/shim/support/util.mjs.map | 1 - deps/framework/shim/tslib.d.ts | 0 deps/framework/shim/tslib.js | 50 - deps/framework/shim/tslib.js.map | 1 - deps/framework/shim/tslib.mjs | 38 - deps/framework/shim/tslib.mjs.map | 1 - deps/framework/shim/util/amd.d.ts | 2 - deps/framework/shim/util/amd.js | 37 - deps/framework/shim/util/amd.js.map | 1 - deps/framework/shim/util/amd.mjs | 37 - deps/framework/shim/util/amd.mjs.map | 1 - deps/framework/stores/Store.d.ts | 62 -- deps/framework/stores/Store.js | 141 --- deps/framework/stores/Store.js.map | 1 - deps/framework/stores/Store.mjs | 118 --- deps/framework/stores/Store.mjs.map | 1 - deps/framework/stores/StoreContainer.d.ts | 3 - deps/framework/stores/StoreContainer.js | 18 - deps/framework/stores/StoreContainer.js.map | 1 - deps/framework/stores/StoreContainer.mjs | 4 - deps/framework/stores/StoreContainer.mjs.map | 1 - deps/framework/stores/StoreInjector.d.ts | 36 - deps/framework/stores/StoreInjector.js | 105 -- deps/framework/stores/StoreInjector.js.map | 1 - deps/framework/stores/StoreInjector.mjs | 78 -- deps/framework/stores/StoreInjector.mjs.map | 1 - .../stores/middleware/HistoryManager.d.ts | 22 - .../stores/middleware/HistoryManager.js | 119 --- .../stores/middleware/HistoryManager.js.map | 1 - .../stores/middleware/HistoryManager.mjs | 102 -- .../stores/middleware/HistoryManager.mjs.map | 1 - deps/framework/stores/process.d.ts | 121 --- deps/framework/stores/process.js | 152 --- deps/framework/stores/process.js.map | 1 - deps/framework/stores/process.mjs | 113 -- deps/framework/stores/process.mjs.map | 1 - deps/framework/stores/state/Patch.d.ts | 38 - deps/framework/stores/state/Patch.js | 152 --- deps/framework/stores/state/Patch.js.map | 1 - deps/framework/stores/state/Patch.mjs | 135 --- deps/framework/stores/state/Patch.mjs.map | 1 - deps/framework/stores/state/Pointer.d.ts | 16 - deps/framework/stores/state/Pointer.js | 117 --- deps/framework/stores/state/Pointer.js.map | 1 - deps/framework/stores/state/Pointer.mjs | 90 -- deps/framework/stores/state/Pointer.mjs.map | 1 - deps/framework/stores/state/operations.d.ts | 6 - deps/framework/stores/state/operations.js | 46 - deps/framework/stores/state/operations.js.map | 1 - deps/framework/stores/state/operations.mjs | 30 - .../framework/stores/state/operations.mjs.map | 1 - deps/framework/testing/harness.d.ts | 39 - deps/framework/testing/harness.js | 149 --- deps/framework/testing/harness.js.map | 1 - deps/framework/testing/harness.mjs | 123 --- deps/framework/testing/harness.mjs.map | 1 - .../testing/support/assertRender.d.ts | 4 - .../framework/testing/support/assertRender.js | 124 --- .../testing/support/assertRender.js.map | 1 - .../testing/support/assertRender.mjs | 109 -- .../testing/support/assertRender.mjs.map | 1 - deps/framework/testing/support/selector.d.ts | 6 - deps/framework/testing/support/selector.js | 120 --- .../framework/testing/support/selector.js.map | 1 - deps/framework/testing/support/selector.mjs | 106 -- .../testing/support/selector.mjs.map | 1 - deps/framework/typings.d.ts | 5 - deps/framework/widget-core/Container.d.ts | 8 - deps/framework/widget-core/Container.js | 38 - deps/framework/widget-core/Container.js.map | 1 - deps/framework/widget-core/Container.mjs | 19 - deps/framework/widget-core/Container.mjs.map | 1 - deps/framework/widget-core/Injector.d.ts | 14 - deps/framework/widget-core/Injector.js | 38 - deps/framework/widget-core/Injector.js.map | 1 - deps/framework/widget-core/Injector.mjs | 21 - deps/framework/widget-core/Injector.mjs.map | 1 - deps/framework/widget-core/NodeHandler.d.ts | 26 - deps/framework/widget-core/NodeHandler.js | 56 - deps/framework/widget-core/NodeHandler.js.map | 1 - deps/framework/widget-core/NodeHandler.mjs | 39 - .../framework/widget-core/NodeHandler.mjs.map | 1 - deps/framework/widget-core/Registry.d.ts | 94 -- deps/framework/widget-core/Registry.js | 136 --- deps/framework/widget-core/Registry.js.map | 1 - deps/framework/widget-core/Registry.mjs | 113 -- deps/framework/widget-core/Registry.mjs.map | 1 - .../widget-core/RegistryHandler.d.ts | 23 - deps/framework/widget-core/RegistryHandler.js | 96 -- .../widget-core/RegistryHandler.js.map | 1 - .../framework/widget-core/RegistryHandler.mjs | 72 -- .../widget-core/RegistryHandler.mjs.map | 1 - deps/framework/widget-core/WidgetBase.d.ts | 107 -- deps/framework/widget-core/WidgetBase.js | 397 ------- deps/framework/widget-core/WidgetBase.js.map | 1 - deps/framework/widget-core/WidgetBase.mjs | 359 ------- deps/framework/widget-core/WidgetBase.mjs.map | 1 - .../animations/cssTransitions.d.ts | 6 - .../widget-core/animations/cssTransitions.js | 75 -- .../animations/cssTransitions.js.map | 1 - .../widget-core/animations/cssTransitions.mjs | 63 -- .../animations/cssTransitions.mjs.map | 1 - deps/framework/widget-core/d.d.ts | 82 -- deps/framework/widget-core/d.js | 134 --- deps/framework/widget-core/d.js.map | 1 - deps/framework/widget-core/d.mjs | 109 -- deps/framework/widget-core/d.mjs.map | 1 - .../widget-core/decorators/afterRender.d.ts | 6 - .../widget-core/decorators/afterRender.js | 21 - .../widget-core/decorators/afterRender.js.map | 1 - .../widget-core/decorators/afterRender.mjs | 8 - .../decorators/afterRender.mjs.map | 1 - .../widget-core/decorators/alwaysRender.d.ts | 2 - .../widget-core/decorators/alwaysRender.js | 24 - .../decorators/alwaysRender.js.map | 1 - .../widget-core/decorators/alwaysRender.mjs | 11 - .../decorators/alwaysRender.mjs.map | 1 - .../decorators/beforeProperties.d.ts | 8 - .../decorators/beforeProperties.js | 21 - .../decorators/beforeProperties.js.map | 1 - .../decorators/beforeProperties.mjs | 8 - .../decorators/beforeProperties.mjs.map | 1 - .../widget-core/decorators/beforeRender.d.ts | 6 - .../widget-core/decorators/beforeRender.js | 21 - .../decorators/beforeRender.js.map | 1 - .../widget-core/decorators/beforeRender.mjs | 8 - .../decorators/beforeRender.mjs.map | 1 - .../widget-core/decorators/customElement.d.ts | 37 - .../widget-core/decorators/customElement.js | 34 - .../decorators/customElement.js.map | 1 - .../widget-core/decorators/customElement.mjs | 20 - .../decorators/customElement.mjs.map | 1 - .../widget-core/decorators/diffProperty.d.ts | 10 - .../widget-core/decorators/diffProperty.js | 37 - .../decorators/diffProperty.js.map | 1 - .../widget-core/decorators/diffProperty.mjs | 23 - .../decorators/diffProperty.mjs.map | 1 - .../decorators/handleDecorator.d.ts | 9 - .../widget-core/decorators/handleDecorator.js | 31 - .../decorators/handleDecorator.js.map | 1 - .../decorators/handleDecorator.mjs | 18 - .../decorators/handleDecorator.mjs.map | 1 - .../widget-core/decorators/inject.d.ts | 31 - .../widget-core/decorators/inject.js | 52 - .../widget-core/decorators/inject.js.map | 1 - .../widget-core/decorators/inject.mjs | 37 - .../widget-core/decorators/inject.mjs.map | 1 - .../widget-core/decorators/registry.d.ts | 11 - .../widget-core/decorators/registry.js | 31 - .../widget-core/decorators/registry.js.map | 1 - .../widget-core/decorators/registry.mjs | 17 - .../widget-core/decorators/registry.mjs.map | 1 - deps/framework/widget-core/diff.d.ts | 6 - deps/framework/widget-core/diff.js | 83 -- deps/framework/widget-core/diff.js.map | 1 - deps/framework/widget-core/diff.mjs | 66 -- deps/framework/widget-core/diff.mjs.map | 1 - deps/framework/widget-core/interfaces.d.ts | 509 --------- deps/framework/widget-core/meta/Base.d.ts | 14 - deps/framework/widget-core/meta/Base.js | 56 - deps/framework/widget-core/meta/Base.js.map | 1 - deps/framework/widget-core/meta/Base.mjs | 38 - deps/framework/widget-core/meta/Base.mjs.map | 1 - .../widget-core/meta/Dimensions.d.ts | 24 - deps/framework/widget-core/meta/Dimensions.js | 92 -- .../widget-core/meta/Dimensions.js.map | 1 - .../framework/widget-core/meta/Dimensions.mjs | 73 -- .../widget-core/meta/Dimensions.mjs.map | 1 - deps/framework/widget-core/meta/Drag.d.ts | 48 - deps/framework/widget-core/meta/Drag.js | 220 ---- deps/framework/widget-core/meta/Drag.js.map | 1 - deps/framework/widget-core/meta/Drag.mjs | 201 ---- deps/framework/widget-core/meta/Drag.mjs.map | 1 - deps/framework/widget-core/meta/Focus.d.ts | 14 - deps/framework/widget-core/meta/Focus.js | 62 -- deps/framework/widget-core/meta/Focus.js.map | 1 - deps/framework/widget-core/meta/Focus.mjs | 45 - deps/framework/widget-core/meta/Focus.mjs.map | 1 - .../widget-core/meta/Intersection.d.ts | 31 - .../widget-core/meta/Intersection.js | 102 -- .../widget-core/meta/Intersection.js.map | 1 - .../widget-core/meta/Intersection.mjs | 72 -- .../widget-core/meta/Intersection.mjs.map | 1 - deps/framework/widget-core/meta/Matches.d.ts | 9 - deps/framework/widget-core/meta/Matches.js | 31 - .../framework/widget-core/meta/Matches.js.map | 1 - deps/framework/widget-core/meta/Matches.mjs | 12 - .../widget-core/meta/Matches.mjs.map | 1 - deps/framework/widget-core/meta/Resize.d.ts | 25 - deps/framework/widget-core/meta/Resize.js | 65 -- deps/framework/widget-core/meta/Resize.js.map | 1 - deps/framework/widget-core/meta/Resize.mjs | 45 - .../framework/widget-core/meta/Resize.mjs.map | 1 - .../widget-core/meta/WebAnimation.d.ts | 62 -- .../widget-core/meta/WebAnimation.js | 119 --- .../widget-core/meta/WebAnimation.js.map | 1 - .../widget-core/meta/WebAnimation.mjs | 100 -- .../widget-core/meta/WebAnimation.mjs.map | 1 - deps/framework/widget-core/mixins/Focus.d.ts | 12 - deps/framework/widget-core/mixins/Focus.js | 52 - .../framework/widget-core/mixins/Focus.js.map | 1 - deps/framework/widget-core/mixins/Focus.mjs | 36 - .../widget-core/mixins/Focus.mjs.map | 1 - deps/framework/widget-core/mixins/I18n.d.ts | 75 -- deps/framework/widget-core/mixins/I18n.js | 165 --- deps/framework/widget-core/mixins/I18n.js.map | 1 - deps/framework/widget-core/mixins/I18n.mjs | 143 --- .../framework/widget-core/mixins/I18n.mjs.map | 1 - .../widget-core/mixins/Projector.d.ts | 90 -- .../framework/widget-core/mixins/Projector.js | 186 ---- .../widget-core/mixins/Projector.js.map | 1 - .../widget-core/mixins/Projector.mjs | 154 --- .../widget-core/mixins/Projector.mjs.map | 1 - deps/framework/widget-core/mixins/Themed.d.ts | 55 - deps/framework/widget-core/mixins/Themed.js | 161 --- .../widget-core/mixins/Themed.js.map | 1 - deps/framework/widget-core/mixins/Themed.mjs | 141 --- .../widget-core/mixins/Themed.mjs.map | 1 - .../widget-core/registerCustomElement.d.ts | 9 - .../widget-core/registerCustomElement.js | 261 ----- .../widget-core/registerCustomElement.js.map | 1 - .../widget-core/registerCustomElement.mjs | 213 ---- .../widget-core/registerCustomElement.mjs.map | 1 - deps/framework/widget-core/tsx.d.ts | 21 - deps/framework/widget-core/tsx.js | 68 -- deps/framework/widget-core/tsx.js.map | 1 - deps/framework/widget-core/tsx.mjs | 43 - deps/framework/widget-core/tsx.mjs.map | 1 - deps/framework/widget-core/vdom.d.ts | 63 -- deps/framework/widget-core/vdom.js | 966 ------------------ deps/framework/widget-core/vdom.js.map | 1 - deps/framework/widget-core/vdom.mjs | 939 ----------------- deps/framework/widget-core/vdom.mjs.map | 1 - package-lock.json | 134 +-- package.json | 2 +- 638 files changed, 68 insertions(+), 36297 deletions(-) delete mode 100644 deps/framework/core/DateObject.d.ts delete mode 100644 deps/framework/core/DateObject.js delete mode 100644 deps/framework/core/DateObject.js.map delete mode 100644 deps/framework/core/DateObject.mjs delete mode 100644 deps/framework/core/DateObject.mjs.map delete mode 100644 deps/framework/core/Destroyable.d.ts delete mode 100644 deps/framework/core/Destroyable.js delete mode 100644 deps/framework/core/Destroyable.js.map delete mode 100644 deps/framework/core/Destroyable.mjs delete mode 100644 deps/framework/core/Destroyable.mjs.map delete mode 100644 deps/framework/core/Evented.d.ts delete mode 100644 deps/framework/core/Evented.js delete mode 100644 deps/framework/core/Evented.js.map delete mode 100644 deps/framework/core/Evented.mjs delete mode 100644 deps/framework/core/Evented.mjs.map delete mode 100644 deps/framework/core/IdentityRegistry.d.ts delete mode 100644 deps/framework/core/IdentityRegistry.js delete mode 100644 deps/framework/core/IdentityRegistry.js.map delete mode 100644 deps/framework/core/IdentityRegistry.mjs delete mode 100644 deps/framework/core/IdentityRegistry.mjs.map delete mode 100644 deps/framework/core/List.d.ts delete mode 100644 deps/framework/core/List.js delete mode 100644 deps/framework/core/List.js.map delete mode 100644 deps/framework/core/List.mjs delete mode 100644 deps/framework/core/List.mjs.map delete mode 100644 deps/framework/core/MatchRegistry.d.ts delete mode 100644 deps/framework/core/MatchRegistry.js delete mode 100644 deps/framework/core/MatchRegistry.js.map delete mode 100644 deps/framework/core/MatchRegistry.mjs delete mode 100644 deps/framework/core/MatchRegistry.mjs.map delete mode 100644 deps/framework/core/MultiMap.d.ts delete mode 100644 deps/framework/core/MultiMap.js delete mode 100644 deps/framework/core/MultiMap.js.map delete mode 100644 deps/framework/core/MultiMap.mjs delete mode 100644 deps/framework/core/MultiMap.mjs.map delete mode 100644 deps/framework/core/Observable.d.ts delete mode 100644 deps/framework/core/Observable.js delete mode 100644 deps/framework/core/Observable.js.map delete mode 100644 deps/framework/core/Observable.mjs delete mode 100644 deps/framework/core/Observable.mjs.map delete mode 100644 deps/framework/core/QueuingEvented.d.ts delete mode 100644 deps/framework/core/QueuingEvented.js delete mode 100644 deps/framework/core/QueuingEvented.js.map delete mode 100644 deps/framework/core/QueuingEvented.mjs delete mode 100644 deps/framework/core/QueuingEvented.mjs.map delete mode 100644 deps/framework/core/Scheduler.d.ts delete mode 100644 deps/framework/core/Scheduler.js delete mode 100644 deps/framework/core/Scheduler.js.map delete mode 100644 deps/framework/core/Scheduler.mjs delete mode 100644 deps/framework/core/Scheduler.mjs.map delete mode 100644 deps/framework/core/UrlSearchParams.d.ts delete mode 100644 deps/framework/core/UrlSearchParams.js delete mode 100644 deps/framework/core/UrlSearchParams.js.map delete mode 100644 deps/framework/core/UrlSearchParams.mjs delete mode 100644 deps/framework/core/UrlSearchParams.mjs.map delete mode 100644 deps/framework/core/aspect.d.ts delete mode 100644 deps/framework/core/aspect.js delete mode 100644 deps/framework/core/aspect.js.map delete mode 100644 deps/framework/core/aspect.mjs delete mode 100644 deps/framework/core/aspect.mjs.map delete mode 100644 deps/framework/core/async/ExtensiblePromise.d.ts delete mode 100644 deps/framework/core/async/ExtensiblePromise.js delete mode 100644 deps/framework/core/async/ExtensiblePromise.js.map delete mode 100644 deps/framework/core/async/ExtensiblePromise.mjs delete mode 100644 deps/framework/core/async/ExtensiblePromise.mjs.map delete mode 100644 deps/framework/core/async/Task.d.ts delete mode 100644 deps/framework/core/async/Task.js delete mode 100644 deps/framework/core/async/Task.js.map delete mode 100644 deps/framework/core/async/Task.mjs delete mode 100644 deps/framework/core/async/Task.mjs.map delete mode 100644 deps/framework/core/async/iteration.d.ts delete mode 100644 deps/framework/core/async/iteration.js delete mode 100644 deps/framework/core/async/iteration.js.map delete mode 100644 deps/framework/core/async/iteration.mjs delete mode 100644 deps/framework/core/async/iteration.mjs.map delete mode 100644 deps/framework/core/async/timing.d.ts delete mode 100644 deps/framework/core/async/timing.js delete mode 100644 deps/framework/core/async/timing.js.map delete mode 100644 deps/framework/core/async/timing.mjs delete mode 100644 deps/framework/core/async/timing.mjs.map delete mode 100644 deps/framework/core/base64.d.ts delete mode 100644 deps/framework/core/base64.js delete mode 100644 deps/framework/core/base64.js.map delete mode 100644 deps/framework/core/base64.mjs delete mode 100644 deps/framework/core/base64.mjs.map delete mode 100644 deps/framework/core/compare.d.ts delete mode 100644 deps/framework/core/compare.js delete mode 100644 deps/framework/core/compare.js.map delete mode 100644 deps/framework/core/compare.mjs delete mode 100644 deps/framework/core/compare.mjs.map delete mode 100644 deps/framework/core/global.d.ts delete mode 100644 deps/framework/core/global.js delete mode 100644 deps/framework/core/global.js.map delete mode 100644 deps/framework/core/global.mjs delete mode 100644 deps/framework/core/global.mjs.map delete mode 100644 deps/framework/core/has.d.ts delete mode 100644 deps/framework/core/has.js delete mode 100644 deps/framework/core/has.js.map delete mode 100644 deps/framework/core/has.mjs delete mode 100644 deps/framework/core/has.mjs.map delete mode 100644 deps/framework/core/instrument.d.ts delete mode 100644 deps/framework/core/instrument.js delete mode 100644 deps/framework/core/instrument.js.map delete mode 100644 deps/framework/core/instrument.mjs delete mode 100644 deps/framework/core/instrument.mjs.map delete mode 100644 deps/framework/core/interfaces.d.ts delete mode 100644 deps/framework/core/interfaces.js delete mode 100644 deps/framework/core/interfaces.js.map delete mode 100644 deps/framework/core/interfaces.mjs delete mode 100644 deps/framework/core/interfaces.mjs.map delete mode 100644 deps/framework/core/lang.d.ts delete mode 100644 deps/framework/core/lang.js delete mode 100644 deps/framework/core/lang.js.map delete mode 100644 deps/framework/core/lang.mjs delete mode 100644 deps/framework/core/lang.mjs.map delete mode 100644 deps/framework/core/load.d.ts delete mode 100644 deps/framework/core/load.js delete mode 100644 deps/framework/core/load.js.map delete mode 100644 deps/framework/core/load.mjs delete mode 100644 deps/framework/core/load.mjs.map delete mode 100644 deps/framework/core/load/util.d.ts delete mode 100644 deps/framework/core/load/util.js delete mode 100644 deps/framework/core/load/util.js.map delete mode 100644 deps/framework/core/load/util.mjs delete mode 100644 deps/framework/core/load/util.mjs.map delete mode 100644 deps/framework/core/load/webpack.d.ts delete mode 100644 deps/framework/core/load/webpack.js delete mode 100644 deps/framework/core/load/webpack.js.map delete mode 100644 deps/framework/core/load/webpack.mjs delete mode 100644 deps/framework/core/load/webpack.mjs.map delete mode 100644 deps/framework/core/main.d.ts delete mode 100644 deps/framework/core/main.js delete mode 100644 deps/framework/core/main.js.map delete mode 100644 deps/framework/core/main.mjs delete mode 100644 deps/framework/core/main.mjs.map delete mode 100644 deps/framework/core/on.d.ts delete mode 100644 deps/framework/core/on.js delete mode 100644 deps/framework/core/on.js.map delete mode 100644 deps/framework/core/on.mjs delete mode 100644 deps/framework/core/on.mjs.map delete mode 100644 deps/framework/core/queue.d.ts delete mode 100644 deps/framework/core/queue.js delete mode 100644 deps/framework/core/queue.js.map delete mode 100644 deps/framework/core/queue.mjs delete mode 100644 deps/framework/core/queue.mjs.map delete mode 100644 deps/framework/core/request.d.ts delete mode 100644 deps/framework/core/request.js delete mode 100644 deps/framework/core/request.js.map delete mode 100644 deps/framework/core/request.mjs delete mode 100644 deps/framework/core/request.mjs.map delete mode 100644 deps/framework/core/request/Headers.d.ts delete mode 100644 deps/framework/core/request/Headers.js delete mode 100644 deps/framework/core/request/Headers.js.map delete mode 100644 deps/framework/core/request/Headers.mjs delete mode 100644 deps/framework/core/request/Headers.mjs.map delete mode 100644 deps/framework/core/request/ProviderRegistry.d.ts delete mode 100644 deps/framework/core/request/ProviderRegistry.js delete mode 100644 deps/framework/core/request/ProviderRegistry.js.map delete mode 100644 deps/framework/core/request/ProviderRegistry.mjs delete mode 100644 deps/framework/core/request/ProviderRegistry.mjs.map delete mode 100644 deps/framework/core/request/Response.d.ts delete mode 100644 deps/framework/core/request/Response.js delete mode 100644 deps/framework/core/request/Response.js.map delete mode 100644 deps/framework/core/request/Response.mjs delete mode 100644 deps/framework/core/request/Response.mjs.map delete mode 100644 deps/framework/core/request/SubscriptionPool.d.ts delete mode 100644 deps/framework/core/request/SubscriptionPool.js delete mode 100644 deps/framework/core/request/SubscriptionPool.js.map delete mode 100644 deps/framework/core/request/SubscriptionPool.mjs delete mode 100644 deps/framework/core/request/SubscriptionPool.mjs.map delete mode 100644 deps/framework/core/request/TimeoutError.d.ts delete mode 100644 deps/framework/core/request/TimeoutError.js delete mode 100644 deps/framework/core/request/TimeoutError.js.map delete mode 100644 deps/framework/core/request/TimeoutError.mjs delete mode 100644 deps/framework/core/request/TimeoutError.mjs.map delete mode 100644 deps/framework/core/request/interfaces.d.ts delete mode 100644 deps/framework/core/request/providers/node.d.ts delete mode 100644 deps/framework/core/request/providers/node.js delete mode 100644 deps/framework/core/request/providers/node.js.map delete mode 100644 deps/framework/core/request/providers/node.mjs delete mode 100644 deps/framework/core/request/providers/node.mjs.map delete mode 100644 deps/framework/core/request/providers/xhr.d.ts delete mode 100644 deps/framework/core/request/providers/xhr.js delete mode 100644 deps/framework/core/request/providers/xhr.js.map delete mode 100644 deps/framework/core/request/providers/xhr.mjs delete mode 100644 deps/framework/core/request/providers/xhr.mjs.map delete mode 100644 deps/framework/core/request/util.d.ts delete mode 100644 deps/framework/core/request/util.js delete mode 100644 deps/framework/core/request/util.js.map delete mode 100644 deps/framework/core/request/util.mjs delete mode 100644 deps/framework/core/request/util.mjs.map delete mode 100644 deps/framework/core/stringExtras.d.ts delete mode 100644 deps/framework/core/stringExtras.js delete mode 100644 deps/framework/core/stringExtras.js.map delete mode 100644 deps/framework/core/stringExtras.mjs delete mode 100644 deps/framework/core/stringExtras.mjs.map delete mode 100644 deps/framework/core/text.d.ts delete mode 100644 deps/framework/core/text.js delete mode 100644 deps/framework/core/text.js.map delete mode 100644 deps/framework/core/text.mjs delete mode 100644 deps/framework/core/text.mjs.map delete mode 100644 deps/framework/core/util.d.ts delete mode 100644 deps/framework/core/util.js delete mode 100644 deps/framework/core/util.js.map delete mode 100644 deps/framework/core/util.mjs delete mode 100644 deps/framework/core/util.mjs.map delete mode 100644 deps/framework/core/uuid.d.ts delete mode 100644 deps/framework/core/uuid.js delete mode 100644 deps/framework/core/uuid.js.map delete mode 100644 deps/framework/core/uuid.mjs delete mode 100644 deps/framework/core/uuid.mjs.map delete mode 100644 deps/framework/has/has.d.ts delete mode 100644 deps/framework/has/has.js delete mode 100644 deps/framework/has/has.js.map delete mode 100644 deps/framework/has/has.mjs delete mode 100644 deps/framework/has/has.mjs.map delete mode 100644 deps/framework/has/loader.d.ts delete mode 100644 deps/framework/has/loader.js delete mode 100644 deps/framework/has/loader.js.map delete mode 100644 deps/framework/has/loader.mjs delete mode 100644 deps/framework/has/loader.mjs.map delete mode 100644 deps/framework/has/main.d.ts delete mode 100644 deps/framework/has/main.js delete mode 100644 deps/framework/has/main.js.map delete mode 100644 deps/framework/has/main.mjs delete mode 100644 deps/framework/has/main.mjs.map delete mode 100644 deps/framework/i18n/cldr/load.d.ts delete mode 100644 deps/framework/i18n/cldr/load.js delete mode 100644 deps/framework/i18n/cldr/load.js.map delete mode 100644 deps/framework/i18n/cldr/load.mjs delete mode 100644 deps/framework/i18n/cldr/load.mjs.map delete mode 100644 deps/framework/i18n/cldr/locales.d.ts delete mode 100644 deps/framework/i18n/cldr/locales.js delete mode 100644 deps/framework/i18n/cldr/locales.js.map delete mode 100644 deps/framework/i18n/cldr/locales.mjs delete mode 100644 deps/framework/i18n/cldr/locales.mjs.map delete mode 100644 deps/framework/i18n/date.d.ts delete mode 100644 deps/framework/i18n/date.js delete mode 100644 deps/framework/i18n/date.js.map delete mode 100644 deps/framework/i18n/date.mjs delete mode 100644 deps/framework/i18n/date.mjs.map delete mode 100644 deps/framework/i18n/i18n.d.ts delete mode 100644 deps/framework/i18n/i18n.js delete mode 100644 deps/framework/i18n/i18n.js.map delete mode 100644 deps/framework/i18n/i18n.mjs delete mode 100644 deps/framework/i18n/i18n.mjs.map delete mode 100644 deps/framework/i18n/main.d.ts delete mode 100644 deps/framework/i18n/main.js delete mode 100644 deps/framework/i18n/main.js.map delete mode 100644 deps/framework/i18n/main.mjs delete mode 100644 deps/framework/i18n/main.mjs.map delete mode 100644 deps/framework/i18n/number.d.ts delete mode 100644 deps/framework/i18n/number.js delete mode 100644 deps/framework/i18n/number.js.map delete mode 100644 deps/framework/i18n/number.mjs delete mode 100644 deps/framework/i18n/number.mjs.map delete mode 100644 deps/framework/i18n/unit.d.ts delete mode 100644 deps/framework/i18n/unit.js delete mode 100644 deps/framework/i18n/unit.js.map delete mode 100644 deps/framework/i18n/unit.mjs delete mode 100644 deps/framework/i18n/unit.mjs.map delete mode 100644 deps/framework/i18n/util/globalize.d.ts delete mode 100644 deps/framework/i18n/util/globalize.js delete mode 100644 deps/framework/i18n/util/globalize.js.map delete mode 100644 deps/framework/i18n/util/globalize.mjs delete mode 100644 deps/framework/i18n/util/globalize.mjs.map delete mode 100644 deps/framework/i18n/util/main.d.ts delete mode 100644 deps/framework/i18n/util/main.js delete mode 100644 deps/framework/i18n/util/main.js.map delete mode 100644 deps/framework/i18n/util/main.mjs delete mode 100644 deps/framework/i18n/util/main.mjs.map delete mode 100644 deps/framework/package.json delete mode 100644 deps/framework/routing/Link.d.ts delete mode 100644 deps/framework/routing/Link.js delete mode 100644 deps/framework/routing/Link.js.map delete mode 100644 deps/framework/routing/Link.mjs delete mode 100644 deps/framework/routing/Link.mjs.map delete mode 100644 deps/framework/routing/Outlet.d.ts delete mode 100644 deps/framework/routing/Outlet.js delete mode 100644 deps/framework/routing/Outlet.js.map delete mode 100644 deps/framework/routing/Outlet.mjs delete mode 100644 deps/framework/routing/Outlet.mjs.map delete mode 100644 deps/framework/routing/Router.d.ts delete mode 100644 deps/framework/routing/Router.js delete mode 100644 deps/framework/routing/Router.js.map delete mode 100644 deps/framework/routing/Router.mjs delete mode 100644 deps/framework/routing/Router.mjs.map delete mode 100644 deps/framework/routing/RouterInjector.d.ts delete mode 100644 deps/framework/routing/RouterInjector.js delete mode 100644 deps/framework/routing/RouterInjector.js.map delete mode 100644 deps/framework/routing/RouterInjector.mjs delete mode 100644 deps/framework/routing/RouterInjector.mjs.map delete mode 100644 deps/framework/routing/history/HashHistory.d.ts delete mode 100644 deps/framework/routing/history/HashHistory.js delete mode 100644 deps/framework/routing/history/HashHistory.js.map delete mode 100644 deps/framework/routing/history/HashHistory.mjs delete mode 100644 deps/framework/routing/history/HashHistory.mjs.map delete mode 100644 deps/framework/routing/history/MemoryHistory.d.ts delete mode 100644 deps/framework/routing/history/MemoryHistory.js delete mode 100644 deps/framework/routing/history/MemoryHistory.js.map delete mode 100644 deps/framework/routing/history/MemoryHistory.mjs delete mode 100644 deps/framework/routing/history/MemoryHistory.mjs.map delete mode 100644 deps/framework/routing/history/StateHistory.d.ts delete mode 100644 deps/framework/routing/history/StateHistory.js delete mode 100644 deps/framework/routing/history/StateHistory.js.map delete mode 100644 deps/framework/routing/history/StateHistory.mjs delete mode 100644 deps/framework/routing/history/StateHistory.mjs.map delete mode 100644 deps/framework/routing/interfaces.d.ts delete mode 100644 deps/framework/shim/Map.d.ts delete mode 100644 deps/framework/shim/Map.js delete mode 100644 deps/framework/shim/Map.js.map delete mode 100644 deps/framework/shim/Map.mjs delete mode 100644 deps/framework/shim/Map.mjs.map delete mode 100644 deps/framework/shim/Observable.d.ts delete mode 100644 deps/framework/shim/Observable.js delete mode 100644 deps/framework/shim/Observable.js.map delete mode 100644 deps/framework/shim/Observable.mjs delete mode 100644 deps/framework/shim/Observable.mjs.map delete mode 100644 deps/framework/shim/Promise.d.ts delete mode 100644 deps/framework/shim/Promise.js delete mode 100644 deps/framework/shim/Promise.js.map delete mode 100644 deps/framework/shim/Promise.mjs delete mode 100644 deps/framework/shim/Promise.mjs.map delete mode 100644 deps/framework/shim/Set.d.ts delete mode 100644 deps/framework/shim/Set.js delete mode 100644 deps/framework/shim/Set.js.map delete mode 100644 deps/framework/shim/Set.mjs delete mode 100644 deps/framework/shim/Set.mjs.map delete mode 100644 deps/framework/shim/Symbol.d.ts delete mode 100644 deps/framework/shim/Symbol.js delete mode 100644 deps/framework/shim/Symbol.js.map delete mode 100644 deps/framework/shim/Symbol.mjs delete mode 100644 deps/framework/shim/Symbol.mjs.map delete mode 100644 deps/framework/shim/WeakMap.d.ts delete mode 100644 deps/framework/shim/WeakMap.js delete mode 100644 deps/framework/shim/WeakMap.js.map delete mode 100644 deps/framework/shim/WeakMap.mjs delete mode 100644 deps/framework/shim/WeakMap.mjs.map delete mode 100644 deps/framework/shim/array.d.ts delete mode 100644 deps/framework/shim/array.js delete mode 100644 deps/framework/shim/array.js.map delete mode 100644 deps/framework/shim/array.mjs delete mode 100644 deps/framework/shim/array.mjs.map delete mode 100644 deps/framework/shim/browser.d.ts delete mode 100644 deps/framework/shim/browser.js delete mode 100644 deps/framework/shim/browser.js.map delete mode 100644 deps/framework/shim/browser.mjs delete mode 100644 deps/framework/shim/browser.mjs.map delete mode 100644 deps/framework/shim/global.d.ts delete mode 100644 deps/framework/shim/global.js delete mode 100644 deps/framework/shim/global.js.map delete mode 100644 deps/framework/shim/global.mjs delete mode 100644 deps/framework/shim/global.mjs.map delete mode 100644 deps/framework/shim/interfaces.d.ts delete mode 100644 deps/framework/shim/iterator.d.ts delete mode 100644 deps/framework/shim/iterator.js delete mode 100644 deps/framework/shim/iterator.js.map delete mode 100644 deps/framework/shim/iterator.mjs delete mode 100644 deps/framework/shim/iterator.mjs.map delete mode 100644 deps/framework/shim/main.d.ts delete mode 100644 deps/framework/shim/main.js delete mode 100644 deps/framework/shim/main.js.map delete mode 100644 deps/framework/shim/main.mjs delete mode 100644 deps/framework/shim/main.mjs.map delete mode 100644 deps/framework/shim/math.d.ts delete mode 100644 deps/framework/shim/math.js delete mode 100644 deps/framework/shim/math.js.map delete mode 100644 deps/framework/shim/math.mjs delete mode 100644 deps/framework/shim/math.mjs.map delete mode 100644 deps/framework/shim/number.d.ts delete mode 100644 deps/framework/shim/number.js delete mode 100644 deps/framework/shim/number.js.map delete mode 100644 deps/framework/shim/number.mjs delete mode 100644 deps/framework/shim/number.mjs.map delete mode 100644 deps/framework/shim/object.d.ts delete mode 100644 deps/framework/shim/object.js delete mode 100644 deps/framework/shim/object.js.map delete mode 100644 deps/framework/shim/object.mjs delete mode 100644 deps/framework/shim/object.mjs.map delete mode 100644 deps/framework/shim/string.d.ts delete mode 100644 deps/framework/shim/string.js delete mode 100644 deps/framework/shim/string.js.map delete mode 100644 deps/framework/shim/string.mjs delete mode 100644 deps/framework/shim/string.mjs.map delete mode 100644 deps/framework/shim/support/decorators.d.ts delete mode 100644 deps/framework/shim/support/decorators.js delete mode 100644 deps/framework/shim/support/decorators.js.map delete mode 100644 deps/framework/shim/support/decorators.mjs delete mode 100644 deps/framework/shim/support/decorators.mjs.map delete mode 100644 deps/framework/shim/support/has.d.ts delete mode 100644 deps/framework/shim/support/has.js delete mode 100644 deps/framework/shim/support/has.js.map delete mode 100644 deps/framework/shim/support/has.mjs delete mode 100644 deps/framework/shim/support/has.mjs.map delete mode 100644 deps/framework/shim/support/queue.d.ts delete mode 100644 deps/framework/shim/support/queue.js delete mode 100644 deps/framework/shim/support/queue.js.map delete mode 100644 deps/framework/shim/support/queue.mjs delete mode 100644 deps/framework/shim/support/queue.mjs.map delete mode 100644 deps/framework/shim/support/util.d.ts delete mode 100644 deps/framework/shim/support/util.js delete mode 100644 deps/framework/shim/support/util.js.map delete mode 100644 deps/framework/shim/support/util.mjs delete mode 100644 deps/framework/shim/support/util.mjs.map delete mode 100644 deps/framework/shim/tslib.d.ts delete mode 100644 deps/framework/shim/tslib.js delete mode 100644 deps/framework/shim/tslib.js.map delete mode 100644 deps/framework/shim/tslib.mjs delete mode 100644 deps/framework/shim/tslib.mjs.map delete mode 100644 deps/framework/shim/util/amd.d.ts delete mode 100644 deps/framework/shim/util/amd.js delete mode 100644 deps/framework/shim/util/amd.js.map delete mode 100644 deps/framework/shim/util/amd.mjs delete mode 100644 deps/framework/shim/util/amd.mjs.map delete mode 100644 deps/framework/stores/Store.d.ts delete mode 100644 deps/framework/stores/Store.js delete mode 100644 deps/framework/stores/Store.js.map delete mode 100644 deps/framework/stores/Store.mjs delete mode 100644 deps/framework/stores/Store.mjs.map delete mode 100644 deps/framework/stores/StoreContainer.d.ts delete mode 100644 deps/framework/stores/StoreContainer.js delete mode 100644 deps/framework/stores/StoreContainer.js.map delete mode 100644 deps/framework/stores/StoreContainer.mjs delete mode 100644 deps/framework/stores/StoreContainer.mjs.map delete mode 100644 deps/framework/stores/StoreInjector.d.ts delete mode 100644 deps/framework/stores/StoreInjector.js delete mode 100644 deps/framework/stores/StoreInjector.js.map delete mode 100644 deps/framework/stores/StoreInjector.mjs delete mode 100644 deps/framework/stores/StoreInjector.mjs.map delete mode 100644 deps/framework/stores/middleware/HistoryManager.d.ts delete mode 100644 deps/framework/stores/middleware/HistoryManager.js delete mode 100644 deps/framework/stores/middleware/HistoryManager.js.map delete mode 100644 deps/framework/stores/middleware/HistoryManager.mjs delete mode 100644 deps/framework/stores/middleware/HistoryManager.mjs.map delete mode 100644 deps/framework/stores/process.d.ts delete mode 100644 deps/framework/stores/process.js delete mode 100644 deps/framework/stores/process.js.map delete mode 100644 deps/framework/stores/process.mjs delete mode 100644 deps/framework/stores/process.mjs.map delete mode 100644 deps/framework/stores/state/Patch.d.ts delete mode 100644 deps/framework/stores/state/Patch.js delete mode 100644 deps/framework/stores/state/Patch.js.map delete mode 100644 deps/framework/stores/state/Patch.mjs delete mode 100644 deps/framework/stores/state/Patch.mjs.map delete mode 100644 deps/framework/stores/state/Pointer.d.ts delete mode 100644 deps/framework/stores/state/Pointer.js delete mode 100644 deps/framework/stores/state/Pointer.js.map delete mode 100644 deps/framework/stores/state/Pointer.mjs delete mode 100644 deps/framework/stores/state/Pointer.mjs.map delete mode 100644 deps/framework/stores/state/operations.d.ts delete mode 100644 deps/framework/stores/state/operations.js delete mode 100644 deps/framework/stores/state/operations.js.map delete mode 100644 deps/framework/stores/state/operations.mjs delete mode 100644 deps/framework/stores/state/operations.mjs.map delete mode 100644 deps/framework/testing/harness.d.ts delete mode 100644 deps/framework/testing/harness.js delete mode 100644 deps/framework/testing/harness.js.map delete mode 100644 deps/framework/testing/harness.mjs delete mode 100644 deps/framework/testing/harness.mjs.map delete mode 100644 deps/framework/testing/support/assertRender.d.ts delete mode 100644 deps/framework/testing/support/assertRender.js delete mode 100644 deps/framework/testing/support/assertRender.js.map delete mode 100644 deps/framework/testing/support/assertRender.mjs delete mode 100644 deps/framework/testing/support/assertRender.mjs.map delete mode 100644 deps/framework/testing/support/selector.d.ts delete mode 100644 deps/framework/testing/support/selector.js delete mode 100644 deps/framework/testing/support/selector.js.map delete mode 100644 deps/framework/testing/support/selector.mjs delete mode 100644 deps/framework/testing/support/selector.mjs.map delete mode 100644 deps/framework/typings.d.ts delete mode 100644 deps/framework/widget-core/Container.d.ts delete mode 100644 deps/framework/widget-core/Container.js delete mode 100644 deps/framework/widget-core/Container.js.map delete mode 100644 deps/framework/widget-core/Container.mjs delete mode 100644 deps/framework/widget-core/Container.mjs.map delete mode 100644 deps/framework/widget-core/Injector.d.ts delete mode 100644 deps/framework/widget-core/Injector.js delete mode 100644 deps/framework/widget-core/Injector.js.map delete mode 100644 deps/framework/widget-core/Injector.mjs delete mode 100644 deps/framework/widget-core/Injector.mjs.map delete mode 100644 deps/framework/widget-core/NodeHandler.d.ts delete mode 100644 deps/framework/widget-core/NodeHandler.js delete mode 100644 deps/framework/widget-core/NodeHandler.js.map delete mode 100644 deps/framework/widget-core/NodeHandler.mjs delete mode 100644 deps/framework/widget-core/NodeHandler.mjs.map delete mode 100644 deps/framework/widget-core/Registry.d.ts delete mode 100644 deps/framework/widget-core/Registry.js delete mode 100644 deps/framework/widget-core/Registry.js.map delete mode 100644 deps/framework/widget-core/Registry.mjs delete mode 100644 deps/framework/widget-core/Registry.mjs.map delete mode 100644 deps/framework/widget-core/RegistryHandler.d.ts delete mode 100644 deps/framework/widget-core/RegistryHandler.js delete mode 100644 deps/framework/widget-core/RegistryHandler.js.map delete mode 100644 deps/framework/widget-core/RegistryHandler.mjs delete mode 100644 deps/framework/widget-core/RegistryHandler.mjs.map delete mode 100644 deps/framework/widget-core/WidgetBase.d.ts delete mode 100644 deps/framework/widget-core/WidgetBase.js delete mode 100644 deps/framework/widget-core/WidgetBase.js.map delete mode 100644 deps/framework/widget-core/WidgetBase.mjs delete mode 100644 deps/framework/widget-core/WidgetBase.mjs.map delete mode 100644 deps/framework/widget-core/animations/cssTransitions.d.ts delete mode 100644 deps/framework/widget-core/animations/cssTransitions.js delete mode 100644 deps/framework/widget-core/animations/cssTransitions.js.map delete mode 100644 deps/framework/widget-core/animations/cssTransitions.mjs delete mode 100644 deps/framework/widget-core/animations/cssTransitions.mjs.map delete mode 100644 deps/framework/widget-core/d.d.ts delete mode 100644 deps/framework/widget-core/d.js delete mode 100644 deps/framework/widget-core/d.js.map delete mode 100644 deps/framework/widget-core/d.mjs delete mode 100644 deps/framework/widget-core/d.mjs.map delete mode 100644 deps/framework/widget-core/decorators/afterRender.d.ts delete mode 100644 deps/framework/widget-core/decorators/afterRender.js delete mode 100644 deps/framework/widget-core/decorators/afterRender.js.map delete mode 100644 deps/framework/widget-core/decorators/afterRender.mjs delete mode 100644 deps/framework/widget-core/decorators/afterRender.mjs.map delete mode 100644 deps/framework/widget-core/decorators/alwaysRender.d.ts delete mode 100644 deps/framework/widget-core/decorators/alwaysRender.js delete mode 100644 deps/framework/widget-core/decorators/alwaysRender.js.map delete mode 100644 deps/framework/widget-core/decorators/alwaysRender.mjs delete mode 100644 deps/framework/widget-core/decorators/alwaysRender.mjs.map delete mode 100644 deps/framework/widget-core/decorators/beforeProperties.d.ts delete mode 100644 deps/framework/widget-core/decorators/beforeProperties.js delete mode 100644 deps/framework/widget-core/decorators/beforeProperties.js.map delete mode 100644 deps/framework/widget-core/decorators/beforeProperties.mjs delete mode 100644 deps/framework/widget-core/decorators/beforeProperties.mjs.map delete mode 100644 deps/framework/widget-core/decorators/beforeRender.d.ts delete mode 100644 deps/framework/widget-core/decorators/beforeRender.js delete mode 100644 deps/framework/widget-core/decorators/beforeRender.js.map delete mode 100644 deps/framework/widget-core/decorators/beforeRender.mjs delete mode 100644 deps/framework/widget-core/decorators/beforeRender.mjs.map delete mode 100644 deps/framework/widget-core/decorators/customElement.d.ts delete mode 100644 deps/framework/widget-core/decorators/customElement.js delete mode 100644 deps/framework/widget-core/decorators/customElement.js.map delete mode 100644 deps/framework/widget-core/decorators/customElement.mjs delete mode 100644 deps/framework/widget-core/decorators/customElement.mjs.map delete mode 100644 deps/framework/widget-core/decorators/diffProperty.d.ts delete mode 100644 deps/framework/widget-core/decorators/diffProperty.js delete mode 100644 deps/framework/widget-core/decorators/diffProperty.js.map delete mode 100644 deps/framework/widget-core/decorators/diffProperty.mjs delete mode 100644 deps/framework/widget-core/decorators/diffProperty.mjs.map delete mode 100644 deps/framework/widget-core/decorators/handleDecorator.d.ts delete mode 100644 deps/framework/widget-core/decorators/handleDecorator.js delete mode 100644 deps/framework/widget-core/decorators/handleDecorator.js.map delete mode 100644 deps/framework/widget-core/decorators/handleDecorator.mjs delete mode 100644 deps/framework/widget-core/decorators/handleDecorator.mjs.map delete mode 100644 deps/framework/widget-core/decorators/inject.d.ts delete mode 100644 deps/framework/widget-core/decorators/inject.js delete mode 100644 deps/framework/widget-core/decorators/inject.js.map delete mode 100644 deps/framework/widget-core/decorators/inject.mjs delete mode 100644 deps/framework/widget-core/decorators/inject.mjs.map delete mode 100644 deps/framework/widget-core/decorators/registry.d.ts delete mode 100644 deps/framework/widget-core/decorators/registry.js delete mode 100644 deps/framework/widget-core/decorators/registry.js.map delete mode 100644 deps/framework/widget-core/decorators/registry.mjs delete mode 100644 deps/framework/widget-core/decorators/registry.mjs.map delete mode 100644 deps/framework/widget-core/diff.d.ts delete mode 100644 deps/framework/widget-core/diff.js delete mode 100644 deps/framework/widget-core/diff.js.map delete mode 100644 deps/framework/widget-core/diff.mjs delete mode 100644 deps/framework/widget-core/diff.mjs.map delete mode 100644 deps/framework/widget-core/interfaces.d.ts delete mode 100644 deps/framework/widget-core/meta/Base.d.ts delete mode 100644 deps/framework/widget-core/meta/Base.js delete mode 100644 deps/framework/widget-core/meta/Base.js.map delete mode 100644 deps/framework/widget-core/meta/Base.mjs delete mode 100644 deps/framework/widget-core/meta/Base.mjs.map delete mode 100644 deps/framework/widget-core/meta/Dimensions.d.ts delete mode 100644 deps/framework/widget-core/meta/Dimensions.js delete mode 100644 deps/framework/widget-core/meta/Dimensions.js.map delete mode 100644 deps/framework/widget-core/meta/Dimensions.mjs delete mode 100644 deps/framework/widget-core/meta/Dimensions.mjs.map delete mode 100644 deps/framework/widget-core/meta/Drag.d.ts delete mode 100644 deps/framework/widget-core/meta/Drag.js delete mode 100644 deps/framework/widget-core/meta/Drag.js.map delete mode 100644 deps/framework/widget-core/meta/Drag.mjs delete mode 100644 deps/framework/widget-core/meta/Drag.mjs.map delete mode 100644 deps/framework/widget-core/meta/Focus.d.ts delete mode 100644 deps/framework/widget-core/meta/Focus.js delete mode 100644 deps/framework/widget-core/meta/Focus.js.map delete mode 100644 deps/framework/widget-core/meta/Focus.mjs delete mode 100644 deps/framework/widget-core/meta/Focus.mjs.map delete mode 100644 deps/framework/widget-core/meta/Intersection.d.ts delete mode 100644 deps/framework/widget-core/meta/Intersection.js delete mode 100644 deps/framework/widget-core/meta/Intersection.js.map delete mode 100644 deps/framework/widget-core/meta/Intersection.mjs delete mode 100644 deps/framework/widget-core/meta/Intersection.mjs.map delete mode 100644 deps/framework/widget-core/meta/Matches.d.ts delete mode 100644 deps/framework/widget-core/meta/Matches.js delete mode 100644 deps/framework/widget-core/meta/Matches.js.map delete mode 100644 deps/framework/widget-core/meta/Matches.mjs delete mode 100644 deps/framework/widget-core/meta/Matches.mjs.map delete mode 100644 deps/framework/widget-core/meta/Resize.d.ts delete mode 100644 deps/framework/widget-core/meta/Resize.js delete mode 100644 deps/framework/widget-core/meta/Resize.js.map delete mode 100644 deps/framework/widget-core/meta/Resize.mjs delete mode 100644 deps/framework/widget-core/meta/Resize.mjs.map delete mode 100644 deps/framework/widget-core/meta/WebAnimation.d.ts delete mode 100644 deps/framework/widget-core/meta/WebAnimation.js delete mode 100644 deps/framework/widget-core/meta/WebAnimation.js.map delete mode 100644 deps/framework/widget-core/meta/WebAnimation.mjs delete mode 100644 deps/framework/widget-core/meta/WebAnimation.mjs.map delete mode 100644 deps/framework/widget-core/mixins/Focus.d.ts delete mode 100644 deps/framework/widget-core/mixins/Focus.js delete mode 100644 deps/framework/widget-core/mixins/Focus.js.map delete mode 100644 deps/framework/widget-core/mixins/Focus.mjs delete mode 100644 deps/framework/widget-core/mixins/Focus.mjs.map delete mode 100644 deps/framework/widget-core/mixins/I18n.d.ts delete mode 100644 deps/framework/widget-core/mixins/I18n.js delete mode 100644 deps/framework/widget-core/mixins/I18n.js.map delete mode 100644 deps/framework/widget-core/mixins/I18n.mjs delete mode 100644 deps/framework/widget-core/mixins/I18n.mjs.map delete mode 100644 deps/framework/widget-core/mixins/Projector.d.ts delete mode 100644 deps/framework/widget-core/mixins/Projector.js delete mode 100644 deps/framework/widget-core/mixins/Projector.js.map delete mode 100644 deps/framework/widget-core/mixins/Projector.mjs delete mode 100644 deps/framework/widget-core/mixins/Projector.mjs.map delete mode 100644 deps/framework/widget-core/mixins/Themed.d.ts delete mode 100644 deps/framework/widget-core/mixins/Themed.js delete mode 100644 deps/framework/widget-core/mixins/Themed.js.map delete mode 100644 deps/framework/widget-core/mixins/Themed.mjs delete mode 100644 deps/framework/widget-core/mixins/Themed.mjs.map delete mode 100644 deps/framework/widget-core/registerCustomElement.d.ts delete mode 100644 deps/framework/widget-core/registerCustomElement.js delete mode 100644 deps/framework/widget-core/registerCustomElement.js.map delete mode 100644 deps/framework/widget-core/registerCustomElement.mjs delete mode 100644 deps/framework/widget-core/registerCustomElement.mjs.map delete mode 100644 deps/framework/widget-core/tsx.d.ts delete mode 100644 deps/framework/widget-core/tsx.js delete mode 100644 deps/framework/widget-core/tsx.js.map delete mode 100644 deps/framework/widget-core/tsx.mjs delete mode 100644 deps/framework/widget-core/tsx.mjs.map delete mode 100644 deps/framework/widget-core/vdom.d.ts delete mode 100644 deps/framework/widget-core/vdom.js delete mode 100644 deps/framework/widget-core/vdom.js.map delete mode 100644 deps/framework/widget-core/vdom.mjs delete mode 100644 deps/framework/widget-core/vdom.mjs.map diff --git a/deps/framework/core/DateObject.d.ts b/deps/framework/core/DateObject.d.ts deleted file mode 100644 index 71db089288..0000000000 --- a/deps/framework/core/DateObject.d.ts +++ /dev/null @@ -1,71 +0,0 @@ -export interface KwArgs { - dayOfMonth?: number; - hours?: number; - milliseconds?: number; - minutes?: number; - month: number; - seconds?: number; - year: number; -} -export interface OperationKwArgs { - days?: number; - hours?: number; - milliseconds?: number; - minutes?: number; - months?: number; - seconds?: number; - years?: number; -} -/** - * The properties of a complete date - */ -export interface DateProperties { - dayOfMonth: number; - readonly dayOfWeek: number; - readonly daysInMonth: number; - hours: number; - readonly isLeapYear: boolean; - milliseconds: number; - minutes: number; - month: number; - seconds: number; - year: number; -} -export declare class DateObject implements DateProperties { - static parse(str: string): DateObject; - static now(): DateObject; - private readonly _date; - readonly utc: DateProperties; - constructor(value: number); - constructor(value: string); - constructor(value: Date); - constructor(value: KwArgs); - constructor(); - readonly isLeapYear: boolean; - readonly daysInMonth: number; - year: number; - month: number; - dayOfMonth: number; - hours: number; - minutes: number; - seconds: number; - milliseconds: number; - time: number; - readonly dayOfWeek: number; - readonly timezoneOffset: number; - add(value: number): DateObject; - add(value: OperationKwArgs): DateObject; - compare(value: DateObject): number; - compareDate(value: KwArgs): number; - compareTime(value: KwArgs): number; - toString(): string; - toDateString(): string; - toTimeString(): string; - toLocaleString(): string; - toLocaleDateString(): string; - toLocaleTimeString(): string; - toISOString(): string; - toJSON(key?: any): string; - valueOf(): number; -} -export default DateObject; diff --git a/deps/framework/core/DateObject.js b/deps/framework/core/DateObject.js deleted file mode 100644 index 2876fc1f11..0000000000 --- a/deps/framework/core/DateObject.js +++ /dev/null @@ -1,316 +0,0 @@ -(function (factory) { - if (typeof module === "object" && typeof module.exports === "object") { - var v = factory(require, exports); - if (v !== undefined) module.exports = v; - } - else if (typeof define === "function" && define.amd) { - define(["require", "exports"], factory); - } -})(function (require, exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - var days = [NaN, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]; - var isLeapYear = (function () { - var date = new Date(); - function isLeapYear(year) { - date.setFullYear(year, 1, 29); - return date.getDate() === 29; - } - return isLeapYear; - })(); - var operationOrder = ['years', 'months', 'days', 'hours', 'minutes', 'seconds', 'milliseconds']; - var operationHash = Object.create(null, { - days: { value: 'Date' }, - hours: { value: 'UTCHours' }, - milliseconds: { value: 'UTCMilliseconds' }, - minutes: { value: 'UTCMinutes' }, - months: { value: 'Month' }, - seconds: { value: 'UTCSeconds' }, - years: { value: 'FullYear' } - }); - var DateObject = /** @class */ (function () { - function DateObject(value) { - var _date; - if (!arguments.length) { - _date = new Date(); - } - else if (value instanceof Date) { - _date = new Date(+value); - } - else if (typeof value === 'number' || typeof value === 'string') { - _date = new Date(value); - } - else { - _date = new Date(value.year, value.month - 1, value.dayOfMonth || 1, value.hours || 0, value.minutes || 0, value.seconds || 0, value.milliseconds || 0); - } - this._date = _date; - var self = this; - this.utc = { - get isLeapYear() { - return isLeapYear(this.year); - }, - get daysInMonth() { - var month = this.month; - if (month === 2 && this.isLeapYear) { - return 29; - } - return days[month]; - }, - get year() { - return self._date.getUTCFullYear(); - }, - set year(year) { - self._date.setUTCFullYear(year); - }, - get month() { - return self._date.getUTCMonth() + 1; - }, - set month(month) { - self._date.setUTCMonth(month - 1); - }, - get dayOfMonth() { - return self._date.getUTCDate(); - }, - set dayOfMonth(day) { - self._date.setUTCDate(day); - }, - get hours() { - return self._date.getUTCHours(); - }, - set hours(hours) { - self._date.setUTCHours(hours); - }, - get minutes() { - return self._date.getUTCMinutes(); - }, - set minutes(minutes) { - self._date.setUTCMinutes(minutes); - }, - get seconds() { - return self._date.getUTCSeconds(); - }, - set seconds(seconds) { - self._date.setUTCSeconds(seconds); - }, - get milliseconds() { - return self._date.getUTCMilliseconds(); - }, - set milliseconds(milliseconds) { - self._date.setUTCMilliseconds(milliseconds); - }, - get dayOfWeek() { - return self._date.getUTCDay(); - }, - toString: function () { - return self._date.toUTCString(); - } - }; - } - DateObject.parse = function (str) { - return new DateObject(Date.parse(str)); - }; - DateObject.now = function () { - return new DateObject(Date.now()); - }; - Object.defineProperty(DateObject.prototype, "isLeapYear", { - get: function () { - return isLeapYear(this.year); - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(DateObject.prototype, "daysInMonth", { - get: function () { - var month = this.month; - if (month === 2 && this.isLeapYear) { - return 29; - } - return days[month]; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(DateObject.prototype, "year", { - get: function () { - return this._date.getFullYear(); - }, - set: function (year) { - var dayOfMonth = this.dayOfMonth; - this._date.setFullYear(year); - if (this.dayOfMonth < dayOfMonth) { - this.dayOfMonth = 0; - } - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(DateObject.prototype, "month", { - get: function () { - return this._date.getMonth() + 1; - }, - set: function (month) { - var dayOfMonth = this.dayOfMonth; - this._date.setMonth(month - 1); - if (this.dayOfMonth < dayOfMonth) { - this.dayOfMonth = 0; - } - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(DateObject.prototype, "dayOfMonth", { - get: function () { - return this._date.getDate(); - }, - set: function (day) { - this._date.setDate(day); - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(DateObject.prototype, "hours", { - get: function () { - return this._date.getHours(); - }, - set: function (hours) { - this._date.setHours(hours); - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(DateObject.prototype, "minutes", { - get: function () { - return this._date.getMinutes(); - }, - set: function (minutes) { - this._date.setMinutes(minutes); - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(DateObject.prototype, "seconds", { - get: function () { - return this._date.getSeconds(); - }, - set: function (seconds) { - this._date.setSeconds(seconds); - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(DateObject.prototype, "milliseconds", { - get: function () { - return this._date.getMilliseconds(); - }, - set: function (milliseconds) { - this._date.setMilliseconds(milliseconds); - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(DateObject.prototype, "time", { - get: function () { - return this._date.getTime(); - }, - set: function (time) { - this._date.setTime(time); - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(DateObject.prototype, "dayOfWeek", { - get: function () { - return this._date.getDay(); - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(DateObject.prototype, "timezoneOffset", { - get: function () { - return this._date.getTimezoneOffset(); - }, - enumerable: true, - configurable: true - }); - DateObject.prototype.add = function (value) { - var _this = this; - var result = new DateObject(this.time); - if (typeof value === 'number') { - result.time += value; - } - else { - // Properties have to be added in a particular order to properly handle - // date overshoots in month and year calculations - operationOrder.forEach(function (property) { - if (!(property in value)) { - return; - } - var dateMethod = operationHash[property]; - result._date["set" + dateMethod](_this._date["get" + dateMethod]() + value[property]); - if ((property === 'years' || property === 'months') && result.dayOfMonth < _this.dayOfMonth) { - // Set the day of the month to 0 to move the date to the first day of the previous - // month to fix overshoots when adding a month and the date is the 31st or adding - // a year and the date is the 29th - result.dayOfMonth = 0; - } - }); - } - return result; - }; - DateObject.prototype.compare = function (value) { - var result = this.time - value.time; - if (result > 0) { - return 1; - } - if (result < 0) { - return -1; - } - return 0; - }; - DateObject.prototype.compareDate = function (value) { - var left = new DateObject(this); - var right = new DateObject(value); - left._date.setHours(0, 0, 0, 0); - right._date.setHours(0, 0, 0, 0); - return left.compare(right); - }; - DateObject.prototype.compareTime = function (value) { - var left = new DateObject(this); - var right = new DateObject(value); - left._date.setFullYear(0, 0, 0); - right._date.setFullYear(0, 0, 0); - return left.compare(right); - }; - DateObject.prototype.toString = function () { - return this._date.toString(); - }; - DateObject.prototype.toDateString = function () { - return this._date.toDateString(); - }; - DateObject.prototype.toTimeString = function () { - return this._date.toTimeString(); - }; - DateObject.prototype.toLocaleString = function () { - return this._date.toLocaleString(); - }; - DateObject.prototype.toLocaleDateString = function () { - return this._date.toLocaleDateString(); - }; - DateObject.prototype.toLocaleTimeString = function () { - return this._date.toLocaleTimeString(); - }; - DateObject.prototype.toISOString = function () { - return this._date.toISOString(); - }; - DateObject.prototype.toJSON = function (key) { - return this._date.toJSON(key); - }; - DateObject.prototype.valueOf = function () { - return this._date.valueOf(); - }; - return DateObject; - }()); - exports.DateObject = DateObject; - exports.default = DateObject; -}); -//# sourceMappingURL=DateObject.js.map \ No newline at end of file diff --git a/deps/framework/core/DateObject.js.map b/deps/framework/core/DateObject.js.map deleted file mode 100644 index ea87b84a33..0000000000 --- a/deps/framework/core/DateObject.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"DateObject.js","sourceRoot":"","sources":["DateObject.ts"],"names":[],"mappings":";;;;;;;;;;;IAsCA,IAAM,IAAI,GAAG,CAAC,GAAG,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC;IAEnE,IAAM,UAAU,GAAG,CAAC;QACnB,IAAM,IAAI,GAAG,IAAI,IAAI,EAAE,CAAC;QACxB,oBAAoB,IAAY;YAC/B,IAAI,CAAC,WAAW,CAAC,IAAI,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC;YAC9B,MAAM,CAAC,IAAI,CAAC,OAAO,EAAE,KAAK,EAAE,CAAC;QAC9B,CAAC;QACD,MAAM,CAAC,UAAU,CAAC;IACnB,CAAC,CAAC,EAAE,CAAC;IAEL,IAAM,cAAc,GAAG,CAAC,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,cAAc,CAAC,CAAC;IAClG,IAAM,aAAa,GAAiB,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE;QACvD,IAAI,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE;QACvB,KAAK,EAAE,EAAE,KAAK,EAAE,UAAU,EAAE;QAC5B,YAAY,EAAE,EAAE,KAAK,EAAE,iBAAiB,EAAE;QAC1C,OAAO,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C;QACD,gCAAW,GAAX;YACC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,WAAW,EAAE,CAAC;QACjC,CAAC;QACD,2BAAM,GAAN,UAAO,GAAS;YACf,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;QAC/B,CAAC;QACD,4BAAO,GAAP;YACC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC;QAC7B,CAAC;QACF,iBAAC;IAAD,CAAC,AA/RD,IA+RC;IA/RY,gCAAU;IAiSvB,kBAAe,UAAU,CAAC","sourcesContent":["import { Hash } from './interfaces';\n\nexport interface KwArgs {\n\tdayOfMonth?: number;\n\thours?: number;\n\tmilliseconds?: number;\n\tminutes?: number;\n\tmonth: number;\n\tseconds?: number;\n\tyear: number;\n}\n\nexport interface OperationKwArgs {\n\tdays?: number;\n\thours?: number;\n\tmilliseconds?: number;\n\tminutes?: number;\n\tmonths?: number;\n\tseconds?: number;\n\tyears?: number;\n}\n\n/**\n * The properties of a complete date\n */\nexport interface DateProperties {\n\tdayOfMonth: number;\n\treadonly dayOfWeek: number;\n\treadonly daysInMonth: number;\n\thours: number;\n\treadonly isLeapYear: boolean;\n\tmilliseconds: number;\n\tminutes: number;\n\tmonth: number;\n\tseconds: number;\n\tyear: number;\n}\n\nconst days = [NaN, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];\n\nconst isLeapYear = (function() {\n\tconst date = new Date();\n\tfunction isLeapYear(year: number): boolean {\n\t\tdate.setFullYear(year, 1, 29);\n\t\treturn date.getDate() === 29;\n\t}\n\treturn isLeapYear;\n})();\n\nconst operationOrder = ['years', 'months', 'days', 'hours', 'minutes', 'seconds', 'milliseconds'];\nconst operationHash: Hash = Object.create(null, {\n\tdays: { value: 'Date' },\n\thours: { value: 'UTCHours' },\n\tmilliseconds: { value: 'UTCMilliseconds' },\n\tminutes: { value: 'UTCMinutes' },\n\tmonths: { value: 'Month' },\n\tseconds: { value: 'UTCSeconds' },\n\tyears: { value: 'FullYear' }\n});\n\nexport class DateObject implements DateProperties {\n\tstatic parse(str: string): DateObject {\n\t\treturn new DateObject(Date.parse(str));\n\t}\n\n\tstatic now(): DateObject {\n\t\treturn new DateObject(Date.now());\n\t}\n\n\tprivate readonly _date: Date;\n\treadonly utc: DateProperties;\n\n\tconstructor(value: number);\n\tconstructor(value: string);\n\tconstructor(value: Date);\n\tconstructor(value: KwArgs);\n\tconstructor();\n\tconstructor(value?: any) {\n\t\tlet _date: Date;\n\t\tif (!arguments.length) {\n\t\t\t_date = new Date();\n\t\t} else if (value instanceof Date) {\n\t\t\t_date = new Date(+value);\n\t\t} else if (typeof value === 'number' || typeof value === 'string') {\n\t\t\t_date = new Date(value);\n\t\t} else {\n\t\t\t_date = new Date(\n\t\t\t\tvalue.year,\n\t\t\t\tvalue.month - 1,\n\t\t\t\tvalue.dayOfMonth || 1,\n\t\t\t\tvalue.hours || 0,\n\t\t\t\tvalue.minutes || 0,\n\t\t\t\tvalue.seconds || 0,\n\t\t\t\tvalue.milliseconds || 0\n\t\t\t);\n\t\t}\n\n\t\tthis._date = _date;\n\t\tconst self = this;\n\t\tthis.utc = {\n\t\t\tget isLeapYear(this: DateObject): boolean {\n\t\t\t\treturn isLeapYear(this.year);\n\t\t\t},\n\t\t\tget daysInMonth(this: DateObject): number {\n\t\t\t\tconst month = this.month;\n\n\t\t\t\tif (month === 2 && this.isLeapYear) {\n\t\t\t\t\treturn 29;\n\t\t\t\t}\n\t\t\t\treturn days[month];\n\t\t\t},\n\n\t\t\tget year(): number {\n\t\t\t\treturn self._date.getUTCFullYear();\n\t\t\t},\n\t\t\tset year(year: number) {\n\t\t\t\tself._date.setUTCFullYear(year);\n\t\t\t},\n\n\t\t\tget month(): number {\n\t\t\t\treturn self._date.getUTCMonth() + 1;\n\t\t\t},\n\t\t\tset month(month: number) {\n\t\t\t\tself._date.setUTCMonth(month - 1);\n\t\t\t},\n\n\t\t\tget dayOfMonth(): number {\n\t\t\t\treturn self._date.getUTCDate();\n\t\t\t},\n\t\t\tset dayOfMonth(day: number) {\n\t\t\t\tself._date.setUTCDate(day);\n\t\t\t},\n\n\t\t\tget hours(): number {\n\t\t\t\treturn self._date.getUTCHours();\n\t\t\t},\n\t\t\tset hours(hours: number) {\n\t\t\t\tself._date.setUTCHours(hours);\n\t\t\t},\n\n\t\t\tget minutes(): number {\n\t\t\t\treturn self._date.getUTCMinutes();\n\t\t\t},\n\t\t\tset minutes(minutes: number) {\n\t\t\t\tself._date.setUTCMinutes(minutes);\n\t\t\t},\n\n\t\t\tget seconds(): number {\n\t\t\t\treturn self._date.getUTCSeconds();\n\t\t\t},\n\t\t\tset seconds(seconds: number) {\n\t\t\t\tself._date.setUTCSeconds(seconds);\n\t\t\t},\n\n\t\t\tget milliseconds(): number {\n\t\t\t\treturn self._date.getUTCMilliseconds();\n\t\t\t},\n\t\t\tset milliseconds(milliseconds: number) {\n\t\t\t\tself._date.setUTCMilliseconds(milliseconds);\n\t\t\t},\n\n\t\t\tget dayOfWeek(): number {\n\t\t\t\treturn self._date.getUTCDay();\n\t\t\t},\n\n\t\t\ttoString: function(): string {\n\t\t\t\treturn self._date.toUTCString();\n\t\t\t}\n\t\t} as any;\n\t}\n\n\tget isLeapYear(): boolean {\n\t\treturn isLeapYear(this.year);\n\t}\n\n\tget daysInMonth(): number {\n\t\tconst month = this.month;\n\n\t\tif (month === 2 && this.isLeapYear) {\n\t\t\treturn 29;\n\t\t}\n\t\treturn days[month];\n\t}\n\n\tget year(): number {\n\t\treturn this._date.getFullYear();\n\t}\n\tset year(year: number) {\n\t\tconst dayOfMonth = this.dayOfMonth;\n\n\t\tthis._date.setFullYear(year);\n\n\t\tif (this.dayOfMonth < dayOfMonth) {\n\t\t\tthis.dayOfMonth = 0;\n\t\t}\n\t}\n\n\tget month(): number {\n\t\treturn this._date.getMonth() + 1;\n\t}\n\tset month(month: number) {\n\t\tconst dayOfMonth = this.dayOfMonth;\n\n\t\tthis._date.setMonth(month - 1);\n\n\t\tif (this.dayOfMonth < dayOfMonth) {\n\t\t\tthis.dayOfMonth = 0;\n\t\t}\n\t}\n\n\tget dayOfMonth(): number {\n\t\treturn this._date.getDate();\n\t}\n\tset dayOfMonth(day: number) {\n\t\tthis._date.setDate(day);\n\t}\n\n\tget hours(): number {\n\t\treturn this._date.getHours();\n\t}\n\tset hours(hours: number) {\n\t\tthis._date.setHours(hours);\n\t}\n\n\tget minutes(): number {\n\t\treturn this._date.getMinutes();\n\t}\n\tset minutes(minutes: number) {\n\t\tthis._date.setMinutes(minutes);\n\t}\n\n\tget seconds(): number {\n\t\treturn this._date.getSeconds();\n\t}\n\tset seconds(seconds: number) {\n\t\tthis._date.setSeconds(seconds);\n\t}\n\n\tget milliseconds(): number {\n\t\treturn this._date.getMilliseconds();\n\t}\n\tset milliseconds(milliseconds: number) {\n\t\tthis._date.setMilliseconds(milliseconds);\n\t}\n\n\tget time(): number {\n\t\treturn this._date.getTime();\n\t}\n\tset time(time: number) {\n\t\tthis._date.setTime(time);\n\t}\n\n\tget dayOfWeek(): number {\n\t\treturn this._date.getDay();\n\t}\n\tget timezoneOffset(): number {\n\t\treturn this._date.getTimezoneOffset();\n\t}\n\n\tadd(value: number): DateObject;\n\tadd(value: OperationKwArgs): DateObject;\n\tadd(value: any): DateObject {\n\t\tconst result = new DateObject(this.time);\n\n\t\tif (typeof value === 'number') {\n\t\t\tresult.time += value;\n\t\t} else {\n\t\t\t// Properties have to be added in a particular order to properly handle\n\t\t\t// date overshoots in month and year calculations\n\t\t\toperationOrder.forEach((property: string): void => {\n\t\t\t\tif (!(property in value)) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tconst dateMethod = operationHash[property];\n\t\t\t\t(result._date)[`set${dateMethod}`]((this._date)[`get${dateMethod}`]() + value[property]);\n\n\t\t\t\tif ((property === 'years' || property === 'months') && result.dayOfMonth < this.dayOfMonth) {\n\t\t\t\t\t// Set the day of the month to 0 to move the date to the first day of the previous\n\t\t\t\t\t// month to fix overshoots when adding a month and the date is the 31st or adding\n\t\t\t\t\t// a year and the date is the 29th\n\t\t\t\t\tresult.dayOfMonth = 0;\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\n\t\treturn result;\n\t}\n\n\tcompare(value: DateObject): number {\n\t\tconst result = this.time - value.time;\n\t\tif (result > 0) {\n\t\t\treturn 1;\n\t\t}\n\t\tif (result < 0) {\n\t\t\treturn -1;\n\t\t}\n\t\treturn 0;\n\t}\n\n\tcompareDate(value: KwArgs): number {\n\t\tconst left = new DateObject(this);\n\t\tconst right = new DateObject(value);\n\n\t\tleft._date.setHours(0, 0, 0, 0);\n\t\tright._date.setHours(0, 0, 0, 0);\n\n\t\treturn left.compare(right);\n\t}\n\n\tcompareTime(value: KwArgs): number {\n\t\tconst left = new DateObject(this);\n\t\tconst right = new DateObject(value);\n\n\t\tleft._date.setFullYear(0, 0, 0);\n\t\tright._date.setFullYear(0, 0, 0);\n\n\t\treturn left.compare(right);\n\t}\n\n\ttoString(): string {\n\t\treturn this._date.toString();\n\t}\n\ttoDateString(): string {\n\t\treturn this._date.toDateString();\n\t}\n\ttoTimeString(): string {\n\t\treturn this._date.toTimeString();\n\t}\n\ttoLocaleString(): string {\n\t\treturn this._date.toLocaleString();\n\t}\n\ttoLocaleDateString(): string {\n\t\treturn this._date.toLocaleDateString();\n\t}\n\ttoLocaleTimeString(): string {\n\t\treturn this._date.toLocaleTimeString();\n\t}\n\ttoISOString(): string {\n\t\treturn this._date.toISOString();\n\t}\n\ttoJSON(key?: any): string {\n\t\treturn this._date.toJSON(key);\n\t}\n\tvalueOf(): number {\n\t\treturn this._date.valueOf();\n\t}\n}\n\nexport default DateObject;\n"]} \ No newline at end of file diff --git a/deps/framework/core/DateObject.mjs b/deps/framework/core/DateObject.mjs deleted file mode 100644 index b49490ee21..0000000000 --- a/deps/framework/core/DateObject.mjs +++ /dev/null @@ -1,253 +0,0 @@ -const days = [NaN, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]; -const isLeapYear = (function () { - const date = new Date(); - function isLeapYear(year) { - date.setFullYear(year, 1, 29); - return date.getDate() === 29; - } - return isLeapYear; -})(); -const operationOrder = ['years', 'months', 'days', 'hours', 'minutes', 'seconds', 'milliseconds']; -const operationHash = Object.create(null, { - days: { value: 'Date' }, - hours: { value: 'UTCHours' }, - milliseconds: { value: 'UTCMilliseconds' }, - minutes: { value: 'UTCMinutes' }, - months: { value: 'Month' }, - seconds: { value: 'UTCSeconds' }, - years: { value: 'FullYear' } -}); -export class DateObject { - static parse(str) { - return new DateObject(Date.parse(str)); - } - static now() { - return new DateObject(Date.now()); - } - constructor(value) { - let _date; - if (!arguments.length) { - _date = new Date(); - } - else if (value instanceof Date) { - _date = new Date(+value); - } - else if (typeof value === 'number' || typeof value === 'string') { - _date = new Date(value); - } - else { - _date = new Date(value.year, value.month - 1, value.dayOfMonth || 1, value.hours || 0, value.minutes || 0, value.seconds || 0, value.milliseconds || 0); - } - this._date = _date; - const self = this; - this.utc = { - get isLeapYear() { - return isLeapYear(this.year); - }, - get daysInMonth() { - const month = this.month; - if (month === 2 && this.isLeapYear) { - return 29; - } - return days[month]; - }, - get year() { - return self._date.getUTCFullYear(); - }, - set year(year) { - self._date.setUTCFullYear(year); - }, - get month() { - return self._date.getUTCMonth() + 1; - }, - set month(month) { - self._date.setUTCMonth(month - 1); - }, - get dayOfMonth() { - return self._date.getUTCDate(); - }, - set dayOfMonth(day) { - self._date.setUTCDate(day); - }, - get hours() { - return self._date.getUTCHours(); - }, - set hours(hours) { - self._date.setUTCHours(hours); - }, - get minutes() { - return self._date.getUTCMinutes(); - }, - set minutes(minutes) { - self._date.setUTCMinutes(minutes); - }, - get seconds() { - return self._date.getUTCSeconds(); - }, - set seconds(seconds) { - self._date.setUTCSeconds(seconds); - }, - get milliseconds() { - return self._date.getUTCMilliseconds(); - }, - set milliseconds(milliseconds) { - self._date.setUTCMilliseconds(milliseconds); - }, - get dayOfWeek() { - return self._date.getUTCDay(); - }, - toString: function () { - return self._date.toUTCString(); - } - }; - } - get isLeapYear() { - return isLeapYear(this.year); - } - get daysInMonth() { - const month = this.month; - if (month === 2 && this.isLeapYear) { - return 29; - } - return days[month]; - } - get year() { - return this._date.getFullYear(); - } - set year(year) { - const dayOfMonth = this.dayOfMonth; - this._date.setFullYear(year); - if (this.dayOfMonth < dayOfMonth) { - this.dayOfMonth = 0; - } - } - get month() { - return this._date.getMonth() + 1; - } - set month(month) { - const dayOfMonth = this.dayOfMonth; - this._date.setMonth(month - 1); - if (this.dayOfMonth < dayOfMonth) { - this.dayOfMonth = 0; - } - } - get dayOfMonth() { - return this._date.getDate(); - } - set dayOfMonth(day) { - this._date.setDate(day); - } - get hours() { - return this._date.getHours(); - } - set hours(hours) { - this._date.setHours(hours); - } - get minutes() { - return this._date.getMinutes(); - } - set minutes(minutes) { - this._date.setMinutes(minutes); - } - get seconds() { - return this._date.getSeconds(); - } - set seconds(seconds) { - this._date.setSeconds(seconds); - } - get milliseconds() { - return this._date.getMilliseconds(); - } - set milliseconds(milliseconds) { - this._date.setMilliseconds(milliseconds); - } - get time() { - return this._date.getTime(); - } - set time(time) { - this._date.setTime(time); - } - get dayOfWeek() { - return this._date.getDay(); - } - get timezoneOffset() { - return this._date.getTimezoneOffset(); - } - add(value) { - const result = new DateObject(this.time); - if (typeof value === 'number') { - result.time += value; - } - else { - // Properties have to be added in a particular order to properly handle - // date overshoots in month and year calculations - operationOrder.forEach((property) => { - if (!(property in value)) { - return; - } - const dateMethod = operationHash[property]; - result._date[`set${dateMethod}`](this._date[`get${dateMethod}`]() + value[property]); - if ((property === 'years' || property === 'months') && result.dayOfMonth < this.dayOfMonth) { - // Set the day of the month to 0 to move the date to the first day of the previous - // month to fix overshoots when adding a month and the date is the 31st or adding - // a year and the date is the 29th - result.dayOfMonth = 0; - } - }); - } - return result; - } - compare(value) { - const result = this.time - value.time; - if (result > 0) { - return 1; - } - if (result < 0) { - return -1; - } - return 0; - } - compareDate(value) { - const left = new DateObject(this); - const right = new DateObject(value); - left._date.setHours(0, 0, 0, 0); - right._date.setHours(0, 0, 0, 0); - return left.compare(right); - } - compareTime(value) { - const left = new DateObject(this); - const right = new DateObject(value); - left._date.setFullYear(0, 0, 0); - right._date.setFullYear(0, 0, 0); - return left.compare(right); - } - toString() { - return this._date.toString(); - } - toDateString() { - return this._date.toDateString(); - } - toTimeString() { - return this._date.toTimeString(); - } - toLocaleString() { - return this._date.toLocaleString(); - } - toLocaleDateString() { - return this._date.toLocaleDateString(); - } - toLocaleTimeString() { - return this._date.toLocaleTimeString(); - } - toISOString() { - return this._date.toISOString(); - } - toJSON(key) { - return this._date.toJSON(key); - } - valueOf() { - return this._date.valueOf(); - } -} -export default DateObject; -//# sourceMappingURL=DateObject.mjs.map \ No newline at end of file diff --git a/deps/framework/core/DateObject.mjs.map b/deps/framework/core/DateObject.mjs.map deleted file mode 100644 index 03b8937ce2..0000000000 --- a/deps/framework/core/DateObject.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"DateObject.mjs","sourceRoot":"","sources":["DateObject.ts"],"names":[],"mappings":"AAsCA,MAAM,IAAI,GAAG,CAAC,GAAG,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC;AAEnE,MAAM,UAAU,GAAG,CAAC;IACnB,MAAM,IAAI,GAAG,IAAI,IAAI,EAAE,CAAC;IACxB,oBAAoB,IAAY;QAC/B,IAAI,CAAC,WAAW,CAAC,IAAI,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC;QAC9B,MAAM,CAAC,IAAI,CAAC,OAAO,EAAE,KAAK,EAAE,CAAC;IAC9B,CAAC;IACD,MAAM,CAAC,UAAU,CAAC;AACnB,CAAC,CAAC,EAAE,CAAC;AAEL,MAAM,cAAc,GAAG,CAAC,OAAO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E,CAAC;IACxC,CAAC;IACD,WAAW;QACV,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,WAAW,EAAE,CAAC;IACjC,CAAC;IACD,MAAM,CAAC,GAAS;QACf,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;IAC/B,CAAC;IACD,OAAO;QACN,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC;IAC7B,CAAC;CACD;AAED,eAAe,UAAU,CAAC","sourcesContent":["import { Hash } from './interfaces';\n\nexport interface KwArgs {\n\tdayOfMonth?: number;\n\thours?: number;\n\tmilliseconds?: number;\n\tminutes?: number;\n\tmonth: number;\n\tseconds?: number;\n\tyear: number;\n}\n\nexport interface OperationKwArgs {\n\tdays?: number;\n\thours?: number;\n\tmilliseconds?: number;\n\tminutes?: number;\n\tmonths?: number;\n\tseconds?: number;\n\tyears?: number;\n}\n\n/**\n * The properties of a complete date\n */\nexport interface DateProperties {\n\tdayOfMonth: number;\n\treadonly dayOfWeek: number;\n\treadonly daysInMonth: number;\n\thours: number;\n\treadonly isLeapYear: boolean;\n\tmilliseconds: number;\n\tminutes: number;\n\tmonth: number;\n\tseconds: number;\n\tyear: number;\n}\n\nconst days = [NaN, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];\n\nconst isLeapYear = (function() {\n\tconst date = new Date();\n\tfunction isLeapYear(year: number): boolean {\n\t\tdate.setFullYear(year, 1, 29);\n\t\treturn date.getDate() === 29;\n\t}\n\treturn isLeapYear;\n})();\n\nconst operationOrder = ['years', 'months', 'days', 'hours', 'minutes', 'seconds', 'milliseconds'];\nconst operationHash: Hash = Object.create(null, {\n\tdays: { value: 'Date' },\n\thours: { value: 'UTCHours' },\n\tmilliseconds: { value: 'UTCMilliseconds' },\n\tminutes: { value: 'UTCMinutes' },\n\tmonths: { value: 'Month' },\n\tseconds: { value: 'UTCSeconds' },\n\tyears: { value: 'FullYear' }\n});\n\nexport class DateObject implements DateProperties {\n\tstatic parse(str: string): DateObject {\n\t\treturn new DateObject(Date.parse(str));\n\t}\n\n\tstatic now(): DateObject {\n\t\treturn new DateObject(Date.now());\n\t}\n\n\tprivate readonly _date: Date;\n\treadonly utc: DateProperties;\n\n\tconstructor(value: number);\n\tconstructor(value: string);\n\tconstructor(value: Date);\n\tconstructor(value: KwArgs);\n\tconstructor();\n\tconstructor(value?: any) {\n\t\tlet _date: Date;\n\t\tif (!arguments.length) {\n\t\t\t_date = new Date();\n\t\t} else if (value instanceof Date) {\n\t\t\t_date = new Date(+value);\n\t\t} else if (typeof value === 'number' || typeof value === 'string') {\n\t\t\t_date = new Date(value);\n\t\t} else {\n\t\t\t_date = new Date(\n\t\t\t\tvalue.year,\n\t\t\t\tvalue.month - 1,\n\t\t\t\tvalue.dayOfMonth || 1,\n\t\t\t\tvalue.hours || 0,\n\t\t\t\tvalue.minutes || 0,\n\t\t\t\tvalue.seconds || 0,\n\t\t\t\tvalue.milliseconds || 0\n\t\t\t);\n\t\t}\n\n\t\tthis._date = _date;\n\t\tconst self = this;\n\t\tthis.utc = {\n\t\t\tget isLeapYear(this: DateObject): boolean {\n\t\t\t\treturn isLeapYear(this.year);\n\t\t\t},\n\t\t\tget daysInMonth(this: DateObject): number {\n\t\t\t\tconst month = this.month;\n\n\t\t\t\tif (month === 2 && this.isLeapYear) {\n\t\t\t\t\treturn 29;\n\t\t\t\t}\n\t\t\t\treturn days[month];\n\t\t\t},\n\n\t\t\tget year(): number {\n\t\t\t\treturn self._date.getUTCFullYear();\n\t\t\t},\n\t\t\tset year(year: number) {\n\t\t\t\tself._date.setUTCFullYear(year);\n\t\t\t},\n\n\t\t\tget month(): number {\n\t\t\t\treturn self._date.getUTCMonth() + 1;\n\t\t\t},\n\t\t\tset month(month: number) {\n\t\t\t\tself._date.setUTCMonth(month - 1);\n\t\t\t},\n\n\t\t\tget dayOfMonth(): number {\n\t\t\t\treturn self._date.getUTCDate();\n\t\t\t},\n\t\t\tset dayOfMonth(day: number) {\n\t\t\t\tself._date.setUTCDate(day);\n\t\t\t},\n\n\t\t\tget hours(): number {\n\t\t\t\treturn self._date.getUTCHours();\n\t\t\t},\n\t\t\tset hours(hours: number) {\n\t\t\t\tself._date.setUTCHours(hours);\n\t\t\t},\n\n\t\t\tget minutes(): number {\n\t\t\t\treturn self._date.getUTCMinutes();\n\t\t\t},\n\t\t\tset minutes(minutes: number) {\n\t\t\t\tself._date.setUTCMinutes(minutes);\n\t\t\t},\n\n\t\t\tget seconds(): number {\n\t\t\t\treturn self._date.getUTCSeconds();\n\t\t\t},\n\t\t\tset seconds(seconds: number) {\n\t\t\t\tself._date.setUTCSeconds(seconds);\n\t\t\t},\n\n\t\t\tget milliseconds(): number {\n\t\t\t\treturn self._date.getUTCMilliseconds();\n\t\t\t},\n\t\t\tset milliseconds(milliseconds: number) {\n\t\t\t\tself._date.setUTCMilliseconds(milliseconds);\n\t\t\t},\n\n\t\t\tget dayOfWeek(): number {\n\t\t\t\treturn self._date.getUTCDay();\n\t\t\t},\n\n\t\t\ttoString: function(): string {\n\t\t\t\treturn self._date.toUTCString();\n\t\t\t}\n\t\t} as any;\n\t}\n\n\tget isLeapYear(): boolean {\n\t\treturn isLeapYear(this.year);\n\t}\n\n\tget daysInMonth(): number {\n\t\tconst month = this.month;\n\n\t\tif (month === 2 && this.isLeapYear) {\n\t\t\treturn 29;\n\t\t}\n\t\treturn days[month];\n\t}\n\n\tget year(): number {\n\t\treturn this._date.getFullYear();\n\t}\n\tset year(year: number) {\n\t\tconst dayOfMonth = this.dayOfMonth;\n\n\t\tthis._date.setFullYear(year);\n\n\t\tif (this.dayOfMonth < dayOfMonth) {\n\t\t\tthis.dayOfMonth = 0;\n\t\t}\n\t}\n\n\tget month(): number {\n\t\treturn this._date.getMonth() + 1;\n\t}\n\tset month(month: number) {\n\t\tconst dayOfMonth = this.dayOfMonth;\n\n\t\tthis._date.setMonth(month - 1);\n\n\t\tif (this.dayOfMonth < dayOfMonth) {\n\t\t\tthis.dayOfMonth = 0;\n\t\t}\n\t}\n\n\tget dayOfMonth(): number {\n\t\treturn this._date.getDate();\n\t}\n\tset dayOfMonth(day: number) {\n\t\tthis._date.setDate(day);\n\t}\n\n\tget hours(): number {\n\t\treturn this._date.getHours();\n\t}\n\tset hours(hours: number) {\n\t\tthis._date.setHours(hours);\n\t}\n\n\tget minutes(): number {\n\t\treturn this._date.getMinutes();\n\t}\n\tset minutes(minutes: number) {\n\t\tthis._date.setMinutes(minutes);\n\t}\n\n\tget seconds(): number {\n\t\treturn this._date.getSeconds();\n\t}\n\tset seconds(seconds: number) {\n\t\tthis._date.setSeconds(seconds);\n\t}\n\n\tget milliseconds(): number {\n\t\treturn this._date.getMilliseconds();\n\t}\n\tset milliseconds(milliseconds: number) {\n\t\tthis._date.setMilliseconds(milliseconds);\n\t}\n\n\tget time(): number {\n\t\treturn this._date.getTime();\n\t}\n\tset time(time: number) {\n\t\tthis._date.setTime(time);\n\t}\n\n\tget dayOfWeek(): number {\n\t\treturn this._date.getDay();\n\t}\n\tget timezoneOffset(): number {\n\t\treturn this._date.getTimezoneOffset();\n\t}\n\n\tadd(value: number): DateObject;\n\tadd(value: OperationKwArgs): DateObject;\n\tadd(value: any): DateObject {\n\t\tconst result = new DateObject(this.time);\n\n\t\tif (typeof value === 'number') {\n\t\t\tresult.time += value;\n\t\t} else {\n\t\t\t// Properties have to be added in a particular order to properly handle\n\t\t\t// date overshoots in month and year calculations\n\t\t\toperationOrder.forEach((property: string): void => {\n\t\t\t\tif (!(property in value)) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tconst dateMethod = operationHash[property];\n\t\t\t\t(result._date)[`set${dateMethod}`]((this._date)[`get${dateMethod}`]() + value[property]);\n\n\t\t\t\tif ((property === 'years' || property === 'months') && result.dayOfMonth < this.dayOfMonth) {\n\t\t\t\t\t// Set the day of the month to 0 to move the date to the first day of the previous\n\t\t\t\t\t// month to fix overshoots when adding a month and the date is the 31st or adding\n\t\t\t\t\t// a year and the date is the 29th\n\t\t\t\t\tresult.dayOfMonth = 0;\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\n\t\treturn result;\n\t}\n\n\tcompare(value: DateObject): number {\n\t\tconst result = this.time - value.time;\n\t\tif (result > 0) {\n\t\t\treturn 1;\n\t\t}\n\t\tif (result < 0) {\n\t\t\treturn -1;\n\t\t}\n\t\treturn 0;\n\t}\n\n\tcompareDate(value: KwArgs): number {\n\t\tconst left = new DateObject(this);\n\t\tconst right = new DateObject(value);\n\n\t\tleft._date.setHours(0, 0, 0, 0);\n\t\tright._date.setHours(0, 0, 0, 0);\n\n\t\treturn left.compare(right);\n\t}\n\n\tcompareTime(value: KwArgs): number {\n\t\tconst left = new DateObject(this);\n\t\tconst right = new DateObject(value);\n\n\t\tleft._date.setFullYear(0, 0, 0);\n\t\tright._date.setFullYear(0, 0, 0);\n\n\t\treturn left.compare(right);\n\t}\n\n\ttoString(): string {\n\t\treturn this._date.toString();\n\t}\n\ttoDateString(): string {\n\t\treturn this._date.toDateString();\n\t}\n\ttoTimeString(): string {\n\t\treturn this._date.toTimeString();\n\t}\n\ttoLocaleString(): string {\n\t\treturn this._date.toLocaleString();\n\t}\n\ttoLocaleDateString(): string {\n\t\treturn this._date.toLocaleDateString();\n\t}\n\ttoLocaleTimeString(): string {\n\t\treturn this._date.toLocaleTimeString();\n\t}\n\ttoISOString(): string {\n\t\treturn this._date.toISOString();\n\t}\n\ttoJSON(key?: any): string {\n\t\treturn this._date.toJSON(key);\n\t}\n\tvalueOf(): number {\n\t\treturn this._date.valueOf();\n\t}\n}\n\nexport default DateObject;\n"]} \ No newline at end of file diff --git a/deps/framework/core/Destroyable.d.ts b/deps/framework/core/Destroyable.d.ts deleted file mode 100644 index 9729afdadc..0000000000 --- a/deps/framework/core/Destroyable.d.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { Handle } from './interfaces'; -export declare class Destroyable { - /** - * register handles for the instance - */ - private handles; - /** - * @constructor - */ - constructor(); - /** - * Register handles for the instance that will be destroyed when `this.destroy` is called - * - * @param {Handle} handle The handle to add for the instance - * @returns {Handle} a handle for the handle, removes the handle for the instance and calls destroy - */ - own(handles: Handle | Handle[]): Handle; - /** - * Destrpys all handers registered for the instance - * - * @returns {Promise; -} -export default Destroyable; diff --git a/deps/framework/core/Destroyable.js b/deps/framework/core/Destroyable.js deleted file mode 100644 index ca83a9699c..0000000000 --- a/deps/framework/core/Destroyable.js +++ /dev/null @@ -1,72 +0,0 @@ -(function (factory) { - if (typeof module === "object" && typeof module.exports === "object") { - var v = factory(require, exports); - if (v !== undefined) module.exports = v; - } - else if (typeof define === "function" && define.amd) { - define(["require", "exports", "tslib", "./lang", "../shim/Promise"], factory); - } -})(function (require, exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - var tslib_1 = require("tslib"); - var lang_1 = require("./lang"); - var Promise_1 = require("../shim/Promise"); - /** - * No operation function to replace own once instance is destoryed - */ - function noop() { - return Promise_1.default.resolve(false); - } - /** - * No op function used to replace own, once instance has been destoryed - */ - function destroyed() { - throw new Error('Call made to destroyed method'); - } - var Destroyable = /** @class */ (function () { - /** - * @constructor - */ - function Destroyable() { - this.handles = []; - } - /** - * Register handles for the instance that will be destroyed when `this.destroy` is called - * - * @param {Handle} handle The handle to add for the instance - * @returns {Handle} a handle for the handle, removes the handle for the instance and calls destroy - */ - Destroyable.prototype.own = function (handles) { - var handle = Array.isArray(handles) ? lang_1.createCompositeHandle.apply(void 0, tslib_1.__spread(handles)) : handles; - var _handles = this.handles; - _handles.push(handle); - return { - destroy: function () { - _handles.splice(_handles.indexOf(handle)); - handle.destroy(); - } - }; - }; - /** - * Destrpys all handers registered for the instance - * - * @returns {Promise {\n\treturn Promise.resolve(false);\n}\n\n/**\n * No op function used to replace own, once instance has been destoryed\n */\nfunction destroyed(): never {\n\tthrow new Error('Call made to destroyed method');\n}\n\nexport class Destroyable {\n\t/**\n\t * register handles for the instance\n\t */\n\tprivate handles: Handle[];\n\n\t/**\n\t * @constructor\n\t */\n\tconstructor() {\n\t\tthis.handles = [];\n\t}\n\n\t/**\n\t * Register handles for the instance that will be destroyed when `this.destroy` is called\n\t *\n\t * @param {Handle} handle The handle to add for the instance\n\t * @returns {Handle} a handle for the handle, removes the handle for the instance and calls destroy\n\t */\n\town(handles: Handle | Handle[]): Handle {\n\t\tconst handle = Array.isArray(handles) ? createCompositeHandle(...handles) : handles;\n\t\tconst { handles: _handles } = this;\n\t\t_handles.push(handle);\n\t\treturn {\n\t\t\tdestroy() {\n\t\t\t\t_handles.splice(_handles.indexOf(handle));\n\t\t\t\thandle.destroy();\n\t\t\t}\n\t\t};\n\t}\n\n\t/**\n\t * Destrpys all handers registered for the instance\n\t *\n\t * @returns {Promise {\n\t\treturn new Promise((resolve) => {\n\t\t\tthis.handles.forEach((handle) => {\n\t\t\t\thandle && handle.destroy && handle.destroy();\n\t\t\t});\n\t\t\tthis.destroy = noop;\n\t\t\tthis.own = destroyed;\n\t\t\tresolve(true);\n\t\t});\n\t}\n}\n\nexport default Destroyable;\n"]} \ No newline at end of file diff --git a/deps/framework/core/Destroyable.mjs b/deps/framework/core/Destroyable.mjs deleted file mode 100644 index a48c08f5cf..0000000000 --- a/deps/framework/core/Destroyable.mjs +++ /dev/null @@ -1,56 +0,0 @@ -import { createCompositeHandle } from './lang'; -import Promise from '../shim/Promise'; -/** - * No operation function to replace own once instance is destoryed - */ -function noop() { - return Promise.resolve(false); -} -/** - * No op function used to replace own, once instance has been destoryed - */ -function destroyed() { - throw new Error('Call made to destroyed method'); -} -export class Destroyable { - /** - * @constructor - */ - constructor() { - this.handles = []; - } - /** - * Register handles for the instance that will be destroyed when `this.destroy` is called - * - * @param {Handle} handle The handle to add for the instance - * @returns {Handle} a handle for the handle, removes the handle for the instance and calls destroy - */ - own(handles) { - const handle = Array.isArray(handles) ? createCompositeHandle(...handles) : handles; - const { handles: _handles } = this; - _handles.push(handle); - return { - destroy() { - _handles.splice(_handles.indexOf(handle)); - handle.destroy(); - } - }; - } - /** - * Destrpys all handers registered for the instance - * - * @returns {Promise { - this.handles.forEach((handle) => { - handle && handle.destroy && handle.destroy(); - }); - this.destroy = noop; - this.own = destroyed; - resolve(true); - }); - } -} -export default Destroyable; -//# sourceMappingURL=Destroyable.mjs.map \ No newline at end of file diff --git a/deps/framework/core/Destroyable.mjs.map b/deps/framework/core/Destroyable.mjs.map deleted file mode 100644 index 384a934771..0000000000 --- a/deps/framework/core/Destroyable.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"Destroyable.mjs","sourceRoot":"","sources":["Destroyable.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,qBAAqB,EAAE,MAAM,QAAQ,CAAC;AAC/C,OAAO,OAAO,MAAM,iBAAiB,CAAC;AAEtC;;GAEG;AACH;IACC,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;AAC/B,CAAC;AAED;;GAEG;AACH;IACC,MAAM,IAAI,KAAK,CAAC,+BAA+B,CAAC,CAAC;AAClD,CAAC;AAED,MAAM;IAML;;OAEG;IACH;QACC,IAAI,CAAC,OAAO,GAAG,EAAE,CAAC;IACnB,CAAC;IAED;;;;;OAKG;IACH,GAAG,CAAC,OAA0B;QAC7B,MAAM,MAAM,GAAG,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,qBAAqB,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC;QACpF,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,GAAG,IAAI,CAAC;QACnC,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QACtB,MAAM,CAAC;YACN,OAAO;gBACN,QAAQ,CAAC,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC;gBAC1C,MAAM,CAAC,OAAO,EAAE,CAAC;YAClB,CAAC;SACD,CAAC;IACH,CAAC;IAED;;;;OAIG;IACH,OAAO;QACN,MAAM,CAAC,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE;YAC9B,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,MAAM,EAAE,EAAE;gBAC/B,MAAM,IAAI,MAAM,CAAC,OAAO,IAAI,MAAM,CAAC,OAAO,EAAE,CAAC;YAC9C,CAAC,CAAC,CAAC;YACH,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC;YACpB,IAAI,CAAC,GAAG,GAAG,SAAS,CAAC;YACrB,OAAO,CAAC,IAAI,CAAC,CAAC;QACf,CAAC,CAAC,CAAC;IACJ,CAAC;CACD;AAED,eAAe,WAAW,CAAC","sourcesContent":["import { Handle } from './interfaces';\nimport { createCompositeHandle } from './lang';\nimport Promise from '../shim/Promise';\n\n/**\n * No operation function to replace own once instance is destoryed\n */\nfunction noop(): Promise {\n\treturn Promise.resolve(false);\n}\n\n/**\n * No op function used to replace own, once instance has been destoryed\n */\nfunction destroyed(): never {\n\tthrow new Error('Call made to destroyed method');\n}\n\nexport class Destroyable {\n\t/**\n\t * register handles for the instance\n\t */\n\tprivate handles: Handle[];\n\n\t/**\n\t * @constructor\n\t */\n\tconstructor() {\n\t\tthis.handles = [];\n\t}\n\n\t/**\n\t * Register handles for the instance that will be destroyed when `this.destroy` is called\n\t *\n\t * @param {Handle} handle The handle to add for the instance\n\t * @returns {Handle} a handle for the handle, removes the handle for the instance and calls destroy\n\t */\n\town(handles: Handle | Handle[]): Handle {\n\t\tconst handle = Array.isArray(handles) ? createCompositeHandle(...handles) : handles;\n\t\tconst { handles: _handles } = this;\n\t\t_handles.push(handle);\n\t\treturn {\n\t\t\tdestroy() {\n\t\t\t\t_handles.splice(_handles.indexOf(handle));\n\t\t\t\thandle.destroy();\n\t\t\t}\n\t\t};\n\t}\n\n\t/**\n\t * Destrpys all handers registered for the instance\n\t *\n\t * @returns {Promise {\n\t\treturn new Promise((resolve) => {\n\t\t\tthis.handles.forEach((handle) => {\n\t\t\t\thandle && handle.destroy && handle.destroy();\n\t\t\t});\n\t\t\tthis.destroy = noop;\n\t\t\tthis.own = destroyed;\n\t\t\tresolve(true);\n\t\t});\n\t}\n}\n\nexport default Destroyable;\n"]} \ No newline at end of file diff --git a/deps/framework/core/Evented.d.ts b/deps/framework/core/Evented.d.ts deleted file mode 100644 index 44a3d3822e..0000000000 --- a/deps/framework/core/Evented.d.ts +++ /dev/null @@ -1,65 +0,0 @@ -import Map from '../shim/Map'; -import { Handle, EventType, EventObject } from './interfaces'; -import { Destroyable } from './Destroyable'; -/** - * Determines is the event type glob has been matched - * - * @returns boolean that indicates if the glob is matched - */ -export declare function isGlobMatch(globString: string | symbol, targetString: string | symbol): boolean; -export declare type EventedCallback = EventObject> = { - /** - * A callback that takes an `event` argument - * - * @param event The event object - */ - (event: E): boolean | void; -}; -export interface CustomEventTypes = EventObject> { - [index: string]: T; -} -/** - * A type which is either a targeted event listener or an array of listeners - * @template T The type of target for the events - * @template E The event type for the events - */ -export declare type EventedCallbackOrArray = EventObject> = EventedCallback | EventedCallback[]; -/** - * Event Class - */ -export declare class Evented = EventObject> extends Destroyable { - protected __typeMap__?: M; - /** - * map of listeners keyed by event type - */ - protected listenersMap: Map[]>; - /** - * Emits the event object for the specified type - * - * @param event the event to emit - */ - emit(event: M[K]): void; - emit(event: O): void; - /** - * Catch all handler for various call signatures. The signatures are defined in - * `BaseEventedEvents`. You can add your own event type -> handler types by extending - * `BaseEventedEvents`. See example for details. - * - * @param args - * - * @example - * - * interface WidgetBaseEvents extends BaseEventedEvents { - * (type: 'properties:changed', handler: PropertiesChangedHandler): Handle; - * } - * class WidgetBase extends Evented { - * on: WidgetBaseEvents; - * } - * - * @return {any} - */ - on(type: K, listener: EventedCallbackOrArray): Handle; - on(type: T, listener: EventedCallbackOrArray): Handle; - private _addListener(type, listener); -} -export default Evented; diff --git a/deps/framework/core/Evented.js b/deps/framework/core/Evented.js deleted file mode 100644 index 636bf28f3a..0000000000 --- a/deps/framework/core/Evented.js +++ /dev/null @@ -1,93 +0,0 @@ -(function (factory) { - if (typeof module === "object" && typeof module.exports === "object") { - var v = factory(require, exports); - if (v !== undefined) module.exports = v; - } - else if (typeof define === "function" && define.amd) { - define(["require", "exports", "tslib", "../shim/Map", "./Destroyable"], factory); - } -})(function (require, exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - var tslib_1 = require("tslib"); - var Map_1 = require("../shim/Map"); - var Destroyable_1 = require("./Destroyable"); - /** - * Map of computed regular expressions, keyed by string - */ - var regexMap = new Map_1.default(); - /** - * Determines is the event type glob has been matched - * - * @returns boolean that indicates if the glob is matched - */ - function isGlobMatch(globString, targetString) { - if (typeof targetString === 'string' && typeof globString === 'string' && globString.indexOf('*') !== -1) { - var regex = void 0; - if (regexMap.has(globString)) { - regex = regexMap.get(globString); - } - else { - regex = new RegExp("^" + globString.replace(/\*/g, '.*') + "$"); - regexMap.set(globString, regex); - } - return regex.test(targetString); - } - else { - return globString === targetString; - } - } - exports.isGlobMatch = isGlobMatch; - /** - * Event Class - */ - var Evented = /** @class */ (function (_super) { - tslib_1.__extends(Evented, _super); - function Evented() { - var _this = _super !== null && _super.apply(this, arguments) || this; - /** - * map of listeners keyed by event type - */ - _this.listenersMap = new Map_1.default(); - return _this; - } - Evented.prototype.emit = function (event) { - var _this = this; - this.listenersMap.forEach(function (methods, type) { - if (isGlobMatch(type, event.type)) { - tslib_1.__spread(methods).forEach(function (method) { - method.call(_this, event); - }); - } - }); - }; - Evented.prototype.on = function (type, listener) { - var _this = this; - if (Array.isArray(listener)) { - var handles_1 = listener.map(function (listener) { return _this._addListener(type, listener); }); - return { - destroy: function () { - handles_1.forEach(function (handle) { return handle.destroy(); }); - } - }; - } - return this._addListener(type, listener); - }; - Evented.prototype._addListener = function (type, listener) { - var _this = this; - var listeners = this.listenersMap.get(type) || []; - listeners.push(listener); - this.listenersMap.set(type, listeners); - return { - destroy: function () { - var listeners = _this.listenersMap.get(type) || []; - listeners.splice(listeners.indexOf(listener), 1); - } - }; - }; - return Evented; - }(Destroyable_1.Destroyable)); - exports.Evented = Evented; - exports.default = Evented; -}); -//# sourceMappingURL=Evented.js.map \ No newline at end of file diff --git a/deps/framework/core/Evented.js.map b/deps/framework/core/Evented.js.map deleted file mode 100644 index b10b3bc7fd..0000000000 --- a/deps/framework/core/Evented.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"Evented.js","sourceRoot":"","sources":["Evented.ts"],"names":[],"mappings":";;;;;;;;;;;;IAAA,mCAA8B;IAE9B,6CAA4C;IAE5C;;OAEG;IACH,IAAM,QAAQ,GAAG,IAAI,aAAG,EAAkB,CAAC;IAE3C;;;;OAIG;IACH,qBAA4B,UAA2B,EAAE,YAA6B;QACrF,EAAE,CAAC,CAAC,OAAO,YAAY,KAAK,QAAQ,IAAI,OAAO,UAAU,KAAK,QAAQ,IAAI,UAAU,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;YAC1G,IAAI,KAAK,SAAQ,CAAC;YAClB,EAAE,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;gBAC9B,KAAK,GAAG,QAAQ,CAAC,GAAG,CAAC,UAAU,CAAE,CAAC;YACnC,CAAC;YAAC,IAAI,CAAC,CAAC;gBACP,KAAK,GAAG,IAAI,MAAM,CAAC,MAAI,UAAU,CAAC,OAAO,CAAC,KAAK,EAAE,IAAI,CAAC,MAAG,CAAC,CAAC;gBAC3D,QAAQ,CAAC,GAAG,CAAC,UAAU,EAAE,KAAK,CAAC,CAAC;YACjC,CAAC;YACD,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;QACjC,CAAC;QAAC,IAAI,CAAC,CAAC;YACP,MAAM,CAAC,UAAU,KAAK,YAAY,CAAC;QACpC,CAAC;IACF,CAAC;IAbD,kCAaC;IAyBD;;OAEG;IACH;QAIU,mCAAW;QAJrB;YAAA,qEA0EC;YAjEA;;eAEG;YACO,kBAA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C,IAAI,EAAE,SAAS,CAAC,CAAC;YACvC,MAAM,CAAC;gBACN,OAAO,EAAE;oBACR,IAAM,SAAS,GAAG,KAAI,CAAC,YAAY,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC;oBACpD,SAAS,CAAC,MAAM,CAAC,SAAS,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,CAAC;gBAClD,CAAC;aACD,CAAC;QACH,CAAC;QACF,cAAC;IAAD,CAAC,AA1ED,CAIU,yBAAW,GAsEpB;IA1EY,0BAAO;IA4EpB,kBAAe,OAAO,CAAC","sourcesContent":["import Map from '../shim/Map';\nimport { Handle, EventType, EventObject } from './interfaces';\nimport { Destroyable } from './Destroyable';\n\n/**\n * Map of computed regular expressions, keyed by string\n */\nconst regexMap = new Map();\n\n/**\n * Determines is the event type glob has been matched\n *\n * @returns boolean that indicates if the glob is matched\n */\nexport function isGlobMatch(globString: string | symbol, targetString: string | symbol): boolean {\n\tif (typeof targetString === 'string' && typeof globString === 'string' && globString.indexOf('*') !== -1) {\n\t\tlet regex: RegExp;\n\t\tif (regexMap.has(globString)) {\n\t\t\tregex = regexMap.get(globString)!;\n\t\t} else {\n\t\t\tregex = new RegExp(`^${globString.replace(/\\*/g, '.*')}$`);\n\t\t\tregexMap.set(globString, regex);\n\t\t}\n\t\treturn regex.test(targetString);\n\t} else {\n\t\treturn globString === targetString;\n\t}\n}\n\nexport type EventedCallback = EventObject> = {\n\t/**\n\t * A callback that takes an `event` argument\n\t *\n\t * @param event The event object\n\t */\n\n\t(event: E): boolean | void;\n};\n\nexport interface CustomEventTypes = EventObject> {\n\t[index: string]: T;\n}\n\n/**\n * A type which is either a targeted event listener or an array of listeners\n * @template T The type of target for the events\n * @template E The event type for the events\n */\nexport type EventedCallbackOrArray = EventObject> =\n\t| EventedCallback\n\t| EventedCallback[];\n\n/**\n * Event Class\n */\nexport class Evented<\n\tM extends CustomEventTypes = {},\n\tT = EventType,\n\tO extends EventObject = EventObject\n> extends Destroyable {\n\t// The following member is purely so TypeScript remembers the type of `M` when extending so\n\t// that the utilities in `on.ts` will work https://github.com/Microsoft/TypeScript/issues/20348\n\t// tslint:disable-next-line\n\tprotected __typeMap__?: M;\n\t/**\n\t * map of listeners keyed by event type\n\t */\n\tprotected listenersMap: Map[]> = new Map();\n\n\t/**\n\t * Emits the event object for the specified type\n\t *\n\t * @param event the event to emit\n\t */\n\temit(event: M[K]): void;\n\temit(event: O): void;\n\temit(event: any): void {\n\t\tthis.listenersMap.forEach((methods, type) => {\n\t\t\tif (isGlobMatch(type as any, event.type)) {\n\t\t\t\t[...methods].forEach((method) => {\n\t\t\t\t\tmethod.call(this, event);\n\t\t\t\t});\n\t\t\t}\n\t\t});\n\t}\n\n\t/**\n\t * Catch all handler for various call signatures. The signatures are defined in\n\t * `BaseEventedEvents`. You can add your own event type -> handler types by extending\n\t * `BaseEventedEvents`. See example for details.\n\t *\n\t * @param args\n\t *\n\t * @example\n\t *\n\t * interface WidgetBaseEvents extends BaseEventedEvents {\n\t * (type: 'properties:changed', handler: PropertiesChangedHandler): Handle;\n\t * }\n\t * class WidgetBase extends Evented {\n\t * on: WidgetBaseEvents;\n\t * }\n\t *\n\t * @return {any}\n\t */\n\ton(type: K, listener: EventedCallbackOrArray): Handle;\n\ton(type: T, listener: EventedCallbackOrArray): Handle;\n\ton(type: any, listener: EventedCallbackOrArray): Handle {\n\t\tif (Array.isArray(listener)) {\n\t\t\tconst handles = listener.map((listener) => this._addListener(type, listener));\n\t\t\treturn {\n\t\t\t\tdestroy() {\n\t\t\t\t\thandles.forEach((handle) => handle.destroy());\n\t\t\t\t}\n\t\t\t};\n\t\t}\n\t\treturn this._addListener(type, listener);\n\t}\n\n\tprivate _addListener(type: T | keyof M, listener: EventedCallback) {\n\t\tconst listeners = this.listenersMap.get(type) || [];\n\t\tlisteners.push(listener);\n\t\tthis.listenersMap.set(type, listeners);\n\t\treturn {\n\t\t\tdestroy: () => {\n\t\t\t\tconst listeners = this.listenersMap.get(type) || [];\n\t\t\t\tlisteners.splice(listeners.indexOf(listener), 1);\n\t\t\t}\n\t\t};\n\t}\n}\n\nexport default Evented;\n"]} \ No newline at end of file diff --git a/deps/framework/core/Evented.mjs b/deps/framework/core/Evented.mjs deleted file mode 100644 index e7ad03e606..0000000000 --- a/deps/framework/core/Evented.mjs +++ /dev/null @@ -1,72 +0,0 @@ -import Map from '../shim/Map'; -import { Destroyable } from './Destroyable'; -/** - * Map of computed regular expressions, keyed by string - */ -const regexMap = new Map(); -/** - * Determines is the event type glob has been matched - * - * @returns boolean that indicates if the glob is matched - */ -export function isGlobMatch(globString, targetString) { - if (typeof targetString === 'string' && typeof globString === 'string' && globString.indexOf('*') !== -1) { - let regex; - if (regexMap.has(globString)) { - regex = regexMap.get(globString); - } - else { - regex = new RegExp(`^${globString.replace(/\*/g, '.*')}$`); - regexMap.set(globString, regex); - } - return regex.test(targetString); - } - else { - return globString === targetString; - } -} -/** - * Event Class - */ -export class Evented extends Destroyable { - constructor() { - super(...arguments); - /** - * map of listeners keyed by event type - */ - this.listenersMap = new Map(); - } - emit(event) { - this.listenersMap.forEach((methods, type) => { - if (isGlobMatch(type, event.type)) { - [...methods].forEach((method) => { - method.call(this, event); - }); - } - }); - } - on(type, listener) { - if (Array.isArray(listener)) { - const handles = listener.map((listener) => this._addListener(type, listener)); - return { - destroy() { - handles.forEach((handle) => handle.destroy()); - } - }; - } - return this._addListener(type, listener); - } - _addListener(type, listener) { - const listeners = this.listenersMap.get(type) || []; - listeners.push(listener); - this.listenersMap.set(type, listeners); - return { - destroy: () => { - const listeners = this.listenersMap.get(type) || []; - listeners.splice(listeners.indexOf(listener), 1); - } - }; - } -} -export default Evented; -//# sourceMappingURL=Evented.mjs.map \ No newline at end of file diff --git a/deps/framework/core/Evented.mjs.map b/deps/framework/core/Evented.mjs.map deleted file mode 100644 index 6b650dbbb1..0000000000 --- a/deps/framework/core/Evented.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":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AAC,CAAC,CAAC;YAClD,CAAC;SACD,CAAC;IACH,CAAC;CACD;AAED,eAAe,OAAO,CAAC","sourcesContent":["import Map from '../shim/Map';\nimport { Handle, EventType, EventObject } from './interfaces';\nimport { Destroyable } from './Destroyable';\n\n/**\n * Map of computed regular expressions, keyed by string\n */\nconst regexMap = new Map();\n\n/**\n * Determines is the event type glob has been matched\n *\n * @returns boolean that indicates if the glob is matched\n */\nexport function isGlobMatch(globString: string | symbol, targetString: string | symbol): boolean {\n\tif (typeof targetString === 'string' && typeof globString === 'string' && globString.indexOf('*') !== -1) {\n\t\tlet regex: RegExp;\n\t\tif (regexMap.has(globString)) {\n\t\t\tregex = regexMap.get(globString)!;\n\t\t} else {\n\t\t\tregex = new RegExp(`^${globString.replace(/\\*/g, '.*')}$`);\n\t\t\tregexMap.set(globString, regex);\n\t\t}\n\t\treturn regex.test(targetString);\n\t} else {\n\t\treturn globString === targetString;\n\t}\n}\n\nexport type EventedCallback = EventObject> = {\n\t/**\n\t * A callback that takes an `event` argument\n\t *\n\t * @param event The event object\n\t */\n\n\t(event: E): boolean | void;\n};\n\nexport interface CustomEventTypes = EventObject> {\n\t[index: string]: T;\n}\n\n/**\n * A type which is either a targeted event listener or an array of listeners\n * @template T The type of target for the events\n * @template E The event type for the events\n */\nexport type EventedCallbackOrArray = EventObject> =\n\t| EventedCallback\n\t| EventedCallback[];\n\n/**\n * Event Class\n */\nexport class Evented<\n\tM extends CustomEventTypes = {},\n\tT = EventType,\n\tO extends EventObject = EventObject\n> extends Destroyable {\n\t// The following member is purely so TypeScript remembers the type of `M` when extending so\n\t// that the utilities in `on.ts` will work https://github.com/Microsoft/TypeScript/issues/20348\n\t// tslint:disable-next-line\n\tprotected __typeMap__?: M;\n\t/**\n\t * map of listeners keyed by event type\n\t */\n\tprotected listenersMap: Map[]> = new Map();\n\n\t/**\n\t * Emits the event object for the specified type\n\t *\n\t * @param event the event to emit\n\t */\n\temit(event: M[K]): void;\n\temit(event: O): void;\n\temit(event: any): void {\n\t\tthis.listenersMap.forEach((methods, type) => {\n\t\t\tif (isGlobMatch(type as any, event.type)) {\n\t\t\t\t[...methods].forEach((method) => {\n\t\t\t\t\tmethod.call(this, event);\n\t\t\t\t});\n\t\t\t}\n\t\t});\n\t}\n\n\t/**\n\t * Catch all handler for various call signatures. The signatures are defined in\n\t * `BaseEventedEvents`. You can add your own event type -> handler types by extending\n\t * `BaseEventedEvents`. See example for details.\n\t *\n\t * @param args\n\t *\n\t * @example\n\t *\n\t * interface WidgetBaseEvents extends BaseEventedEvents {\n\t * (type: 'properties:changed', handler: PropertiesChangedHandler): Handle;\n\t * }\n\t * class WidgetBase extends Evented {\n\t * on: WidgetBaseEvents;\n\t * }\n\t *\n\t * @return {any}\n\t */\n\ton(type: K, listener: EventedCallbackOrArray): Handle;\n\ton(type: T, listener: EventedCallbackOrArray): Handle;\n\ton(type: any, listener: EventedCallbackOrArray): Handle {\n\t\tif (Array.isArray(listener)) {\n\t\t\tconst handles = listener.map((listener) => this._addListener(type, listener));\n\t\t\treturn {\n\t\t\t\tdestroy() {\n\t\t\t\t\thandles.forEach((handle) => handle.destroy());\n\t\t\t\t}\n\t\t\t};\n\t\t}\n\t\treturn this._addListener(type, listener);\n\t}\n\n\tprivate _addListener(type: T | keyof M, listener: EventedCallback) {\n\t\tconst listeners = this.listenersMap.get(type) || [];\n\t\tlisteners.push(listener);\n\t\tthis.listenersMap.set(type, listeners);\n\t\treturn {\n\t\t\tdestroy: () => {\n\t\t\t\tconst listeners = this.listenersMap.get(type) || [];\n\t\t\t\tlisteners.splice(listeners.indexOf(listener), 1);\n\t\t\t}\n\t\t};\n\t}\n}\n\nexport default Evented;\n"]} \ No newline at end of file diff --git a/deps/framework/core/IdentityRegistry.d.ts b/deps/framework/core/IdentityRegistry.d.ts deleted file mode 100644 index e40525bc5f..0000000000 --- a/deps/framework/core/IdentityRegistry.d.ts +++ /dev/null @@ -1,66 +0,0 @@ -import { Iterable, IterableIterator } from '../shim/iterator'; -import { Handle } from './interfaces'; -import '../shim/Symbol'; -/** - * Registry identities can be strings or symbols. Note that the empty string is allowed. - */ -export declare type Identity = string | symbol; -/** - * A registry of values, mapped by identities. - */ -export declare class IdentityRegistry implements Iterable<[Identity, V]> { - constructor(); - /** - * Look up a value by its identifier. - * - * Throws if no value has been registered for the given identifier. - * - * @param id The identifier - * @return The value - */ - get(id: Identity): V; - /** - * Determine whether the value has been registered. - * @param value The value - * @return `true` if the value has been registered, `false` otherwise - */ - contains(value: V): boolean; - /** - * Remove from the registry the value for a given identifier. - * @param id The identifier - * @return `true` if the value was removed, `false` otherwise - */ - delete(id: Identity): boolean; - /** - * Determine whether a value has been registered for the given identifier. - * @param id The identifier - * @return `true` if a value has been registered, `false` otherwise - */ - has(id: Identity): boolean; - /** - * Look up the identifier for which the given value has been registered. - * - * Throws if the value hasn't been registered. - * - * @param value The value - * @return The identifier otherwise - */ - identify(value: V): Identity | undefined; - /** - * Register a new value with a new identity. - * - * Throws if a different value has already been registered for the given identity, - * or if the value has already been registered with a different identity. - * - * @param id The identifier - * @param value The value - * @return A handle for deregistering the value. Note that when called repeatedly with - * the same identifier and value combination, the same handle is returned - */ - register(id: Identity, value: V): Handle; - entries(): IterableIterator<[Identity, V]>; - values(): IterableIterator; - ids(): IterableIterator; - [Symbol.iterator](): IterableIterator<[Identity, V]>; -} -export default IdentityRegistry; diff --git a/deps/framework/core/IdentityRegistry.js b/deps/framework/core/IdentityRegistry.js deleted file mode 100644 index e167cf76d1..0000000000 --- a/deps/framework/core/IdentityRegistry.js +++ /dev/null @@ -1,152 +0,0 @@ -(function (factory) { - if (typeof module === "object" && typeof module.exports === "object") { - var v = factory(require, exports); - if (v !== undefined) module.exports = v; - } - else if (typeof define === "function" && define.amd) { - define(["require", "exports", "../shim/Map", "../shim/WeakMap", "../shim/Symbol", "./List"], factory); - } -})(function (require, exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - var Map_1 = require("../shim/Map"); - var WeakMap_1 = require("../shim/WeakMap"); - require("../shim/Symbol"); - var List_1 = require("./List"); - var noop = function () { }; - var privateStateMap = new WeakMap_1.default(); - function getState(instance) { - return privateStateMap.get(instance); - } - /** - * A registry of values, mapped by identities. - */ - var IdentityRegistry = /** @class */ (function () { - function IdentityRegistry() { - privateStateMap.set(this, { - entryMap: new Map_1.default(), - idMap: new WeakMap_1.default() - }); - } - /** - * Look up a value by its identifier. - * - * Throws if no value has been registered for the given identifier. - * - * @param id The identifier - * @return The value - */ - IdentityRegistry.prototype.get = function (id) { - var entry = getState(this).entryMap.get(id); - if (!entry) { - throw new Error("Could not find a value for identity '" + id.toString() + "'"); - } - return entry.value; - }; - /** - * Determine whether the value has been registered. - * @param value The value - * @return `true` if the value has been registered, `false` otherwise - */ - IdentityRegistry.prototype.contains = function (value) { - return getState(this).idMap.has(value); - }; - /** - * Remove from the registry the value for a given identifier. - * @param id The identifier - * @return `true` if the value was removed, `false` otherwise - */ - IdentityRegistry.prototype.delete = function (id) { - var entry = getState(this).entryMap.get(id); - if (!entry) { - return false; - } - entry.handle.destroy(); - return true; - }; - /** - * Determine whether a value has been registered for the given identifier. - * @param id The identifier - * @return `true` if a value has been registered, `false` otherwise - */ - IdentityRegistry.prototype.has = function (id) { - return getState(this).entryMap.has(id); - }; - /** - * Look up the identifier for which the given value has been registered. - * - * Throws if the value hasn't been registered. - * - * @param value The value - * @return The identifier otherwise - */ - IdentityRegistry.prototype.identify = function (value) { - if (!this.contains(value)) { - throw new Error('Could not identify non-registered value'); - } - return getState(this).idMap.get(value); - }; - /** - * Register a new value with a new identity. - * - * Throws if a different value has already been registered for the given identity, - * or if the value has already been registered with a different identity. - * - * @param id The identifier - * @param value The value - * @return A handle for deregistering the value. Note that when called repeatedly with - * the same identifier and value combination, the same handle is returned - */ - IdentityRegistry.prototype.register = function (id, value) { - var _this = this; - var entryMap = getState(this).entryMap; - var existingEntry = entryMap.get(id); - if (existingEntry && existingEntry.value !== value) { - var str = id.toString(); - throw new Error("A value has already been registered for the given identity (" + str + ")"); - } - var existingId = this.contains(value) ? this.identify(value) : null; - if (existingId && existingId !== id) { - var str = existingId.toString(); - throw new Error("The value has already been registered with a different identity (" + str + ")"); - } - // Adding the same value with the same id is a noop, return the original handle. - if (existingEntry && existingId) { - return existingEntry.handle; - } - var handle = { - destroy: function () { - handle.destroy = noop; - getState(_this).entryMap.delete(id); - } - }; - entryMap.set(id, { handle: handle, value: value }); - getState(this).idMap.set(value, id); - return handle; - }; - IdentityRegistry.prototype.entries = function () { - var values = new List_1.default(); - getState(this).entryMap.forEach(function (value, key) { - values.add([key, value.value]); - }); - return values.values(); - }; - IdentityRegistry.prototype.values = function () { - var values = new List_1.default(); - getState(this).entryMap.forEach(function (value, key) { - values.add(value.value); - }); - return values.values(); - }; - IdentityRegistry.prototype.ids = function () { - return getState(this).entryMap.keys(); - }; - IdentityRegistry.prototype[Symbol.iterator] = function () { - return this.entries(); - }; - return IdentityRegistry; - }()); - exports.IdentityRegistry = IdentityRegistry; - exports.default = IdentityRegistry; -}); -//# sourceMappingURL=IdentityRegistry.js.map \ No newline at end of file diff --git a/deps/framework/core/IdentityRegistry.js.map b/deps/framework/core/IdentityRegistry.js.map deleted file mode 100644 index c6d57f183c..0000000000 --- a/deps/framework/core/IdentityRegistry.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"IdentityRegistry.js","sourceRoot":"","sources":["IdentityRegistry.ts"],"names":[],"mappings":";;;;;;;;;;;IAAA,mCAA8B;IAC9B,2CAAsC;IAGtC,0BAAwB;IACxB,+BAA0B;IAE1B,IAAM,IAAI,GAAG,cAAO,CAAC,CAAC;IAYtB,IAAM,eAAe,GAAG,IAAI,iBAAO,EAAqC,CAAC;IAEzE,kBAAoC,QAA6B;QAChE,MAAM,CAAC,eAAe,CAAC,GAAG,CAAC,QAAQ,CAAE,CAAC;IACvC,CAAC;IAOD;;OAEG;IACH;QACC;YACC,eAAe,CAAC,GAAG,CAAC,IAAI,EAAE;gBACzB,QAAQ,EAAE,IA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terator } from '../shim/iterator';\nimport { Handle } from './interfaces';\nimport '../shim/Symbol';\nimport List from './List';\n\nconst noop = () => {};\n\ninterface Entry {\n\treadonly handle: Handle;\n\treadonly value: V;\n}\n\ninterface State {\n\treadonly entryMap: Map>;\n\treadonly idMap: WeakMap;\n}\n\nconst privateStateMap = new WeakMap, State>();\n\nfunction getState(instance: IdentityRegistry): State {\n\treturn privateStateMap.get(instance)!;\n}\n\n/**\n * Registry identities can be strings or symbols. Note that the empty string is allowed.\n */\nexport type Identity = string | symbol;\n\n/**\n * A registry of values, mapped by identities.\n */\nexport class IdentityRegistry implements Iterable<[Identity, V]> {\n\tconstructor() {\n\t\tprivateStateMap.set(this, {\n\t\t\tentryMap: new Map>(),\n\t\t\tidMap: new WeakMap()\n\t\t});\n\t}\n\n\t/**\n\t * Look up a value by its identifier.\n\t *\n\t * Throws if no value has been registered for the given identifier.\n\t *\n\t * @param id The identifier\n\t * @return The value\n\t */\n\tget(id: Identity): V {\n\t\tconst entry = getState(this).entryMap.get(id);\n\t\tif (!entry) {\n\t\t\tthrow new Error(`Could not find a value for identity '${id.toString()}'`);\n\t\t}\n\n\t\treturn entry.value;\n\t}\n\n\t/**\n\t * Determine whether the value has been registered.\n\t * @param value The value\n\t * @return `true` if the value has been registered, `false` otherwise\n\t */\n\tcontains(value: V): boolean {\n\t\treturn getState(this).idMap.has(value);\n\t}\n\n\t/**\n\t * Remove from the registry the value for a given identifier.\n\t * @param id The identifier\n\t * @return `true` if the value was removed, `false` otherwise\n\t */\n\tdelete(id: Identity): boolean {\n\t\tconst entry = getState(this).entryMap.get(id);\n\t\tif (!entry) {\n\t\t\treturn false;\n\t\t}\n\n\t\tentry.handle.destroy();\n\t\treturn true;\n\t}\n\n\t/**\n\t * Determine whether a value has been registered for the given identifier.\n\t * @param id The identifier\n\t * @return `true` if a value has been registered, `false` otherwise\n\t */\n\thas(id: Identity): boolean {\n\t\treturn getState(this).entryMap.has(id);\n\t}\n\n\t/**\n\t * Look up the identifier for which the given value has been registered.\n\t *\n\t * Throws if the value hasn't been registered.\n\t *\n\t * @param value The value\n\t * @return The identifier otherwise\n\t */\n\tidentify(value: V): Identity | undefined {\n\t\tif (!this.contains(value)) {\n\t\t\tthrow new Error('Could not identify non-registered value');\n\t\t}\n\n\t\treturn getState(this).idMap.get(value);\n\t}\n\n\t/**\n\t * Register a new value with a new identity.\n\t *\n\t * Throws if a different value has already been registered for the given identity,\n\t * or if the value has already been registered with a different identity.\n\t *\n\t * @param id The identifier\n\t * @param value The value\n\t * @return A handle for deregistering the value. Note that when called repeatedly with\n\t * the same identifier and value combination, the same handle is returned\n\t */\n\tregister(id: Identity, value: V): Handle {\n\t\tconst entryMap = getState(this).entryMap;\n\t\tconst existingEntry = entryMap.get(id);\n\t\tif (existingEntry && existingEntry.value !== value) {\n\t\t\tconst str = id.toString();\n\t\t\tthrow new Error(`A value has already been registered for the given identity (${str})`);\n\t\t}\n\n\t\tconst existingId = this.contains(value) ? this.identify(value) : null;\n\t\tif (existingId && existingId !== id) {\n\t\t\tconst str = existingId.toString();\n\t\t\tthrow new Error(`The value has already been registered with a different identity (${str})`);\n\t\t}\n\n\t\t// Adding the same value with the same id is a noop, return the original handle.\n\t\tif (existingEntry && existingId) {\n\t\t\treturn existingEntry.handle;\n\t\t}\n\n\t\tconst handle = {\n\t\t\tdestroy: () => {\n\t\t\t\thandle.destroy = noop;\n\t\t\t\tgetState(this).entryMap.delete(id);\n\t\t\t}\n\t\t};\n\n\t\tentryMap.set(id, { handle, value });\n\t\tgetState(this).idMap.set(value, id);\n\n\t\treturn handle;\n\t}\n\n\tentries(): IterableIterator<[Identity, V]> {\n\t\tconst values = new List<[Identity, V]>();\n\n\t\tgetState(this).entryMap.forEach((value: Entry, key: Identity) => {\n\t\t\tvalues.add([key, value.value]);\n\t\t});\n\n\t\treturn values.values();\n\t}\n\n\tvalues(): IterableIterator {\n\t\tconst values = new List();\n\n\t\tgetState(this).entryMap.forEach((value: Entry, key: Identity) => {\n\t\t\tvalues.add(value.value);\n\t\t});\n\n\t\treturn values.values();\n\t}\n\n\tids(): IterableIterator {\n\t\treturn getState(this).entryMap.keys();\n\t}\n\n\t[Symbol.iterator](): IterableIterator<[Identity, V]> {\n\t\treturn this.entries();\n\t}\n}\n\nexport default IdentityRegistry;\n"]} \ No newline at end of file diff --git a/deps/framework/core/IdentityRegistry.mjs b/deps/framework/core/IdentityRegistry.mjs deleted file mode 100644 index 3835bb007b..0000000000 --- a/deps/framework/core/IdentityRegistry.mjs +++ /dev/null @@ -1,137 +0,0 @@ -import Map from '../shim/Map'; -import WeakMap from '../shim/WeakMap'; -import '../shim/Symbol'; -import List from './List'; -const noop = () => { }; -const privateStateMap = new WeakMap(); -function getState(instance) { - return privateStateMap.get(instance); -} -/** - * A registry of values, mapped by identities. - */ -export class IdentityRegistry { - constructor() { - privateStateMap.set(this, { - entryMap: new Map(), - idMap: new WeakMap() - }); - } - /** - * Look up a value by its identifier. - * - * Throws if no value has been registered for the given identifier. - * - * @param id The identifier - * @return The value - */ - get(id) { - const entry = getState(this).entryMap.get(id); - if (!entry) { - throw new Error(`Could not find a value for identity '${id.toString()}'`); - } - return entry.value; - } - /** - * Determine whether the value has been registered. - * @param value The value - * @return `true` if the value has been registered, `false` otherwise - */ - contains(value) { - return getState(this).idMap.has(value); - } - /** - * Remove from the registry the value for a given identifier. - * @param id The identifier - * @return `true` if the value was removed, `false` otherwise - */ - delete(id) { - const entry = getState(this).entryMap.get(id); - if (!entry) { - return false; - } - entry.handle.destroy(); - return true; - } - /** - * Determine whether a value has been registered for the given identifier. - * @param id The identifier - * @return `true` if a value has been registered, `false` otherwise - */ - has(id) { - return getState(this).entryMap.has(id); - } - /** - * Look up the identifier for which the given value has been registered. - * - * Throws if the value hasn't been registered. - * - * @param value The value - * @return The identifier otherwise - */ - identify(value) { - if (!this.contains(value)) { - throw new Error('Could not identify non-registered value'); - } - return getState(this).idMap.get(value); - } - /** - * Register a new value with a new identity. - * - * Throws if a different value has already been registered for the given identity, - * or if the value has already been registered with a different identity. - * - * @param id The identifier - * @param value The value - * @return A handle for deregistering the value. Note that when called repeatedly with - * the same identifier and value combination, the same handle is returned - */ - register(id, value) { - const entryMap = getState(this).entryMap; - const existingEntry = entryMap.get(id); - if (existingEntry && existingEntry.value !== value) { - const str = id.toString(); - throw new Error(`A value has already been registered for the given identity (${str})`); - } - const existingId = this.contains(value) ? this.identify(value) : null; - if (existingId && existingId !== id) { - const str = existingId.toString(); - throw new Error(`The value has already been registered with a different identity (${str})`); - } - // Adding the same value with the same id is a noop, return the original handle. - if (existingEntry && existingId) { - return existingEntry.handle; - } - const handle = { - destroy: () => { - handle.destroy = noop; - getState(this).entryMap.delete(id); - } - }; - entryMap.set(id, { handle, value }); - getState(this).idMap.set(value, id); - return handle; - } - entries() { - const values = new List(); - getState(this).entryMap.forEach((value, key) => { - values.add([key, value.value]); - }); - return values.values(); - } - values() { - const values = new List(); - getState(this).entryMap.forEach((value, key) => { - values.add(value.value); - }); - return values.values(); - } - ids() { - return getState(this).entryMap.keys(); - } - [Symbol.iterator]() { - return this.entries(); - } -} -export default IdentityRegistry; -//# sourceMappingURL=IdentityRegistry.mjs.map \ No newline at end of file diff --git a/deps/framework/core/IdentityRegistry.mjs.map b/deps/framework/core/IdentityRegistry.mjs.map deleted file mode 100644 index 20b256c39b..0000000000 --- a/deps/framework/core/IdentityRegistry.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"IdentityRegistry.mjs","sourceRoot":"","sources":["IdentityRegistry.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,aAAa,CAAC;AAC9B,OAAO,OAAO,MAAM,iBAAiB,CAAC;AAGtC,OAAO,gBAAgB,CAAC;AACxB,OAAO,IAAI,MAAM,QAAQ,CAAC;AAE1B,MAAM,IAAI,GAAG,GAAG,EAAE,GAAE,CAAC,CAAC;AAYtB,MAAM,eAAe,GAAG,IAAI,OAAO,EAAqC,CAAC;AAEzE,kBAAoC,QAA6B;IAChE,MAA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\nimport { Iterable, IterableIterator } from '../shim/iterator';\nimport { Handle } from './interfaces';\nimport '../shim/Symbol';\nimport List from './List';\n\nconst noop = () => {};\n\ninterface Entry {\n\treadonly handle: Handle;\n\treadonly value: V;\n}\n\ninterface State {\n\treadonly entryMap: Map>;\n\treadonly idMap: WeakMap;\n}\n\nconst privateStateMap = new WeakMap, State>();\n\nfunction getState(instance: IdentityRegistry): State {\n\treturn privateStateMap.get(instance)!;\n}\n\n/**\n * Registry identities can be strings or symbols. Note that the empty string is allowed.\n */\nexport type Identity = string | symbol;\n\n/**\n * A registry of values, mapped by identities.\n */\nexport class IdentityRegistry implements Iterable<[Identity, V]> {\n\tconstructor() {\n\t\tprivateStateMap.set(this, {\n\t\t\tentryMap: new Map>(),\n\t\t\tidMap: new WeakMap()\n\t\t});\n\t}\n\n\t/**\n\t * Look up a value by its identifier.\n\t *\n\t * Throws if no value has been registered for the given identifier.\n\t *\n\t * @param id The identifier\n\t * @return The value\n\t */\n\tget(id: Identity): V {\n\t\tconst entry = getState(this).entryMap.get(id);\n\t\tif (!entry) {\n\t\t\tthrow new Error(`Could not find a value for identity '${id.toString()}'`);\n\t\t}\n\n\t\treturn entry.value;\n\t}\n\n\t/**\n\t * Determine whether the value has been registered.\n\t * @param value The value\n\t * @return `true` if the value has been registered, `false` otherwise\n\t */\n\tcontains(value: V): boolean {\n\t\treturn getState(this).idMap.has(value);\n\t}\n\n\t/**\n\t * Remove from the registry the value for a given identifier.\n\t * @param id The identifier\n\t * @return `true` if the value was removed, `false` otherwise\n\t */\n\tdelete(id: Identity): boolean {\n\t\tconst entry = getState(this).entryMap.get(id);\n\t\tif (!entry) {\n\t\t\treturn false;\n\t\t}\n\n\t\tentry.handle.destroy();\n\t\treturn true;\n\t}\n\n\t/**\n\t * Determine whether a value has been registered for the given identifier.\n\t * @param id The identifier\n\t * @return `true` if a value has been registered, `false` otherwise\n\t */\n\thas(id: Identity): boolean {\n\t\treturn getState(this).entryMap.has(id);\n\t}\n\n\t/**\n\t * Look up the identifier for which the given value has been registered.\n\t *\n\t * Throws if the value hasn't been registered.\n\t *\n\t * @param value The value\n\t * @return The identifier otherwise\n\t */\n\tidentify(value: V): Identity | undefined {\n\t\tif (!this.contains(value)) {\n\t\t\tthrow new Error('Could not identify non-registered value');\n\t\t}\n\n\t\treturn getState(this).idMap.get(value);\n\t}\n\n\t/**\n\t * Register a new value with a new identity.\n\t *\n\t * Throws if a different value has already been registered for the given identity,\n\t * or if the value has already been registered with a different identity.\n\t *\n\t * @param id The identifier\n\t * @param value The value\n\t * @return A handle for deregistering the value. Note that when called repeatedly with\n\t * the same identifier and value combination, the same handle is returned\n\t */\n\tregister(id: Identity, value: V): Handle {\n\t\tconst entryMap = getState(this).entryMap;\n\t\tconst existingEntry = entryMap.get(id);\n\t\tif (existingEntry && existingEntry.value !== value) {\n\t\t\tconst str = id.toString();\n\t\t\tthrow new Error(`A value has already been registered for the given identity (${str})`);\n\t\t}\n\n\t\tconst existingId = this.contains(value) ? this.identify(value) : null;\n\t\tif (existingId && existingId !== id) {\n\t\t\tconst str = existingId.toString();\n\t\t\tthrow new Error(`The value has already been registered with a different identity (${str})`);\n\t\t}\n\n\t\t// Adding the same value with the same id is a noop, return the original handle.\n\t\tif (existingEntry && existingId) {\n\t\t\treturn existingEntry.handle;\n\t\t}\n\n\t\tconst handle = {\n\t\t\tdestroy: () => {\n\t\t\t\thandle.destroy = noop;\n\t\t\t\tgetState(this).entryMap.delete(id);\n\t\t\t}\n\t\t};\n\n\t\tentryMap.set(id, { handle, value });\n\t\tgetState(this).idMap.set(value, id);\n\n\t\treturn handle;\n\t}\n\n\tentries(): IterableIterator<[Identity, V]> {\n\t\tconst values = new List<[Identity, V]>();\n\n\t\tgetState(this).entryMap.forEach((value: Entry, key: Identity) => {\n\t\t\tvalues.add([key, value.value]);\n\t\t});\n\n\t\treturn values.values();\n\t}\n\n\tvalues(): IterableIterator {\n\t\tconst values = new List();\n\n\t\tgetState(this).entryMap.forEach((value: Entry, key: Identity) => {\n\t\t\tvalues.add(value.value);\n\t\t});\n\n\t\treturn values.values();\n\t}\n\n\tids(): IterableIterator {\n\t\treturn getState(this).entryMap.keys();\n\t}\n\n\t[Symbol.iterator](): IterableIterator<[Identity, V]> {\n\t\treturn this.entries();\n\t}\n}\n\nexport default IdentityRegistry;\n"]} \ No newline at end of file diff --git a/deps/framework/core/List.d.ts b/deps/framework/core/List.d.ts deleted file mode 100644 index fada40317d..0000000000 --- a/deps/framework/core/List.d.ts +++ /dev/null @@ -1,22 +0,0 @@ -import { Iterable, IterableIterator } from '../shim/iterator'; -export declare class List { - [Symbol.iterator](): IterableIterator; - readonly size: number; - constructor(source?: Iterable | ArrayLike); - add(value: T): this; - clear(): void; - delete(idx: number): boolean; - entries(): IterableIterator<[number, T]>; - forEach(fn: (value: T, idx: number, list: this) => void, thisArg?: any): void; - has(idx: number): boolean; - includes(value: T): boolean; - indexOf(value: T): number; - join(separator?: string): string; - keys(): IterableIterator; - lastIndexOf(value: T): number; - push(value: T): void; - pop(): T | undefined; - splice(start: number, deleteCount?: number, ...newItems: T[]): T[]; - values(): IterableIterator; -} -export default List; diff --git a/deps/framework/core/List.js b/deps/framework/core/List.js deleted file mode 100644 index 3b0e0353ca..0000000000 --- a/deps/framework/core/List.js +++ /dev/null @@ -1,118 +0,0 @@ -(function (factory) { - if (typeof module === "object" && typeof module.exports === "object") { - var v = factory(require, exports); - if (v !== undefined) module.exports = v; - } - else if (typeof define === "function" && define.amd) { - define(["require", "exports", "tslib", "../shim/iterator", "../shim/WeakMap"], factory); - } -})(function (require, exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - var tslib_1 = require("tslib"); - var iterator_1 = require("../shim/iterator"); - var WeakMap_1 = require("../shim/WeakMap"); - var listItems = new WeakMap_1.default(); - function getListItems(list) { - return (listItems.get(list) || []); - } - var List = /** @class */ (function () { - function List(source) { - listItems.set(this, []); - if (source) { - if (iterator_1.isArrayLike(source)) { - for (var i = 0; i < source.length; i++) { - this.add(source[i]); - } - } - else if (iterator_1.isIterable(source)) { - try { - for (var source_1 = tslib_1.__values(source), source_1_1 = source_1.next(); !source_1_1.done; source_1_1 = source_1.next()) { - var item = source_1_1.value; - this.add(item); - } - } - catch (e_1_1) { e_1 = { error: e_1_1 }; } - finally { - try { - if (source_1_1 && !source_1_1.done && (_a = source_1.return)) _a.call(source_1); - } - finally { if (e_1) throw e_1.error; } - } - } - } - var e_1, _a; - } - List.prototype[Symbol.iterator] = function () { - return this.values(); - }; - Object.defineProperty(List.prototype, "size", { - get: function () { - return getListItems(this).length; - }, - enumerable: true, - configurable: true - }); - List.prototype.add = function (value) { - getListItems(this).push(value); - return this; - }; - List.prototype.clear = function () { - listItems.set(this, []); - }; - List.prototype.delete = function (idx) { - if (idx < this.size) { - getListItems(this).splice(idx, 1); - return true; - } - return false; - }; - List.prototype.entries = function () { - return new iterator_1.ShimIterator(getListItems(this).map(function (value, index) { return [index, value]; })); - }; - List.prototype.forEach = function (fn, thisArg) { - getListItems(this).forEach(fn.bind(thisArg ? thisArg : this)); - }; - List.prototype.has = function (idx) { - return this.size > idx; - }; - List.prototype.includes = function (value) { - return getListItems(this).indexOf(value) >= 0; - }; - List.prototype.indexOf = function (value) { - return getListItems(this).indexOf(value); - }; - List.prototype.join = function (separator) { - if (separator === void 0) { separator = ','; } - return getListItems(this).join(separator); - }; - List.prototype.keys = function () { - return new iterator_1.ShimIterator(getListItems(this).map(function (_, index) { return index; })); - }; - List.prototype.lastIndexOf = function (value) { - return getListItems(this).lastIndexOf(value); - }; - List.prototype.push = function (value) { - this.add(value); - }; - List.prototype.pop = function () { - return getListItems(this).pop(); - }; - List.prototype.splice = function (start, deleteCount) { - var newItems = []; - for (var _i = 2; _i < arguments.length; _i++) { - newItems[_i - 2] = arguments[_i]; - } - return (_a = getListItems(this)).splice.apply(_a, tslib_1.__spread([start, - deleteCount === undefined ? this.size - start : deleteCount], newItems)); - var _a; - }; - List.prototype.values = function () { - return new iterator_1.ShimIterator(getListItems(this).map(function (value) { return value; })); - }; - return List; - }()); - exports.List = List; - exports.default = List; -}); -//# sourceMappingURL=List.js.map \ No newline at end of file diff --git a/deps/framework/core/List.js.map b/deps/framework/core/List.js.map deleted file mode 100644 index 47f226de3c..0000000000 --- a/deps/framework/core/List.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"List.js","sourceRoot":"","sources":["List.ts"],"names":[],"mappings":";;;;;;;;;;;;IAAA,6CAAqG;IACrG,2CAAsC;IAEtC,IAAM,SAAS,GAA8B,IAAI,iBAAO,EAAoB,CAAC;IAE7E,sBAAyB,IAAa;QACrC,MAAM,CAAC,CAAC,SAAS,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,EAAE,CAAQ,CAAC;IAC3C,CAAC;IAED;QASC,cAAY,MAAmC;YAC9C,SAAS,CAAC,GAAG,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;YAExB,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC;gBACZ,EAAE,CAAC,CAAC,sBAAW,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;oBACzB,GAAG,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;wBACxC,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;oBACrB,CAAC;gBACF,CAAC;gBAAC,IAAI,CAAC,EAAE,CAAC,CAAC,qBAAU,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;;wBAC/B,GAAG,CAAC,CAAe,IAAA,WAAA,iBAAA,MAAM,CAAA,8BAAA;4BAApB,IAAM,IAAI,mBAAA;4BACd,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;yBACf;;;;;;;;;gBACF,CAAC;YACF,CAAC;;QACF,CAAC;QAtBD,eAAC,MAAM,CAAC,QAAQ,CAAC,GAAjB;YACC,MAAM,CAAC,IAAI,CAAC,MA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I,UAAC,KAAK,IAAK,OAAA,KAAK,EAAL,CAAK,CAAC,CAAC,CAAC;QACzE,CAAC;QACF,WAAC;IAAD,CAAC,AA9FD,IA8FC;IA9FY,oBAAI;IAgGjB,kBAAe,IAAI,CAAC","sourcesContent":["import { isArrayLike, isIterable, Iterable, IterableIterator, ShimIterator } from '../shim/iterator';\nimport WeakMap from '../shim/WeakMap';\n\nconst listItems: WeakMap, any[]> = new WeakMap, any[]>();\n\nfunction getListItems(list: List): T[] {\n\treturn (listItems.get(list) || []) as T[];\n}\n\nexport class List {\n\t[Symbol.iterator]() {\n\t\treturn this.values();\n\t}\n\n\tget size(): number {\n\t\treturn getListItems(this).length;\n\t}\n\n\tconstructor(source?: Iterable | ArrayLike) {\n\t\tlistItems.set(this, []);\n\n\t\tif (source) {\n\t\t\tif (isArrayLike(source)) {\n\t\t\t\tfor (let i = 0; i < source.length; i++) {\n\t\t\t\t\tthis.add(source[i]);\n\t\t\t\t}\n\t\t\t} else if (isIterable(source)) {\n\t\t\t\tfor (const item of source) {\n\t\t\t\t\tthis.add(item);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tadd(value: T): this {\n\t\tgetListItems(this).push(value);\n\t\treturn this;\n\t}\n\n\tclear(): void {\n\t\tlistItems.set(this, []);\n\t}\n\n\tdelete(idx: number): boolean {\n\t\tif (idx < this.size) {\n\t\t\tgetListItems(this).splice(idx, 1);\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}\n\n\tentries(): IterableIterator<[number, T]> {\n\t\treturn new ShimIterator<[number, T]>(getListItems(this).map<[number, T]>((value, index) => [index, value]));\n\t}\n\n\tforEach(fn: (value: T, idx: number, list: this) => void, thisArg?: any): void {\n\t\tgetListItems(this).forEach(fn.bind(thisArg ? thisArg : this));\n\t}\n\n\thas(idx: number): boolean {\n\t\treturn this.size > idx;\n\t}\n\n\tincludes(value: T): boolean {\n\t\treturn getListItems(this).indexOf(value) >= 0;\n\t}\n\n\tindexOf(value: T): number {\n\t\treturn getListItems(this).indexOf(value);\n\t}\n\n\tjoin(separator: string = ','): string {\n\t\treturn getListItems(this).join(separator);\n\t}\n\n\tkeys(): IterableIterator {\n\t\treturn new ShimIterator(getListItems(this).map((_, index) => index));\n\t}\n\n\tlastIndexOf(value: T): number {\n\t\treturn getListItems(this).lastIndexOf(value);\n\t}\n\n\tpush(value: T): void {\n\t\tthis.add(value);\n\t}\n\n\tpop(): T | undefined {\n\t\treturn getListItems(this).pop();\n\t}\n\n\tsplice(start: number, deleteCount?: number, ...newItems: T[]): T[] {\n\t\treturn getListItems(this).splice(\n\t\t\tstart,\n\t\t\tdeleteCount === undefined ? this.size - start : deleteCount,\n\t\t\t...newItems\n\t\t);\n\t}\n\n\tvalues(): IterableIterator {\n\t\treturn new ShimIterator(getListItems(this).map((value) => value));\n\t}\n}\n\nexport default List;\n"]} \ No newline at end of file diff --git a/deps/framework/core/List.mjs b/deps/framework/core/List.mjs deleted file mode 100644 index 627101d138..0000000000 --- a/deps/framework/core/List.mjs +++ /dev/null @@ -1,81 +0,0 @@ -import { isArrayLike, isIterable, ShimIterator } from '../shim/iterator'; -import WeakMap from '../shim/WeakMap'; -const listItems = new WeakMap(); -function getListItems(list) { - return (listItems.get(list) || []); -} -export class List { - constructor(source) { - listItems.set(this, []); - if (source) { - if (isArrayLike(source)) { - for (let i = 0; i < source.length; i++) { - this.add(source[i]); - } - } - else if (isIterable(source)) { - for (const item of source) { - this.add(item); - } - } - } - } - [Symbol.iterator]() { - return this.values(); - } - get size() { - return getListItems(this).length; - } - add(value) { - getListItems(this).push(value); - return this; - } - clear() { - listItems.set(this, []); - } - delete(idx) { - if (idx < this.size) { - getListItems(this).splice(idx, 1); - return true; - } - return false; - } - entries() { - return new ShimIterator(getListItems(this).map((value, index) => [index, value])); - } - forEach(fn, thisArg) { - getListItems(this).forEach(fn.bind(thisArg ? thisArg : this)); - } - has(idx) { - return this.size > idx; - } - includes(value) { - return getListItems(this).indexOf(value) >= 0; - } - indexOf(value) { - return getListItems(this).indexOf(value); - } - join(separator = ',') { - return getListItems(this).join(separator); - } - keys() { - return new ShimIterator(getListItems(this).map((_, index) => index)); - } - lastIndexOf(value) { - return getListItems(this).lastIndexOf(value); - } - push(value) { - this.add(value); - } - pop() { - return getListItems(this).pop(); - } - splice(start, deleteCount, ...newItems) { - return getListItems(this).splice(start, deleteCount === undefined ? this.size - start : deleteCount, ...newItems); - } - values() { - return new ShimIterator(getListItems(this).map((value) => value)); - } -} -export default List; -//# sourceMappingURL=List.mjs.map \ No newline at end of file diff --git a/deps/framework/core/List.mjs.map b/deps/framework/core/List.mjs.map deleted file mode 100644 index 63f0533206..0000000000 --- a/deps/framework/core/List.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"List.mjs","sourceRoot":"","sources":["List.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,UAAU,EAA8B,YAAY,EAAE,MAAM,kBAAkB,CAAC;AACrG,OAAO,OAAO,MAAM,iBAAiB,CAAC;AAEtC,MAAM,SAAS,GAA8B,IAAI,OAAO,EAAoB,CAAC;AAE7E,sBAAyB,IAAa;IACrC,MAAM,CAAC,CAAC,SAAS,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,EAAE,CAAQ,CAAC;AAC3C,CAAC;AAED,MAAM;IASL,YAAY,MAAmC;QAC9C,SAAS,CAAC,GAAG,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;QAExB,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC;YACZ,EAAE,CAAC,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;gBACzB,GAAG,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;oBACxC,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;gBACrB,CAAC;YACF,CAAC;YAAC,IAAI,CAA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IAAI,YAAY,CAAI,YAAY,CAAC,IAAI,CAAC,CAAC,GAAG,CAAI,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC;IACzE,CAAC;CACD;AAED,eAAe,IAAI,CAAC","sourcesContent":["import { isArrayLike, isIterable, Iterable, IterableIterator, ShimIterator } from '../shim/iterator';\nimport WeakMap from '../shim/WeakMap';\n\nconst listItems: WeakMap, any[]> = new WeakMap, any[]>();\n\nfunction getListItems(list: List): T[] {\n\treturn (listItems.get(list) || []) as T[];\n}\n\nexport class List {\n\t[Symbol.iterator]() {\n\t\treturn this.values();\n\t}\n\n\tget size(): number {\n\t\treturn getListItems(this).length;\n\t}\n\n\tconstructor(source?: Iterable | ArrayLike) {\n\t\tlistItems.set(this, []);\n\n\t\tif (source) {\n\t\t\tif (isArrayLike(source)) {\n\t\t\t\tfor (let i = 0; i < source.length; i++) {\n\t\t\t\t\tthis.add(source[i]);\n\t\t\t\t}\n\t\t\t} else if (isIterable(source)) {\n\t\t\t\tfor (const item of source) {\n\t\t\t\t\tthis.add(item);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tadd(value: T): this {\n\t\tgetListItems(this).push(value);\n\t\treturn this;\n\t}\n\n\tclear(): void {\n\t\tlistItems.set(this, []);\n\t}\n\n\tdelete(idx: number): boolean {\n\t\tif (idx < this.size) {\n\t\t\tgetListItems(this).splice(idx, 1);\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}\n\n\tentries(): IterableIterator<[number, T]> {\n\t\treturn new ShimIterator<[number, T]>(getListItems(this).map<[number, T]>((value, index) => [index, value]));\n\t}\n\n\tforEach(fn: (value: T, idx: number, list: this) => void, thisArg?: any): void {\n\t\tgetListItems(this).forEach(fn.bind(thisArg ? thisArg : this));\n\t}\n\n\thas(idx: number): boolean {\n\t\treturn this.size > idx;\n\t}\n\n\tincludes(value: T): boolean {\n\t\treturn getListItems(this).indexOf(value) >= 0;\n\t}\n\n\tindexOf(value: T): number {\n\t\treturn getListItems(this).indexOf(value);\n\t}\n\n\tjoin(separator: string = ','): string {\n\t\treturn getListItems(this).join(separator);\n\t}\n\n\tkeys(): IterableIterator {\n\t\treturn new ShimIterator(getListItems(this).map((_, index) => index));\n\t}\n\n\tlastIndexOf(value: T): number {\n\t\treturn getListItems(this).lastIndexOf(value);\n\t}\n\n\tpush(value: T): void {\n\t\tthis.add(value);\n\t}\n\n\tpop(): T | undefined {\n\t\treturn getListItems(this).pop();\n\t}\n\n\tsplice(start: number, deleteCount?: number, ...newItems: T[]): T[] {\n\t\treturn getListItems(this).splice(\n\t\t\tstart,\n\t\t\tdeleteCount === undefined ? this.size - start : deleteCount,\n\t\t\t...newItems\n\t\t);\n\t}\n\n\tvalues(): IterableIterator {\n\t\treturn new ShimIterator(getListItems(this).map((value) => value));\n\t}\n}\n\nexport default List;\n"]} \ No newline at end of file diff --git a/deps/framework/core/MatchRegistry.d.ts b/deps/framework/core/MatchRegistry.d.ts deleted file mode 100644 index 77821d4f1c..0000000000 --- a/deps/framework/core/MatchRegistry.d.ts +++ /dev/null @@ -1,35 +0,0 @@ -import { Handle } from './interfaces'; -/** - * A registry of values tagged with matchers. - */ -export declare class MatchRegistry { - protected _defaultValue: T | undefined; - private readonly _entries; - /** - * Construct a new MatchRegistry, optionally containing a given default value. - */ - constructor(defaultValue?: T); - /** - * Return the first entry in this registry that matches the given arguments. If no entry matches and the registry - * was created with a default value, that value will be returned. Otherwise, an exception is thrown. - * - * @param ...args Arguments that will be used to select a matching value. - * @returns the matching value, or a default value if one exists. - */ - match(...args: any[]): T; - /** - * Register a test + value pair with this registry. - * - * @param test The test that will be used to determine if the registered value matches a set of arguments. - * @param value A value being registered. - * @param first If true, the newly registered test and value will be the first entry in the registry. - */ - register(test: Test | null, value: T | null, first?: boolean): Handle; -} -/** - * The interface that a test function must implement. - */ -export interface Test { - (...args: any[]): boolean | null; -} -export default MatchRegistry; diff --git a/deps/framework/core/MatchRegistry.js b/deps/framework/core/MatchRegistry.js deleted file mode 100644 index 5649f314ab..0000000000 --- a/deps/framework/core/MatchRegistry.js +++ /dev/null @@ -1,79 +0,0 @@ -(function (factory) { - if (typeof module === "object" && typeof module.exports === "object") { - var v = factory(require, exports); - if (v !== undefined) module.exports = v; - } - else if (typeof define === "function" && define.amd) { - define(["require", "exports"], factory); - } -})(function (require, exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - /** - * A registry of values tagged with matchers. - */ - var MatchRegistry = /** @class */ (function () { - /** - * Construct a new MatchRegistry, optionally containing a given default value. - */ - function MatchRegistry(defaultValue) { - this._defaultValue = defaultValue; - this._entries = []; - } - /** - * Return the first entry in this registry that matches the given arguments. If no entry matches and the registry - * was created with a default value, that value will be returned. Otherwise, an exception is thrown. - * - * @param ...args Arguments that will be used to select a matching value. - * @returns the matching value, or a default value if one exists. - */ - MatchRegistry.prototype.match = function () { - var args = []; - for (var _i = 0; _i < arguments.length; _i++) { - args[_i] = arguments[_i]; - } - var entries = this._entries ? this._entries.slice(0) : []; - var entry; - for (var i = 0; (entry = entries[i]); ++i) { - if (entry.value && entry.test && entry.test.apply(null, args)) { - return entry.value; - } - } - if (this._defaultValue !== undefined) { - return this._defaultValue; - } - throw new Error('No match found'); - }; - /** - * Register a test + value pair with this registry. - * - * @param test The test that will be used to determine if the registered value matches a set of arguments. - * @param value A value being registered. - * @param first If true, the newly registered test and value will be the first entry in the registry. - */ - MatchRegistry.prototype.register = function (test, value, first) { - var entries = this._entries; - var entry = { - test: test, - value: value - }; - entries[first ? 'unshift' : 'push'](entry); - return { - destroy: function () { - this.destroy = function () { }; - var i = 0; - if (entries && entry) { - while ((i = entries.indexOf(entry, i)) > -1) { - entries.splice(i, 1); - } - } - test = value = entries = entry = null; - } - }; - }; - return MatchRegistry; - }()); - exports.MatchRegistry = MatchRegistry; - exports.default = MatchRegistry; -}); -//# sourceMappingURL=MatchRegistry.js.map \ No newline at end of file diff --git a/deps/framework/core/MatchRegistry.js.map b/deps/framework/core/MatchRegistry.js.map deleted file mode 100644 index 5f06f79d8c..0000000000 --- a/deps/framework/core/MatchRegistry.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"MatchRegistry.js","sourceRoot":"","sources":["MatchRegistry.ts"],"names":[],"mappings":";;;;;;;;;;;IAWA;;OAEG;IACH;QAIC;;WAEG;QACH,uBAAY,YAAgB;YAC3B,IAAI,CAAC,aAAa,GAAG,YAAY,CAAC;YAClC,IAAI,CAAC,QAAQ,GAAG,EAAE,CAAC;QACpB,CAAC;QAED;;;;;;WAMG;QACH,6BAAK,GAAL;YAAM,cAAc;iBAAd,UAAc,EAAd,qBAAc,EAAd,IAAc;gBAAd,yBAAc;;YACnB,IAAM,OAAO,GAAG,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;YAC5D,IAAI,KAAe,CAAC;YAEpB,GAAG,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,KAAK,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,EAAE,CAAC;gBAC3C,EAAE,CAAC,CAAC,KAAK,CAAC,KAAK,IAAI,KAAK,CAAC,IAAI,IAAI,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC;oBAC/D,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC;gBACpB,CAAC;YACF,CAAC;YAED,EAAE,CAAC,CAAC,IAAI,CAAC,aAAa,KAAK,SAAS,CAAC,CAAC,CAAC;gBACtC,MAAM,CAAC,IAAI,CAAC,aAAa,CAAC;YAC3B,CAAC;YAED,MAAM,IAAI,KAAK,CAAC,gBAAgB,CAAC,CAAC;QACnC,CAAC;QAED;;;;;;WAMG;QACH,gCAAQ,GAAR,UAAS,IAAiB,EAAE,KAAe,EAAE,KAAe;YAC3D,IAAI,OAAO,GAAG,IAAI,CAAC,QAAQ,CAAC;YAC5B,IAAI,KAAK,GAAoB;gBAC5B,IAAI,EAAE,IAAI;gBACV,KAAK,EAAE,KAAK;aACZ,CAAC;YAEI,OAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,KAAK,CAAC,CAAC;YAElD,MAAM,CAAC;gBACN,OAAO,EAAE;oBACR,IAAI,CAAC,OAAO,GAAG,cAAkB,CAAC,CAAC;oBACnC,IAAI,CAAC,GAAG,CAAC,CAAC;oBACV,EAAE,CAAC,CAAC,OAAO,IAAI,KAAK,CAAC,CAAC,CAAC;wBACtB,OAAO,CAAC,CAAC,GAAG,OAAO,CAAC,OAAO,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC;4BAC7C,OAAO,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;wBACtB,CAAC;oBACF,CAAC;oBACD,IAAI,GAAG,KAAK,GAAG,OAAO,GAAG,KAAK,GAAG,IAAI,CAAC;gBACvC,CAAC;aACD,CAAC;QACH,CAAC;QACF,oBAAC;IAAD,CAAC,AAjED,IAiEC;IAjEY,sCAAa;IA0E1B,kBAAe,aAAa,CAAC","sourcesContent":["import { Handle } from './interfaces';\n\n/**\n * An entry in a MatchRegistry. Each Entry contains a test to determine whether the Entry is applicable, and a value for\n * the entry.\n */\ninterface Entry {\n\treadonly test: Test | null;\n\treadonly value: T | null;\n}\n\n/**\n * A registry of values tagged with matchers.\n */\nexport class MatchRegistry {\n\tprotected _defaultValue: T | undefined;\n\tprivate readonly _entries: Entry[] | null;\n\n\t/**\n\t * Construct a new MatchRegistry, optionally containing a given default value.\n\t */\n\tconstructor(defaultValue?: T) {\n\t\tthis._defaultValue = defaultValue;\n\t\tthis._entries = [];\n\t}\n\n\t/**\n\t * Return the first entry in this registry that matches the given arguments. If no entry matches and the registry\n\t * was created with a default value, that value will be returned. Otherwise, an exception is thrown.\n\t *\n\t * @param ...args Arguments that will be used to select a matching value.\n\t * @returns the matching value, or a default value if one exists.\n\t */\n\tmatch(...args: any[]): T {\n\t\tconst entries = this._entries ? this._entries.slice(0) : [];\n\t\tlet entry: Entry;\n\n\t\tfor (let i = 0; (entry = entries[i]); ++i) {\n\t\t\tif (entry.value && entry.test && entry.test.apply(null, args)) {\n\t\t\t\treturn entry.value;\n\t\t\t}\n\t\t}\n\n\t\tif (this._defaultValue !== undefined) {\n\t\t\treturn this._defaultValue;\n\t\t}\n\n\t\tthrow new Error('No match found');\n\t}\n\n\t/**\n\t * Register a test + value pair with this registry.\n\t *\n\t * @param test The test that will be used to determine if the registered value matches a set of arguments.\n\t * @param value A value being registered.\n\t * @param first If true, the newly registered test and value will be the first entry in the registry.\n\t */\n\tregister(test: Test | null, value: T | null, first?: boolean): Handle {\n\t\tlet entries = this._entries;\n\t\tlet entry: Entry | null = {\n\t\t\ttest: test,\n\t\t\tvalue: value\n\t\t};\n\n\t\t(entries)[first ? 'unshift' : 'push'](entry);\n\n\t\treturn {\n\t\t\tdestroy: function(this: Handle) {\n\t\t\t\tthis.destroy = function(): void {};\n\t\t\t\tlet i = 0;\n\t\t\t\tif (entries && entry) {\n\t\t\t\t\twhile ((i = entries.indexOf(entry, i)) > -1) {\n\t\t\t\t\t\tentries.splice(i, 1);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\ttest = value = entries = entry = null;\n\t\t\t}\n\t\t};\n\t}\n}\n\n/**\n * The interface that a test function must implement.\n */\nexport interface Test {\n\t(...args: any[]): boolean | null;\n}\n\nexport default MatchRegistry;\n"]} \ No newline at end of file diff --git a/deps/framework/core/MatchRegistry.mjs b/deps/framework/core/MatchRegistry.mjs deleted file mode 100644 index 92aa4334aa..0000000000 --- a/deps/framework/core/MatchRegistry.mjs +++ /dev/null @@ -1,61 +0,0 @@ -/** - * A registry of values tagged with matchers. - */ -export class MatchRegistry { - /** - * Construct a new MatchRegistry, optionally containing a given default value. - */ - constructor(defaultValue) { - this._defaultValue = defaultValue; - this._entries = []; - } - /** - * Return the first entry in this registry that matches the given arguments. If no entry matches and the registry - * was created with a default value, that value will be returned. Otherwise, an exception is thrown. - * - * @param ...args Arguments that will be used to select a matching value. - * @returns the matching value, or a default value if one exists. - */ - match(...args) { - const entries = this._entries ? this._entries.slice(0) : []; - let entry; - for (let i = 0; (entry = entries[i]); ++i) { - if (entry.value && entry.test && entry.test.apply(null, args)) { - return entry.value; - } - } - if (this._defaultValue !== undefined) { - return this._defaultValue; - } - throw new Error('No match found'); - } - /** - * Register a test + value pair with this registry. - * - * @param test The test that will be used to determine if the registered value matches a set of arguments. - * @param value A value being registered. - * @param first If true, the newly registered test and value will be the first entry in the registry. - */ - register(test, value, first) { - let entries = this._entries; - let entry = { - test: test, - value: value - }; - entries[first ? 'unshift' : 'push'](entry); - return { - destroy: function () { - this.destroy = function () { }; - let i = 0; - if (entries && entry) { - while ((i = entries.indexOf(entry, i)) > -1) { - entries.splice(i, 1); - } - } - test = value = entries = entry = null; - } - }; - } -} -export default MatchRegistry; -//# sourceMappingURL=MatchRegistry.mjs.map \ No newline at end of file diff --git a/deps/framework/core/MatchRegistry.mjs.map b/deps/framework/core/MatchRegistry.mjs.map deleted file mode 100644 index 5c99a87e2a..0000000000 --- a/deps/framework/core/MatchRegistry.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"MatchRegistry.mjs","sourceRoot":"","sources":["MatchRegistry.ts"],"names":[],"mappings":"AAWA;;GAEG;AACH,MAAM;IAIL;;OAEG;IACH,YAAY,YAAgB;QAC3B,IAAI,CAAC,aAAa,GAAG,YAAY,CAAC;QAClC,IAAI,CAAC,QAAQ,GAAG,EAAE,CAAC;IACpB,CAAC;IAED;;;;;;OAMG;IACH,KAAK,CAAC,GAAG,IAAW;QACnB,MAAM,OAAO,GAAG,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAA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C,CAAC,EAAE,CAAC,CAAC,CAAC;oBACtB,CAAC;gBACF,CAAC;gBACD,IAAI,GAAG,KAAK,GAAG,OAAO,GAAG,KAAK,GAAG,IAAI,CAAC;YACvC,CAAC;SACD,CAAC;IACH,CAAC;CACD;AASD,eAAe,aAAa,CAAC","sourcesContent":["import { Handle } from './interfaces';\n\n/**\n * An entry in a MatchRegistry. Each Entry contains a test to determine whether the Entry is applicable, and a value for\n * the entry.\n */\ninterface Entry {\n\treadonly test: Test | null;\n\treadonly value: T | null;\n}\n\n/**\n * A registry of values tagged with matchers.\n */\nexport class MatchRegistry {\n\tprotected _defaultValue: T | undefined;\n\tprivate readonly _entries: Entry[] | null;\n\n\t/**\n\t * Construct a new MatchRegistry, optionally containing a given default value.\n\t */\n\tconstructor(defaultValue?: T) {\n\t\tthis._defaultValue = defaultValue;\n\t\tthis._entries = [];\n\t}\n\n\t/**\n\t * Return the first entry in this registry that matches the given arguments. If no entry matches and the registry\n\t * was created with a default value, that value will be returned. Otherwise, an exception is thrown.\n\t *\n\t * @param ...args Arguments that will be used to select a matching value.\n\t * @returns the matching value, or a default value if one exists.\n\t */\n\tmatch(...args: any[]): T {\n\t\tconst entries = this._entries ? this._entries.slice(0) : [];\n\t\tlet entry: Entry;\n\n\t\tfor (let i = 0; (entry = entries[i]); ++i) {\n\t\t\tif (entry.value && entry.test && entry.test.apply(null, args)) {\n\t\t\t\treturn entry.value;\n\t\t\t}\n\t\t}\n\n\t\tif (this._defaultValue !== undefined) {\n\t\t\treturn this._defaultValue;\n\t\t}\n\n\t\tthrow new Error('No match found');\n\t}\n\n\t/**\n\t * Register a test + value pair with this registry.\n\t *\n\t * @param test The test that will be used to determine if the registered value matches a set of arguments.\n\t * @param value A value being registered.\n\t * @param first If true, the newly registered test and value will be the first entry in the registry.\n\t */\n\tregister(test: Test | null, value: T | null, first?: boolean): Handle {\n\t\tlet entries = this._entries;\n\t\tlet entry: Entry | null = {\n\t\t\ttest: test,\n\t\t\tvalue: value\n\t\t};\n\n\t\t(entries)[first ? 'unshift' : 'push'](entry);\n\n\t\treturn {\n\t\t\tdestroy: function(this: Handle) {\n\t\t\t\tthis.destroy = function(): void {};\n\t\t\t\tlet i = 0;\n\t\t\t\tif (entries && entry) {\n\t\t\t\t\twhile ((i = entries.indexOf(entry, i)) > -1) {\n\t\t\t\t\t\tentries.splice(i, 1);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\ttest = value = entries = entry = null;\n\t\t\t}\n\t\t};\n\t}\n}\n\n/**\n * The interface that a test function must implement.\n */\nexport interface Test {\n\t(...args: any[]): boolean | null;\n}\n\nexport default MatchRegistry;\n"]} \ No newline at end of file diff --git a/deps/framework/core/MultiMap.d.ts b/deps/framework/core/MultiMap.d.ts deleted file mode 100644 index 2ba7611308..0000000000 --- a/deps/framework/core/MultiMap.d.ts +++ /dev/null @@ -1,86 +0,0 @@ -import { Iterable, IterableIterator } from '../shim/iterator'; -import Map from '../shim/Map'; -import '../shim/Symbol'; -/** - * A map implmentation that supports multiple keys for specific value. - * - * @param T Accepts the type of the value - */ -export declare class MultiMap implements Map { - private _map; - private _key; - /** - * @constructor - * - * @param iterator an array or iterator of tuples to initialize the map with. - */ - constructor(iterable?: ArrayLike<[any[], T]> | Iterable<[any[], T]>); - /** - * Sets the value for the array of keys provided - * - * @param keys The array of keys to store the value against - * @param value the value of the map entry - * - * @return the multi map instance - */ - set(keys: any[], value: T): this; - /** - * Returns the value entry for the array of keys - * - * @param keys The array of keys to look up the value for - * - * @return The value if found otherwise `undefined` - */ - get(keys: any[]): T | undefined; - /** - * Returns a boolean indicating if the key exists in the map - * - * @return boolean true if the key exists otherwise false - */ - has(keys: any[]): boolean; - /** - * Returns the size of the map, based on the number of unique keys - */ - readonly size: number; - /** - * Deletes the entry for the key provided. - * - * @param keys the key of the entry to remove - * @return boolean trus if the entry was deleted, false if the entry was not found - */ - delete(keys: any[]): boolean; - /** - * Return an iterator that yields each value in the map - * - * @return An iterator containing the instance's values. - */ - values(): IterableIterator; - /** - * Return an iterator that yields each key array in the map - * - * @return An iterator containing the instance's keys. - */ - keys(): IterableIterator; - /** - * Returns an iterator that yields each key/value pair as an array. - * - * @return An iterator for each key/value pair in the instance. - */ - entries(): IterableIterator<[any[], T]>; - /** - * Executes a given function for each map entry. The function - * is invoked with three arguments: the element value, the - * element key, and the associated Map instance. - * - * @param callback The function to execute for each map entry, - * @param context The value to use for `this` for each execution of the calback - */ - forEach(callback: (value: T, key: any[], mapInstance: MultiMap) => any, context?: {}): void; - /** - * Deletes all keys and their associated values. - */ - clear(): void; - [Symbol.iterator](): IterableIterator<[any[], T]>; - [Symbol.toStringTag]: string; -} -export default MultiMap; diff --git a/deps/framework/core/MultiMap.js b/deps/framework/core/MultiMap.js deleted file mode 100644 index 07d3d58a07..0000000000 --- a/deps/framework/core/MultiMap.js +++ /dev/null @@ -1,254 +0,0 @@ -(function (factory) { - if (typeof module === "object" && typeof module.exports === "object") { - var v = factory(require, exports); - if (v !== undefined) module.exports = v; - } - else if (typeof define === "function" && define.amd) { - define(["require", "exports", "tslib", "../shim/array", "../shim/iterator", "../shim/Map", "../shim/Symbol"], factory); - } -})(function (require, exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - var tslib_1 = require("tslib"); - var array_1 = require("../shim/array"); - var iterator_1 = require("../shim/iterator"); - var Map_1 = require("../shim/Map"); - require("../shim/Symbol"); - /** - * A map implmentation that supports multiple keys for specific value. - * - * @param T Accepts the type of the value - */ - var MultiMap = /** @class */ (function () { - /** - * @constructor - * - * @param iterator an array or iterator of tuples to initialize the map with. - */ - function MultiMap(iterable) { - this[Symbol.toStringTag] = 'MultiMap'; - this._map = new Map_1.default(); - this._key = Symbol(); - if (iterable) { - if (iterator_1.isArrayLike(iterable)) { - for (var i = 0; i < iterable.length; i++) { - var value = iterable[i]; - this.set(value[0], value[1]); - } - } - else if (iterator_1.isIterable(iterable)) { - try { - for (var iterable_1 = tslib_1.__values(iterable), iterable_1_1 = iterable_1.next(); !iterable_1_1.done; iterable_1_1 = iterable_1.next()) { - var value = iterable_1_1.value; - this.set(value[0], value[1]); - } - } - catch (e_1_1) { e_1 = { error: e_1_1 }; } - finally { - try { - if (iterable_1_1 && !iterable_1_1.done && (_a = iterable_1.return)) _a.call(iterable_1); - } - finally { if (e_1) throw e_1.error; } - } - } - } - var e_1, _a; - } - /** - * Sets the value for the array of keys provided - * - * @param keys The array of keys to store the value against - * @param value the value of the map entry - * - * @return the multi map instance - */ - MultiMap.prototype.set = function (keys, value) { - var map = this._map; - var childMap; - for (var i = 0; i < keys.length; i++) { - if (map.get(keys[i])) { - map = map.get(keys[i]); - continue; - } - childMap = new Map_1.default(); - map.set(keys[i], childMap); - map = childMap; - } - map.set(this._key, value); - return this; - }; - /** - * Returns the value entry for the array of keys - * - * @param keys The array of keys to look up the value for - * - * @return The value if found otherwise `undefined` - */ - MultiMap.prototype.get = function (keys) { - var map = this._map; - for (var i = 0; i < keys.length; i++) { - map = map.get(keys[i]); - if (!map) { - return undefined; - } - } - return map.get(this._key); - }; - /** - * Returns a boolean indicating if the key exists in the map - * - * @return boolean true if the key exists otherwise false - */ - MultiMap.prototype.has = function (keys) { - var map = this._map; - for (var i = 0; i < keys.length; i++) { - map = map.get(keys[i]); - if (!map) { - return false; - } - } - return true; - }; - Object.defineProperty(MultiMap.prototype, "size", { - /** - * Returns the size of the map, based on the number of unique keys - */ - get: function () { - return array_1.from(this.keys()).length; - }, - enumerable: true, - configurable: true - }); - /** - * Deletes the entry for the key provided. - * - * @param keys the key of the entry to remove - * @return boolean trus if the entry was deleted, false if the entry was not found - */ - MultiMap.prototype.delete = function (keys) { - var map = this._map; - var path = [this._map]; - for (var i = 0; i < keys.length; i++) { - map = map.get(keys[i]); - path.push(map); - if (!map) { - return false; - } - } - map.delete(this._key); - for (var i = keys.length - 1; i >= 0; i--) { - map = path[i].get(keys[i]); - if (map.size) { - break; - } - path[i].delete(keys[i]); - } - return true; - }; - /** - * Return an iterator that yields each value in the map - * - * @return An iterator containing the instance's values. - */ - MultiMap.prototype.values = function () { - var _this = this; - var values = []; - var getValues = function (map) { - map.forEach(function (value, key) { - if (key === _this._key) { - values.push(value); - } - else { - getValues(value); - } - }); - }; - getValues(this._map); - return new iterator_1.ShimIterator(values); - }; - /** - * Return an iterator that yields each key array in the map - * - * @return An iterator containing the instance's keys. - */ - MultiMap.prototype.keys = function () { - var _this = this; - var finalKeys = []; - var getKeys = function (map, keys) { - if (keys === void 0) { keys = []; } - map.forEach(function (value, key) { - if (key === _this._key) { - finalKeys.push(keys); - } - else { - var nextKeys = tslib_1.__spread(keys, [key]); - getKeys(value, nextKeys); - } - }); - }; - getKeys(this._map); - return new iterator_1.ShimIterator(finalKeys); - }; - /** - * Returns an iterator that yields each key/value pair as an array. - * - * @return An iterator for each key/value pair in the instance. - */ - MultiMap.prototype.entries = function () { - var _this = this; - var finalEntries = []; - var getKeys = function (map, keys) { - if (keys === void 0) { keys = []; } - map.forEach(function (value, key) { - if (key === _this._key) { - finalEntries.push([keys, value]); - } - else { - var nextKeys = tslib_1.__spread(keys, [key]); - getKeys(value, nextKeys); - } - }); - }; - getKeys(this._map); - return new iterator_1.ShimIterator(finalEntries); - }; - /** - * Executes a given function for each map entry. The function - * is invoked with three arguments: the element value, the - * element key, and the associated Map instance. - * - * @param callback The function to execute for each map entry, - * @param context The value to use for `this` for each execution of the calback - */ - MultiMap.prototype.forEach = function (callback, context) { - var entries = this.entries(); - try { - for (var entries_1 = tslib_1.__values(entries), entries_1_1 = entries_1.next(); !entries_1_1.done; entries_1_1 = entries_1.next()) { - var value = entries_1_1.value; - callback.call(context, value[1], value[0], this); - } - } - catch (e_2_1) { e_2 = { error: e_2_1 }; } - finally { - try { - if (entries_1_1 && !entries_1_1.done && (_a = entries_1.return)) _a.call(entries_1); - } - finally { if (e_2) throw e_2.error; } - } - var e_2, _a; - }; - /** - * Deletes all keys and their associated values. - */ - MultiMap.prototype.clear = function () { - this._map.clear(); - }; - MultiMap.prototype[Symbol.iterator] = function () { - return this.entries(); - }; - return MultiMap; - }()); - exports.MultiMap = MultiMap; - exports.default = MultiMap; -}); -//# sourceMappingURL=MultiMap.js.map \ No newline at end of file diff --git a/deps/framework/core/MultiMap.js.map b/deps/framework/core/MultiMap.js.map deleted file mode 100644 index fc90430437..0000000000 --- a/deps/framework/core/MultiMap.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"MultiMap.js","sourceRoot":"","sources":["MultiMap.ts"],"names":[],"mappings":";;;;;;;;;;;;IAAA,uCAAkD;IAClD,6CAAqG;IACrG,mCAA8B;IAC9B,0BAAwB;IAExB;;;;OAIG;IACH;QAIC;;;;WAIG;QACH,kBAAY,QAAuD;YAsNnE,KAAC,MAAM,CAAC,WAAW,CAAC,GAAG,UAAU,CAAC;YArNjC,IAAI,CAAC,IAAI,GAAG,IAAI,aAAG,EAAY,CAAC;YAChC,IAAI,CAAC,IAAI,GAAG,MAAM,EAAE,CAAC;YACrB,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC;gBACd,EAAE,CAAC,CAAC,sBAAW,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;oBAC3B,GAAG,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,QAAQ,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;wBAC1C,IAAM,KAAK,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC;wBAC1B,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;oBAC9B,CAAC;gBACF,CAAC;gBAAC,IAAI,CAAC,EAAE,CAAC,CAAC,qBAAU,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;;wBACjC,GAAG,CAAC,CAAgB,IAAA,aAAA,iBAAA,QAAQ,CAAA,kCAAA;4BAAvB,IAAM,KAAK,qBAAA;4BACf,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,C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gBAE/B,GAAG,CAAC,CAAgB,IAAA,YAAA,iBAAA,OAAO,CAAA,gCAAA;oBAAtB,IAAM,KAAK,oBAAA;oBACf,QAAQ,CAAC,IAAI,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC;iBACjD;;;;;;;;;;QACF,CAAC;QAED;;WAEG;QACH,wBAAK,GAAL;YACC,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC;QACnB,CAAC;QAED,mBAAC,MAAM,CAAC,QAAQ,CAAC,GAAjB;YACC,MAAM,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC;QACvB,CAAC;QAGF,eAAC;IAAD,CAAC,AAhOD,IAgOC;IAhOY,4BAAQ;IAkOrB,kBAAe,QAAQ,CAAC","sourcesContent":["import { from as arrayFrom } from '../shim/array';\nimport { isArrayLike, isIterable, Iterable, IterableIterator, ShimIterator } from '../shim/iterator';\nimport Map from '../shim/Map';\nimport '../shim/Symbol';\n\n/**\n * A map implmentation that supports multiple keys for specific value.\n *\n * @param T Accepts the type of the value\n */\nexport class MultiMap implements Map {\n\tprivate _map: Map;\n\tprivate _key: symbol;\n\n\t/**\n\t * @constructor\n\t *\n\t * @param iterator an array or iterator of tuples to initialize the map with.\n\t */\n\tconstructor(iterable?: ArrayLike<[any[], T]> | Iterable<[any[], T]>) {\n\t\tthis._map = new Map();\n\t\tthis._key = Symbol();\n\t\tif (iterable) {\n\t\t\tif (isArrayLike(iterable)) {\n\t\t\t\tfor (let i = 0; i < iterable.length; i++) {\n\t\t\t\t\tconst value = iterable[i];\n\t\t\t\t\tthis.set(value[0], value[1]);\n\t\t\t\t}\n\t\t\t} else if (isIterable(iterable)) {\n\t\t\t\tfor (const value of iterable) {\n\t\t\t\t\tthis.set(value[0], value[1]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Sets the value for the array of keys provided\n\t *\n\t * @param keys The array of keys to store the value against\n\t * @param value the value of the map entry\n\t *\n\t * @return the multi map instance\n\t */\n\tset(keys: any[], value: T): this {\n\t\tlet map = this._map;\n\t\tlet childMap;\n\n\t\tfor (let i = 0; i < keys.length; i++) {\n\t\t\tif (map.get(keys[i])) {\n\t\t\t\tmap = map.get(keys[i]);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tchildMap = new Map();\n\t\t\tmap.set(keys[i], childMap);\n\t\t\tmap = childMap;\n\t\t}\n\n\t\tmap.set(this._key, value);\n\t\treturn this;\n\t}\n\n\t/**\n\t * Returns the value entry for the array of keys\n\t *\n\t * @param keys The array of keys to look up the value for\n\t *\n\t * @return The value if found otherwise `undefined`\n\t */\n\tget(keys: any[]): T | undefined {\n\t\tlet map = this._map;\n\n\t\tfor (let i = 0; i < keys.length; i++) {\n\t\t\tmap = map.get(keys[i]);\n\n\t\t\tif (!map) {\n\t\t\t\treturn undefined;\n\t\t\t}\n\t\t}\n\n\t\treturn map.get(this._key);\n\t}\n\n\t/**\n\t * Returns a boolean indicating if the key exists in the map\n\t *\n\t * @return boolean true if the key exists otherwise false\n\t */\n\thas(keys: any[]): boolean {\n\t\tlet map = this._map;\n\n\t\tfor (let i = 0; i < keys.length; i++) {\n\t\t\tmap = map.get(keys[i]);\n\t\t\tif (!map) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}\n\n\t/**\n\t * Returns the size of the map, based on the number of unique keys\n\t */\n\tget size(): number {\n\t\treturn arrayFrom(this.keys()).length;\n\t}\n\n\t/**\n\t * Deletes the entry for the key provided.\n\t *\n\t * @param keys the key of the entry to remove\n\t * @return boolean trus if the entry was deleted, false if the entry was not found\n\t */\n\tdelete(keys: any[]): boolean {\n\t\tlet map = this._map;\n\t\tconst path = [this._map];\n\n\t\tfor (let i = 0; i < keys.length; i++) {\n\t\t\tmap = map.get(keys[i]);\n\t\t\tpath.push(map);\n\t\t\tif (!map) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\tmap.delete(this._key);\n\n\t\tfor (let i = keys.length - 1; i >= 0; i--) {\n\t\t\tmap = path[i].get(keys[i]);\n\t\t\tif (map.size) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tpath[i].delete(keys[i]);\n\t\t}\n\n\t\treturn true;\n\t}\n\n\t/**\n\t * Return an iterator that yields each value in the map\n\t *\n\t * @return An iterator containing the instance's values.\n\t */\n\tvalues(): IterableIterator {\n\t\tconst values: T[] = [];\n\n\t\tconst getValues = (map: Map) => {\n\t\t\tmap.forEach((value, key) => {\n\t\t\t\tif (key === this._key) {\n\t\t\t\t\tvalues.push(value);\n\t\t\t\t} else {\n\t\t\t\t\tgetValues(value);\n\t\t\t\t}\n\t\t\t});\n\t\t};\n\n\t\tgetValues(this._map);\n\t\treturn new ShimIterator(values);\n\t}\n\n\t/**\n\t * Return an iterator that yields each key array in the map\n\t *\n\t * @return An iterator containing the instance's keys.\n\t */\n\tkeys(): IterableIterator {\n\t\tconst finalKeys: any[][] = [];\n\n\t\tconst getKeys = (map: Map, keys: any[] = []) => {\n\t\t\tmap.forEach((value, key) => {\n\t\t\t\tif (key === this._key) {\n\t\t\t\t\tfinalKeys.push(keys);\n\t\t\t\t} else {\n\t\t\t\t\tconst nextKeys = [...keys, key];\n\t\t\t\t\tgetKeys(value, nextKeys);\n\t\t\t\t}\n\t\t\t});\n\t\t};\n\n\t\tgetKeys(this._map);\n\t\treturn new ShimIterator(finalKeys);\n\t}\n\n\t/**\n\t * Returns an iterator that yields each key/value pair as an array.\n\t *\n\t * @return An iterator for each key/value pair in the instance.\n\t */\n\tentries(): IterableIterator<[any[], T]> {\n\t\tconst finalEntries: [any[], T][] = [];\n\n\t\tconst getKeys = (map: Map, keys: any[] = []) => {\n\t\t\tmap.forEach((value, key) => {\n\t\t\t\tif (key === this._key) {\n\t\t\t\t\tfinalEntries.push([keys, value]);\n\t\t\t\t} else {\n\t\t\t\t\tconst nextKeys = [...keys, key];\n\t\t\t\t\tgetKeys(value, nextKeys);\n\t\t\t\t}\n\t\t\t});\n\t\t};\n\n\t\tgetKeys(this._map);\n\t\treturn new ShimIterator<[any[], T]>(finalEntries);\n\t}\n\n\t/**\n\t * Executes a given function for each map entry. The function\n\t * is invoked with three arguments: the element value, the\n\t * element key, and the associated Map instance.\n\t *\n\t * @param callback The function to execute for each map entry,\n\t * @param context The value to use for `this` for each execution of the calback\n\t */\n\tforEach(callback: (value: T, key: any[], mapInstance: MultiMap) => any, context?: {}): void {\n\t\tconst entries = this.entries();\n\n\t\tfor (const value of entries) {\n\t\t\tcallback.call(context, value[1], value[0], this);\n\t\t}\n\t}\n\n\t/**\n\t * Deletes all keys and their associated values.\n\t */\n\tclear(): void {\n\t\tthis._map.clear();\n\t}\n\n\t[Symbol.iterator](): IterableIterator<[any[], T]> {\n\t\treturn this.entries();\n\t}\n\n\t[Symbol.toStringTag] = 'MultiMap';\n}\n\nexport default MultiMap;\n"]} \ No newline at end of file diff --git a/deps/framework/core/MultiMap.mjs b/deps/framework/core/MultiMap.mjs deleted file mode 100644 index c16f65e768..0000000000 --- a/deps/framework/core/MultiMap.mjs +++ /dev/null @@ -1,208 +0,0 @@ -import { from as arrayFrom } from '../shim/array'; -import { isArrayLike, isIterable, ShimIterator } from '../shim/iterator'; -import Map from '../shim/Map'; -import '../shim/Symbol'; -/** - * A map implmentation that supports multiple keys for specific value. - * - * @param T Accepts the type of the value - */ -export class MultiMap { - /** - * @constructor - * - * @param iterator an array or iterator of tuples to initialize the map with. - */ - constructor(iterable) { - this[Symbol.toStringTag] = 'MultiMap'; - this._map = new Map(); - this._key = Symbol(); - if (iterable) { - if (isArrayLike(iterable)) { - for (let i = 0; i < iterable.length; i++) { - const value = iterable[i]; - this.set(value[0], value[1]); - } - } - else if (isIterable(iterable)) { - for (const value of iterable) { - this.set(value[0], value[1]); - } - } - } - } - /** - * Sets the value for the array of keys provided - * - * @param keys The array of keys to store the value against - * @param value the value of the map entry - * - * @return the multi map instance - */ - set(keys, value) { - let map = this._map; - let childMap; - for (let i = 0; i < keys.length; i++) { - if (map.get(keys[i])) { - map = map.get(keys[i]); - continue; - } - childMap = new Map(); - map.set(keys[i], childMap); - map = childMap; - } - map.set(this._key, value); - return this; - } - /** - * Returns the value entry for the array of keys - * - * @param keys The array of keys to look up the value for - * - * @return The value if found otherwise `undefined` - */ - get(keys) { - let map = this._map; - for (let i = 0; i < keys.length; i++) { - map = map.get(keys[i]); - if (!map) { - return undefined; - } - } - return map.get(this._key); - } - /** - * Returns a boolean indicating if the key exists in the map - * - * @return boolean true if the key exists otherwise false - */ - has(keys) { - let map = this._map; - for (let i = 0; i < keys.length; i++) { - map = map.get(keys[i]); - if (!map) { - return false; - } - } - return true; - } - /** - * Returns the size of the map, based on the number of unique keys - */ - get size() { - return arrayFrom(this.keys()).length; - } - /** - * Deletes the entry for the key provided. - * - * @param keys the key of the entry to remove - * @return boolean trus if the entry was deleted, false if the entry was not found - */ - delete(keys) { - let map = this._map; - const path = [this._map]; - for (let i = 0; i < keys.length; i++) { - map = map.get(keys[i]); - path.push(map); - if (!map) { - return false; - } - } - map.delete(this._key); - for (let i = keys.length - 1; i >= 0; i--) { - map = path[i].get(keys[i]); - if (map.size) { - break; - } - path[i].delete(keys[i]); - } - return true; - } - /** - * Return an iterator that yields each value in the map - * - * @return An iterator containing the instance's values. - */ - values() { - const values = []; - const getValues = (map) => { - map.forEach((value, key) => { - if (key === this._key) { - values.push(value); - } - else { - getValues(value); - } - }); - }; - getValues(this._map); - return new ShimIterator(values); - } - /** - * Return an iterator that yields each key array in the map - * - * @return An iterator containing the instance's keys. - */ - keys() { - const finalKeys = []; - const getKeys = (map, keys = []) => { - map.forEach((value, key) => { - if (key === this._key) { - finalKeys.push(keys); - } - else { - const nextKeys = [...keys, key]; - getKeys(value, nextKeys); - } - }); - }; - getKeys(this._map); - return new ShimIterator(finalKeys); - } - /** - * Returns an iterator that yields each key/value pair as an array. - * - * @return An iterator for each key/value pair in the instance. - */ - entries() { - const finalEntries = []; - const getKeys = (map, keys = []) => { - map.forEach((value, key) => { - if (key === this._key) { - finalEntries.push([keys, value]); - } - else { - const nextKeys = [...keys, key]; - getKeys(value, nextKeys); - } - }); - }; - getKeys(this._map); - return new ShimIterator(finalEntries); - } - /** - * Executes a given function for each map entry. The function - * is invoked with three arguments: the element value, the - * element key, and the associated Map instance. - * - * @param callback The function to execute for each map entry, - * @param context The value to use for `this` for each execution of the calback - */ - forEach(callback, context) { - const entries = this.entries(); - for (const value of entries) { - callback.call(context, value[1], value[0], this); - } - } - /** - * Deletes all keys and their associated values. - */ - clear() { - this._map.clear(); - } - [Symbol.iterator]() { - return this.entries(); - } -} -export default MultiMap; -//# sourceMappingURL=MultiMap.mjs.map \ No newline at end of file diff --git a/deps/framework/core/MultiMap.mjs.map b/deps/framework/core/MultiMap.mjs.map deleted file mode 100644 index 4f4cb18948..0000000000 --- a/deps/framework/core/MultiMap.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"MultiMap.mjs","sourceRoot":"","sources":["MultiMap.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,IAAI,SAAS,EAAE,MAAM,eAAe,CAAC;AAClD,OAAO,EAAE,WAAW,EAAE,UAAU,EAA8B,YAAY,EAAE,MAAM,kBAAkB,CAAC;AACrG,OAAO,GAAG,MAAM,aAAa,CAAC;AAC9B,OAAO,gBAAgB,CAAC;AAExB;;;;GAIG;AACH,MAAM;IAIL;;;;OAIG;IACH,YAAY,QAAuD;QAsNnE,KAAC,MAAM,CAAC,WAAW,CAAC,GAAG,UAAU,CAAC;QArNjC,IAAI,CAAC,IAAI,GAAG,IAAI,GAAG,EAAY,CAAC;QAChC,IAAI,CAAC,IAAI,GAAG,MAAM,EAAE,CAAC;QACrB,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC;YACd,EAAE,CAAC,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;gBAC3B,GAAG,CAAC,CAAC,IAAI,C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,GAAG,CAAC,CAAC;oBAChC,OAAO,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC;gBAC1B,CAAC;YACF,CAAC,CAAC,CAAC;QACJ,CAAC,CAAC;QAEF,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACnB,MAAM,CAAC,IAAI,YAAY,CAAa,YAAY,CAAC,CAAC;IACnD,CAAC;IAED;;;;;;;OAOG;IACH,OAAO,CAAC,QAAiE,EAAE,OAAY;QACtF,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,EAAE,CAAC;QAE/B,GAAG,CAAC,CAAC,MAAM,KAAK,IAAI,OAAO,CAAC,CAAC,CAAC;YAC7B,QAAQ,CAAC,IAAI,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC;QAClD,CAAC;IACF,CAAC;IAED;;OAEG;IACH,KAAK;QACJ,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC;IACnB,CAAC;IAED,CAAC,MAAM,CAAC,QAAQ,CAAC;QAChB,MAAM,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC;IACvB,CAAC;CAGD;AAED,eAAe,QAAQ,CAAC","sourcesContent":["import { from as arrayFrom } from '../shim/array';\nimport { isArrayLike, isIterable, Iterable, IterableIterator, ShimIterator } from '../shim/iterator';\nimport Map from '../shim/Map';\nimport '../shim/Symbol';\n\n/**\n * A map implmentation that supports multiple keys for specific value.\n *\n * @param T Accepts the type of the value\n */\nexport class MultiMap implements Map {\n\tprivate _map: Map;\n\tprivate _key: symbol;\n\n\t/**\n\t * @constructor\n\t *\n\t * @param iterator an array or iterator of tuples to initialize the map with.\n\t */\n\tconstructor(iterable?: ArrayLike<[any[], T]> | Iterable<[any[], T]>) {\n\t\tthis._map = new Map();\n\t\tthis._key = Symbol();\n\t\tif (iterable) {\n\t\t\tif (isArrayLike(iterable)) {\n\t\t\t\tfor (let i = 0; i < iterable.length; i++) {\n\t\t\t\t\tconst value = iterable[i];\n\t\t\t\t\tthis.set(value[0], value[1]);\n\t\t\t\t}\n\t\t\t} else if (isIterable(iterable)) {\n\t\t\t\tfor (const value of iterable) {\n\t\t\t\t\tthis.set(value[0], value[1]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Sets the value for the array of keys provided\n\t *\n\t * @param keys The array of keys to store the value against\n\t * @param value the value of the map entry\n\t *\n\t * @return the multi map instance\n\t */\n\tset(keys: any[], value: T): this {\n\t\tlet map = this._map;\n\t\tlet childMap;\n\n\t\tfor (let i = 0; i < keys.length; i++) {\n\t\t\tif (map.get(keys[i])) {\n\t\t\t\tmap = map.get(keys[i]);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tchildMap = new Map();\n\t\t\tmap.set(keys[i], childMap);\n\t\t\tmap = childMap;\n\t\t}\n\n\t\tmap.set(this._key, value);\n\t\treturn this;\n\t}\n\n\t/**\n\t * Returns the value entry for the array of keys\n\t *\n\t * @param keys The array of keys to look up the value for\n\t *\n\t * @return The value if found otherwise `undefined`\n\t */\n\tget(keys: any[]): T | undefined {\n\t\tlet map = this._map;\n\n\t\tfor (let i = 0; i < keys.length; i++) {\n\t\t\tmap = map.get(keys[i]);\n\n\t\t\tif (!map) {\n\t\t\t\treturn undefined;\n\t\t\t}\n\t\t}\n\n\t\treturn map.get(this._key);\n\t}\n\n\t/**\n\t * Returns a boolean indicating if the key exists in the map\n\t *\n\t * @return boolean true if the key exists otherwise false\n\t */\n\thas(keys: any[]): boolean {\n\t\tlet map = this._map;\n\n\t\tfor (let i = 0; i < keys.length; i++) {\n\t\t\tmap = map.get(keys[i]);\n\t\t\tif (!map) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}\n\n\t/**\n\t * Returns the size of the map, based on the number of unique keys\n\t */\n\tget size(): number {\n\t\treturn arrayFrom(this.keys()).length;\n\t}\n\n\t/**\n\t * Deletes the entry for the key provided.\n\t *\n\t * @param keys the key of the entry to remove\n\t * @return boolean trus if the entry was deleted, false if the entry was not found\n\t */\n\tdelete(keys: any[]): boolean {\n\t\tlet map = this._map;\n\t\tconst path = [this._map];\n\n\t\tfor (let i = 0; i < keys.length; i++) {\n\t\t\tmap = map.get(keys[i]);\n\t\t\tpath.push(map);\n\t\t\tif (!map) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\tmap.delete(this._key);\n\n\t\tfor (let i = keys.length - 1; i >= 0; i--) {\n\t\t\tmap = path[i].get(keys[i]);\n\t\t\tif (map.size) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tpath[i].delete(keys[i]);\n\t\t}\n\n\t\treturn true;\n\t}\n\n\t/**\n\t * Return an iterator that yields each value in the map\n\t *\n\t * @return An iterator containing the instance's values.\n\t */\n\tvalues(): IterableIterator {\n\t\tconst values: T[] = [];\n\n\t\tconst getValues = (map: Map) => {\n\t\t\tmap.forEach((value, key) => {\n\t\t\t\tif (key === this._key) {\n\t\t\t\t\tvalues.push(value);\n\t\t\t\t} else {\n\t\t\t\t\tgetValues(value);\n\t\t\t\t}\n\t\t\t});\n\t\t};\n\n\t\tgetValues(this._map);\n\t\treturn new ShimIterator(values);\n\t}\n\n\t/**\n\t * Return an iterator that yields each key array in the map\n\t *\n\t * @return An iterator containing the instance's keys.\n\t */\n\tkeys(): IterableIterator {\n\t\tconst finalKeys: any[][] = [];\n\n\t\tconst getKeys = (map: Map, keys: any[] = []) => {\n\t\t\tmap.forEach((value, key) => {\n\t\t\t\tif (key === this._key) {\n\t\t\t\t\tfinalKeys.push(keys);\n\t\t\t\t} else {\n\t\t\t\t\tconst nextKeys = [...keys, key];\n\t\t\t\t\tgetKeys(value, nextKeys);\n\t\t\t\t}\n\t\t\t});\n\t\t};\n\n\t\tgetKeys(this._map);\n\t\treturn new ShimIterator(finalKeys);\n\t}\n\n\t/**\n\t * Returns an iterator that yields each key/value pair as an array.\n\t *\n\t * @return An iterator for each key/value pair in the instance.\n\t */\n\tentries(): IterableIterator<[any[], T]> {\n\t\tconst finalEntries: [any[], T][] = [];\n\n\t\tconst getKeys = (map: Map, keys: any[] = []) => {\n\t\t\tmap.forEach((value, key) => {\n\t\t\t\tif (key === this._key) {\n\t\t\t\t\tfinalEntries.push([keys, value]);\n\t\t\t\t} else {\n\t\t\t\t\tconst nextKeys = [...keys, key];\n\t\t\t\t\tgetKeys(value, nextKeys);\n\t\t\t\t}\n\t\t\t});\n\t\t};\n\n\t\tgetKeys(this._map);\n\t\treturn new ShimIterator<[any[], T]>(finalEntries);\n\t}\n\n\t/**\n\t * Executes a given function for each map entry. The function\n\t * is invoked with three arguments: the element value, the\n\t * element key, and the associated Map instance.\n\t *\n\t * @param callback The function to execute for each map entry,\n\t * @param context The value to use for `this` for each execution of the calback\n\t */\n\tforEach(callback: (value: T, key: any[], mapInstance: MultiMap) => any, context?: {}): void {\n\t\tconst entries = this.entries();\n\n\t\tfor (const value of entries) {\n\t\t\tcallback.call(context, value[1], value[0], this);\n\t\t}\n\t}\n\n\t/**\n\t * Deletes all keys and their associated values.\n\t */\n\tclear(): void {\n\t\tthis._map.clear();\n\t}\n\n\t[Symbol.iterator](): IterableIterator<[any[], T]> {\n\t\treturn this.entries();\n\t}\n\n\t[Symbol.toStringTag] = 'MultiMap';\n}\n\nexport default MultiMap;\n"]} \ No newline at end of file diff --git a/deps/framework/core/Observable.d.ts b/deps/framework/core/Observable.d.ts deleted file mode 100644 index 0acdca3fc4..0000000000 --- a/deps/framework/core/Observable.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -import ObservableShim, { ObservableObject, Subscribable, SubscriptionObserver } from '../shim/Observable'; -import { Iterable } from '../shim/iterator'; -export default class Observable extends ObservableShim { - static of(...items: T[]): Observable; - static from(item: Iterable | ArrayLike | ObservableObject): Observable; - static defer(deferFunction: () => Subscribable): Observable; - toPromise(): Promise; - map(mapFunction: (x: T) => U): Observable; - filter(filterFunction: (x: T) => boolean): Observable; - toArray(): Observable; - mergeAll(concurrent: number): Observable; -} -export { Observable, Subscribable, SubscriptionObserver as Observer }; diff --git a/deps/framework/core/Observable.js b/deps/framework/core/Observable.js deleted file mode 100644 index afc2606c76..0000000000 --- a/deps/framework/core/Observable.js +++ /dev/null @@ -1,176 +0,0 @@ -(function (factory) { - if (typeof module === "object" && typeof module.exports === "object") { - var v = factory(require, exports); - if (v !== undefined) module.exports = v; - } - else if (typeof define === "function" && define.amd) { - define(["require", "exports", "tslib", "../shim/Observable", "../shim/Promise"], factory); - } -})(function (require, exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - var tslib_1 = require("tslib"); - var Observable_1 = require("../shim/Observable"); - var Promise_1 = require("../shim/Promise"); - function isSubscribable(object) { - return object && object.subscribe !== undefined; - } - var Observable = /** @class */ (function (_super) { - tslib_1.__extends(Observable, _super); - function Observable() { - return _super !== null && _super.apply(this, arguments) || this; - } - Observable.of = function () { - var items = []; - for (var _i = 0; _i < arguments.length; _i++) { - items[_i] = arguments[_i]; - } - return _super.of.apply(this, tslib_1.__spread(items)); - }; - Observable.from = function (item) { - return _super.from.call(this, item); - }; - Observable.defer = function (deferFunction) { - return new Observable(function (observer) { - var trueObservable = deferFunction(); - return trueObservable.subscribe({ - next: function (value) { - return observer.next(value); - }, - error: function (errorValue) { - return observer.error(errorValue); - }, - complete: function (completeValue) { - observer.complete(completeValue); - } - }); - }); - }; - Observable.prototype.toPromise = function () { - var _this = this; - return new Promise_1.default(function (resolve, reject) { - _this.subscribe({ - next: function (value) { - resolve(value); - }, - error: function (error) { - reject(error); - } - }); - }); - }; - Observable.prototype.map = function (mapFunction) { - var self = this; - if (typeof mapFunction !== 'function') { - throw new TypeError('Map parameter must be a function'); - } - return new Observable(function (observer) { - self.subscribe({ - next: function (value) { - try { - var result = mapFunction(value); - return observer.next(result); - } - catch (e) { - return observer.error(e); - } - }, - error: function (errorValue) { - return observer.error(errorValue); - }, - complete: function (completeValue) { - return observer.complete(completeValue); - } - }); - }); - }; - Observable.prototype.filter = function (filterFunction) { - var self = this; - if (typeof filterFunction !== 'function') { - throw new TypeError('Filter argument must be a function'); - } - return new Observable(function (observer) { - self.subscribe({ - next: function (value) { - try { - if (filterFunction(value)) { - return observer.next(value); - } - } - catch (e) { - return observer.error(e); - } - }, - error: function (errorValue) { - return observer.error(errorValue); - }, - complete: function (completeValue) { - return observer.complete(completeValue); - } - }); - }); - }; - Observable.prototype.toArray = function () { - var self = this; - return new Observable(function (observer) { - var values = []; - self.subscribe({ - next: function (value) { - values.push(value); - }, - error: function (errorValue) { - return observer.error(errorValue); - }, - complete: function (completeValue) { - observer.next(values); - observer.complete(completeValue); - } - }); - }); - }; - Observable.prototype.mergeAll = function (concurrent) { - var self = this; - return new Observable(function (observer) { - var active = []; - var queue = []; - function checkForComplete() { - if (active.length === 0 && queue.length === 0) { - observer.complete(); - } - else if (queue.length > 0 && active.length < concurrent) { - var item = queue.shift(); - if (isSubscribable(item)) { - var itemIndex_1 = active.length; - active.push(item); - item.subscribe({ - next: function (value) { - observer.next(value); - }, - complete: function () { - active.splice(itemIndex_1, 1); - checkForComplete(); - } - }); - } - else { - observer.next(item); - checkForComplete(); - } - } - } - self.subscribe({ - next: function (value) { - queue.push(value); - }, - complete: function () { - checkForComplete(); - } - }); - }); - }; - return Observable; - }(Observable_1.default)); - exports.Observable = Observable; - exports.default = Observable; -}); -//# sourceMappingURL=Observable.js.map \ No newline at end of file diff --git a/deps/framework/core/Observable.js.map b/deps/framework/core/Observable.js.map deleted file mode 100644 index b6e5ebf4a7..0000000000 --- a/deps/framework/core/Observable.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"Observable.js","sourceRoot":"","sources":["Observable.ts"],"names":[],"mappings":";;;;;;;;;;;;IAAA,iDAA0G;IAC1G,2CAAsC;IAGtC,wBAAwB,MAAW;QAClC,MAAM,CAAC,MAAM,IAAI,MAAM,CAAC,SAAS,KAAK,SAAS,CAAC;IACjD,CAAC;IAED;QAA2C,sCAAiB;QAA5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M,KAAK,CAAC,CAAC,CAAC,CAAC;wBAC/C,QAAQ,CAAC,QAAQ,EAAE,CAAC;oBACrB,CAAC;oBAAC,IAAI,CAAC,EAAE,CAAC,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,IAAI,MAAM,CAAC,MAAM,GAAG,UAAU,CAAC,CAAC,CAAC;wBAC3D,IAAM,IAAI,GAAG,KAAK,CAAC,KAAK,EAAE,CAAC;wBAE3B,EAAE,CAAC,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;4BAC1B,IAAM,WAAS,GAAG,MAAM,CAAC,MAAM,CAAC;4BAChC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;4BAElB,IAAI,CAAC,SAAS,CAAC;gCACd,IAAI,YAAC,KAAU;oCACd,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;gCACtB,CAAC;gCACD,QAAQ;oCACP,MAAM,CAAC,MAAM,CAAC,WAAS,EAAE,CAAC,CAAC,CAAC;oCAC5B,gBAAgB,EAAE,CAAC;gCACpB,CAAC;6BACD,CAAC,CAAC;wBACJ,CAAC;wBAAC,IAAI,CAAC,CAAC;4BACP,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;4BACpB,gBAAgB,EAAE,CAAC;wBACpB,CAAC;oBACF,CAAC;gBACF,CAAC;gBAED,IAAI,CAAC,SAAS,CAAC;oBACd,IAAI,YAAC,KAAQ;wBACZ,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;oBACnB,CAAC;oBACD,QAAQ;wBACP,gBAAgB,EAAE,CAAC;oBACpB,CAAC;iBACD,CAAC,CAAC;YACJ,CAAC,CAAC,CAAC;QACJ,CAAC;QACF,iBAAC;IAAD,CAAC,AA/JD,CAA2C,oBAAc,GA+JxD;IAGQ,gCAAU","sourcesContent":["import ObservableShim, { ObservableObject, Subscribable, SubscriptionObserver } from '../shim/Observable';\nimport Promise from '../shim/Promise';\nimport { Iterable } from '../shim/iterator';\n\nfunction isSubscribable(object: any): object is Subscribable {\n\treturn object && object.subscribe !== undefined;\n}\n\nexport default class Observable extends ObservableShim {\n\tstatic of(...items: T[]): Observable {\n\t\treturn >super.of(...items);\n\t}\n\n\tstatic from(item: Iterable | ArrayLike | ObservableObject): Observable {\n\t\treturn >super.from(item);\n\t}\n\n\tstatic defer(deferFunction: () => Subscribable): Observable {\n\t\treturn new Observable((observer) => {\n\t\t\tconst trueObservable = deferFunction();\n\n\t\t\treturn trueObservable.subscribe({\n\t\t\t\tnext(value: T) {\n\t\t\t\t\treturn observer.next(value);\n\t\t\t\t},\n\t\t\t\terror(errorValue?: any) {\n\t\t\t\t\treturn observer.error(errorValue);\n\t\t\t\t},\n\t\t\t\tcomplete(completeValue?: any) {\n\t\t\t\t\tobserver.complete(completeValue);\n\t\t\t\t}\n\t\t\t});\n\t\t});\n\t}\n\n\ttoPromise(): Promise {\n\t\treturn new Promise((resolve, reject) => {\n\t\t\tthis.subscribe({\n\t\t\t\tnext(value: T) {\n\t\t\t\t\tresolve(value);\n\t\t\t\t},\n\t\t\t\terror(error: any) {\n\t\t\t\t\treject(error);\n\t\t\t\t}\n\t\t\t});\n\t\t});\n\t}\n\n\tmap(mapFunction: (x: T) => U): Observable {\n\t\tconst self = this;\n\n\t\tif (typeof mapFunction !== 'function') {\n\t\t\tthrow new TypeError('Map parameter must be a function');\n\t\t}\n\n\t\treturn new Observable((observer: SubscriptionObserver) => {\n\t\t\tself.subscribe({\n\t\t\t\tnext(value: T) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tconst result: U = mapFunction(value);\n\t\t\t\t\t\treturn observer.next(result);\n\t\t\t\t\t} catch (e) {\n\t\t\t\t\t\treturn observer.error(e);\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\terror(errorValue?: any) {\n\t\t\t\t\treturn observer.error(errorValue);\n\t\t\t\t},\n\t\t\t\tcomplete(completeValue?: any) {\n\t\t\t\t\treturn observer.complete(completeValue);\n\t\t\t\t}\n\t\t\t});\n\t\t});\n\t}\n\n\tfilter(filterFunction: (x: T) => boolean): Observable {\n\t\tconst self = this;\n\n\t\tif (typeof filterFunction !== 'function') {\n\t\t\tthrow new TypeError('Filter argument must be a function');\n\t\t}\n\n\t\treturn new Observable((observer: SubscriptionObserver) => {\n\t\t\tself.subscribe({\n\t\t\t\tnext(value: T) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tif (filterFunction(value)) {\n\t\t\t\t\t\t\treturn observer.next(value);\n\t\t\t\t\t\t}\n\t\t\t\t\t} catch (e) {\n\t\t\t\t\t\treturn observer.error(e);\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\terror(errorValue?: any) {\n\t\t\t\t\treturn observer.error(errorValue);\n\t\t\t\t},\n\t\t\t\tcomplete(completeValue?: any) {\n\t\t\t\t\treturn observer.complete(completeValue);\n\t\t\t\t}\n\t\t\t});\n\t\t});\n\t}\n\n\ttoArray(): Observable {\n\t\tconst self = this;\n\n\t\treturn new Observable((observer) => {\n\t\t\tconst values: T[] = [];\n\n\t\t\tself.subscribe({\n\t\t\t\tnext(value: T) {\n\t\t\t\t\tvalues.push(value);\n\t\t\t\t},\n\t\t\t\terror(errorValue?: any) {\n\t\t\t\t\treturn observer.error(errorValue);\n\t\t\t\t},\n\t\t\t\tcomplete(completeValue?: any) {\n\t\t\t\t\tobserver.next(values);\n\t\t\t\t\tobserver.complete(completeValue);\n\t\t\t\t}\n\t\t\t});\n\t\t});\n\t}\n\n\tmergeAll(concurrent: number): Observable {\n\t\tconst self = this;\n\n\t\treturn new Observable>((observer) => {\n\t\t\tlet active: any[] = [];\n\t\t\tlet queue: any[] = [];\n\n\t\t\tfunction checkForComplete() {\n\t\t\t\tif (active.length === 0 && queue.length === 0) {\n\t\t\t\t\tobserver.complete();\n\t\t\t\t} else if (queue.length > 0 && active.length < concurrent) {\n\t\t\t\t\tconst item = queue.shift();\n\n\t\t\t\t\tif (isSubscribable(item)) {\n\t\t\t\t\t\tconst itemIndex = active.length;\n\t\t\t\t\t\tactive.push(item);\n\n\t\t\t\t\t\titem.subscribe({\n\t\t\t\t\t\t\tnext(value: any) {\n\t\t\t\t\t\t\t\tobserver.next(value);\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tcomplete() {\n\t\t\t\t\t\t\t\tactive.splice(itemIndex, 1);\n\t\t\t\t\t\t\t\tcheckForComplete();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\t\t\t\t\t} else {\n\t\t\t\t\t\tobserver.next(item);\n\t\t\t\t\t\tcheckForComplete();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tself.subscribe({\n\t\t\t\tnext(value: T) {\n\t\t\t\t\tqueue.push(value);\n\t\t\t\t},\n\t\t\t\tcomplete() {\n\t\t\t\t\tcheckForComplete();\n\t\t\t\t}\n\t\t\t});\n\t\t});\n\t}\n}\n\n// for convienence, re-export some interfaces from shim\nexport { Observable, Subscribable, SubscriptionObserver as Observer };\n"]} \ No newline at end of file diff --git a/deps/framework/core/Observable.mjs b/deps/framework/core/Observable.mjs deleted file mode 100644 index a9bb9e61d8..0000000000 --- a/deps/framework/core/Observable.mjs +++ /dev/null @@ -1,153 +0,0 @@ -import ObservableShim from '../shim/Observable'; -import Promise from '../shim/Promise'; -function isSubscribable(object) { - return object && object.subscribe !== undefined; -} -export default class Observable extends ObservableShim { - static of(...items) { - return super.of(...items); - } - static from(item) { - return super.from(item); - } - static defer(deferFunction) { - return new Observable((observer) => { - const trueObservable = deferFunction(); - return trueObservable.subscribe({ - next(value) { - return observer.next(value); - }, - error(errorValue) { - return observer.error(errorValue); - }, - complete(completeValue) { - observer.complete(completeValue); - } - }); - }); - } - toPromise() { - return new Promise((resolve, reject) => { - this.subscribe({ - next(value) { - resolve(value); - }, - error(error) { - reject(error); - } - }); - }); - } - map(mapFunction) { - const self = this; - if (typeof mapFunction !== 'function') { - throw new TypeError('Map parameter must be a function'); - } - return new Observable((observer) => { - self.subscribe({ - next(value) { - try { - const result = mapFunction(value); - return observer.next(result); - } - catch (e) { - return observer.error(e); - } - }, - error(errorValue) { - return observer.error(errorValue); - }, - complete(completeValue) { - return observer.complete(completeValue); - } - }); - }); - } - filter(filterFunction) { - const self = this; - if (typeof filterFunction !== 'function') { - throw new TypeError('Filter argument must be a function'); - } - return new Observable((observer) => { - self.subscribe({ - next(value) { - try { - if (filterFunction(value)) { - return observer.next(value); - } - } - catch (e) { - return observer.error(e); - } - }, - error(errorValue) { - return observer.error(errorValue); - }, - complete(completeValue) { - return observer.complete(completeValue); - } - }); - }); - } - toArray() { - const self = this; - return new Observable((observer) => { - const values = []; - self.subscribe({ - next(value) { - values.push(value); - }, - error(errorValue) { - return observer.error(errorValue); - }, - complete(completeValue) { - observer.next(values); - observer.complete(completeValue); - } - }); - }); - } - mergeAll(concurrent) { - const self = this; - return new Observable((observer) => { - let active = []; - let queue = []; - function checkForComplete() { - if (active.length === 0 && queue.length === 0) { - observer.complete(); - } - else if (queue.length > 0 && active.length < concurrent) { - const item = queue.shift(); - if (isSubscribable(item)) { - const itemIndex = active.length; - active.push(item); - item.subscribe({ - next(value) { - observer.next(value); - }, - complete() { - active.splice(itemIndex, 1); - checkForComplete(); - } - }); - } - else { - observer.next(item); - checkForComplete(); - } - } - } - self.subscribe({ - next(value) { - queue.push(value); - }, - complete() { - checkForComplete(); - } - }); - }); - } -} -// for convienence, re-export some interfaces from shim -export { Observable }; -//# sourceMappingURL=Observable.mjs.map \ No newline at end of file diff --git a/deps/framework/core/Observable.mjs.map b/deps/framework/core/Observable.mjs.map deleted file mode 100644 index bf1ae473aa..0000000000 --- a/deps/framework/core/Observable.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"Observable.mjs","sourceRoot":"","sources":["Observable.ts"],"names":[],"mappings":"AAAA,OAAO,cAAwE,MAAM,oBAAoB,CAAC;AAC1G,OAAO,OAAO,MAAM,iBAAiB,CAAC;AAGtC,wBAAwB,MAAW;IAClC,MAAM,CAAC,MAA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im/Observable';\nimport Promise from '../shim/Promise';\nimport { Iterable } from '../shim/iterator';\n\nfunction isSubscribable(object: any): object is Subscribable {\n\treturn object && object.subscribe !== undefined;\n}\n\nexport default class Observable extends ObservableShim {\n\tstatic of(...items: T[]): Observable {\n\t\treturn >super.of(...items);\n\t}\n\n\tstatic from(item: Iterable | ArrayLike | ObservableObject): Observable {\n\t\treturn >super.from(item);\n\t}\n\n\tstatic defer(deferFunction: () => Subscribable): Observable {\n\t\treturn new Observable((observer) => {\n\t\t\tconst trueObservable = deferFunction();\n\n\t\t\treturn trueObservable.subscribe({\n\t\t\t\tnext(value: T) {\n\t\t\t\t\treturn observer.next(value);\n\t\t\t\t},\n\t\t\t\terror(errorValue?: any) {\n\t\t\t\t\treturn observer.error(errorValue);\n\t\t\t\t},\n\t\t\t\tcomplete(completeValue?: any) {\n\t\t\t\t\tobserver.complete(completeValue);\n\t\t\t\t}\n\t\t\t});\n\t\t});\n\t}\n\n\ttoPromise(): Promise {\n\t\treturn new Promise((resolve, reject) => {\n\t\t\tthis.subscribe({\n\t\t\t\tnext(value: T) {\n\t\t\t\t\tresolve(value);\n\t\t\t\t},\n\t\t\t\terror(error: any) {\n\t\t\t\t\treject(error);\n\t\t\t\t}\n\t\t\t});\n\t\t});\n\t}\n\n\tmap(mapFunction: (x: T) => U): Observable {\n\t\tconst self = this;\n\n\t\tif (typeof mapFunction !== 'function') {\n\t\t\tthrow new TypeError('Map parameter must be a function');\n\t\t}\n\n\t\treturn new Observable((observer: SubscriptionObserver) => {\n\t\t\tself.subscribe({\n\t\t\t\tnext(value: T) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tconst result: U = mapFunction(value);\n\t\t\t\t\t\treturn observer.next(result);\n\t\t\t\t\t} catch (e) {\n\t\t\t\t\t\treturn observer.error(e);\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\terror(errorValue?: any) {\n\t\t\t\t\treturn observer.error(errorValue);\n\t\t\t\t},\n\t\t\t\tcomplete(completeValue?: any) {\n\t\t\t\t\treturn observer.complete(completeValue);\n\t\t\t\t}\n\t\t\t});\n\t\t});\n\t}\n\n\tfilter(filterFunction: (x: T) => boolean): Observable {\n\t\tconst self = this;\n\n\t\tif (typeof filterFunction !== 'function') {\n\t\t\tthrow new TypeError('Filter argument must be a function');\n\t\t}\n\n\t\treturn new Observable((observer: SubscriptionObserver) => {\n\t\t\tself.subscribe({\n\t\t\t\tnext(value: T) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tif (filterFunction(value)) {\n\t\t\t\t\t\t\treturn observer.next(value);\n\t\t\t\t\t\t}\n\t\t\t\t\t} catch (e) {\n\t\t\t\t\t\treturn observer.error(e);\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\terror(errorValue?: any) {\n\t\t\t\t\treturn observer.error(errorValue);\n\t\t\t\t},\n\t\t\t\tcomplete(completeValue?: any) {\n\t\t\t\t\treturn observer.complete(completeValue);\n\t\t\t\t}\n\t\t\t});\n\t\t});\n\t}\n\n\ttoArray(): Observable {\n\t\tconst self = this;\n\n\t\treturn new Observable((observer) => {\n\t\t\tconst values: T[] = [];\n\n\t\t\tself.subscribe({\n\t\t\t\tnext(value: T) {\n\t\t\t\t\tvalues.push(value);\n\t\t\t\t},\n\t\t\t\terror(errorValue?: any) {\n\t\t\t\t\treturn observer.error(errorValue);\n\t\t\t\t},\n\t\t\t\tcomplete(completeValue?: any) {\n\t\t\t\t\tobserver.next(values);\n\t\t\t\t\tobserver.complete(completeValue);\n\t\t\t\t}\n\t\t\t});\n\t\t});\n\t}\n\n\tmergeAll(concurrent: number): Observable {\n\t\tconst self = this;\n\n\t\treturn new Observable>((observer) => {\n\t\t\tlet active: any[] = [];\n\t\t\tlet queue: any[] = [];\n\n\t\t\tfunction checkForComplete() {\n\t\t\t\tif (active.length === 0 && queue.length === 0) {\n\t\t\t\t\tobserver.complete();\n\t\t\t\t} else if (queue.length > 0 && active.length < concurrent) {\n\t\t\t\t\tconst item = queue.shift();\n\n\t\t\t\t\tif (isSubscribable(item)) {\n\t\t\t\t\t\tconst itemIndex = active.length;\n\t\t\t\t\t\tactive.push(item);\n\n\t\t\t\t\t\titem.subscribe({\n\t\t\t\t\t\t\tnext(value: any) {\n\t\t\t\t\t\t\t\tobserver.next(value);\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tcomplete() {\n\t\t\t\t\t\t\t\tactive.splice(itemIndex, 1);\n\t\t\t\t\t\t\t\tcheckForComplete();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\t\t\t\t\t} else {\n\t\t\t\t\t\tobserver.next(item);\n\t\t\t\t\t\tcheckForComplete();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tself.subscribe({\n\t\t\t\tnext(value: T) {\n\t\t\t\t\tqueue.push(value);\n\t\t\t\t},\n\t\t\t\tcomplete() {\n\t\t\t\t\tcheckForComplete();\n\t\t\t\t}\n\t\t\t});\n\t\t});\n\t}\n}\n\n// for convienence, re-export some interfaces from shim\nexport { Observable, Subscribable, SubscriptionObserver as Observer };\n"]} \ No newline at end of file diff --git a/deps/framework/core/QueuingEvented.d.ts b/deps/framework/core/QueuingEvented.d.ts deleted file mode 100644 index d3522e3f80..0000000000 --- a/deps/framework/core/QueuingEvented.d.ts +++ /dev/null @@ -1,18 +0,0 @@ -import { Handle, EventObject, EventType } from './interfaces'; -import Evented, { CustomEventTypes, EventedCallbackOrArray } from './Evented'; -/** - * An implementation of the Evented class that queues up events when no listeners are - * listening. When a listener is subscribed, the queue will be published to the listener. - * When the queue is full, the oldest events will be discarded to make room for the newest ones. - * - * @property maxEvents The number of events to queue before old events are discarded. If zero (default), an unlimited number of events is queued. - */ -declare class QueuingEvented = EventObject> extends Evented { - private _queue; - maxEvents: number; - emit(event: M[K]): void; - emit(event: O): void; - on(type: K, listener: EventedCallbackOrArray): Handle; - on(type: T, listener: EventedCallbackOrArray): Handle; -} -export default QueuingEvented; diff --git a/deps/framework/core/QueuingEvented.js b/deps/framework/core/QueuingEvented.js deleted file mode 100644 index 2d9f294ded..0000000000 --- a/deps/framework/core/QueuingEvented.js +++ /dev/null @@ -1,70 +0,0 @@ -(function (factory) { - if (typeof module === "object" && typeof module.exports === "object") { - var v = factory(require, exports); - if (v !== undefined) module.exports = v; - } - else if (typeof define === "function" && define.amd) { - define(["require", "exports", "tslib", "../shim/Map", "./Evented"], factory); - } -})(function (require, exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - var tslib_1 = require("tslib"); - var Map_1 = require("../shim/Map"); - var Evented_1 = require("./Evented"); - /** - * An implementation of the Evented class that queues up events when no listeners are - * listening. When a listener is subscribed, the queue will be published to the listener. - * When the queue is full, the oldest events will be discarded to make room for the newest ones. - * - * @property maxEvents The number of events to queue before old events are discarded. If zero (default), an unlimited number of events is queued. - */ - var QueuingEvented = /** @class */ (function (_super) { - tslib_1.__extends(QueuingEvented, _super); - function QueuingEvented() { - var _this = _super !== null && _super.apply(this, arguments) || this; - _this._queue = new Map_1.default(); - _this.maxEvents = 0; - return _this; - } - QueuingEvented.prototype.emit = function (event) { - _super.prototype.emit.call(this, event); - var hasMatch = false; - this.listenersMap.forEach(function (method, type) { - // Since `type` is generic, the compiler doesn't know what type it is and `isGlobMatch` requires `string | symbol` - if (Evented_1.isGlobMatch(type, event.type)) { - hasMatch = true; - } - }); - if (!hasMatch) { - var queue = this._queue.get(event.type); - if (!queue) { - queue = []; - this._queue.set(event.type, queue); - } - queue.push(event); - if (this.maxEvents > 0) { - while (queue.length > this.maxEvents) { - queue.shift(); - } - } - } - }; - QueuingEvented.prototype.on = function (type, listener) { - var _this = this; - var handle = _super.prototype.on.call(this, type, listener); - this.listenersMap.forEach(function (method, listenerType) { - _this._queue.forEach(function (events, queuedType) { - if (Evented_1.isGlobMatch(listenerType, queuedType)) { - events.forEach(function (event) { return _this.emit(event); }); - _this._queue.delete(queuedType); - } - }); - }); - return handle; - }; - return QueuingEvented; - }(Evented_1.default)); - exports.default = QueuingEvented; -}); -//# sourceMappingURL=QueuingEvented.js.map \ No newline at end of file diff --git a/deps/framework/core/QueuingEvented.js.map b/deps/framework/core/QueuingEvented.js.map deleted file mode 100644 index 9a53868aa4..0000000000 --- a/deps/framework/core/QueuingEvented.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"QueuingEvented.js","sourceRoot":"","sources":["QueuingEvented.ts"],"names":[],"mappings":";;;;;;;;;;;;IACA,mCAA8B;IAC9B,qCAA2F;IAE3F;;;;;;OAMG;IACH;QAIU,0CAAgB;QAJ1B;YAAA,qEAyDC;YApDQ,YAAM,GAAwC,IAAI,aAAG,EAAE,CAAC;YAEzD,eAAS,GAAG,CAAC,CAAC;;QAkDtB,CAAC;QA9CA,6BAAI,GAAJ,UAAK,KAAU;YACd,iBAAM,IAAI,YAAC,KAAK,CAAC,CAAC;YAElB,IAAI,QAAQ,GAAG,KAAK,CAAC;YAErB,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,UAAC,MAAM,EAAE,IAAI;gBACtC,kHAAkH;gBAClH,EAAE,CAAC,CAAC,qBAAW,CAAC,IAAW,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;oBAC1C,QAAQ,GAAG,IAAI,CAAC;gBACjB,CAAC;YACF,CAAC,CAAC,CAAC;YAEH,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC;gBACf,IAAI,KAAK,GAAG,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;gBAExC,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC;oBACZ,KAAK,GAAG,EAAE,CAAC;oBACX,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;gBACpC,CAAC;gBAED,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;gBAElB,EAAE,CAAC,CAAC,IAAI,CAAC,SAAS,GAAG,CAAC,CAAC,CAAC,CAAC;oBACxB,OAAO,KAAK,CAAC,MAAM,GAAG,IAAI,CAAC,SAAS,EAAE,CAAC;wBACtC,KAAK,CAAC,KAAK,EAAE,CAAC;oBACf,CAAC;gBACF,CAAC;YACF,CAAC;QACF,CAAC;QAID,2BAAE,GAAF,UAAG,IAAS,EAAE,QAA0C;YAAxD,iBAaC;YAZA,IAAI,MAAM,GAAG,iBAAM,EAAE,YAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;YAEtC,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,UAAC,MAAM,EAAE,YAAY;gBAC9C,KAAI,CAAC,MAAM,CAAC,OAAO,CAAC,UAAC,MAAM,EAAE,UAAU;oBACtC,EAAE,CAAC,CAAC,qBAAW,CAAC,YAAmB,EAAE,UAAU,CAAC,CAAC,CAAC,CAAC;wBAClD,MAAM,CAAC,OAAO,CAAC,UAAC,KAAK,IAAK,OAAA,KAAI,CAAC,IAAI,CAAC,KAAK,CAAC,EAAhB,CAAgB,CAAC,CAAC;wBAC5C,KAAI,CAAC,MAAM,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC;oBAChC,CAAC;gBACF,CAAC,CAAC,CAAC;YACJ,CAAC,CAAC,CAAC;YAEH,MAAM,CAAC,MAAM,CAAC;QACf,CAAC;QACF,qBAAC;IAAD,CAAC,AAzDD,CAIU,iBAAO,GAqDhB;IAED,kBAAe,cAAc,CAAC","sourcesContent":["import { Handle, EventObject, EventType } from './interfaces';\nimport Map from '../shim/Map';\nimport Evented, { CustomEventTypes, isGlobMatch, EventedCallbackOrArray } from './Evented';\n\n/**\n * An implementation of the Evented class that queues up events when no listeners are\n * listening. When a listener is subscribed, the queue will be published to the listener.\n * When the queue is full, the oldest events will be discarded to make room for the newest ones.\n *\n * @property maxEvents The number of events to queue before old events are discarded. If zero (default), an unlimited number of events is queued.\n */\nclass QueuingEvented<\n\tM extends CustomEventTypes = {},\n\tT = EventType,\n\tO extends EventObject = EventObject\n> extends Evented {\n\tprivate _queue: Map = new Map();\n\n\tpublic maxEvents = 0;\n\n\temit(event: M[K]): void;\n\temit(event: O): void;\n\temit(event: any): void {\n\t\tsuper.emit(event);\n\n\t\tlet hasMatch = false;\n\n\t\tthis.listenersMap.forEach((method, type) => {\n\t\t\t// Since `type` is generic, the compiler doesn't know what type it is and `isGlobMatch` requires `string | symbol`\n\t\t\tif (isGlobMatch(type as any, event.type)) {\n\t\t\t\thasMatch = true;\n\t\t\t}\n\t\t});\n\n\t\tif (!hasMatch) {\n\t\t\tlet queue = this._queue.get(event.type);\n\n\t\t\tif (!queue) {\n\t\t\t\tqueue = [];\n\t\t\t\tthis._queue.set(event.type, queue);\n\t\t\t}\n\n\t\t\tqueue.push(event);\n\n\t\t\tif (this.maxEvents > 0) {\n\t\t\t\twhile (queue.length > this.maxEvents) {\n\t\t\t\t\tqueue.shift();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\ton(type: K, listener: EventedCallbackOrArray): Handle;\n\ton(type: T, listener: EventedCallbackOrArray): Handle;\n\ton(type: any, listener: EventedCallbackOrArray): Handle {\n\t\tlet handle = super.on(type, listener);\n\n\t\tthis.listenersMap.forEach((method, listenerType) => {\n\t\t\tthis._queue.forEach((events, queuedType) => {\n\t\t\t\tif (isGlobMatch(listenerType as any, queuedType)) {\n\t\t\t\t\tevents.forEach((event) => this.emit(event));\n\t\t\t\t\tthis._queue.delete(queuedType);\n\t\t\t\t}\n\t\t\t});\n\t\t});\n\n\t\treturn handle;\n\t}\n}\n\nexport default QueuingEvented;\n"]} \ No newline at end of file diff --git a/deps/framework/core/QueuingEvented.mjs b/deps/framework/core/QueuingEvented.mjs deleted file mode 100644 index 744453e97c..0000000000 --- a/deps/framework/core/QueuingEvented.mjs +++ /dev/null @@ -1,53 +0,0 @@ -import Map from '../shim/Map'; -import Evented, { isGlobMatch } from './Evented'; -/** - * An implementation of the Evented class that queues up events when no listeners are - * listening. When a listener is subscribed, the queue will be published to the listener. - * When the queue is full, the oldest events will be discarded to make room for the newest ones. - * - * @property maxEvents The number of events to queue before old events are discarded. If zero (default), an unlimited number of events is queued. - */ -class QueuingEvented extends Evented { - constructor() { - super(...arguments); - this._queue = new Map(); - this.maxEvents = 0; - } - emit(event) { - super.emit(event); - let hasMatch = false; - this.listenersMap.forEach((method, type) => { - // Since `type` is generic, the compiler doesn't know what type it is and `isGlobMatch` requires `string | symbol` - if (isGlobMatch(type, event.type)) { - hasMatch = true; - } - }); - if (!hasMatch) { - let queue = this._queue.get(event.type); - if (!queue) { - queue = []; - this._queue.set(event.type, queue); - } - queue.push(event); - if (this.maxEvents > 0) { - while (queue.length > this.maxEvents) { - queue.shift(); - } - } - } - } - on(type, listener) { - let handle = super.on(type, listener); - this.listenersMap.forEach((method, listenerType) => { - this._queue.forEach((events, queuedType) => { - if (isGlobMatch(listenerType, queuedType)) { - events.forEach((event) => this.emit(event)); - this._queue.delete(queuedType); - } - }); - }); - return handle; - } -} -export default QueuingEvented; -//# sourceMappingURL=QueuingEvented.mjs.map \ No newline at end of file diff --git a/deps/framework/core/QueuingEvented.mjs.map b/deps/framework/core/QueuingEvented.mjs.map deleted file mode 100644 index 1def2f6f42..0000000000 --- a/deps/framework/core/QueuingEvented.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"QueuingEvented.mjs","sourceRoot":"","sources":["QueuingEvented.ts"],"names":[],"mappings":"AACA,OAAO,GAAG,MAAM,aAAa,CAAC;AAC9B,OAAO,OAAO,EAAE,EAAoB,WAAW,EAA0B,MAAM,WAAW,CAAC;AAE3F;;;;;;GAMG;AACH,oBAIE,SAAQ,OAAgB;IAJ1B;;QAKS,WAAM,GAAwC,IAAI,GAAG,EAAE,CAAC;QAEzD,cAAS,GAAG,CAAC,CAAC;IAkDtB,CAAC;IA9CA,IAAI,CAAC,KAAU;QACd,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QAElB,IAAI,QAAQ,GAAG,KAAK,CAAC;QAErB,IAAI,CAAC,YAAY,CA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AAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC;oBAC5C,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC;gBAChC,CAAC;YACF,CAAC,CAAC,CAAC;QACJ,CAAC,CAAC,CAAC;QAEH,MAAM,CAAC,MAAM,CAAC;IACf,CAAC;CACD;AAED,eAAe,cAAc,CAAC","sourcesContent":["import { Handle, EventObject, EventType } from './interfaces';\nimport Map from '../shim/Map';\nimport Evented, { CustomEventTypes, isGlobMatch, EventedCallbackOrArray } from './Evented';\n\n/**\n * An implementation of the Evented class that queues up events when no listeners are\n * listening. When a listener is subscribed, the queue will be published to the listener.\n * When the queue is full, the oldest events will be discarded to make room for the newest ones.\n *\n * @property maxEvents The number of events to queue before old events are discarded. If zero (default), an unlimited number of events is queued.\n */\nclass QueuingEvented<\n\tM extends CustomEventTypes = {},\n\tT = EventType,\n\tO extends EventObject = EventObject\n> extends Evented {\n\tprivate _queue: Map = new Map();\n\n\tpublic maxEvents = 0;\n\n\temit(event: M[K]): void;\n\temit(event: O): void;\n\temit(event: any): void {\n\t\tsuper.emit(event);\n\n\t\tlet hasMatch = false;\n\n\t\tthis.listenersMap.forEach((method, type) => {\n\t\t\t// Since `type` is generic, the compiler doesn't know what type it is and `isGlobMatch` requires `string | symbol`\n\t\t\tif (isGlobMatch(type as any, event.type)) {\n\t\t\t\thasMatch = true;\n\t\t\t}\n\t\t});\n\n\t\tif (!hasMatch) {\n\t\t\tlet queue = this._queue.get(event.type);\n\n\t\t\tif (!queue) {\n\t\t\t\tqueue = [];\n\t\t\t\tthis._queue.set(event.type, queue);\n\t\t\t}\n\n\t\t\tqueue.push(event);\n\n\t\t\tif (this.maxEvents > 0) {\n\t\t\t\twhile (queue.length > this.maxEvents) {\n\t\t\t\t\tqueue.shift();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\ton(type: K, listener: EventedCallbackOrArray): Handle;\n\ton(type: T, listener: EventedCallbackOrArray): Handle;\n\ton(type: any, listener: EventedCallbackOrArray): Handle {\n\t\tlet handle = super.on(type, listener);\n\n\t\tthis.listenersMap.forEach((method, listenerType) => {\n\t\t\tthis._queue.forEach((events, queuedType) => {\n\t\t\t\tif (isGlobMatch(listenerType as any, queuedType)) {\n\t\t\t\t\tevents.forEach((event) => this.emit(event));\n\t\t\t\t\tthis._queue.delete(queuedType);\n\t\t\t\t}\n\t\t\t});\n\t\t});\n\n\t\treturn handle;\n\t}\n}\n\nexport default QueuingEvented;\n"]} \ No newline at end of file diff --git a/deps/framework/core/Scheduler.d.ts b/deps/framework/core/Scheduler.d.ts deleted file mode 100644 index c25f21cef7..0000000000 --- a/deps/framework/core/Scheduler.d.ts +++ /dev/null @@ -1,29 +0,0 @@ -import { Handle } from './interfaces'; -import { QueueItem } from './queue'; -export interface KwArgs { - deferWhileProcessing?: boolean; - queueFunction?: (callback: (...args: any[]) => any) => Handle; -} -export declare class Scheduler { - protected readonly _boundDispatch: () => void; - protected _deferred: QueueItem[] | null; - protected _isProcessing: boolean; - protected readonly _queue: QueueItem[]; - protected _task: Handle | null; - /** - * Determines whether any callbacks registered during should be added to the current batch (`false`) - * or deferred until the next batch (`true`, default). - */ - deferWhileProcessing: boolean | undefined; - /** - * Allows users to specify the function that should be used to schedule callbacks. - * If no function is provided, then `queueTask` will be used. - */ - queueFunction: (callback: (...args: any[]) => any) => Handle; - protected _defer(callback: (...args: any[]) => void): Handle; - protected _dispatch(): void; - protected _schedule(item: QueueItem): void; - constructor(kwArgs?: KwArgs); - schedule(callback: (...args: any[]) => void): Handle; -} -export default Scheduler; diff --git a/deps/framework/core/Scheduler.js b/deps/framework/core/Scheduler.js deleted file mode 100644 index 3e0da6d41d..0000000000 --- a/deps/framework/core/Scheduler.js +++ /dev/null @@ -1,88 +0,0 @@ -(function (factory) { - if (typeof module === "object" && typeof module.exports === "object") { - var v = factory(require, exports); - if (v !== undefined) module.exports = v; - } - else if (typeof define === "function" && define.amd) { - define(["require", "exports", "./queue"], factory); - } -})(function (require, exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - var queue_1 = require("./queue"); - function getQueueHandle(item) { - return { - destroy: function () { - this.destroy = function () { }; - item.isActive = false; - item.callback = null; - } - }; - } - var Scheduler = /** @class */ (function () { - function Scheduler(kwArgs) { - this._deferred = null; - this._task = null; - this.deferWhileProcessing = kwArgs && 'deferWhileProcessing' in kwArgs ? kwArgs.deferWhileProcessing : true; - this.queueFunction = kwArgs && kwArgs.queueFunction ? kwArgs.queueFunction : queue_1.queueTask; - this._boundDispatch = this._dispatch.bind(this); - this._isProcessing = false; - this._queue = []; - } - Scheduler.prototype._defer = function (callback) { - var item = { - isActive: true, - callback: callback - }; - if (!this._deferred) { - this._deferred = []; - } - this._deferred.push(item); - return getQueueHandle(item); - }; - Scheduler.prototype._dispatch = function () { - this._isProcessing = true; - if (this._task) { - this._task.destroy(); - this._task = null; - } - var queue = this._queue; - var item; - while ((item = queue.shift())) { - if (item.isActive && item.callback) { - item.callback(); - } - } - this._isProcessing = false; - var deferred = this._deferred; - if (deferred && deferred.length) { - this._deferred = null; - var item_1; - while ((item_1 = deferred.shift())) { - this._schedule(item_1); - } - } - }; - Scheduler.prototype._schedule = function (item) { - if (!this._task) { - this._task = this.queueFunction(this._boundDispatch); - } - this._queue.push(item); - }; - Scheduler.prototype.schedule = function (callback) { - if (this._isProcessing && this.deferWhileProcessing) { - return this._defer(callback); - } - var item = { - isActive: true, - callback: callback - }; - this._schedule(item); - return getQueueHandle(item); - }; - return Scheduler; - }()); - exports.Scheduler = Scheduler; - exports.default = Scheduler; -}); -//# sourceMappingURL=Scheduler.js.map \ No newline at end of file diff --git a/deps/framework/core/Scheduler.js.map b/deps/framework/core/Scheduler.js.map deleted file mode 100644 index 12eff5e0fa..0000000000 --- a/deps/framework/core/Scheduler.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"Scheduler.js","sourceRoot":"","sources":["Scheduler.ts"],"names":[],"mappings":";;;;;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;gBACrD,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;YAC9B,CAAC;YAED,IAAM,IAAI,GAAc;gBACvB,QAAQ,EAAE,IAAI;gBACd,QAAQ,EAAE,QAAQ;aAClB,CAAC;YAEF,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;YAErB,MAAM,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC;QAC7B,CAAC;QACF,gBAAC;IAAD,CAAC,AA9FD,IA8FC;IA9FY,8BAAS;IAgGtB,kBAAe,SAAS,CAAC","sourcesContent":["import { Handle } from './interfaces';\nimport { QueueItem, queueTask } from './queue';\n\nfunction getQueueHandle(item: QueueItem): Handle {\n\treturn {\n\t\tdestroy: function(this: Handle) {\n\t\t\tthis.destroy = function() {};\n\t\t\titem.isActive = false;\n\t\t\titem.callback = null;\n\t\t}\n\t};\n}\n\nexport interface KwArgs {\n\tdeferWhileProcessing?: boolean;\n\tqueueFunction?: (callback: (...args: any[]) => any) => Handle;\n}\n\nexport class Scheduler {\n\tprotected readonly _boundDispatch: () => void;\n\tprotected _deferred: QueueItem[] | null = null;\n\tprotected _isProcessing: boolean;\n\tprotected readonly _queue: QueueItem[];\n\tprotected _task: Handle | null = null;\n\n\t/**\n\t * Determines whether any callbacks registered during should be added to the current batch (`false`)\n\t * or deferred until the next batch (`true`, default).\n\t */\n\tdeferWhileProcessing: boolean | undefined;\n\n\t/**\n\t * Allows users to specify the function that should be used to schedule callbacks.\n\t * If no function is provided, then `queueTask` will be used.\n\t */\n\tqueueFunction: (callback: (...args: any[]) => any) => Handle;\n\n\tprotected _defer(callback: (...args: any[]) => void): Handle {\n\t\tconst item: QueueItem = {\n\t\t\tisActive: true,\n\t\t\tcallback: callback\n\t\t};\n\n\t\tif (!this._deferred) {\n\t\t\tthis._deferred = [];\n\t\t}\n\n\t\tthis._deferred.push(item);\n\n\t\treturn getQueueHandle(item);\n\t}\n\n\tprotected _dispatch(): void {\n\t\tthis._isProcessing = true;\n\t\tif (this._task) {\n\t\t\tthis._task.destroy();\n\t\t\tthis._task = null;\n\t\t}\n\n\t\tconst queue = this._queue;\n\t\tlet item: QueueItem | undefined;\n\n\t\twhile ((item = queue.shift())) {\n\t\t\tif (item.isActive && item.callback) {\n\t\t\t\titem.callback();\n\t\t\t}\n\t\t}\n\n\t\tthis._isProcessing = false;\n\n\t\tlet deferred: QueueItem[] | null = this._deferred;\n\t\tif (deferred && deferred.length) {\n\t\t\tthis._deferred = null;\n\n\t\t\tlet item: QueueItem | undefined;\n\t\t\twhile ((item = deferred.shift())) {\n\t\t\t\tthis._schedule(item);\n\t\t\t}\n\t\t}\n\t}\n\n\tprotected _schedule(item: QueueItem): void {\n\t\tif (!this._task) {\n\t\t\tthis._task = this.queueFunction(this._boundDispatch);\n\t\t}\n\n\t\tthis._queue.push(item);\n\t}\n\n\tconstructor(kwArgs?: KwArgs) {\n\t\tthis.deferWhileProcessing = kwArgs && 'deferWhileProcessing' in kwArgs ? kwArgs.deferWhileProcessing : true;\n\t\tthis.queueFunction = kwArgs && kwArgs.queueFunction ? kwArgs.queueFunction : queueTask;\n\n\t\tthis._boundDispatch = this._dispatch.bind(this);\n\t\tthis._isProcessing = false;\n\t\tthis._queue = [];\n\t}\n\n\tschedule(callback: (...args: any[]) => void): Handle {\n\t\tif (this._isProcessing && this.deferWhileProcessing) {\n\t\t\treturn this._defer(callback);\n\t\t}\n\n\t\tconst item: QueueItem = {\n\t\t\tisActive: true,\n\t\t\tcallback: callback\n\t\t};\n\n\t\tthis._schedule(item);\n\n\t\treturn getQueueHandle(item);\n\t}\n}\n\nexport default Scheduler;\n"]} \ No newline at end of file diff --git a/deps/framework/core/Scheduler.mjs b/deps/framework/core/Scheduler.mjs deleted file mode 100644 index 05bdb4fea6..0000000000 --- a/deps/framework/core/Scheduler.mjs +++ /dev/null @@ -1,74 +0,0 @@ -import { queueTask } from './queue'; -function getQueueHandle(item) { - return { - destroy: function () { - this.destroy = function () { }; - item.isActive = false; - item.callback = null; - } - }; -} -export class Scheduler { - constructor(kwArgs) { - this._deferred = null; - this._task = null; - this.deferWhileProcessing = kwArgs && 'deferWhileProcessing' in kwArgs ? kwArgs.deferWhileProcessing : true; - this.queueFunction = kwArgs && kwArgs.queueFunction ? kwArgs.queueFunction : queueTask; - this._boundDispatch = this._dispatch.bind(this); - this._isProcessing = false; - this._queue = []; - } - _defer(callback) { - const item = { - isActive: true, - callback: callback - }; - if (!this._deferred) { - this._deferred = []; - } - this._deferred.push(item); - return getQueueHandle(item); - } - _dispatch() { - this._isProcessing = true; - if (this._task) { - this._task.destroy(); - this._task = null; - } - const queue = this._queue; - let item; - while ((item = queue.shift())) { - if (item.isActive && item.callback) { - item.callback(); - } - } - this._isProcessing = false; - let deferred = this._deferred; - if (deferred && deferred.length) { - this._deferred = null; - let item; - while ((item = deferred.shift())) { - this._schedule(item); - } - } - } - _schedule(item) { - if (!this._task) { - this._task = this.queueFunction(this._boundDispatch); - } - this._queue.push(item); - } - schedule(callback) { - if (this._isProcessing && this.deferWhileProcessing) { - return this._defer(callback); - } - const item = { - isActive: true, - callback: callback - }; - this._schedule(item); - return getQueueHandle(item); - } -} -export default Scheduler; -//# sourceMappingURL=Scheduler.mjs.map \ No newline at end of file diff --git a/deps/framework/core/Scheduler.mjs.map b/deps/framework/core/Scheduler.mjs.map deleted file mode 100644 index 42750d6d6c..0000000000 --- a/deps/framework/core/Scheduler.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"Scheduler.mjs","sourceRoot":"","sources":["Scheduler.ts"],"names":[],"mappings":"AACA,OAAO,EAAa,SAAS,EAAE,MAAM,SAAS,CAAC;AAE/C,wBAAwB,IAAe;IACtC,MAAM,CAAC;QACN,OAAO,EAAE;YACR,IAAI,CAAC,OAAO,GAAG,cAAY,CAAC,CAAC;YAC7B,IAAI,CAAC,QAAQ,GAAG,KAAK,CAAC;YACtB,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC;QACtB,CAAC;KACD,CA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,eAAe,SAAS,CAAC","sourcesContent":["import { Handle } from './interfaces';\nimport { QueueItem, queueTask } from './queue';\n\nfunction getQueueHandle(item: QueueItem): Handle {\n\treturn {\n\t\tdestroy: function(this: Handle) {\n\t\t\tthis.destroy = function() {};\n\t\t\titem.isActive = false;\n\t\t\titem.callback = null;\n\t\t}\n\t};\n}\n\nexport interface KwArgs {\n\tdeferWhileProcessing?: boolean;\n\tqueueFunction?: (callback: (...args: any[]) => any) => Handle;\n}\n\nexport class Scheduler {\n\tprotected readonly _boundDispatch: () => void;\n\tprotected _deferred: QueueItem[] | null = null;\n\tprotected _isProcessing: boolean;\n\tprotected readonly _queue: QueueItem[];\n\tprotected _task: Handle | null = null;\n\n\t/**\n\t * Determines whether any callbacks registered during should be added to the current batch (`false`)\n\t * or deferred until the next batch (`true`, default).\n\t */\n\tdeferWhileProcessing: boolean | undefined;\n\n\t/**\n\t * Allows users to specify the function that should be used to schedule callbacks.\n\t * If no function is provided, then `queueTask` will be used.\n\t */\n\tqueueFunction: (callback: (...args: any[]) => any) => Handle;\n\n\tprotected _defer(callback: (...args: any[]) => void): Handle {\n\t\tconst item: QueueItem = {\n\t\t\tisActive: true,\n\t\t\tcallback: callback\n\t\t};\n\n\t\tif (!this._deferred) {\n\t\t\tthis._deferred = [];\n\t\t}\n\n\t\tthis._deferred.push(item);\n\n\t\treturn getQueueHandle(item);\n\t}\n\n\tprotected _dispatch(): void {\n\t\tthis._isProcessing = true;\n\t\tif (this._task) {\n\t\t\tthis._task.destroy();\n\t\t\tthis._task = null;\n\t\t}\n\n\t\tconst queue = this._queue;\n\t\tlet item: QueueItem | undefined;\n\n\t\twhile ((item = queue.shift())) {\n\t\t\tif (item.isActive && item.callback) {\n\t\t\t\titem.callback();\n\t\t\t}\n\t\t}\n\n\t\tthis._isProcessing = false;\n\n\t\tlet deferred: QueueItem[] | null = this._deferred;\n\t\tif (deferred && deferred.length) {\n\t\t\tthis._deferred = null;\n\n\t\t\tlet item: QueueItem | undefined;\n\t\t\twhile ((item = deferred.shift())) {\n\t\t\t\tthis._schedule(item);\n\t\t\t}\n\t\t}\n\t}\n\n\tprotected _schedule(item: QueueItem): void {\n\t\tif (!this._task) {\n\t\t\tthis._task = this.queueFunction(this._boundDispatch);\n\t\t}\n\n\t\tthis._queue.push(item);\n\t}\n\n\tconstructor(kwArgs?: KwArgs) {\n\t\tthis.deferWhileProcessing = kwArgs && 'deferWhileProcessing' in kwArgs ? kwArgs.deferWhileProcessing : true;\n\t\tthis.queueFunction = kwArgs && kwArgs.queueFunction ? kwArgs.queueFunction : queueTask;\n\n\t\tthis._boundDispatch = this._dispatch.bind(this);\n\t\tthis._isProcessing = false;\n\t\tthis._queue = [];\n\t}\n\n\tschedule(callback: (...args: any[]) => void): Handle {\n\t\tif (this._isProcessing && this.deferWhileProcessing) {\n\t\t\treturn this._defer(callback);\n\t\t}\n\n\t\tconst item: QueueItem = {\n\t\t\tisActive: true,\n\t\t\tcallback: callback\n\t\t};\n\n\t\tthis._schedule(item);\n\n\t\treturn getQueueHandle(item);\n\t}\n}\n\nexport default Scheduler;\n"]} \ No newline at end of file diff --git a/deps/framework/core/UrlSearchParams.d.ts b/deps/framework/core/UrlSearchParams.d.ts deleted file mode 100644 index da8c29c8ae..0000000000 --- a/deps/framework/core/UrlSearchParams.d.ts +++ /dev/null @@ -1,65 +0,0 @@ -import { Hash } from './interfaces'; -/** - * Object with string keys and string or string array values that describes a query string. - */ -export declare type ParamList = Hash; -/** - * Represents a set of URL query search parameters. - */ -export declare class UrlSearchParams { - /** - * Constructs a new UrlSearchParams from a query string, an object of parameters and values, or another - * UrlSearchParams. - */ - constructor(input?: string | ParamList | UrlSearchParams); - /** - * Maps property keys to arrays of values. The value for any property that has been set will be an array containing - * at least one item. Properties that have been deleted will have a value of 'undefined'. - */ - protected readonly _list: Hash; - /** - * Appends a new value to the set of values for a key. - * @param key The key to add a value for - * @param value The value to add - */ - append(key: string, value: string): void; - /** - * Deletes all values for a key. - * @param key The key whose values are to be removed - */ - delete(key: string): void; - /** - * Returns the first value associated with a key. - * @param key The key to return the first value for - * @return The first string value for the key - */ - get(key: string): string | undefined; - /** - * Returns all the values associated with a key. - * @param key The key to return all values for - * @return An array of strings containing all values for the key - */ - getAll(key: string): string[] | undefined; - /** - * Returns true if a key has been set to any value, false otherwise. - * @param key The key to test for existence - * @return A boolean indicating if the key has been set - */ - has(key: string): boolean; - /** - * Returns an array of all keys which have been set. - * @return An array of strings containing all keys set in the UrlSearchParams instance - */ - keys(): string[]; - /** - * Sets the value associated with a key. - * @param key The key to set the value of - */ - set(key: string, value: string): void; - /** - * Returns this object's data as an encoded query string. - * @return A string in application/x-www-form-urlencoded format containing all of the set keys/values - */ - toString(): string; -} -export default UrlSearchParams; diff --git a/deps/framework/core/UrlSearchParams.js b/deps/framework/core/UrlSearchParams.js deleted file mode 100644 index 9f4b53c1ab..0000000000 --- a/deps/framework/core/UrlSearchParams.js +++ /dev/null @@ -1,180 +0,0 @@ -(function (factory) { - if (typeof module === "object" && typeof module.exports === "object") { - var v = factory(require, exports); - if (v !== undefined) module.exports = v; - } - else if (typeof define === "function" && define.amd) { - define(["require", "exports", "./lang"], factory); - } -})(function (require, exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - var lang_1 = require("./lang"); - /** - * Parses a query string, returning a ParamList object. - */ - function parseQueryString(input) { - var query = {}; - var splits = input.split('&'); - for (var i = 0; i < splits.length; i++) { - var entry = splits[i]; - var indexOfFirstEquals = entry.indexOf('='); - var key = void 0; - var value = ''; - if (indexOfFirstEquals >= 0) { - key = entry.slice(0, indexOfFirstEquals); - value = entry.slice(indexOfFirstEquals + 1); - } - else { - key = entry; - } - key = key ? decodeURIComponent(key) : ''; - value = value ? decodeURIComponent(value) : ''; - if (key in query) { - query[key].push(value); - } - else { - query[key] = [value]; - } - } - return query; - } - /** - * Represents a set of URL query search parameters. - */ - var UrlSearchParams = /** @class */ (function () { - /** - * Constructs a new UrlSearchParams from a query string, an object of parameters and values, or another - * UrlSearchParams. - */ - function UrlSearchParams(input) { - var list = {}; - if (input instanceof UrlSearchParams) { - // Copy the incoming UrlSearchParam's internal list - list = lang_1.duplicate(input._list); - } - else if (typeof input === 'object') { - // Copy the incoming object, assuming its property values are either arrays or strings - list = {}; - for (var key in input) { - var value = input[key]; - if (Array.isArray(value)) { - list[key] = value.length ? value.slice() : ['']; - } - else if (value == null) { - list[key] = ['']; - } - else { - list[key] = [value]; - } - } - } - else if (typeof input === 'string') { - // Parse the incoming string as a query string - list = parseQueryString(input); - } - this._list = list; - } - /** - * Appends a new value to the set of values for a key. - * @param key The key to add a value for - * @param value The value to add - */ - UrlSearchParams.prototype.append = function (key, value) { - if (!this.has(key)) { - this.set(key, value); - } - else { - var values = this._list[key]; - if (values) { - values.push(value); - } - } - }; - /** - * Deletes all values for a key. - * @param key The key whose values are to be removed - */ - UrlSearchParams.prototype.delete = function (key) { - // Set to undefined rather than deleting the key, for better consistency across browsers. - // If a deleted key is re-added, most browsers put it at the end of iteration order, but IE maintains - // its original position. This approach maintains the original position everywhere. - this._list[key] = undefined; - }; - /** - * Returns the first value associated with a key. - * @param key The key to return the first value for - * @return The first string value for the key - */ - UrlSearchParams.prototype.get = function (key) { - if (!this.has(key)) { - return undefined; - } - var value = this._list[key]; - return value ? value[0] : undefined; - }; - /** - * Returns all the values associated with a key. - * @param key The key to return all values for - * @return An array of strings containing all values for the key - */ - UrlSearchParams.prototype.getAll = function (key) { - if (!this.has(key)) { - return undefined; - } - return this._list[key]; - }; - /** - * Returns true if a key has been set to any value, false otherwise. - * @param key The key to test for existence - * @return A boolean indicating if the key has been set - */ - UrlSearchParams.prototype.has = function (key) { - return Array.isArray(this._list[key]); - }; - /** - * Returns an array of all keys which have been set. - * @return An array of strings containing all keys set in the UrlSearchParams instance - */ - UrlSearchParams.prototype.keys = function () { - var keys = []; - for (var key in this._list) { - if (this.has(key)) { - keys.push(key); - } - } - return keys; - }; - /** - * Sets the value associated with a key. - * @param key The key to set the value of - */ - UrlSearchParams.prototype.set = function (key, value) { - this._list[key] = [value]; - }; - /** - * Returns this object's data as an encoded query string. - * @return A string in application/x-www-form-urlencoded format containing all of the set keys/values - */ - UrlSearchParams.prototype.toString = function () { - var query = []; - for (var key in this._list) { - if (!this.has(key)) { - continue; - } - var values = this._list[key]; - if (values) { - var encodedKey = encodeURIComponent(key); - for (var i = 0; i < values.length; i++) { - query.push(encodedKey + (values[i] ? '=' + encodeURIComponent(values[i]) : '')); - } - } - } - return query.join('&'); - }; - return UrlSearchParams; - }()); - exports.UrlSearchParams = UrlSearchParams; - exports.default = UrlSearchParams; -}); -//# sourceMappingURL=UrlSearchParams.js.map \ No newline at end of file diff --git a/deps/framework/core/UrlSearchParams.js.map b/deps/framework/core/UrlSearchParams.js.map deleted file mode 100644 index 5bf27c0e87..0000000000 --- a/deps/framework/core/UrlSearchParams.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"UrlSearchParams.js","sourceRoot":"","sources":["UrlSearchParams.ts"],"names":[],"mappings":";;;;;;;;;;;IACA,+BAAmC;IAOnC;;OAEG;IACH,0BAA0B,KAAa;QACtC,IAAM,KAAK,GAAmB,EAAE,CAAC;QACjC,IAAM,MAAM,GAAG,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QAEhC,GAAG,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;YACxC,IAAM,KAAK,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;YACxB,IAAM,kBAAkB,GAAG,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;YAC9C,IAAI,GAAG,SAAQ,CAAC;YAChB,IAAI,KAAK,GAAG,EAAE,CAAC;YAEf,EAAE,CAAC,CAAC,kBAAkB,IAAI,CAAC,CAAC,CAAC,CAAC;gBAC7B,GAAG,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,kBAAkB,CAAC,C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R;YACC,IAAM,KAAK,GAAa,EAAE,CAAC;YAE3B,GAAG,CAAC,CAAC,IAAM,GAAG,IAAI,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC;gBAC9B,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;oBACpB,QAAQ,CAAC;gBACV,CAAC;gBAED,IAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;gBAC/B,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC;oBACZ,IAAM,UAAU,GAAG,kBAAkB,CAAC,GAAG,CAAC,CAAC;oBAC3C,GAAG,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;wBACxC,KAAK,CAAC,IAAI,CAAC,UAAU,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,GAAG,kBAAkB,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;oBACjF,CAAC;gBACF,CAAC;YACF,CAAC;YAED,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QACxB,CAAC;QACF,sBAAC;IAAD,CAAC,AAnJD,IAmJC;IAnJY,0CAAe;IAqJ5B,kBAAe,eAAe,CAAC","sourcesContent":["import { Hash } from './interfaces';\nimport { duplicate } from './lang';\n\n/**\n * Object with string keys and string or string array values that describes a query string.\n */\nexport type ParamList = Hash;\n\n/**\n * Parses a query string, returning a ParamList object.\n */\nfunction parseQueryString(input: string): ParamList {\n\tconst query: Hash = {};\n\tconst splits = input.split('&');\n\n\tfor (let i = 0; i < splits.length; i++) {\n\t\tconst entry = splits[i];\n\t\tconst indexOfFirstEquals = entry.indexOf('=');\n\t\tlet key: string;\n\t\tlet value = '';\n\n\t\tif (indexOfFirstEquals >= 0) {\n\t\t\tkey = entry.slice(0, indexOfFirstEquals);\n\t\t\tvalue = entry.slice(indexOfFirstEquals + 1);\n\t\t} else {\n\t\t\tkey = entry;\n\t\t}\n\n\t\tkey = key ? decodeURIComponent(key) : '';\n\t\tvalue = value ? decodeURIComponent(value) : '';\n\n\t\tif (key in query) {\n\t\t\tquery[key].push(value);\n\t\t} else {\n\t\t\tquery[key] = [value];\n\t\t}\n\t}\n\treturn query;\n}\n\n/**\n * Represents a set of URL query search parameters.\n */\nexport class UrlSearchParams {\n\t/**\n\t * Constructs a new UrlSearchParams from a query string, an object of parameters and values, or another\n\t * UrlSearchParams.\n\t */\n\tconstructor(input?: string | ParamList | UrlSearchParams) {\n\t\tlet list: ParamList = {};\n\n\t\tif (input instanceof UrlSearchParams) {\n\t\t\t// Copy the incoming UrlSearchParam's internal list\n\t\t\tlist = duplicate(input._list);\n\t\t} else if (typeof input === 'object') {\n\t\t\t// Copy the incoming object, assuming its property values are either arrays or strings\n\t\t\tlist = {};\n\t\t\tfor (const key in input) {\n\t\t\t\tconst value = (input)[key];\n\n\t\t\t\tif (Array.isArray(value)) {\n\t\t\t\t\tlist[key] = value.length ? value.slice() : [''];\n\t\t\t\t} else if (value == null) {\n\t\t\t\t\tlist[key] = [''];\n\t\t\t\t} else {\n\t\t\t\t\tlist[key] = [value];\n\t\t\t\t}\n\t\t\t}\n\t\t} else if (typeof input === 'string') {\n\t\t\t// Parse the incoming string as a query string\n\t\t\tlist = parseQueryString(input);\n\t\t}\n\n\t\tthis._list = list as Hash;\n\t}\n\n\t/**\n\t * Maps property keys to arrays of values. The value for any property that has been set will be an array containing\n\t * at least one item. Properties that have been deleted will have a value of 'undefined'.\n\t */\n\tprotected readonly _list: Hash;\n\n\t/**\n\t * Appends a new value to the set of values for a key.\n\t * @param key The key to add a value for\n\t * @param value The value to add\n\t */\n\tappend(key: string, value: string): void {\n\t\tif (!this.has(key)) {\n\t\t\tthis.set(key, value);\n\t\t} else {\n\t\t\tconst values = this._list[key];\n\t\t\tif (values) {\n\t\t\t\tvalues.push(value);\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Deletes all values for a key.\n\t * @param key The key whose values are to be removed\n\t */\n\tdelete(key: string): void {\n\t\t// Set to undefined rather than deleting the key, for better consistency across browsers.\n\t\t// If a deleted key is re-added, most browsers put it at the end of iteration order, but IE maintains\n\t\t// its original position. This approach maintains the original position everywhere.\n\t\tthis._list[key] = undefined;\n\t}\n\n\t/**\n\t * Returns the first value associated with a key.\n\t * @param key The key to return the first value for\n\t * @return The first string value for the key\n\t */\n\tget(key: string): string | undefined {\n\t\tif (!this.has(key)) {\n\t\t\treturn undefined;\n\t\t}\n\t\tconst value = this._list[key];\n\t\treturn value ? value[0] : undefined;\n\t}\n\n\t/**\n\t * Returns all the values associated with a key.\n\t * @param key The key to return all values for\n\t * @return An array of strings containing all values for the key\n\t */\n\tgetAll(key: string): string[] | undefined {\n\t\tif (!this.has(key)) {\n\t\t\treturn undefined;\n\t\t}\n\t\treturn this._list[key];\n\t}\n\n\t/**\n\t * Returns true if a key has been set to any value, false otherwise.\n\t * @param key The key to test for existence\n\t * @return A boolean indicating if the key has been set\n\t */\n\thas(key: string): boolean {\n\t\treturn Array.isArray(this._list[key]);\n\t}\n\n\t/**\n\t * Returns an array of all keys which have been set.\n\t * @return An array of strings containing all keys set in the UrlSearchParams instance\n\t */\n\tkeys(): string[] {\n\t\tconst keys: string[] = [];\n\n\t\tfor (const key in this._list) {\n\t\t\tif (this.has(key)) {\n\t\t\t\tkeys.push(key);\n\t\t\t}\n\t\t}\n\n\t\treturn keys;\n\t}\n\n\t/**\n\t * Sets the value associated with a key.\n\t * @param key The key to set the value of\n\t */\n\tset(key: string, value: string): void {\n\t\tthis._list[key] = [value];\n\t}\n\n\t/**\n\t * Returns this object's data as an encoded query string.\n\t * @return A string in application/x-www-form-urlencoded format containing all of the set keys/values\n\t */\n\ttoString(): string {\n\t\tconst query: string[] = [];\n\n\t\tfor (const key in this._list) {\n\t\t\tif (!this.has(key)) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tconst values = this._list[key];\n\t\t\tif (values) {\n\t\t\t\tconst encodedKey = encodeURIComponent(key);\n\t\t\t\tfor (let i = 0; i < values.length; i++) {\n\t\t\t\t\tquery.push(encodedKey + (values[i] ? '=' + encodeURIComponent(values[i]) : ''));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn query.join('&');\n\t}\n}\n\nexport default UrlSearchParams;\n"]} \ No newline at end of file diff --git a/deps/framework/core/UrlSearchParams.mjs b/deps/framework/core/UrlSearchParams.mjs deleted file mode 100644 index c8fb2f419e..0000000000 --- a/deps/framework/core/UrlSearchParams.mjs +++ /dev/null @@ -1,166 +0,0 @@ -import { duplicate } from './lang'; -/** - * Parses a query string, returning a ParamList object. - */ -function parseQueryString(input) { - const query = {}; - const splits = input.split('&'); - for (let i = 0; i < splits.length; i++) { - const entry = splits[i]; - const indexOfFirstEquals = entry.indexOf('='); - let key; - let value = ''; - if (indexOfFirstEquals >= 0) { - key = entry.slice(0, indexOfFirstEquals); - value = entry.slice(indexOfFirstEquals + 1); - } - else { - key = entry; - } - key = key ? decodeURIComponent(key) : ''; - value = value ? decodeURIComponent(value) : ''; - if (key in query) { - query[key].push(value); - } - else { - query[key] = [value]; - } - } - return query; -} -/** - * Represents a set of URL query search parameters. - */ -export class UrlSearchParams { - /** - * Constructs a new UrlSearchParams from a query string, an object of parameters and values, or another - * UrlSearchParams. - */ - constructor(input) { - let list = {}; - if (input instanceof UrlSearchParams) { - // Copy the incoming UrlSearchParam's internal list - list = duplicate(input._list); - } - else if (typeof input === 'object') { - // Copy the incoming object, assuming its property values are either arrays or strings - list = {}; - for (const key in input) { - const value = input[key]; - if (Array.isArray(value)) { - list[key] = value.length ? value.slice() : ['']; - } - else if (value == null) { - list[key] = ['']; - } - else { - list[key] = [value]; - } - } - } - else if (typeof input === 'string') { - // Parse the incoming string as a query string - list = parseQueryString(input); - } - this._list = list; - } - /** - * Appends a new value to the set of values for a key. - * @param key The key to add a value for - * @param value The value to add - */ - append(key, value) { - if (!this.has(key)) { - this.set(key, value); - } - else { - const values = this._list[key]; - if (values) { - values.push(value); - } - } - } - /** - * Deletes all values for a key. - * @param key The key whose values are to be removed - */ - delete(key) { - // Set to undefined rather than deleting the key, for better consistency across browsers. - // If a deleted key is re-added, most browsers put it at the end of iteration order, but IE maintains - // its original position. This approach maintains the original position everywhere. - this._list[key] = undefined; - } - /** - * Returns the first value associated with a key. - * @param key The key to return the first value for - * @return The first string value for the key - */ - get(key) { - if (!this.has(key)) { - return undefined; - } - const value = this._list[key]; - return value ? value[0] : undefined; - } - /** - * Returns all the values associated with a key. - * @param key The key to return all values for - * @return An array of strings containing all values for the key - */ - getAll(key) { - if (!this.has(key)) { - return undefined; - } - return this._list[key]; - } - /** - * Returns true if a key has been set to any value, false otherwise. - * @param key The key to test for existence - * @return A boolean indicating if the key has been set - */ - has(key) { - return Array.isArray(this._list[key]); - } - /** - * Returns an array of all keys which have been set. - * @return An array of strings containing all keys set in the UrlSearchParams instance - */ - keys() { - const keys = []; - for (const key in this._list) { - if (this.has(key)) { - keys.push(key); - } - } - return keys; - } - /** - * Sets the value associated with a key. - * @param key The key to set the value of - */ - set(key, value) { - this._list[key] = [value]; - } - /** - * Returns this object's data as an encoded query string. - * @return A string in application/x-www-form-urlencoded format containing all of the set keys/values - */ - toString() { - const query = []; - for (const key in this._list) { - if (!this.has(key)) { - continue; - } - const values = this._list[key]; - if (values) { - const encodedKey = encodeURIComponent(key); - for (let i = 0; i < values.length; i++) { - query.push(encodedKey + (values[i] ? '=' + encodeURIComponent(values[i]) : '')); - } - } - } - return query.join('&'); - } -} -export default UrlSearchParams; -//# sourceMappingURL=UrlSearchParams.mjs.map \ No newline at end of file diff --git a/deps/framework/core/UrlSearchParams.mjs.map b/deps/framework/core/UrlSearchParams.mjs.map deleted file mode 100644 index ee698ce51e..0000000000 --- a/deps/framework/core/UrlSearchParams.mjs.map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C,CAAC,CAAC,CAAC,GAAG,GAAG,kBAAkB,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;gBACjF,CAAC;YACF,CAAC;QACF,CAAC;QAED,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IACxB,CAAC;CACD;AAED,eAAe,eAAe,CAAC","sourcesContent":["import { Hash } from './interfaces';\nimport { duplicate } from './lang';\n\n/**\n * Object with string keys and string or string array values that describes a query string.\n */\nexport type ParamList = Hash;\n\n/**\n * Parses a query string, returning a ParamList object.\n */\nfunction parseQueryString(input: string): ParamList {\n\tconst query: Hash = {};\n\tconst splits = input.split('&');\n\n\tfor (let i = 0; i < splits.length; i++) {\n\t\tconst entry = splits[i];\n\t\tconst indexOfFirstEquals = entry.indexOf('=');\n\t\tlet key: string;\n\t\tlet value = '';\n\n\t\tif (indexOfFirstEquals >= 0) {\n\t\t\tkey = entry.slice(0, indexOfFirstEquals);\n\t\t\tvalue = entry.slice(indexOfFirstEquals + 1);\n\t\t} else {\n\t\t\tkey = entry;\n\t\t}\n\n\t\tkey = key ? decodeURIComponent(key) : '';\n\t\tvalue = value ? decodeURIComponent(value) : '';\n\n\t\tif (key in query) {\n\t\t\tquery[key].push(value);\n\t\t} else {\n\t\t\tquery[key] = [value];\n\t\t}\n\t}\n\treturn query;\n}\n\n/**\n * Represents a set of URL query search parameters.\n */\nexport class UrlSearchParams {\n\t/**\n\t * Constructs a new UrlSearchParams from a query string, an object of parameters and values, or another\n\t * UrlSearchParams.\n\t */\n\tconstructor(input?: string | ParamList | UrlSearchParams) {\n\t\tlet list: ParamList = {};\n\n\t\tif (input instanceof UrlSearchParams) {\n\t\t\t// Copy the incoming UrlSearchParam's internal list\n\t\t\tlist = duplicate(input._list);\n\t\t} else if (typeof input === 'object') {\n\t\t\t// Copy the incoming object, assuming its property values are either arrays or strings\n\t\t\tlist = {};\n\t\t\tfor (const key in input) {\n\t\t\t\tconst value = (input)[key];\n\n\t\t\t\tif (Array.isArray(value)) {\n\t\t\t\t\tlist[key] = value.length ? value.slice() : [''];\n\t\t\t\t} else if (value == null) {\n\t\t\t\t\tlist[key] = [''];\n\t\t\t\t} else {\n\t\t\t\t\tlist[key] = [value];\n\t\t\t\t}\n\t\t\t}\n\t\t} else if (typeof input === 'string') {\n\t\t\t// Parse the incoming string as a query string\n\t\t\tlist = parseQueryString(input);\n\t\t}\n\n\t\tthis._list = list as Hash;\n\t}\n\n\t/**\n\t * Maps property keys to arrays of values. The value for any property that has been set will be an array containing\n\t * at least one item. Properties that have been deleted will have a value of 'undefined'.\n\t */\n\tprotected readonly _list: Hash;\n\n\t/**\n\t * Appends a new value to the set of values for a key.\n\t * @param key The key to add a value for\n\t * @param value The value to add\n\t */\n\tappend(key: string, value: string): void {\n\t\tif (!this.has(key)) {\n\t\t\tthis.set(key, value);\n\t\t} else {\n\t\t\tconst values = this._list[key];\n\t\t\tif (values) {\n\t\t\t\tvalues.push(value);\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Deletes all values for a key.\n\t * @param key The key whose values are to be removed\n\t */\n\tdelete(key: string): void {\n\t\t// Set to undefined rather than deleting the key, for better consistency across browsers.\n\t\t// If a deleted key is re-added, most browsers put it at the end of iteration order, but IE maintains\n\t\t// its original position. This approach maintains the original position everywhere.\n\t\tthis._list[key] = undefined;\n\t}\n\n\t/**\n\t * Returns the first value associated with a key.\n\t * @param key The key to return the first value for\n\t * @return The first string value for the key\n\t */\n\tget(key: string): string | undefined {\n\t\tif (!this.has(key)) {\n\t\t\treturn undefined;\n\t\t}\n\t\tconst value = this._list[key];\n\t\treturn value ? value[0] : undefined;\n\t}\n\n\t/**\n\t * Returns all the values associated with a key.\n\t * @param key The key to return all values for\n\t * @return An array of strings containing all values for the key\n\t */\n\tgetAll(key: string): string[] | undefined {\n\t\tif (!this.has(key)) {\n\t\t\treturn undefined;\n\t\t}\n\t\treturn this._list[key];\n\t}\n\n\t/**\n\t * Returns true if a key has been set to any value, false otherwise.\n\t * @param key The key to test for existence\n\t * @return A boolean indicating if the key has been set\n\t */\n\thas(key: string): boolean {\n\t\treturn Array.isArray(this._list[key]);\n\t}\n\n\t/**\n\t * Returns an array of all keys which have been set.\n\t * @return An array of strings containing all keys set in the UrlSearchParams instance\n\t */\n\tkeys(): string[] {\n\t\tconst keys: string[] = [];\n\n\t\tfor (const key in this._list) {\n\t\t\tif (this.has(key)) {\n\t\t\t\tkeys.push(key);\n\t\t\t}\n\t\t}\n\n\t\treturn keys;\n\t}\n\n\t/**\n\t * Sets the value associated with a key.\n\t * @param key The key to set the value of\n\t */\n\tset(key: string, value: string): void {\n\t\tthis._list[key] = [value];\n\t}\n\n\t/**\n\t * Returns this object's data as an encoded query string.\n\t * @return A string in application/x-www-form-urlencoded format containing all of the set keys/values\n\t */\n\ttoString(): string {\n\t\tconst query: string[] = [];\n\n\t\tfor (const key in this._list) {\n\t\t\tif (!this.has(key)) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tconst values = this._list[key];\n\t\t\tif (values) {\n\t\t\t\tconst encodedKey = encodeURIComponent(key);\n\t\t\t\tfor (let i = 0; i < values.length; i++) {\n\t\t\t\t\tquery.push(encodedKey + (values[i] ? '=' + encodeURIComponent(values[i]) : ''));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn query.join('&');\n\t}\n}\n\nexport default UrlSearchParams;\n"]} \ No newline at end of file diff --git a/deps/framework/core/aspect.d.ts b/deps/framework/core/aspect.d.ts deleted file mode 100644 index 23c7fdd8ba..0000000000 --- a/deps/framework/core/aspect.d.ts +++ /dev/null @@ -1,146 +0,0 @@ -import { Handle } from './interfaces'; -/** - * An object that provides the necessary APIs to be MapLike - */ -export interface MapLike { - get(key: K): V; - set(key: K, value?: V): this; -} -export interface Indexable { - [method: string]: any; -} -/** - * The types of objects or maps where advice can be applied - */ -export declare type Targetable = MapLike | Indexable; -export interface JoinPointDispatchAdvice { - before?: JoinPointBeforeAdvice[]; - after?: JoinPointAfterAdvice[]; - readonly joinPoint: Function; -} -export interface JoinPointAfterAdvice { - /** - * Advice which is applied *after*, receiving the result and arguments from the join point. - * - * @param result The result from the function being advised - * @param args The arguments that were supplied to the advised function - * @returns The value returned from the advice is then the result of calling the method - */ - (result: T, ...args: any[]): T; -} -export interface JoinPointAroundAdvice { - /** - * Advice which is applied *around*. The advising function receives the original function and - * needs to return a new function which will then invoke the original function. - * - * @param origFn The original function - * @returns A new function which will invoke the original function. - */ - (origFn: GenericFunction): (...args: any[]) => T; -} -export interface JoinPointBeforeAdvice { - /** - * Advice which is applied *before*, receiving the original arguments, if the advising - * function returns a value, it is passed further along taking the place of the original - * arguments. - * - * @param args The arguments the method was called with - */ - (...args: any[]): any[] | void; -} -export interface GenericFunction { - (...args: any[]): T; -} -/** - * Attaches "after" advice to be executed after the original method. - * The advising function will receive the original method's return value and arguments object. - * The value it returns will be returned from the method when it is called (even if the return value is undefined). - * - * @param target Object whose method will be aspected - * @param methodName Name of method to aspect - * @param advice Advising function which will receive the original method's return value and arguments object - * @return A handle which will remove the aspect when destroy is called - */ -export declare function after(target: Targetable, methodName: string | symbol, advice: (originalReturn: any, originalArgs: IArguments) => any): Handle; -/** - * Apply advice *after* the supplied joinPoint (function) - * - * @param joinPoint A function that should have advice applied to - * @param advice The after advice - */ -export declare function after, T>(joinPoint: F, advice: JoinPointAfterAdvice): F; -/** - * Apply advice *around* the supplied joinPoint (function) - * - * @param joinPoint A function that should have advice applied to - * @param advice The around advice - */ -export declare function aroundJoinPoint, T>(joinPoint: F, advice: JoinPointAroundAdvice): F; -/** - * Attaches "around" advice around the original method. - * - * @param target Object whose method will be aspected - * @param methodName Name of method to aspect - * @param advice Advising function which will receive the original function - * @return A handle which will remove the aspect when destroy is called - */ -export declare function aroundObject(target: Targetable, methodName: string | symbol, advice: ((previous: Function) => Function)): Handle; -/** - * Attaches "around" advice around the original method. - * - * @param target Object whose method will be aspected - * @param methodName Name of method to aspect - * @param advice Advising function which will receive the original function - * @return A handle which will remove the aspect when destroy is called - */ -export declare function around(target: Targetable, methodName: string | symbol, advice: ((previous: Function) => Function)): Handle; -/** - * Apply advice *around* the supplied joinPoint (function) - * - * @param joinPoint A function that should have advice applied to - * @param advice The around advice - */ -export declare function around, T>(joinPoint: F, advice: JoinPointAroundAdvice): F; -/** - * Apply advice *before* the supplied joinPoint (function) - * - * @param joinPoint A function that should have advice applied to - * @param advice The before advice - */ -export declare function beforeJoinPoint>(joinPoint: F, advice: JoinPointBeforeAdvice): F; -/** - * Attaches "before" advice to be executed before the original method. - * - * @param target Object whose method will be aspected - * @param methodName Name of method to aspect - * @param advice Advising function which will receive the same arguments as the original, and may return new arguments - * @return A handle which will remove the aspect when destroy is called - */ -export declare function beforeObject(target: Targetable, methodName: string | symbol, advice: (...originalArgs: any[]) => any[] | void): Handle; -/** - * Attaches "before" advice to be executed before the original method. - * - * @param target Object whose method will be aspected - * @param methodName Name of method to aspect - * @param advice Advising function which will receive the same arguments as the original, and may return new arguments - * @return A handle which will remove the aspect when destroy is called - */ -export declare function before(target: Targetable, methodName: string | symbol, advice: (...originalArgs: any[]) => any[] | void): Handle; -/** - * Apply advice *before* the supplied joinPoint (function) - * - * @param joinPoint A function that should have advice applied to - * @param advice The before advice - */ -export declare function before>(joinPoint: F, advice: JoinPointBeforeAdvice): F; -/** - * Attaches advice to be executed after the original method. - * The advising function will receive the same arguments as the original method. - * The value it returns will be returned from the method when it is called *unless* its return value is undefined. - * - * @param target Object whose method will be aspected - * @param methodName Name of method to aspect - * @param advice Advising function which will receive the same arguments as the original method - * @return A handle which will remove the aspect when destroy is called - */ -export declare function on(target: Targetable, methodName: string | symbol, advice: (...originalArgs: any[]) => any): Handle; diff --git a/deps/framework/core/aspect.js b/deps/framework/core/aspect.js deleted file mode 100644 index d8bb66f97e..0000000000 --- a/deps/framework/core/aspect.js +++ /dev/null @@ -1,352 +0,0 @@ -(function (factory) { - if (typeof module === "object" && typeof module.exports === "object") { - var v = factory(require, exports); - if (v !== undefined) module.exports = v; - } - else if (typeof define === "function" && define.amd) { - define(["require", "exports", "../shim/WeakMap", "./lang"], factory); - } -})(function (require, exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - var WeakMap_1 = require("../shim/WeakMap"); - var lang_1 = require("./lang"); - /** - * An internal type guard that determines if an value is MapLike or not - * - * @param value The value to guard against - */ - function isMapLike(value) { - return value && typeof value.get === 'function' && typeof value.set === 'function'; - } - /** - * A weak map of dispatchers used to apply the advice - */ - var dispatchAdviceMap = new WeakMap_1.default(); - /** - * A UID for tracking advice ordering - */ - var nextId = 0; - /** - * Internal function that advises a join point - * - * @param dispatcher The current advice dispatcher - * @param type The type of before or after advice to apply - * @param advice The advice to apply - * @param receiveArguments If true, the advice will receive the arguments passed to the join point - * @return The handle that will remove the advice - */ - function adviseObject(dispatcher, type, advice, receiveArguments) { - var previous = dispatcher && dispatcher[type]; - var advised = { - id: nextId++, - advice: advice, - receiveArguments: receiveArguments - }; - if (previous) { - if (type === 'after') { - // add the listener to the end of the list - // note that we had to change this loop a little bit to workaround a bizarre IE10 JIT bug - while (previous.next && (previous = previous.next)) { } - previous.next = advised; - advised.previous = previous; - } - else { - // add to the beginning - if (dispatcher) { - dispatcher.before = advised; - } - advised.next = previous; - previous.previous = advised; - } - } - else { - dispatcher && (dispatcher[type] = advised); - } - advice = previous = undefined; - return lang_1.createHandle(function () { - var _a = advised || {}, _b = _a.previous, previous = _b === void 0 ? undefined : _b, _c = _a.next, next = _c === void 0 ? undefined : _c; - if (dispatcher && !previous && !next) { - dispatcher[type] = undefined; - } - else { - if (previous) { - previous.next = next; - } - else { - dispatcher && (dispatcher[type] = next); - } - if (next) { - next.previous = previous; - } - } - if (advised) { - delete advised.advice; - } - dispatcher = advised = undefined; - }); - } - /** - * Advise a join point (function) with supplied advice - * - * @param joinPoint The function to be advised - * @param type The type of advice to be applied - * @param advice The advice to apply - */ - function adviseJoinPoint(joinPoint, type, advice) { - var dispatcher; - if (type === 'around') { - dispatcher = getJoinPointDispatcher(advice.apply(this, [joinPoint])); - } - else { - dispatcher = getJoinPointDispatcher(joinPoint); - // cannot have undefined in map due to code logic, using ! - var adviceMap = dispatchAdviceMap.get(dispatcher); - if (type === 'before') { - (adviceMap.before || (adviceMap.before = [])).unshift(advice); - } - else { - (adviceMap.after || (adviceMap.after = [])).push(advice); - } - } - return dispatcher; - } - /** - * An internal function that resolves or creates the dispatcher for a given join point - * - * @param target The target object or map - * @param methodName The name of the method that the dispatcher should be resolved for - * @return The dispatcher - */ - function getDispatcherObject(target, methodName) { - var existing = isMapLike(target) ? target.get(methodName) : target && target[methodName]; - var dispatcher; - if (!existing || existing.target !== target) { - /* There is no existing dispatcher, therefore we will create one */ - dispatcher = function () { - var executionId = nextId; - var args = arguments; - var results; - var before = dispatcher.before; - while (before) { - if (before.advice) { - args = before.advice.apply(this, args) || args; - } - before = before.next; - } - if (dispatcher.around && dispatcher.around.advice) { - results = dispatcher.around.advice(this, args); - } - var after = dispatcher.after; - while (after && after.id !== undefined && after.id < executionId) { - if (after.advice) { - if (after.receiveArguments) { - var newResults = after.advice.apply(this, args); - results = newResults === undefined ? results : newResults; - } - else { - results = after.advice.call(this, results, args); - } - } - after = after.next; - } - return results; - }; - if (isMapLike(target)) { - target.set(methodName, dispatcher); - } - else { - target && (target[methodName] = dispatcher); - } - if (existing) { - dispatcher.around = { - advice: function (target, args) { - return existing.apply(target, args); - } - }; - } - dispatcher.target = target; - } - else { - dispatcher = existing; - } - return dispatcher; - } - /** - * Returns the dispatcher function for a given joinPoint (method/function) - * - * @param joinPoint The function that is to be advised - */ - function getJoinPointDispatcher(joinPoint) { - function dispatcher() { - var _this = this; - var args = []; - for (var _i = 0; _i < arguments.length; _i++) { - args[_i] = arguments[_i]; - } - // cannot have undefined in map due to code logic, using ! - var _a = dispatchAdviceMap.get(dispatcher), before = _a.before, after = _a.after, joinPoint = _a.joinPoint; - if (before) { - args = before.reduce(function (previousArgs, advice) { - var currentArgs = advice.apply(_this, previousArgs); - return currentArgs || previousArgs; - }, args); - } - var result = joinPoint.apply(this, args); - if (after) { - result = after.reduce(function (previousResult, advice) { - return advice.apply(_this, [previousResult].concat(args)); - }, result); - } - return result; - } - /* We want to "clone" the advice that has been applied already, if this - * joinPoint is already advised */ - if (dispatchAdviceMap.has(joinPoint)) { - // cannot have undefined in map due to code logic, using ! - var adviceMap = dispatchAdviceMap.get(joinPoint); - var before_1 = adviceMap.before, after_1 = adviceMap.after; - if (before_1) { - before_1 = before_1.slice(0); - } - if (after_1) { - after_1 = after_1.slice(0); - } - dispatchAdviceMap.set(dispatcher, { - joinPoint: adviceMap.joinPoint, - before: before_1, - after: after_1 - }); - } - else { - /* Otherwise, this is a new joinPoint, so we will create the advice map afresh */ - dispatchAdviceMap.set(dispatcher, { joinPoint: joinPoint }); - } - return dispatcher; - } - /** - * Apply advice *after* the supplied joinPoint (function) - * - * @param joinPoint A function that should have advice applied to - * @param advice The after advice - */ - function afterJoinPoint(joinPoint, advice) { - return adviseJoinPoint(joinPoint, 'after', advice); - } - /** - * Attaches "after" advice to be executed after the original method. - * The advising function will receive the original method's return value and arguments object. - * The value it returns will be returned from the method when it is called (even if the return value is undefined). - * - * @param target Object whose method will be aspected - * @param methodName Name of method to aspect - * @param advice Advising function which will receive the original method's return value and arguments object - * @return A handle which will remove the aspect when destroy is called - */ - function afterObject(target, methodName, advice) { - return adviseObject(getDispatcherObject(target, methodName), 'after', advice); - } - function after(joinPointOrTarget, methodNameOrAdvice, objectAdvice) { - if (typeof joinPointOrTarget === 'function') { - return afterJoinPoint(joinPointOrTarget, methodNameOrAdvice); - } - else { - return afterObject(joinPointOrTarget, methodNameOrAdvice, objectAdvice); - } - } - exports.after = after; - /** - * Apply advice *around* the supplied joinPoint (function) - * - * @param joinPoint A function that should have advice applied to - * @param advice The around advice - */ - function aroundJoinPoint(joinPoint, advice) { - return adviseJoinPoint(joinPoint, 'around', advice); - } - exports.aroundJoinPoint = aroundJoinPoint; - /** - * Attaches "around" advice around the original method. - * - * @param target Object whose method will be aspected - * @param methodName Name of method to aspect - * @param advice Advising function which will receive the original function - * @return A handle which will remove the aspect when destroy is called - */ - function aroundObject(target, methodName, advice) { - var dispatcher = getDispatcherObject(target, methodName); - var previous = dispatcher.around; - var advised; - if (advice) { - advised = advice(function () { - if (previous && previous.advice) { - return previous.advice(this, arguments); - } - }); - } - dispatcher.around = { - advice: function (target, args) { - return advised ? advised.apply(target, args) : previous && previous.advice && previous.advice(target, args); - } - }; - return lang_1.createHandle(function () { - advised = dispatcher = undefined; - }); - } - exports.aroundObject = aroundObject; - function around(joinPointOrTarget, methodNameOrAdvice, objectAdvice) { - if (typeof joinPointOrTarget === 'function') { - return aroundJoinPoint(joinPointOrTarget, methodNameOrAdvice); - } - else { - return aroundObject(joinPointOrTarget, methodNameOrAdvice, objectAdvice); - } - } - exports.around = around; - /** - * Apply advice *before* the supplied joinPoint (function) - * - * @param joinPoint A function that should have advice applied to - * @param advice The before advice - */ - function beforeJoinPoint(joinPoint, advice) { - return adviseJoinPoint(joinPoint, 'before', advice); - } - exports.beforeJoinPoint = beforeJoinPoint; - /** - * Attaches "before" advice to be executed before the original method. - * - * @param target Object whose method will be aspected - * @param methodName Name of method to aspect - * @param advice Advising function which will receive the same arguments as the original, and may return new arguments - * @return A handle which will remove the aspect when destroy is called - */ - function beforeObject(target, methodName, advice) { - return adviseObject(getDispatcherObject(target, methodName), 'before', advice); - } - exports.beforeObject = beforeObject; - function before(joinPointOrTarget, methodNameOrAdvice, objectAdvice) { - if (typeof joinPointOrTarget === 'function') { - return beforeJoinPoint(joinPointOrTarget, methodNameOrAdvice); - } - else { - return beforeObject(joinPointOrTarget, methodNameOrAdvice, objectAdvice); - } - } - exports.before = before; - /** - * Attaches advice to be executed after the original method. - * The advising function will receive the same arguments as the original method. - * The value it returns will be returned from the method when it is called *unless* its return value is undefined. - * - * @param target Object whose method will be aspected - * @param methodName Name of method to aspect - * @param advice Advising function which will receive the same arguments as the original method - * @return A handle which will remove the aspect when destroy is called - */ - function on(target, methodName, advice) { - return adviseObject(getDispatcherObject(target, methodName), 'after', advice, true); - } - exports.on = on; -}); -//# sourceMappingURL=aspect.js.map \ No newline at end of file diff --git a/deps/framework/core/aspect.js.map b/deps/framework/core/aspect.js.map deleted file mode 100644 index d9312dcbf3..0000000000 --- a/deps/framework/core/aspect.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"aspect.js","sourceRoot":"","sources":["aspect.ts"],"names":[],"mappings":";;;;;;;;;;;IACA,2CAAsC;IACtC,+BAAsC;IAUtC;;;;OAIG;IACH,mBAAmB,KAAU;QAC5B,MAAM,CAAC,KAAK,IAAI,OAAO,KAAK,CAAC,GAAG,KAAK,UAAU,IAAI,OAAO,KAAK,CAAC,GAAG,KAAK,UAAU,CAAC;IACpF,CAAC;IAgFD;;OAEG;IACH,IAAM,iBAAiB,GAAG,IAAI,iBAAO,EAA0C,CAAC;IAEhF;;OAEG;IACH,IAAI,MAAM,GAAG,CAAC,CAAC;IAEf;;;;;;;;OAQG;IACH,sBACC,UAAkC,EAClC,IAAgB,EAChB,MAA4B,EAC5B,gBAA0B;QAE1B,IAAI,QAAQ,GAAG,UAAU,IAAI,UAAU,CAAC,IAAI,CAAC,CAAC;QAC9C,IAAI,OAAO,GAAwB;YAClC,EAAE,EAAE,MAAM,EAAE;YACZ,MAAM,EAAE,MAAM;YACd,gBAAgB,EAAE,gBAAgB;SAClC,CAAC;QAEF,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC;YACd,EAAE,CAAC,CAAC,IAAI,KAAK,OAAO,CAAC,CAAC,CAAC;gBACtB,0CAA0C;gBAC1C,yFAAyF;gBACzF,OAAO,QAAQ,CAAC,IAAI,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA,CAAC;gBACtD,QAAQ,CAAC,IAAI,GAAG,OAAO,CAAC;gBACxB,OAAO,CAAC,QAAQ,GAAG,QA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yB,kBAAkB,CAAC,CAAC;QACtF,CAAC;QAAC,IAAI,CAAC,CAAC;YACP,MAAM,CAAC,YAAY,CAAC,iBAAiB,EAAmB,kBAAkB,EAAE,YAAa,CAAC,CAAC;QAC5F,CAAC;IACF,CAAC;IAVD,wBAUC;IAED;;;;;;;;;OASG;IACH,YAAmB,MAAkB,EAAE,UAA2B,EAAE,MAAuC;QAC1G,MAAM,CAAC,YAAY,CAAC,mBAAmB,CAAC,MAAM,EAAE,UAAU,CAAC,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,CAAC;IACrF,CAAC;IAFD,gBAEC","sourcesContent":["import { Handle } from './interfaces';\nimport WeakMap from '../shim/WeakMap';\nimport { createHandle } from './lang';\n\n/**\n * An object that provides the necessary APIs to be MapLike\n */\nexport interface MapLike {\n\tget(key: K): V;\n\tset(key: K, value?: V): this;\n}\n\n/**\n * An internal type guard that determines if an value is MapLike or not\n *\n * @param value The value to guard against\n */\nfunction isMapLike(value: any): value is MapLike {\n\treturn value && typeof value.get === 'function' && typeof value.set === 'function';\n}\n\nexport interface Indexable {\n\t[method: string]: any;\n}\n\n/**\n * The types of objects or maps where advice can be applied\n */\nexport type Targetable = MapLike | Indexable;\n\ntype AdviceType = 'before' | 'after' | 'around';\n\n/**\n * A meta data structure when applying advice\n */\ninterface Advised {\n\treadonly id?: number;\n\tadvice?: Function;\n\tprevious?: Advised;\n\tnext?: Advised;\n\treadonly receiveArguments?: boolean;\n}\n\n/**\n * A function that dispatches advice which is decorated with additional\n * meta data about the advice to apply\n */\ninterface Dispatcher {\n\t[type: string]: Advised | undefined;\n\t(): any;\n\ttarget: any;\n\tbefore?: Advised;\n\taround?: Advised;\n\tafter?: Advised;\n}\n\nexport interface JoinPointDispatchAdvice {\n\tbefore?: JoinPointBeforeAdvice[];\n\tafter?: JoinPointAfterAdvice[];\n\treadonly joinPoint: Function;\n}\n\nexport interface JoinPointAfterAdvice {\n\t/**\n\t * Advice which is applied *after*, receiving the result and arguments from the join point.\n\t *\n\t * @param result The result from the function being advised\n\t * @param args The arguments that were supplied to the advised function\n\t * @returns The value returned from the advice is then the result of calling the method\n\t */\n\t(result: T, ...args: any[]): T;\n}\n\nexport interface JoinPointAroundAdvice {\n\t/**\n\t * Advice which is applied *around*. The advising function receives the original function and\n\t * needs to return a new function which will then invoke the original function.\n\t *\n\t * @param origFn The original function\n\t * @returns A new function which will invoke the original function.\n\t */\n\t(origFn: GenericFunction): (...args: any[]) => T;\n}\n\nexport interface JoinPointBeforeAdvice {\n\t/**\n\t * Advice which is applied *before*, receiving the original arguments, if the advising\n\t * function returns a value, it is passed further along taking the place of the original\n\t * arguments.\n\t *\n\t * @param args The arguments the method was called with\n\t */\n\t(...args: any[]): any[] | void;\n}\n\nexport interface GenericFunction {\n\t(...args: any[]): T;\n}\n\n/**\n * A weak map of dispatchers used to apply the advice\n */\nconst dispatchAdviceMap = new WeakMap>();\n\n/**\n * A UID for tracking advice ordering\n */\nlet nextId = 0;\n\n/**\n * Internal function that advises a join point\n *\n * @param dispatcher The current advice dispatcher\n * @param type The type of before or after advice to apply\n * @param advice The advice to apply\n * @param receiveArguments If true, the advice will receive the arguments passed to the join point\n * @return The handle that will remove the advice\n */\nfunction adviseObject(\n\tdispatcher: Dispatcher | undefined,\n\ttype: AdviceType,\n\tadvice: Function | undefined,\n\treceiveArguments?: boolean\n): Handle {\n\tlet previous = dispatcher && dispatcher[type];\n\tlet advised: Advised | undefined = {\n\t\tid: nextId++,\n\t\tadvice: advice,\n\t\treceiveArguments: receiveArguments\n\t};\n\n\tif (previous) {\n\t\tif (type === 'after') {\n\t\t\t// add the listener to the end of the list\n\t\t\t// note that we had to change this loop a little bit to workaround a bizarre IE10 JIT bug\n\t\t\twhile (previous.next && (previous = previous.next)) {}\n\t\t\tprevious.next = advised;\n\t\t\tadvised.previous = previous;\n\t\t} else {\n\t\t\t// add to the beginning\n\t\t\tif (dispatcher) {\n\t\t\t\tdispatcher.before = advised;\n\t\t\t}\n\t\t\tadvised.next = previous;\n\t\t\tprevious.previous = advised;\n\t\t}\n\t} else {\n\t\tdispatcher && (dispatcher[type] = advised);\n\t}\n\n\tadvice = previous = undefined;\n\n\treturn createHandle(function() {\n\t\tlet { previous = undefined, next = undefined } = advised || {};\n\n\t\tif (dispatcher && !previous && !next) {\n\t\t\tdispatcher[type] = undefined;\n\t\t} else {\n\t\t\tif (previous) {\n\t\t\t\tprevious.next = next;\n\t\t\t} else {\n\t\t\t\tdispatcher && (dispatcher[type] = next);\n\t\t\t}\n\n\t\t\tif (next) {\n\t\t\t\tnext.previous = previous;\n\t\t\t}\n\t\t}\n\t\tif (advised) {\n\t\t\tdelete advised.advice;\n\t\t}\n\t\tdispatcher = advised = undefined;\n\t});\n}\n\n/**\n * Advise a join point (function) with supplied advice\n *\n * @param joinPoint The function to be advised\n * @param type The type of advice to be applied\n * @param advice The advice to apply\n */\nfunction adviseJoinPoint, T>(\n\tthis: any,\n\tjoinPoint: F,\n\ttype: AdviceType,\n\tadvice: JoinPointBeforeAdvice | JoinPointAfterAdvice | JoinPointAroundAdvice\n): F {\n\tlet dispatcher: F;\n\tif (type === 'around') {\n\t\tdispatcher = getJoinPointDispatcher(advice.apply(this, [joinPoint]));\n\t} else {\n\t\tdispatcher = getJoinPointDispatcher(joinPoint);\n\t\t// cannot have undefined in map due to code logic, using !\n\t\tconst adviceMap = dispatchAdviceMap.get(dispatcher)!;\n\t\tif (type === 'before') {\n\t\t\t(adviceMap.before || (adviceMap.before = [])).unshift(advice);\n\t\t} else {\n\t\t\t(adviceMap.after || (adviceMap.after = [])).push(advice);\n\t\t}\n\t}\n\treturn dispatcher;\n}\n\n/**\n * An internal function that resolves or creates the dispatcher for a given join point\n *\n * @param target The target object or map\n * @param methodName The name of the method that the dispatcher should be resolved for\n * @return The dispatcher\n */\nfunction getDispatcherObject(target: Targetable, methodName: string | symbol): Dispatcher {\n\tconst existing = isMapLike(target) ? target.get(methodName) : target && target[methodName];\n\tlet dispatcher: Dispatcher;\n\n\tif (!existing || existing.target !== target) {\n\t\t/* There is no existing dispatcher, therefore we will create one */\n\t\tdispatcher = function(this: Dispatcher): any {\n\t\t\tlet executionId = nextId;\n\t\t\tlet args = arguments;\n\t\t\tlet results: any;\n\t\t\tlet before = dispatcher.before;\n\n\t\t\twhile (before) {\n\t\t\t\tif (before.advice) {\n\t\t\t\t\targs = before.advice.apply(this, args) || args;\n\t\t\t\t}\n\t\t\t\tbefore = before.next;\n\t\t\t}\n\n\t\t\tif (dispatcher.around && dispatcher.around.advice) {\n\t\t\t\tresults = dispatcher.around.advice(this, args);\n\t\t\t}\n\n\t\t\tlet after = dispatcher.after;\n\t\t\twhile (after && after.id !== undefined && after.id < executionId) {\n\t\t\t\tif (after.advice) {\n\t\t\t\t\tif (after.receiveArguments) {\n\t\t\t\t\t\tlet newResults = after.advice.apply(this, args);\n\t\t\t\t\t\tresults = newResults === undefined ? results : newResults;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tresults = after.advice.call(this, results, args);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tafter = after.next;\n\t\t\t}\n\n\t\t\treturn results;\n\t\t};\n\n\t\tif (isMapLike(target)) {\n\t\t\ttarget.set(methodName, dispatcher);\n\t\t} else {\n\t\t\ttarget && (target[methodName] = dispatcher);\n\t\t}\n\n\t\tif (existing) {\n\t\t\tdispatcher.around = {\n\t\t\t\tadvice: function(target: any, args: any[]): any {\n\t\t\t\t\treturn existing.apply(target, args);\n\t\t\t\t}\n\t\t\t};\n\t\t}\n\n\t\tdispatcher.target = target;\n\t} else {\n\t\tdispatcher = existing;\n\t}\n\n\treturn dispatcher;\n}\n\n/**\n * Returns the dispatcher function for a given joinPoint (method/function)\n *\n * @param joinPoint The function that is to be advised\n */\nfunction getJoinPointDispatcher, T>(joinPoint: F): F {\n\tfunction dispatcher(this: Function, ...args: any[]): T {\n\t\t// cannot have undefined in map due to code logic, using !\n\t\tconst { before, after, joinPoint } = dispatchAdviceMap.get(dispatcher)!;\n\t\tif (before) {\n\t\t\targs = before.reduce((previousArgs, advice) => {\n\t\t\t\tconst currentArgs = advice.apply(this, previousArgs);\n\t\t\t\treturn currentArgs || previousArgs;\n\t\t\t}, args);\n\t\t}\n\t\tlet result = joinPoint.apply(this, args);\n\t\tif (after) {\n\t\t\tresult = after.reduce((previousResult, advice) => {\n\t\t\t\treturn advice.apply(this, [previousResult].concat(args));\n\t\t\t}, result);\n\t\t}\n\t\treturn result;\n\t}\n\n\t/* We want to \"clone\" the advice that has been applied already, if this\n\t * joinPoint is already advised */\n\tif (dispatchAdviceMap.has(joinPoint)) {\n\t\t// cannot have undefined in map due to code logic, using !\n\t\tconst adviceMap = dispatchAdviceMap.get(joinPoint)!;\n\t\tlet { before, after } = adviceMap;\n\t\tif (before) {\n\t\t\tbefore = before.slice(0);\n\t\t}\n\t\tif (after) {\n\t\t\tafter = after.slice(0);\n\t\t}\n\t\tdispatchAdviceMap.set(dispatcher, {\n\t\t\tjoinPoint: adviceMap.joinPoint,\n\t\t\tbefore,\n\t\t\tafter\n\t\t});\n\t} else {\n\t\t/* Otherwise, this is a new joinPoint, so we will create the advice map afresh */\n\t\tdispatchAdviceMap.set(dispatcher, { joinPoint });\n\t}\n\n\treturn dispatcher as F;\n}\n\n/**\n * Apply advice *after* the supplied joinPoint (function)\n *\n * @param joinPoint A function that should have advice applied to\n * @param advice The after advice\n */\nfunction afterJoinPoint, T>(joinPoint: F, advice: JoinPointAfterAdvice): F {\n\treturn adviseJoinPoint(joinPoint, 'after', advice);\n}\n\n/**\n * Attaches \"after\" advice to be executed after the original method.\n * The advising function will receive the original method's return value and arguments object.\n * The value it returns will be returned from the method when it is called (even if the return value is undefined).\n *\n * @param target Object whose method will be aspected\n * @param methodName Name of method to aspect\n * @param advice Advising function which will receive the original method's return value and arguments object\n * @return A handle which will remove the aspect when destroy is called\n */\nfunction afterObject(\n\ttarget: Targetable,\n\tmethodName: string | symbol,\n\tadvice: (originalReturn: any, originalArgs: IArguments) => any\n): Handle {\n\treturn adviseObject(getDispatcherObject(target, methodName), 'after', advice);\n}\n\n/**\n * Attaches \"after\" advice to be executed after the original method.\n * The advising function will receive the original method's return value and arguments object.\n * The value it returns will be returned from the method when it is called (even if the return value is undefined).\n *\n * @param target Object whose method will be aspected\n * @param methodName Name of method to aspect\n * @param advice Advising function which will receive the original method's return value and arguments object\n * @return A handle which will remove the aspect when destroy is called\n */\nexport function after(\n\ttarget: Targetable,\n\tmethodName: string | symbol,\n\tadvice: (originalReturn: any, originalArgs: IArguments) => any\n): Handle;\n/**\n * Apply advice *after* the supplied joinPoint (function)\n *\n * @param joinPoint A function that should have advice applied to\n * @param advice The after advice\n */\nexport function after, T>(joinPoint: F, advice: JoinPointAfterAdvice): F;\nexport function after, T>(\n\tjoinPointOrTarget: F | Targetable,\n\tmethodNameOrAdvice: string | symbol | JoinPointAfterAdvice,\n\tobjectAdvice?: (originalReturn: any, originalArgs: IArguments) => any\n): Handle | F {\n\tif (typeof joinPointOrTarget === 'function') {\n\t\treturn afterJoinPoint(joinPointOrTarget, >methodNameOrAdvice);\n\t} else {\n\t\treturn afterObject(joinPointOrTarget, methodNameOrAdvice, objectAdvice!);\n\t}\n}\n\n/**\n * Apply advice *around* the supplied joinPoint (function)\n *\n * @param joinPoint A function that should have advice applied to\n * @param advice The around advice\n */\nexport function aroundJoinPoint, T>(joinPoint: F, advice: JoinPointAroundAdvice): F {\n\treturn adviseJoinPoint(joinPoint, 'around', advice);\n}\n\n/**\n * Attaches \"around\" advice around the original method.\n *\n * @param target Object whose method will be aspected\n * @param methodName Name of method to aspect\n * @param advice Advising function which will receive the original function\n * @return A handle which will remove the aspect when destroy is called\n */\nexport function aroundObject(\n\ttarget: Targetable,\n\tmethodName: string | symbol,\n\tadvice: ((previous: Function) => Function)\n): Handle {\n\tlet dispatcher: Dispatcher | undefined = getDispatcherObject(target, methodName);\n\tlet previous = dispatcher.around;\n\tlet advised: Function | undefined;\n\tif (advice) {\n\t\tadvised = advice(function(this: Dispatcher): any {\n\t\t\tif (previous && previous.advice) {\n\t\t\t\treturn previous.advice(this, arguments);\n\t\t\t}\n\t\t});\n\t}\n\n\tdispatcher.around = {\n\t\tadvice: function(target: any, args: any[]): any {\n\t\t\treturn advised ? advised.apply(target, args) : previous && previous.advice && previous.advice(target, args);\n\t\t}\n\t};\n\n\treturn createHandle(function() {\n\t\tadvised = dispatcher = undefined;\n\t});\n}\n\n/**\n * Attaches \"around\" advice around the original method.\n *\n * @param target Object whose method will be aspected\n * @param methodName Name of method to aspect\n * @param advice Advising function which will receive the original function\n * @return A handle which will remove the aspect when destroy is called\n */\nexport function around(\n\ttarget: Targetable,\n\tmethodName: string | symbol,\n\tadvice: ((previous: Function) => Function)\n): Handle;\n/**\n * Apply advice *around* the supplied joinPoint (function)\n *\n * @param joinPoint A function that should have advice applied to\n * @param advice The around advice\n */\nexport function around, T>(joinPoint: F, advice: JoinPointAroundAdvice): F;\nexport function around, T>(\n\tjoinPointOrTarget: F | Targetable,\n\tmethodNameOrAdvice: string | symbol | JoinPointAroundAdvice,\n\tobjectAdvice?: ((previous: Function) => Function)\n): Handle | F {\n\tif (typeof joinPointOrTarget === 'function') {\n\t\treturn aroundJoinPoint(joinPointOrTarget, >methodNameOrAdvice);\n\t} else {\n\t\treturn aroundObject(joinPointOrTarget, methodNameOrAdvice, objectAdvice!);\n\t}\n}\n\n/**\n * Apply advice *before* the supplied joinPoint (function)\n *\n * @param joinPoint A function that should have advice applied to\n * @param advice The before advice\n */\nexport function beforeJoinPoint>(joinPoint: F, advice: JoinPointBeforeAdvice): F {\n\treturn adviseJoinPoint(joinPoint, 'before', advice);\n}\n\n/**\n * Attaches \"before\" advice to be executed before the original method.\n *\n * @param target Object whose method will be aspected\n * @param methodName Name of method to aspect\n * @param advice Advising function which will receive the same arguments as the original, and may return new arguments\n * @return A handle which will remove the aspect when destroy is called\n */\nexport function beforeObject(\n\ttarget: Targetable,\n\tmethodName: string | symbol,\n\tadvice: (...originalArgs: any[]) => any[] | void\n): Handle {\n\treturn adviseObject(getDispatcherObject(target, methodName), 'before', advice);\n}\n\n/**\n * Attaches \"before\" advice to be executed before the original method.\n *\n * @param target Object whose method will be aspected\n * @param methodName Name of method to aspect\n * @param advice Advising function which will receive the same arguments as the original, and may return new arguments\n * @return A handle which will remove the aspect when destroy is called\n */\nexport function before(\n\ttarget: Targetable,\n\tmethodName: string | symbol,\n\tadvice: (...originalArgs: any[]) => any[] | void\n): Handle;\n/**\n * Apply advice *before* the supplied joinPoint (function)\n *\n * @param joinPoint A function that should have advice applied to\n * @param advice The before advice\n */\nexport function before>(joinPoint: F, advice: JoinPointBeforeAdvice): F;\nexport function before, T>(\n\tjoinPointOrTarget: F | Targetable,\n\tmethodNameOrAdvice: string | symbol | JoinPointBeforeAdvice,\n\tobjectAdvice?: ((...originalArgs: any[]) => any[] | void)\n): Handle | F {\n\tif (typeof joinPointOrTarget === 'function') {\n\t\treturn beforeJoinPoint(joinPointOrTarget, methodNameOrAdvice);\n\t} else {\n\t\treturn beforeObject(joinPointOrTarget, methodNameOrAdvice, objectAdvice!);\n\t}\n}\n\n/**\n * Attaches advice to be executed after the original method.\n * The advising function will receive the same arguments as the original method.\n * The value it returns will be returned from the method when it is called *unless* its return value is undefined.\n *\n * @param target Object whose method will be aspected\n * @param methodName Name of method to aspect\n * @param advice Advising function which will receive the same arguments as the original method\n * @return A handle which will remove the aspect when destroy is called\n */\nexport function on(target: Targetable, methodName: string | symbol, advice: (...originalArgs: any[]) => any): Handle {\n\treturn adviseObject(getDispatcherObject(target, methodName), 'after', advice, true);\n}\n"]} \ No newline at end of file diff --git a/deps/framework/core/aspect.mjs b/deps/framework/core/aspect.mjs deleted file mode 100644 index e06ef45bf0..0000000000 --- a/deps/framework/core/aspect.mjs +++ /dev/null @@ -1,327 +0,0 @@ -import WeakMap from '../shim/WeakMap'; -import { createHandle } from './lang'; -/** - * An internal type guard that determines if an value is MapLike or not - * - * @param value The value to guard against - */ -function isMapLike(value) { - return value && typeof value.get === 'function' && typeof value.set === 'function'; -} -/** - * A weak map of dispatchers used to apply the advice - */ -const dispatchAdviceMap = new WeakMap(); -/** - * A UID for tracking advice ordering - */ -let nextId = 0; -/** - * Internal function that advises a join point - * - * @param dispatcher The current advice dispatcher - * @param type The type of before or after advice to apply - * @param advice The advice to apply - * @param receiveArguments If true, the advice will receive the arguments passed to the join point - * @return The handle that will remove the advice - */ -function adviseObject(dispatcher, type, advice, receiveArguments) { - let previous = dispatcher && dispatcher[type]; - let advised = { - id: nextId++, - advice: advice, - receiveArguments: receiveArguments - }; - if (previous) { - if (type === 'after') { - // add the listener to the end of the list - // note that we had to change this loop a little bit to workaround a bizarre IE10 JIT bug - while (previous.next && (previous = previous.next)) { } - previous.next = advised; - advised.previous = previous; - } - else { - // add to the beginning - if (dispatcher) { - dispatcher.before = advised; - } - advised.next = previous; - previous.previous = advised; - } - } - else { - dispatcher && (dispatcher[type] = advised); - } - advice = previous = undefined; - return createHandle(function () { - let { previous = undefined, next = undefined } = advised || {}; - if (dispatcher && !previous && !next) { - dispatcher[type] = undefined; - } - else { - if (previous) { - previous.next = next; - } - else { - dispatcher && (dispatcher[type] = next); - } - if (next) { - next.previous = previous; - } - } - if (advised) { - delete advised.advice; - } - dispatcher = advised = undefined; - }); -} -/** - * Advise a join point (function) with supplied advice - * - * @param joinPoint The function to be advised - * @param type The type of advice to be applied - * @param advice The advice to apply - */ -function adviseJoinPoint(joinPoint, type, advice) { - let dispatcher; - if (type === 'around') { - dispatcher = getJoinPointDispatcher(advice.apply(this, [joinPoint])); - } - else { - dispatcher = getJoinPointDispatcher(joinPoint); - // cannot have undefined in map due to code logic, using ! - const adviceMap = dispatchAdviceMap.get(dispatcher); - if (type === 'before') { - (adviceMap.before || (adviceMap.before = [])).unshift(advice); - } - else { - (adviceMap.after || (adviceMap.after = [])).push(advice); - } - } - return dispatcher; -} -/** - * An internal function that resolves or creates the dispatcher for a given join point - * - * @param target The target object or map - * @param methodName The name of the method that the dispatcher should be resolved for - * @return The dispatcher - */ -function getDispatcherObject(target, methodName) { - const existing = isMapLike(target) ? target.get(methodName) : target && target[methodName]; - let dispatcher; - if (!existing || existing.target !== target) { - /* There is no existing dispatcher, therefore we will create one */ - dispatcher = function () { - let executionId = nextId; - let args = arguments; - let results; - let before = dispatcher.before; - while (before) { - if (before.advice) { - args = before.advice.apply(this, args) || args; - } - before = before.next; - } - if (dispatcher.around && dispatcher.around.advice) { - results = dispatcher.around.advice(this, args); - } - let after = dispatcher.after; - while (after && after.id !== undefined && after.id < executionId) { - if (after.advice) { - if (after.receiveArguments) { - let newResults = after.advice.apply(this, args); - results = newResults === undefined ? results : newResults; - } - else { - results = after.advice.call(this, results, args); - } - } - after = after.next; - } - return results; - }; - if (isMapLike(target)) { - target.set(methodName, dispatcher); - } - else { - target && (target[methodName] = dispatcher); - } - if (existing) { - dispatcher.around = { - advice: function (target, args) { - return existing.apply(target, args); - } - }; - } - dispatcher.target = target; - } - else { - dispatcher = existing; - } - return dispatcher; -} -/** - * Returns the dispatcher function for a given joinPoint (method/function) - * - * @param joinPoint The function that is to be advised - */ -function getJoinPointDispatcher(joinPoint) { - function dispatcher(...args) { - // cannot have undefined in map due to code logic, using ! - const { before, after, joinPoint } = dispatchAdviceMap.get(dispatcher); - if (before) { - args = before.reduce((previousArgs, advice) => { - const currentArgs = advice.apply(this, previousArgs); - return currentArgs || previousArgs; - }, args); - } - let result = joinPoint.apply(this, args); - if (after) { - result = after.reduce((previousResult, advice) => { - return advice.apply(this, [previousResult].concat(args)); - }, result); - } - return result; - } - /* We want to "clone" the advice that has been applied already, if this - * joinPoint is already advised */ - if (dispatchAdviceMap.has(joinPoint)) { - // cannot have undefined in map due to code logic, using ! - const adviceMap = dispatchAdviceMap.get(joinPoint); - let { before, after } = adviceMap; - if (before) { - before = before.slice(0); - } - if (after) { - after = after.slice(0); - } - dispatchAdviceMap.set(dispatcher, { - joinPoint: adviceMap.joinPoint, - before, - after - }); - } - else { - /* Otherwise, this is a new joinPoint, so we will create the advice map afresh */ - dispatchAdviceMap.set(dispatcher, { joinPoint }); - } - return dispatcher; -} -/** - * Apply advice *after* the supplied joinPoint (function) - * - * @param joinPoint A function that should have advice applied to - * @param advice The after advice - */ -function afterJoinPoint(joinPoint, advice) { - return adviseJoinPoint(joinPoint, 'after', advice); -} -/** - * Attaches "after" advice to be executed after the original method. - * The advising function will receive the original method's return value and arguments object. - * The value it returns will be returned from the method when it is called (even if the return value is undefined). - * - * @param target Object whose method will be aspected - * @param methodName Name of method to aspect - * @param advice Advising function which will receive the original method's return value and arguments object - * @return A handle which will remove the aspect when destroy is called - */ -function afterObject(target, methodName, advice) { - return adviseObject(getDispatcherObject(target, methodName), 'after', advice); -} -export function after(joinPointOrTarget, methodNameOrAdvice, objectAdvice) { - if (typeof joinPointOrTarget === 'function') { - return afterJoinPoint(joinPointOrTarget, methodNameOrAdvice); - } - else { - return afterObject(joinPointOrTarget, methodNameOrAdvice, objectAdvice); - } -} -/** - * Apply advice *around* the supplied joinPoint (function) - * - * @param joinPoint A function that should have advice applied to - * @param advice The around advice - */ -export function aroundJoinPoint(joinPoint, advice) { - return adviseJoinPoint(joinPoint, 'around', advice); -} -/** - * Attaches "around" advice around the original method. - * - * @param target Object whose method will be aspected - * @param methodName Name of method to aspect - * @param advice Advising function which will receive the original function - * @return A handle which will remove the aspect when destroy is called - */ -export function aroundObject(target, methodName, advice) { - let dispatcher = getDispatcherObject(target, methodName); - let previous = dispatcher.around; - let advised; - if (advice) { - advised = advice(function () { - if (previous && previous.advice) { - return previous.advice(this, arguments); - } - }); - } - dispatcher.around = { - advice: function (target, args) { - return advised ? advised.apply(target, args) : previous && previous.advice && previous.advice(target, args); - } - }; - return createHandle(function () { - advised = dispatcher = undefined; - }); -} -export function around(joinPointOrTarget, methodNameOrAdvice, objectAdvice) { - if (typeof joinPointOrTarget === 'function') { - return aroundJoinPoint(joinPointOrTarget, methodNameOrAdvice); - } - else { - return aroundObject(joinPointOrTarget, methodNameOrAdvice, objectAdvice); - } -} -/** - * Apply advice *before* the supplied joinPoint (function) - * - * @param joinPoint A function that should have advice applied to - * @param advice The before advice - */ -export function beforeJoinPoint(joinPoint, advice) { - return adviseJoinPoint(joinPoint, 'before', advice); -} -/** - * Attaches "before" advice to be executed before the original method. - * - * @param target Object whose method will be aspected - * @param methodName Name of method to aspect - * @param advice Advising function which will receive the same arguments as the original, and may return new arguments - * @return A handle which will remove the aspect when destroy is called - */ -export function beforeObject(target, methodName, advice) { - return adviseObject(getDispatcherObject(target, methodName), 'before', advice); -} -export function before(joinPointOrTarget, methodNameOrAdvice, objectAdvice) { - if (typeof joinPointOrTarget === 'function') { - return beforeJoinPoint(joinPointOrTarget, methodNameOrAdvice); - } - else { - return beforeObject(joinPointOrTarget, methodNameOrAdvice, objectAdvice); - } -} -/** - * Attaches advice to be executed after the original method. - * The advising function will receive the same arguments as the original method. - * The value it returns will be returned from the method when it is called *unless* its return value is undefined. - * - * @param target Object whose method will be aspected - * @param methodName Name of method to aspect - * @param advice Advising function which will receive the same arguments as the original method - * @return A handle which will remove the aspect when destroy is called - */ -export function on(target, methodName, advice) { - return adviseObject(getDispatcherObject(target, methodName), 'after', advice, true); -} -//# sourceMappingURL=aspect.mjs.map \ No newline at end of file diff --git a/deps/framework/core/aspect.mjs.map b/deps/framework/core/aspect.mjs.map deleted file mode 100644 index 1de41a6fd4..0000000000 --- a/deps/framework/core/aspect.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"aspect.mjs","sourceRoot":"","sources":["aspect.ts"],"names":[],"mappings":"AACA,OAAO,OAAO,MAAM,iBAAiB,CAAC;AACtC,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AAUtC;;;;GAIG;AACH,mBAAmB,KAAU;IAC5B,MAAM,CAAC,KAAK,IAAI,OAAO,KAAK,CAAC,GAAG,KAAK,UAAU,IAAI,OAAO,KAAK,CAAC,GAAG,KAAK,UAAU,CAAC;AACpF,CAAC;AAgFD;;GAEG;AACH,MAAM,iBAAiB,GAAG,IA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,YAAY,CAAC,iBAAiB,EAAmB,kBAAkB,EAAE,YAAa,CAAC,CAAC;IAC5F,CAAC;AACF,CAAC;AAED;;;;;GAKG;AACH,MAAM,0BAA0D,SAAY,EAAE,MAA6B;IAC1G,MAAM,CAAC,eAAe,CAAC,SAAS,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC;AACrD,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,uBACL,MAAkB,EAClB,UAA2B,EAC3B,MAAgD;IAEhD,MAAM,CAAC,YAAY,CAAC,mBAAmB,CAAC,MAAM,EAAE,UAAU,CAAC,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC;AAChF,CAAC;AAsBD,MAAM,iBACL,iBAAiC,EACjC,kBAA2D,EAC3D,YAAyD;IAEzD,EAAE,CAAC,CAAC,OAAO,iBAAiB,KAAK,UAAU,CAAC,CAAC,CAAC;QAC7C,MAAM,CAAC,eAAe,CAAC,iBAAiB,EAAyB,kBAAkB,CAAC,CAAC;IACtF,CAAC;IAAC,IAAI,CAAC,CAAC;QACP,MAAM,CAAC,YAAY,CAAC,iBAAiB,EAAmB,kBAAkB,EAAE,YAAa,CAAC,CAAC;IAC5F,CAAC;AACF,CAAC;AAED;;;;;;;;;GASG;AACH,MAAM,aAAa,MAAkB,EAAE,UAA2B,EAAE,MAAuC;IAC1G,MAAM,CAAC,YAAY,CAAC,mBAAmB,CAAC,MAAM,EAAE,UAAU,CAAC,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,CAAC;AACrF,CAAC","sourcesContent":["import { Handle } from './interfaces';\nimport WeakMap from '../shim/WeakMap';\nimport { createHandle } from './lang';\n\n/**\n * An object that provides the necessary APIs to be MapLike\n */\nexport interface MapLike {\n\tget(key: K): V;\n\tset(key: K, value?: V): this;\n}\n\n/**\n * An internal type guard that determines if an value is MapLike or not\n *\n * @param value The value to guard against\n */\nfunction isMapLike(value: any): value is MapLike {\n\treturn value && typeof value.get === 'function' && typeof value.set === 'function';\n}\n\nexport interface Indexable {\n\t[method: string]: any;\n}\n\n/**\n * The types of objects or maps where advice can be applied\n */\nexport type Targetable = MapLike | Indexable;\n\ntype AdviceType = 'before' | 'after' | 'around';\n\n/**\n * A meta data structure when applying advice\n */\ninterface Advised {\n\treadonly id?: number;\n\tadvice?: Function;\n\tprevious?: Advised;\n\tnext?: Advised;\n\treadonly receiveArguments?: boolean;\n}\n\n/**\n * A function that dispatches advice which is decorated with additional\n * meta data about the advice to apply\n */\ninterface Dispatcher {\n\t[type: string]: Advised | undefined;\n\t(): any;\n\ttarget: any;\n\tbefore?: Advised;\n\taround?: Advised;\n\tafter?: Advised;\n}\n\nexport interface JoinPointDispatchAdvice {\n\tbefore?: JoinPointBeforeAdvice[];\n\tafter?: JoinPointAfterAdvice[];\n\treadonly joinPoint: Function;\n}\n\nexport interface JoinPointAfterAdvice {\n\t/**\n\t * Advice which is applied *after*, receiving the result and arguments from the join point.\n\t *\n\t * @param result The result from the function being advised\n\t * @param args The arguments that were supplied to the advised function\n\t * @returns The value returned from the advice is then the result of calling the method\n\t */\n\t(result: T, ...args: any[]): T;\n}\n\nexport interface JoinPointAroundAdvice {\n\t/**\n\t * Advice which is applied *around*. The advising function receives the original function and\n\t * needs to return a new function which will then invoke the original function.\n\t *\n\t * @param origFn The original function\n\t * @returns A new function which will invoke the original function.\n\t */\n\t(origFn: GenericFunction): (...args: any[]) => T;\n}\n\nexport interface JoinPointBeforeAdvice {\n\t/**\n\t * Advice which is applied *before*, receiving the original arguments, if the advising\n\t * function returns a value, it is passed further along taking the place of the original\n\t * arguments.\n\t *\n\t * @param args The arguments the method was called with\n\t */\n\t(...args: any[]): any[] | void;\n}\n\nexport interface GenericFunction {\n\t(...args: any[]): T;\n}\n\n/**\n * A weak map of dispatchers used to apply the advice\n */\nconst dispatchAdviceMap = new WeakMap>();\n\n/**\n * A UID for tracking advice ordering\n */\nlet nextId = 0;\n\n/**\n * Internal function that advises a join point\n *\n * @param dispatcher The current advice dispatcher\n * @param type The type of before or after advice to apply\n * @param advice The advice to apply\n * @param receiveArguments If true, the advice will receive the arguments passed to the join point\n * @return The handle that will remove the advice\n */\nfunction adviseObject(\n\tdispatcher: Dispatcher | undefined,\n\ttype: AdviceType,\n\tadvice: Function | undefined,\n\treceiveArguments?: boolean\n): Handle {\n\tlet previous = dispatcher && dispatcher[type];\n\tlet advised: Advised | undefined = {\n\t\tid: nextId++,\n\t\tadvice: advice,\n\t\treceiveArguments: receiveArguments\n\t};\n\n\tif (previous) {\n\t\tif (type === 'after') {\n\t\t\t// add the listener to the end of the list\n\t\t\t// note that we had to change this loop a little bit to workaround a bizarre IE10 JIT bug\n\t\t\twhile (previous.next && (previous = previous.next)) {}\n\t\t\tprevious.next = advised;\n\t\t\tadvised.previous = previous;\n\t\t} else {\n\t\t\t// add to the beginning\n\t\t\tif (dispatcher) {\n\t\t\t\tdispatcher.before = advised;\n\t\t\t}\n\t\t\tadvised.next = previous;\n\t\t\tprevious.previous = advised;\n\t\t}\n\t} else {\n\t\tdispatcher && (dispatcher[type] = advised);\n\t}\n\n\tadvice = previous = undefined;\n\n\treturn createHandle(function() {\n\t\tlet { previous = undefined, next = undefined } = advised || {};\n\n\t\tif (dispatcher && !previous && !next) {\n\t\t\tdispatcher[type] = undefined;\n\t\t} else {\n\t\t\tif (previous) {\n\t\t\t\tprevious.next = next;\n\t\t\t} else {\n\t\t\t\tdispatcher && (dispatcher[type] = next);\n\t\t\t}\n\n\t\t\tif (next) {\n\t\t\t\tnext.previous = previous;\n\t\t\t}\n\t\t}\n\t\tif (advised) {\n\t\t\tdelete advised.advice;\n\t\t}\n\t\tdispatcher = advised = undefined;\n\t});\n}\n\n/**\n * Advise a join point (function) with supplied advice\n *\n * @param joinPoint The function to be advised\n * @param type The type of advice to be applied\n * @param advice The advice to apply\n */\nfunction adviseJoinPoint, T>(\n\tthis: any,\n\tjoinPoint: F,\n\ttype: AdviceType,\n\tadvice: JoinPointBeforeAdvice | JoinPointAfterAdvice | JoinPointAroundAdvice\n): F {\n\tlet dispatcher: F;\n\tif (type === 'around') {\n\t\tdispatcher = getJoinPointDispatcher(advice.apply(this, [joinPoint]));\n\t} else {\n\t\tdispatcher = getJoinPointDispatcher(joinPoint);\n\t\t// cannot have undefined in map due to code logic, using !\n\t\tconst adviceMap = dispatchAdviceMap.get(dispatcher)!;\n\t\tif (type === 'before') {\n\t\t\t(adviceMap.before || (adviceMap.before = [])).unshift(advice);\n\t\t} else {\n\t\t\t(adviceMap.after || (adviceMap.after = [])).push(advice);\n\t\t}\n\t}\n\treturn dispatcher;\n}\n\n/**\n * An internal function that resolves or creates the dispatcher for a given join point\n *\n * @param target The target object or map\n * @param methodName The name of the method that the dispatcher should be resolved for\n * @return The dispatcher\n */\nfunction getDispatcherObject(target: Targetable, methodName: string | symbol): Dispatcher {\n\tconst existing = isMapLike(target) ? target.get(methodName) : target && target[methodName];\n\tlet dispatcher: Dispatcher;\n\n\tif (!existing || existing.target !== target) {\n\t\t/* There is no existing dispatcher, therefore we will create one */\n\t\tdispatcher = function(this: Dispatcher): any {\n\t\t\tlet executionId = nextId;\n\t\t\tlet args = arguments;\n\t\t\tlet results: any;\n\t\t\tlet before = dispatcher.before;\n\n\t\t\twhile (before) {\n\t\t\t\tif (before.advice) {\n\t\t\t\t\targs = before.advice.apply(this, args) || args;\n\t\t\t\t}\n\t\t\t\tbefore = before.next;\n\t\t\t}\n\n\t\t\tif (dispatcher.around && dispatcher.around.advice) {\n\t\t\t\tresults = dispatcher.around.advice(this, args);\n\t\t\t}\n\n\t\t\tlet after = dispatcher.after;\n\t\t\twhile (after && after.id !== undefined && after.id < executionId) {\n\t\t\t\tif (after.advice) {\n\t\t\t\t\tif (after.receiveArguments) {\n\t\t\t\t\t\tlet newResults = after.advice.apply(this, args);\n\t\t\t\t\t\tresults = newResults === undefined ? results : newResults;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tresults = after.advice.call(this, results, args);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tafter = after.next;\n\t\t\t}\n\n\t\t\treturn results;\n\t\t};\n\n\t\tif (isMapLike(target)) {\n\t\t\ttarget.set(methodName, dispatcher);\n\t\t} else {\n\t\t\ttarget && (target[methodName] = dispatcher);\n\t\t}\n\n\t\tif (existing) {\n\t\t\tdispatcher.around = {\n\t\t\t\tadvice: function(target: any, args: any[]): any {\n\t\t\t\t\treturn existing.apply(target, args);\n\t\t\t\t}\n\t\t\t};\n\t\t}\n\n\t\tdispatcher.target = target;\n\t} else {\n\t\tdispatcher = existing;\n\t}\n\n\treturn dispatcher;\n}\n\n/**\n * Returns the dispatcher function for a given joinPoint (method/function)\n *\n * @param joinPoint The function that is to be advised\n */\nfunction getJoinPointDispatcher, T>(joinPoint: F): F {\n\tfunction dispatcher(this: Function, ...args: any[]): T {\n\t\t// cannot have undefined in map due to code logic, using !\n\t\tconst { before, after, joinPoint } = dispatchAdviceMap.get(dispatcher)!;\n\t\tif (before) {\n\t\t\targs = before.reduce((previousArgs, advice) => {\n\t\t\t\tconst currentArgs = advice.apply(this, previousArgs);\n\t\t\t\treturn currentArgs || previousArgs;\n\t\t\t}, args);\n\t\t}\n\t\tlet result = joinPoint.apply(this, args);\n\t\tif (after) {\n\t\t\tresult = after.reduce((previousResult, advice) => {\n\t\t\t\treturn advice.apply(this, [previousResult].concat(args));\n\t\t\t}, result);\n\t\t}\n\t\treturn result;\n\t}\n\n\t/* We want to \"clone\" the advice that has been applied already, if this\n\t * joinPoint is already advised */\n\tif (dispatchAdviceMap.has(joinPoint)) {\n\t\t// cannot have undefined in map due to code logic, using !\n\t\tconst adviceMap = dispatchAdviceMap.get(joinPoint)!;\n\t\tlet { before, after } = adviceMap;\n\t\tif (before) {\n\t\t\tbefore = before.slice(0);\n\t\t}\n\t\tif (after) {\n\t\t\tafter = after.slice(0);\n\t\t}\n\t\tdispatchAdviceMap.set(dispatcher, {\n\t\t\tjoinPoint: adviceMap.joinPoint,\n\t\t\tbefore,\n\t\t\tafter\n\t\t});\n\t} else {\n\t\t/* Otherwise, this is a new joinPoint, so we will create the advice map afresh */\n\t\tdispatchAdviceMap.set(dispatcher, { joinPoint });\n\t}\n\n\treturn dispatcher as F;\n}\n\n/**\n * Apply advice *after* the supplied joinPoint (function)\n *\n * @param joinPoint A function that should have advice applied to\n * @param advice The after advice\n */\nfunction afterJoinPoint, T>(joinPoint: F, advice: JoinPointAfterAdvice): F {\n\treturn adviseJoinPoint(joinPoint, 'after', advice);\n}\n\n/**\n * Attaches \"after\" advice to be executed after the original method.\n * The advising function will receive the original method's return value and arguments object.\n * The value it returns will be returned from the method when it is called (even if the return value is undefined).\n *\n * @param target Object whose method will be aspected\n * @param methodName Name of method to aspect\n * @param advice Advising function which will receive the original method's return value and arguments object\n * @return A handle which will remove the aspect when destroy is called\n */\nfunction afterObject(\n\ttarget: Targetable,\n\tmethodName: string | symbol,\n\tadvice: (originalReturn: any, originalArgs: IArguments) => any\n): Handle {\n\treturn adviseObject(getDispatcherObject(target, methodName), 'after', advice);\n}\n\n/**\n * Attaches \"after\" advice to be executed after the original method.\n * The advising function will receive the original method's return value and arguments object.\n * The value it returns will be returned from the method when it is called (even if the return value is undefined).\n *\n * @param target Object whose method will be aspected\n * @param methodName Name of method to aspect\n * @param advice Advising function which will receive the original method's return value and arguments object\n * @return A handle which will remove the aspect when destroy is called\n */\nexport function after(\n\ttarget: Targetable,\n\tmethodName: string | symbol,\n\tadvice: (originalReturn: any, originalArgs: IArguments) => any\n): Handle;\n/**\n * Apply advice *after* the supplied joinPoint (function)\n *\n * @param joinPoint A function that should have advice applied to\n * @param advice The after advice\n */\nexport function after, T>(joinPoint: F, advice: JoinPointAfterAdvice): F;\nexport function after, T>(\n\tjoinPointOrTarget: F | Targetable,\n\tmethodNameOrAdvice: string | symbol | JoinPointAfterAdvice,\n\tobjectAdvice?: (originalReturn: any, originalArgs: IArguments) => any\n): Handle | F {\n\tif (typeof joinPointOrTarget === 'function') {\n\t\treturn afterJoinPoint(joinPointOrTarget, >methodNameOrAdvice);\n\t} else {\n\t\treturn afterObject(joinPointOrTarget, methodNameOrAdvice, objectAdvice!);\n\t}\n}\n\n/**\n * Apply advice *around* the supplied joinPoint (function)\n *\n * @param joinPoint A function that should have advice applied to\n * @param advice The around advice\n */\nexport function aroundJoinPoint, T>(joinPoint: F, advice: JoinPointAroundAdvice): F {\n\treturn adviseJoinPoint(joinPoint, 'around', advice);\n}\n\n/**\n * Attaches \"around\" advice around the original method.\n *\n * @param target Object whose method will be aspected\n * @param methodName Name of method to aspect\n * @param advice Advising function which will receive the original function\n * @return A handle which will remove the aspect when destroy is called\n */\nexport function aroundObject(\n\ttarget: Targetable,\n\tmethodName: string | symbol,\n\tadvice: ((previous: Function) => Function)\n): Handle {\n\tlet dispatcher: Dispatcher | undefined = getDispatcherObject(target, methodName);\n\tlet previous = dispatcher.around;\n\tlet advised: Function | undefined;\n\tif (advice) {\n\t\tadvised = advice(function(this: Dispatcher): any {\n\t\t\tif (previous && previous.advice) {\n\t\t\t\treturn previous.advice(this, arguments);\n\t\t\t}\n\t\t});\n\t}\n\n\tdispatcher.around = {\n\t\tadvice: function(target: any, args: any[]): any {\n\t\t\treturn advised ? advised.apply(target, args) : previous && previous.advice && previous.advice(target, args);\n\t\t}\n\t};\n\n\treturn createHandle(function() {\n\t\tadvised = dispatcher = undefined;\n\t});\n}\n\n/**\n * Attaches \"around\" advice around the original method.\n *\n * @param target Object whose method will be aspected\n * @param methodName Name of method to aspect\n * @param advice Advising function which will receive the original function\n * @return A handle which will remove the aspect when destroy is called\n */\nexport function around(\n\ttarget: Targetable,\n\tmethodName: string | symbol,\n\tadvice: ((previous: Function) => Function)\n): Handle;\n/**\n * Apply advice *around* the supplied joinPoint (function)\n *\n * @param joinPoint A function that should have advice applied to\n * @param advice The around advice\n */\nexport function around, T>(joinPoint: F, advice: JoinPointAroundAdvice): F;\nexport function around, T>(\n\tjoinPointOrTarget: F | Targetable,\n\tmethodNameOrAdvice: string | symbol | JoinPointAroundAdvice,\n\tobjectAdvice?: ((previous: Function) => Function)\n): Handle | F {\n\tif (typeof joinPointOrTarget === 'function') {\n\t\treturn aroundJoinPoint(joinPointOrTarget, >methodNameOrAdvice);\n\t} else {\n\t\treturn aroundObject(joinPointOrTarget, methodNameOrAdvice, objectAdvice!);\n\t}\n}\n\n/**\n * Apply advice *before* the supplied joinPoint (function)\n *\n * @param joinPoint A function that should have advice applied to\n * @param advice The before advice\n */\nexport function beforeJoinPoint>(joinPoint: F, advice: JoinPointBeforeAdvice): F {\n\treturn adviseJoinPoint(joinPoint, 'before', advice);\n}\n\n/**\n * Attaches \"before\" advice to be executed before the original method.\n *\n * @param target Object whose method will be aspected\n * @param methodName Name of method to aspect\n * @param advice Advising function which will receive the same arguments as the original, and may return new arguments\n * @return A handle which will remove the aspect when destroy is called\n */\nexport function beforeObject(\n\ttarget: Targetable,\n\tmethodName: string | symbol,\n\tadvice: (...originalArgs: any[]) => any[] | void\n): Handle {\n\treturn adviseObject(getDispatcherObject(target, methodName), 'before', advice);\n}\n\n/**\n * Attaches \"before\" advice to be executed before the original method.\n *\n * @param target Object whose method will be aspected\n * @param methodName Name of method to aspect\n * @param advice Advising function which will receive the same arguments as the original, and may return new arguments\n * @return A handle which will remove the aspect when destroy is called\n */\nexport function before(\n\ttarget: Targetable,\n\tmethodName: string | symbol,\n\tadvice: (...originalArgs: any[]) => any[] | void\n): Handle;\n/**\n * Apply advice *before* the supplied joinPoint (function)\n *\n * @param joinPoint A function that should have advice applied to\n * @param advice The before advice\n */\nexport function before>(joinPoint: F, advice: JoinPointBeforeAdvice): F;\nexport function before, T>(\n\tjoinPointOrTarget: F | Targetable,\n\tmethodNameOrAdvice: string | symbol | JoinPointBeforeAdvice,\n\tobjectAdvice?: ((...originalArgs: any[]) => any[] | void)\n): Handle | F {\n\tif (typeof joinPointOrTarget === 'function') {\n\t\treturn beforeJoinPoint(joinPointOrTarget, methodNameOrAdvice);\n\t} else {\n\t\treturn beforeObject(joinPointOrTarget, methodNameOrAdvice, objectAdvice!);\n\t}\n}\n\n/**\n * Attaches advice to be executed after the original method.\n * The advising function will receive the same arguments as the original method.\n * The value it returns will be returned from the method when it is called *unless* its return value is undefined.\n *\n * @param target Object whose method will be aspected\n * @param methodName Name of method to aspect\n * @param advice Advising function which will receive the same arguments as the original method\n * @return A handle which will remove the aspect when destroy is called\n */\nexport function on(target: Targetable, methodName: string | symbol, advice: (...originalArgs: any[]) => any): Handle {\n\treturn adviseObject(getDispatcherObject(target, methodName), 'after', advice, true);\n}\n"]} \ No newline at end of file diff --git a/deps/framework/core/async/ExtensiblePromise.d.ts b/deps/framework/core/async/ExtensiblePromise.d.ts deleted file mode 100644 index 8fb9cf82a5..0000000000 --- a/deps/framework/core/async/ExtensiblePromise.d.ts +++ /dev/null @@ -1,139 +0,0 @@ -import { Thenable } from '../../shim/interfaces'; -import { Iterable } from '../../shim/iterator'; -import { Executor } from '../../shim/Promise'; -import '../../shim/Symbol'; -/** - * Take a list of values, and if any are ExtensiblePromise objects, insert the wrapped Promise in its place, - * otherwise use the original object. We use this to help use the native Promise methods like `all` and `race`. - * - * @param iterable The list of objects to iterate over - * @returns {any[]} The list of objects, as an array, with ExtensiblePromises being replaced by Promises. - */ -export declare function unwrapPromises(iterable: Iterable | any[]): any[]; -export declare type DictionaryOfPromises = { - [_: string]: T | Promise | Thenable; -}; -export declare type ListOfPromises = Iterable>; -/** - * An extensible base to allow Promises to be extended in ES5. This class basically wraps a native Promise object, - * giving an API like a native promise. - */ -export declare class ExtensiblePromise { - /** - * Return a rejected promise wrapped in an ExtensiblePromise - * - * @param reason The reason for the rejection - * @returns An extensible promise - */ - static reject(reason?: any): ExtensiblePromise; - /** - * Return a resolved promise wrapped in an ExtensiblePromise - * - * @param value The value to resolve the promise with - * - * @returns An extensible promise - */ - static resolve

>(): P; - /** - * Return a resolved promise wrapped in an ExtensiblePromise - * - * @param value The value to resolve the promise with - * - * @returns An extensible promise - */ - static resolve>(value: T | PromiseLike): P; - /** - * Return a ExtensiblePromise that resolves when all of the passed in objects have resolved. When used with a key/value - * pair, the returned promise's argument is a key/value pair of the original keys with their resolved values. - * - * @example - * ExtensiblePromise.all({ one: 1, two: 2 }).then(results => console.log(results)); - * // { one: 1, two: 2 } - * - * @param iterable An iterable of values to resolve, or a key/value pair of values to resolve. These can be Promises, ExtensiblePromises, or other objects - * @returns An extensible promise - */ - static all(iterable: DictionaryOfPromises): ExtensiblePromise<{ - [key: string]: T; - }>; - /** - * Return a ExtensiblePromise that resolves when all of the passed in objects have resolved. When used with a key/value - * pair, the returned promise's argument is a key/value pair of the original keys with their resolved values. - * - * @example - * ExtensiblePromise.all({ one: 1, two: 2 }).then(results => console.log(results)); - * // { one: 1, two: 2 } - * - * @param iterable An iterable of values to resolve, or a key/value pair of values to resolve. These can be Promises, ExtensiblePromises, or other objects - * @returns An extensible promise - */ - static all(iterable: (T | Thenable)[]): ExtensiblePromise; - /** - * Return a ExtensiblePromise that resolves when all of the passed in objects have resolved. When used with a key/value - * pair, the returned promise's argument is a key/value pair of the original keys with their resolved values. - * - * @example - * ExtensiblePromise.all({ one: 1, two: 2 }).then(results => console.log(results)); - * // { one: 1, two: 2 } - * - * @param iterable An iterable of values to resolve, or a key/value pair of values to resolve. These can be Promises, ExtensiblePromises, or other objects - * @returns An extensible promise - */ - static all(iterable: T | Thenable): ExtensiblePromise; - /** - * Return a ExtensiblePromise that resolves when all of the passed in objects have resolved. When used with a key/value - * pair, the returned promise's argument is a key/value pair of the original keys with their resolved values. - * - * @example - * ExtensiblePromise.all({ one: 1, two: 2 }).then(results => console.log(results)); - * // { one: 1, two: 2 } - * - * @param iterable An iterable of values to resolve, or a key/value pair of values to resolve. These can be Promises, ExtensiblePromises, or other objects - * @returns An extensible promise - */ - static all(iterable: ListOfPromises): ExtensiblePromise; - /** - * Return a ExtensiblePromise that resolves when one of the passed in objects have resolved - * - * @param iterable An iterable of values to resolve. These can be Promises, ExtensiblePromises, or other objects - * @returns {ExtensiblePromise} - */ - static race(iterable: Iterable> | (T | PromiseLike)[]): ExtensiblePromise; - /** - * @type {Promise} - * The wrapped promise - */ - readonly _promise: Promise; - /** - * Creates a new extended Promise. - * - * @constructor - * - * @param executor - * The executor function is called immediately when the Promise is instantiated. It is responsible for - * starting the asynchronous operation when it is invoked. - * - * The executor must call either the passed `resolve` function when the asynchronous operation has completed - * successfully, or the `reject` function when the operation fails. - */ - constructor(executor: Executor); - /** - * Adds a callback to be invoked when the wrapped Promise is rejected. - * - * @param {Function} onRejected A function to call to handle the error. The parameter to the function will be the caught error. - * - * @returns {ExtensiblePromise} - */ - catch(onRejected?: ((reason: any) => TResult | PromiseLike) | undefined | null): ExtensiblePromise; - /** - * Adds a callback to be invoked when the wrapped Promise resolves or is rejected. - * - * @param {Function} onFulfilled A function to call to handle the resolution. The paramter to the function will be the resolved value, if any. - * @param {Function} onRejected A function to call to handle the error. The parameter to the function will be the caught error. - * - * @returns {ExtensiblePromise} - */ - then(onFulfilled?: ((value: T) => TResult1 | PromiseLike) | undefined | null, onRejected?: ((reason: any) => TResult2 | PromiseLike | void) | undefined | null): ExtensiblePromise; - readonly [Symbol.toStringTag]: 'Promise'; -} -export default ExtensiblePromise; diff --git a/deps/framework/core/async/ExtensiblePromise.js b/deps/framework/core/async/ExtensiblePromise.js deleted file mode 100644 index 7e1cd3b72a..0000000000 --- a/deps/framework/core/async/ExtensiblePromise.js +++ /dev/null @@ -1,168 +0,0 @@ -(function (factory) { - if (typeof module === "object" && typeof module.exports === "object") { - var v = factory(require, exports); - if (v !== undefined) module.exports = v; - } - else if (typeof define === "function" && define.amd) { - define(["require", "exports", "tslib", "../../shim/iterator", "../../shim/Promise", "../../shim/Symbol"], factory); - } -})(function (require, exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - var tslib_1 = require("tslib"); - var iterator_1 = require("../../shim/iterator"); - var Promise_1 = require("../../shim/Promise"); - require("../../shim/Symbol"); - /** - * Take a list of values, and if any are ExtensiblePromise objects, insert the wrapped Promise in its place, - * otherwise use the original object. We use this to help use the native Promise methods like `all` and `race`. - * - * @param iterable The list of objects to iterate over - * @returns {any[]} The list of objects, as an array, with ExtensiblePromises being replaced by Promises. - */ - function unwrapPromises(iterable) { - var unwrapped = []; - if (iterator_1.isArrayLike(iterable)) { - for (var i = 0; i < iterable.length; i++) { - var item = iterable[i]; - unwrapped.push(item instanceof ExtensiblePromise ? item._promise : item); - } - } - else { - try { - for (var iterable_1 = tslib_1.__values(iterable), iterable_1_1 = iterable_1.next(); !iterable_1_1.done; iterable_1_1 = iterable_1.next()) { - var item = iterable_1_1.value; - unwrapped.push(item instanceof ExtensiblePromise ? item._promise : item); - } - } - catch (e_1_1) { e_1 = { error: e_1_1 }; } - finally { - try { - if (iterable_1_1 && !iterable_1_1.done && (_a = iterable_1.return)) _a.call(iterable_1); - } - finally { if (e_1) throw e_1.error; } - } - } - return unwrapped; - var e_1, _a; - } - exports.unwrapPromises = unwrapPromises; - /** - * An extensible base to allow Promises to be extended in ES5. This class basically wraps a native Promise object, - * giving an API like a native promise. - */ - var ExtensiblePromise = /** @class */ (function () { - /** - * Creates a new extended Promise. - * - * @constructor - * - * @param executor - * The executor function is called immediately when the Promise is instantiated. It is responsible for - * starting the asynchronous operation when it is invoked. - * - * The executor must call either the passed `resolve` function when the asynchronous operation has completed - * successfully, or the `reject` function when the operation fails. - */ - function ExtensiblePromise(executor) { - this._promise = new Promise_1.default(executor); - } - /** - * Return a rejected promise wrapped in an ExtensiblePromise - * - * @param reason The reason for the rejection - * @returns An extensible promise - */ - ExtensiblePromise.reject = function (reason) { - return new this(function (resolve, reject) { return reject(reason); }); - }; - ExtensiblePromise.resolve = function (value) { - return new this(function (resolve, reject) { return resolve(value); }); - }; - /** - * Return a ExtensiblePromise that resolves when all of the passed in objects have resolved. When used with a key/value - * pair, the returned promise's argument is a key/value pair of the original keys with their resolved values. - * - * @example - * ExtensiblePromise.all({ one: 1, two: 2 }).then(results => console.log(results)); - * // { one: 1, two: 2 } - * - * @param iterable An iterable of values to resolve, or a key/value pair of values to resolve. These can be Promises, ExtensiblePromises, or other objects - * @returns An extensible promise - */ - ExtensiblePromise.all = function (iterable) { - if (!iterator_1.isArrayLike(iterable) && !iterator_1.isIterable(iterable)) { - var promiseKeys_1 = Object.keys(iterable); - return new this(function (resolve, reject) { - Promise_1.default.all(promiseKeys_1.map(function (key) { return iterable[key]; })).then(function (promiseResults) { - var returnValue = {}; - promiseResults.forEach(function (value, index) { - returnValue[promiseKeys_1[index]] = value; - }); - resolve(returnValue); - }, reject); - }); - } - return new this(function (resolve, reject) { - Promise_1.default.all(unwrapPromises(iterable)).then(resolve, reject); - }); - }; - /** - * Return a ExtensiblePromise that resolves when one of the passed in objects have resolved - * - * @param iterable An iterable of values to resolve. These can be Promises, ExtensiblePromises, or other objects - * @returns {ExtensiblePromise} - */ - ExtensiblePromise.race = function (iterable) { - return new this(function (resolve, reject) { - Promise_1.default.race(unwrapPromises(iterable)).then(resolve, reject); - }); - }; - /** - * Adds a callback to be invoked when the wrapped Promise is rejected. - * - * @param {Function} onRejected A function to call to handle the error. The parameter to the function will be the caught error. - * - * @returns {ExtensiblePromise} - */ - ExtensiblePromise.prototype.catch = function (onRejected) { - return this.then(undefined, onRejected); - }; - /** - * Adds a callback to be invoked when the wrapped Promise resolves or is rejected. - * - * @param {Function} onFulfilled A function to call to handle the resolution. The paramter to the function will be the resolved value, if any. - * @param {Function} onRejected A function to call to handle the error. The parameter to the function will be the caught error. - * - * @returns {ExtensiblePromise} - */ - ExtensiblePromise.prototype.then = function (onFulfilled, onRejected) { - var _this = this; - var executor = function (resolve, reject) { - function handler(rejected, valueOrError) { - var callback = rejected ? onRejected : onFulfilled; - if (typeof callback === 'function') { - try { - resolve(callback(valueOrError)); - } - catch (error) { - reject(error); - } - } - else if (rejected) { - reject(valueOrError); - } - else { - resolve(valueOrError); - } - } - _this._promise.then(handler.bind(null, false), handler.bind(null, true)); - }; - return new this.constructor(executor); - }; - return ExtensiblePromise; - }()); - exports.ExtensiblePromise = ExtensiblePromise; - exports.default = ExtensiblePromise; -}); -//# sourceMappingURL=ExtensiblePromise.js.map \ No newline at end of file diff --git a/deps/framework/core/async/ExtensiblePromise.js.map b/deps/framework/core/async/ExtensiblePromise.js.map deleted file mode 100644 index 90e8565f5a..0000000000 --- a/deps/framework/core/async/ExtensiblePromise.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"ExtensiblePromise.js","sourceRoot":"","sources":["ExtensiblePromise.ts"],"names":[],"mappings":";;;;;;;;;;;;IACA,gDAAwE;IACxE,8CAAuD;IACvD,6BAA2B;IAE3B;;;;;;OAMG;IACH,wBAA+B,QAA+B;QAC7D,IAAM,SAAS,GAAU,EAAE,CAAC;QAE5B,EAAE,CAAC,CAAC,sBAAW,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;YAC3B,GAAG,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,QAAQ,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;gBAC1C,IAAM,IAAI,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC;gBACzB,SAAS,CAAC,IAAI,CAAC,IAAI,YAAY,iBAAiB,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;YAC1E,CAAC;QACF,CAAC;QAAC,IAAI,CAAC,CAAC;;gBACP,GAAG,CAAC,CAAe,IAAA,aAAA,iBAAA,QAAQ,CAAA,kCAAA;oBAAtB,IAAM,IAAI,qBAAA;oBACd,SAAS,CAAC,IAAI,CAAC,IAAI,YAAY,iBAAiB,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;iBACzE;;;;;;;;;QACF,CAAC;QAED,MAAM,CAAC,SAAS,CAAC;;IAClB,CAAC;IAfD,wCAeC;IAKD;;;OAGG;IACH;QAiJC;;;;;;;;;;;WAWG;QACH,2BAAY,QAAqB;YAChC,IAAI,CAAC,QAAQ,GAAG,IAAI,iBAAO,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AC;gBACF,CAAC;gBAED,KAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,EAAE,KAAK,CAAC,EAAE,OAAO,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC;YACzE,CAAC,CAAC;YAEF,MAAM,CAAC,IAAK,IAAI,CAAC,WAAwC,CAAC,QAAQ,CAAC,CAAC;QACrE,CAAC;QAGF,wBAAC;IAAD,CAAC,AAlND,IAkNC;IAlNY,8CAAiB;IAoN9B,kBAAe,iBAAiB,CAAC","sourcesContent":["import { Thenable } from '../../shim/interfaces';\nimport { isArrayLike, isIterable, Iterable } from '../../shim/iterator';\nimport Promise, { Executor } from '../../shim/Promise';\nimport '../../shim/Symbol';\n\n/**\n * Take a list of values, and if any are ExtensiblePromise objects, insert the wrapped Promise in its place,\n * otherwise use the original object. We use this to help use the native Promise methods like `all` and `race`.\n *\n * @param iterable The list of objects to iterate over\n * @returns {any[]} The list of objects, as an array, with ExtensiblePromises being replaced by Promises.\n */\nexport function unwrapPromises(iterable: Iterable | any[]): any[] {\n\tconst unwrapped: any[] = [];\n\n\tif (isArrayLike(iterable)) {\n\t\tfor (let i = 0; i < iterable.length; i++) {\n\t\t\tconst item = iterable[i];\n\t\t\tunwrapped.push(item instanceof ExtensiblePromise ? item._promise : item);\n\t\t}\n\t} else {\n\t\tfor (const item of iterable) {\n\t\t\tunwrapped.push(item instanceof ExtensiblePromise ? item._promise : item);\n\t\t}\n\t}\n\n\treturn unwrapped;\n}\n\nexport type DictionaryOfPromises = { [_: string]: T | Promise | Thenable };\nexport type ListOfPromises = Iterable>;\n\n/**\n * An extensible base to allow Promises to be extended in ES5. This class basically wraps a native Promise object,\n * giving an API like a native promise.\n */\nexport class ExtensiblePromise {\n\t/**\n\t * Return a rejected promise wrapped in an ExtensiblePromise\n\t *\n\t * @param reason The reason for the rejection\n\t * @returns An extensible promise\n\t */\n\tstatic reject(reason?: any): ExtensiblePromise;\n\n\t/**\n\t * Return a rejected promise wrapped in an ExtensiblePromise\n\t *\n\t * @param reason The reason for the rejection\n\t * @returns An extensible promise\n\t */\n\tstatic reject(reason?: any): ExtensiblePromise {\n\t\treturn new this((resolve, reject) => reject(reason));\n\t}\n\n\t/**\n\t * Return a resolved promise wrapped in an ExtensiblePromise\n\t *\n\t * @param value The value to resolve the promise with\n\t *\n\t * @returns An extensible promise\n\t */\n\tstatic resolve

>(): P;\n\n\t/**\n\t * Return a resolved promise wrapped in an ExtensiblePromise\n\t *\n\t * @param value The value to resolve the promise with\n\t *\n\t * @returns An extensible promise\n\t */\n\tstatic resolve>(value: T | PromiseLike): P;\n\tstatic resolve(value?: any | PromiseLike): ExtensiblePromise {\n\t\treturn new this((resolve, reject) => resolve(value));\n\t}\n\n\t/**\n\t * Return a ExtensiblePromise that resolves when all of the passed in objects have resolved. When used with a key/value\n\t * pair, the returned promise's argument is a key/value pair of the original keys with their resolved values.\n\t *\n\t * @example\n\t * ExtensiblePromise.all({ one: 1, two: 2 }).then(results => console.log(results));\n\t * // { one: 1, two: 2 }\n\t *\n\t * @param iterable An iterable of values to resolve, or a key/value pair of values to resolve. These can be Promises, ExtensiblePromises, or other objects\n\t * @returns An extensible promise\n\t */\n\tstatic all(iterable: DictionaryOfPromises): ExtensiblePromise<{ [key: string]: T }>;\n\n\t/**\n\t * Return a ExtensiblePromise that resolves when all of the passed in objects have resolved. When used with a key/value\n\t * pair, the returned promise's argument is a key/value pair of the original keys with their resolved values.\n\t *\n\t * @example\n\t * ExtensiblePromise.all({ one: 1, two: 2 }).then(results => console.log(results));\n\t * // { one: 1, two: 2 }\n\t *\n\t * @param iterable An iterable of values to resolve, or a key/value pair of values to resolve. These can be Promises, ExtensiblePromises, or other objects\n\t * @returns An extensible promise\n\t */\n\tstatic all(iterable: (T | Thenable)[]): ExtensiblePromise;\n\n\t/**\n\t * Return a ExtensiblePromise that resolves when all of the passed in objects have resolved. When used with a key/value\n\t * pair, the returned promise's argument is a key/value pair of the original keys with their resolved values.\n\t *\n\t * @example\n\t * ExtensiblePromise.all({ one: 1, two: 2 }).then(results => console.log(results));\n\t * // { one: 1, two: 2 }\n\t *\n\t * @param iterable An iterable of values to resolve, or a key/value pair of values to resolve. These can be Promises, ExtensiblePromises, or other objects\n\t * @returns An extensible promise\n\t */\n\tstatic all(iterable: T | Thenable): ExtensiblePromise;\n\n\t/**\n\t * Return a ExtensiblePromise that resolves when all of the passed in objects have resolved. When used with a key/value\n\t * pair, the returned promise's argument is a key/value pair of the original keys with their resolved values.\n\t *\n\t * @example\n\t * ExtensiblePromise.all({ one: 1, two: 2 }).then(results => console.log(results));\n\t * // { one: 1, two: 2 }\n\t *\n\t * @param iterable An iterable of values to resolve, or a key/value pair of values to resolve. These can be Promises, ExtensiblePromises, or other objects\n\t * @returns An extensible promise\n\t */\n\tstatic all(iterable: ListOfPromises): ExtensiblePromise;\n\n\t/**\n\t * Return a ExtensiblePromise that resolves when all of the passed in objects have resolved. When used with a key/value\n\t * pair, the returned promise's argument is a key/value pair of the original keys with their resolved values.\n\t *\n\t * @example\n\t * ExtensiblePromise.all({ one: 1, two: 2 }).then(results => console.log(results));\n\t * // { one: 1, two: 2 }\n\t *\n\t * @param iterable An iterable of values to resolve, or a key/value pair of values to resolve. These can be Promises, ExtensiblePromises, or other objects\n\t * @returns An extensible promise\n\t */\n\tstatic all(\n\t\titerable: DictionaryOfPromises | ListOfPromises\n\t): ExtensiblePromise {\n\t\tif (!isArrayLike(iterable) && !isIterable(iterable)) {\n\t\t\tconst promiseKeys = Object.keys(iterable);\n\n\t\t\treturn new this((resolve, reject) => {\n\t\t\t\tPromise.all(promiseKeys.map((key) => iterable[key])).then((promiseResults: T[]) => {\n\t\t\t\t\tconst returnValue: { [key: string]: T } = {};\n\n\t\t\t\t\tpromiseResults.forEach((value: T, index: number) => {\n\t\t\t\t\t\treturnValue[promiseKeys[index]] = value;\n\t\t\t\t\t});\n\n\t\t\t\t\tresolve(returnValue);\n\t\t\t\t}, reject);\n\t\t\t});\n\t\t}\n\n\t\treturn new this((resolve, reject) => {\n\t\t\tPromise.all(unwrapPromises(>iterable)).then(resolve, reject);\n\t\t});\n\t}\n\n\t/**\n\t * Return a ExtensiblePromise that resolves when one of the passed in objects have resolved\n\t *\n\t * @param iterable An iterable of values to resolve. These can be Promises, ExtensiblePromises, or other objects\n\t * @returns {ExtensiblePromise}\n\t */\n\tstatic race(iterable: Iterable> | (T | PromiseLike)[]): ExtensiblePromise {\n\t\treturn new this((resolve, reject) => {\n\t\t\tPromise.race(unwrapPromises(iterable)).then(resolve, reject);\n\t\t});\n\t}\n\n\t/**\n\t * @type {Promise}\n\t * The wrapped promise\n\t */\n\treadonly _promise: Promise;\n\n\t/**\n\t * Creates a new extended Promise.\n\t *\n\t * @constructor\n\t *\n\t * @param executor\n\t * The executor function is called immediately when the Promise is instantiated. It is responsible for\n\t * starting the asynchronous operation when it is invoked.\n\t *\n\t * The executor must call either the passed `resolve` function when the asynchronous operation has completed\n\t * successfully, or the `reject` function when the operation fails.\n\t */\n\tconstructor(executor: Executor) {\n\t\tthis._promise = new Promise(executor);\n\t}\n\n\t/**\n\t * Adds a callback to be invoked when the wrapped Promise is rejected.\n\t *\n\t * @param {Function} onRejected A function to call to handle the error. The parameter to the function will be the caught error.\n\t *\n\t * @returns {ExtensiblePromise}\n\t */\n\tcatch(\n\t\tonRejected?: ((reason: any) => TResult | PromiseLike) | undefined | null\n\t): ExtensiblePromise {\n\t\treturn this.then(undefined, onRejected);\n\t}\n\n\t/**\n\t * Adds a callback to be invoked when the wrapped Promise resolves or is rejected.\n\t *\n\t * @param {Function} onFulfilled A function to call to handle the resolution. The paramter to the function will be the resolved value, if any.\n\t * @param {Function} onRejected A function to call to handle the error. The parameter to the function will be the caught error.\n\t *\n\t * @returns {ExtensiblePromise}\n\t */\n\tthen(\n\t\tonFulfilled?: ((value: T) => TResult1 | PromiseLike) | undefined | null,\n\t\tonRejected?: ((reason: any) => TResult2 | PromiseLike | void) | undefined | null\n\t): ExtensiblePromise {\n\t\tconst executor: Executor = (resolve, reject) => {\n\t\t\tfunction handler(rejected: boolean, valueOrError: T | TResult1 | Error) {\n\t\t\t\tconst callback: ((value: any) => any) | null | undefined = rejected ? onRejected : onFulfilled;\n\n\t\t\t\tif (typeof callback === 'function') {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tresolve(callback(valueOrError));\n\t\t\t\t\t} catch (error) {\n\t\t\t\t\t\treject(error);\n\t\t\t\t\t}\n\t\t\t\t} else if (rejected) {\n\t\t\t\t\treject(valueOrError);\n\t\t\t\t} else {\n\t\t\t\t\tresolve(valueOrError as TResult1);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tthis._promise.then(handler.bind(null, false), handler.bind(null, true));\n\t\t};\n\n\t\treturn new (this.constructor as typeof ExtensiblePromise)(executor);\n\t}\n\n\treadonly [Symbol.toStringTag]: 'Promise';\n}\n\nexport default ExtensiblePromise;\n"]} \ No newline at end of file diff --git a/deps/framework/core/async/ExtensiblePromise.mjs b/deps/framework/core/async/ExtensiblePromise.mjs deleted file mode 100644 index 40a20143c4..0000000000 --- a/deps/framework/core/async/ExtensiblePromise.mjs +++ /dev/null @@ -1,140 +0,0 @@ -import { isArrayLike, isIterable } from '../../shim/iterator'; -import Promise from '../../shim/Promise'; -import '../../shim/Symbol'; -/** - * Take a list of values, and if any are ExtensiblePromise objects, insert the wrapped Promise in its place, - * otherwise use the original object. We use this to help use the native Promise methods like `all` and `race`. - * - * @param iterable The list of objects to iterate over - * @returns {any[]} The list of objects, as an array, with ExtensiblePromises being replaced by Promises. - */ -export function unwrapPromises(iterable) { - const unwrapped = []; - if (isArrayLike(iterable)) { - for (let i = 0; i < iterable.length; i++) { - const item = iterable[i]; - unwrapped.push(item instanceof ExtensiblePromise ? item._promise : item); - } - } - else { - for (const item of iterable) { - unwrapped.push(item instanceof ExtensiblePromise ? item._promise : item); - } - } - return unwrapped; -} -/** - * An extensible base to allow Promises to be extended in ES5. This class basically wraps a native Promise object, - * giving an API like a native promise. - */ -export class ExtensiblePromise { - /** - * Creates a new extended Promise. - * - * @constructor - * - * @param executor - * The executor function is called immediately when the Promise is instantiated. It is responsible for - * starting the asynchronous operation when it is invoked. - * - * The executor must call either the passed `resolve` function when the asynchronous operation has completed - * successfully, or the `reject` function when the operation fails. - */ - constructor(executor) { - this._promise = new Promise(executor); - } - /** - * Return a rejected promise wrapped in an ExtensiblePromise - * - * @param reason The reason for the rejection - * @returns An extensible promise - */ - static reject(reason) { - return new this((resolve, reject) => reject(reason)); - } - static resolve(value) { - return new this((resolve, reject) => resolve(value)); - } - /** - * Return a ExtensiblePromise that resolves when all of the passed in objects have resolved. When used with a key/value - * pair, the returned promise's argument is a key/value pair of the original keys with their resolved values. - * - * @example - * ExtensiblePromise.all({ one: 1, two: 2 }).then(results => console.log(results)); - * // { one: 1, two: 2 } - * - * @param iterable An iterable of values to resolve, or a key/value pair of values to resolve. These can be Promises, ExtensiblePromises, or other objects - * @returns An extensible promise - */ - static all(iterable) { - if (!isArrayLike(iterable) && !isIterable(iterable)) { - const promiseKeys = Object.keys(iterable); - return new this((resolve, reject) => { - Promise.all(promiseKeys.map((key) => iterable[key])).then((promiseResults) => { - const returnValue = {}; - promiseResults.forEach((value, index) => { - returnValue[promiseKeys[index]] = value; - }); - resolve(returnValue); - }, reject); - }); - } - return new this((resolve, reject) => { - Promise.all(unwrapPromises(iterable)).then(resolve, reject); - }); - } - /** - * Return a ExtensiblePromise that resolves when one of the passed in objects have resolved - * - * @param iterable An iterable of values to resolve. These can be Promises, ExtensiblePromises, or other objects - * @returns {ExtensiblePromise} - */ - static race(iterable) { - return new this((resolve, reject) => { - Promise.race(unwrapPromises(iterable)).then(resolve, reject); - }); - } - /** - * Adds a callback to be invoked when the wrapped Promise is rejected. - * - * @param {Function} onRejected A function to call to handle the error. The parameter to the function will be the caught error. - * - * @returns {ExtensiblePromise} - */ - catch(onRejected) { - return this.then(undefined, onRejected); - } - /** - * Adds a callback to be invoked when the wrapped Promise resolves or is rejected. - * - * @param {Function} onFulfilled A function to call to handle the resolution. The paramter to the function will be the resolved value, if any. - * @param {Function} onRejected A function to call to handle the error. The parameter to the function will be the caught error. - * - * @returns {ExtensiblePromise} - */ - then(onFulfilled, onRejected) { - const executor = (resolve, reject) => { - function handler(rejected, valueOrError) { - const callback = rejected ? onRejected : onFulfilled; - if (typeof callback === 'function') { - try { - resolve(callback(valueOrError)); - } - catch (error) { - reject(error); - } - } - else if (rejected) { - reject(valueOrError); - } - else { - resolve(valueOrError); - } - } - this._promise.then(handler.bind(null, false), handler.bind(null, true)); - }; - return new this.constructor(executor); - } -} -export default ExtensiblePromise; -//# sourceMappingURL=ExtensiblePromise.mjs.map \ No newline at end of file diff --git a/deps/framework/core/async/ExtensiblePromise.mjs.map b/deps/framework/core/async/ExtensiblePromise.mjs.map deleted file mode 100644 index b0d45e1f65..0000000000 --- a/deps/framework/core/async/ExtensiblePromise.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"ExtensiblePromise.mjs","sourceRoot":"","sources":["ExtensiblePromise.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,UAAU,EAAY,MAAM,qBAAqB,CAAC;AACxE,OAAO,OAAqB,MAAM,oBAAoB,CAAC;AACvD,OAAO,mBAAmB,CAAC;AAE3B;;;;;;GAMG;AACH,MAAM,yBAAyB,QAA+B;IAC7D,MAAM,SAAS,GAAU,EAAE,CAAC;IAE5B,EAAE,CAAC,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;QAC3B,GAAG,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,QAAQ,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;YAC1C,MAAM,IAAI,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC;YACzB,SAAS,CAAC,IAAI,CAAC,IAAI,YAAY,iBAAiB,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CA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,CAAC;gBAE/F,EAAE,CAAC,CAAC,OAAO,QAAQ,KAAK,UAAU,CAAC,CAAC,CAAC;oBACpC,IAAI,CAAC;wBACJ,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAC,CAAC;oBACjC,CAAC;oBAAC,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC;wBAChB,MAAM,CAAC,KAAK,CAAC,CAAC;oBACf,CAAC;gBACF,CAAC;gBAAC,IAAI,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC;oBACrB,MAAM,CAAC,YAAY,CAAC,CAAC;gBACtB,CAAC;gBAAC,IAAI,CAAC,CAAC;oBACP,OAAO,CAAC,YAAwB,CAAC,CAAC;gBACnC,CAAC;YACF,CAAC;YAED,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,EAAE,KAAK,CAAC,EAAE,OAAO,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC;QACzE,CAAC,CAAC;QAEF,MAAM,CAAC,IAAK,IAAI,CAAC,WAAwC,CAAC,QAAQ,CAAC,CAAC;IACrE,CAAC;CAGD;AAED,eAAe,iBAAiB,CAAC","sourcesContent":["import { Thenable } from '../../shim/interfaces';\nimport { isArrayLike, isIterable, Iterable } from '../../shim/iterator';\nimport Promise, { Executor } from '../../shim/Promise';\nimport '../../shim/Symbol';\n\n/**\n * Take a list of values, and if any are ExtensiblePromise objects, insert the wrapped Promise in its place,\n * otherwise use the original object. We use this to help use the native Promise methods like `all` and `race`.\n *\n * @param iterable The list of objects to iterate over\n * @returns {any[]} The list of objects, as an array, with ExtensiblePromises being replaced by Promises.\n */\nexport function unwrapPromises(iterable: Iterable | any[]): any[] {\n\tconst unwrapped: any[] = [];\n\n\tif (isArrayLike(iterable)) {\n\t\tfor (let i = 0; i < iterable.length; i++) {\n\t\t\tconst item = iterable[i];\n\t\t\tunwrapped.push(item instanceof ExtensiblePromise ? item._promise : item);\n\t\t}\n\t} else {\n\t\tfor (const item of iterable) {\n\t\t\tunwrapped.push(item instanceof ExtensiblePromise ? item._promise : item);\n\t\t}\n\t}\n\n\treturn unwrapped;\n}\n\nexport type DictionaryOfPromises = { [_: string]: T | Promise | Thenable };\nexport type ListOfPromises = Iterable>;\n\n/**\n * An extensible base to allow Promises to be extended in ES5. This class basically wraps a native Promise object,\n * giving an API like a native promise.\n */\nexport class ExtensiblePromise {\n\t/**\n\t * Return a rejected promise wrapped in an ExtensiblePromise\n\t *\n\t * @param reason The reason for the rejection\n\t * @returns An extensible promise\n\t */\n\tstatic reject(reason?: any): ExtensiblePromise;\n\n\t/**\n\t * Return a rejected promise wrapped in an ExtensiblePromise\n\t *\n\t * @param reason The reason for the rejection\n\t * @returns An extensible promise\n\t */\n\tstatic reject(reason?: any): ExtensiblePromise {\n\t\treturn new this((resolve, reject) => reject(reason));\n\t}\n\n\t/**\n\t * Return a resolved promise wrapped in an ExtensiblePromise\n\t *\n\t * @param value The value to resolve the promise with\n\t *\n\t * @returns An extensible promise\n\t */\n\tstatic resolve

>(): P;\n\n\t/**\n\t * Return a resolved promise wrapped in an ExtensiblePromise\n\t *\n\t * @param value The value to resolve the promise with\n\t *\n\t * @returns An extensible promise\n\t */\n\tstatic resolve>(value: T | PromiseLike): P;\n\tstatic resolve(value?: any | PromiseLike): ExtensiblePromise {\n\t\treturn new this((resolve, reject) => resolve(value));\n\t}\n\n\t/**\n\t * Return a ExtensiblePromise that resolves when all of the passed in objects have resolved. When used with a key/value\n\t * pair, the returned promise's argument is a key/value pair of the original keys with their resolved values.\n\t *\n\t * @example\n\t * ExtensiblePromise.all({ one: 1, two: 2 }).then(results => console.log(results));\n\t * // { one: 1, two: 2 }\n\t *\n\t * @param iterable An iterable of values to resolve, or a key/value pair of values to resolve. These can be Promises, ExtensiblePromises, or other objects\n\t * @returns An extensible promise\n\t */\n\tstatic all(iterable: DictionaryOfPromises): ExtensiblePromise<{ [key: string]: T }>;\n\n\t/**\n\t * Return a ExtensiblePromise that resolves when all of the passed in objects have resolved. When used with a key/value\n\t * pair, the returned promise's argument is a key/value pair of the original keys with their resolved values.\n\t *\n\t * @example\n\t * ExtensiblePromise.all({ one: 1, two: 2 }).then(results => console.log(results));\n\t * // { one: 1, two: 2 }\n\t *\n\t * @param iterable An iterable of values to resolve, or a key/value pair of values to resolve. These can be Promises, ExtensiblePromises, or other objects\n\t * @returns An extensible promise\n\t */\n\tstatic all(iterable: (T | Thenable)[]): ExtensiblePromise;\n\n\t/**\n\t * Return a ExtensiblePromise that resolves when all of the passed in objects have resolved. When used with a key/value\n\t * pair, the returned promise's argument is a key/value pair of the original keys with their resolved values.\n\t *\n\t * @example\n\t * ExtensiblePromise.all({ one: 1, two: 2 }).then(results => console.log(results));\n\t * // { one: 1, two: 2 }\n\t *\n\t * @param iterable An iterable of values to resolve, or a key/value pair of values to resolve. These can be Promises, ExtensiblePromises, or other objects\n\t * @returns An extensible promise\n\t */\n\tstatic all(iterable: T | Thenable): ExtensiblePromise;\n\n\t/**\n\t * Return a ExtensiblePromise that resolves when all of the passed in objects have resolved. When used with a key/value\n\t * pair, the returned promise's argument is a key/value pair of the original keys with their resolved values.\n\t *\n\t * @example\n\t * ExtensiblePromise.all({ one: 1, two: 2 }).then(results => console.log(results));\n\t * // { one: 1, two: 2 }\n\t *\n\t * @param iterable An iterable of values to resolve, or a key/value pair of values to resolve. These can be Promises, ExtensiblePromises, or other objects\n\t * @returns An extensible promise\n\t */\n\tstatic all(iterable: ListOfPromises): ExtensiblePromise;\n\n\t/**\n\t * Return a ExtensiblePromise that resolves when all of the passed in objects have resolved. When used with a key/value\n\t * pair, the returned promise's argument is a key/value pair of the original keys with their resolved values.\n\t *\n\t * @example\n\t * ExtensiblePromise.all({ one: 1, two: 2 }).then(results => console.log(results));\n\t * // { one: 1, two: 2 }\n\t *\n\t * @param iterable An iterable of values to resolve, or a key/value pair of values to resolve. These can be Promises, ExtensiblePromises, or other objects\n\t * @returns An extensible promise\n\t */\n\tstatic all(\n\t\titerable: DictionaryOfPromises | ListOfPromises\n\t): ExtensiblePromise {\n\t\tif (!isArrayLike(iterable) && !isIterable(iterable)) {\n\t\t\tconst promiseKeys = Object.keys(iterable);\n\n\t\t\treturn new this((resolve, reject) => {\n\t\t\t\tPromise.all(promiseKeys.map((key) => iterable[key])).then((promiseResults: T[]) => {\n\t\t\t\t\tconst returnValue: { [key: string]: T } = {};\n\n\t\t\t\t\tpromiseResults.forEach((value: T, index: number) => {\n\t\t\t\t\t\treturnValue[promiseKeys[index]] = value;\n\t\t\t\t\t});\n\n\t\t\t\t\tresolve(returnValue);\n\t\t\t\t}, reject);\n\t\t\t});\n\t\t}\n\n\t\treturn new this((resolve, reject) => {\n\t\t\tPromise.all(unwrapPromises(>iterable)).then(resolve, reject);\n\t\t});\n\t}\n\n\t/**\n\t * Return a ExtensiblePromise that resolves when one of the passed in objects have resolved\n\t *\n\t * @param iterable An iterable of values to resolve. These can be Promises, ExtensiblePromises, or other objects\n\t * @returns {ExtensiblePromise}\n\t */\n\tstatic race(iterable: Iterable> | (T | PromiseLike)[]): ExtensiblePromise {\n\t\treturn new this((resolve, reject) => {\n\t\t\tPromise.race(unwrapPromises(iterable)).then(resolve, reject);\n\t\t});\n\t}\n\n\t/**\n\t * @type {Promise}\n\t * The wrapped promise\n\t */\n\treadonly _promise: Promise;\n\n\t/**\n\t * Creates a new extended Promise.\n\t *\n\t * @constructor\n\t *\n\t * @param executor\n\t * The executor function is called immediately when the Promise is instantiated. It is responsible for\n\t * starting the asynchronous operation when it is invoked.\n\t *\n\t * The executor must call either the passed `resolve` function when the asynchronous operation has completed\n\t * successfully, or the `reject` function when the operation fails.\n\t */\n\tconstructor(executor: Executor) {\n\t\tthis._promise = new Promise(executor);\n\t}\n\n\t/**\n\t * Adds a callback to be invoked when the wrapped Promise is rejected.\n\t *\n\t * @param {Function} onRejected A function to call to handle the error. The parameter to the function will be the caught error.\n\t *\n\t * @returns {ExtensiblePromise}\n\t */\n\tcatch(\n\t\tonRejected?: ((reason: any) => TResult | PromiseLike) | undefined | null\n\t): ExtensiblePromise {\n\t\treturn this.then(undefined, onRejected);\n\t}\n\n\t/**\n\t * Adds a callback to be invoked when the wrapped Promise resolves or is rejected.\n\t *\n\t * @param {Function} onFulfilled A function to call to handle the resolution. The paramter to the function will be the resolved value, if any.\n\t * @param {Function} onRejected A function to call to handle the error. The parameter to the function will be the caught error.\n\t *\n\t * @returns {ExtensiblePromise}\n\t */\n\tthen(\n\t\tonFulfilled?: ((value: T) => TResult1 | PromiseLike) | undefined | null,\n\t\tonRejected?: ((reason: any) => TResult2 | PromiseLike | void) | undefined | null\n\t): ExtensiblePromise {\n\t\tconst executor: Executor = (resolve, reject) => {\n\t\t\tfunction handler(rejected: boolean, valueOrError: T | TResult1 | Error) {\n\t\t\t\tconst callback: ((value: any) => any) | null | undefined = rejected ? onRejected : onFulfilled;\n\n\t\t\t\tif (typeof callback === 'function') {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tresolve(callback(valueOrError));\n\t\t\t\t\t} catch (error) {\n\t\t\t\t\t\treject(error);\n\t\t\t\t\t}\n\t\t\t\t} else if (rejected) {\n\t\t\t\t\treject(valueOrError);\n\t\t\t\t} else {\n\t\t\t\t\tresolve(valueOrError as TResult1);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tthis._promise.then(handler.bind(null, false), handler.bind(null, true));\n\t\t};\n\n\t\treturn new (this.constructor as typeof ExtensiblePromise)(executor);\n\t}\n\n\treadonly [Symbol.toStringTag]: 'Promise';\n}\n\nexport default ExtensiblePromise;\n"]} \ No newline at end of file diff --git a/deps/framework/core/async/Task.d.ts b/deps/framework/core/async/Task.d.ts deleted file mode 100644 index 785dac4dab..0000000000 --- a/deps/framework/core/async/Task.d.ts +++ /dev/null @@ -1,163 +0,0 @@ -import { Thenable } from '../../shim/interfaces'; -import { Iterable } from '../../shim/iterator'; -import { Executor } from '../../shim/Promise'; -import ExtensiblePromise, { DictionaryOfPromises, ListOfPromises } from './ExtensiblePromise'; -/** - * Describe the internal state of a task. - */ -export declare const enum State { - Fulfilled = 0, - Pending = 1, - Rejected = 2, - Canceled = 3, -} -/** - * A type guard that determines if `value` is a `Task` - * @param value The value to guard - */ -export declare function isTask(value: any): value is Task; -/** - * Returns true if a given value has a `then` method. - * @param {any} value The value to check if is Thenable - * @returns {is Thenable} A type guard if the value is thenable - */ -export declare function isThenable(value: any): value is Thenable; -/** - * Task is an extension of Promise that supports cancellation and the Task#finally method. - */ -export declare class Task extends ExtensiblePromise { - /** - * Return a Task that resolves when one of the passed in objects have resolved - * - * @param iterable An iterable of values to resolve. These can be Promises, ExtensiblePromises, or other objects - * @returns {Task} - */ - static race(iterable: Iterable> | (T | Thenable)[]): Task; - /** - * Return a rejected promise wrapped in a Task - * - * @param reason The reason for the rejection - * @returns A task - */ - static reject(reason?: Error): Task; - /** - * Return a resolved task. - * - * @param value The value to resolve with - * - * @return A task - */ - static resolve(): Task; - /** - * Return a resolved task. - * - * @param value The value to resolve with - * - * @return A task - */ - static resolve(value: T | Thenable): Task; - /** - * Return a ExtensiblePromise that resolves when all of the passed in objects have resolved. When used with a key/value - * pair, the returned promise's argument is a key/value pair of the original keys with their resolved values. - * - * @example - * ExtensiblePromise.all({ one: 1, two: 2 }).then(results => console.log(results)); - * // { one: 1, two: 2 } - * - * @param iterable An iterable of values to resolve, or a key/value pair of values to resolve. These can be Promises, ExtensiblePromises, or other objects - * @returns An extensible promise - */ - static all(iterable: DictionaryOfPromises): Task<{ - [key: string]: T; - }>; - /** - * Return a ExtensiblePromise that resolves when all of the passed in objects have resolved. When used with a key/value - * pair, the returned promise's argument is a key/value pair of the original keys with their resolved values. - * - * @example - * ExtensiblePromise.all({ one: 1, two: 2 }).then(results => console.log(results)); - * // { one: 1, two: 2 } - * - * @param iterable An iterable of values to resolve, or a key/value pair of values to resolve. These can be Promises, ExtensiblePromises, or other objects - * @returns An extensible promise - */ - static all(iterable: (T | Thenable)[]): Task; - /** - * Return a ExtensiblePromise that resolves when all of the passed in objects have resolved. When used with a key/value - * pair, the returned promise's argument is a key/value pair of the original keys with their resolved values. - * - * @example - * ExtensiblePromise.all({ one: 1, two: 2 }).then(results => console.log(results)); - * // { one: 1, two: 2 } - * - * @param iterable An iterable of values to resolve, or a key/value pair of values to resolve. These can be Promises, ExtensiblePromises, or other objects - * @returns An extensible promise - */ - static all(iterable: T | Thenable): Task; - /** - * Return a ExtensiblePromise that resolves when all of the passed in objects have resolved. When used with a key/value - * pair, the returned promise's argument is a key/value pair of the original keys with their resolved values. - * - * @example - * ExtensiblePromise.all({ one: 1, two: 2 }).then(results => console.log(results)); - * // { one: 1, two: 2 } - * - * @param iterable An iterable of values to resolve, or a key/value pair of values to resolve. These can be Promises, ExtensiblePromises, or other objects - * @returns An extensible promise - */ - static all(iterable: ListOfPromises): Task; - /** - * A cancelation handler that will be called if this task is canceled. - */ - private canceler; - /** - * Children of this Task (i.e., Tasks that were created from this Task with `then` or `catch`). - */ - private readonly children; - /** - * The finally callback for this Task (if it was created by a call to `finally`). - */ - private _finally; - /** - * The state of the task - */ - protected _state: State; - readonly state: State; - /** - * @constructor - * - * Create a new task. Executor is run immediately. The canceler will be called when the task is canceled. - * - * @param executor Method that initiates some task - * @param canceler Method to call when the task is canceled - * - */ - constructor(executor: Executor, canceler?: () => void); - /** - * Propagates cancellation down through a Task tree. The Task's state is immediately set to canceled. If a Thenable - * finally task was passed in, it is resolved before calling this Task's finally callback; otherwise, this Task's - * finally callback is immediately executed. `_cancel` is called for each child Task, passing in the value returned - * by this Task's finally callback or a Promise chain that will eventually resolve to that value. - */ - private _cancel(finallyTask?); - /** - * Immediately cancels this task if it has not already resolved. This Task and any descendants are synchronously set - * to the Canceled state and any `finally` added downstream from the canceled Task are invoked. - */ - cancel(): void; - catch(onRejected?: ((reason: any) => TResult | PromiseLike) | undefined): Task; - /** - * Allows for cleanup actions to be performed after resolution of a Promise. - */ - finally(callback: () => void): Task; - /** - * Adds a callback to be invoked when the Task resolves or is rejected. - * - * @param onFulfilled A function to call to handle the resolution. The paramter to the function will be the resolved value, if any. - * @param onRejected A function to call to handle the error. The parameter to the function will be the caught error. - * - * @returns A task - */ - then(onFulfilled?: ((value: T) => TResult1 | PromiseLike) | undefined | null, onRejected?: ((reason: any) => TResult2 | PromiseLike) | undefined | null): Task; -} -export default Task; diff --git a/deps/framework/core/async/Task.js b/deps/framework/core/async/Task.js deleted file mode 100644 index 2a36c68104..0000000000 --- a/deps/framework/core/async/Task.js +++ /dev/null @@ -1,284 +0,0 @@ -(function (factory) { - if (typeof module === "object" && typeof module.exports === "object") { - var v = factory(require, exports); - if (v !== undefined) module.exports = v; - } - else if (typeof define === "function" && define.amd) { - define(["require", "exports", "tslib", "../../shim/iterator", "./ExtensiblePromise"], factory); - } -})(function (require, exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - var tslib_1 = require("tslib"); - var iterator_1 = require("../../shim/iterator"); - var ExtensiblePromise_1 = require("./ExtensiblePromise"); - /** - * A type guard that determines if `value` is a `Task` - * @param value The value to guard - */ - function isTask(value) { - return Boolean(value && typeof value.cancel === 'function' && Array.isArray(value.children) && isThenable(value)); - } - exports.isTask = isTask; - /** - * Returns true if a given value has a `then` method. - * @param {any} value The value to check if is Thenable - * @returns {is Thenable} A type guard if the value is thenable - */ - function isThenable(value) { - return value && typeof value.then === 'function'; - } - exports.isThenable = isThenable; - /** - * Task is an extension of Promise that supports cancellation and the Task#finally method. - */ - var Task = /** @class */ (function (_super) { - tslib_1.__extends(Task, _super); - /** - * @constructor - * - * Create a new task. Executor is run immediately. The canceler will be called when the task is canceled. - * - * @param executor Method that initiates some task - * @param canceler Method to call when the task is canceled - * - */ - function Task(executor, canceler) { - var _this = this; - // we have to initialize these to avoid a compiler error of using them before they are initialized - var superResolve = function () { }; - var superReject = function () { }; - _this = _super.call(this, function (resolve, reject) { - superResolve = resolve; - superReject = reject; - }) || this; - _this._state = 1 /* Pending */; - _this.children = []; - _this.canceler = function () { - if (canceler) { - canceler(); - } - _this._cancel(); - }; - // Don't let the Task resolve if it's been canceled - try { - executor(function (value) { - if (_this._state === 3 /* Canceled */) { - return; - } - _this._state = 0 /* Fulfilled */; - superResolve(value); - }, function (reason) { - if (_this._state === 3 /* Canceled */) { - return; - } - _this._state = 2 /* Rejected */; - superReject(reason); - }); - } - catch (reason) { - _this._state = 2 /* Rejected */; - superReject(reason); - } - return _this; - } - /** - * Return a Task that resolves when one of the passed in objects have resolved - * - * @param iterable An iterable of values to resolve. These can be Promises, ExtensiblePromises, or other objects - * @returns {Task} - */ - Task.race = function (iterable) { - return new this(function (resolve, reject) { - Promise.race(ExtensiblePromise_1.unwrapPromises(iterable)).then(resolve, reject); - }); - }; - /** - * Return a rejected promise wrapped in a Task - * - * @param reason The reason for the rejection - * @returns A task - */ - Task.reject = function (reason) { - return new this(function (resolve, reject) { return reject(reason); }); - }; - /** - * Return a resolved task. - * - * @param value The value to resolve with - * - * @return A task - */ - Task.resolve = function (value) { - return new this(function (resolve, reject) { return resolve(value); }); - }; - /** - * Return a ExtensiblePromise that resolves when all of the passed in objects have resolved. When used with a key/value - * pair, the returned promise's argument is a key/value pair of the original keys with their resolved values. - * - * @example - * ExtensiblePromise.all({ one: 1, two: 2 }).then(results => console.log(results)); - * // { one: 1, two: 2 } - * - * @param iterable An iterable of values to resolve, or a key/value pair of values to resolve. These can be Promises, ExtensiblePromises, or other objects - * @returns An extensible promise - */ - Task.all = function (iterable) { - var _this = this; - return new Task(function (resolve, reject) { - _super.all.call(_this, iterable).then(resolve, reject); - }, function () { - if (iterator_1.isArrayLike(iterable)) { - for (var i = 0; i < iterable.length; i++) { - var promiseLike = iterable[i]; - if (isTask(promiseLike)) { - promiseLike.cancel(); - } - } - } - else if (iterator_1.isIterable(iterable)) { - try { - for (var iterable_1 = tslib_1.__values(iterable), iterable_1_1 = iterable_1.next(); !iterable_1_1.done; iterable_1_1 = iterable_1.next()) { - var promiseLike = iterable_1_1.value; - if (isTask(promiseLike)) { - promiseLike.cancel(); - } - } - } - catch (e_1_1) { e_1 = { error: e_1_1 }; } - finally { - try { - if (iterable_1_1 && !iterable_1_1.done && (_a = iterable_1.return)) _a.call(iterable_1); - } - finally { if (e_1) throw e_1.error; } - } - } - else { - Object.keys(iterable).forEach(function (key) { - var promiseLike = iterable[key]; - if (isTask(promiseLike)) { - promiseLike.cancel(); - } - }); - } - var e_1, _a; - }); - }; - Object.defineProperty(Task.prototype, "state", { - get: function () { - return this._state; - }, - enumerable: true, - configurable: true - }); - /** - * Propagates cancellation down through a Task tree. The Task's state is immediately set to canceled. If a Thenable - * finally task was passed in, it is resolved before calling this Task's finally callback; otherwise, this Task's - * finally callback is immediately executed. `_cancel` is called for each child Task, passing in the value returned - * by this Task's finally callback or a Promise chain that will eventually resolve to that value. - */ - Task.prototype._cancel = function (finallyTask) { - var _this = this; - this._state = 3 /* Canceled */; - var runFinally = function () { - try { - return _this._finally && _this._finally(); - } - catch (error) { - // Any errors in a `finally` callback are completely ignored during cancelation - } - }; - if (this._finally) { - if (isThenable(finallyTask)) { - finallyTask = finallyTask.then(runFinally, runFinally); - } - else { - finallyTask = runFinally(); - } - } - this.children.forEach(function (child) { - child._cancel(finallyTask); - }); - }; - /** - * Immediately cancels this task if it has not already resolved. This Task and any descendants are synchronously set - * to the Canceled state and any `finally` added downstream from the canceled Task are invoked. - */ - Task.prototype.cancel = function () { - if (this._state === 1 /* Pending */) { - this.canceler(); - } - }; - Task.prototype.catch = function (onRejected) { - return this.then(undefined, onRejected); - }; - /** - * Allows for cleanup actions to be performed after resolution of a Promise. - */ - Task.prototype.finally = function (callback) { - // if this task is already canceled, call the task - if (this._state === 3 /* Canceled */) { - callback(); - return this; - } - var task = this.then(function (value) { return Task.resolve(callback()).then(function () { return value; }); }, function (reason) { - return Task.resolve(callback()).then(function () { - throw reason; - }); - }); - // Keep a reference to the callback; it will be called if the Task is canceled - task._finally = callback; - return task; - }; - /** - * Adds a callback to be invoked when the Task resolves or is rejected. - * - * @param onFulfilled A function to call to handle the resolution. The paramter to the function will be the resolved value, if any. - * @param onRejected A function to call to handle the error. The parameter to the function will be the caught error. - * - * @returns A task - */ - Task.prototype.then = function (onFulfilled, onRejected) { - var _this = this; - // FIXME - // tslint:disable-next-line:no-var-keyword - var task = _super.prototype.then.call(this, - // Don't call the onFulfilled or onRejected handlers if this Task is canceled - function (value) { - if (task._state === 3 /* Canceled */) { - return; - } - if (onFulfilled) { - return onFulfilled(value); - } - return value; - }, function (error) { - if (task._state === 3 /* Canceled */) { - return; - } - if (onRejected) { - return onRejected(error); - } - throw error; - }); - task.canceler = function () { - // If task's parent (this) hasn't been resolved, cancel it; downward propagation will start at the first - // unresolved parent - if (_this._state === 1 /* Pending */) { - _this.cancel(); - } - else { - // If task's parent has been resolved, propagate cancelation to the task's descendants - task._cancel(); - } - }; - // Keep track of child Tasks for propogating cancelation back down the chain - this.children.push(task); - return task; - }; - return Task; - }(ExtensiblePromise_1.default)); - exports.Task = Task; - exports.default = Task; -}); -//# sourceMappingURL=Task.js.map \ No newline at end of file diff --git a/deps/framework/core/async/Task.js.map b/deps/framework/core/async/Task.js.map deleted file mode 100644 index 97f58204f4..0000000000 --- a/deps/framework/core/async/Task.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"Task.js","sourceRoot":"","sources":["Task.ts"],"names":[],"mappings":";;;;;;;;;;;;IACA,gDAAwE;IAExE,yDAA8G;IAY9G;;;OAGG;IACH,gBAA0B,KAAU;QACnC,MAAM,CAAC,OAAO,CAAC,KAAK,IAAI,OAAO,KAAK,CAAC,MAAM,KAAK,UAAU,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,QAAQ,CAAC,IAAI,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC;IACnH,CAAC;IAFD,wBAEC;IAED;;;;OAIG;IACH,oBAA8B,KAAU;QACvC,MAAM,CAAC,KAAK,IAAI,OAAO,KAAK,CAAC,IAAI,KAAK,UAAU,CAAC;IAClD,CAAC;IAFD,gCA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shim/interfaces';\nimport { isArrayLike, isIterable, Iterable } from '../../shim/iterator';\nimport { Executor } from '../../shim/Promise';\nimport ExtensiblePromise, { DictionaryOfPromises, ListOfPromises, unwrapPromises } from './ExtensiblePromise';\n\n/**\n * Describe the internal state of a task.\n */\nexport const enum State {\n\tFulfilled = 0,\n\tPending = 1,\n\tRejected = 2,\n\tCanceled = 3\n}\n\n/**\n * A type guard that determines if `value` is a `Task`\n * @param value The value to guard\n */\nexport function isTask(value: any): value is Task {\n\treturn Boolean(value && typeof value.cancel === 'function' && Array.isArray(value.children) && isThenable(value));\n}\n\n/**\n * Returns true if a given value has a `then` method.\n * @param {any} value The value to check if is Thenable\n * @returns {is Thenable} A type guard if the value is thenable\n */\nexport function isThenable(value: any): value is Thenable {\n\treturn value && typeof value.then === 'function';\n}\n\n/**\n * Task is an extension of Promise that supports cancellation and the Task#finally method.\n */\nexport class Task extends ExtensiblePromise {\n\t/**\n\t * Return a Task that resolves when one of the passed in objects have resolved\n\t *\n\t * @param iterable An iterable of values to resolve. These can be Promises, ExtensiblePromises, or other objects\n\t * @returns {Task}\n\t */\n\tstatic race(iterable: Iterable> | (T | Thenable)[]): Task {\n\t\treturn new this((resolve, reject) => {\n\t\t\tPromise.race(unwrapPromises(iterable)).then(resolve, reject);\n\t\t});\n\t}\n\n\t/**\n\t * Return a rejected promise wrapped in a Task\n\t *\n\t * @param reason The reason for the rejection\n\t * @returns A task\n\t */\n\tstatic reject(reason?: Error): Task {\n\t\treturn new this((resolve, reject) => reject(reason));\n\t}\n\n\t/**\n\t * Return a resolved task.\n\t *\n\t * @param value The value to resolve with\n\t *\n\t * @return A task\n\t */\n\tpublic static resolve(): Task;\n\n\t/**\n\t * Return a resolved task.\n\t *\n\t * @param value The value to resolve with\n\t *\n\t * @return A task\n\t */\n\tpublic static resolve(value: T | Thenable): Task;\n\n\t/**\n\t * Return a resolved task.\n\t *\n\t * @param value The value to resolve with\n\t *\n\t * @return A task\n\t */\n\tpublic static resolve(value?: any): Task {\n\t\treturn new this((resolve, reject) => resolve(value));\n\t}\n\n\t/**\n\t * Return a ExtensiblePromise that resolves when all of the passed in objects have resolved. When used with a key/value\n\t * pair, the returned promise's argument is a key/value pair of the original keys with their resolved values.\n\t *\n\t * @example\n\t * ExtensiblePromise.all({ one: 1, two: 2 }).then(results => console.log(results));\n\t * // { one: 1, two: 2 }\n\t *\n\t * @param iterable An iterable of values to resolve, or a key/value pair of values to resolve. These can be Promises, ExtensiblePromises, or other objects\n\t * @returns An extensible promise\n\t */\n\tstatic all(iterable: DictionaryOfPromises): Task<{ [key: string]: T }>;\n\n\t/**\n\t * Return a ExtensiblePromise that resolves when all of the passed in objects have resolved. When used with a key/value\n\t * pair, the returned promise's argument is a key/value pair of the original keys with their resolved values.\n\t *\n\t * @example\n\t * ExtensiblePromise.all({ one: 1, two: 2 }).then(results => console.log(results));\n\t * // { one: 1, two: 2 }\n\t *\n\t * @param iterable An iterable of values to resolve, or a key/value pair of values to resolve. These can be Promises, ExtensiblePromises, or other objects\n\t * @returns An extensible promise\n\t */\n\tstatic all(iterable: (T | Thenable)[]): Task;\n\n\t/**\n\t * Return a ExtensiblePromise that resolves when all of the passed in objects have resolved. When used with a key/value\n\t * pair, the returned promise's argument is a key/value pair of the original keys with their resolved values.\n\t *\n\t * @example\n\t * ExtensiblePromise.all({ one: 1, two: 2 }).then(results => console.log(results));\n\t * // { one: 1, two: 2 }\n\t *\n\t * @param iterable An iterable of values to resolve, or a key/value pair of values to resolve. These can be Promises, ExtensiblePromises, or other objects\n\t * @returns An extensible promise\n\t */\n\tstatic all(iterable: T | Thenable): Task;\n\n\t/**\n\t * Return a ExtensiblePromise that resolves when all of the passed in objects have resolved. When used with a key/value\n\t * pair, the returned promise's argument is a key/value pair of the original keys with their resolved values.\n\t *\n\t * @example\n\t * ExtensiblePromise.all({ one: 1, two: 2 }).then(results => console.log(results));\n\t * // { one: 1, two: 2 }\n\t *\n\t * @param iterable An iterable of values to resolve, or a key/value pair of values to resolve. These can be Promises, ExtensiblePromises, or other objects\n\t * @returns An extensible promise\n\t */\n\tstatic all(iterable: ListOfPromises): Task;\n\n\t/**\n\t * Return a ExtensiblePromise that resolves when all of the passed in objects have resolved. When used with a key/value\n\t * pair, the returned promise's argument is a key/value pair of the original keys with their resolved values.\n\t *\n\t * @example\n\t * ExtensiblePromise.all({ one: 1, two: 2 }).then(results => console.log(results));\n\t * // { one: 1, two: 2 }\n\t *\n\t * @param iterable An iterable of values to resolve, or a key/value pair of values to resolve. These can be Promises, ExtensiblePromises, or other objects\n\t * @returns An extensible promise\n\t */\n\tstatic all(iterable: DictionaryOfPromises | ListOfPromises): Task {\n\t\treturn new Task(\n\t\t\t(resolve, reject) => {\n\t\t\t\tsuper.all(iterable).then(resolve, reject);\n\t\t\t},\n\t\t\t() => {\n\t\t\t\tif (isArrayLike(iterable)) {\n\t\t\t\t\tfor (let i = 0; i < iterable.length; i++) {\n\t\t\t\t\t\tconst promiseLike = iterable[i];\n\n\t\t\t\t\t\tif (isTask(promiseLike)) {\n\t\t\t\t\t\t\tpromiseLike.cancel();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} else if (isIterable(iterable)) {\n\t\t\t\t\tfor (const promiseLike of iterable) {\n\t\t\t\t\t\tif (isTask(promiseLike)) {\n\t\t\t\t\t\t\tpromiseLike.cancel();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tObject.keys(iterable).forEach((key: any) => {\n\t\t\t\t\t\tconst promiseLike = iterable[key];\n\n\t\t\t\t\t\tif (isTask(promiseLike)) {\n\t\t\t\t\t\t\tpromiseLike.cancel();\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\t\t);\n\t}\n\n\t/**\n\t * A cancelation handler that will be called if this task is canceled.\n\t */\n\tprivate canceler: () => void;\n\n\t/**\n\t * Children of this Task (i.e., Tasks that were created from this Task with `then` or `catch`).\n\t */\n\tprivate readonly children: Task[];\n\n\t/**\n\t * The finally callback for this Task (if it was created by a call to `finally`).\n\t */\n\tprivate _finally: undefined | (() => void);\n\n\t/**\n\t * The state of the task\n\t */\n\tprotected _state: State;\n\n\tget state() {\n\t\treturn this._state;\n\t}\n\n\t/**\n\t * @constructor\n\t *\n\t * Create a new task. Executor is run immediately. The canceler will be called when the task is canceled.\n\t *\n\t * @param executor Method that initiates some task\n\t * @param canceler Method to call when the task is canceled\n\t *\n\t */\n\tconstructor(executor: Executor, canceler?: () => void) {\n\t\t// we have to initialize these to avoid a compiler error of using them before they are initialized\n\t\tlet superResolve: (value?: T | Thenable | undefined) => void = () => {};\n\t\tlet superReject: (reason?: any) => void = () => {};\n\n\t\tsuper((resolve, reject) => {\n\t\t\tsuperResolve = resolve;\n\t\t\tsuperReject = reject;\n\t\t});\n\n\t\tthis._state = State.Pending;\n\n\t\tthis.children = [];\n\t\tthis.canceler = () => {\n\t\t\tif (canceler) {\n\t\t\t\tcanceler();\n\t\t\t}\n\t\t\tthis._cancel();\n\t\t};\n\n\t\t// Don't let the Task resolve if it's been canceled\n\t\ttry {\n\t\t\texecutor(\n\t\t\t\t(value) => {\n\t\t\t\t\tif (this._state === State.Canceled) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tthis._state = State.Fulfilled;\n\t\t\t\t\tsuperResolve(value);\n\t\t\t\t},\n\t\t\t\t(reason) => {\n\t\t\t\t\tif (this._state === State.Canceled) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tthis._state = State.Rejected;\n\t\t\t\t\tsuperReject(reason);\n\t\t\t\t}\n\t\t\t);\n\t\t} catch (reason) {\n\t\t\tthis._state = State.Rejected;\n\t\t\tsuperReject(reason);\n\t\t}\n\t}\n\n\t/**\n\t * Propagates cancellation down through a Task tree. The Task's state is immediately set to canceled. If a Thenable\n\t * finally task was passed in, it is resolved before calling this Task's finally callback; otherwise, this Task's\n\t * finally callback is immediately executed. `_cancel` is called for each child Task, passing in the value returned\n\t * by this Task's finally callback or a Promise chain that will eventually resolve to that value.\n\t */\n\tprivate _cancel(finallyTask?: void | Thenable): void {\n\t\tthis._state = State.Canceled;\n\n\t\tconst runFinally = () => {\n\t\t\ttry {\n\t\t\t\treturn this._finally && this._finally();\n\t\t\t} catch (error) {\n\t\t\t\t// Any errors in a `finally` callback are completely ignored during cancelation\n\t\t\t}\n\t\t};\n\n\t\tif (this._finally) {\n\t\t\tif (isThenable(finallyTask)) {\n\t\t\t\tfinallyTask = (>finallyTask).then(runFinally, runFinally);\n\t\t\t} else {\n\t\t\t\tfinallyTask = runFinally();\n\t\t\t}\n\t\t}\n\n\t\tthis.children.forEach(function(child) {\n\t\t\tchild._cancel(finallyTask);\n\t\t});\n\t}\n\n\t/**\n\t * Immediately cancels this task if it has not already resolved. This Task and any descendants are synchronously set\n\t * to the Canceled state and any `finally` added downstream from the canceled Task are invoked.\n\t */\n\tcancel(): void {\n\t\tif (this._state === State.Pending) {\n\t\t\tthis.canceler();\n\t\t}\n\t}\n\n\tcatch(\n\t\tonRejected?: ((reason: any) => TResult | PromiseLike) | undefined\n\t): Task {\n\t\treturn this.then(undefined, onRejected) as Task;\n\t}\n\n\t/**\n\t * Allows for cleanup actions to be performed after resolution of a Promise.\n\t */\n\tfinally(callback: () => void): Task {\n\t\t// if this task is already canceled, call the task\n\t\tif (this._state === State.Canceled) {\n\t\t\tcallback();\n\t\t\treturn this;\n\t\t}\n\n\t\tconst task = this.then(\n\t\t\t(value) => Task.resolve(callback()).then(() => value),\n\t\t\t(reason) =>\n\t\t\t\tTask.resolve(callback()).then(() => {\n\t\t\t\t\tthrow reason;\n\t\t\t\t})\n\t\t);\n\n\t\t// Keep a reference to the callback; it will be called if the Task is canceled\n\t\ttask._finally = callback;\n\t\treturn task;\n\t}\n\n\t/**\n\t * Adds a callback to be invoked when the Task resolves or is rejected.\n\t *\n\t * @param onFulfilled A function to call to handle the resolution. The paramter to the function will be the resolved value, if any.\n\t * @param onRejected A function to call to handle the error. The parameter to the function will be the caught error.\n\t *\n\t * @returns A task\n\t */\n\tthen(\n\t\tonFulfilled?: ((value: T) => TResult1 | PromiseLike) | undefined | null,\n\t\tonRejected?: ((reason: any) => TResult2 | PromiseLike) | undefined | null\n\t): Task {\n\t\t// FIXME\n\t\t// tslint:disable-next-line:no-var-keyword\n\t\tvar task = super.then(\n\t\t\t// Don't call the onFulfilled or onRejected handlers if this Task is canceled\n\t\t\tfunction(value) {\n\t\t\t\tif (task._state === State.Canceled) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif (onFulfilled) {\n\t\t\t\t\treturn onFulfilled(value);\n\t\t\t\t}\n\t\t\t\treturn value;\n\t\t\t},\n\t\t\tfunction(error) {\n\t\t\t\tif (task._state === State.Canceled) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif (onRejected) {\n\t\t\t\t\treturn onRejected(error);\n\t\t\t\t}\n\t\t\t\tthrow error;\n\t\t\t}\n\t\t) as Task;\n\n\t\ttask.canceler = () => {\n\t\t\t// If task's parent (this) hasn't been resolved, cancel it; downward propagation will start at the first\n\t\t\t// unresolved parent\n\t\t\tif (this._state === State.Pending) {\n\t\t\t\tthis.cancel();\n\t\t\t} else {\n\t\t\t\t// If task's parent has been resolved, propagate cancelation to the task's descendants\n\t\t\t\ttask._cancel();\n\t\t\t}\n\t\t};\n\n\t\t// Keep track of child Tasks for propogating cancelation back down the chain\n\t\tthis.children.push(task);\n\n\t\treturn task;\n\t}\n}\n\nexport default Task;\n"]} \ No newline at end of file diff --git a/deps/framework/core/async/Task.mjs b/deps/framework/core/async/Task.mjs deleted file mode 100644 index 6574910531..0000000000 --- a/deps/framework/core/async/Task.mjs +++ /dev/null @@ -1,244 +0,0 @@ -import { isArrayLike, isIterable } from '../../shim/iterator'; -import ExtensiblePromise, { unwrapPromises } from './ExtensiblePromise'; -/** - * A type guard that determines if `value` is a `Task` - * @param value The value to guard - */ -export function isTask(value) { - return Boolean(value && typeof value.cancel === 'function' && Array.isArray(value.children) && isThenable(value)); -} -/** - * Returns true if a given value has a `then` method. - * @param {any} value The value to check if is Thenable - * @returns {is Thenable} A type guard if the value is thenable - */ -export function isThenable(value) { - return value && typeof value.then === 'function'; -} -/** - * Task is an extension of Promise that supports cancellation and the Task#finally method. - */ -export class Task extends ExtensiblePromise { - /** - * @constructor - * - * Create a new task. Executor is run immediately. The canceler will be called when the task is canceled. - * - * @param executor Method that initiates some task - * @param canceler Method to call when the task is canceled - * - */ - constructor(executor, canceler) { - // we have to initialize these to avoid a compiler error of using them before they are initialized - let superResolve = () => { }; - let superReject = () => { }; - super((resolve, reject) => { - superResolve = resolve; - superReject = reject; - }); - this._state = 1 /* Pending */; - this.children = []; - this.canceler = () => { - if (canceler) { - canceler(); - } - this._cancel(); - }; - // Don't let the Task resolve if it's been canceled - try { - executor((value) => { - if (this._state === 3 /* Canceled */) { - return; - } - this._state = 0 /* Fulfilled */; - superResolve(value); - }, (reason) => { - if (this._state === 3 /* Canceled */) { - return; - } - this._state = 2 /* Rejected */; - superReject(reason); - }); - } - catch (reason) { - this._state = 2 /* Rejected */; - superReject(reason); - } - } - /** - * Return a Task that resolves when one of the passed in objects have resolved - * - * @param iterable An iterable of values to resolve. These can be Promises, ExtensiblePromises, or other objects - * @returns {Task} - */ - static race(iterable) { - return new this((resolve, reject) => { - Promise.race(unwrapPromises(iterable)).then(resolve, reject); - }); - } - /** - * Return a rejected promise wrapped in a Task - * - * @param reason The reason for the rejection - * @returns A task - */ - static reject(reason) { - return new this((resolve, reject) => reject(reason)); - } - /** - * Return a resolved task. - * - * @param value The value to resolve with - * - * @return A task - */ - static resolve(value) { - return new this((resolve, reject) => resolve(value)); - } - /** - * Return a ExtensiblePromise that resolves when all of the passed in objects have resolved. When used with a key/value - * pair, the returned promise's argument is a key/value pair of the original keys with their resolved values. - * - * @example - * ExtensiblePromise.all({ one: 1, two: 2 }).then(results => console.log(results)); - * // { one: 1, two: 2 } - * - * @param iterable An iterable of values to resolve, or a key/value pair of values to resolve. These can be Promises, ExtensiblePromises, or other objects - * @returns An extensible promise - */ - static all(iterable) { - return new Task((resolve, reject) => { - super.all(iterable).then(resolve, reject); - }, () => { - if (isArrayLike(iterable)) { - for (let i = 0; i < iterable.length; i++) { - const promiseLike = iterable[i]; - if (isTask(promiseLike)) { - promiseLike.cancel(); - } - } - } - else if (isIterable(iterable)) { - for (const promiseLike of iterable) { - if (isTask(promiseLike)) { - promiseLike.cancel(); - } - } - } - else { - Object.keys(iterable).forEach((key) => { - const promiseLike = iterable[key]; - if (isTask(promiseLike)) { - promiseLike.cancel(); - } - }); - } - }); - } - get state() { - return this._state; - } - /** - * Propagates cancellation down through a Task tree. The Task's state is immediately set to canceled. If a Thenable - * finally task was passed in, it is resolved before calling this Task's finally callback; otherwise, this Task's - * finally callback is immediately executed. `_cancel` is called for each child Task, passing in the value returned - * by this Task's finally callback or a Promise chain that will eventually resolve to that value. - */ - _cancel(finallyTask) { - this._state = 3 /* Canceled */; - const runFinally = () => { - try { - return this._finally && this._finally(); - } - catch (error) { - // Any errors in a `finally` callback are completely ignored during cancelation - } - }; - if (this._finally) { - if (isThenable(finallyTask)) { - finallyTask = finallyTask.then(runFinally, runFinally); - } - else { - finallyTask = runFinally(); - } - } - this.children.forEach(function (child) { - child._cancel(finallyTask); - }); - } - /** - * Immediately cancels this task if it has not already resolved. This Task and any descendants are synchronously set - * to the Canceled state and any `finally` added downstream from the canceled Task are invoked. - */ - cancel() { - if (this._state === 1 /* Pending */) { - this.canceler(); - } - } - catch(onRejected) { - return this.then(undefined, onRejected); - } - /** - * Allows for cleanup actions to be performed after resolution of a Promise. - */ - finally(callback) { - // if this task is already canceled, call the task - if (this._state === 3 /* Canceled */) { - callback(); - return this; - } - const task = this.then((value) => Task.resolve(callback()).then(() => value), (reason) => Task.resolve(callback()).then(() => { - throw reason; - })); - // Keep a reference to the callback; it will be called if the Task is canceled - task._finally = callback; - return task; - } - /** - * Adds a callback to be invoked when the Task resolves or is rejected. - * - * @param onFulfilled A function to call to handle the resolution. The paramter to the function will be the resolved value, if any. - * @param onRejected A function to call to handle the error. The parameter to the function will be the caught error. - * - * @returns A task - */ - then(onFulfilled, onRejected) { - // FIXME - // tslint:disable-next-line:no-var-keyword - var task = super.then( - // Don't call the onFulfilled or onRejected handlers if this Task is canceled - function (value) { - if (task._state === 3 /* Canceled */) { - return; - } - if (onFulfilled) { - return onFulfilled(value); - } - return value; - }, function (error) { - if (task._state === 3 /* Canceled */) { - return; - } - if (onRejected) { - return onRejected(error); - } - throw error; - }); - task.canceler = () => { - // If task's parent (this) hasn't been resolved, cancel it; downward propagation will start at the first - // unresolved parent - if (this._state === 1 /* Pending */) { - this.cancel(); - } - else { - // If task's parent has been resolved, propagate cancelation to the task's descendants - task._cancel(); - } - }; - // Keep track of child Tasks for propogating cancelation back down the chain - this.children.push(task); - return task; - } -} -export default Task; -//# sourceMappingURL=Task.mjs.map \ No newline at end of file diff --git a/deps/framework/core/async/Task.mjs.map b/deps/framework/core/async/Task.mjs.map deleted file mode 100644 index 59465049a3..0000000000 --- a/deps/framework/core/async/Task.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"Task.mjs","sourceRoot":"","sources":["Task.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,UAAU,EAAY,MAAM,qBAAqB,CAAC;AAExE,OAAO,iBAAiB,EAAE,EAAwC,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAY9G;;;GAGG;AACH,MAAM,iBAAoB,KAAU;IACnC,MAAM,CAAC,OAAO,CAAC,KAAK,IAAI,OAAO,KAAK,CAAC,MAAM,KAAK,UAAU,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,QAAQ,CAAC,IAAI,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC;AACnH,CAAC;AAED;;;;GAIG;AACH,MAAM,qBAAwB,KAAU;IACvC,MAAM,CAAC,KAAK,IAAI,OAAO,KAAK,CAAC,IAAI,KAAK,UAAU,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;OAOG;IACH,IAAI,CACH,WAAiF,EACjF,UAAmF;QAEnF,QAAQ;QACR,0CAA0C;QAC1C,IAAI,IAAI,GAAG,KAAK,CAAC,IAAI;QACpB,6EAA6E;QAC7E,UAAS,KAAK;YACb,EAAE,CAAC,CAAC,IAAI,CAAC,MAAM,qBAAmB,CAAC,CAAC,CAAC;gBACpC,MAAM,CAAC;YACR,CAAC;YACD,EAAE,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC;gBACjB,MAAM,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;YAC3B,CAAC;YACD,MAAM,CAAM,KAAK,CAAC;QACnB,CAAC,EACD,UAAS,KAAK;YACb,EAAE,CAAC,CAAC,IAAI,CAAC,MAAM,qBAAmB,CAAC,CAAC,CAAC;gBACpC,MAAM,CAAC;YACR,CAAC;YACD,EAAE,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC;gBAChB,MAAM,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;YAC1B,CAAC;YACD,MAAM,KAAK,CAAC;QACb,CAAC,CAC4B,CAAC;QAE/B,IAAI,CAAC,QAAQ,GAAG,GAAG,EAAE;YACpB,wGAAwG;YACxG,oBAAoB;YACpB,EAAE,CAAC,CAAC,IAAI,CAAC,MAAM,oBAAkB,CAAC,CAAC,CAAC;gBACnC,IAAI,CAAC,MAAM,EAAE,CAAC;YACf,CAAC;YAAC,IAAI,CAAC,CAAC;gBACP,sFAAsF;gBACtF,IAAI,CAAC,OAAO,EAAE,CAAC;YAChB,CAAC;QACF,CAAC,CAAC;QAEF,4EAA4E;QAC5E,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAEzB,MAAM,CAAC,IAAI,CAAC;IACb,CAAC;CACD;AAED,eAAe,IAAI,CAAC","sourcesContent":["import { Thenable } from '../../shim/interfaces';\nimport { isArrayLike, isIterable, Iterable } from '../../shim/iterator';\nimport { Executor } from '../../shim/Promise';\nimport ExtensiblePromise, { DictionaryOfPromises, ListOfPromises, unwrapPromises } from './ExtensiblePromise';\n\n/**\n * Describe the internal state of a task.\n */\nexport const enum State {\n\tFulfilled = 0,\n\tPending = 1,\n\tRejected = 2,\n\tCanceled = 3\n}\n\n/**\n * A type guard that determines if `value` is a `Task`\n * @param value The value to guard\n */\nexport function isTask(value: any): value is Task {\n\treturn Boolean(value && typeof value.cancel === 'function' && Array.isArray(value.children) && isThenable(value));\n}\n\n/**\n * Returns true if a given value has a `then` method.\n * @param {any} value The value to check if is Thenable\n * @returns {is Thenable} A type guard if the value is thenable\n */\nexport function isThenable(value: any): value is Thenable {\n\treturn value && typeof value.then === 'function';\n}\n\n/**\n * Task is an extension of Promise that supports cancellation and the Task#finally method.\n */\nexport class Task extends ExtensiblePromise {\n\t/**\n\t * Return a Task that resolves when one of the passed in objects have resolved\n\t *\n\t * @param iterable An iterable of values to resolve. These can be Promises, ExtensiblePromises, or other objects\n\t * @returns {Task}\n\t */\n\tstatic race(iterable: Iterable> | (T | Thenable)[]): Task {\n\t\treturn new this((resolve, reject) => {\n\t\t\tPromise.race(unwrapPromises(iterable)).then(resolve, reject);\n\t\t});\n\t}\n\n\t/**\n\t * Return a rejected promise wrapped in a Task\n\t *\n\t * @param reason The reason for the rejection\n\t * @returns A task\n\t */\n\tstatic reject(reason?: Error): Task {\n\t\treturn new this((resolve, reject) => reject(reason));\n\t}\n\n\t/**\n\t * Return a resolved task.\n\t *\n\t * @param value The value to resolve with\n\t *\n\t * @return A task\n\t */\n\tpublic static resolve(): Task;\n\n\t/**\n\t * Return a resolved task.\n\t *\n\t * @param value The value to resolve with\n\t *\n\t * @return A task\n\t */\n\tpublic static resolve(value: T | Thenable): Task;\n\n\t/**\n\t * Return a resolved task.\n\t *\n\t * @param value The value to resolve with\n\t *\n\t * @return A task\n\t */\n\tpublic static resolve(value?: any): Task {\n\t\treturn new this((resolve, reject) => resolve(value));\n\t}\n\n\t/**\n\t * Return a ExtensiblePromise that resolves when all of the passed in objects have resolved. When used with a key/value\n\t * pair, the returned promise's argument is a key/value pair of the original keys with their resolved values.\n\t *\n\t * @example\n\t * ExtensiblePromise.all({ one: 1, two: 2 }).then(results => console.log(results));\n\t * // { one: 1, two: 2 }\n\t *\n\t * @param iterable An iterable of values to resolve, or a key/value pair of values to resolve. These can be Promises, ExtensiblePromises, or other objects\n\t * @returns An extensible promise\n\t */\n\tstatic all(iterable: DictionaryOfPromises): Task<{ [key: string]: T }>;\n\n\t/**\n\t * Return a ExtensiblePromise that resolves when all of the passed in objects have resolved. When used with a key/value\n\t * pair, the returned promise's argument is a key/value pair of the original keys with their resolved values.\n\t *\n\t * @example\n\t * ExtensiblePromise.all({ one: 1, two: 2 }).then(results => console.log(results));\n\t * // { one: 1, two: 2 }\n\t *\n\t * @param iterable An iterable of values to resolve, or a key/value pair of values to resolve. These can be Promises, ExtensiblePromises, or other objects\n\t * @returns An extensible promise\n\t */\n\tstatic all(iterable: (T | Thenable)[]): Task;\n\n\t/**\n\t * Return a ExtensiblePromise that resolves when all of the passed in objects have resolved. When used with a key/value\n\t * pair, the returned promise's argument is a key/value pair of the original keys with their resolved values.\n\t *\n\t * @example\n\t * ExtensiblePromise.all({ one: 1, two: 2 }).then(results => console.log(results));\n\t * // { one: 1, two: 2 }\n\t *\n\t * @param iterable An iterable of values to resolve, or a key/value pair of values to resolve. These can be Promises, ExtensiblePromises, or other objects\n\t * @returns An extensible promise\n\t */\n\tstatic all(iterable: T | Thenable): Task;\n\n\t/**\n\t * Return a ExtensiblePromise that resolves when all of the passed in objects have resolved. When used with a key/value\n\t * pair, the returned promise's argument is a key/value pair of the original keys with their resolved values.\n\t *\n\t * @example\n\t * ExtensiblePromise.all({ one: 1, two: 2 }).then(results => console.log(results));\n\t * // { one: 1, two: 2 }\n\t *\n\t * @param iterable An iterable of values to resolve, or a key/value pair of values to resolve. These can be Promises, ExtensiblePromises, or other objects\n\t * @returns An extensible promise\n\t */\n\tstatic all(iterable: ListOfPromises): Task;\n\n\t/**\n\t * Return a ExtensiblePromise that resolves when all of the passed in objects have resolved. When used with a key/value\n\t * pair, the returned promise's argument is a key/value pair of the original keys with their resolved values.\n\t *\n\t * @example\n\t * ExtensiblePromise.all({ one: 1, two: 2 }).then(results => console.log(results));\n\t * // { one: 1, two: 2 }\n\t *\n\t * @param iterable An iterable of values to resolve, or a key/value pair of values to resolve. These can be Promises, ExtensiblePromises, or other objects\n\t * @returns An extensible promise\n\t */\n\tstatic all(iterable: DictionaryOfPromises | ListOfPromises): Task {\n\t\treturn new Task(\n\t\t\t(resolve, reject) => {\n\t\t\t\tsuper.all(iterable).then(resolve, reject);\n\t\t\t},\n\t\t\t() => {\n\t\t\t\tif (isArrayLike(iterable)) {\n\t\t\t\t\tfor (let i = 0; i < iterable.length; i++) {\n\t\t\t\t\t\tconst promiseLike = iterable[i];\n\n\t\t\t\t\t\tif (isTask(promiseLike)) {\n\t\t\t\t\t\t\tpromiseLike.cancel();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} else if (isIterable(iterable)) {\n\t\t\t\t\tfor (const promiseLike of iterable) {\n\t\t\t\t\t\tif (isTask(promiseLike)) {\n\t\t\t\t\t\t\tpromiseLike.cancel();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tObject.keys(iterable).forEach((key: any) => {\n\t\t\t\t\t\tconst promiseLike = iterable[key];\n\n\t\t\t\t\t\tif (isTask(promiseLike)) {\n\t\t\t\t\t\t\tpromiseLike.cancel();\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\t\t);\n\t}\n\n\t/**\n\t * A cancelation handler that will be called if this task is canceled.\n\t */\n\tprivate canceler: () => void;\n\n\t/**\n\t * Children of this Task (i.e., Tasks that were created from this Task with `then` or `catch`).\n\t */\n\tprivate readonly children: Task[];\n\n\t/**\n\t * The finally callback for this Task (if it was created by a call to `finally`).\n\t */\n\tprivate _finally: undefined | (() => void);\n\n\t/**\n\t * The state of the task\n\t */\n\tprotected _state: State;\n\n\tget state() {\n\t\treturn this._state;\n\t}\n\n\t/**\n\t * @constructor\n\t *\n\t * Create a new task. Executor is run immediately. The canceler will be called when the task is canceled.\n\t *\n\t * @param executor Method that initiates some task\n\t * @param canceler Method to call when the task is canceled\n\t *\n\t */\n\tconstructor(executor: Executor, canceler?: () => void) {\n\t\t// we have to initialize these to avoid a compiler error of using them before they are initialized\n\t\tlet superResolve: (value?: T | Thenable | undefined) => void = () => {};\n\t\tlet superReject: (reason?: any) => void = () => {};\n\n\t\tsuper((resolve, reject) => {\n\t\t\tsuperResolve = resolve;\n\t\t\tsuperReject = reject;\n\t\t});\n\n\t\tthis._state = State.Pending;\n\n\t\tthis.children = [];\n\t\tthis.canceler = () => {\n\t\t\tif (canceler) {\n\t\t\t\tcanceler();\n\t\t\t}\n\t\t\tthis._cancel();\n\t\t};\n\n\t\t// Don't let the Task resolve if it's been canceled\n\t\ttry {\n\t\t\texecutor(\n\t\t\t\t(value) => {\n\t\t\t\t\tif (this._state === State.Canceled) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tthis._state = State.Fulfilled;\n\t\t\t\t\tsuperResolve(value);\n\t\t\t\t},\n\t\t\t\t(reason) => {\n\t\t\t\t\tif (this._state === State.Canceled) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tthis._state = State.Rejected;\n\t\t\t\t\tsuperReject(reason);\n\t\t\t\t}\n\t\t\t);\n\t\t} catch (reason) {\n\t\t\tthis._state = State.Rejected;\n\t\t\tsuperReject(reason);\n\t\t}\n\t}\n\n\t/**\n\t * Propagates cancellation down through a Task tree. The Task's state is immediately set to canceled. If a Thenable\n\t * finally task was passed in, it is resolved before calling this Task's finally callback; otherwise, this Task's\n\t * finally callback is immediately executed. `_cancel` is called for each child Task, passing in the value returned\n\t * by this Task's finally callback or a Promise chain that will eventually resolve to that value.\n\t */\n\tprivate _cancel(finallyTask?: void | Thenable): void {\n\t\tthis._state = State.Canceled;\n\n\t\tconst runFinally = () => {\n\t\t\ttry {\n\t\t\t\treturn this._finally && this._finally();\n\t\t\t} catch (error) {\n\t\t\t\t// Any errors in a `finally` callback are completely ignored during cancelation\n\t\t\t}\n\t\t};\n\n\t\tif (this._finally) {\n\t\t\tif (isThenable(finallyTask)) {\n\t\t\t\tfinallyTask = (>finallyTask).then(runFinally, runFinally);\n\t\t\t} else {\n\t\t\t\tfinallyTask = runFinally();\n\t\t\t}\n\t\t}\n\n\t\tthis.children.forEach(function(child) {\n\t\t\tchild._cancel(finallyTask);\n\t\t});\n\t}\n\n\t/**\n\t * Immediately cancels this task if it has not already resolved. This Task and any descendants are synchronously set\n\t * to the Canceled state and any `finally` added downstream from the canceled Task are invoked.\n\t */\n\tcancel(): void {\n\t\tif (this._state === State.Pending) {\n\t\t\tthis.canceler();\n\t\t}\n\t}\n\n\tcatch(\n\t\tonRejected?: ((reason: any) => TResult | PromiseLike) | undefined\n\t): Task {\n\t\treturn this.then(undefined, onRejected) as Task;\n\t}\n\n\t/**\n\t * Allows for cleanup actions to be performed after resolution of a Promise.\n\t */\n\tfinally(callback: () => void): Task {\n\t\t// if this task is already canceled, call the task\n\t\tif (this._state === State.Canceled) {\n\t\t\tcallback();\n\t\t\treturn this;\n\t\t}\n\n\t\tconst task = this.then(\n\t\t\t(value) => Task.resolve(callback()).then(() => value),\n\t\t\t(reason) =>\n\t\t\t\tTask.resolve(callback()).then(() => {\n\t\t\t\t\tthrow reason;\n\t\t\t\t})\n\t\t);\n\n\t\t// Keep a reference to the callback; it will be called if the Task is canceled\n\t\ttask._finally = callback;\n\t\treturn task;\n\t}\n\n\t/**\n\t * Adds a callback to be invoked when the Task resolves or is rejected.\n\t *\n\t * @param onFulfilled A function to call to handle the resolution. The paramter to the function will be the resolved value, if any.\n\t * @param onRejected A function to call to handle the error. The parameter to the function will be the caught error.\n\t *\n\t * @returns A task\n\t */\n\tthen(\n\t\tonFulfilled?: ((value: T) => TResult1 | PromiseLike) | undefined | null,\n\t\tonRejected?: ((reason: any) => TResult2 | PromiseLike) | undefined | null\n\t): Task {\n\t\t// FIXME\n\t\t// tslint:disable-next-line:no-var-keyword\n\t\tvar task = super.then(\n\t\t\t// Don't call the onFulfilled or onRejected handlers if this Task is canceled\n\t\t\tfunction(value) {\n\t\t\t\tif (task._state === State.Canceled) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif (onFulfilled) {\n\t\t\t\t\treturn onFulfilled(value);\n\t\t\t\t}\n\t\t\t\treturn value;\n\t\t\t},\n\t\t\tfunction(error) {\n\t\t\t\tif (task._state === State.Canceled) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif (onRejected) {\n\t\t\t\t\treturn onRejected(error);\n\t\t\t\t}\n\t\t\t\tthrow error;\n\t\t\t}\n\t\t) as Task;\n\n\t\ttask.canceler = () => {\n\t\t\t// If task's parent (this) hasn't been resolved, cancel it; downward propagation will start at the first\n\t\t\t// unresolved parent\n\t\t\tif (this._state === State.Pending) {\n\t\t\t\tthis.cancel();\n\t\t\t} else {\n\t\t\t\t// If task's parent has been resolved, propagate cancelation to the task's descendants\n\t\t\t\ttask._cancel();\n\t\t\t}\n\t\t};\n\n\t\t// Keep track of child Tasks for propogating cancelation back down the chain\n\t\tthis.children.push(task);\n\n\t\treturn task;\n\t}\n}\n\nexport default Task;\n"]} \ No newline at end of file diff --git a/deps/framework/core/async/iteration.d.ts b/deps/framework/core/async/iteration.d.ts deleted file mode 100644 index 13cf28d27e..0000000000 --- a/deps/framework/core/async/iteration.d.ts +++ /dev/null @@ -1,56 +0,0 @@ -import { Iterable } from '../../shim/iterator'; -import { Thenable } from '../../shim/interfaces'; -/** - * Test whether all elements in the array pass the provided callback - * @param items a collection of synchronous/asynchronous values - * @param callback a synchronous/asynchronous test - * @return eventually returns true if all values pass; otherwise false - */ -export declare function every(items: Iterable> | (T | Promise)[], callback: Filterer): Promise; -/** - * Returns an array of elements which pass the provided callback - * @param items a collection of synchronous/asynchronous values - * @param callback a synchronous/asynchronous test - * @return eventually returns a new array with only values that have passed - */ -export declare function filter(items: Iterable> | (T | Promise)[], callback: Filterer): Promise; -/** - * Find the first value matching a filter function - * @param items a collection of synchronous/asynchronous values - * @param callback a synchronous/asynchronous test - * @return a promise eventually containing the item or undefined if a match is not found - */ -export declare function find(items: Iterable> | (T | Promise)[], callback: Filterer): Promise; -/** - * Find the first index with a value matching the filter function - * @param items a collection of synchronous/asynchronous values - * @param callback a synchronous/asynchronous test - * @return a promise eventually containing the index of the matching item or -1 if a match is not found - */ -export declare function findIndex(items: Iterable> | (T | Thenable)[], callback: Filterer): Promise; -/** - * transform a list of items using a mapper function - * @param items a collection of synchronous/asynchronous values - * @param callback a synchronous/asynchronous transform function - * @return a promise eventually containing a collection of each transformed value - */ -export declare function map(items: Iterable> | (T | Promise)[], callback: Mapper): Promise; -/** - * reduce a list of items down to a single value - * @param items a collection of synchronous/asynchronous values - * @param callback a synchronous/asynchronous reducer function - * @param [initialValue] the first value to pass to the callback - * @return a promise eventually containing a value that is the result of the reduction - */ -export declare function reduce(this: any, items: Iterable> | (T | Promise)[], callback: Reducer, initialValue?: U): Promise; -export declare function reduceRight(this: any, items: Iterable> | (T | Promise)[], callback: Reducer, initialValue?: U): Promise; -export declare function series(items: Iterable> | (T | Promise)[], operation: Mapper): Promise; -export declare function some(items: Iterable> | Array>, callback: Filterer): Promise; -export interface Filterer extends Mapper { -} -export interface Mapper { - (value: T, index: number, array: T[]): U | Thenable; -} -export interface Reducer { - (previousValue: U, currentValue: T, index: number, array: T[]): U | Thenable; -} diff --git a/deps/framework/core/async/iteration.js b/deps/framework/core/async/iteration.js deleted file mode 100644 index 80d9a3aeb7..0000000000 --- a/deps/framework/core/async/iteration.js +++ /dev/null @@ -1,244 +0,0 @@ -(function (factory) { - if (typeof module === "object" && typeof module.exports === "object") { - var v = factory(require, exports); - if (v !== undefined) module.exports = v; - } - else if (typeof define === "function" && define.amd) { - define(["require", "exports", "../../shim/array", "../../shim/iterator", "../../shim/Promise"], factory); - } -})(function (require, exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - var array = require("../../shim/array"); - var iterator_1 = require("../../shim/iterator"); - var Promise_1 = require("../../shim/Promise"); - function isThenable(value) { - return value && typeof value.then === 'function'; - } - /** - * Processes all items and then applies the callback to each item and eventually returns an object containing the - * processed values and callback results - * @param items a list of synchronous/asynchronous values to process - * @param callback a callback that maps values to synchronous/asynchronous results - * @return a list of objects holding the synchronous values and synchronous results. - */ - function processValuesAndCallback(items, callback) { - return Promise_1.default.all(items).then(function (results) { - var pass = Array.prototype.map.call(results, callback); - return Promise_1.default.all(pass).then(function (pass) { - return { values: results, results: pass }; - }); - }); - } - /** - * Finds the index of the next value in a sparse array-like object - * @param list the sparse array-like object - * @param offset the starting offset - * @return the offset of the next index with a value; or -1 if not found - */ - function findNextValueIndex(list, offset) { - if (offset === void 0) { offset = -1; } - offset++; - for (var length_1 = list.length; offset < length_1; offset++) { - if (offset in list) { - return offset; - } - } - return -1; - } - function findLastValueIndex(list, offset) { - offset = (offset === undefined ? list.length : offset) - 1; - for (; offset >= 0; offset--) { - if (offset in list) { - return offset; - } - } - return -1; - } - function generalReduce(findNextIndex, items, callback, initialValue) { - var hasInitialValue = arguments.length > 3; - return Promise_1.default.all(items).then(function (results) { - return new Promise_1.default(function (resolve, reject) { - // As iterators do not have indices like `ArrayLike` objects, the results array - // is used to determine the next value. - var list = iterator_1.isArrayLike(items) ? items : results; - var i; - function next(currentValue) { - i = findNextIndex(list, i); - if (i >= 0) { - if (results) { - if (currentValue) { - var result = callback(currentValue, results[i], i, results); - if (isThenable(result)) { - result.then(next, reject); - } - else { - next(result); - } - } - } - } - else { - resolve(currentValue); - } - } - var value; - if (hasInitialValue) { - value = initialValue; - } - else { - i = findNextIndex(list); - if (i < 0) { - throw new Error('reduce array with no initial value'); - } - if (results) { - value = results[i]; - } - } - next(value); - }); - }); - } - function testAndHaltOnCondition(condition, items, callback) { - return Promise_1.default.all(items).then(function (results) { - return new Promise_1.default(function (resolve) { - var result; - var pendingCount = 0; - if (results) { - for (var i = 0; i < results.length; i++) { - result = callback(results[i], i, results); - if (result === condition) { - return resolve(result); - } - else if (isThenable(result)) { - pendingCount++; - result.then(function (result) { - if (result === condition) { - resolve(result); - } - pendingCount--; - if (pendingCount === 0) { - resolve(!condition); - } - }); - } - } - } - if (pendingCount === 0) { - resolve(!condition); - } - }); - }); - } - /** - * Test whether all elements in the array pass the provided callback - * @param items a collection of synchronous/asynchronous values - * @param callback a synchronous/asynchronous test - * @return eventually returns true if all values pass; otherwise false - */ - function every(items, callback) { - return testAndHaltOnCondition(false, items, callback); - } - exports.every = every; - /** - * Returns an array of elements which pass the provided callback - * @param items a collection of synchronous/asynchronous values - * @param callback a synchronous/asynchronous test - * @return eventually returns a new array with only values that have passed - */ - function filter(items, callback) { - return processValuesAndCallback(items, callback).then(function (result) { - var arr = []; - if (result && result.results && result.values) { - for (var i = 0; i < result.results.length; i++) { - result.results[i] && arr.push(result.values[i]); - } - } - return arr; - }); - } - exports.filter = filter; - /** - * Find the first value matching a filter function - * @param items a collection of synchronous/asynchronous values - * @param callback a synchronous/asynchronous test - * @return a promise eventually containing the item or undefined if a match is not found - */ - function find(items, callback) { - var list = iterator_1.isArrayLike(items) ? items : array.from(items); - return findIndex(list, callback).then(function (i) { - return i !== undefined && i >= 0 ? list[i] : undefined; - }); - } - exports.find = find; - /** - * Find the first index with a value matching the filter function - * @param items a collection of synchronous/asynchronous values - * @param callback a synchronous/asynchronous test - * @return a promise eventually containing the index of the matching item or -1 if a match is not found - */ - function findIndex(items, callback) { - // TODO we can improve this by returning immediately - return processValuesAndCallback(items, callback).then(function (result) { - if (result && result.results) { - for (var i = 0; i < result.results.length; i++) { - if (result.results[i]) { - return i; - } - } - } - return -1; - }); - } - exports.findIndex = findIndex; - /** - * transform a list of items using a mapper function - * @param items a collection of synchronous/asynchronous values - * @param callback a synchronous/asynchronous transform function - * @return a promise eventually containing a collection of each transformed value - */ - function map(items, callback) { - return processValuesAndCallback(items, callback).then(function (result) { - return result ? result.results : null; - }); - } - exports.map = map; - /** - * reduce a list of items down to a single value - * @param items a collection of synchronous/asynchronous values - * @param callback a synchronous/asynchronous reducer function - * @param [initialValue] the first value to pass to the callback - * @return a promise eventually containing a value that is the result of the reduction - */ - function reduce(items, callback, initialValue) { - var args = array.from(arguments); - args.unshift(findNextValueIndex); - return generalReduce.apply(this, args); - } - exports.reduce = reduce; - function reduceRight(items, callback, initialValue) { - var args = array.from(arguments); - args.unshift(findLastValueIndex); - return generalReduce.apply(this, args); - } - exports.reduceRight = reduceRight; - function series(items, operation) { - return generalReduce(findNextValueIndex, items, function (previousValue, currentValue, index, array) { - var result = operation(currentValue, index, array); - if (isThenable(result)) { - return result.then(function (value) { - previousValue.push(value); - return previousValue; - }); - } - previousValue.push(result); - return previousValue; - }, []); - } - exports.series = series; - function some(items, callback) { - return testAndHaltOnCondition(true, items, callback); - } - exports.some = some; -}); -//# sourceMappingURL=iteration.js.map \ No newline at end of file diff --git a/deps/framework/core/async/iteration.js.map b/deps/framework/core/async/iteration.js.map deleted file mode 100644 index 186cdda86c..0000000000 --- a/deps/framework/core/async/iteration.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"iteration.js","sourceRoot":"","sources":["iteration.ts"],"names":[],"mappings":";;;;;;;;;;;IAAA,wCAA0C;IAC1C,gDAA4D;IAC5D,8CAAyC;IAGzC,oBAAuB,KAAU;QAChC,MAAM,CAAC,KAAK,IAAI,OAAO,KAAK,CAAC,IAAI,KAAK,UAAU,CAAC;IAClD,CAAC;IAID;;;;;;OAMG;IACH,kCACC,KAAqD,EACrD,QAAsB;QAEtB,MAAM,CAAC,iBAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,UAAS,OAAO;YAC9C,IAAM,IAAI,GAAuB,KAAK,CAAC,SAAS,CAAC,GAAG,CAAC,IAAI,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;Y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CAAC,kBAAkB,CAAC,CAAC;QACjC,MAAM,CAAC,aAAa,CAAC,KAAK,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;IACxC,CAAC;IATD,wBASC;IAED,qBAEC,KAAoD,EACpD,QAAuB,EACvB,YAAgB;QAEhB,IAAM,IAAI,GAAiB,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QACjD,IAAI,CAAC,OAAO,CAAC,kBAAkB,CAAC,CAAC;QACjC,MAAM,CAAC,aAAa,CAAC,KAAK,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;IACxC,CAAC;IATD,kCASC;IAED,gBACC,KAAoD,EACpD,SAAuB;QAEvB,MAAM,CAAC,aAAa,CACnB,kBAAkB,EAClB,KAAK,EACL,UAAS,aAAa,EAAE,YAAe,EAAE,KAAa,EAAE,KAAU;YACjE,IAAM,MAAM,GAAG,SAAS,CAAC,YAAY,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC;YAErD,EAAE,CAAC,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;gBACxB,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,UAAS,KAAK;oBAChC,aAAa,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;oBAC1B,MAAM,CAAC,aAAa,CAAC;gBACtB,CAAC,CAAC,CAAC;YACJ,CAAC;YAED,aAAa,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;YAC3B,MAAM,CAAC,aAAa,CAAC;QACtB,CAAC,EACD,EAAS,CACT,CAAC;IACH,CAAC;IAtBD,wBAsBC;IAED,cACC,KAAuD,EACvD,QAAqB;QAErB,MAAM,CAAC,sBAAsB,CAAC,IAAI,EAAE,KAAK,EAAE,QAAQ,CAAC,CAAC;IACtD,CAAC;IALD,oBAKC","sourcesContent":["import * as array from '../../shim/array';\nimport { isArrayLike, Iterable } from '../../shim/iterator';\nimport Promise from '../../shim/Promise';\nimport { Thenable } from '../../shim/interfaces';\n\nfunction isThenable(value: any): value is Thenable {\n\treturn value && typeof value.then === 'function';\n}\n\ntype ValuesAndResults = { values: T[] | undefined; results: U[] | undefined };\n\n/**\n * Processes all items and then applies the callback to each item and eventually returns an object containing the\n * processed values and callback results\n * @param items a list of synchronous/asynchronous values to process\n * @param callback a callback that maps values to synchronous/asynchronous results\n * @return a list of objects holding the synchronous values and synchronous results.\n */\nfunction processValuesAndCallback(\n\titems: Iterable> | (T | Thenable)[],\n\tcallback: Mapper\n): Promise> {\n\treturn Promise.all(items).then(function(results) {\n\t\tconst pass: (U | Promise)[] = Array.prototype.map.call(results, callback);\n\t\treturn Promise.all(pass).then(function(pass) {\n\t\t\treturn { values: results, results: pass };\n\t\t});\n\t});\n}\n\n/**\n * Finds the index of the next value in a sparse array-like object\n * @param list the sparse array-like object\n * @param offset the starting offset\n * @return the offset of the next index with a value; or -1 if not found\n */\nfunction findNextValueIndex(list: ArrayLike, offset: number = -1): number {\n\toffset++;\n\tfor (let length = list.length; offset < length; offset++) {\n\t\tif (offset in list) {\n\t\t\treturn offset;\n\t\t}\n\t}\n\treturn -1;\n}\n\nfunction findLastValueIndex(list: ArrayLike, offset?: number): number {\n\toffset = (offset === undefined ? list.length : offset) - 1;\n\tfor (; offset >= 0; offset--) {\n\t\tif (offset in list) {\n\t\t\treturn offset;\n\t\t}\n\t}\n\treturn -1;\n}\n\nfunction generalReduce(\n\tfindNextIndex: (list: ArrayLike, offset?: number) => number,\n\titems: Iterable> | (T | Promise)[],\n\tcallback: Reducer,\n\tinitialValue?: U\n): Promise {\n\tconst hasInitialValue = arguments.length > 3;\n\treturn Promise.all(items).then(function(results) {\n\t\treturn new Promise(function(resolve, reject) {\n\t\t\t// As iterators do not have indices like `ArrayLike` objects, the results array\n\t\t\t// is used to determine the next value.\n\t\t\tconst list = isArrayLike(items) ? items : results;\n\t\t\tlet i: number;\n\t\t\tfunction next(currentValue: U | undefined): void {\n\t\t\t\ti = findNextIndex(list, i);\n\t\t\t\tif (i >= 0) {\n\t\t\t\t\tif (results) {\n\t\t\t\t\t\tif (currentValue) {\n\t\t\t\t\t\t\tconst result = callback(currentValue, results[i], i, results);\n\n\t\t\t\t\t\t\tif (isThenable(result)) {\n\t\t\t\t\t\t\t\tresult.then(next, reject);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tnext(result);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tresolve(currentValue);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tlet value: U | undefined;\n\t\t\tif (hasInitialValue) {\n\t\t\t\tvalue = initialValue;\n\t\t\t} else {\n\t\t\t\ti = findNextIndex(list);\n\n\t\t\t\tif (i < 0) {\n\t\t\t\t\tthrow new Error('reduce array with no initial value');\n\t\t\t\t}\n\t\t\t\tif (results) {\n\t\t\t\t\tvalue = results[i];\n\t\t\t\t}\n\t\t\t}\n\t\t\tnext(value);\n\t\t});\n\t});\n}\n\nfunction testAndHaltOnCondition(\n\tcondition: boolean,\n\titems: Iterable> | (T | Promise)[],\n\tcallback: Filterer\n): Promise {\n\treturn Promise.all(items).then(function(results) {\n\t\treturn new Promise(function(resolve) {\n\t\t\tlet result: boolean | Thenable;\n\t\t\tlet pendingCount = 0;\n\t\t\tif (results) {\n\t\t\t\tfor (let i = 0; i < results.length; i++) {\n\t\t\t\t\tresult = callback(results[i], i, results);\n\t\t\t\t\tif (result === condition) {\n\t\t\t\t\t\treturn resolve(result);\n\t\t\t\t\t} else if (isThenable(result)) {\n\t\t\t\t\t\tpendingCount++;\n\t\t\t\t\t\tresult.then(function(result) {\n\t\t\t\t\t\t\tif (result === condition) {\n\t\t\t\t\t\t\t\tresolve(result);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tpendingCount--;\n\t\t\t\t\t\t\tif (pendingCount === 0) {\n\t\t\t\t\t\t\t\tresolve(!condition);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (pendingCount === 0) {\n\t\t\t\tresolve(!condition);\n\t\t\t}\n\t\t});\n\t});\n}\n\n/**\n * Test whether all elements in the array pass the provided callback\n * @param items a collection of synchronous/asynchronous values\n * @param callback a synchronous/asynchronous test\n * @return eventually returns true if all values pass; otherwise false\n */\nexport function every(\n\titems: Iterable> | (T | Promise)[],\n\tcallback: Filterer\n): Promise {\n\treturn testAndHaltOnCondition(false, items, callback);\n}\n\n/**\n * Returns an array of elements which pass the provided callback\n * @param items a collection of synchronous/asynchronous values\n * @param callback a synchronous/asynchronous test\n * @return eventually returns a new array with only values that have passed\n */\nexport function filter(items: Iterable> | (T | Promise)[], callback: Filterer): Promise {\n\treturn processValuesAndCallback(items, callback).then(function(result) {\n\t\tlet arr: T[] = [];\n\t\tif (result && result.results && result.values) {\n\t\t\tfor (let i = 0; i < result.results.length; i++) {\n\t\t\t\tresult.results[i] && arr.push(result.values[i]);\n\t\t\t}\n\t\t}\n\t\treturn arr;\n\t});\n}\n\n/**\n * Find the first value matching a filter function\n * @param items a collection of synchronous/asynchronous values\n * @param callback a synchronous/asynchronous test\n * @return a promise eventually containing the item or undefined if a match is not found\n */\nexport function find(\n\titems: Iterable> | (T | Promise)[],\n\tcallback: Filterer\n): Promise {\n\tconst list = isArrayLike(items) ? items : array.from(items);\n\treturn findIndex(list, callback).then(function(i) {\n\t\treturn i !== undefined && i >= 0 ? list[i] : undefined;\n\t});\n}\n\n/**\n * Find the first index with a value matching the filter function\n * @param items a collection of synchronous/asynchronous values\n * @param callback a synchronous/asynchronous test\n * @return a promise eventually containing the index of the matching item or -1 if a match is not found\n */\nexport function findIndex(\n\titems: Iterable> | (T | Thenable)[],\n\tcallback: Filterer\n): Promise {\n\t// TODO we can improve this by returning immediately\n\treturn processValuesAndCallback(items, callback).then(function(result: ValuesAndResults) {\n\t\tif (result && result.results) {\n\t\t\tfor (let i = 0; i < result.results.length; i++) {\n\t\t\t\tif (result.results[i]) {\n\t\t\t\t\treturn i;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn -1;\n\t});\n}\n\n/**\n * transform a list of items using a mapper function\n * @param items a collection of synchronous/asynchronous values\n * @param callback a synchronous/asynchronous transform function\n * @return a promise eventually containing a collection of each transformed value\n */\nexport function map(\n\titems: Iterable> | (T | Promise)[],\n\tcallback: Mapper\n): Promise {\n\treturn processValuesAndCallback(items, callback).then(function(result) {\n\t\treturn result ? result.results : null;\n\t});\n}\n\n/**\n * reduce a list of items down to a single value\n * @param items a collection of synchronous/asynchronous values\n * @param callback a synchronous/asynchronous reducer function\n * @param [initialValue] the first value to pass to the callback\n * @return a promise eventually containing a value that is the result of the reduction\n */\nexport function reduce(\n\tthis: any,\n\titems: Iterable> | (T | Promise)[],\n\tcallback: Reducer,\n\tinitialValue?: U\n): Promise {\n\tconst args: any[] = array.from(arguments);\n\targs.unshift(findNextValueIndex);\n\treturn generalReduce.apply(this, args);\n}\n\nexport function reduceRight(\n\tthis: any,\n\titems: Iterable> | (T | Promise)[],\n\tcallback: Reducer,\n\tinitialValue?: U\n): Promise {\n\tconst args: any[] = array.from(arguments);\n\targs.unshift(findLastValueIndex);\n\treturn generalReduce.apply(this, args);\n}\n\nexport function series(\n\titems: Iterable> | (T | Promise)[],\n\toperation: Mapper\n): Promise {\n\treturn generalReduce(\n\t\tfindNextValueIndex,\n\t\titems,\n\t\tfunction(previousValue, currentValue: T, index: number, array: T[]) {\n\t\t\tconst result = operation(currentValue, index, array);\n\n\t\t\tif (isThenable(result)) {\n\t\t\t\treturn result.then(function(value) {\n\t\t\t\t\tpreviousValue.push(value);\n\t\t\t\t\treturn previousValue;\n\t\t\t\t});\n\t\t\t}\n\n\t\t\tpreviousValue.push(result);\n\t\t\treturn previousValue;\n\t\t},\n\t\t[] as U[]\n\t);\n}\n\nexport function some(\n\titems: Iterable> | Array>,\n\tcallback: Filterer\n): Promise {\n\treturn testAndHaltOnCondition(true, items, callback);\n}\n\nexport interface Filterer extends Mapper {}\n\nexport interface Mapper {\n\t(value: T, index: number, array: T[]): U | Thenable;\n}\n\nexport interface Reducer {\n\t(previousValue: U, currentValue: T, index: number, array: T[]): U | Thenable;\n}\n"]} \ No newline at end of file diff --git a/deps/framework/core/async/iteration.mjs b/deps/framework/core/async/iteration.mjs deleted file mode 100644 index de0bf0805f..0000000000 --- a/deps/framework/core/async/iteration.mjs +++ /dev/null @@ -1,222 +0,0 @@ -import * as array from '../../shim/array'; -import { isArrayLike } from '../../shim/iterator'; -import Promise from '../../shim/Promise'; -function isThenable(value) { - return value && typeof value.then === 'function'; -} -/** - * Processes all items and then applies the callback to each item and eventually returns an object containing the - * processed values and callback results - * @param items a list of synchronous/asynchronous values to process - * @param callback a callback that maps values to synchronous/asynchronous results - * @return a list of objects holding the synchronous values and synchronous results. - */ -function processValuesAndCallback(items, callback) { - return Promise.all(items).then(function (results) { - const pass = Array.prototype.map.call(results, callback); - return Promise.all(pass).then(function (pass) { - return { values: results, results: pass }; - }); - }); -} -/** - * Finds the index of the next value in a sparse array-like object - * @param list the sparse array-like object - * @param offset the starting offset - * @return the offset of the next index with a value; or -1 if not found - */ -function findNextValueIndex(list, offset = -1) { - offset++; - for (let length = list.length; offset < length; offset++) { - if (offset in list) { - return offset; - } - } - return -1; -} -function findLastValueIndex(list, offset) { - offset = (offset === undefined ? list.length : offset) - 1; - for (; offset >= 0; offset--) { - if (offset in list) { - return offset; - } - } - return -1; -} -function generalReduce(findNextIndex, items, callback, initialValue) { - const hasInitialValue = arguments.length > 3; - return Promise.all(items).then(function (results) { - return new Promise(function (resolve, reject) { - // As iterators do not have indices like `ArrayLike` objects, the results array - // is used to determine the next value. - const list = isArrayLike(items) ? items : results; - let i; - function next(currentValue) { - i = findNextIndex(list, i); - if (i >= 0) { - if (results) { - if (currentValue) { - const result = callback(currentValue, results[i], i, results); - if (isThenable(result)) { - result.then(next, reject); - } - else { - next(result); - } - } - } - } - else { - resolve(currentValue); - } - } - let value; - if (hasInitialValue) { - value = initialValue; - } - else { - i = findNextIndex(list); - if (i < 0) { - throw new Error('reduce array with no initial value'); - } - if (results) { - value = results[i]; - } - } - next(value); - }); - }); -} -function testAndHaltOnCondition(condition, items, callback) { - return Promise.all(items).then(function (results) { - return new Promise(function (resolve) { - let result; - let pendingCount = 0; - if (results) { - for (let i = 0; i < results.length; i++) { - result = callback(results[i], i, results); - if (result === condition) { - return resolve(result); - } - else if (isThenable(result)) { - pendingCount++; - result.then(function (result) { - if (result === condition) { - resolve(result); - } - pendingCount--; - if (pendingCount === 0) { - resolve(!condition); - } - }); - } - } - } - if (pendingCount === 0) { - resolve(!condition); - } - }); - }); -} -/** - * Test whether all elements in the array pass the provided callback - * @param items a collection of synchronous/asynchronous values - * @param callback a synchronous/asynchronous test - * @return eventually returns true if all values pass; otherwise false - */ -export function every(items, callback) { - return testAndHaltOnCondition(false, items, callback); -} -/** - * Returns an array of elements which pass the provided callback - * @param items a collection of synchronous/asynchronous values - * @param callback a synchronous/asynchronous test - * @return eventually returns a new array with only values that have passed - */ -export function filter(items, callback) { - return processValuesAndCallback(items, callback).then(function (result) { - let arr = []; - if (result && result.results && result.values) { - for (let i = 0; i < result.results.length; i++) { - result.results[i] && arr.push(result.values[i]); - } - } - return arr; - }); -} -/** - * Find the first value matching a filter function - * @param items a collection of synchronous/asynchronous values - * @param callback a synchronous/asynchronous test - * @return a promise eventually containing the item or undefined if a match is not found - */ -export function find(items, callback) { - const list = isArrayLike(items) ? items : array.from(items); - return findIndex(list, callback).then(function (i) { - return i !== undefined && i >= 0 ? list[i] : undefined; - }); -} -/** - * Find the first index with a value matching the filter function - * @param items a collection of synchronous/asynchronous values - * @param callback a synchronous/asynchronous test - * @return a promise eventually containing the index of the matching item or -1 if a match is not found - */ -export function findIndex(items, callback) { - // TODO we can improve this by returning immediately - return processValuesAndCallback(items, callback).then(function (result) { - if (result && result.results) { - for (let i = 0; i < result.results.length; i++) { - if (result.results[i]) { - return i; - } - } - } - return -1; - }); -} -/** - * transform a list of items using a mapper function - * @param items a collection of synchronous/asynchronous values - * @param callback a synchronous/asynchronous transform function - * @return a promise eventually containing a collection of each transformed value - */ -export function map(items, callback) { - return processValuesAndCallback(items, callback).then(function (result) { - return result ? result.results : null; - }); -} -/** - * reduce a list of items down to a single value - * @param items a collection of synchronous/asynchronous values - * @param callback a synchronous/asynchronous reducer function - * @param [initialValue] the first value to pass to the callback - * @return a promise eventually containing a value that is the result of the reduction - */ -export function reduce(items, callback, initialValue) { - const args = array.from(arguments); - args.unshift(findNextValueIndex); - return generalReduce.apply(this, args); -} -export function reduceRight(items, callback, initialValue) { - const args = array.from(arguments); - args.unshift(findLastValueIndex); - return generalReduce.apply(this, args); -} -export function series(items, operation) { - return generalReduce(findNextValueIndex, items, function (previousValue, currentValue, index, array) { - const result = operation(currentValue, index, array); - if (isThenable(result)) { - return result.then(function (value) { - previousValue.push(value); - return previousValue; - }); - } - previousValue.push(result); - return previousValue; - }, []); -} -export function some(items, callback) { - return testAndHaltOnCondition(true, items, callback); -} -//# sourceMappingURL=iteration.mjs.map \ No newline at end of file diff --git a/deps/framework/core/async/iteration.mjs.map b/deps/framework/core/async/iteration.mjs.map deleted file mode 100644 index c9e7868968..0000000000 --- a/deps/framework/core/async/iteration.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"iteration.mjs","sourceRoot":"","sources":["iteration.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,kBAAkB,CAAC;AAC1C,OAAO,EAAE,WAAW,EAAY,MAAM,qBAAqB,CAAC;AAC5D,OAAO,OAAO,MAAM,oBAAoB,CAAC;AAGzC,oBAAuB,KAAU;IAChC,MAAM,CAAC,KAAK,IAAI,OAAO,KAAK,CAAC,IAAI,KAAK,UAAU,CAAC;AAClD,CAAC;AAID;;;;;;GAMG;AACH,kCACC,KAAqD,EACrD,QAAsB;IAEtB,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,UAAS,OAAO;QAC9C,MAAM,IA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AAO,CAAC,kBAAkB,CAAC,CAAC;IACjC,MAAM,CAAC,aAAa,CAAC,KAAK,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;AACxC,CAAC;AAED,MAAM,sBAEL,KAAoD,EACpD,QAAuB,EACvB,YAAgB;IAEhB,MAAM,IAAI,GAAiB,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;IACjD,IAAI,CAAC,OAAO,CAAC,kBAAkB,CAAC,CAAC;IACjC,MAAM,CAAC,aAAa,CAAC,KAAK,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;AACxC,CAAC;AAED,MAAM,iBACL,KAAoD,EACpD,SAAuB;IAEvB,MAAM,CAAC,aAAa,CACnB,kBAAkB,EAClB,KAAK,EACL,UAAS,aAAa,EAAE,YAAe,EAAE,KAAa,EAAE,KAAU;QACjE,MAAM,MAAM,GAAG,SAAS,CAAC,YAAY,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC;QAErD,EAAE,CAAC,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;YACxB,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,UAAS,KAAK;gBAChC,aAAa,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;gBAC1B,MAAM,CAAC,aAAa,CAAC;YACtB,CAAC,CAAC,CAAC;QACJ,CAAC;QAED,aAAa,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QAC3B,MAAM,CAAC,aAAa,CAAC;IACtB,CAAC,EACD,EAAS,CACT,CAAC;AACH,CAAC;AAED,MAAM,eACL,KAAuD,EACvD,QAAqB;IAErB,MAAM,CAAC,sBAAsB,CAAC,IAAI,EAAE,KAAK,EAAE,QAAQ,CAAC,CAAC;AACtD,CAAC","sourcesContent":["import * as array from '../../shim/array';\nimport { isArrayLike, Iterable } from '../../shim/iterator';\nimport Promise from '../../shim/Promise';\nimport { Thenable } from '../../shim/interfaces';\n\nfunction isThenable(value: any): value is Thenable {\n\treturn value && typeof value.then === 'function';\n}\n\ntype ValuesAndResults = { values: T[] | undefined; results: U[] | undefined };\n\n/**\n * Processes all items and then applies the callback to each item and eventually returns an object containing the\n * processed values and callback results\n * @param items a list of synchronous/asynchronous values to process\n * @param callback a callback that maps values to synchronous/asynchronous results\n * @return a list of objects holding the synchronous values and synchronous results.\n */\nfunction processValuesAndCallback(\n\titems: Iterable> | (T | Thenable)[],\n\tcallback: Mapper\n): Promise> {\n\treturn Promise.all(items).then(function(results) {\n\t\tconst pass: (U | Promise)[] = Array.prototype.map.call(results, callback);\n\t\treturn Promise.all(pass).then(function(pass) {\n\t\t\treturn { values: results, results: pass };\n\t\t});\n\t});\n}\n\n/**\n * Finds the index of the next value in a sparse array-like object\n * @param list the sparse array-like object\n * @param offset the starting offset\n * @return the offset of the next index with a value; or -1 if not found\n */\nfunction findNextValueIndex(list: ArrayLike, offset: number = -1): number {\n\toffset++;\n\tfor (let length = list.length; offset < length; offset++) {\n\t\tif (offset in list) {\n\t\t\treturn offset;\n\t\t}\n\t}\n\treturn -1;\n}\n\nfunction findLastValueIndex(list: ArrayLike, offset?: number): number {\n\toffset = (offset === undefined ? list.length : offset) - 1;\n\tfor (; offset >= 0; offset--) {\n\t\tif (offset in list) {\n\t\t\treturn offset;\n\t\t}\n\t}\n\treturn -1;\n}\n\nfunction generalReduce(\n\tfindNextIndex: (list: ArrayLike, offset?: number) => number,\n\titems: Iterable> | (T | Promise)[],\n\tcallback: Reducer,\n\tinitialValue?: U\n): Promise {\n\tconst hasInitialValue = arguments.length > 3;\n\treturn Promise.all(items).then(function(results) {\n\t\treturn new Promise(function(resolve, reject) {\n\t\t\t// As iterators do not have indices like `ArrayLike` objects, the results array\n\t\t\t// is used to determine the next value.\n\t\t\tconst list = isArrayLike(items) ? items : results;\n\t\t\tlet i: number;\n\t\t\tfunction next(currentValue: U | undefined): void {\n\t\t\t\ti = findNextIndex(list, i);\n\t\t\t\tif (i >= 0) {\n\t\t\t\t\tif (results) {\n\t\t\t\t\t\tif (currentValue) {\n\t\t\t\t\t\t\tconst result = callback(currentValue, results[i], i, results);\n\n\t\t\t\t\t\t\tif (isThenable(result)) {\n\t\t\t\t\t\t\t\tresult.then(next, reject);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tnext(result);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tresolve(currentValue);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tlet value: U | undefined;\n\t\t\tif (hasInitialValue) {\n\t\t\t\tvalue = initialValue;\n\t\t\t} else {\n\t\t\t\ti = findNextIndex(list);\n\n\t\t\t\tif (i < 0) {\n\t\t\t\t\tthrow new Error('reduce array with no initial value');\n\t\t\t\t}\n\t\t\t\tif (results) {\n\t\t\t\t\tvalue = results[i];\n\t\t\t\t}\n\t\t\t}\n\t\t\tnext(value);\n\t\t});\n\t});\n}\n\nfunction testAndHaltOnCondition(\n\tcondition: boolean,\n\titems: Iterable> | (T | Promise)[],\n\tcallback: Filterer\n): Promise {\n\treturn Promise.all(items).then(function(results) {\n\t\treturn new Promise(function(resolve) {\n\t\t\tlet result: boolean | Thenable;\n\t\t\tlet pendingCount = 0;\n\t\t\tif (results) {\n\t\t\t\tfor (let i = 0; i < results.length; i++) {\n\t\t\t\t\tresult = callback(results[i], i, results);\n\t\t\t\t\tif (result === condition) {\n\t\t\t\t\t\treturn resolve(result);\n\t\t\t\t\t} else if (isThenable(result)) {\n\t\t\t\t\t\tpendingCount++;\n\t\t\t\t\t\tresult.then(function(result) {\n\t\t\t\t\t\t\tif (result === condition) {\n\t\t\t\t\t\t\t\tresolve(result);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tpendingCount--;\n\t\t\t\t\t\t\tif (pendingCount === 0) {\n\t\t\t\t\t\t\t\tresolve(!condition);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (pendingCount === 0) {\n\t\t\t\tresolve(!condition);\n\t\t\t}\n\t\t});\n\t});\n}\n\n/**\n * Test whether all elements in the array pass the provided callback\n * @param items a collection of synchronous/asynchronous values\n * @param callback a synchronous/asynchronous test\n * @return eventually returns true if all values pass; otherwise false\n */\nexport function every(\n\titems: Iterable> | (T | Promise)[],\n\tcallback: Filterer\n): Promise {\n\treturn testAndHaltOnCondition(false, items, callback);\n}\n\n/**\n * Returns an array of elements which pass the provided callback\n * @param items a collection of synchronous/asynchronous values\n * @param callback a synchronous/asynchronous test\n * @return eventually returns a new array with only values that have passed\n */\nexport function filter(items: Iterable> | (T | Promise)[], callback: Filterer): Promise {\n\treturn processValuesAndCallback(items, callback).then(function(result) {\n\t\tlet arr: T[] = [];\n\t\tif (result && result.results && result.values) {\n\t\t\tfor (let i = 0; i < result.results.length; i++) {\n\t\t\t\tresult.results[i] && arr.push(result.values[i]);\n\t\t\t}\n\t\t}\n\t\treturn arr;\n\t});\n}\n\n/**\n * Find the first value matching a filter function\n * @param items a collection of synchronous/asynchronous values\n * @param callback a synchronous/asynchronous test\n * @return a promise eventually containing the item or undefined if a match is not found\n */\nexport function find(\n\titems: Iterable> | (T | Promise)[],\n\tcallback: Filterer\n): Promise {\n\tconst list = isArrayLike(items) ? items : array.from(items);\n\treturn findIndex(list, callback).then(function(i) {\n\t\treturn i !== undefined && i >= 0 ? list[i] : undefined;\n\t});\n}\n\n/**\n * Find the first index with a value matching the filter function\n * @param items a collection of synchronous/asynchronous values\n * @param callback a synchronous/asynchronous test\n * @return a promise eventually containing the index of the matching item or -1 if a match is not found\n */\nexport function findIndex(\n\titems: Iterable> | (T | Thenable)[],\n\tcallback: Filterer\n): Promise {\n\t// TODO we can improve this by returning immediately\n\treturn processValuesAndCallback(items, callback).then(function(result: ValuesAndResults) {\n\t\tif (result && result.results) {\n\t\t\tfor (let i = 0; i < result.results.length; i++) {\n\t\t\t\tif (result.results[i]) {\n\t\t\t\t\treturn i;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn -1;\n\t});\n}\n\n/**\n * transform a list of items using a mapper function\n * @param items a collection of synchronous/asynchronous values\n * @param callback a synchronous/asynchronous transform function\n * @return a promise eventually containing a collection of each transformed value\n */\nexport function map(\n\titems: Iterable> | (T | Promise)[],\n\tcallback: Mapper\n): Promise {\n\treturn processValuesAndCallback(items, callback).then(function(result) {\n\t\treturn result ? result.results : null;\n\t});\n}\n\n/**\n * reduce a list of items down to a single value\n * @param items a collection of synchronous/asynchronous values\n * @param callback a synchronous/asynchronous reducer function\n * @param [initialValue] the first value to pass to the callback\n * @return a promise eventually containing a value that is the result of the reduction\n */\nexport function reduce(\n\tthis: any,\n\titems: Iterable> | (T | Promise)[],\n\tcallback: Reducer,\n\tinitialValue?: U\n): Promise {\n\tconst args: any[] = array.from(arguments);\n\targs.unshift(findNextValueIndex);\n\treturn generalReduce.apply(this, args);\n}\n\nexport function reduceRight(\n\tthis: any,\n\titems: Iterable> | (T | Promise)[],\n\tcallback: Reducer,\n\tinitialValue?: U\n): Promise {\n\tconst args: any[] = array.from(arguments);\n\targs.unshift(findLastValueIndex);\n\treturn generalReduce.apply(this, args);\n}\n\nexport function series(\n\titems: Iterable> | (T | Promise)[],\n\toperation: Mapper\n): Promise {\n\treturn generalReduce(\n\t\tfindNextValueIndex,\n\t\titems,\n\t\tfunction(previousValue, currentValue: T, index: number, array: T[]) {\n\t\t\tconst result = operation(currentValue, index, array);\n\n\t\t\tif (isThenable(result)) {\n\t\t\t\treturn result.then(function(value) {\n\t\t\t\t\tpreviousValue.push(value);\n\t\t\t\t\treturn previousValue;\n\t\t\t\t});\n\t\t\t}\n\n\t\t\tpreviousValue.push(result);\n\t\t\treturn previousValue;\n\t\t},\n\t\t[] as U[]\n\t);\n}\n\nexport function some(\n\titems: Iterable> | Array>,\n\tcallback: Filterer\n): Promise {\n\treturn testAndHaltOnCondition(true, items, callback);\n}\n\nexport interface Filterer extends Mapper {}\n\nexport interface Mapper {\n\t(value: T, index: number, array: T[]): U | Thenable;\n}\n\nexport interface Reducer {\n\t(previousValue: U, currentValue: T, index: number, array: T[]): U | Thenable;\n}\n"]} \ No newline at end of file diff --git a/deps/framework/core/async/timing.d.ts b/deps/framework/core/async/timing.d.ts deleted file mode 100644 index a92535cc5d..0000000000 --- a/deps/framework/core/async/timing.d.ts +++ /dev/null @@ -1,32 +0,0 @@ -import Promise from './ExtensiblePromise'; -import { Thenable } from '../../shim/interfaces'; -export declare type IdentityValue = T | (() => T | Thenable); -export interface Identity { - (value?: IdentityValue): Promise; -} -/** - * Used for delaying a Promise chain for a specific number of milliseconds. - * - * @param milliseconds the number of milliseconds to delay - * @return {function (value: T | (() => T | Thenable)): Promise} a function producing a promise that eventually returns the value or executes the value function passed to it; usable with Thenable.then() - */ -export declare function delay(milliseconds: number): Identity; -/** - * Reject a promise chain if a result hasn't been found before the timeout - * - * @param milliseconds after this number of milliseconds a rejection will be returned - * @param reason The reason for the rejection - * @return {function(T): Promise} a function that produces a promise that is rejected or resolved based on your timeout - */ -export declare function timeout(milliseconds: number, reason: Error): Identity; -/** - * A Promise that will reject itself automatically after a time. - * Useful for combining with other promises in Promise.race. - */ -export declare class DelayedRejection extends Promise { - /** - * @param milliseconds the number of milliseconds to wait before triggering a rejection - * @param reason the reason for the rejection - */ - constructor(milliseconds: number, reason?: Error); -} diff --git a/deps/framework/core/async/timing.js b/deps/framework/core/async/timing.js deleted file mode 100644 index 3edf31f091..0000000000 --- a/deps/framework/core/async/timing.js +++ /dev/null @@ -1,72 +0,0 @@ -(function (factory) { - if (typeof module === "object" && typeof module.exports === "object") { - var v = factory(require, exports); - if (v !== undefined) module.exports = v; - } - else if (typeof define === "function" && define.amd) { - define(["require", "exports", "tslib", "./ExtensiblePromise"], factory); - } -})(function (require, exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - var tslib_1 = require("tslib"); - var ExtensiblePromise_1 = require("./ExtensiblePromise"); - /** - * Used for delaying a Promise chain for a specific number of milliseconds. - * - * @param milliseconds the number of milliseconds to delay - * @return {function (value: T | (() => T | Thenable)): Promise} a function producing a promise that eventually returns the value or executes the value function passed to it; usable with Thenable.then() - */ - function delay(milliseconds) { - return function (value) { - return new ExtensiblePromise_1.default(function (resolve) { - setTimeout(function () { - resolve(typeof value === 'function' ? value() : value); - }, milliseconds); - }); - }; - } - exports.delay = delay; - /** - * Reject a promise chain if a result hasn't been found before the timeout - * - * @param milliseconds after this number of milliseconds a rejection will be returned - * @param reason The reason for the rejection - * @return {function(T): Promise} a function that produces a promise that is rejected or resolved based on your timeout - */ - function timeout(milliseconds, reason) { - var start = Date.now(); - return function (value) { - if (Date.now() - milliseconds > start) { - return ExtensiblePromise_1.default.reject(reason); - } - if (typeof value === 'function') { - return ExtensiblePromise_1.default.resolve(value()); - } - return ExtensiblePromise_1.default.resolve(value); - }; - } - exports.timeout = timeout; - /** - * A Promise that will reject itself automatically after a time. - * Useful for combining with other promises in Promise.race. - */ - var DelayedRejection = /** @class */ (function (_super) { - tslib_1.__extends(DelayedRejection, _super); - /** - * @param milliseconds the number of milliseconds to wait before triggering a rejection - * @param reason the reason for the rejection - */ - function DelayedRejection(milliseconds, reason) { - var _this = _super.call(this, function () { }) || this; - return new ExtensiblePromise_1.default(function (resolve, reject) { - setTimeout(function () { - reject(reason); - }, milliseconds); - }); - } - return DelayedRejection; - }(ExtensiblePromise_1.default)); - exports.DelayedRejection = DelayedRejection; -}); -//# sourceMappingURL=timing.js.map \ No newline at end of file diff --git a/deps/framework/core/async/timing.js.map b/deps/framework/core/async/timing.js.map deleted file mode 100644 index d558048621..0000000000 --- a/deps/framework/core/async/timing.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"timing.js","sourceRoot":"","sources":["timing.ts"],"names":[],"mappings":";;;;;;;;;;;;IAAA,yDAA0C;IAQ1C;;;;;OAKG;IACH,eAAyB,YAAoB;QAC5C,MAAM,CAAC,UAAS,KAAwB;YACvC,MAAM,CAAC,IAAI,2BAAO,CAAC,UAAS,OAAO;gBAClC,UAAU,CAAC;oBACV,OAAO,CAAC,OAAO,KAAK,KAAK,UAAU,CAAC,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;gBACxD,CAAC,EAAE,YAAY,CAAC,CAAC;YAClB,CAAC,CAAC,CAAC;QACJ,CAAC,CAAC;IACH,CAAC;IARD,sBAQC;IAED;;;;;;OAMG;IACH,iBAA2B,YAAoB,EAAE,MAAa;QAC7D,IAAM,KAAK,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;QACzB,MAAM,CAAC,UAAS,KAAwB;YACvC,EAAE,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,YAAY,GAAG,KAAK,CAAC,CAAC,CAAC;gBACvC,MAAM,CAAC,2BAAO,CAAC,MAAM,CAAI,MAAM,CAAC,CAAC;YAClC,CAAC;YACD,EAAE,CAAC,CAAC,OAAO,KAAK,KAAK,UAAU,CAAC,CAAC,CAAC;gBACjC,MAAM,CAAC,2BAAO,CAAC,OAAO,CAAC,KAAK,EAAE,CAAC,CAAC;YACjC,CAAC;YACD,MAAM,CAAC,2BAAO,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;QAC/B,CAAC,CAAC;IACH,CAAC;IAXD,0BAWC;IAED;;;OAGG;IACH;QAAsC,4CAAY;QACjD;;;WAGG;QACH,0BAAY,YAAoB,EAAE,MAAc;YAAhD,YACC,kBAAM,cAAO,CAAC,CAAC,SAOf;YALA,MAAM,CAAC,IAAI,2BAAO,CAAC,UAAS,OAAO,EAAE,MAAM;gBAC1C,UAAU,CAAC;oBACV,MAAM,CAAC,MAAM,CAAC,CAAC;gBAChB,CAAC,EAAE,YAAY,CAAC,CAAC;YAClB,CAAC,CAAC,CAAC;QACJ,CAAC;QACF,uBAAC;IAAD,CAAC,AAdD,CAAsC,2BAAO,GAc5C;IAdY,4CAAgB","sourcesContent":["import Promise from './ExtensiblePromise';\nimport { Thenable } from '../../shim/interfaces';\n\nexport type IdentityValue = T | (() => T | Thenable);\nexport interface Identity {\n\t(value?: IdentityValue): Promise;\n}\n\n/**\n * Used for delaying a Promise chain for a specific number of milliseconds.\n *\n * @param milliseconds the number of milliseconds to delay\n * @return {function (value: T | (() => T | Thenable)): Promise} a function producing a promise that eventually returns the value or executes the value function passed to it; usable with Thenable.then()\n */\nexport function delay(milliseconds: number): Identity {\n\treturn function(value?: IdentityValue): Promise {\n\t\treturn new Promise(function(resolve) {\n\t\t\tsetTimeout(function() {\n\t\t\t\tresolve(typeof value === 'function' ? value() : value);\n\t\t\t}, milliseconds);\n\t\t});\n\t};\n}\n\n/**\n * Reject a promise chain if a result hasn't been found before the timeout\n *\n * @param milliseconds after this number of milliseconds a rejection will be returned\n * @param reason The reason for the rejection\n * @return {function(T): Promise} a function that produces a promise that is rejected or resolved based on your timeout\n */\nexport function timeout(milliseconds: number, reason: Error): Identity {\n\tconst start = Date.now();\n\treturn function(value?: IdentityValue): Promise {\n\t\tif (Date.now() - milliseconds > start) {\n\t\t\treturn Promise.reject(reason);\n\t\t}\n\t\tif (typeof value === 'function') {\n\t\t\treturn Promise.resolve(value());\n\t\t}\n\t\treturn Promise.resolve(value);\n\t};\n}\n\n/**\n * A Promise that will reject itself automatically after a time.\n * Useful for combining with other promises in Promise.race.\n */\nexport class DelayedRejection extends Promise {\n\t/**\n\t * @param milliseconds the number of milliseconds to wait before triggering a rejection\n\t * @param reason the reason for the rejection\n\t */\n\tconstructor(milliseconds: number, reason?: Error) {\n\t\tsuper(() => {});\n\n\t\treturn new Promise(function(resolve, reject) {\n\t\t\tsetTimeout(() => {\n\t\t\t\treject(reason);\n\t\t\t}, milliseconds);\n\t\t});\n\t}\n}\n"]} \ No newline at end of file diff --git a/deps/framework/core/async/timing.mjs b/deps/framework/core/async/timing.mjs deleted file mode 100644 index 3ee71a3cc7..0000000000 --- a/deps/framework/core/async/timing.mjs +++ /dev/null @@ -1,54 +0,0 @@ -import Promise from './ExtensiblePromise'; -/** - * Used for delaying a Promise chain for a specific number of milliseconds. - * - * @param milliseconds the number of milliseconds to delay - * @return {function (value: T | (() => T | Thenable)): Promise} a function producing a promise that eventually returns the value or executes the value function passed to it; usable with Thenable.then() - */ -export function delay(milliseconds) { - return function (value) { - return new Promise(function (resolve) { - setTimeout(function () { - resolve(typeof value === 'function' ? value() : value); - }, milliseconds); - }); - }; -} -/** - * Reject a promise chain if a result hasn't been found before the timeout - * - * @param milliseconds after this number of milliseconds a rejection will be returned - * @param reason The reason for the rejection - * @return {function(T): Promise} a function that produces a promise that is rejected or resolved based on your timeout - */ -export function timeout(milliseconds, reason) { - const start = Date.now(); - return function (value) { - if (Date.now() - milliseconds > start) { - return Promise.reject(reason); - } - if (typeof value === 'function') { - return Promise.resolve(value()); - } - return Promise.resolve(value); - }; -} -/** - * A Promise that will reject itself automatically after a time. - * Useful for combining with other promises in Promise.race. - */ -export class DelayedRejection extends Promise { - /** - * @param milliseconds the number of milliseconds to wait before triggering a rejection - * @param reason the reason for the rejection - */ - constructor(milliseconds, reason) { - super(() => { }); - return new Promise(function (resolve, reject) { - setTimeout(() => { - reject(reason); - }, milliseconds); - }); - } -} -//# sourceMappingURL=timing.mjs.map \ No newline at end of file diff --git a/deps/framework/core/async/timing.mjs.map b/deps/framework/core/async/timing.mjs.map deleted file mode 100644 index 6ab393d728..0000000000 --- a/deps/framework/core/async/timing.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"timing.mjs","sourceRoot":"","sources":["timing.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,qBAAqB,CAAC;AAQ1C;;;;;GAKG;AACH,MAAM,gBAAmB,YAAoB;IAC5C,MAAM,CAAC,UAAS,KAAwB;QACvC,MAAM,CAAC,IAAI,OAAO,CAAC,UAAS,OAAO;YAClC,UAAU,CAAC;gBACV,OAAO,CAAC,OAAO,KAAK,KAAK,UAAU,CAAC,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;YACxD,CAAC,EAAE,YAAY,CAAC,CAAC;QAClB,CAAC,CAAC,CAAC;IACJ,CAAC,CAAC;AACH,CAAC;AAED;;;;;;GAMG;AACH,MAAM,kBAAqB,YAAoB,EAAE,MAAa;IAC7D,MAAM,KAAK,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;IACzB,MAAM,CAAC,UAAS,KAAwB;QACvC,EAAE,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,YAAY,GAAG,KAAK,CAAC,CAAC,CAAC;YACvC,MAAM,CAAC,OAAO,CAAC,MAAM,CAAI,MAAM,CAAC,CAAC;QAClC,CAAC;QACD,EAAE,CAAC,CAAC,OAAO,KAAK,KAAK,UAAU,CAAC,CAAC,CAAC;YACjC,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,KAAK,EAAE,CAAC,CAAC;QACjC,CAAC;QACD,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;IAC/B,CAAC,CAAC;AACH,CAAC;AAED;;;GAGG;AACH,MAAM,uBAAwB,SAAQ,OAAY;IACjD;;;OAGG;IACH,YAAY,YAAoB,EAAE,MAAc;QAC/C,KAAK,CAAC,GAAG,EAAE,GAAE,CAAC,CAAC,CAAC;QAEhB,MAAM,CAAC,IAAI,OAAO,CAAC,UAAS,OAAO,EAAE,MAAM;YAC1C,UAAU,CAAC,GAAG,EAAE;gBACf,MAAM,CAAC,MAAM,CAAC,CAAC;YAChB,CAAC,EAAE,YAAY,CAAC,CAAC;QAClB,CAAC,CAAC,CAAC;IACJ,CAAC;CACD","sourcesContent":["import Promise from './ExtensiblePromise';\nimport { Thenable } from '../../shim/interfaces';\n\nexport type IdentityValue = T | (() => T | Thenable);\nexport interface Identity {\n\t(value?: IdentityValue): Promise;\n}\n\n/**\n * Used for delaying a Promise chain for a specific number of milliseconds.\n *\n * @param milliseconds the number of milliseconds to delay\n * @return {function (value: T | (() => T | Thenable)): Promise} a function producing a promise that eventually returns the value or executes the value function passed to it; usable with Thenable.then()\n */\nexport function delay(milliseconds: number): Identity {\n\treturn function(value?: IdentityValue): Promise {\n\t\treturn new Promise(function(resolve) {\n\t\t\tsetTimeout(function() {\n\t\t\t\tresolve(typeof value === 'function' ? value() : value);\n\t\t\t}, milliseconds);\n\t\t});\n\t};\n}\n\n/**\n * Reject a promise chain if a result hasn't been found before the timeout\n *\n * @param milliseconds after this number of milliseconds a rejection will be returned\n * @param reason The reason for the rejection\n * @return {function(T): Promise} a function that produces a promise that is rejected or resolved based on your timeout\n */\nexport function timeout(milliseconds: number, reason: Error): Identity {\n\tconst start = Date.now();\n\treturn function(value?: IdentityValue): Promise {\n\t\tif (Date.now() - milliseconds > start) {\n\t\t\treturn Promise.reject(reason);\n\t\t}\n\t\tif (typeof value === 'function') {\n\t\t\treturn Promise.resolve(value());\n\t\t}\n\t\treturn Promise.resolve(value);\n\t};\n}\n\n/**\n * A Promise that will reject itself automatically after a time.\n * Useful for combining with other promises in Promise.race.\n */\nexport class DelayedRejection extends Promise {\n\t/**\n\t * @param milliseconds the number of milliseconds to wait before triggering a rejection\n\t * @param reason the reason for the rejection\n\t */\n\tconstructor(milliseconds: number, reason?: Error) {\n\t\tsuper(() => {});\n\n\t\treturn new Promise(function(resolve, reject) {\n\t\t\tsetTimeout(() => {\n\t\t\t\treject(reason);\n\t\t\t}, milliseconds);\n\t\t});\n\t}\n}\n"]} \ No newline at end of file diff --git a/deps/framework/core/base64.d.ts b/deps/framework/core/base64.d.ts deleted file mode 100644 index 15cc81de3b..0000000000 --- a/deps/framework/core/base64.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -/** - * Take a string encoded in base64 and decode it - * @param encodedString The base64 encoded string - */ -export declare const decode: (encodedString: string) => string; -/** - * Take a string and encode it to base64 - * @param rawString The string to encode - */ -export declare const encode: (rawString: string) => string; diff --git a/deps/framework/core/base64.js b/deps/framework/core/base64.js deleted file mode 100644 index cff7d220eb..0000000000 --- a/deps/framework/core/base64.js +++ /dev/null @@ -1,45 +0,0 @@ -(function (factory) { - if (typeof module === "object" && typeof module.exports === "object") { - var v = factory(require, exports); - if (v !== undefined) module.exports = v; - } - else if (typeof define === "function" && define.amd) { - define(["require", "exports", "../shim/global", "../has/has"], factory); - } -})(function (require, exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - var global_1 = require("../shim/global"); - var has_1 = require("../has/has"); - has_1.add('btoa', 'btoa' in global_1.default, true); - has_1.add('atob', 'atob' in global_1.default, true); - /** - * Take a string encoded in base64 and decode it - * @param encodedString The base64 encoded string - */ - exports.decode = has_1.default('atob') - ? function (encodedString) { - /* this allows for utf8 characters to be decoded properly */ - return decodeURIComponent(Array.prototype.map - .call(atob(encodedString), function (char) { return '%' + ('00' + char.charCodeAt(0).toString(16)).slice(-2); }) - .join('')); - } - : function (encodedString) { - return new Buffer(encodedString.toString(), 'base64').toString('utf8'); - }; - /** - * Take a string and encode it to base64 - * @param rawString The string to encode - */ - exports.encode = has_1.default('btoa') - ? function (decodedString) { - /* this allows for utf8 characters to be encoded properly */ - return btoa(encodeURIComponent(decodedString).replace(/%([0-9A-F]{2})/g, function (match, code) { - return String.fromCharCode(Number('0x' + code)); - })); - } - : function (rawString) { - return new Buffer(rawString.toString(), 'utf8').toString('base64'); - }; -}); -//# sourceMappingURL=base64.js.map \ No newline at end of file diff --git a/deps/framework/core/base64.js.map b/deps/framework/core/base64.js.map deleted file mode 100644 index 4f37c791a9..0000000000 --- a/deps/framework/core/base64.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"base64.js","sourceRoot":"","sources":["base64.ts"],"names":[],"mappings":";;;;;;;;;;;IAAA,yCAAoC;IACpC,kCAAgD;IAEhD,SAAM,CAAC,MAAM,EAAE,MAAM,IAAI,gBAAM,EAAE,IAAI,CAAC,CAAC;IACvC,SAAM,CAAC,MAAM,EAAE,MAAM,IAAI,gBAAM,EAAE,IAAI,CAAC,CAAC;IAEvC;;;OAGG;IACU,QAAA,MAAM,GAAsC,aAAG,CAAC,MAAM,CAAC;QACnE,CAAC,CAAC,UAAS,aAAqB;YAC9B,4DAA4D;YAC5D,MAAM,CAAC,kBAAkB,CACxB,KAAK,CAAC,SAAS,CAAC,GAAG;iBACjB,IAAI,CACJ,IAAI,CAAC,aAAa,CAAC,EACnB,UAAC,IAAY,IAAK,OAAA,GAAG,GAAG,CAAC,IAAI,GAAG,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAAxD,CAAwD,CAC1E;iBACA,IAAI,CAAC,EAAE,CAAC,CACV,CAAC;QACH,CAAC;QACF,CAAC,CAAC,UAAS,aAAqB;YAC9B,MAAM,CAAC,IAAI,MAAM,CAAC,aAAa,CAAC,QAAQ,EAAE,EAAE,QAAQ,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;QACxE,CAAC,CAAC;IAEJ;;;OAGG;IACU,QAAA,MAAM,GAAkC,aAAG,CAAC,MAAM,CAAC;QAC/D,CAAC,CAAC,UAAS,aAAqB;YAC9B,4DAA4D;YAC5D,MAAM,CAAC,IAAI,CACV,kBAAkB,CAAC,aAAa,CAAC,CAAC,OAAO,CAAC,iBAAiB,EAAE,UAAC,KAAK,EAAE,IAAY;gBAChF,OAAA,MAAM,CAAC,YAAY,CAAC,MAAM,CAAC,IAAI,GAAG,IAAI,CAAC,CAAC;YAAxC,CAAwC,CACxC,CACD,CAAC;QACH,CAAC;QACF,CAAC,CAAC,UAAS,SAAiB;YAC1B,MAAM,CAAC,IAAI,MAAM,CAAC,SAAS,CAAC,QAAQ,EAAE,EAAE,MAAM,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;QACpE,CAAC,CAAC","sourcesContent":["import global from '../shim/global';\nimport has, { add as hasAdd } from '../has/has';\n\nhasAdd('btoa', 'btoa' in global, true);\nhasAdd('atob', 'atob' in global, true);\n\n/**\n * Take a string encoded in base64 and decode it\n * @param encodedString The base64 encoded string\n */\nexport const decode: (encodedString: string) => string = has('atob')\n\t? function(encodedString: string) {\n\t\t\t/* this allows for utf8 characters to be decoded properly */\n\t\t\treturn decodeURIComponent(\n\t\t\t\tArray.prototype.map\n\t\t\t\t\t.call(\n\t\t\t\t\t\tatob(encodedString),\n\t\t\t\t\t\t(char: string) => '%' + ('00' + char.charCodeAt(0).toString(16)).slice(-2)\n\t\t\t\t\t)\n\t\t\t\t\t.join('')\n\t\t\t);\n\t\t}\n\t: function(encodedString: string): string {\n\t\t\treturn new Buffer(encodedString.toString(), 'base64').toString('utf8');\n\t\t};\n\n/**\n * Take a string and encode it to base64\n * @param rawString The string to encode\n */\nexport const encode: (rawString: string) => string = has('btoa')\n\t? function(decodedString: string) {\n\t\t\t/* this allows for utf8 characters to be encoded properly */\n\t\t\treturn btoa(\n\t\t\t\tencodeURIComponent(decodedString).replace(/%([0-9A-F]{2})/g, (match, code: string) =>\n\t\t\t\t\tString.fromCharCode(Number('0x' + code))\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\t: function(rawString: string): string {\n\t\t\treturn new Buffer(rawString.toString(), 'utf8').toString('base64');\n\t\t};\n"]} \ No newline at end of file diff --git a/deps/framework/core/base64.mjs b/deps/framework/core/base64.mjs deleted file mode 100644 index bdd68cb1b4..0000000000 --- a/deps/framework/core/base64.mjs +++ /dev/null @@ -1,31 +0,0 @@ -import global from '../shim/global'; -import has, { add as hasAdd } from '../has/has'; -hasAdd('btoa', 'btoa' in global, true); -hasAdd('atob', 'atob' in global, true); -/** - * Take a string encoded in base64 and decode it - * @param encodedString The base64 encoded string - */ -export const decode = has('atob') - ? function (encodedString) { - /* this allows for utf8 characters to be decoded properly */ - return decodeURIComponent(Array.prototype.map - .call(atob(encodedString), (char) => '%' + ('00' + char.charCodeAt(0).toString(16)).slice(-2)) - .join('')); - } - : function (encodedString) { - return new Buffer(encodedString.toString(), 'base64').toString('utf8'); - }; -/** - * Take a string and encode it to base64 - * @param rawString The string to encode - */ -export const encode = has('btoa') - ? function (decodedString) { - /* this allows for utf8 characters to be encoded properly */ - return btoa(encodeURIComponent(decodedString).replace(/%([0-9A-F]{2})/g, (match, code) => String.fromCharCode(Number('0x' + code)))); - } - : function (rawString) { - return new Buffer(rawString.toString(), 'utf8').toString('base64'); - }; -//# sourceMappingURL=base64.mjs.map \ No newline at end of file diff --git a/deps/framework/core/base64.mjs.map b/deps/framework/core/base64.mjs.map deleted file mode 100644 index d322e74701..0000000000 --- a/deps/framework/core/base64.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"base64.mjs","sourceRoot":"","sources":["base64.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,gBAAgB,CAAC;AACpC,OAAO,GAAG,EAAE,EAAE,GAAG,IAAI,MAAM,EAAE,MAAM,YAAY,CAAC;AAEhD,MAAM,CAAC,MAAM,EAAE,MAAM,IAAI,MAAM,EAAE,IAAI,CAAC,CAAC;AACvC,MAAM,CAAC,MAAM,EAAE,MAAM,IAAI,MAAM,EAAE,IAAI,CAAC,CAAC;AAEvC;;;GAGG;AACH,MAAM,CAAC,MAAM,MAAM,GAAsC,GAAG,CAAC,MAAM,CAAC;IACnE,CAAC,CAAC,UAAS,aAAqB;QAC9B,4DAA4D;QAC5D,MAAM,CAAC,kBAAkB,CACxB,KAAK,CAAC,SAAS,CAAC,GAAG;aACjB,IAAI,CACJ,IAAI,CAAC,aAAa,CAAC,EACnB,CAAC,IAAY,EAAE,EAAE,CAAC,GAAG,GAAG,CAAC,IAAI,GAAG,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAC1E;aACA,IAAI,CAAC,EAAE,CAAC,CACV,CAAC;IACH,CAAC;IACF,CAAC,CAAC,UAAS,aAAqB;QAC9B,MAAM,CAAC,IAAI,MAAM,CAAC,aAAa,CAAC,QAAQ,EAAE,EAAE,QAAQ,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;IACxE,CAAC,CAAC;AAEJ;;;GAGG;AACH,MAAM,CAAC,MAAM,MAAM,GAAkC,GAAG,CAAC,MAAM,CAAC;IAC/D,CAAC,CAAC,UAAS,aAAqB;QAC9B,4DAA4D;QAC5D,MAAM,CAAC,IAAI,CACV,kBAAkB,CAAC,aAAa,CAAC,CAAC,OAAO,CAAC,iBAAiB,EAAE,CAAC,KAAK,EAAE,IAAY,EAAE,EAAE,CACpF,MAAM,CAAC,YAAY,CAAC,MAAM,CAAC,IAAI,GAAG,IAAI,CAAC,CAAC,CACxC,CACD,CAAC;IACH,CAAC;IACF,CAAC,CAAC,UAAS,SAAiB;QAC1B,MAAM,CAAC,IAAI,MAAM,CAAC,SAAS,CAAC,QAAQ,EAAE,EAAE,MAAM,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;IACpE,CAAC,CAAC","sourcesContent":["import global from '../shim/global';\nimport has, { add as hasAdd } from '../has/has';\n\nhasAdd('btoa', 'btoa' in global, true);\nhasAdd('atob', 'atob' in global, true);\n\n/**\n * Take a string encoded in base64 and decode it\n * @param encodedString The base64 encoded string\n */\nexport const decode: (encodedString: string) => string = has('atob')\n\t? function(encodedString: string) {\n\t\t\t/* this allows for utf8 characters to be decoded properly */\n\t\t\treturn decodeURIComponent(\n\t\t\t\tArray.prototype.map\n\t\t\t\t\t.call(\n\t\t\t\t\t\tatob(encodedString),\n\t\t\t\t\t\t(char: string) => '%' + ('00' + char.charCodeAt(0).toString(16)).slice(-2)\n\t\t\t\t\t)\n\t\t\t\t\t.join('')\n\t\t\t);\n\t\t}\n\t: function(encodedString: string): string {\n\t\t\treturn new Buffer(encodedString.toString(), 'base64').toString('utf8');\n\t\t};\n\n/**\n * Take a string and encode it to base64\n * @param rawString The string to encode\n */\nexport const encode: (rawString: string) => string = has('btoa')\n\t? function(decodedString: string) {\n\t\t\t/* this allows for utf8 characters to be encoded properly */\n\t\t\treturn btoa(\n\t\t\t\tencodeURIComponent(decodedString).replace(/%([0-9A-F]{2})/g, (match, code: string) =>\n\t\t\t\t\tString.fromCharCode(Number('0x' + code))\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\t: function(rawString: string): string {\n\t\t\treturn new Buffer(rawString.toString(), 'utf8').toString('base64');\n\t\t};\n"]} \ No newline at end of file diff --git a/deps/framework/core/compare.d.ts b/deps/framework/core/compare.d.ts deleted file mode 100644 index 7fd1fdc856..0000000000 --- a/deps/framework/core/compare.d.ts +++ /dev/null @@ -1,191 +0,0 @@ -import Set from '../shim/Set'; -export declare type IgnorePropertyFunction = (name: string, a: any, b: any) => boolean; -export interface DiffOptions { - /** - * Allow functions to be values. Values will be considered equal if the `typeof` both values are `function`. - * When adding or updating the property, the value of the property of `a` will be used in the record, which - * will be a reference to the function. - */ - allowFunctionValues?: boolean; - /** - * An array of strings or regular expressions which flag certain properties to be ignored. Alternatively - * a function, which returns `true` to have the property ignored or `false` to diff the property. - */ - ignoreProperties?: (string | RegExp)[] | IgnorePropertyFunction; - /** - * An array of strings or regular expressions which flag certain values to be ignored. For flagged properties, - * if the property is present in both `a` and `b` the value will be ignored. If adding the property, - * whatever the value of the property of `a` will be used, which could be a reference. - */ - ignorePropertyValues?: (string | RegExp)[] | IgnorePropertyFunction; -} -/** - * Interface for a generic constructor function - */ -export interface Constructor { - new (...args: any[]): object; - prototype: object; -} -/** - * A partial property descriptor that provides the property descriptor flags supported by the - * complex property construction of `patch()` - * - * All properties are value properties, with the value being supplied by the `ConstructRecord` - */ -export interface ConstructDescriptor { - /** - * Is the property configurable? - */ - configurable?: boolean; - /** - * Is the property enumerable? - */ - enumerable?: boolean; - /** - * Is the property configurable? - */ - writable?: boolean; -} -/** - * A record that describes a constructor function and arguments necessary to create an instance of - * an object - */ -export interface AnonymousConstructRecord { - /** - * Any arguments to pass to the constructor function - */ - args?: any[]; - /** - * The constructor function to use to create the instance - */ - Ctor: Constructor; - /** - * The partial descriptor that is used to set the value of the instance - */ - descriptor?: ConstructDescriptor; - /** - * Any patches to properties that need to occur on the instance - */ - propertyRecords?: (ConstructRecord | PatchRecord)[]; -} -export interface ConstructRecord extends AnonymousConstructRecord { - /** - * The name of the property on the Object - */ - name: string; -} -/** - * A record that describes the mutations necessary to a property of an object to make that property look - * like another - */ -export declare type PatchRecord = { - /** - * The name of the property on the Object - */ - name: string; - /** - * The type of the patch - */ - type: 'delete'; -} | { - /** - * A property descriptor that describes the property in `name` - */ - descriptor: PropertyDescriptor; - /** - * The name of the property on the Object - */ - name: string; - /** - * The type of the patch - */ - type: 'add' | 'update'; - /** - * Additional patch records which describe the value of the property - */ - valueRecords?: (ConstructRecord | PatchRecord | SpliceRecord)[]; -}; -/** - * The different types of patch records supported - */ -export declare type PatchTypes = 'add' | 'update' | 'delete'; -/** - * A record that describes a splice operation to perform on an array to make the array look like another array - */ -export interface SpliceRecord { - /** - * Any items that are being added to the array - */ - add?: any[]; - /** - * The number of items in the array to delete - */ - deleteCount: number; - /** - * The type, set to `splice` - */ - type: 'splice'; - /** - * The index of where to start the splice - */ - start: number; -} -/** - * A record that describes how to instantiate a new object via a constructor function - * @param Ctor The constructor function - * @param args Any arguments to be passed to the constructor function - */ -export declare function createConstructRecord(Ctor: Constructor, args?: any[], descriptor?: ConstructDescriptor): AnonymousConstructRecord; -/** - * A function that returns a constructor record or `undefined` when diffing a value - */ -export declare type CustomDiffFunction = (value: T, nameOrIndex: string | number, parent: object) => AnonymousConstructRecord | void; -/** - * A class which is used when making a custom comparison of a non-plain object or array - */ -export declare class CustomDiff { - private _differ; - constructor(diff: CustomDiffFunction); - /** - * Get the difference of the `value` - * @param value The value to diff - * @param nameOrIndex A `string` if comparing a property or a `number` if comparing an array element - * @param parent The outer parent that this value is part of - */ - diff(value: T, nameOrIndex: string | number, parent: object): ConstructRecord | void; -} -/** - * Takes two plain objects to be compared, as well as options customizing the behavior of the comparison, and returns - * two new objects that contain only those properties that should be compared. If a property is ignored - * it will not be included in either returned object. If a property's value should be ignored it will be excluded - * if it is present in both objects. - * @param a The first object to compare - * @param b The second object to compare - * @param options An options bag indicating which properties should be ignored or have their values ignored, if any. - */ -export declare function getComparableObjects(a: any, b: any, options: DiffOptions): { - comparableA: { - [key: string]: any; - }; - comparableB: { - [key: string]: any; - }; - ignore: Set; -}; -/** - * Compares two plain objects or arrays and return a set of records which describe the differences between the two - * - * The records describe what would need to be applied to the second argument to make it look like the first argument - * - * @param a The plain object or array to compare with - * @param b The plain object or array to compare to - * @param options An options bag that allows configuration of the behaviour of `diff()` - */ -export declare function diff(a: any, b: any, options?: DiffOptions): (ConstructRecord | PatchRecord | SpliceRecord)[]; -/** - * Apply a set of patch records to a target. - * - * @param target The plain object or array that the patch records should be applied to - * @param records A set of patch records to be applied to the target - */ -export declare function patch(target: any, records: (ConstructRecord | PatchRecord | SpliceRecord)[]): any; diff --git a/deps/framework/core/compare.js b/deps/framework/core/compare.js deleted file mode 100644 index a3b6ac2a50..0000000000 --- a/deps/framework/core/compare.js +++ /dev/null @@ -1,504 +0,0 @@ -(function (factory) { - if (typeof module === "object" && typeof module.exports === "object") { - var v = factory(require, exports); - if (v !== undefined) module.exports = v; - } - else if (typeof define === "function" && define.amd) { - define(["require", "exports", "tslib", "../shim/object", "../shim/object", "../shim/Set"], factory); - } -})(function (require, exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - var tslib_1 = require("tslib"); - var object_1 = require("../shim/object"); - var object_2 = require("../shim/object"); - var Set_1 = require("../shim/Set"); - /* Assigning to local variables to improve minification and readability */ - var objectCreate = Object.create; - var hasOwnProperty = Object.prototype.hasOwnProperty; - var defineProperty = Object.defineProperty; - var isArray = Array.isArray; - var isFrozen = Object.isFrozen; - var isSealed = Object.isSealed; - /** - * A record that describes how to instantiate a new object via a constructor function - * @param Ctor The constructor function - * @param args Any arguments to be passed to the constructor function - */ - /* tslint:disable:variable-name */ - function createConstructRecord(Ctor, args, descriptor) { - var record = object_1.assign(objectCreate(null), { Ctor: Ctor }); - if (args) { - record.args = args; - } - if (descriptor) { - record.descriptor = descriptor; - } - return record; - } - exports.createConstructRecord = createConstructRecord; - /* tslint:enable:variable-name */ - /** - * An internal function that returns a new patch record - * - * @param type The type of patch record - * @param name The property name the record refers to - * @param descriptor The property descriptor to be installed on the object - * @param valueRecords Any subsequenet patch recrds to be applied to the value of the descriptor - */ - function createPatchRecord(type, name, descriptor, valueRecords) { - var patchRecord = object_1.assign(objectCreate(null), { - type: type, - name: name - }); - if (descriptor) { - patchRecord.descriptor = descriptor; - } - if (valueRecords) { - patchRecord.valueRecords = valueRecords; - } - return patchRecord; - } - /** - * An internal function that returns a new splice record - * - * @param start Where in the array to start the splice - * @param deleteCount The number of elements to delete from the array - * @param add Elements to be added to the target - */ - function createSpliceRecord(start, deleteCount, add) { - var spliceRecord = object_1.assign(objectCreate(null), { - type: 'splice', - start: start, - deleteCount: deleteCount - }); - if (add && add.length) { - spliceRecord.add = add; - } - return spliceRecord; - } - /** - * A function that produces a value property descriptor, which assumes that properties are enumerable, writable and configurable - * unless specified - * - * @param value The value for the descriptor - * @param writable Defaults to `true` if not specified - * @param enumerable Defaults to `true` if not specified - * @param configurable Defaults to `true` if not specified - */ - function createValuePropertyDescriptor(value, writable, enumerable, configurable) { - if (writable === void 0) { writable = true; } - if (enumerable === void 0) { enumerable = true; } - if (configurable === void 0) { configurable = true; } - return object_1.assign(objectCreate(null), { - value: value, - writable: writable, - enumerable: enumerable, - configurable: configurable - }); - } - /** - * A class which is used when making a custom comparison of a non-plain object or array - */ - var CustomDiff = /** @class */ (function () { - function CustomDiff(diff) { - this._differ = diff; - } - /** - * Get the difference of the `value` - * @param value The value to diff - * @param nameOrIndex A `string` if comparing a property or a `number` if comparing an array element - * @param parent The outer parent that this value is part of - */ - CustomDiff.prototype.diff = function (value, nameOrIndex, parent) { - var record = this._differ(value, nameOrIndex, parent); - if (record && typeof nameOrIndex === 'string') { - return object_1.assign(record, { name: nameOrIndex }); - } - }; - return CustomDiff; - }()); - exports.CustomDiff = CustomDiff; - /** - * Internal function that detects the differences between an array and another value and returns a set of splice records that - * describe the differences - * - * @param a The first array to compare to - * @param b The second value to compare to - * @param options An options bag that allows configuration of the behaviour of `diffArray()` - */ - function diffArray(a, b, options) { - /* This function takes an overly simplistic approach to calculating splice records. There are many situations where - * in complicated array mutations, the splice records can be more optimised. - * - * TODO: Raise an issue for this when it is finally merged and put into core - */ - var _a = options.allowFunctionValues, allowFunctionValues = _a === void 0 ? false : _a; - var arrayA = a; - var lengthA = arrayA.length; - var arrayB = isArray(b) ? b : []; - var lengthB = arrayB.length; - var patchRecords = []; - if (!lengthA && lengthB) { - /* empty array */ - patchRecords.push(createSpliceRecord(0, lengthB)); - return patchRecords; - } - var add = []; - var start = 0; - var deleteCount = 0; - var last = -1; - function flushSpliceRecord() { - if (deleteCount || add.length) { - patchRecords.push(createSpliceRecord(start, start + deleteCount > lengthB ? lengthB - start : deleteCount, add)); - } - } - function addDifference(index, adding, value) { - if (index > last + 1) { - /* flush the splice */ - flushSpliceRecord(); - start = index; - deleteCount = 0; - if (add.length) { - add = []; - } - } - if (adding) { - add.push(value); - } - deleteCount++; - last = index; - } - arrayA.forEach(function (valueA, index) { - var valueB = arrayB[index]; - if (index in arrayB && - (valueA === valueB || (allowFunctionValues && typeof valueA === 'function' && typeof valueB === 'function'))) { - return; /* not different */ - } - var isValueAArray = isArray(valueA); - var isValueAPlainObject = isPlainObject(valueA); - if (isValueAArray || isValueAPlainObject) { - var value = isValueAArray - ? isArray(valueB) ? valueB : [] - : isPlainObject(valueB) ? valueB : Object.create(null); - var valueRecords = diff(valueA, value, options); - if (valueRecords.length) { - /* only add if there are changes */ - addDifference(index, true, diff(valueA, value, options)); - } - } - else if (isPrimitive(valueA)) { - addDifference(index, true, valueA); - } - else if (allowFunctionValues && typeof valueA === 'function') { - addDifference(index, true, valueA); - } - else { - throw new TypeError("Value of array element \"" + index + "\" from first argument is not a primative, plain Object, or Array."); - } - }); - if (lengthB > lengthA) { - for (var index = lengthA; index < lengthB; index++) { - addDifference(index, false); - } - } - /* flush any deletes */ - flushSpliceRecord(); - return patchRecords; - } - /** - * Internal function that detects the differences between plain objects and returns a set of patch records that - * describe the differences - * - * @param a The first plain object to compare to - * @param b The second plain bject to compare to - * @param options An options bag that allows configuration of the behaviour of `diffPlainObject()` - */ - function diffPlainObject(a, b, options) { - var _a = options.allowFunctionValues, allowFunctionValues = _a === void 0 ? false : _a, _b = options.ignorePropertyValues, ignorePropertyValues = _b === void 0 ? [] : _b; - var patchRecords = []; - var _c = getComparableObjects(a, b, options), comparableA = _c.comparableA, comparableB = _c.comparableB; - /* look for keys in a that are different from b */ - object_2.keys(comparableA).reduce(function (patchRecords, name) { - var valueA = a[name]; - var valueB = b[name]; - var bHasOwnProperty = hasOwnProperty.call(comparableB, name); - if (bHasOwnProperty && - (valueA === valueB || (allowFunctionValues && typeof valueA === 'function' && typeof valueB === 'function'))) { - /* not different */ - /* when `allowFunctionValues` is true, functions are simply considered to be equal by `typeof` */ - return patchRecords; - } - var type = bHasOwnProperty ? 'update' : 'add'; - var isValueAArray = isArray(valueA); - var isValueAPlainObject = isPlainObject(valueA); - if (isValueAArray || isValueAPlainObject) { - /* non-primitive values we can diff */ - /* this is a bit complicated, but essentially if valueA and valueB are both arrays or plain objects, then - * we can diff those two values, if not, then we need to use an empty array or an empty object and diff - * the valueA with that */ - var value = (isValueAArray && isArray(valueB)) || (isValueAPlainObject && isPlainObject(valueB)) - ? valueB - : isValueAArray ? [] : objectCreate(null); - var valueRecords = diff(valueA, value, options); - if (valueRecords.length) { - /* only add if there are changes */ - patchRecords.push(createPatchRecord(type, name, createValuePropertyDescriptor(value), diff(valueA, value, options))); - } - } - else if (isCustomDiff(valueA) && !isCustomDiff(valueB)) { - /* complex diff left hand */ - var result = valueA.diff(valueB, name, b); - if (result) { - patchRecords.push(result); - } - } - else if (isCustomDiff(valueB)) { - /* complex diff right hand */ - var result = valueB.diff(valueA, name, a); - if (result) { - patchRecords.push(result); - } - } - else if (isPrimitive(valueA) || - (allowFunctionValues && typeof valueA === 'function') || - isIgnoredPropertyValue(name, a, b, ignorePropertyValues)) { - /* primitive values, functions values if allowed, or ignored property values can just be copied */ - patchRecords.push(createPatchRecord(type, name, createValuePropertyDescriptor(valueA))); - } - else { - throw new TypeError("Value of property named \"" + name + "\" from first argument is not a primative, plain Object, or Array."); - } - return patchRecords; - }, patchRecords); - /* look for keys in b that are not in a */ - object_2.keys(comparableB).reduce(function (patchRecords, name) { - if (!hasOwnProperty.call(comparableA, name)) { - patchRecords.push(createPatchRecord('delete', name)); - } - return patchRecords; - }, patchRecords); - return patchRecords; - } - /** - * Takes two plain objects to be compared, as well as options customizing the behavior of the comparison, and returns - * two new objects that contain only those properties that should be compared. If a property is ignored - * it will not be included in either returned object. If a property's value should be ignored it will be excluded - * if it is present in both objects. - * @param a The first object to compare - * @param b The second object to compare - * @param options An options bag indicating which properties should be ignored or have their values ignored, if any. - */ - function getComparableObjects(a, b, options) { - var _a = options.ignoreProperties, ignoreProperties = _a === void 0 ? [] : _a, _b = options.ignorePropertyValues, ignorePropertyValues = _b === void 0 ? [] : _b; - var ignore = new Set_1.default(); - var keep = new Set_1.default(); - var isIgnoredProperty = Array.isArray(ignoreProperties) - ? function (name) { - return ignoreProperties.some(function (value) { return (typeof value === 'string' ? name === value : value.test(name)); }); - } - : function (name) { return ignoreProperties(name, a, b); }; - var comparableA = object_2.keys(a).reduce(function (obj, name) { - if (isIgnoredProperty(name) || - (hasOwnProperty.call(b, name) && isIgnoredPropertyValue(name, a, b, ignorePropertyValues))) { - ignore.add(name); - return obj; - } - keep.add(name); - obj[name] = a[name]; - return obj; - }, {}); - var comparableB = object_2.keys(b).reduce(function (obj, name) { - if (ignore.has(name) || (!keep.has(name) && isIgnoredProperty(name))) { - return obj; - } - obj[name] = b[name]; - return obj; - }, {}); - return { comparableA: comparableA, comparableB: comparableB, ignore: ignore }; - } - exports.getComparableObjects = getComparableObjects; - /** - * A guard that determines if the value is a `ConstructRecord` - * @param value The value to check - */ - function isConstructRecord(value) { - return Boolean(value && typeof value === 'object' && value !== null && value.Ctor && value.name); - } - function isIgnoredPropertyValue(name, a, b, ignoredPropertyValues) { - return Array.isArray(ignoredPropertyValues) - ? ignoredPropertyValues.some(function (value) { - return typeof value === 'string' ? name === value : value.test(name); - }) - : ignoredPropertyValues(name, a, b); - } - /** - * A guard that determines if the value is a `PatchRecord` - * - * @param value The value to check - */ - function isPatchRecord(value) { - return Boolean(value && value.type && value.name); - } - /** - * A guard that determines if the value is an array of `PatchRecord`s - * - * @param value The value to check - */ - function isPatchRecordArray(value) { - return Boolean(isArray(value) && value.length && isPatchRecord(value[0])); - } - /** - * A guard that determines if the value is a plain object. A plain object is an object that has - * either no constructor (e.g. `Object.create(null)`) or has Object as its constructor. - * - * @param value The value to check - */ - function isPlainObject(value) { - return Boolean(value && typeof value === 'object' && (value.constructor === Object || value.constructor === undefined)); - } - /** - * A guard that determines if the value is a primitive (including `null`), as these values are - * fine to just copy. - * - * @param value The value to check - */ - function isPrimitive(value) { - var typeofValue = typeof value; - return (value === null || - typeofValue === 'undefined' || - typeofValue === 'string' || - typeofValue === 'number' || - typeofValue === 'boolean'); - } - /** - * A guard that determines if the value is a `CustomDiff` - * @param value The value to check - */ - function isCustomDiff(value) { - return typeof value === 'object' && value instanceof CustomDiff; - } - /** - * A guard that determines if the value is a `SpliceRecord` - * - * @param value The value to check - */ - function isSpliceRecord(value) { - return value && value.type === 'splice' && 'start' in value && 'deleteCount' in value; - } - /** - * A guard that determines if the value is an array of `SpliceRecord`s - * - * @param value The value to check - */ - function isSpliceRecordArray(value) { - return Boolean(isArray(value) && value.length && isSpliceRecord(value[0])); - } - /** - * An internal function that patches a target with a `SpliceRecord` - */ - function patchSplice(target, _a) { - var add = _a.add, deleteCount = _a.deleteCount, start = _a.start; - if (add && add.length) { - var deletedItems_1 = deleteCount ? target.slice(start, start + deleteCount) : []; - add = add.map(function (value, index) { return resolveTargetValue(value, deletedItems_1[index]); }); - target.splice.apply(target, tslib_1.__spread([start, deleteCount], add)); - } - else { - target.splice(start, deleteCount); - } - return target; - } - /** - * An internal function that patches a target with a `PatchRecord` - */ - function patchPatch(target, record) { - var name = record.name; - if (record.type === 'delete') { - delete target[name]; - return target; - } - var descriptor = record.descriptor, valueRecords = record.valueRecords; - if (valueRecords && valueRecords.length) { - descriptor.value = patch(descriptor.value, valueRecords); - } - defineProperty(target, name, descriptor); - return target; - } - var defaultConstructDescriptor = { - configurable: true, - enumerable: true, - writable: true - }; - function patchConstruct(target, record) { - var args = record.args, _a = record.descriptor, descriptor = _a === void 0 ? defaultConstructDescriptor : _a, Ctor = record.Ctor, name = record.name, propertyRecords = record.propertyRecords; - var value = new (Ctor.bind.apply(Ctor, tslib_1.__spread([void 0], (args || []))))(); - if (propertyRecords) { - propertyRecords.forEach(function (record) { return (isConstructRecord(record) ? patchConstruct(value, record) : patchPatch(value, record)); }); - } - defineProperty(target, name, object_1.assign({ value: value }, descriptor)); - return target; - } - /** - * An internal function that takes a value from array being patched and the target value from the same - * index and determines the value that should actually be patched into the target array - */ - function resolveTargetValue(patchValue, targetValue) { - var patchIsSpliceRecordArray = isSpliceRecordArray(patchValue); - return patchIsSpliceRecordArray || isPatchRecordArray(patchValue) - ? patch(patchIsSpliceRecordArray - ? isArray(targetValue) ? targetValue : [] - : isPlainObject(targetValue) ? targetValue : objectCreate(null), patchValue) - : patchValue; - } - /** - * Compares two plain objects or arrays and return a set of records which describe the differences between the two - * - * The records describe what would need to be applied to the second argument to make it look like the first argument - * - * @param a The plain object or array to compare with - * @param b The plain object or array to compare to - * @param options An options bag that allows configuration of the behaviour of `diff()` - */ - function diff(a, b, options) { - if (options === void 0) { options = {}; } - if (typeof a !== 'object' || typeof b !== 'object') { - throw new TypeError('Arguments are not of type object.'); - } - if (isArray(a)) { - return diffArray(a, b, options); - } - if (isArray(b)) { - b = objectCreate(null); - } - if (!isPlainObject(a) || !isPlainObject(b)) { - throw new TypeError('Arguments are not plain Objects or Arrays.'); - } - return diffPlainObject(a, b, options); - } - exports.diff = diff; - /** - * Apply a set of patch records to a target. - * - * @param target The plain object or array that the patch records should be applied to - * @param records A set of patch records to be applied to the target - */ - function patch(target, records) { - if (!isArray(target) && !isPlainObject(target)) { - throw new TypeError('A target for a patch must be either an array or a plain object.'); - } - if (isFrozen(target) || isSealed(target)) { - throw new TypeError('Cannot patch sealed or frozen objects.'); - } - records.forEach(function (record) { - target = isSpliceRecord(record) - ? patchSplice(isArray(target) ? target : [], record) /* patch arrays */ - : isConstructRecord(record) - ? patchConstruct(target, record) /* patch complex object */ - : patchPatch(isPlainObject(target) ? target : {}, record); /* patch plain object */ - }); - return target; - } - exports.patch = patch; -}); -//# sourceMappingURL=compare.js.map \ No newline at end of file diff --git a/deps/framework/core/compare.js.map b/deps/framework/core/compare.js.map deleted file mode 100644 index e201afe44d..0000000000 --- a/deps/framework/core/compare.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"compare.js","sourceRoot":"","sources":["compare.ts"],"names":[],"mappings":";;;;;;;;;;;;IAAA,yCAAwC;IACxC,yCAAsC;IACtC,mCAA8B;IAE9B,0EAA0E;IAE1E,IAAM,YAAY,GAAG,MAAM,CAAC,MAAM,CAAC;IACnC,IAAM,cAAc,GAAG,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC;IACvD,IAAM,cAAc,GAAG,MAAM,CAAC,cAAc,CAAC;IAC7C,IAAM,OAAO,GAAG,KAAK,CAAC,OAAO,CAAC;IAC9B,IAAM,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC;IACjC,IAAM,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC;IA8JjC;;;;OAIG;IACH,kCAAkC;IAClC,+BACC,IAAiB,EACjB,IAAY,EACZ,UAAgC;QAEhC,IAAM,MAAM,GAA6B,eAAM,CAAC,YAAY,CAAC,IAAI,CAAC,EAAE,EAAE,IAAI,MAAA,EAAE,CAAC,CAAC;QAC9E,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC;YACV,MAAM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,CAAC,CAAC,UAAU,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,MAAM,CAAC,CAAC,CAAC,wBAAwB;QACtF,CAAC,CAAC,CAAC;QACH,MAAM,CAAC,MAAM,CAAC;IACf,CAAC;IAhBD,sBAgBC","sourcesContent":["import { assign } from '../shim/object';\nimport { keys } from '../shim/object';\nimport Set from '../shim/Set';\n\n/* Assigning to local variables to improve minification and readability */\n\nconst objectCreate = Object.create;\nconst hasOwnProperty = Object.prototype.hasOwnProperty;\nconst defineProperty = Object.defineProperty;\nconst isArray = Array.isArray;\nconst isFrozen = Object.isFrozen;\nconst isSealed = Object.isSealed;\n\nexport type IgnorePropertyFunction = (name: string, a: any, b: any) => boolean;\n\nexport interface DiffOptions {\n\t/**\n\t * Allow functions to be values. Values will be considered equal if the `typeof` both values are `function`.\n\t * When adding or updating the property, the value of the property of `a` will be used in the record, which\n\t * will be a reference to the function.\n\t */\n\tallowFunctionValues?: boolean;\n\n\t/**\n\t * An array of strings or regular expressions which flag certain properties to be ignored. Alternatively\n\t * a function, which returns `true` to have the property ignored or `false` to diff the property.\n\t */\n\tignoreProperties?: (string | RegExp)[] | IgnorePropertyFunction;\n\n\t/**\n\t * An array of strings or regular expressions which flag certain values to be ignored. For flagged properties,\n\t * if the property is present in both `a` and `b` the value will be ignored. If adding the property,\n\t * whatever the value of the property of `a` will be used, which could be a reference.\n\t */\n\tignorePropertyValues?: (string | RegExp)[] | IgnorePropertyFunction;\n}\n\n/**\n * Interface for a generic constructor function\n */\nexport interface Constructor {\n\tnew (...args: any[]): object;\n\tprototype: object;\n}\n\n/**\n * A partial property descriptor that provides the property descriptor flags supported by the\n * complex property construction of `patch()`\n *\n * All properties are value properties, with the value being supplied by the `ConstructRecord`\n */\nexport interface ConstructDescriptor {\n\t/**\n\t * Is the property configurable?\n\t */\n\tconfigurable?: boolean;\n\n\t/**\n\t * Is the property enumerable?\n\t */\n\tenumerable?: boolean;\n\n\t/**\n\t * Is the property configurable?\n\t */\n\twritable?: boolean;\n}\n\n/**\n * A record that describes a constructor function and arguments necessary to create an instance of\n * an object\n */\nexport interface AnonymousConstructRecord {\n\t/**\n\t * Any arguments to pass to the constructor function\n\t */\n\targs?: any[];\n\n\t/**\n\t * The constructor function to use to create the instance\n\t */\n\tCtor: Constructor;\n\n\t/**\n\t * The partial descriptor that is used to set the value of the instance\n\t */\n\tdescriptor?: ConstructDescriptor;\n\n\t/**\n\t * Any patches to properties that need to occur on the instance\n\t */\n\tpropertyRecords?: (ConstructRecord | PatchRecord)[];\n}\n\nexport interface ConstructRecord extends AnonymousConstructRecord {\n\t/**\n\t * The name of the property on the Object\n\t */\n\tname: string;\n}\n\n/**\n * A record that describes the mutations necessary to a property of an object to make that property look\n * like another\n */\nexport type PatchRecord =\n\t| {\n\t\t\t/**\n\t\t\t * The name of the property on the Object\n\t\t\t */\n\t\t\tname: string;\n\n\t\t\t/**\n\t\t\t * The type of the patch\n\t\t\t */\n\t\t\ttype: 'delete';\n\t\t}\n\t| {\n\t\t\t/**\n\t\t\t * A property descriptor that describes the property in `name`\n\t\t\t */\n\t\t\tdescriptor: PropertyDescriptor;\n\n\t\t\t/**\n\t\t\t * The name of the property on the Object\n\t\t\t */\n\t\t\tname: string;\n\n\t\t\t/**\n\t\t\t * The type of the patch\n\t\t\t */\n\t\t\ttype: 'add' | 'update';\n\n\t\t\t/**\n\t\t\t * Additional patch records which describe the value of the property\n\t\t\t */\n\t\t\tvalueRecords?: (ConstructRecord | PatchRecord | SpliceRecord)[];\n\t\t};\n\n/**\n * The different types of patch records supported\n */\nexport type PatchTypes = 'add' | 'update' | 'delete';\n\n/**\n * A record that describes a splice operation to perform on an array to make the array look like another array\n */\nexport interface SpliceRecord {\n\t/**\n\t * Any items that are being added to the array\n\t */\n\tadd?: any[];\n\n\t/**\n\t * The number of items in the array to delete\n\t */\n\tdeleteCount: number;\n\n\t/**\n\t * The type, set to `splice`\n\t */\n\ttype: 'splice';\n\n\t/**\n\t * The index of where to start the splice\n\t */\n\tstart: number;\n}\n\n/**\n * A record that describes how to instantiate a new object via a constructor function\n * @param Ctor The constructor function\n * @param args Any arguments to be passed to the constructor function\n */\n/* tslint:disable:variable-name */\nexport function createConstructRecord(\n\tCtor: Constructor,\n\targs?: any[],\n\tdescriptor?: ConstructDescriptor\n): AnonymousConstructRecord {\n\tconst record: AnonymousConstructRecord = assign(objectCreate(null), { Ctor });\n\tif (args) {\n\t\trecord.args = args;\n\t}\n\tif (descriptor) {\n\t\trecord.descriptor = descriptor;\n\t}\n\treturn record;\n}\n/* tslint:enable:variable-name */\n\n/**\n * An internal function that returns a new patch record\n *\n * @param type The type of patch record\n * @param name The property name the record refers to\n * @param descriptor The property descriptor to be installed on the object\n * @param valueRecords Any subsequenet patch recrds to be applied to the value of the descriptor\n */\nfunction createPatchRecord(\n\ttype: PatchTypes,\n\tname: string,\n\tdescriptor?: PropertyDescriptor,\n\tvalueRecords?: (ConstructRecord | PatchRecord | SpliceRecord)[]\n): PatchRecord {\n\tconst patchRecord = assign(objectCreate(null), {\n\t\ttype,\n\t\tname\n\t});\n\n\tif (descriptor) {\n\t\tpatchRecord.descriptor = descriptor;\n\t}\n\tif (valueRecords) {\n\t\tpatchRecord.valueRecords = valueRecords;\n\t}\n\n\treturn patchRecord as PatchRecord;\n}\n\n/**\n * An internal function that returns a new splice record\n *\n * @param start Where in the array to start the splice\n * @param deleteCount The number of elements to delete from the array\n * @param add Elements to be added to the target\n */\nfunction createSpliceRecord(start: number, deleteCount: number, add?: any[]): SpliceRecord {\n\tconst spliceRecord: SpliceRecord = assign(objectCreate(null), {\n\t\ttype: 'splice',\n\t\tstart,\n\t\tdeleteCount\n\t});\n\n\tif (add && add.length) {\n\t\tspliceRecord.add = add;\n\t}\n\n\treturn spliceRecord;\n}\n\n/**\n * A function that produces a value property descriptor, which assumes that properties are enumerable, writable and configurable\n * unless specified\n *\n * @param value The value for the descriptor\n * @param writable Defaults to `true` if not specified\n * @param enumerable Defaults to `true` if not specified\n * @param configurable Defaults to `true` if not specified\n */\nfunction createValuePropertyDescriptor(\n\tvalue: any,\n\twritable: boolean = true,\n\tenumerable: boolean = true,\n\tconfigurable: boolean = true\n): PropertyDescriptor {\n\treturn assign(objectCreate(null), {\n\t\tvalue,\n\t\twritable,\n\t\tenumerable,\n\t\tconfigurable\n\t});\n}\n\n/**\n * A function that returns a constructor record or `undefined` when diffing a value\n */\nexport type CustomDiffFunction = (\n\tvalue: T,\n\tnameOrIndex: string | number,\n\tparent: object\n) => AnonymousConstructRecord | void;\n\n/**\n * A class which is used when making a custom comparison of a non-plain object or array\n */\nexport class CustomDiff {\n\tprivate _differ: CustomDiffFunction;\n\n\tconstructor(diff: CustomDiffFunction) {\n\t\tthis._differ = diff;\n\t}\n\n\t/**\n\t * Get the difference of the `value`\n\t * @param value The value to diff\n\t * @param nameOrIndex A `string` if comparing a property or a `number` if comparing an array element\n\t * @param parent The outer parent that this value is part of\n\t */\n\tdiff(value: T, nameOrIndex: string | number, parent: object): ConstructRecord | void {\n\t\tconst record = this._differ(value, nameOrIndex, parent);\n\t\tif (record && typeof nameOrIndex === 'string') {\n\t\t\treturn assign(record, { name: nameOrIndex });\n\t\t}\n\t}\n}\n\n/**\n * Internal function that detects the differences between an array and another value and returns a set of splice records that\n * describe the differences\n *\n * @param a The first array to compare to\n * @param b The second value to compare to\n * @param options An options bag that allows configuration of the behaviour of `diffArray()`\n */\nfunction diffArray(a: any[], b: any, options: DiffOptions): SpliceRecord[] {\n\t/* This function takes an overly simplistic approach to calculating splice records. There are many situations where\n\t * in complicated array mutations, the splice records can be more optimised.\n\t *\n\t * TODO: Raise an issue for this when it is finally merged and put into core\n\t */\n\n\tconst { allowFunctionValues = false } = options;\n\n\tconst arrayA = a;\n\tconst lengthA = arrayA.length;\n\tconst arrayB = isArray(b) ? b : [];\n\tconst lengthB = arrayB.length;\n\tconst patchRecords: SpliceRecord[] = [];\n\n\tif (!lengthA && lengthB) {\n\t\t/* empty array */\n\t\tpatchRecords.push(createSpliceRecord(0, lengthB));\n\t\treturn patchRecords;\n\t}\n\n\tlet add: any[] = [];\n\tlet start = 0;\n\tlet deleteCount = 0;\n\tlet last = -1;\n\n\tfunction flushSpliceRecord() {\n\t\tif (deleteCount || add.length) {\n\t\t\tpatchRecords.push(\n\t\t\t\tcreateSpliceRecord(start, start + deleteCount > lengthB ? lengthB - start : deleteCount, add)\n\t\t\t);\n\t\t}\n\t}\n\n\tfunction addDifference(index: number, adding: boolean, value?: any) {\n\t\tif (index > last + 1) {\n\t\t\t/* flush the splice */\n\t\t\tflushSpliceRecord();\n\t\t\tstart = index;\n\t\t\tdeleteCount = 0;\n\t\t\tif (add.length) {\n\t\t\t\tadd = [];\n\t\t\t}\n\t\t}\n\n\t\tif (adding) {\n\t\t\tadd.push(value);\n\t\t}\n\t\tdeleteCount++;\n\t\tlast = index;\n\t}\n\n\tarrayA.forEach((valueA, index) => {\n\t\tconst valueB = arrayB[index];\n\n\t\tif (\n\t\t\tindex in arrayB &&\n\t\t\t(valueA === valueB || (allowFunctionValues && typeof valueA === 'function' && typeof valueB === 'function'))\n\t\t) {\n\t\t\treturn; /* not different */\n\t\t}\n\n\t\tconst isValueAArray = isArray(valueA);\n\t\tconst isValueAPlainObject = isPlainObject(valueA);\n\n\t\tif (isValueAArray || isValueAPlainObject) {\n\t\t\tconst value = isValueAArray\n\t\t\t\t? isArray(valueB) ? valueB : []\n\t\t\t\t: isPlainObject(valueB) ? valueB : Object.create(null);\n\t\t\tconst valueRecords = diff(valueA, value, options);\n\t\t\tif (valueRecords.length) {\n\t\t\t\t/* only add if there are changes */\n\t\t\t\taddDifference(index, true, diff(valueA, value, options));\n\t\t\t}\n\t\t} else if (isPrimitive(valueA)) {\n\t\t\taddDifference(index, true, valueA);\n\t\t} else if (allowFunctionValues && typeof valueA === 'function') {\n\t\t\taddDifference(index, true, valueA);\n\t\t} else {\n\t\t\tthrow new TypeError(\n\t\t\t\t`Value of array element \"${index}\" from first argument is not a primative, plain Object, or Array.`\n\t\t\t);\n\t\t}\n\t});\n\n\tif (lengthB > lengthA) {\n\t\tfor (let index = lengthA; index < lengthB; index++) {\n\t\t\taddDifference(index, false);\n\t\t}\n\t}\n\n\t/* flush any deletes */\n\tflushSpliceRecord();\n\n\treturn patchRecords;\n}\n\n/**\n * Internal function that detects the differences between plain objects and returns a set of patch records that\n * describe the differences\n *\n * @param a The first plain object to compare to\n * @param b The second plain bject to compare to\n * @param options An options bag that allows configuration of the behaviour of `diffPlainObject()`\n */\nfunction diffPlainObject(a: any, b: any, options: DiffOptions): (ConstructRecord | PatchRecord)[] {\n\tconst { allowFunctionValues = false, ignorePropertyValues = [] } = options;\n\tconst patchRecords: (ConstructRecord | PatchRecord)[] = [];\n\tconst { comparableA, comparableB } = getComparableObjects(a, b, options);\n\n\t/* look for keys in a that are different from b */\n\tkeys(comparableA).reduce((patchRecords, name) => {\n\t\tconst valueA = a[name];\n\t\tconst valueB = b[name];\n\t\tconst bHasOwnProperty = hasOwnProperty.call(comparableB, name);\n\n\t\tif (\n\t\t\tbHasOwnProperty &&\n\t\t\t(valueA === valueB || (allowFunctionValues && typeof valueA === 'function' && typeof valueB === 'function'))\n\t\t) {\n\t\t\t/* not different */\n\t\t\t/* when `allowFunctionValues` is true, functions are simply considered to be equal by `typeof` */\n\t\t\treturn patchRecords;\n\t\t}\n\n\t\tconst type = bHasOwnProperty ? 'update' : 'add';\n\n\t\tconst isValueAArray = isArray(valueA);\n\t\tconst isValueAPlainObject = isPlainObject(valueA);\n\n\t\tif (isValueAArray || isValueAPlainObject) {\n\t\t\t/* non-primitive values we can diff */\n\t\t\t/* this is a bit complicated, but essentially if valueA and valueB are both arrays or plain objects, then\n\t\t\t* we can diff those two values, if not, then we need to use an empty array or an empty object and diff\n\t\t\t* the valueA with that */\n\t\t\tconst value =\n\t\t\t\t(isValueAArray && isArray(valueB)) || (isValueAPlainObject && isPlainObject(valueB))\n\t\t\t\t\t? valueB\n\t\t\t\t\t: isValueAArray ? [] : objectCreate(null);\n\t\t\tconst valueRecords = diff(valueA, value, options);\n\t\t\tif (valueRecords.length) {\n\t\t\t\t/* only add if there are changes */\n\t\t\t\tpatchRecords.push(\n\t\t\t\t\tcreatePatchRecord(type, name, createValuePropertyDescriptor(value), diff(valueA, value, options))\n\t\t\t\t);\n\t\t\t}\n\t\t} else if (isCustomDiff(valueA) && !isCustomDiff(valueB)) {\n\t\t\t/* complex diff left hand */\n\t\t\tconst result = valueA.diff(valueB, name, b);\n\t\t\tif (result) {\n\t\t\t\tpatchRecords.push(result);\n\t\t\t}\n\t\t} else if (isCustomDiff(valueB)) {\n\t\t\t/* complex diff right hand */\n\t\t\tconst result = valueB.diff(valueA, name, a);\n\t\t\tif (result) {\n\t\t\t\tpatchRecords.push(result);\n\t\t\t}\n\t\t} else if (\n\t\t\tisPrimitive(valueA) ||\n\t\t\t(allowFunctionValues && typeof valueA === 'function') ||\n\t\t\tisIgnoredPropertyValue(name, a, b, ignorePropertyValues)\n\t\t) {\n\t\t\t/* primitive values, functions values if allowed, or ignored property values can just be copied */\n\t\t\tpatchRecords.push(createPatchRecord(type, name, createValuePropertyDescriptor(valueA)));\n\t\t} else {\n\t\t\tthrow new TypeError(\n\t\t\t\t`Value of property named \"${name}\" from first argument is not a primative, plain Object, or Array.`\n\t\t\t);\n\t\t}\n\t\treturn patchRecords;\n\t}, patchRecords);\n\n\t/* look for keys in b that are not in a */\n\tkeys(comparableB).reduce((patchRecords, name) => {\n\t\tif (!hasOwnProperty.call(comparableA, name)) {\n\t\t\tpatchRecords.push(createPatchRecord('delete', name));\n\t\t}\n\t\treturn patchRecords;\n\t}, patchRecords);\n\n\treturn patchRecords;\n}\n\n/**\n * Takes two plain objects to be compared, as well as options customizing the behavior of the comparison, and returns\n * two new objects that contain only those properties that should be compared. If a property is ignored\n * it will not be included in either returned object. If a property's value should be ignored it will be excluded\n * if it is present in both objects.\n * @param a The first object to compare\n * @param b The second object to compare\n * @param options An options bag indicating which properties should be ignored or have their values ignored, if any.\n */\nexport function getComparableObjects(a: any, b: any, options: DiffOptions) {\n\tconst { ignoreProperties = [], ignorePropertyValues = [] } = options;\n\tconst ignore = new Set();\n\tconst keep = new Set();\n\n\tconst isIgnoredProperty = Array.isArray(ignoreProperties)\n\t\t? (name: string) => {\n\t\t\t\treturn ignoreProperties.some(\n\t\t\t\t\t(value) => (typeof value === 'string' ? name === value : value.test(name))\n\t\t\t\t);\n\t\t\t}\n\t\t: (name: string) => ignoreProperties(name, a, b);\n\n\tconst comparableA = keys(a).reduce(\n\t\t(obj, name) => {\n\t\t\tif (\n\t\t\t\tisIgnoredProperty(name) ||\n\t\t\t\t(hasOwnProperty.call(b, name) && isIgnoredPropertyValue(name, a, b, ignorePropertyValues))\n\t\t\t) {\n\t\t\t\tignore.add(name);\n\t\t\t\treturn obj;\n\t\t\t}\n\n\t\t\tkeep.add(name);\n\t\t\tobj[name] = a[name];\n\t\t\treturn obj;\n\t\t},\n\t\t{} as { [key: string]: any }\n\t);\n\n\tconst comparableB = keys(b).reduce(\n\t\t(obj, name) => {\n\t\t\tif (ignore.has(name) || (!keep.has(name) && isIgnoredProperty(name))) {\n\t\t\t\treturn obj;\n\t\t\t}\n\n\t\t\tobj[name] = b[name];\n\t\t\treturn obj;\n\t\t},\n\t\t{} as { [key: string]: any }\n\t);\n\n\treturn { comparableA, comparableB, ignore };\n}\n\n/**\n * A guard that determines if the value is a `ConstructRecord`\n * @param value The value to check\n */\nfunction isConstructRecord(value: any): value is ConstructRecord {\n\treturn Boolean(value && typeof value === 'object' && value !== null && value.Ctor && value.name);\n}\n\nfunction isIgnoredPropertyValue(\n\tname: string,\n\ta: any,\n\tb: any,\n\tignoredPropertyValues: (string | RegExp)[] | IgnorePropertyFunction\n) {\n\treturn Array.isArray(ignoredPropertyValues)\n\t\t? ignoredPropertyValues.some((value) => {\n\t\t\t\treturn typeof value === 'string' ? name === value : value.test(name);\n\t\t\t})\n\t\t: ignoredPropertyValues(name, a, b);\n}\n\n/**\n * A guard that determines if the value is a `PatchRecord`\n *\n * @param value The value to check\n */\nfunction isPatchRecord(value: any): value is PatchRecord {\n\treturn Boolean(value && value.type && value.name);\n}\n\n/**\n * A guard that determines if the value is an array of `PatchRecord`s\n *\n * @param value The value to check\n */\nfunction isPatchRecordArray(value: any): value is PatchRecord[] {\n\treturn Boolean(isArray(value) && value.length && isPatchRecord(value[0]));\n}\n\n/**\n * A guard that determines if the value is a plain object. A plain object is an object that has\n * either no constructor (e.g. `Object.create(null)`) or has Object as its constructor.\n *\n * @param value The value to check\n */\nfunction isPlainObject(value: any): value is Object {\n\treturn Boolean(\n\t\tvalue && typeof value === 'object' && (value.constructor === Object || value.constructor === undefined)\n\t);\n}\n\n/**\n * A guard that determines if the value is a primitive (including `null`), as these values are\n * fine to just copy.\n *\n * @param value The value to check\n */\nfunction isPrimitive(value: any): value is string | number | boolean | undefined | null {\n\tconst typeofValue = typeof value;\n\treturn (\n\t\tvalue === null ||\n\t\ttypeofValue === 'undefined' ||\n\t\ttypeofValue === 'string' ||\n\t\ttypeofValue === 'number' ||\n\t\ttypeofValue === 'boolean'\n\t);\n}\n\n/**\n * A guard that determines if the value is a `CustomDiff`\n * @param value The value to check\n */\nfunction isCustomDiff(value: any): value is CustomDiff {\n\treturn typeof value === 'object' && value instanceof CustomDiff;\n}\n\n/**\n * A guard that determines if the value is a `SpliceRecord`\n *\n * @param value The value to check\n */\nfunction isSpliceRecord(value: any): value is SpliceRecord {\n\treturn value && value.type === 'splice' && 'start' in value && 'deleteCount' in value;\n}\n\n/**\n * A guard that determines if the value is an array of `SpliceRecord`s\n *\n * @param value The value to check\n */\nfunction isSpliceRecordArray(value: any): value is SpliceRecord[] {\n\treturn Boolean(isArray(value) && value.length && isSpliceRecord(value[0]));\n}\n\n/**\n * An internal function that patches a target with a `SpliceRecord`\n */\nfunction patchSplice(target: any[], { add, deleteCount, start }: SpliceRecord): any {\n\tif (add && add.length) {\n\t\tconst deletedItems = deleteCount ? target.slice(start, start + deleteCount) : [];\n\t\tadd = add.map((value, index) => resolveTargetValue(value, deletedItems[index]));\n\t\ttarget.splice(start, deleteCount, ...add);\n\t} else {\n\t\ttarget.splice(start, deleteCount);\n\t}\n\treturn target;\n}\n\n/**\n * An internal function that patches a target with a `PatchRecord`\n */\nfunction patchPatch(target: any, record: PatchRecord): any {\n\tconst { name } = record;\n\tif (record.type === 'delete') {\n\t\tdelete target[name];\n\t\treturn target;\n\t}\n\tconst { descriptor, valueRecords } = record;\n\tif (valueRecords && valueRecords.length) {\n\t\tdescriptor.value = patch(descriptor.value, valueRecords);\n\t}\n\tdefineProperty(target, name, descriptor);\n\treturn target;\n}\n\nconst defaultConstructDescriptor = {\n\tconfigurable: true,\n\tenumerable: true,\n\twritable: true\n};\n\nfunction patchConstruct(target: any, record: ConstructRecord): any {\n\tconst { args, descriptor = defaultConstructDescriptor, Ctor, name, propertyRecords } = record;\n\tconst value = new Ctor(...(args || []));\n\tif (propertyRecords) {\n\t\tpropertyRecords.forEach(\n\t\t\t(record) => (isConstructRecord(record) ? patchConstruct(value, record) : patchPatch(value, record))\n\t\t);\n\t}\n\tdefineProperty(target, name, assign({ value }, descriptor));\n\treturn target;\n}\n\n/**\n * An internal function that takes a value from array being patched and the target value from the same\n * index and determines the value that should actually be patched into the target array\n */\nfunction resolveTargetValue(patchValue: any, targetValue: any): any {\n\tconst patchIsSpliceRecordArray = isSpliceRecordArray(patchValue);\n\treturn patchIsSpliceRecordArray || isPatchRecordArray(patchValue)\n\t\t? patch(\n\t\t\t\tpatchIsSpliceRecordArray\n\t\t\t\t\t? isArray(targetValue) ? targetValue : []\n\t\t\t\t\t: isPlainObject(targetValue) ? targetValue : objectCreate(null),\n\t\t\t\tpatchValue\n\t\t\t)\n\t\t: patchValue;\n}\n\n/**\n * Compares two plain objects or arrays and return a set of records which describe the differences between the two\n *\n * The records describe what would need to be applied to the second argument to make it look like the first argument\n *\n * @param a The plain object or array to compare with\n * @param b The plain object or array to compare to\n * @param options An options bag that allows configuration of the behaviour of `diff()`\n */\nexport function diff(a: any, b: any, options: DiffOptions = {}): (ConstructRecord | PatchRecord | SpliceRecord)[] {\n\tif (typeof a !== 'object' || typeof b !== 'object') {\n\t\tthrow new TypeError('Arguments are not of type object.');\n\t}\n\n\tif (isArray(a)) {\n\t\treturn diffArray(a, b, options);\n\t}\n\n\tif (isArray(b)) {\n\t\tb = objectCreate(null);\n\t}\n\n\tif (!isPlainObject(a) || !isPlainObject(b)) {\n\t\tthrow new TypeError('Arguments are not plain Objects or Arrays.');\n\t}\n\n\treturn diffPlainObject(a, b, options);\n}\n\n/**\n * Apply a set of patch records to a target.\n *\n * @param target The plain object or array that the patch records should be applied to\n * @param records A set of patch records to be applied to the target\n */\nexport function patch(target: any, records: (ConstructRecord | PatchRecord | SpliceRecord)[]): any {\n\tif (!isArray(target) && !isPlainObject(target)) {\n\t\tthrow new TypeError('A target for a patch must be either an array or a plain object.');\n\t}\n\tif (isFrozen(target) || isSealed(target)) {\n\t\tthrow new TypeError('Cannot patch sealed or frozen objects.');\n\t}\n\n\trecords.forEach((record) => {\n\t\ttarget = isSpliceRecord(record)\n\t\t\t? patchSplice(isArray(target) ? target : [], record) /* patch arrays */\n\t\t\t: isConstructRecord(record)\n\t\t\t\t? patchConstruct(target, record) /* patch complex object */\n\t\t\t\t: patchPatch(isPlainObject(target) ? target : {}, record); /* patch plain object */\n\t});\n\treturn target;\n}\n"]} \ No newline at end of file diff --git a/deps/framework/core/compare.mjs b/deps/framework/core/compare.mjs deleted file mode 100644 index 309756f1cd..0000000000 --- a/deps/framework/core/compare.mjs +++ /dev/null @@ -1,480 +0,0 @@ -import { assign } from '../shim/object'; -import { keys } from '../shim/object'; -import Set from '../shim/Set'; -/* Assigning to local variables to improve minification and readability */ -const objectCreate = Object.create; -const hasOwnProperty = Object.prototype.hasOwnProperty; -const defineProperty = Object.defineProperty; -const isArray = Array.isArray; -const isFrozen = Object.isFrozen; -const isSealed = Object.isSealed; -/** - * A record that describes how to instantiate a new object via a constructor function - * @param Ctor The constructor function - * @param args Any arguments to be passed to the constructor function - */ -/* tslint:disable:variable-name */ -export function createConstructRecord(Ctor, args, descriptor) { - const record = assign(objectCreate(null), { Ctor }); - if (args) { - record.args = args; - } - if (descriptor) { - record.descriptor = descriptor; - } - return record; -} -/* tslint:enable:variable-name */ -/** - * An internal function that returns a new patch record - * - * @param type The type of patch record - * @param name The property name the record refers to - * @param descriptor The property descriptor to be installed on the object - * @param valueRecords Any subsequenet patch recrds to be applied to the value of the descriptor - */ -function createPatchRecord(type, name, descriptor, valueRecords) { - const patchRecord = assign(objectCreate(null), { - type, - name - }); - if (descriptor) { - patchRecord.descriptor = descriptor; - } - if (valueRecords) { - patchRecord.valueRecords = valueRecords; - } - return patchRecord; -} -/** - * An internal function that returns a new splice record - * - * @param start Where in the array to start the splice - * @param deleteCount The number of elements to delete from the array - * @param add Elements to be added to the target - */ -function createSpliceRecord(start, deleteCount, add) { - const spliceRecord = assign(objectCreate(null), { - type: 'splice', - start, - deleteCount - }); - if (add && add.length) { - spliceRecord.add = add; - } - return spliceRecord; -} -/** - * A function that produces a value property descriptor, which assumes that properties are enumerable, writable and configurable - * unless specified - * - * @param value The value for the descriptor - * @param writable Defaults to `true` if not specified - * @param enumerable Defaults to `true` if not specified - * @param configurable Defaults to `true` if not specified - */ -function createValuePropertyDescriptor(value, writable = true, enumerable = true, configurable = true) { - return assign(objectCreate(null), { - value, - writable, - enumerable, - configurable - }); -} -/** - * A class which is used when making a custom comparison of a non-plain object or array - */ -export class CustomDiff { - constructor(diff) { - this._differ = diff; - } - /** - * Get the difference of the `value` - * @param value The value to diff - * @param nameOrIndex A `string` if comparing a property or a `number` if comparing an array element - * @param parent The outer parent that this value is part of - */ - diff(value, nameOrIndex, parent) { - const record = this._differ(value, nameOrIndex, parent); - if (record && typeof nameOrIndex === 'string') { - return assign(record, { name: nameOrIndex }); - } - } -} -/** - * Internal function that detects the differences between an array and another value and returns a set of splice records that - * describe the differences - * - * @param a The first array to compare to - * @param b The second value to compare to - * @param options An options bag that allows configuration of the behaviour of `diffArray()` - */ -function diffArray(a, b, options) { - /* This function takes an overly simplistic approach to calculating splice records. There are many situations where - * in complicated array mutations, the splice records can be more optimised. - * - * TODO: Raise an issue for this when it is finally merged and put into core - */ - const { allowFunctionValues = false } = options; - const arrayA = a; - const lengthA = arrayA.length; - const arrayB = isArray(b) ? b : []; - const lengthB = arrayB.length; - const patchRecords = []; - if (!lengthA && lengthB) { - /* empty array */ - patchRecords.push(createSpliceRecord(0, lengthB)); - return patchRecords; - } - let add = []; - let start = 0; - let deleteCount = 0; - let last = -1; - function flushSpliceRecord() { - if (deleteCount || add.length) { - patchRecords.push(createSpliceRecord(start, start + deleteCount > lengthB ? lengthB - start : deleteCount, add)); - } - } - function addDifference(index, adding, value) { - if (index > last + 1) { - /* flush the splice */ - flushSpliceRecord(); - start = index; - deleteCount = 0; - if (add.length) { - add = []; - } - } - if (adding) { - add.push(value); - } - deleteCount++; - last = index; - } - arrayA.forEach((valueA, index) => { - const valueB = arrayB[index]; - if (index in arrayB && - (valueA === valueB || (allowFunctionValues && typeof valueA === 'function' && typeof valueB === 'function'))) { - return; /* not different */ - } - const isValueAArray = isArray(valueA); - const isValueAPlainObject = isPlainObject(valueA); - if (isValueAArray || isValueAPlainObject) { - const value = isValueAArray - ? isArray(valueB) ? valueB : [] - : isPlainObject(valueB) ? valueB : Object.create(null); - const valueRecords = diff(valueA, value, options); - if (valueRecords.length) { - /* only add if there are changes */ - addDifference(index, true, diff(valueA, value, options)); - } - } - else if (isPrimitive(valueA)) { - addDifference(index, true, valueA); - } - else if (allowFunctionValues && typeof valueA === 'function') { - addDifference(index, true, valueA); - } - else { - throw new TypeError(`Value of array element "${index}" from first argument is not a primative, plain Object, or Array.`); - } - }); - if (lengthB > lengthA) { - for (let index = lengthA; index < lengthB; index++) { - addDifference(index, false); - } - } - /* flush any deletes */ - flushSpliceRecord(); - return patchRecords; -} -/** - * Internal function that detects the differences between plain objects and returns a set of patch records that - * describe the differences - * - * @param a The first plain object to compare to - * @param b The second plain bject to compare to - * @param options An options bag that allows configuration of the behaviour of `diffPlainObject()` - */ -function diffPlainObject(a, b, options) { - const { allowFunctionValues = false, ignorePropertyValues = [] } = options; - const patchRecords = []; - const { comparableA, comparableB } = getComparableObjects(a, b, options); - /* look for keys in a that are different from b */ - keys(comparableA).reduce((patchRecords, name) => { - const valueA = a[name]; - const valueB = b[name]; - const bHasOwnProperty = hasOwnProperty.call(comparableB, name); - if (bHasOwnProperty && - (valueA === valueB || (allowFunctionValues && typeof valueA === 'function' && typeof valueB === 'function'))) { - /* not different */ - /* when `allowFunctionValues` is true, functions are simply considered to be equal by `typeof` */ - return patchRecords; - } - const type = bHasOwnProperty ? 'update' : 'add'; - const isValueAArray = isArray(valueA); - const isValueAPlainObject = isPlainObject(valueA); - if (isValueAArray || isValueAPlainObject) { - /* non-primitive values we can diff */ - /* this is a bit complicated, but essentially if valueA and valueB are both arrays or plain objects, then - * we can diff those two values, if not, then we need to use an empty array or an empty object and diff - * the valueA with that */ - const value = (isValueAArray && isArray(valueB)) || (isValueAPlainObject && isPlainObject(valueB)) - ? valueB - : isValueAArray ? [] : objectCreate(null); - const valueRecords = diff(valueA, value, options); - if (valueRecords.length) { - /* only add if there are changes */ - patchRecords.push(createPatchRecord(type, name, createValuePropertyDescriptor(value), diff(valueA, value, options))); - } - } - else if (isCustomDiff(valueA) && !isCustomDiff(valueB)) { - /* complex diff left hand */ - const result = valueA.diff(valueB, name, b); - if (result) { - patchRecords.push(result); - } - } - else if (isCustomDiff(valueB)) { - /* complex diff right hand */ - const result = valueB.diff(valueA, name, a); - if (result) { - patchRecords.push(result); - } - } - else if (isPrimitive(valueA) || - (allowFunctionValues && typeof valueA === 'function') || - isIgnoredPropertyValue(name, a, b, ignorePropertyValues)) { - /* primitive values, functions values if allowed, or ignored property values can just be copied */ - patchRecords.push(createPatchRecord(type, name, createValuePropertyDescriptor(valueA))); - } - else { - throw new TypeError(`Value of property named "${name}" from first argument is not a primative, plain Object, or Array.`); - } - return patchRecords; - }, patchRecords); - /* look for keys in b that are not in a */ - keys(comparableB).reduce((patchRecords, name) => { - if (!hasOwnProperty.call(comparableA, name)) { - patchRecords.push(createPatchRecord('delete', name)); - } - return patchRecords; - }, patchRecords); - return patchRecords; -} -/** - * Takes two plain objects to be compared, as well as options customizing the behavior of the comparison, and returns - * two new objects that contain only those properties that should be compared. If a property is ignored - * it will not be included in either returned object. If a property's value should be ignored it will be excluded - * if it is present in both objects. - * @param a The first object to compare - * @param b The second object to compare - * @param options An options bag indicating which properties should be ignored or have their values ignored, if any. - */ -export function getComparableObjects(a, b, options) { - const { ignoreProperties = [], ignorePropertyValues = [] } = options; - const ignore = new Set(); - const keep = new Set(); - const isIgnoredProperty = Array.isArray(ignoreProperties) - ? (name) => { - return ignoreProperties.some((value) => (typeof value === 'string' ? name === value : value.test(name))); - } - : (name) => ignoreProperties(name, a, b); - const comparableA = keys(a).reduce((obj, name) => { - if (isIgnoredProperty(name) || - (hasOwnProperty.call(b, name) && isIgnoredPropertyValue(name, a, b, ignorePropertyValues))) { - ignore.add(name); - return obj; - } - keep.add(name); - obj[name] = a[name]; - return obj; - }, {}); - const comparableB = keys(b).reduce((obj, name) => { - if (ignore.has(name) || (!keep.has(name) && isIgnoredProperty(name))) { - return obj; - } - obj[name] = b[name]; - return obj; - }, {}); - return { comparableA, comparableB, ignore }; -} -/** - * A guard that determines if the value is a `ConstructRecord` - * @param value The value to check - */ -function isConstructRecord(value) { - return Boolean(value && typeof value === 'object' && value !== null && value.Ctor && value.name); -} -function isIgnoredPropertyValue(name, a, b, ignoredPropertyValues) { - return Array.isArray(ignoredPropertyValues) - ? ignoredPropertyValues.some((value) => { - return typeof value === 'string' ? name === value : value.test(name); - }) - : ignoredPropertyValues(name, a, b); -} -/** - * A guard that determines if the value is a `PatchRecord` - * - * @param value The value to check - */ -function isPatchRecord(value) { - return Boolean(value && value.type && value.name); -} -/** - * A guard that determines if the value is an array of `PatchRecord`s - * - * @param value The value to check - */ -function isPatchRecordArray(value) { - return Boolean(isArray(value) && value.length && isPatchRecord(value[0])); -} -/** - * A guard that determines if the value is a plain object. A plain object is an object that has - * either no constructor (e.g. `Object.create(null)`) or has Object as its constructor. - * - * @param value The value to check - */ -function isPlainObject(value) { - return Boolean(value && typeof value === 'object' && (value.constructor === Object || value.constructor === undefined)); -} -/** - * A guard that determines if the value is a primitive (including `null`), as these values are - * fine to just copy. - * - * @param value The value to check - */ -function isPrimitive(value) { - const typeofValue = typeof value; - return (value === null || - typeofValue === 'undefined' || - typeofValue === 'string' || - typeofValue === 'number' || - typeofValue === 'boolean'); -} -/** - * A guard that determines if the value is a `CustomDiff` - * @param value The value to check - */ -function isCustomDiff(value) { - return typeof value === 'object' && value instanceof CustomDiff; -} -/** - * A guard that determines if the value is a `SpliceRecord` - * - * @param value The value to check - */ -function isSpliceRecord(value) { - return value && value.type === 'splice' && 'start' in value && 'deleteCount' in value; -} -/** - * A guard that determines if the value is an array of `SpliceRecord`s - * - * @param value The value to check - */ -function isSpliceRecordArray(value) { - return Boolean(isArray(value) && value.length && isSpliceRecord(value[0])); -} -/** - * An internal function that patches a target with a `SpliceRecord` - */ -function patchSplice(target, { add, deleteCount, start }) { - if (add && add.length) { - const deletedItems = deleteCount ? target.slice(start, start + deleteCount) : []; - add = add.map((value, index) => resolveTargetValue(value, deletedItems[index])); - target.splice(start, deleteCount, ...add); - } - else { - target.splice(start, deleteCount); - } - return target; -} -/** - * An internal function that patches a target with a `PatchRecord` - */ -function patchPatch(target, record) { - const { name } = record; - if (record.type === 'delete') { - delete target[name]; - return target; - } - const { descriptor, valueRecords } = record; - if (valueRecords && valueRecords.length) { - descriptor.value = patch(descriptor.value, valueRecords); - } - defineProperty(target, name, descriptor); - return target; -} -const defaultConstructDescriptor = { - configurable: true, - enumerable: true, - writable: true -}; -function patchConstruct(target, record) { - const { args, descriptor = defaultConstructDescriptor, Ctor, name, propertyRecords } = record; - const value = new Ctor(...(args || [])); - if (propertyRecords) { - propertyRecords.forEach((record) => (isConstructRecord(record) ? patchConstruct(value, record) : patchPatch(value, record))); - } - defineProperty(target, name, assign({ value }, descriptor)); - return target; -} -/** - * An internal function that takes a value from array being patched and the target value from the same - * index and determines the value that should actually be patched into the target array - */ -function resolveTargetValue(patchValue, targetValue) { - const patchIsSpliceRecordArray = isSpliceRecordArray(patchValue); - return patchIsSpliceRecordArray || isPatchRecordArray(patchValue) - ? patch(patchIsSpliceRecordArray - ? isArray(targetValue) ? targetValue : [] - : isPlainObject(targetValue) ? targetValue : objectCreate(null), patchValue) - : patchValue; -} -/** - * Compares two plain objects or arrays and return a set of records which describe the differences between the two - * - * The records describe what would need to be applied to the second argument to make it look like the first argument - * - * @param a The plain object or array to compare with - * @param b The plain object or array to compare to - * @param options An options bag that allows configuration of the behaviour of `diff()` - */ -export function diff(a, b, options = {}) { - if (typeof a !== 'object' || typeof b !== 'object') { - throw new TypeError('Arguments are not of type object.'); - } - if (isArray(a)) { - return diffArray(a, b, options); - } - if (isArray(b)) { - b = objectCreate(null); - } - if (!isPlainObject(a) || !isPlainObject(b)) { - throw new TypeError('Arguments are not plain Objects or Arrays.'); - } - return diffPlainObject(a, b, options); -} -/** - * Apply a set of patch records to a target. - * - * @param target The plain object or array that the patch records should be applied to - * @param records A set of patch records to be applied to the target - */ -export function patch(target, records) { - if (!isArray(target) && !isPlainObject(target)) { - throw new TypeError('A target for a patch must be either an array or a plain object.'); - } - if (isFrozen(target) || isSealed(target)) { - throw new TypeError('Cannot patch sealed or frozen objects.'); - } - records.forEach((record) => { - target = isSpliceRecord(record) - ? patchSplice(isArray(target) ? target : [], record) /* patch arrays */ - : isConstructRecord(record) - ? patchConstruct(target, record) /* patch complex object */ - : patchPatch(isPlainObject(target) ? target : {}, record); /* patch plain object */ - }); - return target; -} -//# sourceMappingURL=compare.mjs.map \ No newline at end of file diff --git a/deps/framework/core/compare.mjs.map b/deps/framework/core/compare.mjs.map deleted file mode 100644 index da503630d3..0000000000 --- a/deps/framework/core/compare.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"compare.mjs","sourceRoot":"","sources":["compare.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AACxC,OAAO,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;AACtC,OAAO,GAAG,MAAM,aAAa,CAAC;AAE9B,0EAA0E;AAE1E,MAAM,YAAY,GAAG,MAAM,CAAC,MAAM,CAAC;AACnC,MAAM,cAAc,GAAG,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC;AACvD,MAAM,cAAc,GAAG,MAAM,CAAC,cAAc,CAAC;AAC7C,MAAM,OAAO,GAAG,KAAK,CAAC,OAAO,CAAC;AAC9B,MAAM,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC;AACjC,MAAM,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC;AA8JjC;;;;GAIG;AACH,kCAAkC;AAClC,MAAM,gCACL,IAAiB,EACjB,IAAY,EACZ,UAAgC;IAEhC,MAAM,MAAM,GAA6B,MAAM,CAAC,YAAY,CAAC,IAAI,CAAC,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC;IAC9E,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC;QACV,MAAM,CAAC,IAAI,GAAG,IAAI,CAAC;IACpB,CAAC;IACD,EAAE,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC;QAChB,MAAM,CAAC,UAAU,GAAG,UAAU,CAAC;IAChC,CAAC;IACD,MAAM,CAAC,MAAM,CAAC;AACf,CAAC;AACD,iCAAiC;AAEjC;;;;;;;GAOG;AACH,2BACC,IAAgB,EAChB,IAAY,EACZ,UAA+B,EAC/B,YAA+D;IAE/D,MAAM,WAAW,GAAG,MAAM,CAAC,YAAY,CAAC,IAAI,CAAC,EAAE;QAC9C,IAAI;QACJ,IAAI;KACJ,CAAC,CAAC;IAEH,EAAE,CAAC,CAA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ED;;;;;GAKG;AACH,MAAM,gBAAgB,MAAW,EAAE,OAAyD;IAC3F,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;QAChD,MAAM,IAAI,SAAS,CAAC,iEAAiE,CAAC,CAAC;IACxF,CAAC;IACD,EAAE,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;QAC1C,MAAM,IAAI,SAAS,CAAC,wCAAwC,CAAC,CAAC;IAC/D,CAAC;IAED,OAAO,CAAC,OAAO,CAAC,CAAC,MAAM,EAAE,EAAE;QAC1B,MAAM,GAAG,cAAc,CAAC,MAAM,CAAC;YAC9B,CAAC,CAAC,WAAW,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,MAAM,CAAC,CAAC,kBAAkB;YACvE,CAAC,CAAC,iBAAiB,CAAC,MAAM,CAAC;gBAC1B,CAAC,CAAC,cAAc,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,0BAA0B;gBAC3D,CAAC,CAAC,UAAU,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,MAAM,CAAC,CAAC,CAAC,wBAAwB;IACtF,CAAC,CAAC,CAAC;IACH,MAAM,CAAC,MAAM,CAAC;AACf,CAAC","sourcesContent":["import { assign } from '../shim/object';\nimport { keys } from '../shim/object';\nimport Set from '../shim/Set';\n\n/* Assigning to local variables to improve minification and readability */\n\nconst objectCreate = Object.create;\nconst hasOwnProperty = Object.prototype.hasOwnProperty;\nconst defineProperty = Object.defineProperty;\nconst isArray = Array.isArray;\nconst isFrozen = Object.isFrozen;\nconst isSealed = Object.isSealed;\n\nexport type IgnorePropertyFunction = (name: string, a: any, b: any) => boolean;\n\nexport interface DiffOptions {\n\t/**\n\t * Allow functions to be values. Values will be considered equal if the `typeof` both values are `function`.\n\t * When adding or updating the property, the value of the property of `a` will be used in the record, which\n\t * will be a reference to the function.\n\t */\n\tallowFunctionValues?: boolean;\n\n\t/**\n\t * An array of strings or regular expressions which flag certain properties to be ignored. Alternatively\n\t * a function, which returns `true` to have the property ignored or `false` to diff the property.\n\t */\n\tignoreProperties?: (string | RegExp)[] | IgnorePropertyFunction;\n\n\t/**\n\t * An array of strings or regular expressions which flag certain values to be ignored. For flagged properties,\n\t * if the property is present in both `a` and `b` the value will be ignored. If adding the property,\n\t * whatever the value of the property of `a` will be used, which could be a reference.\n\t */\n\tignorePropertyValues?: (string | RegExp)[] | IgnorePropertyFunction;\n}\n\n/**\n * Interface for a generic constructor function\n */\nexport interface Constructor {\n\tnew (...args: any[]): object;\n\tprototype: object;\n}\n\n/**\n * A partial property descriptor that provides the property descriptor flags supported by the\n * complex property construction of `patch()`\n *\n * All properties are value properties, with the value being supplied by the `ConstructRecord`\n */\nexport interface ConstructDescriptor {\n\t/**\n\t * Is the property configurable?\n\t */\n\tconfigurable?: boolean;\n\n\t/**\n\t * Is the property enumerable?\n\t */\n\tenumerable?: boolean;\n\n\t/**\n\t * Is the property configurable?\n\t */\n\twritable?: boolean;\n}\n\n/**\n * A record that describes a constructor function and arguments necessary to create an instance of\n * an object\n */\nexport interface AnonymousConstructRecord {\n\t/**\n\t * Any arguments to pass to the constructor function\n\t */\n\targs?: any[];\n\n\t/**\n\t * The constructor function to use to create the instance\n\t */\n\tCtor: Constructor;\n\n\t/**\n\t * The partial descriptor that is used to set the value of the instance\n\t */\n\tdescriptor?: ConstructDescriptor;\n\n\t/**\n\t * Any patches to properties that need to occur on the instance\n\t */\n\tpropertyRecords?: (ConstructRecord | PatchRecord)[];\n}\n\nexport interface ConstructRecord extends AnonymousConstructRecord {\n\t/**\n\t * The name of the property on the Object\n\t */\n\tname: string;\n}\n\n/**\n * A record that describes the mutations necessary to a property of an object to make that property look\n * like another\n */\nexport type PatchRecord =\n\t| {\n\t\t\t/**\n\t\t\t * The name of the property on the Object\n\t\t\t */\n\t\t\tname: string;\n\n\t\t\t/**\n\t\t\t * The type of the patch\n\t\t\t */\n\t\t\ttype: 'delete';\n\t\t}\n\t| {\n\t\t\t/**\n\t\t\t * A property descriptor that describes the property in `name`\n\t\t\t */\n\t\t\tdescriptor: PropertyDescriptor;\n\n\t\t\t/**\n\t\t\t * The name of the property on the Object\n\t\t\t */\n\t\t\tname: string;\n\n\t\t\t/**\n\t\t\t * The type of the patch\n\t\t\t */\n\t\t\ttype: 'add' | 'update';\n\n\t\t\t/**\n\t\t\t * Additional patch records which describe the value of the property\n\t\t\t */\n\t\t\tvalueRecords?: (ConstructRecord | PatchRecord | SpliceRecord)[];\n\t\t};\n\n/**\n * The different types of patch records supported\n */\nexport type PatchTypes = 'add' | 'update' | 'delete';\n\n/**\n * A record that describes a splice operation to perform on an array to make the array look like another array\n */\nexport interface SpliceRecord {\n\t/**\n\t * Any items that are being added to the array\n\t */\n\tadd?: any[];\n\n\t/**\n\t * The number of items in the array to delete\n\t */\n\tdeleteCount: number;\n\n\t/**\n\t * The type, set to `splice`\n\t */\n\ttype: 'splice';\n\n\t/**\n\t * The index of where to start the splice\n\t */\n\tstart: number;\n}\n\n/**\n * A record that describes how to instantiate a new object via a constructor function\n * @param Ctor The constructor function\n * @param args Any arguments to be passed to the constructor function\n */\n/* tslint:disable:variable-name */\nexport function createConstructRecord(\n\tCtor: Constructor,\n\targs?: any[],\n\tdescriptor?: ConstructDescriptor\n): AnonymousConstructRecord {\n\tconst record: AnonymousConstructRecord = assign(objectCreate(null), { Ctor });\n\tif (args) {\n\t\trecord.args = args;\n\t}\n\tif (descriptor) {\n\t\trecord.descriptor = descriptor;\n\t}\n\treturn record;\n}\n/* tslint:enable:variable-name */\n\n/**\n * An internal function that returns a new patch record\n *\n * @param type The type of patch record\n * @param name The property name the record refers to\n * @param descriptor The property descriptor to be installed on the object\n * @param valueRecords Any subsequenet patch recrds to be applied to the value of the descriptor\n */\nfunction createPatchRecord(\n\ttype: PatchTypes,\n\tname: string,\n\tdescriptor?: PropertyDescriptor,\n\tvalueRecords?: (ConstructRecord | PatchRecord | SpliceRecord)[]\n): PatchRecord {\n\tconst patchRecord = assign(objectCreate(null), {\n\t\ttype,\n\t\tname\n\t});\n\n\tif (descriptor) {\n\t\tpatchRecord.descriptor = descriptor;\n\t}\n\tif (valueRecords) {\n\t\tpatchRecord.valueRecords = valueRecords;\n\t}\n\n\treturn patchRecord as PatchRecord;\n}\n\n/**\n * An internal function that returns a new splice record\n *\n * @param start Where in the array to start the splice\n * @param deleteCount The number of elements to delete from the array\n * @param add Elements to be added to the target\n */\nfunction createSpliceRecord(start: number, deleteCount: number, add?: any[]): SpliceRecord {\n\tconst spliceRecord: SpliceRecord = assign(objectCreate(null), {\n\t\ttype: 'splice',\n\t\tstart,\n\t\tdeleteCount\n\t});\n\n\tif (add && add.length) {\n\t\tspliceRecord.add = add;\n\t}\n\n\treturn spliceRecord;\n}\n\n/**\n * A function that produces a value property descriptor, which assumes that properties are enumerable, writable and configurable\n * unless specified\n *\n * @param value The value for the descriptor\n * @param writable Defaults to `true` if not specified\n * @param enumerable Defaults to `true` if not specified\n * @param configurable Defaults to `true` if not specified\n */\nfunction createValuePropertyDescriptor(\n\tvalue: any,\n\twritable: boolean = true,\n\tenumerable: boolean = true,\n\tconfigurable: boolean = true\n): PropertyDescriptor {\n\treturn assign(objectCreate(null), {\n\t\tvalue,\n\t\twritable,\n\t\tenumerable,\n\t\tconfigurable\n\t});\n}\n\n/**\n * A function that returns a constructor record or `undefined` when diffing a value\n */\nexport type CustomDiffFunction = (\n\tvalue: T,\n\tnameOrIndex: string | number,\n\tparent: object\n) => AnonymousConstructRecord | void;\n\n/**\n * A class which is used when making a custom comparison of a non-plain object or array\n */\nexport class CustomDiff {\n\tprivate _differ: CustomDiffFunction;\n\n\tconstructor(diff: CustomDiffFunction) {\n\t\tthis._differ = diff;\n\t}\n\n\t/**\n\t * Get the difference of the `value`\n\t * @param value The value to diff\n\t * @param nameOrIndex A `string` if comparing a property or a `number` if comparing an array element\n\t * @param parent The outer parent that this value is part of\n\t */\n\tdiff(value: T, nameOrIndex: string | number, parent: object): ConstructRecord | void {\n\t\tconst record = this._differ(value, nameOrIndex, parent);\n\t\tif (record && typeof nameOrIndex === 'string') {\n\t\t\treturn assign(record, { name: nameOrIndex });\n\t\t}\n\t}\n}\n\n/**\n * Internal function that detects the differences between an array and another value and returns a set of splice records that\n * describe the differences\n *\n * @param a The first array to compare to\n * @param b The second value to compare to\n * @param options An options bag that allows configuration of the behaviour of `diffArray()`\n */\nfunction diffArray(a: any[], b: any, options: DiffOptions): SpliceRecord[] {\n\t/* This function takes an overly simplistic approach to calculating splice records. There are many situations where\n\t * in complicated array mutations, the splice records can be more optimised.\n\t *\n\t * TODO: Raise an issue for this when it is finally merged and put into core\n\t */\n\n\tconst { allowFunctionValues = false } = options;\n\n\tconst arrayA = a;\n\tconst lengthA = arrayA.length;\n\tconst arrayB = isArray(b) ? b : [];\n\tconst lengthB = arrayB.length;\n\tconst patchRecords: SpliceRecord[] = [];\n\n\tif (!lengthA && lengthB) {\n\t\t/* empty array */\n\t\tpatchRecords.push(createSpliceRecord(0, lengthB));\n\t\treturn patchRecords;\n\t}\n\n\tlet add: any[] = [];\n\tlet start = 0;\n\tlet deleteCount = 0;\n\tlet last = -1;\n\n\tfunction flushSpliceRecord() {\n\t\tif (deleteCount || add.length) {\n\t\t\tpatchRecords.push(\n\t\t\t\tcreateSpliceRecord(start, start + deleteCount > lengthB ? lengthB - start : deleteCount, add)\n\t\t\t);\n\t\t}\n\t}\n\n\tfunction addDifference(index: number, adding: boolean, value?: any) {\n\t\tif (index > last + 1) {\n\t\t\t/* flush the splice */\n\t\t\tflushSpliceRecord();\n\t\t\tstart = index;\n\t\t\tdeleteCount = 0;\n\t\t\tif (add.length) {\n\t\t\t\tadd = [];\n\t\t\t}\n\t\t}\n\n\t\tif (adding) {\n\t\t\tadd.push(value);\n\t\t}\n\t\tdeleteCount++;\n\t\tlast = index;\n\t}\n\n\tarrayA.forEach((valueA, index) => {\n\t\tconst valueB = arrayB[index];\n\n\t\tif (\n\t\t\tindex in arrayB &&\n\t\t\t(valueA === valueB || (allowFunctionValues && typeof valueA === 'function' && typeof valueB === 'function'))\n\t\t) {\n\t\t\treturn; /* not different */\n\t\t}\n\n\t\tconst isValueAArray = isArray(valueA);\n\t\tconst isValueAPlainObject = isPlainObject(valueA);\n\n\t\tif (isValueAArray || isValueAPlainObject) {\n\t\t\tconst value = isValueAArray\n\t\t\t\t? isArray(valueB) ? valueB : []\n\t\t\t\t: isPlainObject(valueB) ? valueB : Object.create(null);\n\t\t\tconst valueRecords = diff(valueA, value, options);\n\t\t\tif (valueRecords.length) {\n\t\t\t\t/* only add if there are changes */\n\t\t\t\taddDifference(index, true, diff(valueA, value, options));\n\t\t\t}\n\t\t} else if (isPrimitive(valueA)) {\n\t\t\taddDifference(index, true, valueA);\n\t\t} else if (allowFunctionValues && typeof valueA === 'function') {\n\t\t\taddDifference(index, true, valueA);\n\t\t} else {\n\t\t\tthrow new TypeError(\n\t\t\t\t`Value of array element \"${index}\" from first argument is not a primative, plain Object, or Array.`\n\t\t\t);\n\t\t}\n\t});\n\n\tif (lengthB > lengthA) {\n\t\tfor (let index = lengthA; index < lengthB; index++) {\n\t\t\taddDifference(index, false);\n\t\t}\n\t}\n\n\t/* flush any deletes */\n\tflushSpliceRecord();\n\n\treturn patchRecords;\n}\n\n/**\n * Internal function that detects the differences between plain objects and returns a set of patch records that\n * describe the differences\n *\n * @param a The first plain object to compare to\n * @param b The second plain bject to compare to\n * @param options An options bag that allows configuration of the behaviour of `diffPlainObject()`\n */\nfunction diffPlainObject(a: any, b: any, options: DiffOptions): (ConstructRecord | PatchRecord)[] {\n\tconst { allowFunctionValues = false, ignorePropertyValues = [] } = options;\n\tconst patchRecords: (ConstructRecord | PatchRecord)[] = [];\n\tconst { comparableA, comparableB } = getComparableObjects(a, b, options);\n\n\t/* look for keys in a that are different from b */\n\tkeys(comparableA).reduce((patchRecords, name) => {\n\t\tconst valueA = a[name];\n\t\tconst valueB = b[name];\n\t\tconst bHasOwnProperty = hasOwnProperty.call(comparableB, name);\n\n\t\tif (\n\t\t\tbHasOwnProperty &&\n\t\t\t(valueA === valueB || (allowFunctionValues && typeof valueA === 'function' && typeof valueB === 'function'))\n\t\t) {\n\t\t\t/* not different */\n\t\t\t/* when `allowFunctionValues` is true, functions are simply considered to be equal by `typeof` */\n\t\t\treturn patchRecords;\n\t\t}\n\n\t\tconst type = bHasOwnProperty ? 'update' : 'add';\n\n\t\tconst isValueAArray = isArray(valueA);\n\t\tconst isValueAPlainObject = isPlainObject(valueA);\n\n\t\tif (isValueAArray || isValueAPlainObject) {\n\t\t\t/* non-primitive values we can diff */\n\t\t\t/* this is a bit complicated, but essentially if valueA and valueB are both arrays or plain objects, then\n\t\t\t* we can diff those two values, if not, then we need to use an empty array or an empty object and diff\n\t\t\t* the valueA with that */\n\t\t\tconst value =\n\t\t\t\t(isValueAArray && isArray(valueB)) || (isValueAPlainObject && isPlainObject(valueB))\n\t\t\t\t\t? valueB\n\t\t\t\t\t: isValueAArray ? [] : objectCreate(null);\n\t\t\tconst valueRecords = diff(valueA, value, options);\n\t\t\tif (valueRecords.length) {\n\t\t\t\t/* only add if there are changes */\n\t\t\t\tpatchRecords.push(\n\t\t\t\t\tcreatePatchRecord(type, name, createValuePropertyDescriptor(value), diff(valueA, value, options))\n\t\t\t\t);\n\t\t\t}\n\t\t} else if (isCustomDiff(valueA) && !isCustomDiff(valueB)) {\n\t\t\t/* complex diff left hand */\n\t\t\tconst result = valueA.diff(valueB, name, b);\n\t\t\tif (result) {\n\t\t\t\tpatchRecords.push(result);\n\t\t\t}\n\t\t} else if (isCustomDiff(valueB)) {\n\t\t\t/* complex diff right hand */\n\t\t\tconst result = valueB.diff(valueA, name, a);\n\t\t\tif (result) {\n\t\t\t\tpatchRecords.push(result);\n\t\t\t}\n\t\t} else if (\n\t\t\tisPrimitive(valueA) ||\n\t\t\t(allowFunctionValues && typeof valueA === 'function') ||\n\t\t\tisIgnoredPropertyValue(name, a, b, ignorePropertyValues)\n\t\t) {\n\t\t\t/* primitive values, functions values if allowed, or ignored property values can just be copied */\n\t\t\tpatchRecords.push(createPatchRecord(type, name, createValuePropertyDescriptor(valueA)));\n\t\t} else {\n\t\t\tthrow new TypeError(\n\t\t\t\t`Value of property named \"${name}\" from first argument is not a primative, plain Object, or Array.`\n\t\t\t);\n\t\t}\n\t\treturn patchRecords;\n\t}, patchRecords);\n\n\t/* look for keys in b that are not in a */\n\tkeys(comparableB).reduce((patchRecords, name) => {\n\t\tif (!hasOwnProperty.call(comparableA, name)) {\n\t\t\tpatchRecords.push(createPatchRecord('delete', name));\n\t\t}\n\t\treturn patchRecords;\n\t}, patchRecords);\n\n\treturn patchRecords;\n}\n\n/**\n * Takes two plain objects to be compared, as well as options customizing the behavior of the comparison, and returns\n * two new objects that contain only those properties that should be compared. If a property is ignored\n * it will not be included in either returned object. If a property's value should be ignored it will be excluded\n * if it is present in both objects.\n * @param a The first object to compare\n * @param b The second object to compare\n * @param options An options bag indicating which properties should be ignored or have their values ignored, if any.\n */\nexport function getComparableObjects(a: any, b: any, options: DiffOptions) {\n\tconst { ignoreProperties = [], ignorePropertyValues = [] } = options;\n\tconst ignore = new Set();\n\tconst keep = new Set();\n\n\tconst isIgnoredProperty = Array.isArray(ignoreProperties)\n\t\t? (name: string) => {\n\t\t\t\treturn ignoreProperties.some(\n\t\t\t\t\t(value) => (typeof value === 'string' ? name === value : value.test(name))\n\t\t\t\t);\n\t\t\t}\n\t\t: (name: string) => ignoreProperties(name, a, b);\n\n\tconst comparableA = keys(a).reduce(\n\t\t(obj, name) => {\n\t\t\tif (\n\t\t\t\tisIgnoredProperty(name) ||\n\t\t\t\t(hasOwnProperty.call(b, name) && isIgnoredPropertyValue(name, a, b, ignorePropertyValues))\n\t\t\t) {\n\t\t\t\tignore.add(name);\n\t\t\t\treturn obj;\n\t\t\t}\n\n\t\t\tkeep.add(name);\n\t\t\tobj[name] = a[name];\n\t\t\treturn obj;\n\t\t},\n\t\t{} as { [key: string]: any }\n\t);\n\n\tconst comparableB = keys(b).reduce(\n\t\t(obj, name) => {\n\t\t\tif (ignore.has(name) || (!keep.has(name) && isIgnoredProperty(name))) {\n\t\t\t\treturn obj;\n\t\t\t}\n\n\t\t\tobj[name] = b[name];\n\t\t\treturn obj;\n\t\t},\n\t\t{} as { [key: string]: any }\n\t);\n\n\treturn { comparableA, comparableB, ignore };\n}\n\n/**\n * A guard that determines if the value is a `ConstructRecord`\n * @param value The value to check\n */\nfunction isConstructRecord(value: any): value is ConstructRecord {\n\treturn Boolean(value && typeof value === 'object' && value !== null && value.Ctor && value.name);\n}\n\nfunction isIgnoredPropertyValue(\n\tname: string,\n\ta: any,\n\tb: any,\n\tignoredPropertyValues: (string | RegExp)[] | IgnorePropertyFunction\n) {\n\treturn Array.isArray(ignoredPropertyValues)\n\t\t? ignoredPropertyValues.some((value) => {\n\t\t\t\treturn typeof value === 'string' ? name === value : value.test(name);\n\t\t\t})\n\t\t: ignoredPropertyValues(name, a, b);\n}\n\n/**\n * A guard that determines if the value is a `PatchRecord`\n *\n * @param value The value to check\n */\nfunction isPatchRecord(value: any): value is PatchRecord {\n\treturn Boolean(value && value.type && value.name);\n}\n\n/**\n * A guard that determines if the value is an array of `PatchRecord`s\n *\n * @param value The value to check\n */\nfunction isPatchRecordArray(value: any): value is PatchRecord[] {\n\treturn Boolean(isArray(value) && value.length && isPatchRecord(value[0]));\n}\n\n/**\n * A guard that determines if the value is a plain object. A plain object is an object that has\n * either no constructor (e.g. `Object.create(null)`) or has Object as its constructor.\n *\n * @param value The value to check\n */\nfunction isPlainObject(value: any): value is Object {\n\treturn Boolean(\n\t\tvalue && typeof value === 'object' && (value.constructor === Object || value.constructor === undefined)\n\t);\n}\n\n/**\n * A guard that determines if the value is a primitive (including `null`), as these values are\n * fine to just copy.\n *\n * @param value The value to check\n */\nfunction isPrimitive(value: any): value is string | number | boolean | undefined | null {\n\tconst typeofValue = typeof value;\n\treturn (\n\t\tvalue === null ||\n\t\ttypeofValue === 'undefined' ||\n\t\ttypeofValue === 'string' ||\n\t\ttypeofValue === 'number' ||\n\t\ttypeofValue === 'boolean'\n\t);\n}\n\n/**\n * A guard that determines if the value is a `CustomDiff`\n * @param value The value to check\n */\nfunction isCustomDiff(value: any): value is CustomDiff {\n\treturn typeof value === 'object' && value instanceof CustomDiff;\n}\n\n/**\n * A guard that determines if the value is a `SpliceRecord`\n *\n * @param value The value to check\n */\nfunction isSpliceRecord(value: any): value is SpliceRecord {\n\treturn value && value.type === 'splice' && 'start' in value && 'deleteCount' in value;\n}\n\n/**\n * A guard that determines if the value is an array of `SpliceRecord`s\n *\n * @param value The value to check\n */\nfunction isSpliceRecordArray(value: any): value is SpliceRecord[] {\n\treturn Boolean(isArray(value) && value.length && isSpliceRecord(value[0]));\n}\n\n/**\n * An internal function that patches a target with a `SpliceRecord`\n */\nfunction patchSplice(target: any[], { add, deleteCount, start }: SpliceRecord): any {\n\tif (add && add.length) {\n\t\tconst deletedItems = deleteCount ? target.slice(start, start + deleteCount) : [];\n\t\tadd = add.map((value, index) => resolveTargetValue(value, deletedItems[index]));\n\t\ttarget.splice(start, deleteCount, ...add);\n\t} else {\n\t\ttarget.splice(start, deleteCount);\n\t}\n\treturn target;\n}\n\n/**\n * An internal function that patches a target with a `PatchRecord`\n */\nfunction patchPatch(target: any, record: PatchRecord): any {\n\tconst { name } = record;\n\tif (record.type === 'delete') {\n\t\tdelete target[name];\n\t\treturn target;\n\t}\n\tconst { descriptor, valueRecords } = record;\n\tif (valueRecords && valueRecords.length) {\n\t\tdescriptor.value = patch(descriptor.value, valueRecords);\n\t}\n\tdefineProperty(target, name, descriptor);\n\treturn target;\n}\n\nconst defaultConstructDescriptor = {\n\tconfigurable: true,\n\tenumerable: true,\n\twritable: true\n};\n\nfunction patchConstruct(target: any, record: ConstructRecord): any {\n\tconst { args, descriptor = defaultConstructDescriptor, Ctor, name, propertyRecords } = record;\n\tconst value = new Ctor(...(args || []));\n\tif (propertyRecords) {\n\t\tpropertyRecords.forEach(\n\t\t\t(record) => (isConstructRecord(record) ? patchConstruct(value, record) : patchPatch(value, record))\n\t\t);\n\t}\n\tdefineProperty(target, name, assign({ value }, descriptor));\n\treturn target;\n}\n\n/**\n * An internal function that takes a value from array being patched and the target value from the same\n * index and determines the value that should actually be patched into the target array\n */\nfunction resolveTargetValue(patchValue: any, targetValue: any): any {\n\tconst patchIsSpliceRecordArray = isSpliceRecordArray(patchValue);\n\treturn patchIsSpliceRecordArray || isPatchRecordArray(patchValue)\n\t\t? patch(\n\t\t\t\tpatchIsSpliceRecordArray\n\t\t\t\t\t? isArray(targetValue) ? targetValue : []\n\t\t\t\t\t: isPlainObject(targetValue) ? targetValue : objectCreate(null),\n\t\t\t\tpatchValue\n\t\t\t)\n\t\t: patchValue;\n}\n\n/**\n * Compares two plain objects or arrays and return a set of records which describe the differences between the two\n *\n * The records describe what would need to be applied to the second argument to make it look like the first argument\n *\n * @param a The plain object or array to compare with\n * @param b The plain object or array to compare to\n * @param options An options bag that allows configuration of the behaviour of `diff()`\n */\nexport function diff(a: any, b: any, options: DiffOptions = {}): (ConstructRecord | PatchRecord | SpliceRecord)[] {\n\tif (typeof a !== 'object' || typeof b !== 'object') {\n\t\tthrow new TypeError('Arguments are not of type object.');\n\t}\n\n\tif (isArray(a)) {\n\t\treturn diffArray(a, b, options);\n\t}\n\n\tif (isArray(b)) {\n\t\tb = objectCreate(null);\n\t}\n\n\tif (!isPlainObject(a) || !isPlainObject(b)) {\n\t\tthrow new TypeError('Arguments are not plain Objects or Arrays.');\n\t}\n\n\treturn diffPlainObject(a, b, options);\n}\n\n/**\n * Apply a set of patch records to a target.\n *\n * @param target The plain object or array that the patch records should be applied to\n * @param records A set of patch records to be applied to the target\n */\nexport function patch(target: any, records: (ConstructRecord | PatchRecord | SpliceRecord)[]): any {\n\tif (!isArray(target) && !isPlainObject(target)) {\n\t\tthrow new TypeError('A target for a patch must be either an array or a plain object.');\n\t}\n\tif (isFrozen(target) || isSealed(target)) {\n\t\tthrow new TypeError('Cannot patch sealed or frozen objects.');\n\t}\n\n\trecords.forEach((record) => {\n\t\ttarget = isSpliceRecord(record)\n\t\t\t? patchSplice(isArray(target) ? target : [], record) /* patch arrays */\n\t\t\t: isConstructRecord(record)\n\t\t\t\t? patchConstruct(target, record) /* patch complex object */\n\t\t\t\t: patchPatch(isPlainObject(target) ? target : {}, record); /* patch plain object */\n\t});\n\treturn target;\n}\n"]} \ No newline at end of file diff --git a/deps/framework/core/global.d.ts b/deps/framework/core/global.d.ts deleted file mode 100644 index 2ae5eaf5f0..0000000000 --- a/deps/framework/core/global.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import globalObject from '../shim/global'; -export default globalObject; diff --git a/deps/framework/core/global.js b/deps/framework/core/global.js deleted file mode 100644 index 4beb851902..0000000000 --- a/deps/framework/core/global.js +++ /dev/null @@ -1,21 +0,0 @@ -(function (factory) { - if (typeof module === "object" && typeof module.exports === "object") { - var v = factory(require, exports); - if (v !== undefined) module.exports = v; - } - else if (typeof define === "function" && define.amd) { - define(["require", "exports", "../shim/global", "./instrument"], factory); - } -})(function (require, exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - var global_1 = require("../shim/global"); - var instrument_1 = require("./instrument"); - instrument_1.deprecated({ - message: 'has been replaced with @dojo/framework/shim/global', - name: '@dojo/framework/core/global', - url: 'https://github.com/dojo/core/issues/302' - }); - exports.default = global_1.default; -}); -//# sourceMappingURL=global.js.map \ No newline at end of file diff --git a/deps/framework/core/global.js.map b/deps/framework/core/global.js.map deleted file mode 100644 index 6677575320..0000000000 --- a/deps/framework/core/global.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"global.js","sourceRoot":"","sources":["global.ts"],"names":[],"mappings":";;;;;;;;;;;IAAA,yCAA0C;IAC1C,2CAA0C;IAE1C,uBAAU,CAAC;QACV,OAAO,EAAE,oDAAoD;QAC7D,IAAI,EAAE,6BAA6B;QACnC,GAAG,EAAE,yCAAyC;KAC9C,CAAC,CAAC;IAEH,kBAAe,gBAAY,CAAC","sourcesContent":["import globalObject from '../shim/global';\nimport { deprecated } from './instrument';\n\ndeprecated({\n\tmessage: 'has been replaced with @dojo/framework/shim/global',\n\tname: '@dojo/framework/core/global',\n\turl: 'https://github.com/dojo/core/issues/302'\n});\n\nexport default globalObject;\n"]} \ No newline at end of file diff --git a/deps/framework/core/global.mjs b/deps/framework/core/global.mjs deleted file mode 100644 index 25e1239078..0000000000 --- a/deps/framework/core/global.mjs +++ /dev/null @@ -1,9 +0,0 @@ -import globalObject from '../shim/global'; -import { deprecated } from './instrument'; -deprecated({ - message: 'has been replaced with @dojo/framework/shim/global', - name: '@dojo/framework/core/global', - url: 'https://github.com/dojo/core/issues/302' -}); -export default globalObject; -//# sourceMappingURL=global.mjs.map \ No newline at end of file diff --git a/deps/framework/core/global.mjs.map b/deps/framework/core/global.mjs.map deleted file mode 100644 index b3e35302e1..0000000000 --- a/deps/framework/core/global.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"global.mjs","sourceRoot":"","sources":["global.ts"],"names":[],"mappings":"AAAA,OAAO,YAAY,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C,UAAU,CAAC;IACV,OAAO,EAAE,oDAAoD;IAC7D,IAAI,EAAE,6BAA6B;IACnC,GAAG,EAAE,yCAAyC;CAC9C,CAAC,CAAC;AAEH,eAAe,YAAY,CAAC","sourcesContent":["import globalObject from '../shim/global';\nimport { deprecated } from './instrument';\n\ndeprecated({\n\tmessage: 'has been replaced with @dojo/framework/shim/global',\n\tname: '@dojo/framework/core/global',\n\turl: 'https://github.com/dojo/core/issues/302'\n});\n\nexport default globalObject;\n"]} \ No newline at end of file diff --git a/deps/framework/core/has.d.ts b/deps/framework/core/has.d.ts deleted file mode 100644 index 332b7e46ed..0000000000 --- a/deps/framework/core/has.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import has from '../shim/support/has'; -export * from '../shim/support/has'; -export default has; diff --git a/deps/framework/core/has.js b/deps/framework/core/has.js deleted file mode 100644 index 6dc46becff..0000000000 --- a/deps/framework/core/has.js +++ /dev/null @@ -1,59 +0,0 @@ -(function (factory) { - if (typeof module === "object" && typeof module.exports === "object") { - var v = factory(require, exports); - if (v !== undefined) module.exports = v; - } - else if (typeof define === "function" && define.amd) { - define(["require", "exports", "tslib", "../shim/global", "../shim/support/has", "../shim/support/has"], factory); - } -})(function (require, exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - var tslib_1 = require("tslib"); - var global_1 = require("../shim/global"); - var has_1 = require("../shim/support/has"); - tslib_1.__exportStar(require("../shim/support/has"), exports); - exports.default = has_1.default; - has_1.add('object-assign', typeof global_1.default.Object.assign === 'function', true); - has_1.add('arraybuffer', typeof global_1.default.ArrayBuffer !== 'undefined', true); - has_1.add('formdata', typeof global_1.default.FormData !== 'undefined', true); - has_1.add('filereader', typeof global_1.default.FileReader !== 'undefined', true); - has_1.add('xhr', typeof global_1.default.XMLHttpRequest !== 'undefined', true); - has_1.add('xhr2', has_1.default('xhr') && 'responseType' in global_1.default.XMLHttpRequest.prototype, true); - has_1.add('blob', function () { - if (!has_1.default('xhr2')) { - return false; - } - var request = new global_1.default.XMLHttpRequest(); - request.open('GET', global_1.default.location.protocol + '//www.google.com', true); - request.responseType = 'blob'; - request.abort(); - return request.responseType === 'blob'; - }, true); - has_1.add('node-buffer', 'Buffer' in global_1.default && typeof global_1.default.Buffer === 'function', true); - has_1.add('fetch', 'fetch' in global_1.default && typeof global_1.default.fetch === 'function', true); - has_1.add('web-worker-xhr-upload', typeof global_1.default.Promise !== 'undefined' && - new Promise(function (resolve) { - try { - if (global_1.default.Worker !== undefined && global_1.default.URL && global_1.default.URL.createObjectURL) { - var blob = new Blob([ - "(function () {\nself.addEventListener('message', function () {\n\tvar xhr = new XMLHttpRequest();\n\ttry {\n\t\txhr.upload;\n\t\tpostMessage('true');\n\t} catch (e) {\n\t\tpostMessage('false');\n\t}\n});\n\t\t})()" - ], { type: 'application/javascript' }); - var worker = new Worker(URL.createObjectURL(blob)); - worker.addEventListener('message', function (_a) { - var result = _a.data; - resolve(result === 'true'); - }); - worker.postMessage({}); - } - else { - resolve(false); - } - } - catch (e) { - // IE11 on Winodws 8.1 encounters a security error. - resolve(false); - } - }), true); -}); -//# sourceMappingURL=has.js.map \ No newline at end of file diff --git a/deps/framework/core/has.js.map b/deps/framework/core/has.js.map deleted file mode 100644 index d3a9c592f0..0000000000 --- a/deps/framework/core/has.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"has.js","sourceRoot":"","sources":["has.ts"],"names":[],"mappings":";;;;;;;;;;;;IAAA,yCAAoC;IACpC,2CAA+C;IAE/C,8DAAoC;IACpC,kBAAe,aAAG,CAAC;IAEnB,SAAG,CAAC,eAAe,EAAE,OAAO,gBAAM,CAAC,MAAM,CAAC,MAAM,KAAK,UAAU,EAAE,IAAI,CAAC,CAAC;IAEvE,SAAG,CAAC,aAAa,EAAE,OAAO,gBAAM,CAAC,WAAW,KAAK,WAAW,EAAE,IAAI,CAAC,CAAC;IACpE,SAAG,CAAC,UAAU,EAAE,OAAO,gBAAM,CAAC,QAAQ,KAAK,WAAW,EAAE,IAAI,CAAC,CAAC;IAC9D,SAAG,CAAC,YAAY,EAAE,OAAO,gBAAM,CAAC,UAAU,KAAK,WAAW,EAAE,IAAI,CAAC,CAAC;IAClE,SAAG,CAAC,KAAK,EAAE,OAAO,gBAAM,CAAC,cAAc,KAAK,WAAW,EAAE,IAAI,CAAC,CAAC;IAC/D,SAAG,CAAC,MAAM,EAAE,aAAG,CAAC,KAAK,CAAC,IAAI,cAAc,IAAI,gBAAM,CAAC,cAAc,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC;IACnF,SAAG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4BAAd,gBAAY;wBACjD,OAAO,CAAC,MAAM,KAAK,MAAM,CAAC,CAAC;oBAC5B,CAAC,CAAC,CAAC;oBACH,MAAM,CAAC,WAAW,CAAC,EAAE,CAAC,CAAC;gBACxB,CAAC;gBAAC,IAAI,CAAC,CAAC;oBACP,OAAO,CAAC,KAAK,CAAC,CAAC;gBAChB,CAAC;YACF,CAAC;YAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;gBACZ,mDAAmD;gBACnD,OAAO,CAAC,KAAK,CAAC,CAAC;YAChB,CAAC;QACF,CAAC,CAAC,EACH,IAAI,CACJ,CAAC","sourcesContent":["import global from '../shim/global';\nimport has, { add } from '../shim/support/has';\n\nexport * from '../shim/support/has';\nexport default has;\n\nadd('object-assign', typeof global.Object.assign === 'function', true);\n\nadd('arraybuffer', typeof global.ArrayBuffer !== 'undefined', true);\nadd('formdata', typeof global.FormData !== 'undefined', true);\nadd('filereader', typeof global.FileReader !== 'undefined', true);\nadd('xhr', typeof global.XMLHttpRequest !== 'undefined', true);\nadd('xhr2', has('xhr') && 'responseType' in global.XMLHttpRequest.prototype, true);\nadd(\n\t'blob',\n\tfunction() {\n\t\tif (!has('xhr2')) {\n\t\t\treturn false;\n\t\t}\n\n\t\tconst request = new global.XMLHttpRequest();\n\t\trequest.open('GET', global.location.protocol + '//www.google.com', true);\n\t\trequest.responseType = 'blob';\n\t\trequest.abort();\n\t\treturn request.responseType === 'blob';\n\t},\n\ttrue\n);\n\nadd('node-buffer', 'Buffer' in global && typeof global.Buffer === 'function', true);\n\nadd('fetch', 'fetch' in global && typeof global.fetch === 'function', true);\n\nadd(\n\t'web-worker-xhr-upload',\n\ttypeof global.Promise !== 'undefined' &&\n\t\tnew Promise((resolve) => {\n\t\t\ttry {\n\t\t\t\tif (global.Worker !== undefined && global.URL && global.URL.createObjectURL) {\n\t\t\t\t\tconst blob = new Blob(\n\t\t\t\t\t\t[\n\t\t\t\t\t\t\t`(function () {\nself.addEventListener('message', function () {\n\tvar xhr = new XMLHttpRequest();\n\ttry {\n\t\txhr.upload;\n\t\tpostMessage('true');\n\t} catch (e) {\n\t\tpostMessage('false');\n\t}\n});\n\t\t})()`\n\t\t\t\t\t\t],\n\t\t\t\t\t\t{ type: 'application/javascript' }\n\t\t\t\t\t);\n\t\t\t\t\tconst worker = new Worker(URL.createObjectURL(blob));\n\t\t\t\t\tworker.addEventListener('message', ({ data: result }) => {\n\t\t\t\t\t\tresolve(result === 'true');\n\t\t\t\t\t});\n\t\t\t\t\tworker.postMessage({});\n\t\t\t\t} else {\n\t\t\t\t\tresolve(false);\n\t\t\t\t}\n\t\t\t} catch (e) {\n\t\t\t\t// IE11 on Winodws 8.1 encounters a security error.\n\t\t\t\tresolve(false);\n\t\t\t}\n\t\t}),\n\ttrue\n);\n"]} \ No newline at end of file diff --git a/deps/framework/core/has.mjs b/deps/framework/core/has.mjs deleted file mode 100644 index 4fac03d2fd..0000000000 --- a/deps/framework/core/has.mjs +++ /dev/null @@ -1,55 +0,0 @@ -import global from '../shim/global'; -import has, { add } from '../shim/support/has'; -export * from '../shim/support/has'; -export default has; -add('object-assign', typeof global.Object.assign === 'function', true); -add('arraybuffer', typeof global.ArrayBuffer !== 'undefined', true); -add('formdata', typeof global.FormData !== 'undefined', true); -add('filereader', typeof global.FileReader !== 'undefined', true); -add('xhr', typeof global.XMLHttpRequest !== 'undefined', true); -add('xhr2', has('xhr') && 'responseType' in global.XMLHttpRequest.prototype, true); -add('blob', function () { - if (!has('xhr2')) { - return false; - } - const request = new global.XMLHttpRequest(); - request.open('GET', global.location.protocol + '//www.google.com', true); - request.responseType = 'blob'; - request.abort(); - return request.responseType === 'blob'; -}, true); -add('node-buffer', 'Buffer' in global && typeof global.Buffer === 'function', true); -add('fetch', 'fetch' in global && typeof global.fetch === 'function', true); -add('web-worker-xhr-upload', typeof global.Promise !== 'undefined' && - new Promise((resolve) => { - try { - if (global.Worker !== undefined && global.URL && global.URL.createObjectURL) { - const blob = new Blob([ - `(function () { -self.addEventListener('message', function () { - var xhr = new XMLHttpRequest(); - try { - xhr.upload; - postMessage('true'); - } catch (e) { - postMessage('false'); - } -}); - })()` - ], { type: 'application/javascript' }); - const worker = new Worker(URL.createObjectURL(blob)); - worker.addEventListener('message', ({ data: result }) => { - resolve(result === 'true'); - }); - worker.postMessage({}); - } - else { - resolve(false); - } - } - catch (e) { - // IE11 on Winodws 8.1 encounters a security error. - resolve(false); - } - }), true); -//# sourceMappingURL=has.mjs.map \ No newline at end of file diff --git a/deps/framework/core/has.mjs.map b/deps/framework/core/has.mjs.map deleted file mode 100644 index 15c9cb536a..0000000000 --- a/deps/framework/core/has.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"has.mjs","sourceRoot":"","sources":["has.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,gBAAgB,CAAC;AACpC,OAAO,GAAG,EAAE,EAAE,GAAG,EAAE,MAAM,qBAAqB,CAAC;AAE/C,cAAc,qBAAqB,CAAC;AACpC,eAAe,GAAG,CAAC;AAEnB,GAAG,CAAC,eAAe,EAAE,OAAO,MAAM,CAAC,MAAM,CAAC,MAAM,KAAK,UAAU,EAAE,IAAI,CAAC,CAAC;AAEvE,GAAG,CAAC,aAAa,EAAE,OAAO,MAAM,CAAC,WAAW,KAAK,WAAW,EAAE,IAAI,CAAC,CAAC;AACpE,GAAG,CAAC,UAAU,EAAE,OAAO,MAAM,CAAC,QAAQ,KAAK,WAAW,EAAE,IAAI,CAAC,CAAC;AAC9D,GAAG,CAAC,YAAY,EAAE,OAAO,MAAM,CAAC,UAAU,KAAK,WAAW,EAAE,IAAI,CAAC,CAAC;AAClE,GAAG,CAAC,KAAK,EAAE,OAAO,MAAM,CAAC,cAAc,KAAK,WAAW,EAAE,IAAI,CAAC,CAAC;AAC/D,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,KAAK,CAAC,IAAI,cAAc,IAAI,MAAM,CAAC,cAAc,CAAC,SAAS,EAAE,IAAI,CAAC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,SAAS,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE;oBACvD,OAAO,CAAC,MAAM,KAAK,MAAM,CAAC,CAAC;gBAC5B,CAAC,CAAC,CAAC;gBACH,MAAM,CAAC,WAAW,CAAC,EAAE,CAAC,CAAC;YACxB,CAAC;YAAC,IAAI,CAAC,CAAC;gBACP,OAAO,CAAC,KAAK,CAAC,CAAC;YAChB,CAAC;QACF,CAAC;QAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;YACZ,mDAAmD;YACnD,OAAO,CAAC,KAAK,CAAC,CAAC;QAChB,CAAC;IACF,CAAC,CAAC,EACH,IAAI,CACJ,CAAC","sourcesContent":["import global from '../shim/global';\nimport has, { add } from '../shim/support/has';\n\nexport * from '../shim/support/has';\nexport default has;\n\nadd('object-assign', typeof global.Object.assign === 'function', true);\n\nadd('arraybuffer', typeof global.ArrayBuffer !== 'undefined', true);\nadd('formdata', typeof global.FormData !== 'undefined', true);\nadd('filereader', typeof global.FileReader !== 'undefined', true);\nadd('xhr', typeof global.XMLHttpRequest !== 'undefined', true);\nadd('xhr2', has('xhr') && 'responseType' in global.XMLHttpRequest.prototype, true);\nadd(\n\t'blob',\n\tfunction() {\n\t\tif (!has('xhr2')) {\n\t\t\treturn false;\n\t\t}\n\n\t\tconst request = new global.XMLHttpRequest();\n\t\trequest.open('GET', global.location.protocol + '//www.google.com', true);\n\t\trequest.responseType = 'blob';\n\t\trequest.abort();\n\t\treturn request.responseType === 'blob';\n\t},\n\ttrue\n);\n\nadd('node-buffer', 'Buffer' in global && typeof global.Buffer === 'function', true);\n\nadd('fetch', 'fetch' in global && typeof global.fetch === 'function', true);\n\nadd(\n\t'web-worker-xhr-upload',\n\ttypeof global.Promise !== 'undefined' &&\n\t\tnew Promise((resolve) => {\n\t\t\ttry {\n\t\t\t\tif (global.Worker !== undefined && global.URL && global.URL.createObjectURL) {\n\t\t\t\t\tconst blob = new Blob(\n\t\t\t\t\t\t[\n\t\t\t\t\t\t\t`(function () {\nself.addEventListener('message', function () {\n\tvar xhr = new XMLHttpRequest();\n\ttry {\n\t\txhr.upload;\n\t\tpostMessage('true');\n\t} catch (e) {\n\t\tpostMessage('false');\n\t}\n});\n\t\t})()`\n\t\t\t\t\t\t],\n\t\t\t\t\t\t{ type: 'application/javascript' }\n\t\t\t\t\t);\n\t\t\t\t\tconst worker = new Worker(URL.createObjectURL(blob));\n\t\t\t\t\tworker.addEventListener('message', ({ data: result }) => {\n\t\t\t\t\t\tresolve(result === 'true');\n\t\t\t\t\t});\n\t\t\t\t\tworker.postMessage({});\n\t\t\t\t} else {\n\t\t\t\t\tresolve(false);\n\t\t\t\t}\n\t\t\t} catch (e) {\n\t\t\t\t// IE11 on Winodws 8.1 encounters a security error.\n\t\t\t\tresolve(false);\n\t\t\t}\n\t\t}),\n\ttrue\n);\n"]} \ No newline at end of file diff --git a/deps/framework/core/instrument.d.ts b/deps/framework/core/instrument.d.ts deleted file mode 100644 index 1a0dd67072..0000000000 --- a/deps/framework/core/instrument.d.ts +++ /dev/null @@ -1,43 +0,0 @@ -export interface DeprecatedOptions { - /** - * The message to use when warning - */ - message?: string; - /** - * The name of the method or function to use - */ - name?: string; - /** - * An alternative function to log the warning to - */ - warn?: (...args: any[]) => void; - /** - * Reference an URL for more information when warning - */ - url?: string; -} -/** - * A function that will console warn that a function has been deprecated - * - * @param options Provide options which change the display of the message - */ -export declare function deprecated({message, name, warn, url}?: DeprecatedOptions): void; -/** - * A function that generates before advice that can be used to warn when an API has been deprecated - * - * @param options Provide options which change the display of the message - */ -export declare function deprecatedAdvice(options?: DeprecatedOptions): (...args: any[]) => any[]; -/** - * A method decorator that will console warn when a method if invoked that is deprecated - * - * @param options Provide options which change the display of the message - */ -export declare function deprecatedDecorator(options?: DeprecatedOptions): MethodDecorator; -/** - * A function that will set the warn function that will be used instead of `console.warn` when - * logging warning messages - * - * @param warn The function (or `undefined`) to use instead of `console.warn` - */ -export declare function setWarn(warn?: ((message?: any, ...optionalParams: any[]) => void)): void; diff --git a/deps/framework/core/instrument.js b/deps/framework/core/instrument.js deleted file mode 100644 index 2c93a32a12..0000000000 --- a/deps/framework/core/instrument.js +++ /dev/null @@ -1,100 +0,0 @@ -(function (factory) { - if (typeof module === "object" && typeof module.exports === "object") { - var v = factory(require, exports); - if (v !== undefined) module.exports = v; - } - else if (typeof define === "function" && define.amd) { - define(["require", "exports", "./has"], factory); - } -})(function (require, exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - var has_1 = require("./has"); - /** - * The default message to warn when no other is provided - */ - var DEFAULT_DEPRECATED_MESSAGE = 'This function will be removed in future versions.'; - /** - * When set, globalWarn will be used instead of `console.warn` - */ - var globalWarn; - /** - * A function that will console warn that a function has been deprecated - * - * @param options Provide options which change the display of the message - */ - function deprecated(_a) { - var _b = _a === void 0 ? {} : _a, message = _b.message, name = _b.name, warn = _b.warn, url = _b.url; - /* istanbul ignore else: testing with debug off is difficult */ - if (has_1.default('debug')) { - message = message || DEFAULT_DEPRECATED_MESSAGE; - var warning = "DEPRECATED: " + (name ? name + ': ' : '') + message; - if (url) { - warning += "\n\n See " + url + " for more details.\n\n"; - } - if (warn) { - warn(warning); - } - else if (globalWarn) { - globalWarn(warning); - } - else { - console.warn(warning); - } - } - } - exports.deprecated = deprecated; - /** - * A function that generates before advice that can be used to warn when an API has been deprecated - * - * @param options Provide options which change the display of the message - */ - function deprecatedAdvice(options) { - return function () { - var args = []; - for (var _i = 0; _i < arguments.length; _i++) { - args[_i] = arguments[_i]; - } - deprecated(options); - return args; - }; - } - exports.deprecatedAdvice = deprecatedAdvice; - /** - * A method decorator that will console warn when a method if invoked that is deprecated - * - * @param options Provide options which change the display of the message - */ - function deprecatedDecorator(options) { - return function (target, propertyKey, descriptor) { - if (has_1.default('debug')) { - var originalFn_1 = descriptor.value; - options = options || {}; - propertyKey = String(propertyKey); - /* IE 10/11 don't have the name property on functions */ - options.name = target.constructor.name ? target.constructor.name + "#" + propertyKey : propertyKey; - descriptor.value = function () { - var args = []; - for (var _i = 0; _i < arguments.length; _i++) { - args[_i] = arguments[_i]; - } - deprecated(options); - return originalFn_1.apply(target, args); - }; - } - return descriptor; - }; - } - exports.deprecatedDecorator = deprecatedDecorator; - /** - * A function that will set the warn function that will be used instead of `console.warn` when - * logging warning messages - * - * @param warn The function (or `undefined`) to use instead of `console.warn` - */ - function setWarn(warn) { - globalWarn = warn; - } - exports.setWarn = setWarn; -}); -//# sourceMappingURL=instrument.js.map \ No newline at end of file diff --git a/deps/framework/core/instrument.js.map b/deps/framework/core/instrument.js.map deleted file mode 100644 index 71515179ff..0000000000 --- a/deps/framework/core/instrument.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"instrument.js","sourceRoot":"","sources":["instrument.ts"],"names":[],"mappings":";;;;;;;;;;;IAAA,6BAAwB;IAExB;;OAEG;IACH,IAAM,0BAA0B,GAAG,mDAAmD,CAAC;IAEvF;;OAEG;IACH,IAAI,UAA2E,CAAC;IAwBhF;;;;OAIG;IACH,oBAA2B,EAAoD;YAApD,4BAAoD,EAAlD,oBAAO,EAAE,cAAI,EAAE,cAAI,EAAE,YAAG;QACpD,+DAA+D;QAC/D,EAAE,CAAC,CAAC,aAAG,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;YAClB,OAAO,GAAG,OAAO,IAAI,0BAA0B,CAAC;YAChD,IAAI,OAAO,GAAG,kBAAe,IAAI,CAAC,CAAC,CAAC,IAAI,GAAG,IAAI,CAAC,CAAC,CAAC,EAAE,IAAG,OAAS,CAAC;YACjE,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;gBACT,OAAO,IAAI,iBAAe,GAAG,2BAAwB,CAAC;YACvD,CAAC;YACD,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC;gBACV,IAAI,CAAC,OAAO,CAAC,CAAC;YACf,CAAC;YAAC,IAAI,CAAC,EAAE,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC;gBACvB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,0BAEC","sourcesContent":["import has from './has';\n\n/**\n * The default message to warn when no other is provided\n */\nconst DEFAULT_DEPRECATED_MESSAGE = 'This function will be removed in future versions.';\n\n/**\n * When set, globalWarn will be used instead of `console.warn`\n */\nlet globalWarn: ((message?: any, ...optionalParams: any[]) => void) | undefined;\n\nexport interface DeprecatedOptions {\n\t/**\n\t * The message to use when warning\n\t */\n\tmessage?: string;\n\n\t/**\n\t * The name of the method or function to use\n\t */\n\tname?: string;\n\n\t/**\n\t * An alternative function to log the warning to\n\t */\n\twarn?: (...args: any[]) => void;\n\n\t/**\n\t * Reference an URL for more information when warning\n\t */\n\turl?: string;\n}\n\n/**\n * A function that will console warn that a function has been deprecated\n *\n * @param options Provide options which change the display of the message\n */\nexport function deprecated({ message, name, warn, url }: DeprecatedOptions = {}): void {\n\t/* istanbul ignore else: testing with debug off is difficult */\n\tif (has('debug')) {\n\t\tmessage = message || DEFAULT_DEPRECATED_MESSAGE;\n\t\tlet warning = `DEPRECATED: ${name ? name + ': ' : ''}${message}`;\n\t\tif (url) {\n\t\t\twarning += `\\n\\n See ${url} for more details.\\n\\n`;\n\t\t}\n\t\tif (warn) {\n\t\t\twarn(warning);\n\t\t} else if (globalWarn) {\n\t\t\tglobalWarn(warning);\n\t\t} else {\n\t\t\tconsole.warn(warning);\n\t\t}\n\t}\n}\n\n/**\n * A function that generates before advice that can be used to warn when an API has been deprecated\n *\n * @param options Provide options which change the display of the message\n */\nexport function deprecatedAdvice(options?: DeprecatedOptions): (...args: any[]) => any[] {\n\treturn function(...args: any[]): any[] {\n\t\tdeprecated(options);\n\t\treturn args;\n\t};\n}\n\n/**\n * A method decorator that will console warn when a method if invoked that is deprecated\n *\n * @param options Provide options which change the display of the message\n */\nexport function deprecatedDecorator(options?: DeprecatedOptions): MethodDecorator {\n\treturn function(target: any, propertyKey: string | symbol, descriptor: PropertyDescriptor) {\n\t\tif (has('debug')) {\n\t\t\tconst { value: originalFn } = descriptor;\n\t\t\toptions = options || {};\n\t\t\tpropertyKey = String(propertyKey);\n\t\t\t/* IE 10/11 don't have the name property on functions */\n\t\t\toptions.name = target.constructor.name ? `${target.constructor.name}#${propertyKey}` : propertyKey;\n\t\t\tdescriptor.value = function(...args: any[]) {\n\t\t\t\tdeprecated(options);\n\t\t\t\treturn originalFn.apply(target, args);\n\t\t\t};\n\t\t}\n\t\treturn descriptor;\n\t};\n}\n\n/**\n * A function that will set the warn function that will be used instead of `console.warn` when\n * logging warning messages\n *\n * @param warn The function (or `undefined`) to use instead of `console.warn`\n */\nexport function setWarn(warn?: ((message?: any, ...optionalParams: any[]) => void)): void {\n\tglobalWarn = warn;\n}\n"]} \ No newline at end of file diff --git a/deps/framework/core/instrument.mjs b/deps/framework/core/instrument.mjs deleted file mode 100644 index 3a95ba019a..0000000000 --- a/deps/framework/core/instrument.mjs +++ /dev/null @@ -1,75 +0,0 @@ -import has from './has'; -/** - * The default message to warn when no other is provided - */ -const DEFAULT_DEPRECATED_MESSAGE = 'This function will be removed in future versions.'; -/** - * When set, globalWarn will be used instead of `console.warn` - */ -let globalWarn; -/** - * A function that will console warn that a function has been deprecated - * - * @param options Provide options which change the display of the message - */ -export function deprecated({ message, name, warn, url } = {}) { - /* istanbul ignore else: testing with debug off is difficult */ - if (has('debug')) { - message = message || DEFAULT_DEPRECATED_MESSAGE; - let warning = `DEPRECATED: ${name ? name + ': ' : ''}${message}`; - if (url) { - warning += `\n\n See ${url} for more details.\n\n`; - } - if (warn) { - warn(warning); - } - else if (globalWarn) { - globalWarn(warning); - } - else { - console.warn(warning); - } - } -} -/** - * A function that generates before advice that can be used to warn when an API has been deprecated - * - * @param options Provide options which change the display of the message - */ -export function deprecatedAdvice(options) { - return function (...args) { - deprecated(options); - return args; - }; -} -/** - * A method decorator that will console warn when a method if invoked that is deprecated - * - * @param options Provide options which change the display of the message - */ -export function deprecatedDecorator(options) { - return function (target, propertyKey, descriptor) { - if (has('debug')) { - const { value: originalFn } = descriptor; - options = options || {}; - propertyKey = String(propertyKey); - /* IE 10/11 don't have the name property on functions */ - options.name = target.constructor.name ? `${target.constructor.name}#${propertyKey}` : propertyKey; - descriptor.value = function (...args) { - deprecated(options); - return originalFn.apply(target, args); - }; - } - return descriptor; - }; -} -/** - * A function that will set the warn function that will be used instead of `console.warn` when - * logging warning messages - * - * @param warn The function (or `undefined`) to use instead of `console.warn` - */ -export function setWarn(warn) { - globalWarn = warn; -} -//# sourceMappingURL=instrument.mjs.map \ No newline at end of file diff --git a/deps/framework/core/instrument.mjs.map b/deps/framework/core/instrument.mjs.map deleted file mode 100644 index ab0a7c512a..0000000000 --- a/deps/framework/core/instrument.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"instrument.mjs","sourceRoot":"","sources":["instrument.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,OAAO,CAAC;AAExB;;GAEG;AACH,MAAM,0BAA0B,GAAG,mDAAmD,CAAC;AAEvF;;GAEG;AACH,IAAI,UAA2E,CAAC;AAwBhF;;;;GAIG;AACH,MAAM,qBAAqB,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,GAAG,KAAwB,EAAE;IAC9E,+DAA+D;IAC/D,EAAE,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;QAClB,OAAO,GAAG,OAAO,IAAI,0BAA0B,CAAC;QAChD,IAAI,OAAO,GAAG,eAAe,IAAI,CAAC,CAAC,CAAC,IAAI,GAAG,IAAI,CAAC,CAAC,CAAC,EAAE,GAAG,OAAO,EAAE,CAAC;QACjE,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;YACT,OAAO,IAAI,eAAe,GAAG,wBAAwB,CAAC;QACvD,CAAC;QACD,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC;YACV,IAAI,CAAC,OAAO,CAAC,CAAC;QACf,CAAC;QAAC,IAAI,CAAC,EAAE,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC;YACvB,UAAU,CAAC,OAAO,CAAC,CAAC;QACrB,CAAC;QAAC,IAAI,CAAC,CAAC;YACP,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACvB,CAAC;IACF,CAAC;AACF,CAAC;AAED;;;;GAIG;AACH,MAAM,2BAA2B,OAA2B;IAC3D,MAAM,CAAC,UAAS,GAAG,IAAW;QAC7B,UAAU,CAAC,OAAO,CAAC,CAAC;QACpB,MAAM,CAAC,IAAI,CAAC;IACb,CAAC,CAAC;AACH,CAAC;AAED;;;;GAIG;AACH,MAAM,8BAA8B,OAA2B;IAC9D,MAAM,CAAC,UAAS,MAAW,EAAE,WAA4B,EAAE,UAA8B;QACxF,EAAE,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;YAClB,MAAM,EAAE,KAAK,EAAE,UAAU,EAAE,GAAG,UAAU,CAAC;YACzC,OAAO,GAAG,OAAO,IAAI,EAAE,CAAC;YACxB,WAAW,GAAG,MAAM,CAAC,WAAW,CAAC,CAAC;YAClC,wDAAwD;YACxD,OAAO,CAAC,IAAI,GAAG,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,WAAW,CAAC,IAAI,IAAI,WAAW,EAAE,CAAC,CAAC,CAAC,WAAW,CAAC;YACnG,UAAU,CAAC,KAAK,GAAG,UAAS,GAAG,IAAW;gBACzC,UAAU,CAAC,OAAO,CAAC,CAAC;gBACpB,MAAM,CAAC,UAAU,CAAC,KAAK,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;YACvC,CAAC,CAAC;QACH,CAAC;QACD,MAAM,CAAC,UAAU,CAAC;IACnB,CAAC,CAAC;AACH,CAAC;AAED;;;;;GAKG;AACH,MAAM,kBAAkB,IAA0D;IACjF,UAAU,GAAG,IAAI,CAAC;AACnB,CAAC","sourcesContent":["import has from './has';\n\n/**\n * The default message to warn when no other is provided\n */\nconst DEFAULT_DEPRECATED_MESSAGE = 'This function will be removed in future versions.';\n\n/**\n * When set, globalWarn will be used instead of `console.warn`\n */\nlet globalWarn: ((message?: any, ...optionalParams: any[]) => void) | undefined;\n\nexport interface DeprecatedOptions {\n\t/**\n\t * The message to use when warning\n\t */\n\tmessage?: string;\n\n\t/**\n\t * The name of the method or function to use\n\t */\n\tname?: string;\n\n\t/**\n\t * An alternative function to log the warning to\n\t */\n\twarn?: (...args: any[]) => void;\n\n\t/**\n\t * Reference an URL for more information when warning\n\t */\n\turl?: string;\n}\n\n/**\n * A function that will console warn that a function has been deprecated\n *\n * @param options Provide options which change the display of the message\n */\nexport function deprecated({ message, name, warn, url }: DeprecatedOptions = {}): void {\n\t/* istanbul ignore else: testing with debug off is difficult */\n\tif (has('debug')) {\n\t\tmessage = message || DEFAULT_DEPRECATED_MESSAGE;\n\t\tlet warning = `DEPRECATED: ${name ? name + ': ' : ''}${message}`;\n\t\tif (url) {\n\t\t\twarning += `\\n\\n See ${url} for more details.\\n\\n`;\n\t\t}\n\t\tif (warn) {\n\t\t\twarn(warning);\n\t\t} else if (globalWarn) {\n\t\t\tglobalWarn(warning);\n\t\t} else {\n\t\t\tconsole.warn(warning);\n\t\t}\n\t}\n}\n\n/**\n * A function that generates before advice that can be used to warn when an API has been deprecated\n *\n * @param options Provide options which change the display of the message\n */\nexport function deprecatedAdvice(options?: DeprecatedOptions): (...args: any[]) => any[] {\n\treturn function(...args: any[]): any[] {\n\t\tdeprecated(options);\n\t\treturn args;\n\t};\n}\n\n/**\n * A method decorator that will console warn when a method if invoked that is deprecated\n *\n * @param options Provide options which change the display of the message\n */\nexport function deprecatedDecorator(options?: DeprecatedOptions): MethodDecorator {\n\treturn function(target: any, propertyKey: string | symbol, descriptor: PropertyDescriptor) {\n\t\tif (has('debug')) {\n\t\t\tconst { value: originalFn } = descriptor;\n\t\t\toptions = options || {};\n\t\t\tpropertyKey = String(propertyKey);\n\t\t\t/* IE 10/11 don't have the name property on functions */\n\t\t\toptions.name = target.constructor.name ? `${target.constructor.name}#${propertyKey}` : propertyKey;\n\t\t\tdescriptor.value = function(...args: any[]) {\n\t\t\t\tdeprecated(options);\n\t\t\t\treturn originalFn.apply(target, args);\n\t\t\t};\n\t\t}\n\t\treturn descriptor;\n\t};\n}\n\n/**\n * A function that will set the warn function that will be used instead of `console.warn` when\n * logging warning messages\n *\n * @param warn The function (or `undefined`) to use instead of `console.warn`\n */\nexport function setWarn(warn?: ((message?: any, ...optionalParams: any[]) => void)): void {\n\tglobalWarn = warn;\n}\n"]} \ No newline at end of file diff --git a/deps/framework/core/interfaces.d.ts b/deps/framework/core/interfaces.d.ts deleted file mode 100644 index 2b0119afd2..0000000000 --- a/deps/framework/core/interfaces.d.ts +++ /dev/null @@ -1,249 +0,0 @@ -export declare type EventType = string | symbol; -/** - * The base event object, which provides a `type` property - */ -export interface EventObject { - /** - * The type of the event - */ - readonly type: T; -} -export interface EventErrorObject extends EventObject { - /** - * The error that is the subject of this event - */ - readonly error: Error; -} -/** - * An interface for an object which provides a cancelable event API. By calling the - * `.preventDefault()` method on the object, the event should be cancelled and not - * proceed any further - */ -export interface EventCancelableObject extends EventObject { - /** - * Can the event be canceled? - */ - readonly cancelable: boolean; - /** - * Was the event canceled? - */ - readonly defaultPrevented: boolean; - /** - * Cancel the event - */ - preventDefault(): void; -} -/** - * Used through the toolkit as a consistent API to manage how callers can "cleanup" - * when doing a function. - */ -export interface Handle { - /** - * Perform the destruction/cleanup logic associated with this handle - */ - destroy(): void; -} -/** - * A general interface that can be used to renference a general index map of values of a particular type - */ -export interface Hash { - [id: string]: T; -} -/** - * A base map of styles where each key is the name of the style attribute and the value is a string - * which represents the style - */ -export interface StylesMap { - [style: string]: string; -} -/** - * The interfaces to the `@dojo/loader` AMD loader - */ -export interface AmdConfig { - /** - * The base URL that the loader will use to resolve modules - */ - baseUrl?: string; - /** - * A map of module identifiers and their replacement meta data - */ - map?: AmdModuleMap; - /** - * An array of packages that the loader should use when resolving a module ID - */ - packages?: AmdPackage[]; - /** - * A map of paths to use when resolving modules names - */ - paths?: { - [path: string]: string; - }; - /** - * A map of packages that the loader should use when resolving a module ID - */ - pkgs?: { - [path: string]: AmdPackage; - }; -} -export interface AmdDefine { - /** - * Define a module - * - * @param moduleId the MID to use for the module - * @param dependencies an array of MIDs this module depends upon - * @param factory the factory function that will return the module - */ - (moduleId: string, dependencies: string[], factory: AmdFactory): void; - /** - * Define a module - * - * @param dependencies an array of MIDs this module depends upon - * @param factory the factory function that will return the module - */ - (dependencies: string[], factory: AmdFactory): void; - /** - * Define a module - * - * @param factory the factory function that will return the module - */ - (factory: AmdFactory): void; - /** - * Define a module - * - * @param value the value for the module - */ - (value: any): void; - /** - * Meta data about this particular AMD loader - */ - amd: { - [prop: string]: string | number | boolean; - }; -} -export interface AmdFactory { - /** - * The module factory - * - * @param modules The arguments that represent the resolved versions of the module dependencies - */ - (...modules: any[]): any; -} -export interface AmdHas { - /** - * Determine if a feature is present - * - * @param name the feature name to check - */ - (name: string): any; - /** - * Register a feature test - * - * @param name The name of the feature to register - * @param value The test for the feature - * @param now If `true` the test will be executed immediatly, if not, it will be lazily executed - * @param force If `true` the test value will be overwritten if already registered - */ - add(name: string, value: (global: Window, document?: HTMLDocument, element?: HTMLDivElement) => any, now?: boolean, force?: boolean): void; - add(name: string, value: any, now?: boolean, force?: boolean): void; -} -export interface AmdModuleMap extends AmdModuleMapItem { - [sourceMid: string]: AmdModuleMapReplacement; -} -export interface AmdModuleMapItem { - [mid: string]: any; -} -export interface AmdModuleMapReplacement extends AmdModuleMapItem { - [findMid: string]: string; -} -export interface NodeRequire { - (moduleId: string): any; - resolve(moduleId: string): string; -} -export interface AmdPackage { - /** - * The path to the root of the package - */ - location?: string; - /** - * The main module of the package (defaults to `main.js`) - */ - main?: string; - /** - * The package name - */ - name?: string; -} -export interface AmdRequire { - /** - * Resolve a list of module dependencies and pass them to the callback - * - * @param dependencies The array of MIDs to resolve - * @param callback The function to invoke with the resolved dependencies - */ - (dependencies: string[], callback: AmdRequireCallback): void; - /** - * Resolve and return a single module (compatability with CommonJS `require`) - * - * @param moduleId The module ID to resolve and return - */ - (moduleId: string): ModuleType; - /** - * If running in the node environment, a reference to the original NodeJS `require` - */ - nodeRequire?: NodeRequire; - /** - * Take a relative MID and return an absolute MID - * - * @param moduleId The relative module ID to resolve - */ - toAbsMid(moduleId: string): string; - /** - * Take a path and resolve the full URL for the path - * - * @param path The path to resolve and return as a URL - */ - toUrl(path: string): string; -} -export interface AmdRequireCallback { - /** - * The `require` callback - * - * @param modules The arguments that represent the resolved versions of dependencies - */ - (...modules: any[]): void; -} -export interface AmdRootRequire extends AmdRequire { - /** - * The minimalist `has` API integrated with the `@dojo/loader` - */ - has: AmdHas; - /** - * Register an event listener - * - * @param type The event type to listen for - * @param listener The listener to call when the event is emitted - */ - on(type: AmdRequireOnSignalType, listener: any): { - remove: () => void; - }; - /** - * Configure the loader - * - * @param config The configuration to apply to the loader - */ - config(config: AmdConfig): void; - /** - * Return internal values of loader for debug purposes - * - * @param name The name of the internal label - */ - inspect?(name: string): any; - /** - * Undefine a module, based on absolute MID that should be removed from the loader cache - */ - undef(moduleId: string): void; -} -/** - * The signal type for the `require.on` API - */ -export declare type AmdRequireOnSignalType = 'error'; diff --git a/deps/framework/core/interfaces.js b/deps/framework/core/interfaces.js deleted file mode 100644 index fffca93173..0000000000 --- a/deps/framework/core/interfaces.js +++ /dev/null @@ -1,13 +0,0 @@ -(function (factory) { - if (typeof module === "object" && typeof module.exports === "object") { - var v = factory(require, exports); - if (v !== undefined) module.exports = v; - } - else if (typeof define === "function" && define.amd) { - define(["require", "exports"], factory); - } -})(function (require, exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); -}); -//# sourceMappingURL=interfaces.js.map \ No newline at end of file diff --git a/deps/framework/core/interfaces.js.map b/deps/framework/core/interfaces.js.map deleted file mode 100644 index 3c62d42432..0000000000 --- a/deps/framework/core/interfaces.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"interfaces.js","sourceRoot":"","sources":["interfaces.ts"],"names":[],"mappings":"","sourcesContent":["export type EventType = string | symbol;\n\n/**\n * The base event object, which provides a `type` property\n */\nexport interface EventObject {\n\t/**\n\t * The type of the event\n\t */\n\treadonly type: T;\n}\n\nexport interface EventErrorObject extends EventObject {\n\t/**\n\t * The error that is the subject of this event\n\t */\n\treadonly error: Error;\n}\n\n/**\n * An interface for an object which provides a cancelable event API. By calling the\n * `.preventDefault()` method on the object, the event should be cancelled and not\n * proceed any further\n */\nexport interface EventCancelableObject extends EventObject {\n\t/**\n\t * Can the event be canceled?\n\t */\n\treadonly cancelable: boolean;\n\n\t/**\n\t * Was the event canceled?\n\t */\n\treadonly defaultPrevented: boolean;\n\n\t/**\n\t * Cancel the event\n\t */\n\tpreventDefault(): void;\n}\n\n/**\n * Used through the toolkit as a consistent API to manage how callers can \"cleanup\"\n * when doing a function.\n */\nexport interface Handle {\n\t/**\n\t * Perform the destruction/cleanup logic associated with this handle\n\t */\n\tdestroy(): void;\n}\n\n/**\n * A general interface that can be used to renference a general index map of values of a particular type\n */\nexport interface Hash {\n\t[id: string]: T;\n}\n\n/**\n * A base map of styles where each key is the name of the style attribute and the value is a string\n * which represents the style\n */\nexport interface StylesMap {\n\t[style: string]: string;\n}\n\n/**\n * The interfaces to the `@dojo/loader` AMD loader\n */\n\nexport interface AmdConfig {\n\t/**\n\t * The base URL that the loader will use to resolve modules\n\t */\n\tbaseUrl?: string;\n\n\t/**\n\t * A map of module identifiers and their replacement meta data\n\t */\n\tmap?: AmdModuleMap;\n\n\t/**\n\t * An array of packages that the loader should use when resolving a module ID\n\t */\n\tpackages?: AmdPackage[];\n\n\t/**\n\t * A map of paths to use when resolving modules names\n\t */\n\tpaths?: { [path: string]: string };\n\n\t/**\n\t * A map of packages that the loader should use when resolving a module ID\n\t */\n\tpkgs?: { [path: string]: AmdPackage };\n}\n\nexport interface AmdDefine {\n\t/**\n\t * Define a module\n\t *\n\t * @param moduleId the MID to use for the module\n\t * @param dependencies an array of MIDs this module depends upon\n\t * @param factory the factory function that will return the module\n\t */\n\t(moduleId: string, dependencies: string[], factory: AmdFactory): void;\n\n\t/**\n\t * Define a module\n\t *\n\t * @param dependencies an array of MIDs this module depends upon\n\t * @param factory the factory function that will return the module\n\t */\n\t(dependencies: string[], factory: AmdFactory): void;\n\n\t/**\n\t * Define a module\n\t *\n\t * @param factory the factory function that will return the module\n\t */\n\t(factory: AmdFactory): void;\n\n\t/**\n\t * Define a module\n\t *\n\t * @param value the value for the module\n\t */\n\t(value: any): void;\n\n\t/**\n\t * Meta data about this particular AMD loader\n\t */\n\tamd: { [prop: string]: string | number | boolean };\n}\n\nexport interface AmdFactory {\n\t/**\n\t * The module factory\n\t *\n\t * @param modules The arguments that represent the resolved versions of the module dependencies\n\t */\n\t(...modules: any[]): any;\n}\n\nexport interface AmdHas {\n\t/**\n\t * Determine if a feature is present\n\t *\n\t * @param name the feature name to check\n\t */\n\t(name: string): any;\n\n\t/**\n\t * Register a feature test\n\t *\n\t * @param name The name of the feature to register\n\t * @param value The test for the feature\n\t * @param now If `true` the test will be executed immediatly, if not, it will be lazily executed\n\t * @param force If `true` the test value will be overwritten if already registered\n\t */\n\tadd(\n\t\tname: string,\n\t\tvalue: (global: Window, document?: HTMLDocument, element?: HTMLDivElement) => any,\n\t\tnow?: boolean,\n\t\tforce?: boolean\n\t): void;\n\tadd(name: string, value: any, now?: boolean, force?: boolean): void;\n}\n\nexport interface AmdModuleMap extends AmdModuleMapItem {\n\t[sourceMid: string]: AmdModuleMapReplacement;\n}\n\nexport interface AmdModuleMapItem {\n\t[mid: string]: any;\n}\n\nexport interface AmdModuleMapReplacement extends AmdModuleMapItem {\n\t[findMid: string]: string;\n}\n\nexport interface NodeRequire {\n\t(moduleId: string): any;\n\tresolve(moduleId: string): string;\n}\n\nexport interface AmdPackage {\n\t/**\n\t * The path to the root of the package\n\t */\n\tlocation?: string;\n\n\t/**\n\t * The main module of the package (defaults to `main.js`)\n\t */\n\tmain?: string;\n\n\t/**\n\t * The package name\n\t */\n\tname?: string;\n}\n\nexport interface AmdRequire {\n\t/**\n\t * Resolve a list of module dependencies and pass them to the callback\n\t *\n\t * @param dependencies The array of MIDs to resolve\n\t * @param callback The function to invoke with the resolved dependencies\n\t */\n\t(dependencies: string[], callback: AmdRequireCallback): void;\n\n\t/**\n\t * Resolve and return a single module (compatability with CommonJS `require`)\n\t *\n\t * @param moduleId The module ID to resolve and return\n\t */\n\t(moduleId: string): ModuleType;\n\n\t/**\n\t * If running in the node environment, a reference to the original NodeJS `require`\n\t */\n\tnodeRequire?: NodeRequire;\n\n\t/**\n\t * Take a relative MID and return an absolute MID\n\t *\n\t * @param moduleId The relative module ID to resolve\n\t */\n\ttoAbsMid(moduleId: string): string;\n\n\t/**\n\t * Take a path and resolve the full URL for the path\n\t *\n\t * @param path The path to resolve and return as a URL\n\t */\n\ttoUrl(path: string): string;\n}\n\nexport interface AmdRequireCallback {\n\t/**\n\t * The `require` callback\n\t *\n\t * @param modules The arguments that represent the resolved versions of dependencies\n\t */\n\t(...modules: any[]): void;\n}\n\nexport interface AmdRootRequire extends AmdRequire {\n\t/**\n\t * The minimalist `has` API integrated with the `@dojo/loader`\n\t */\n\thas: AmdHas;\n\n\t/**\n\t * Register an event listener\n\t *\n\t * @param type The event type to listen for\n\t * @param listener The listener to call when the event is emitted\n\t */\n\ton(type: AmdRequireOnSignalType, listener: any): { remove: () => void };\n\n\t/**\n\t * Configure the loader\n\t *\n\t * @param config The configuration to apply to the loader\n\t */\n\tconfig(config: AmdConfig): void;\n\n\t/**\n\t * Return internal values of loader for debug purposes\n\t *\n\t * @param name The name of the internal label\n\t */\n\tinspect?(name: string): any;\n\n\t/**\n\t * Undefine a module, based on absolute MID that should be removed from the loader cache\n\t */\n\tundef(moduleId: string): void;\n}\n\n/**\n * The signal type for the `require.on` API\n */\nexport type AmdRequireOnSignalType = 'error';\n"]} \ No newline at end of file diff --git a/deps/framework/core/interfaces.mjs b/deps/framework/core/interfaces.mjs deleted file mode 100644 index 853801f7a8..0000000000 --- a/deps/framework/core/interfaces.mjs +++ /dev/null @@ -1 +0,0 @@ -//# sourceMappingURL=interfaces.mjs.map \ No newline at end of file diff --git a/deps/framework/core/interfaces.mjs.map b/deps/framework/core/interfaces.mjs.map deleted file mode 100644 index 6280950c18..0000000000 --- a/deps/framework/core/interfaces.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"interfaces.mjs","sourceRoot":"","sources":["interfaces.ts"],"names":[],"mappings":"","sourcesContent":["export type EventType = string | symbol;\n\n/**\n * The base event object, which provides a `type` property\n */\nexport interface EventObject {\n\t/**\n\t * The type of the event\n\t */\n\treadonly type: T;\n}\n\nexport interface EventErrorObject extends EventObject {\n\t/**\n\t * The error that is the subject of this event\n\t */\n\treadonly error: Error;\n}\n\n/**\n * An interface for an object which provides a cancelable event API. By calling the\n * `.preventDefault()` method on the object, the event should be cancelled and not\n * proceed any further\n */\nexport interface EventCancelableObject extends EventObject {\n\t/**\n\t * Can the event be canceled?\n\t */\n\treadonly cancelable: boolean;\n\n\t/**\n\t * Was the event canceled?\n\t */\n\treadonly defaultPrevented: boolean;\n\n\t/**\n\t * Cancel the event\n\t */\n\tpreventDefault(): void;\n}\n\n/**\n * Used through the toolkit as a consistent API to manage how callers can \"cleanup\"\n * when doing a function.\n */\nexport interface Handle {\n\t/**\n\t * Perform the destruction/cleanup logic associated with this handle\n\t */\n\tdestroy(): void;\n}\n\n/**\n * A general interface that can be used to renference a general index map of values of a particular type\n */\nexport interface Hash {\n\t[id: string]: T;\n}\n\n/**\n * A base map of styles where each key is the name of the style attribute and the value is a string\n * which represents the style\n */\nexport interface StylesMap {\n\t[style: string]: string;\n}\n\n/**\n * The interfaces to the `@dojo/loader` AMD loader\n */\n\nexport interface AmdConfig {\n\t/**\n\t * The base URL that the loader will use to resolve modules\n\t */\n\tbaseUrl?: string;\n\n\t/**\n\t * A map of module identifiers and their replacement meta data\n\t */\n\tmap?: AmdModuleMap;\n\n\t/**\n\t * An array of packages that the loader should use when resolving a module ID\n\t */\n\tpackages?: AmdPackage[];\n\n\t/**\n\t * A map of paths to use when resolving modules names\n\t */\n\tpaths?: { [path: string]: string };\n\n\t/**\n\t * A map of packages that the loader should use when resolving a module ID\n\t */\n\tpkgs?: { [path: string]: AmdPackage };\n}\n\nexport interface AmdDefine {\n\t/**\n\t * Define a module\n\t *\n\t * @param moduleId the MID to use for the module\n\t * @param dependencies an array of MIDs this module depends upon\n\t * @param factory the factory function that will return the module\n\t */\n\t(moduleId: string, dependencies: string[], factory: AmdFactory): void;\n\n\t/**\n\t * Define a module\n\t *\n\t * @param dependencies an array of MIDs this module depends upon\n\t * @param factory the factory function that will return the module\n\t */\n\t(dependencies: string[], factory: AmdFactory): void;\n\n\t/**\n\t * Define a module\n\t *\n\t * @param factory the factory function that will return the module\n\t */\n\t(factory: AmdFactory): void;\n\n\t/**\n\t * Define a module\n\t *\n\t * @param value the value for the module\n\t */\n\t(value: any): void;\n\n\t/**\n\t * Meta data about this particular AMD loader\n\t */\n\tamd: { [prop: string]: string | number | boolean };\n}\n\nexport interface AmdFactory {\n\t/**\n\t * The module factory\n\t *\n\t * @param modules The arguments that represent the resolved versions of the module dependencies\n\t */\n\t(...modules: any[]): any;\n}\n\nexport interface AmdHas {\n\t/**\n\t * Determine if a feature is present\n\t *\n\t * @param name the feature name to check\n\t */\n\t(name: string): any;\n\n\t/**\n\t * Register a feature test\n\t *\n\t * @param name The name of the feature to register\n\t * @param value The test for the feature\n\t * @param now If `true` the test will be executed immediatly, if not, it will be lazily executed\n\t * @param force If `true` the test value will be overwritten if already registered\n\t */\n\tadd(\n\t\tname: string,\n\t\tvalue: (global: Window, document?: HTMLDocument, element?: HTMLDivElement) => any,\n\t\tnow?: boolean,\n\t\tforce?: boolean\n\t): void;\n\tadd(name: string, value: any, now?: boolean, force?: boolean): void;\n}\n\nexport interface AmdModuleMap extends AmdModuleMapItem {\n\t[sourceMid: string]: AmdModuleMapReplacement;\n}\n\nexport interface AmdModuleMapItem {\n\t[mid: string]: any;\n}\n\nexport interface AmdModuleMapReplacement extends AmdModuleMapItem {\n\t[findMid: string]: string;\n}\n\nexport interface NodeRequire {\n\t(moduleId: string): any;\n\tresolve(moduleId: string): string;\n}\n\nexport interface AmdPackage {\n\t/**\n\t * The path to the root of the package\n\t */\n\tlocation?: string;\n\n\t/**\n\t * The main module of the package (defaults to `main.js`)\n\t */\n\tmain?: string;\n\n\t/**\n\t * The package name\n\t */\n\tname?: string;\n}\n\nexport interface AmdRequire {\n\t/**\n\t * Resolve a list of module dependencies and pass them to the callback\n\t *\n\t * @param dependencies The array of MIDs to resolve\n\t * @param callback The function to invoke with the resolved dependencies\n\t */\n\t(dependencies: string[], callback: AmdRequireCallback): void;\n\n\t/**\n\t * Resolve and return a single module (compatability with CommonJS `require`)\n\t *\n\t * @param moduleId The module ID to resolve and return\n\t */\n\t(moduleId: string): ModuleType;\n\n\t/**\n\t * If running in the node environment, a reference to the original NodeJS `require`\n\t */\n\tnodeRequire?: NodeRequire;\n\n\t/**\n\t * Take a relative MID and return an absolute MID\n\t *\n\t * @param moduleId The relative module ID to resolve\n\t */\n\ttoAbsMid(moduleId: string): string;\n\n\t/**\n\t * Take a path and resolve the full URL for the path\n\t *\n\t * @param path The path to resolve and return as a URL\n\t */\n\ttoUrl(path: string): string;\n}\n\nexport interface AmdRequireCallback {\n\t/**\n\t * The `require` callback\n\t *\n\t * @param modules The arguments that represent the resolved versions of dependencies\n\t */\n\t(...modules: any[]): void;\n}\n\nexport interface AmdRootRequire extends AmdRequire {\n\t/**\n\t * The minimalist `has` API integrated with the `@dojo/loader`\n\t */\n\thas: AmdHas;\n\n\t/**\n\t * Register an event listener\n\t *\n\t * @param type The event type to listen for\n\t * @param listener The listener to call when the event is emitted\n\t */\n\ton(type: AmdRequireOnSignalType, listener: any): { remove: () => void };\n\n\t/**\n\t * Configure the loader\n\t *\n\t * @param config The configuration to apply to the loader\n\t */\n\tconfig(config: AmdConfig): void;\n\n\t/**\n\t * Return internal values of loader for debug purposes\n\t *\n\t * @param name The name of the internal label\n\t */\n\tinspect?(name: string): any;\n\n\t/**\n\t * Undefine a module, based on absolute MID that should be removed from the loader cache\n\t */\n\tundef(moduleId: string): void;\n}\n\n/**\n * The signal type for the `require.on` API\n */\nexport type AmdRequireOnSignalType = 'error';\n"]} \ No newline at end of file diff --git a/deps/framework/core/lang.d.ts b/deps/framework/core/lang.d.ts deleted file mode 100644 index fc8e38e808..0000000000 --- a/deps/framework/core/lang.d.ts +++ /dev/null @@ -1,110 +0,0 @@ -import { Handle } from './interfaces'; -export { assign } from '../shim/object'; -/** - * Creates a new object from the given prototype, and copies all enumerable own properties of one or more - * source objects to the newly created target object. - * - * @param prototype The prototype to create a new object from - * @param mixins Any number of objects whose enumerable own properties will be copied to the created object - * @return The new object - */ -export declare function create(prototype: T, mixin1: U, mixin2: V, mixin3: W, mixin4: X, mixin5: Y, mixin6: Z): T & U & V & W & X & Y & Z; -export declare function create(prototype: T, mixin1: U, mixin2: V, mixin3: W, mixin4: X, mixin5: Y): T & U & V & W & X & Y; -export declare function create(prototype: T, mixin1: U, mixin2: V, mixin3: W, mixin4: X): T & U & V & W & X; -export declare function create(prototype: T, mixin1: U, mixin2: V, mixin3: W): T & U & V & W; -export declare function create(prototype: T, mixin1: U, mixin2: V): T & U & V; -export declare function create(prototype: T, mixin: U): T & U; -export declare function create(prototype: T): T; -/** - * Copies the values of all enumerable own properties of one or more source objects to the target object, - * recursively copying all nested objects and arrays as well. - * - * @param target The target object to receive values from source objects - * @param sources Any number of objects whose enumerable own properties will be copied to the target object - * @return The modified target object - */ -export declare function deepAssign(target: T, source1: U, source2: V, source3: W, source4: X, source5: Y, source6: Z): T & U & V & W & X & Y & Z; -export declare function deepAssign(target: T, source1: U, source2: V, source3: W, source4: X, source5: Y): T & U & V & W & X & Y; -export declare function deepAssign(target: T, source1: U, source2: V, source3: W, source4: X): T & U & V & W & X; -export declare function deepAssign(target: T, source1: U, source2: V, source3: W): T & U & V & W; -export declare function deepAssign(target: T, source1: U, source2: V): T & U & V; -export declare function deepAssign(target: T, source: U): T & U; -/** - * Copies the values of all enumerable (own or inherited) properties of one or more source objects to the - * target object, recursively copying all nested objects and arrays as well. - * - * @param target The target object to receive values from source objects - * @param sources Any number of objects whose enumerable properties will be copied to the target object - * @return The modified target object - */ -export declare function deepMixin(target: T, source1: U, source2: V, source3: W, source4: X, source5: Y, source6: Z): T & U & V & W & X & Y & Z; -export declare function deepMixin(target: T, source1: U, source2: V, source3: W, source4: X, source5: Y): T & U & V & W & X & Y; -export declare function deepMixin(target: T, source1: U, source2: V, source3: W, source4: X): T & U & V & W & X; -export declare function deepMixin(target: T, source1: U, source2: V, source3: W): T & U & V & W; -export declare function deepMixin(target: T, source1: U, source2: V): T & U & V; -export declare function deepMixin(target: T, source: U): T & U; -/** - * Creates a new object using the provided source's prototype as the prototype for the new object, and then - * deep copies the provided source's values into the new target. - * - * @param source The object to duplicate - * @return The new object - */ -export declare function duplicate(source: T): T; -/** - * Determines whether two values are the same value. - * - * @param a First value to compare - * @param b Second value to compare - * @return true if the values are the same; false otherwise - */ -export declare function isIdentical(a: any, b: any): boolean; -/** - * Returns a function that binds a method to the specified object at runtime. This is similar to - * `Function.prototype.bind`, but instead of a function it takes the name of a method on an object. - * As a result, the function returned by `lateBind` will always call the function currently assigned to - * the specified property on the object as of the moment the function it returns is called. - * - * @param instance The context object - * @param method The name of the method on the context object to bind to itself - * @param suppliedArgs An optional array of values to prepend to the `instance[method]` arguments list - * @return The bound function - */ -export declare function lateBind(instance: {}, method: string, ...suppliedArgs: any[]): (...args: any[]) => any; -/** - * Copies the values of all enumerable (own or inherited) properties of one or more source objects to the - * target object. - * - * @return The modified target object - */ -export declare function mixin(target: T, source1: U, source2: V, source3: W, source4: X, source5: Y, source6: Z): T & U & V & W & X & Y & Z; -export declare function mixin(target: T, source1: U, source2: V, source3: W, source4: X, source5: Y): T & U & V & W & X & Y; -export declare function mixin(target: T, source1: U, source2: V, source3: W, source4: X): T & U & V & W & X; -export declare function mixin(target: T, source1: U, source2: V, source3: W): T & U & V & W; -export declare function mixin(target: T, source1: U, source2: V): T & U & V; -export declare function mixin(target: T, source: U): T & U; -/** - * Returns a function which invokes the given function with the given arguments prepended to its argument list. - * Like `Function.prototype.bind`, but does not alter execution context. - * - * @param targetFunction The function that needs to be bound - * @param suppliedArgs An optional array of arguments to prepend to the `targetFunction` arguments list - * @return The bound function - */ -export declare function partial(targetFunction: (...args: any[]) => any, ...suppliedArgs: any[]): (...args: any[]) => any; -/** - * Returns an object with a destroy method that, when called, calls the passed-in destructor. - * This is intended to provide a unified interface for creating "remove" / "destroy" handlers for - * event listeners, timers, etc. - * - * @param destructor A function that will be called when the handle's `destroy` method is invoked - * @return The handle object - */ -export declare function createHandle(destructor: () => void): Handle; -/** - * Returns a single handle that can be used to destroy multiple handles simultaneously. - * - * @param handles An array of handles with `destroy` methods - * @return The handle object - */ -export declare function createCompositeHandle(...handles: Handle[]): Handle; diff --git a/deps/framework/core/lang.js b/deps/framework/core/lang.js deleted file mode 100644 index d282376cef..0000000000 --- a/deps/framework/core/lang.js +++ /dev/null @@ -1,248 +0,0 @@ -(function (factory) { - if (typeof module === "object" && typeof module.exports === "object") { - var v = factory(require, exports); - if (v !== undefined) module.exports = v; - } - else if (typeof define === "function" && define.amd) { - define(["require", "exports", "tslib", "../shim/object", "../shim/object"], factory); - } -})(function (require, exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - var tslib_1 = require("tslib"); - var object_1 = require("../shim/object"); - var object_2 = require("../shim/object"); - exports.assign = object_2.assign; - var slice = Array.prototype.slice; - var hasOwnProperty = Object.prototype.hasOwnProperty; - /** - * Type guard that ensures that the value can be coerced to Object - * to weed out host objects that do not derive from Object. - * This function is used to check if we want to deep copy an object or not. - * Note: In ES6 it is possible to modify an object's Symbol.toStringTag property, which will - * change the value returned by `toString`. This is a rare edge case that is difficult to handle, - * so it is not handled here. - * @param value The value to check - * @return If the value is coercible into an Object - */ - function shouldDeepCopyObject(value) { - return Object.prototype.toString.call(value) === '[object Object]'; - } - function copyArray(array, inherited) { - return array.map(function (item) { - if (Array.isArray(item)) { - return copyArray(item, inherited); - } - return !shouldDeepCopyObject(item) - ? item - : _mixin({ - deep: true, - inherited: inherited, - sources: [item], - target: {} - }); - }); - } - function _mixin(kwArgs) { - var deep = kwArgs.deep; - var inherited = kwArgs.inherited; - var target = kwArgs.target; - var copied = kwArgs.copied || []; - var copiedClone = tslib_1.__spread(copied); - for (var i = 0; i < kwArgs.sources.length; i++) { - var source = kwArgs.sources[i]; - if (source === null || source === undefined) { - continue; - } - for (var key in source) { - if (inherited || hasOwnProperty.call(source, key)) { - var value = source[key]; - if (copiedClone.indexOf(value) !== -1) { - continue; - } - if (deep) { - if (Array.isArray(value)) { - value = copyArray(value, inherited); - } - else if (shouldDeepCopyObject(value)) { - var targetValue = target[key] || {}; - copied.push(source); - value = _mixin({ - deep: true, - inherited: inherited, - sources: [value], - target: targetValue, - copied: copied - }); - } - } - target[key] = value; - } - } - } - return target; - } - function create(prototype) { - var mixins = []; - for (var _i = 1; _i < arguments.length; _i++) { - mixins[_i - 1] = arguments[_i]; - } - if (!mixins.length) { - throw new RangeError('lang.create requires at least one mixin object.'); - } - var args = mixins.slice(); - args.unshift(Object.create(prototype)); - return object_1.assign.apply(null, args); - } - exports.create = create; - function deepAssign(target) { - var sources = []; - for (var _i = 1; _i < arguments.length; _i++) { - sources[_i - 1] = arguments[_i]; - } - return _mixin({ - deep: true, - inherited: false, - sources: sources, - target: target - }); - } - exports.deepAssign = deepAssign; - function deepMixin(target) { - var sources = []; - for (var _i = 1; _i < arguments.length; _i++) { - sources[_i - 1] = arguments[_i]; - } - return _mixin({ - deep: true, - inherited: true, - sources: sources, - target: target - }); - } - exports.deepMixin = deepMixin; - /** - * Creates a new object using the provided source's prototype as the prototype for the new object, and then - * deep copies the provided source's values into the new target. - * - * @param source The object to duplicate - * @return The new object - */ - function duplicate(source) { - var target = Object.create(Object.getPrototypeOf(source)); - return deepMixin(target, source); - } - exports.duplicate = duplicate; - /** - * Determines whether two values are the same value. - * - * @param a First value to compare - * @param b Second value to compare - * @return true if the values are the same; false otherwise - */ - function isIdentical(a, b) { - return (a === b || - /* both values are NaN */ - (a !== a && b !== b)); - } - exports.isIdentical = isIdentical; - /** - * Returns a function that binds a method to the specified object at runtime. This is similar to - * `Function.prototype.bind`, but instead of a function it takes the name of a method on an object. - * As a result, the function returned by `lateBind` will always call the function currently assigned to - * the specified property on the object as of the moment the function it returns is called. - * - * @param instance The context object - * @param method The name of the method on the context object to bind to itself - * @param suppliedArgs An optional array of values to prepend to the `instance[method]` arguments list - * @return The bound function - */ - function lateBind(instance, method) { - var suppliedArgs = []; - for (var _i = 2; _i < arguments.length; _i++) { - suppliedArgs[_i - 2] = arguments[_i]; - } - return suppliedArgs.length - ? function () { - var args = arguments.length ? suppliedArgs.concat(slice.call(arguments)) : suppliedArgs; - // TS7017 - return instance[method].apply(instance, args); - } - : function () { - // TS7017 - return instance[method].apply(instance, arguments); - }; - } - exports.lateBind = lateBind; - function mixin(target) { - var sources = []; - for (var _i = 1; _i < arguments.length; _i++) { - sources[_i - 1] = arguments[_i]; - } - return _mixin({ - deep: false, - inherited: true, - sources: sources, - target: target - }); - } - exports.mixin = mixin; - /** - * Returns a function which invokes the given function with the given arguments prepended to its argument list. - * Like `Function.prototype.bind`, but does not alter execution context. - * - * @param targetFunction The function that needs to be bound - * @param suppliedArgs An optional array of arguments to prepend to the `targetFunction` arguments list - * @return The bound function - */ - function partial(targetFunction) { - var suppliedArgs = []; - for (var _i = 1; _i < arguments.length; _i++) { - suppliedArgs[_i - 1] = arguments[_i]; - } - return function () { - var args = arguments.length ? suppliedArgs.concat(slice.call(arguments)) : suppliedArgs; - return targetFunction.apply(this, args); - }; - } - exports.partial = partial; - /** - * Returns an object with a destroy method that, when called, calls the passed-in destructor. - * This is intended to provide a unified interface for creating "remove" / "destroy" handlers for - * event listeners, timers, etc. - * - * @param destructor A function that will be called when the handle's `destroy` method is invoked - * @return The handle object - */ - function createHandle(destructor) { - var called = false; - return { - destroy: function () { - if (!called) { - called = true; - destructor(); - } - } - }; - } - exports.createHandle = createHandle; - /** - * Returns a single handle that can be used to destroy multiple handles simultaneously. - * - * @param handles An array of handles with `destroy` methods - * @return The handle object - */ - function createCompositeHandle() { - var handles = []; - for (var _i = 0; _i < arguments.length; _i++) { - handles[_i] = arguments[_i]; - } - return createHandle(function () { - for (var i = 0; i < handles.length; i++) { - handles[i].destroy(); - } - }); - } - exports.createCompositeHandle = createCompositeHandle; -}); -//# sourceMappingURL=lang.js.map \ No newline at end of file diff --git a/deps/framework/core/lang.js.map b/deps/framework/core/lang.js.map deleted file mode 100644 index 192ee3689a..0000000000 --- a/deps/framework/core/lang.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"lang.js","sourceRoot":"","sources":["lang.ts"],"names":[],"mappings":";;;;;;;;;;;;IACA,yCAAwC;IAExC,yCAAwC;IAA/B,0BAAA,MAAM,CAAA;IAEf,IAAM,KAAK,GAAG,KAAK,CAAC,SAAS,CAAC,KAAK,CAAC;IACpC,IAAM,cAAc,GAAG,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC;IAEvD;;;;;;;;;OASG;IACH,8BAA8B,KAAU;QACvC,MAAM,CAAC,MAAM,CAAC,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,iBAAiB,CAAC;IACpE,CAAC;IAED,mBAAsB,KAAU,EAAE,SAAkB;QACnD,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,UAAS,IAAO;YAChC,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;gBACzB,MAAM,CAAM,SAAS,CAAM,IAAI,EAAE,SAAS,CAAC,CAAC;YAC7C,CAAC;YAED,MAAM,CAAC,CAAC,oBAAoB,CAAC,IAAI,CAAC;gBACjC,CAAC,CAAC,IAAI;gBACN,CAAC,CAAC,MAAM,CAAC;oBACP,IA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C,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;gBACzC,OAAO,CAAC,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC;YACtB,CAAC;QACF,CAAC,CAAC,CAAC;IACJ,CAAC;IAND,sDAMC","sourcesContent":["import { Handle } from './interfaces';\nimport { assign } from '../shim/object';\n\nexport { assign } from '../shim/object';\n\nconst slice = Array.prototype.slice;\nconst hasOwnProperty = Object.prototype.hasOwnProperty;\n\n/**\n * Type guard that ensures that the value can be coerced to Object\n * to weed out host objects that do not derive from Object.\n * This function is used to check if we want to deep copy an object or not.\n * Note: In ES6 it is possible to modify an object's Symbol.toStringTag property, which will\n * change the value returned by `toString`. This is a rare edge case that is difficult to handle,\n * so it is not handled here.\n * @param value The value to check\n * @return If the value is coercible into an Object\n */\nfunction shouldDeepCopyObject(value: any): value is Object {\n\treturn Object.prototype.toString.call(value) === '[object Object]';\n}\n\nfunction copyArray(array: T[], inherited: boolean): T[] {\n\treturn array.map(function(item: T): T {\n\t\tif (Array.isArray(item)) {\n\t\t\treturn copyArray(item, inherited);\n\t\t}\n\n\t\treturn !shouldDeepCopyObject(item)\n\t\t\t? item\n\t\t\t: _mixin({\n\t\t\t\t\tdeep: true,\n\t\t\t\t\tinherited: inherited,\n\t\t\t\t\tsources: >[item],\n\t\t\t\t\ttarget: {}\n\t\t\t\t});\n\t});\n}\n\ninterface MixinArgs {\n\tdeep: boolean;\n\tinherited: boolean;\n\tsources: (U | null | undefined)[];\n\ttarget: T;\n\tcopied?: any[];\n}\n\nfunction _mixin(kwArgs: MixinArgs): T & U {\n\tconst deep = kwArgs.deep;\n\tconst inherited = kwArgs.inherited;\n\tconst target: any = kwArgs.target;\n\tconst copied = kwArgs.copied || [];\n\tconst copiedClone = [...copied];\n\n\tfor (let i = 0; i < kwArgs.sources.length; i++) {\n\t\tconst source = kwArgs.sources[i];\n\n\t\tif (source === null || source === undefined) {\n\t\t\tcontinue;\n\t\t}\n\t\tfor (let key in source) {\n\t\t\tif (inherited || hasOwnProperty.call(source, key)) {\n\t\t\t\tlet value: any = source[key];\n\n\t\t\t\tif (copiedClone.indexOf(value) !== -1) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tif (deep) {\n\t\t\t\t\tif (Array.isArray(value)) {\n\t\t\t\t\t\tvalue = copyArray(value, inherited);\n\t\t\t\t\t} else if (shouldDeepCopyObject(value)) {\n\t\t\t\t\t\tconst targetValue: any = target[key] || {};\n\t\t\t\t\t\tcopied.push(source);\n\t\t\t\t\t\tvalue = _mixin({\n\t\t\t\t\t\t\tdeep: true,\n\t\t\t\t\t\t\tinherited: inherited,\n\t\t\t\t\t\t\tsources: [value],\n\t\t\t\t\t\t\ttarget: targetValue,\n\t\t\t\t\t\t\tcopied\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\ttarget[key] = value;\n\t\t\t}\n\t\t}\n\t}\n\n\treturn target;\n}\n\n/**\n * Creates a new object from the given prototype, and copies all enumerable own properties of one or more\n * source objects to the newly created target object.\n *\n * @param prototype The prototype to create a new object from\n * @param mixins Any number of objects whose enumerable own properties will be copied to the created object\n * @return The new object\n */\nexport function create<\n\tT extends {},\n\tU extends {},\n\tV extends {},\n\tW extends {},\n\tX extends {},\n\tY extends {},\n\tZ extends {}\n>(prototype: T, mixin1: U, mixin2: V, mixin3: W, mixin4: X, mixin5: Y, mixin6: Z): T & U & V & W & X & Y & Z;\nexport function create(\n\tprototype: T,\n\tmixin1: U,\n\tmixin2: V,\n\tmixin3: W,\n\tmixin4: X,\n\tmixin5: Y\n): T & U & V & W & X & Y;\nexport function create(\n\tprototype: T,\n\tmixin1: U,\n\tmixin2: V,\n\tmixin3: W,\n\tmixin4: X\n): T & U & V & W & X;\nexport function create(\n\tprototype: T,\n\tmixin1: U,\n\tmixin2: V,\n\tmixin3: W\n): T & U & V & W;\nexport function create(prototype: T, mixin1: U, mixin2: V): T & U & V;\nexport function create(prototype: T, mixin: U): T & U;\nexport function create(prototype: T): T;\nexport function create(prototype: any, ...mixins: any[]): any {\n\tif (!mixins.length) {\n\t\tthrow new RangeError('lang.create requires at least one mixin object.');\n\t}\n\n\tconst args = mixins.slice();\n\targs.unshift(Object.create(prototype));\n\n\treturn assign.apply(null, args);\n}\n\n/**\n * Copies the values of all enumerable own properties of one or more source objects to the target object,\n * recursively copying all nested objects and arrays as well.\n *\n * @param target The target object to receive values from source objects\n * @param sources Any number of objects whose enumerable own properties will be copied to the target object\n * @return The modified target object\n */\nexport function deepAssign<\n\tT extends {},\n\tU extends {},\n\tV extends {},\n\tW extends {},\n\tX extends {},\n\tY extends {},\n\tZ extends {}\n>(target: T, source1: U, source2: V, source3: W, source4: X, source5: Y, source6: Z): T & U & V & W & X & Y & Z;\nexport function deepAssign(\n\ttarget: T,\n\tsource1: U,\n\tsource2: V,\n\tsource3: W,\n\tsource4: X,\n\tsource5: Y\n): T & U & V & W & X & Y;\nexport function deepAssign(\n\ttarget: T,\n\tsource1: U,\n\tsource2: V,\n\tsource3: W,\n\tsource4: X\n): T & U & V & W & X;\nexport function deepAssign(\n\ttarget: T,\n\tsource1: U,\n\tsource2: V,\n\tsource3: W\n): T & U & V & W;\nexport function deepAssign(target: T, source1: U, source2: V): T & U & V;\nexport function deepAssign(target: T, source: U): T & U;\nexport function deepAssign(target: any, ...sources: any[]): any {\n\treturn _mixin({\n\t\tdeep: true,\n\t\tinherited: false,\n\t\tsources: sources,\n\t\ttarget: target\n\t});\n}\n\n/**\n * Copies the values of all enumerable (own or inherited) properties of one or more source objects to the\n * target object, recursively copying all nested objects and arrays as well.\n *\n * @param target The target object to receive values from source objects\n * @param sources Any number of objects whose enumerable properties will be copied to the target object\n * @return The modified target object\n */\nexport function deepMixin<\n\tT extends {},\n\tU extends {},\n\tV extends {},\n\tW extends {},\n\tX extends {},\n\tY extends {},\n\tZ extends {}\n>(target: T, source1: U, source2: V, source3: W, source4: X, source5: Y, source6: Z): T & U & V & W & X & Y & Z;\nexport function deepMixin(\n\ttarget: T,\n\tsource1: U,\n\tsource2: V,\n\tsource3: W,\n\tsource4: X,\n\tsource5: Y\n): T & U & V & W & X & Y;\nexport function deepMixin(\n\ttarget: T,\n\tsource1: U,\n\tsource2: V,\n\tsource3: W,\n\tsource4: X\n): T & U & V & W & X;\nexport function deepMixin(\n\ttarget: T,\n\tsource1: U,\n\tsource2: V,\n\tsource3: W\n): T & U & V & W;\nexport function deepMixin(target: T, source1: U, source2: V): T & U & V;\nexport function deepMixin(target: T, source: U): T & U;\nexport function deepMixin(target: any, ...sources: any[]): any {\n\treturn _mixin({\n\t\tdeep: true,\n\t\tinherited: true,\n\t\tsources: sources,\n\t\ttarget: target\n\t});\n}\n\n/**\n * Creates a new object using the provided source's prototype as the prototype for the new object, and then\n * deep copies the provided source's values into the new target.\n *\n * @param source The object to duplicate\n * @return The new object\n */\nexport function duplicate(source: T): T {\n\tconst target = Object.create(Object.getPrototypeOf(source));\n\n\treturn deepMixin(target, source);\n}\n\n/**\n * Determines whether two values are the same value.\n *\n * @param a First value to compare\n * @param b Second value to compare\n * @return true if the values are the same; false otherwise\n */\nexport function isIdentical(a: any, b: any): boolean {\n\treturn (\n\t\ta === b ||\n\t\t/* both values are NaN */\n\t\t(a !== a && b !== b)\n\t);\n}\n\n/**\n * Returns a function that binds a method to the specified object at runtime. This is similar to\n * `Function.prototype.bind`, but instead of a function it takes the name of a method on an object.\n * As a result, the function returned by `lateBind` will always call the function currently assigned to\n * the specified property on the object as of the moment the function it returns is called.\n *\n * @param instance The context object\n * @param method The name of the method on the context object to bind to itself\n * @param suppliedArgs An optional array of values to prepend to the `instance[method]` arguments list\n * @return The bound function\n */\nexport function lateBind(instance: {}, method: string, ...suppliedArgs: any[]): (...args: any[]) => any {\n\treturn suppliedArgs.length\n\t\t? function() {\n\t\t\t\tconst args: any[] = arguments.length ? suppliedArgs.concat(slice.call(arguments)) : suppliedArgs;\n\n\t\t\t\t// TS7017\n\t\t\t\treturn (instance)[method].apply(instance, args);\n\t\t\t}\n\t\t: function() {\n\t\t\t\t// TS7017\n\t\t\t\treturn (instance)[method].apply(instance, arguments);\n\t\t\t};\n}\n\n/**\n * Copies the values of all enumerable (own or inherited) properties of one or more source objects to the\n * target object.\n *\n * @return The modified target object\n */\nexport function mixin(\n\ttarget: T,\n\tsource1: U,\n\tsource2: V,\n\tsource3: W,\n\tsource4: X,\n\tsource5: Y,\n\tsource6: Z\n): T & U & V & W & X & Y & Z;\nexport function mixin(\n\ttarget: T,\n\tsource1: U,\n\tsource2: V,\n\tsource3: W,\n\tsource4: X,\n\tsource5: Y\n): T & U & V & W & X & Y;\nexport function mixin(\n\ttarget: T,\n\tsource1: U,\n\tsource2: V,\n\tsource3: W,\n\tsource4: X\n): T & U & V & W & X;\nexport function mixin(\n\ttarget: T,\n\tsource1: U,\n\tsource2: V,\n\tsource3: W\n): T & U & V & W;\nexport function mixin(target: T, source1: U, source2: V): T & U & V;\nexport function mixin(target: T, source: U): T & U;\nexport function mixin(target: any, ...sources: any[]): any {\n\treturn _mixin({\n\t\tdeep: false,\n\t\tinherited: true,\n\t\tsources: sources,\n\t\ttarget: target\n\t});\n}\n\n/**\n * Returns a function which invokes the given function with the given arguments prepended to its argument list.\n * Like `Function.prototype.bind`, but does not alter execution context.\n *\n * @param targetFunction The function that needs to be bound\n * @param suppliedArgs An optional array of arguments to prepend to the `targetFunction` arguments list\n * @return The bound function\n */\nexport function partial(targetFunction: (...args: any[]) => any, ...suppliedArgs: any[]): (...args: any[]) => any {\n\treturn function(this: any) {\n\t\tconst args: any[] = arguments.length ? suppliedArgs.concat(slice.call(arguments)) : suppliedArgs;\n\n\t\treturn targetFunction.apply(this, args);\n\t};\n}\n\n/**\n * Returns an object with a destroy method that, when called, calls the passed-in destructor.\n * This is intended to provide a unified interface for creating \"remove\" / \"destroy\" handlers for\n * event listeners, timers, etc.\n *\n * @param destructor A function that will be called when the handle's `destroy` method is invoked\n * @return The handle object\n */\nexport function createHandle(destructor: () => void): Handle {\n\tlet called = false;\n\treturn {\n\t\tdestroy: function(this: Handle) {\n\t\t\tif (!called) {\n\t\t\t\tcalled = true;\n\t\t\t\tdestructor();\n\t\t\t}\n\t\t}\n\t};\n}\n\n/**\n * Returns a single handle that can be used to destroy multiple handles simultaneously.\n *\n * @param handles An array of handles with `destroy` methods\n * @return The handle object\n */\nexport function createCompositeHandle(...handles: Handle[]): Handle {\n\treturn createHandle(function() {\n\t\tfor (let i = 0; i < handles.length; i++) {\n\t\t\thandles[i].destroy();\n\t\t}\n\t});\n}\n"]} \ No newline at end of file diff --git a/deps/framework/core/lang.mjs b/deps/framework/core/lang.mjs deleted file mode 100644 index 0e628dbc63..0000000000 --- a/deps/framework/core/lang.mjs +++ /dev/null @@ -1,196 +0,0 @@ -import { assign } from '../shim/object'; -export { assign } from '../shim/object'; -const slice = Array.prototype.slice; -const hasOwnProperty = Object.prototype.hasOwnProperty; -/** - * Type guard that ensures that the value can be coerced to Object - * to weed out host objects that do not derive from Object. - * This function is used to check if we want to deep copy an object or not. - * Note: In ES6 it is possible to modify an object's Symbol.toStringTag property, which will - * change the value returned by `toString`. This is a rare edge case that is difficult to handle, - * so it is not handled here. - * @param value The value to check - * @return If the value is coercible into an Object - */ -function shouldDeepCopyObject(value) { - return Object.prototype.toString.call(value) === '[object Object]'; -} -function copyArray(array, inherited) { - return array.map(function (item) { - if (Array.isArray(item)) { - return copyArray(item, inherited); - } - return !shouldDeepCopyObject(item) - ? item - : _mixin({ - deep: true, - inherited: inherited, - sources: [item], - target: {} - }); - }); -} -function _mixin(kwArgs) { - const deep = kwArgs.deep; - const inherited = kwArgs.inherited; - const target = kwArgs.target; - const copied = kwArgs.copied || []; - const copiedClone = [...copied]; - for (let i = 0; i < kwArgs.sources.length; i++) { - const source = kwArgs.sources[i]; - if (source === null || source === undefined) { - continue; - } - for (let key in source) { - if (inherited || hasOwnProperty.call(source, key)) { - let value = source[key]; - if (copiedClone.indexOf(value) !== -1) { - continue; - } - if (deep) { - if (Array.isArray(value)) { - value = copyArray(value, inherited); - } - else if (shouldDeepCopyObject(value)) { - const targetValue = target[key] || {}; - copied.push(source); - value = _mixin({ - deep: true, - inherited: inherited, - sources: [value], - target: targetValue, - copied - }); - } - } - target[key] = value; - } - } - } - return target; -} -export function create(prototype, ...mixins) { - if (!mixins.length) { - throw new RangeError('lang.create requires at least one mixin object.'); - } - const args = mixins.slice(); - args.unshift(Object.create(prototype)); - return assign.apply(null, args); -} -export function deepAssign(target, ...sources) { - return _mixin({ - deep: true, - inherited: false, - sources: sources, - target: target - }); -} -export function deepMixin(target, ...sources) { - return _mixin({ - deep: true, - inherited: true, - sources: sources, - target: target - }); -} -/** - * Creates a new object using the provided source's prototype as the prototype for the new object, and then - * deep copies the provided source's values into the new target. - * - * @param source The object to duplicate - * @return The new object - */ -export function duplicate(source) { - const target = Object.create(Object.getPrototypeOf(source)); - return deepMixin(target, source); -} -/** - * Determines whether two values are the same value. - * - * @param a First value to compare - * @param b Second value to compare - * @return true if the values are the same; false otherwise - */ -export function isIdentical(a, b) { - return (a === b || - /* both values are NaN */ - (a !== a && b !== b)); -} -/** - * Returns a function that binds a method to the specified object at runtime. This is similar to - * `Function.prototype.bind`, but instead of a function it takes the name of a method on an object. - * As a result, the function returned by `lateBind` will always call the function currently assigned to - * the specified property on the object as of the moment the function it returns is called. - * - * @param instance The context object - * @param method The name of the method on the context object to bind to itself - * @param suppliedArgs An optional array of values to prepend to the `instance[method]` arguments list - * @return The bound function - */ -export function lateBind(instance, method, ...suppliedArgs) { - return suppliedArgs.length - ? function () { - const args = arguments.length ? suppliedArgs.concat(slice.call(arguments)) : suppliedArgs; - // TS7017 - return instance[method].apply(instance, args); - } - : function () { - // TS7017 - return instance[method].apply(instance, arguments); - }; -} -export function mixin(target, ...sources) { - return _mixin({ - deep: false, - inherited: true, - sources: sources, - target: target - }); -} -/** - * Returns a function which invokes the given function with the given arguments prepended to its argument list. - * Like `Function.prototype.bind`, but does not alter execution context. - * - * @param targetFunction The function that needs to be bound - * @param suppliedArgs An optional array of arguments to prepend to the `targetFunction` arguments list - * @return The bound function - */ -export function partial(targetFunction, ...suppliedArgs) { - return function () { - const args = arguments.length ? suppliedArgs.concat(slice.call(arguments)) : suppliedArgs; - return targetFunction.apply(this, args); - }; -} -/** - * Returns an object with a destroy method that, when called, calls the passed-in destructor. - * This is intended to provide a unified interface for creating "remove" / "destroy" handlers for - * event listeners, timers, etc. - * - * @param destructor A function that will be called when the handle's `destroy` method is invoked - * @return The handle object - */ -export function createHandle(destructor) { - let called = false; - return { - destroy: function () { - if (!called) { - called = true; - destructor(); - } - } - }; -} -/** - * Returns a single handle that can be used to destroy multiple handles simultaneously. - * - * @param handles An array of handles with `destroy` methods - * @return The handle object - */ -export function createCompositeHandle(...handles) { - return createHandle(function () { - for (let i = 0; i < handles.length; i++) { - handles[i].destroy(); - } - }); -} -//# sourceMappingURL=lang.mjs.map \ No newline at end of file diff --git a/deps/framework/core/lang.mjs.map b/deps/framework/core/lang.mjs.map deleted file mode 100644 index e2d14dfe8e..0000000000 --- a/deps/framework/core/lang.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"lang.mjs","sourceRoot":"","sources":["lang.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAExC,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAExC,MAAM,KAAK,GAAG,KAAK,CAAC,SAAS,CAAC,KAAK,CAAC;AACpC,MAAM,cAAc,GAAG,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC;AAEvD;;;;;;;;;GASG;AACH,8BAA8B,KAAU;IACvC,MAAM,CAAC,MAAM,CAAC,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,iBAAiB,CAAC;AACpE,CAAC;AAED,mBAAsB,KAAU,EAAE,SAAkB;IACnD,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC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;AACJ,CAAC","sourcesContent":["import { Handle } from './interfaces';\nimport { assign } from '../shim/object';\n\nexport { assign } from '../shim/object';\n\nconst slice = Array.prototype.slice;\nconst hasOwnProperty = Object.prototype.hasOwnProperty;\n\n/**\n * Type guard that ensures that the value can be coerced to Object\n * to weed out host objects that do not derive from Object.\n * This function is used to check if we want to deep copy an object or not.\n * Note: In ES6 it is possible to modify an object's Symbol.toStringTag property, which will\n * change the value returned by `toString`. This is a rare edge case that is difficult to handle,\n * so it is not handled here.\n * @param value The value to check\n * @return If the value is coercible into an Object\n */\nfunction shouldDeepCopyObject(value: any): value is Object {\n\treturn Object.prototype.toString.call(value) === '[object Object]';\n}\n\nfunction copyArray(array: T[], inherited: boolean): T[] {\n\treturn array.map(function(item: T): T {\n\t\tif (Array.isArray(item)) {\n\t\t\treturn copyArray(item, inherited);\n\t\t}\n\n\t\treturn !shouldDeepCopyObject(item)\n\t\t\t? item\n\t\t\t: _mixin({\n\t\t\t\t\tdeep: true,\n\t\t\t\t\tinherited: inherited,\n\t\t\t\t\tsources: >[item],\n\t\t\t\t\ttarget: {}\n\t\t\t\t});\n\t});\n}\n\ninterface MixinArgs {\n\tdeep: boolean;\n\tinherited: boolean;\n\tsources: (U | null | undefined)[];\n\ttarget: T;\n\tcopied?: any[];\n}\n\nfunction _mixin(kwArgs: MixinArgs): T & U {\n\tconst deep = kwArgs.deep;\n\tconst inherited = kwArgs.inherited;\n\tconst target: any = kwArgs.target;\n\tconst copied = kwArgs.copied || [];\n\tconst copiedClone = [...copied];\n\n\tfor (let i = 0; i < kwArgs.sources.length; i++) {\n\t\tconst source = kwArgs.sources[i];\n\n\t\tif (source === null || source === undefined) {\n\t\t\tcontinue;\n\t\t}\n\t\tfor (let key in source) {\n\t\t\tif (inherited || hasOwnProperty.call(source, key)) {\n\t\t\t\tlet value: any = source[key];\n\n\t\t\t\tif (copiedClone.indexOf(value) !== -1) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tif (deep) {\n\t\t\t\t\tif (Array.isArray(value)) {\n\t\t\t\t\t\tvalue = copyArray(value, inherited);\n\t\t\t\t\t} else if (shouldDeepCopyObject(value)) {\n\t\t\t\t\t\tconst targetValue: any = target[key] || {};\n\t\t\t\t\t\tcopied.push(source);\n\t\t\t\t\t\tvalue = _mixin({\n\t\t\t\t\t\t\tdeep: true,\n\t\t\t\t\t\t\tinherited: inherited,\n\t\t\t\t\t\t\tsources: [value],\n\t\t\t\t\t\t\ttarget: targetValue,\n\t\t\t\t\t\t\tcopied\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\ttarget[key] = value;\n\t\t\t}\n\t\t}\n\t}\n\n\treturn target;\n}\n\n/**\n * Creates a new object from the given prototype, and copies all enumerable own properties of one or more\n * source objects to the newly created target object.\n *\n * @param prototype The prototype to create a new object from\n * @param mixins Any number of objects whose enumerable own properties will be copied to the created object\n * @return The new object\n */\nexport function create<\n\tT extends {},\n\tU extends {},\n\tV extends {},\n\tW extends {},\n\tX extends {},\n\tY extends {},\n\tZ extends {}\n>(prototype: T, mixin1: U, mixin2: V, mixin3: W, mixin4: X, mixin5: Y, mixin6: Z): T & U & V & W & X & Y & Z;\nexport function create(\n\tprototype: T,\n\tmixin1: U,\n\tmixin2: V,\n\tmixin3: W,\n\tmixin4: X,\n\tmixin5: Y\n): T & U & V & W & X & Y;\nexport function create(\n\tprototype: T,\n\tmixin1: U,\n\tmixin2: V,\n\tmixin3: W,\n\tmixin4: X\n): T & U & V & W & X;\nexport function create(\n\tprototype: T,\n\tmixin1: U,\n\tmixin2: V,\n\tmixin3: W\n): T & U & V & W;\nexport function create(prototype: T, mixin1: U, mixin2: V): T & U & V;\nexport function create(prototype: T, mixin: U): T & U;\nexport function create(prototype: T): T;\nexport function create(prototype: any, ...mixins: any[]): any {\n\tif (!mixins.length) {\n\t\tthrow new RangeError('lang.create requires at least one mixin object.');\n\t}\n\n\tconst args = mixins.slice();\n\targs.unshift(Object.create(prototype));\n\n\treturn assign.apply(null, args);\n}\n\n/**\n * Copies the values of all enumerable own properties of one or more source objects to the target object,\n * recursively copying all nested objects and arrays as well.\n *\n * @param target The target object to receive values from source objects\n * @param sources Any number of objects whose enumerable own properties will be copied to the target object\n * @return The modified target object\n */\nexport function deepAssign<\n\tT extends {},\n\tU extends {},\n\tV extends {},\n\tW extends {},\n\tX extends {},\n\tY extends {},\n\tZ extends {}\n>(target: T, source1: U, source2: V, source3: W, source4: X, source5: Y, source6: Z): T & U & V & W & X & Y & Z;\nexport function deepAssign(\n\ttarget: T,\n\tsource1: U,\n\tsource2: V,\n\tsource3: W,\n\tsource4: X,\n\tsource5: Y\n): T & U & V & W & X & Y;\nexport function deepAssign(\n\ttarget: T,\n\tsource1: U,\n\tsource2: V,\n\tsource3: W,\n\tsource4: X\n): T & U & V & W & X;\nexport function deepAssign(\n\ttarget: T,\n\tsource1: U,\n\tsource2: V,\n\tsource3: W\n): T & U & V & W;\nexport function deepAssign(target: T, source1: U, source2: V): T & U & V;\nexport function deepAssign(target: T, source: U): T & U;\nexport function deepAssign(target: any, ...sources: any[]): any {\n\treturn _mixin({\n\t\tdeep: true,\n\t\tinherited: false,\n\t\tsources: sources,\n\t\ttarget: target\n\t});\n}\n\n/**\n * Copies the values of all enumerable (own or inherited) properties of one or more source objects to the\n * target object, recursively copying all nested objects and arrays as well.\n *\n * @param target The target object to receive values from source objects\n * @param sources Any number of objects whose enumerable properties will be copied to the target object\n * @return The modified target object\n */\nexport function deepMixin<\n\tT extends {},\n\tU extends {},\n\tV extends {},\n\tW extends {},\n\tX extends {},\n\tY extends {},\n\tZ extends {}\n>(target: T, source1: U, source2: V, source3: W, source4: X, source5: Y, source6: Z): T & U & V & W & X & Y & Z;\nexport function deepMixin(\n\ttarget: T,\n\tsource1: U,\n\tsource2: V,\n\tsource3: W,\n\tsource4: X,\n\tsource5: Y\n): T & U & V & W & X & Y;\nexport function deepMixin(\n\ttarget: T,\n\tsource1: U,\n\tsource2: V,\n\tsource3: W,\n\tsource4: X\n): T & U & V & W & X;\nexport function deepMixin(\n\ttarget: T,\n\tsource1: U,\n\tsource2: V,\n\tsource3: W\n): T & U & V & W;\nexport function deepMixin(target: T, source1: U, source2: V): T & U & V;\nexport function deepMixin(target: T, source: U): T & U;\nexport function deepMixin(target: any, ...sources: any[]): any {\n\treturn _mixin({\n\t\tdeep: true,\n\t\tinherited: true,\n\t\tsources: sources,\n\t\ttarget: target\n\t});\n}\n\n/**\n * Creates a new object using the provided source's prototype as the prototype for the new object, and then\n * deep copies the provided source's values into the new target.\n *\n * @param source The object to duplicate\n * @return The new object\n */\nexport function duplicate(source: T): T {\n\tconst target = Object.create(Object.getPrototypeOf(source));\n\n\treturn deepMixin(target, source);\n}\n\n/**\n * Determines whether two values are the same value.\n *\n * @param a First value to compare\n * @param b Second value to compare\n * @return true if the values are the same; false otherwise\n */\nexport function isIdentical(a: any, b: any): boolean {\n\treturn (\n\t\ta === b ||\n\t\t/* both values are NaN */\n\t\t(a !== a && b !== b)\n\t);\n}\n\n/**\n * Returns a function that binds a method to the specified object at runtime. This is similar to\n * `Function.prototype.bind`, but instead of a function it takes the name of a method on an object.\n * As a result, the function returned by `lateBind` will always call the function currently assigned to\n * the specified property on the object as of the moment the function it returns is called.\n *\n * @param instance The context object\n * @param method The name of the method on the context object to bind to itself\n * @param suppliedArgs An optional array of values to prepend to the `instance[method]` arguments list\n * @return The bound function\n */\nexport function lateBind(instance: {}, method: string, ...suppliedArgs: any[]): (...args: any[]) => any {\n\treturn suppliedArgs.length\n\t\t? function() {\n\t\t\t\tconst args: any[] = arguments.length ? suppliedArgs.concat(slice.call(arguments)) : suppliedArgs;\n\n\t\t\t\t// TS7017\n\t\t\t\treturn (instance)[method].apply(instance, args);\n\t\t\t}\n\t\t: function() {\n\t\t\t\t// TS7017\n\t\t\t\treturn (instance)[method].apply(instance, arguments);\n\t\t\t};\n}\n\n/**\n * Copies the values of all enumerable (own or inherited) properties of one or more source objects to the\n * target object.\n *\n * @return The modified target object\n */\nexport function mixin(\n\ttarget: T,\n\tsource1: U,\n\tsource2: V,\n\tsource3: W,\n\tsource4: X,\n\tsource5: Y,\n\tsource6: Z\n): T & U & V & W & X & Y & Z;\nexport function mixin(\n\ttarget: T,\n\tsource1: U,\n\tsource2: V,\n\tsource3: W,\n\tsource4: X,\n\tsource5: Y\n): T & U & V & W & X & Y;\nexport function mixin(\n\ttarget: T,\n\tsource1: U,\n\tsource2: V,\n\tsource3: W,\n\tsource4: X\n): T & U & V & W & X;\nexport function mixin(\n\ttarget: T,\n\tsource1: U,\n\tsource2: V,\n\tsource3: W\n): T & U & V & W;\nexport function mixin(target: T, source1: U, source2: V): T & U & V;\nexport function mixin(target: T, source: U): T & U;\nexport function mixin(target: any, ...sources: any[]): any {\n\treturn _mixin({\n\t\tdeep: false,\n\t\tinherited: true,\n\t\tsources: sources,\n\t\ttarget: target\n\t});\n}\n\n/**\n * Returns a function which invokes the given function with the given arguments prepended to its argument list.\n * Like `Function.prototype.bind`, but does not alter execution context.\n *\n * @param targetFunction The function that needs to be bound\n * @param suppliedArgs An optional array of arguments to prepend to the `targetFunction` arguments list\n * @return The bound function\n */\nexport function partial(targetFunction: (...args: any[]) => any, ...suppliedArgs: any[]): (...args: any[]) => any {\n\treturn function(this: any) {\n\t\tconst args: any[] = arguments.length ? suppliedArgs.concat(slice.call(arguments)) : suppliedArgs;\n\n\t\treturn targetFunction.apply(this, args);\n\t};\n}\n\n/**\n * Returns an object with a destroy method that, when called, calls the passed-in destructor.\n * This is intended to provide a unified interface for creating \"remove\" / \"destroy\" handlers for\n * event listeners, timers, etc.\n *\n * @param destructor A function that will be called when the handle's `destroy` method is invoked\n * @return The handle object\n */\nexport function createHandle(destructor: () => void): Handle {\n\tlet called = false;\n\treturn {\n\t\tdestroy: function(this: Handle) {\n\t\t\tif (!called) {\n\t\t\t\tcalled = true;\n\t\t\t\tdestructor();\n\t\t\t}\n\t\t}\n\t};\n}\n\n/**\n * Returns a single handle that can be used to destroy multiple handles simultaneously.\n *\n * @param handles An array of handles with `destroy` methods\n * @return The handle object\n */\nexport function createCompositeHandle(...handles: Handle[]): Handle {\n\treturn createHandle(function() {\n\t\tfor (let i = 0; i < handles.length; i++) {\n\t\t\thandles[i].destroy();\n\t\t}\n\t});\n}\n"]} \ No newline at end of file diff --git a/deps/framework/core/load.d.ts b/deps/framework/core/load.d.ts deleted file mode 100644 index aa5233ca9f..0000000000 --- a/deps/framework/core/load.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { AmdRequire, NodeRequire } from './interfaces'; -import { isPlugin, useDefault } from './load/util'; -export declare type Require = AmdRequire | NodeRequire; -export interface Load { - (require: Require, ...moduleIds: string[]): Promise; - (...moduleIds: string[]): Promise; -} -export declare function isAmdRequire(object: any): object is AmdRequire; -export declare function isNodeRequire(object: any): object is NodeRequire; -declare const load: Load; -export default load; -export { isPlugin, useDefault }; diff --git a/deps/framework/core/load.js b/deps/framework/core/load.js deleted file mode 100644 index cff64a85d2..0000000000 --- a/deps/framework/core/load.js +++ /dev/null @@ -1,113 +0,0 @@ -(function (factory) { - if (typeof module === "object" && typeof module.exports === "object") { - var v = factory(require, exports); - if (v !== undefined) module.exports = v; - } - else if (typeof define === "function" && define.amd) { - define(["require", "exports", "../shim/Promise", "./load/util"], factory); - } -})(function (require, exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - var Promise_1 = require("../shim/Promise"); - var util_1 = require("./load/util"); - exports.isPlugin = util_1.isPlugin; - exports.useDefault = util_1.useDefault; - function isAmdRequire(object) { - return typeof object.toUrl === 'function'; - } - exports.isAmdRequire = isAmdRequire; - function isNodeRequire(object) { - return typeof object.resolve === 'function'; - } - exports.isNodeRequire = isNodeRequire; - var load = (function () { - var resolver = isAmdRequire(require) - ? require.toUrl - : isNodeRequire(require) ? require.resolve : function (resourceId) { return resourceId; }; - function pluginLoad(moduleIds, load, loader) { - var pluginResourceIds = []; - moduleIds = moduleIds.map(function (id, i) { - var parts = id.split('!'); - pluginResourceIds[i] = parts[1]; - return parts[0]; - }); - return loader(moduleIds).then(function (modules) { - pluginResourceIds.forEach(function (resourceId, i) { - if (typeof resourceId === 'string') { - var module_1 = modules[i]; - var defaultExport = module_1['default'] || module_1; - if (util_1.isPlugin(defaultExport)) { - resourceId = - typeof defaultExport.normalize === 'function' - ? defaultExport.normalize(resourceId, resolver) - : resolver(resourceId); - modules[i] = defaultExport.load(resourceId, load); - } - } - }); - return Promise_1.default.all(modules); - }); - } - if (typeof module === 'object' && typeof module.exports === 'object') { - return function load(contextualRequire) { - var moduleIds = []; - for (var _i = 1; _i < arguments.length; _i++) { - moduleIds[_i - 1] = arguments[_i]; - } - if (typeof contextualRequire === 'string') { - moduleIds.unshift(contextualRequire); - contextualRequire = require; - } - return pluginLoad(moduleIds, load, function (moduleIds) { - try { - return Promise_1.default.resolve(moduleIds.map(function (moduleId) { - return contextualRequire(moduleId.split('!')[0]); - })); - } - catch (error) { - return Promise_1.default.reject(error); - } - }); - }; - } - else if (typeof define === 'function' && define.amd) { - return function load(contextualRequire) { - var moduleIds = []; - for (var _i = 1; _i < arguments.length; _i++) { - moduleIds[_i - 1] = arguments[_i]; - } - if (typeof contextualRequire === 'string') { - moduleIds.unshift(contextualRequire); - contextualRequire = require; - } - return pluginLoad(moduleIds, load, function (moduleIds) { - return new Promise_1.default(function (resolve, reject) { - var errorHandle; - if (typeof contextualRequire.on === 'function') { - errorHandle = contextualRequire.on('error', function (error) { - errorHandle.remove(); - reject(error); - }); - } - contextualRequire(moduleIds, function () { - var modules = []; - for (var _i = 0; _i < arguments.length; _i++) { - modules[_i] = arguments[_i]; - } - errorHandle && errorHandle.remove(); - resolve(modules); - }); - }); - }); - }; - } - else { - return function () { - return Promise_1.default.reject(new Error('Unknown loader')); - }; - } - })(); - exports.default = load; -}); -//# sourceMappingURL=load.js.map \ No newline at end of file diff --git a/deps/framework/core/load.js.map b/deps/framework/core/load.js.map deleted file mode 100644 index 19f4b81d21..0000000000 --- a/deps/framework/core/load.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ACpC,OAAO,CAAC,OAAO,CAAC,CAAC;wBAClB,CAAC,CAAC,CAAC;oBACJ,CAAC,CAAC,CAAC;gBACJ,CAAC,CAAC,CAAC;YACJ,CAAC,CAAC;QACH,CAAC;QAAC,IAAI,CAAC,CAAC;YACP,MAAM,CAAC;gBACN,MAAM,CAAC,iBAAO,CAAC,MAAM,CAAC,IAAI,KAAK,CAAC,gBAAgB,CAAC,CAAC,CAAC;YACpD,CAAC,CAAC;QACH,CAAC;IACF,CAAC,CAAC,EAAE,CAAC;IACL,kBAAe,IAAI,CAAC","sourcesContent":["import Promise from '../shim/Promise';\nimport { AmdRequire, AmdDefine, NodeRequire } from './interfaces';\nimport { isPlugin, useDefault } from './load/util';\n\nexport type Require = AmdRequire | NodeRequire;\n\nexport interface Load {\n\t(require: Require, ...moduleIds: string[]): Promise;\n\t(...moduleIds: string[]): Promise;\n}\n\ndeclare const require: Require;\n\ndeclare const define: AmdDefine;\n\nexport function isAmdRequire(object: any): object is AmdRequire {\n\treturn typeof object.toUrl === 'function';\n}\n\nexport function isNodeRequire(object: any): object is NodeRequire {\n\treturn typeof object.resolve === 'function';\n}\n\nconst load: Load = (function(): Load {\n\tconst resolver = isAmdRequire(require)\n\t\t? require.toUrl\n\t\t: isNodeRequire(require) ? require.resolve : (resourceId: string) => resourceId;\n\n\tfunction pluginLoad(moduleIds: string[], load: Load, loader: (modulesIds: string[]) => Promise) {\n\t\tconst pluginResourceIds: string[] = [];\n\t\tmoduleIds = moduleIds.map((id: string, i: number) => {\n\t\t\tconst parts = id.split('!');\n\t\t\tpluginResourceIds[i] = parts[1];\n\t\t\treturn parts[0];\n\t\t});\n\n\t\treturn loader(moduleIds).then((modules: any[]) => {\n\t\t\tpluginResourceIds.forEach((resourceId: string, i: number) => {\n\t\t\t\tif (typeof resourceId === 'string') {\n\t\t\t\t\tconst module = modules[i];\n\t\t\t\t\tconst defaultExport = module['default'] || module;\n\n\t\t\t\t\tif (isPlugin(defaultExport)) {\n\t\t\t\t\t\tresourceId =\n\t\t\t\t\t\t\ttypeof defaultExport.normalize === 'function'\n\t\t\t\t\t\t\t\t? defaultExport.normalize(resourceId, resolver)\n\t\t\t\t\t\t\t\t: resolver(resourceId);\n\n\t\t\t\t\t\tmodules[i] = defaultExport.load(resourceId, load);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\n\t\t\treturn Promise.all(modules);\n\t\t});\n\t}\n\n\tif (typeof module === 'object' && typeof module.exports === 'object') {\n\t\treturn function load(contextualRequire: any, ...moduleIds: string[]): Promise {\n\t\t\tif (typeof contextualRequire === 'string') {\n\t\t\t\tmoduleIds.unshift(contextualRequire);\n\t\t\t\tcontextualRequire = require;\n\t\t\t}\n\n\t\t\treturn pluginLoad(moduleIds, load, (moduleIds: string[]) => {\n\t\t\t\ttry {\n\t\t\t\t\treturn Promise.resolve(\n\t\t\t\t\t\tmoduleIds.map(function(moduleId): any {\n\t\t\t\t\t\t\treturn contextualRequire(moduleId.split('!')[0]);\n\t\t\t\t\t\t})\n\t\t\t\t\t);\n\t\t\t\t} catch (error) {\n\t\t\t\t\treturn Promise.reject(error);\n\t\t\t\t}\n\t\t\t});\n\t\t};\n\t} else if (typeof define === 'function' && define.amd) {\n\t\treturn function load(contextualRequire: any, ...moduleIds: string[]): Promise {\n\t\t\tif (typeof contextualRequire === 'string') {\n\t\t\t\tmoduleIds.unshift(contextualRequire);\n\t\t\t\tcontextualRequire = require;\n\t\t\t}\n\n\t\t\treturn pluginLoad(moduleIds, load, (moduleIds: string[]) => {\n\t\t\t\treturn new Promise(function(resolve, reject) {\n\t\t\t\t\tlet errorHandle: { remove: () => void };\n\n\t\t\t\t\tif (typeof contextualRequire.on === 'function') {\n\t\t\t\t\t\terrorHandle = contextualRequire.on('error', (error: Error) => {\n\t\t\t\t\t\t\terrorHandle.remove();\n\t\t\t\t\t\t\treject(error);\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\n\t\t\t\t\tcontextualRequire(moduleIds, function(...modules: any[]) {\n\t\t\t\t\t\terrorHandle && errorHandle.remove();\n\t\t\t\t\t\tresolve(modules);\n\t\t\t\t\t});\n\t\t\t\t});\n\t\t\t});\n\t\t};\n\t} else {\n\t\treturn function() {\n\t\t\treturn Promise.reject(new Error('Unknown loader'));\n\t\t};\n\t}\n})();\nexport default load;\n\nexport { isPlugin, useDefault };\n"]} \ No newline at end of file diff --git a/deps/framework/core/load.mjs b/deps/framework/core/load.mjs deleted file mode 100644 index 3173d222fe..0000000000 --- a/deps/framework/core/load.mjs +++ /dev/null @@ -1,86 +0,0 @@ -import Promise from '../shim/Promise'; -import { isPlugin, useDefault } from './load/util'; -export function isAmdRequire(object) { - return typeof object.toUrl === 'function'; -} -export function isNodeRequire(object) { - return typeof object.resolve === 'function'; -} -const load = (function () { - const resolver = isAmdRequire(require) - ? require.toUrl - : isNodeRequire(require) ? require.resolve : (resourceId) => resourceId; - function pluginLoad(moduleIds, load, loader) { - const pluginResourceIds = []; - moduleIds = moduleIds.map((id, i) => { - const parts = id.split('!'); - pluginResourceIds[i] = parts[1]; - return parts[0]; - }); - return loader(moduleIds).then((modules) => { - pluginResourceIds.forEach((resourceId, i) => { - if (typeof resourceId === 'string') { - const module = modules[i]; - const defaultExport = module['default'] || module; - if (isPlugin(defaultExport)) { - resourceId = - typeof defaultExport.normalize === 'function' - ? defaultExport.normalize(resourceId, resolver) - : resolver(resourceId); - modules[i] = defaultExport.load(resourceId, load); - } - } - }); - return Promise.all(modules); - }); - } - if (typeof module === 'object' && typeof module.exports === 'object') { - return function load(contextualRequire, ...moduleIds) { - if (typeof contextualRequire === 'string') { - moduleIds.unshift(contextualRequire); - contextualRequire = require; - } - return pluginLoad(moduleIds, load, (moduleIds) => { - try { - return Promise.resolve(moduleIds.map(function (moduleId) { - return contextualRequire(moduleId.split('!')[0]); - })); - } - catch (error) { - return Promise.reject(error); - } - }); - }; - } - else if (typeof define === 'function' && define.amd) { - return function load(contextualRequire, ...moduleIds) { - if (typeof contextualRequire === 'string') { - moduleIds.unshift(contextualRequire); - contextualRequire = require; - } - return pluginLoad(moduleIds, load, (moduleIds) => { - return new Promise(function (resolve, reject) { - let errorHandle; - if (typeof contextualRequire.on === 'function') { - errorHandle = contextualRequire.on('error', (error) => { - errorHandle.remove(); - reject(error); - }); - } - contextualRequire(moduleIds, function (...modules) { - errorHandle && errorHandle.remove(); - resolve(modules); - }); - }); - }); - }; - } - else { - return function () { - return Promise.reject(new Error('Unknown loader')); - }; - } -})(); -export default load; -export { isPlugin, useDefault }; -//# sourceMappingURL=load.mjs.map \ No newline at end of file diff --git a/deps/framework/core/load.mjs.map b/deps/framework/core/load.mjs.map deleted file mode 100644 index a1e85e79ae..0000000000 --- a/deps/framework/core/load.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"load.mjs","sourceRoot":"","sources":["load.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,iBAAiB,CAAC;AAEtC,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAanD,MAAM,uBAAuB,MAAW;IACvC,MAAM,CAAC,OAAO,MAAM,CAAC,KAAK,KAAK,UAAU,CAAC;AAC3C,CAAC;AAED,MAAM,wBAAwB,MAAW;IACxC,MAAM,CAAC,OAAO,MAAM,CAAC,OAAO,KAAK,UAAU,CAAC;AAC7C,CAAC;AAED,MAAM,IAAI,GAAS,CAAC;IACnB,MAAM,QAAQ,GAAG,YAAY,CAAC,OAAO,CAAC;QACrC,CAAC,CAAC,OAAO,CAAC,KAAK;QACf,CAAC,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,UAAkB,EAAE,EAAE,CAAC,UAAU,CAAC;IAEjF,oBAAoB,SAAmB,EAAE,IAAU,EAAE,MAA8C;QAClG,MAAM,iBAAiB,GAAa,EAAE,CAAC;QACvC,SAAS,GAAG,SAAS,CAAC,GAAG,CAAC,CAAC,EAAU,EAAE,CAAS,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,WAAW,GAAG,iBAAiB,CAAC,EAAE,CAAC,OAAO,EAAE,CAAC,KAAY,EAAE,EAAE;4BAC5D,WAAW,CAAC,MAAM,EAAE,CAAC;4BACrB,MAAM,CAAC,KAAK,CAAC,CAAC;wBACf,CAAC,CAAC,CAAC;oBACJ,CAAC;oBAED,iBAAiB,CAAC,SAAS,EAAE,UAAS,GAAG,OAAc;wBACtD,WAAW,IAAI,WAAW,CAAC,MAAM,EAAE,CAAC;wBACpC,OAAO,CAAC,OAAO,CAAC,CAAC;oBAClB,CAAC,CAAC,CAAC;gBACJ,CAAC,CAAC,CAAC;YACJ,CAAC,CAAC,CAAC;QACJ,CAAC,CAAC;IACH,CAAC;IAAC,IAAI,CAAC,CAAC;QACP,MAAM,CAAC;YACN,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,KAAK,CAAC,gBAAgB,CAAC,CAAC,CAAC;QACpD,CAAC,CAAC;IACH,CAAC;AACF,CAAC,CAAC,EAAE,CAAC;AACL,eAAe,IAAI,CAAC;AAEpB,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,CAAC","sourcesContent":["import Promise from '../shim/Promise';\nimport { AmdRequire, AmdDefine, NodeRequire } from './interfaces';\nimport { isPlugin, useDefault } from './load/util';\n\nexport type Require = AmdRequire | NodeRequire;\n\nexport interface Load {\n\t(require: Require, ...moduleIds: string[]): Promise;\n\t(...moduleIds: string[]): Promise;\n}\n\ndeclare const require: Require;\n\ndeclare const define: AmdDefine;\n\nexport function isAmdRequire(object: any): object is AmdRequire {\n\treturn typeof object.toUrl === 'function';\n}\n\nexport function isNodeRequire(object: any): object is NodeRequire {\n\treturn typeof object.resolve === 'function';\n}\n\nconst load: Load = (function(): Load {\n\tconst resolver = isAmdRequire(require)\n\t\t? require.toUrl\n\t\t: isNodeRequire(require) ? require.resolve : (resourceId: string) => resourceId;\n\n\tfunction pluginLoad(moduleIds: string[], load: Load, loader: (modulesIds: string[]) => Promise) {\n\t\tconst pluginResourceIds: string[] = [];\n\t\tmoduleIds = moduleIds.map((id: string, i: number) => {\n\t\t\tconst parts = id.split('!');\n\t\t\tpluginResourceIds[i] = parts[1];\n\t\t\treturn parts[0];\n\t\t});\n\n\t\treturn loader(moduleIds).then((modules: any[]) => {\n\t\t\tpluginResourceIds.forEach((resourceId: string, i: number) => {\n\t\t\t\tif (typeof resourceId === 'string') {\n\t\t\t\t\tconst module = modules[i];\n\t\t\t\t\tconst defaultExport = module['default'] || module;\n\n\t\t\t\t\tif (isPlugin(defaultExport)) {\n\t\t\t\t\t\tresourceId =\n\t\t\t\t\t\t\ttypeof defaultExport.normalize === 'function'\n\t\t\t\t\t\t\t\t? defaultExport.normalize(resourceId, resolver)\n\t\t\t\t\t\t\t\t: resolver(resourceId);\n\n\t\t\t\t\t\tmodules[i] = defaultExport.load(resourceId, load);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\n\t\t\treturn Promise.all(modules);\n\t\t});\n\t}\n\n\tif (typeof module === 'object' && typeof module.exports === 'object') {\n\t\treturn function load(contextualRequire: any, ...moduleIds: string[]): Promise {\n\t\t\tif (typeof contextualRequire === 'string') {\n\t\t\t\tmoduleIds.unshift(contextualRequire);\n\t\t\t\tcontextualRequire = require;\n\t\t\t}\n\n\t\t\treturn pluginLoad(moduleIds, load, (moduleIds: string[]) => {\n\t\t\t\ttry {\n\t\t\t\t\treturn Promise.resolve(\n\t\t\t\t\t\tmoduleIds.map(function(moduleId): any {\n\t\t\t\t\t\t\treturn contextualRequire(moduleId.split('!')[0]);\n\t\t\t\t\t\t})\n\t\t\t\t\t);\n\t\t\t\t} catch (error) {\n\t\t\t\t\treturn Promise.reject(error);\n\t\t\t\t}\n\t\t\t});\n\t\t};\n\t} else if (typeof define === 'function' && define.amd) {\n\t\treturn function load(contextualRequire: any, ...moduleIds: string[]): Promise {\n\t\t\tif (typeof contextualRequire === 'string') {\n\t\t\t\tmoduleIds.unshift(contextualRequire);\n\t\t\t\tcontextualRequire = require;\n\t\t\t}\n\n\t\t\treturn pluginLoad(moduleIds, load, (moduleIds: string[]) => {\n\t\t\t\treturn new Promise(function(resolve, reject) {\n\t\t\t\t\tlet errorHandle: { remove: () => void };\n\n\t\t\t\t\tif (typeof contextualRequire.on === 'function') {\n\t\t\t\t\t\terrorHandle = contextualRequire.on('error', (error: Error) => {\n\t\t\t\t\t\t\terrorHandle.remove();\n\t\t\t\t\t\t\treject(error);\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\n\t\t\t\t\tcontextualRequire(moduleIds, function(...modules: any[]) {\n\t\t\t\t\t\terrorHandle && errorHandle.remove();\n\t\t\t\t\t\tresolve(modules);\n\t\t\t\t\t});\n\t\t\t\t});\n\t\t\t});\n\t\t};\n\t} else {\n\t\treturn function() {\n\t\t\treturn Promise.reject(new Error('Unknown loader'));\n\t\t};\n\t}\n})();\nexport default load;\n\nexport { isPlugin, useDefault };\n"]} \ No newline at end of file diff --git a/deps/framework/core/load/util.d.ts b/deps/framework/core/load/util.d.ts deleted file mode 100644 index 4e30f2a181..0000000000 --- a/deps/framework/core/load/util.d.ts +++ /dev/null @@ -1,30 +0,0 @@ -import { Load } from '../load'; -export interface LoadPlugin { - /** - * An optional method that normmalizes a resource id. - * - * @param resourceId - * The raw resource id. - * - * @param resolver - * A method that can resolve an id to an absolute path. Depending on the environment, this will - * usually be either `require.toUrl` or `require.resolve`. - */ - normalize?: (resourceId: string, resolver: (resourceId: string) => string) => string; - /** - * A method that loads the specified resource. - * - * @param resourceId - * The id of the resource to load. - * - * @param load - * The `load` method that was used to load and execute the plugin. - * - * @return - * A promise that resolves to the loaded resource. - */ - load(resourceId: string, load: Load): Promise; -} -export declare function isPlugin(value: any): value is LoadPlugin; -export declare function useDefault(modules: any[]): any[]; -export declare function useDefault(module: any): any; diff --git a/deps/framework/core/load/util.js b/deps/framework/core/load/util.js deleted file mode 100644 index 0329e5f2dc..0000000000 --- a/deps/framework/core/load/util.js +++ /dev/null @@ -1,51 +0,0 @@ -(function (factory) { - if (typeof module === "object" && typeof module.exports === "object") { - var v = factory(require, exports); - if (v !== undefined) module.exports = v; - } - else if (typeof define === "function" && define.amd) { - define(["require", "exports", "tslib", "../../shim/iterator"], factory); - } -})(function (require, exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - var tslib_1 = require("tslib"); - var iterator_1 = require("../../shim/iterator"); - function isPlugin(value) { - return Boolean(value) && typeof value.load === 'function'; - } - exports.isPlugin = isPlugin; - function useDefault(modules) { - if (iterator_1.isArrayLike(modules)) { - var processedModules = []; - for (var i = 0; i < modules.length; i++) { - var module_1 = modules[i]; - processedModules.push(module_1.__esModule && module_1.default ? module_1.default : module_1); - } - return processedModules; - } - else if (iterator_1.isIterable(modules)) { - var processedModules = []; - try { - for (var modules_1 = tslib_1.__values(modules), modules_1_1 = modules_1.next(); !modules_1_1.done; modules_1_1 = modules_1.next()) { - var module_2 = modules_1_1.value; - processedModules.push(module_2.__esModule && module_2.default ? module_2.default : module_2); - } - } - catch (e_1_1) { e_1 = { error: e_1_1 }; } - finally { - try { - if (modules_1_1 && !modules_1_1.done && (_a = modules_1.return)) _a.call(modules_1); - } - finally { if (e_1) throw e_1.error; } - } - return processedModules; - } - else { - return modules.__esModule && modules.default ? modules.default : modules; - } - var e_1, _a; - } - exports.useDefault = useDefault; -}); -//# sourceMappingURL=util.js.map \ No newline at end of file diff --git a/deps/framework/core/load/util.js.map b/deps/framework/core/load/util.js.map deleted file mode 100644 index f8d88aea11..0000000000 --- a/deps/framework/core/load/util.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"util.js","sourceRoot":"","sources":["util.ts"],"names":[],"mappings":";;;;;;;;;;;;IAAA,gDAA8D;IA+B9D,kBAAyB,KAAU;QAClC,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,OAAO,KAAK,CAAC,IAAI,KAAK,UAAU,CAAC;IAC3D,CAAC;IAFD,4BAEC;IAID,oBAA2B,OAAoB;QAC9C,EAAE,CAAC,CAAC,sBAAW,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;YAC1B,IAAI,gBAAgB,GAAU,EAAE,CAAC;YAEjC,GAAG,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;gBACzC,IAAM,QAAM,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;gBAC1B,gBAAgB,CAAC,IAAI,CAAC,QAAM,CAAC,UAAU,IAAI,QAAM,CAAC,OAAO,CAAC,CAAC,CAAC,QAAM,CAAC,OAAO,CAAC,CAAC,CAAC,QAAM,CAAC,CAAC;YACtF,CAAC;YAED,MAAM,CAAC,gBAAgB,CAAC;QACzB,CAAC;QAAC,IAAI,CAAC,EAAE,CAAC,CAAC,qBAAU,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;YAChC,IAAI,gBAAgB,GAAU,EAAE,CAAC;;gBAEjC,GAAG,CAAC,CAAiB,IAAA,YAAA,iBAAA,OAAO,CAAA,gCAAA;oBAAvB,IAAM,QAAM,oBAAA;oBAChB,gBAAgB,CAAC,IAAI,CAAC,QAAM,CAAC,UAAU,IAAI,QAAM,CAAC,OAAO,CAAC,CAAC,CAAC,QAAM,CAAC,OAAO,CAAC,CAAC,CAAC,QAAM,CAAC,CAAC;iBACrF;;;;;;;;;YAED,MAAM,CAAC,gBAAgB,CAAC;QACzB,CAAC;QAAC,IAAI,CAAC,CAAC;YACP,MAAM,CAAC,OAAO,CAAC,UAAU,IAAI,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC;QAC1E,CAAC;;IACF,CAAC;IArBD,gCAqBC","sourcesContent":["import { isArrayLike, isIterable } from '../../shim/iterator';\nimport { Load } from '../load';\n\nexport interface LoadPlugin {\n\t/**\n\t * An optional method that normmalizes a resource id.\n\t *\n\t * @param resourceId\n\t * The raw resource id.\n\t *\n\t * @param resolver\n\t * A method that can resolve an id to an absolute path. Depending on the environment, this will\n\t * usually be either `require.toUrl` or `require.resolve`.\n\t */\n\tnormalize?: (resourceId: string, resolver: (resourceId: string) => string) => string;\n\n\t/**\n\t * A method that loads the specified resource.\n\t *\n\t * @param resourceId\n\t * The id of the resource to load.\n\t *\n\t * @param load\n\t * The `load` method that was used to load and execute the plugin.\n\t *\n\t * @return\n\t * A promise that resolves to the loaded resource.\n\t */\n\tload(resourceId: string, load: Load): Promise;\n}\n\nexport function isPlugin(value: any): value is LoadPlugin {\n\treturn Boolean(value) && typeof value.load === 'function';\n}\n\nexport function useDefault(modules: any[]): any[];\nexport function useDefault(module: any): any;\nexport function useDefault(modules: any | any[]): any[] | any {\n\tif (isArrayLike(modules)) {\n\t\tlet processedModules: any[] = [];\n\n\t\tfor (let i = 0; i < modules.length; i++) {\n\t\t\tconst module = modules[i];\n\t\t\tprocessedModules.push(module.__esModule && module.default ? module.default : module);\n\t\t}\n\n\t\treturn processedModules;\n\t} else if (isIterable(modules)) {\n\t\tlet processedModules: any[] = [];\n\n\t\tfor (const module of modules) {\n\t\t\tprocessedModules.push(module.__esModule && module.default ? module.default : module);\n\t\t}\n\n\t\treturn processedModules;\n\t} else {\n\t\treturn modules.__esModule && modules.default ? modules.default : modules;\n\t}\n}\n"]} \ No newline at end of file diff --git a/deps/framework/core/load/util.mjs b/deps/framework/core/load/util.mjs deleted file mode 100644 index bc1800b09b..0000000000 --- a/deps/framework/core/load/util.mjs +++ /dev/null @@ -1,25 +0,0 @@ -import { isArrayLike, isIterable } from '../../shim/iterator'; -export function isPlugin(value) { - return Boolean(value) && typeof value.load === 'function'; -} -export function useDefault(modules) { - if (isArrayLike(modules)) { - let processedModules = []; - for (let i = 0; i < modules.length; i++) { - const module = modules[i]; - processedModules.push(module.__esModule && module.default ? module.default : module); - } - return processedModules; - } - else if (isIterable(modules)) { - let processedModules = []; - for (const module of modules) { - processedModules.push(module.__esModule && module.default ? module.default : module); - } - return processedModules; - } - else { - return modules.__esModule && modules.default ? modules.default : modules; - } -} -//# sourceMappingURL=util.mjs.map \ No newline at end of file diff --git a/deps/framework/core/load/util.mjs.map b/deps/framework/core/load/util.mjs.map deleted file mode 100644 index 860a1d8805..0000000000 --- a/deps/framework/core/load/util.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"util.mjs","sourceRoot":"","sources":["util.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AA+B9D,MAAM,mBAAmB,KAAU;IAClC,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,OAAO,KAAK,CAAC,IAAI,KAAK,UAAU,CAAC;AAC3D,CAAC;AAID,MAAM,qBAAqB,OAAoB;IAC9C,EAAE,CAAC,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;QAC1B,IAAI,gBAAgB,GAAU,EAAE,CAAC;QAEjC,GAAG,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;YACzC,MAAM,MAAM,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;YAC1B,gBAAgB,CAAC,IAAI,CAAC,MAAM,CAAC,UAAU,IAAI,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC;QACtF,CAAC;QAED,MAAM,CAAC,gBAAgB,CAAC;IACzB,CAAC;IAAC,IAAI,CAAC,EAAE,CAAC,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;QAChC,IAAI,gBAAgB,GAAU,EAAE,CAAC;QAEjC,GAAG,CAAC,CAAC,MAAM,MAAM,IAAI,OAAO,CAAC,CAAC,CAAC;YAC9B,gBAAgB,CAAC,IAAI,CAAC,MAAM,CAAC,UAAU,IAAI,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC;QACtF,CAAC;QAED,MAAM,CAAC,gBAAgB,CAAC;IACzB,CAAC;IAAC,IAAI,CAAC,CAAC;QACP,MAAM,CAAC,OAAO,CAAC,UAAU,IAAI,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC;IAC1E,CAAC;AACF,CAAC","sourcesContent":["import { isArrayLike, isIterable } from '../../shim/iterator';\nimport { Load } from '../load';\n\nexport interface LoadPlugin {\n\t/**\n\t * An optional method that normmalizes a resource id.\n\t *\n\t * @param resourceId\n\t * The raw resource id.\n\t *\n\t * @param resolver\n\t * A method that can resolve an id to an absolute path. Depending on the environment, this will\n\t * usually be either `require.toUrl` or `require.resolve`.\n\t */\n\tnormalize?: (resourceId: string, resolver: (resourceId: string) => string) => string;\n\n\t/**\n\t * A method that loads the specified resource.\n\t *\n\t * @param resourceId\n\t * The id of the resource to load.\n\t *\n\t * @param load\n\t * The `load` method that was used to load and execute the plugin.\n\t *\n\t * @return\n\t * A promise that resolves to the loaded resource.\n\t */\n\tload(resourceId: string, load: Load): Promise;\n}\n\nexport function isPlugin(value: any): value is LoadPlugin {\n\treturn Boolean(value) && typeof value.load === 'function';\n}\n\nexport function useDefault(modules: any[]): any[];\nexport function useDefault(module: any): any;\nexport function useDefault(modules: any | any[]): any[] | any {\n\tif (isArrayLike(modules)) {\n\t\tlet processedModules: any[] = [];\n\n\t\tfor (let i = 0; i < modules.length; i++) {\n\t\t\tconst module = modules[i];\n\t\t\tprocessedModules.push(module.__esModule && module.default ? module.default : module);\n\t\t}\n\n\t\treturn processedModules;\n\t} else if (isIterable(modules)) {\n\t\tlet processedModules: any[] = [];\n\n\t\tfor (const module of modules) {\n\t\t\tprocessedModules.push(module.__esModule && module.default ? module.default : module);\n\t\t}\n\n\t\treturn processedModules;\n\t} else {\n\t\treturn modules.__esModule && modules.default ? modules.default : modules;\n\t}\n}\n"]} \ No newline at end of file diff --git a/deps/framework/core/load/webpack.d.ts b/deps/framework/core/load/webpack.d.ts deleted file mode 100644 index 4913468bb0..0000000000 --- a/deps/framework/core/load/webpack.d.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { isPlugin, useDefault } from './util'; -/** - * A webpack-specific function that replaces `@dojo/core/load` in its builds. In order for a module to be loaded, - * it must first be included in a webpack chunk, whether that chunk is included in the main build, or lazy-loaded. - * Note that this module is not intended for direct use, but rather is intended for use by a webpack plugin - * that sets the module ID map used to translate resolved module paths to webpack module IDs. - * - * @param contextRequire - * An optional function that returns the base path to use when resolving relative module IDs. - * - * @param ...mids - * One or more IDs for modules to load. - * - * @return - * A promise to the loaded module values. - */ -export default function load(contextRequire: () => string, ...mids: string[]): Promise; -export default function load(...mids: string[]): Promise; -export { isPlugin, useDefault }; diff --git a/deps/framework/core/load/webpack.js b/deps/framework/core/load/webpack.js deleted file mode 100644 index 668b3e99c8..0000000000 --- a/deps/framework/core/load/webpack.js +++ /dev/null @@ -1,107 +0,0 @@ -(function (factory) { - if (typeof module === "object" && typeof module.exports === "object") { - var v = factory(require, exports); - if (v !== undefined) module.exports = v; - } - else if (typeof define === "function" && define.amd) { - define(["require", "exports", "tslib", "../../shim/Promise", "./util"], factory); - } -})(function (require, exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - var tslib_1 = require("tslib"); - var Promise_1 = require("../../shim/Promise"); - var util_1 = require("./util"); - exports.isPlugin = util_1.isPlugin; - exports.useDefault = util_1.useDefault; - /** - * @private - * Resolves an absolute path from an absolute base path and relative module ID. - * - * @param base - * The absolute base path. - * - * @param mid - * The relative module ID - * - * @return - * The resolved absolute module path. - */ - function resolveRelative(base, mid) { - var isRelative = mid.match(/^\.+\//); - var result = base; - if (isRelative) { - if (mid.match(/^\.\//)) { - mid = mid.replace(/\.\//, ''); - } - var up = mid.match(/\.\.\//g); - if (up) { - var chunks = base.split('/'); - if (up.length > chunks.length) { - throw new Error('Path cannot go beyond root directory.'); - } - chunks.splice(chunks.length - up.length); - result = chunks.join('/'); - mid = mid.replace(/\.\.\//g, ''); - } - mid = result + '/' + mid; - } - return mid; - } - /** - * @private - * Returns the parent directory for the specified module ID. - * - * @param context - * A function that returns the context module ID. - * - * @return - * The parent directory of the path returned by the context function. - */ - function getBasePath(context) { - return context() - .split('/') - .slice(0, -1) - .join('/'); - } - function load() { - var args = []; - for (var _i = 0; _i < arguments.length; _i++) { - args[_i] = arguments[_i]; - } - var req = __webpack_require__; - var context = typeof args[0] === 'function' - ? args[0] - : function () { - return ''; - }; - var modules = __modules__ || {}; - var base = getBasePath(context); - var results = args - .filter(function (mid) { return typeof mid === 'string'; }) - .map(function (mid) { return resolveRelative(base, mid); }) - .map(function (mid) { - var _a = tslib_1.__read(mid.split('!'), 2), moduleId = _a[0], pluginResourceId = _a[1]; - var moduleMeta = modules[mid] || modules[moduleId]; - if (!moduleMeta) { - return Promise_1.default.reject(new Error("Missing module: " + mid)); - } - if (moduleMeta.lazy) { - return new Promise_1.default(function (resolve) { return req(moduleMeta.id)(resolve); }); - } - var module = req(moduleMeta.id); - var defaultExport = module['default'] || module; - if (util_1.isPlugin(defaultExport)) { - pluginResourceId = - typeof defaultExport.normalize === 'function' - ? defaultExport.normalize(pluginResourceId, function (mid) { return resolveRelative(base, mid); }) - : resolveRelative(base, pluginResourceId); - return Promise_1.default.resolve(defaultExport.load(pluginResourceId, load)); - } - return Promise_1.default.resolve(module); - }); - return Promise_1.default.all(results); - } - exports.default = load; -}); -//# sourceMappingURL=webpack.js.map \ No newline at end of file diff --git a/deps/framework/core/load/webpack.js.map b/deps/framework/core/load/webpack.js.map deleted file mode 100644 index 6d6b25aa12..0000000000 --- a/deps/framework/core/load/webpack.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"webpack.js","sourceRoot":"","sources":["webpack.ts"],"names":[],"mappings":";;;;;;;;;;;;IAAA,8CAAyC;IACzC,+BAA8C;IAgJrC,mBAhJA,eAAQ,CAgJA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AAU,CAAC,EAAE,CAAC,CAAC;YAClC,IAAM,aAAa,GAAG,MAAM,CAAC,SAAS,CAAC,IAAI,MAAM,CAAC;YAElD,EAAE,CAAC,CAAC,eAAQ,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC;gBAC7B,gBAAgB;oBACf,OAAO,aAAa,CAAC,SAAS,KAAK,UAAU;wBAC5C,CAAC,CAAC,aAAa,CAAC,SAAS,CAAC,gBAAgB,EAAE,UAAC,GAAW,IAAK,OAAA,eAAe,CAAC,IAAI,EAAE,GAAG,CAAC,EAA1B,CAA0B,CAAC;wBACxF,CAAC,CAAC,eAAe,CAAC,IAAI,EAAE,gBAAgB,CAAC,CAAC;gBAE5C,MAAM,CAAC,iBAAO,CAAC,OAAO,CAAC,aAAa,CAAC,IAAI,CAAC,gBAAgB,EAAO,IAAI,CAAC,CAAC,CAAC;YACzE,CAAC;YAED,MAAM,CAAC,iBAAO,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;QAChC,CAAC,CAAC,CAAC;QAEJ,MAAM,CAAC,iBAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;IAC7B,CAAC;IA3CD,uBA2CC","sourcesContent":["import Promise from '../../shim/Promise';\nimport { isPlugin, useDefault } from './util';\n\ninterface ModuleIdMap {\n\t[path: string]: { id: number; lazy: boolean };\n}\n\ninterface BundleLoaderCallback {\n\t(value: T): void;\n}\n\ninterface WebpackRequire {\n\t(id: number): T | BundleLoaderCallback;\n}\n\n/**\n * A global map (set by the build) of resolved module paths to webpack-specific module data.\n */\ndeclare const __modules__: ModuleIdMap;\n\n/**\n * The webpack-specific require function, set globally by webpack.\n */\ndeclare const __webpack_require__: WebpackRequire;\n\n/**\n * @private\n * Resolves an absolute path from an absolute base path and relative module ID.\n *\n * @param base\n * The absolute base path.\n *\n * @param mid\n * The relative module ID\n *\n * @return\n * The resolved absolute module path.\n */\nfunction resolveRelative(base: string, mid: string): string {\n\tconst isRelative = mid.match(/^\\.+\\//);\n\tlet result = base;\n\n\tif (isRelative) {\n\t\tif (mid.match(/^\\.\\//)) {\n\t\t\tmid = mid.replace(/\\.\\//, '');\n\t\t}\n\n\t\tconst up = mid.match(/\\.\\.\\//g);\n\t\tif (up) {\n\t\t\tconst chunks = base.split('/');\n\n\t\t\tif (up.length > chunks.length) {\n\t\t\t\tthrow new Error('Path cannot go beyond root directory.');\n\t\t\t}\n\n\t\t\tchunks.splice(chunks.length - up.length);\n\t\t\tresult = chunks.join('/');\n\t\t\tmid = mid.replace(/\\.\\.\\//g, '');\n\t\t}\n\n\t\tmid = result + '/' + mid;\n\t}\n\n\treturn mid;\n}\n\n/**\n * @private\n * Returns the parent directory for the specified module ID.\n *\n * @param context\n * A function that returns the context module ID.\n *\n * @return\n * The parent directory of the path returned by the context function.\n */\nfunction getBasePath(context: () => string): string {\n\treturn context()\n\t\t.split('/')\n\t\t.slice(0, -1)\n\t\t.join('/');\n}\n\n/**\n * A webpack-specific function that replaces `@dojo/core/load` in its builds. In order for a module to be loaded,\n * it must first be included in a webpack chunk, whether that chunk is included in the main build, or lazy-loaded.\n * Note that this module is not intended for direct use, but rather is intended for use by a webpack plugin\n * that sets the module ID map used to translate resolved module paths to webpack module IDs.\n *\n * @param contextRequire\n * An optional function that returns the base path to use when resolving relative module IDs.\n *\n * @param ...mids\n * One or more IDs for modules to load.\n *\n * @return\n * A promise to the loaded module values.\n */\nexport default function load(contextRequire: () => string, ...mids: string[]): Promise;\nexport default function load(...mids: string[]): Promise;\nexport default function load(...args: any[]): Promise {\n\tconst req = __webpack_require__;\n\tconst context =\n\t\ttypeof args[0] === 'function'\n\t\t\t? args[0]\n\t\t\t: function() {\n\t\t\t\t\treturn '';\n\t\t\t\t};\n\n\tconst modules = __modules__ || {};\n\tconst base = getBasePath(context);\n\n\tconst results = args\n\t\t.filter((mid: string | Function) => typeof mid === 'string')\n\t\t.map((mid: string) => resolveRelative(base, mid))\n\t\t.map((mid: string) => {\n\t\t\tlet [moduleId, pluginResourceId] = mid.split('!');\n\t\t\tconst moduleMeta = modules[mid] || modules[moduleId];\n\n\t\t\tif (!moduleMeta) {\n\t\t\t\treturn Promise.reject(new Error(`Missing module: ${mid}`));\n\t\t\t}\n\n\t\t\tif (moduleMeta.lazy) {\n\t\t\t\treturn new Promise((resolve) => req(moduleMeta.id)(resolve));\n\t\t\t}\n\n\t\t\tconst module = req(moduleMeta.id);\n\t\t\tconst defaultExport = module['default'] || module;\n\n\t\t\tif (isPlugin(defaultExport)) {\n\t\t\t\tpluginResourceId =\n\t\t\t\t\ttypeof defaultExport.normalize === 'function'\n\t\t\t\t\t\t? defaultExport.normalize(pluginResourceId, (mid: string) => resolveRelative(base, mid))\n\t\t\t\t\t\t: resolveRelative(base, pluginResourceId);\n\n\t\t\t\treturn Promise.resolve(defaultExport.load(pluginResourceId, load));\n\t\t\t}\n\n\t\t\treturn Promise.resolve(module);\n\t\t});\n\n\treturn Promise.all(results);\n}\n\nexport { isPlugin, useDefault };\n"]} \ No newline at end of file diff --git a/deps/framework/core/load/webpack.mjs b/deps/framework/core/load/webpack.mjs deleted file mode 100644 index a01727fd1f..0000000000 --- a/deps/framework/core/load/webpack.mjs +++ /dev/null @@ -1,88 +0,0 @@ -import Promise from '../../shim/Promise'; -import { isPlugin, useDefault } from './util'; -/** - * @private - * Resolves an absolute path from an absolute base path and relative module ID. - * - * @param base - * The absolute base path. - * - * @param mid - * The relative module ID - * - * @return - * The resolved absolute module path. - */ -function resolveRelative(base, mid) { - const isRelative = mid.match(/^\.+\//); - let result = base; - if (isRelative) { - if (mid.match(/^\.\//)) { - mid = mid.replace(/\.\//, ''); - } - const up = mid.match(/\.\.\//g); - if (up) { - const chunks = base.split('/'); - if (up.length > chunks.length) { - throw new Error('Path cannot go beyond root directory.'); - } - chunks.splice(chunks.length - up.length); - result = chunks.join('/'); - mid = mid.replace(/\.\.\//g, ''); - } - mid = result + '/' + mid; - } - return mid; -} -/** - * @private - * Returns the parent directory for the specified module ID. - * - * @param context - * A function that returns the context module ID. - * - * @return - * The parent directory of the path returned by the context function. - */ -function getBasePath(context) { - return context() - .split('/') - .slice(0, -1) - .join('/'); -} -export default function load(...args) { - const req = __webpack_require__; - const context = typeof args[0] === 'function' - ? args[0] - : function () { - return ''; - }; - const modules = __modules__ || {}; - const base = getBasePath(context); - const results = args - .filter((mid) => typeof mid === 'string') - .map((mid) => resolveRelative(base, mid)) - .map((mid) => { - let [moduleId, pluginResourceId] = mid.split('!'); - const moduleMeta = modules[mid] || modules[moduleId]; - if (!moduleMeta) { - return Promise.reject(new Error(`Missing module: ${mid}`)); - } - if (moduleMeta.lazy) { - return new Promise((resolve) => req(moduleMeta.id)(resolve)); - } - const module = req(moduleMeta.id); - const defaultExport = module['default'] || module; - if (isPlugin(defaultExport)) { - pluginResourceId = - typeof defaultExport.normalize === 'function' - ? defaultExport.normalize(pluginResourceId, (mid) => resolveRelative(base, mid)) - : resolveRelative(base, pluginResourceId); - return Promise.resolve(defaultExport.load(pluginResourceId, load)); - } - return Promise.resolve(module); - }); - return Promise.all(results); -} -export { isPlugin, useDefault }; -//# sourceMappingURL=webpack.mjs.map \ No newline at end of file diff --git a/deps/framework/core/load/webpack.mjs.map b/deps/framework/core/load/webpack.mjs.map deleted file mode 100644 index 7c9c64d6a9..0000000000 --- a/deps/framework/core/load/webpack.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"webpack.mjs","sourceRoot":"","sources":["webpack.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,oBAAoB,CAAC;AACzC,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AAwB9C;;;;;;;;;;;;GAYG;AACH,yBAAyB,IAAY,EAAE,GAAW;IACjD,MAAM,UAAU,GAAG,GAAG,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;IACvC,IAAI,MAAM,GAAG,IAAI,CAAC;IAElB,EAAE,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC;QAChB,EAAE,CAAC,CAAC,GA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AC,GAAW,EAAE,EAAE,CAAC,eAAe,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;oBACxF,CAAC,CAAC,eAAe,CAAC,IAAI,EAAE,gBAAgB,CAAC,CAAC;YAE5C,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,aAAa,CAAC,IAAI,CAAC,gBAAgB,EAAO,IAAI,CAAC,CAAC,CAAC;QACzE,CAAC;QAED,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;IAChC,CAAC,CAAC,CAAC;IAEJ,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;AAC7B,CAAC;AAED,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,CAAC","sourcesContent":["import Promise from '../../shim/Promise';\nimport { isPlugin, useDefault } from './util';\n\ninterface ModuleIdMap {\n\t[path: string]: { id: number; lazy: boolean };\n}\n\ninterface BundleLoaderCallback {\n\t(value: T): void;\n}\n\ninterface WebpackRequire {\n\t(id: number): T | BundleLoaderCallback;\n}\n\n/**\n * A global map (set by the build) of resolved module paths to webpack-specific module data.\n */\ndeclare const __modules__: ModuleIdMap;\n\n/**\n * The webpack-specific require function, set globally by webpack.\n */\ndeclare const __webpack_require__: WebpackRequire;\n\n/**\n * @private\n * Resolves an absolute path from an absolute base path and relative module ID.\n *\n * @param base\n * The absolute base path.\n *\n * @param mid\n * The relative module ID\n *\n * @return\n * The resolved absolute module path.\n */\nfunction resolveRelative(base: string, mid: string): string {\n\tconst isRelative = mid.match(/^\\.+\\//);\n\tlet result = base;\n\n\tif (isRelative) {\n\t\tif (mid.match(/^\\.\\//)) {\n\t\t\tmid = mid.replace(/\\.\\//, '');\n\t\t}\n\n\t\tconst up = mid.match(/\\.\\.\\//g);\n\t\tif (up) {\n\t\t\tconst chunks = base.split('/');\n\n\t\t\tif (up.length > chunks.length) {\n\t\t\t\tthrow new Error('Path cannot go beyond root directory.');\n\t\t\t}\n\n\t\t\tchunks.splice(chunks.length - up.length);\n\t\t\tresult = chunks.join('/');\n\t\t\tmid = mid.replace(/\\.\\.\\//g, '');\n\t\t}\n\n\t\tmid = result + '/' + mid;\n\t}\n\n\treturn mid;\n}\n\n/**\n * @private\n * Returns the parent directory for the specified module ID.\n *\n * @param context\n * A function that returns the context module ID.\n *\n * @return\n * The parent directory of the path returned by the context function.\n */\nfunction getBasePath(context: () => string): string {\n\treturn context()\n\t\t.split('/')\n\t\t.slice(0, -1)\n\t\t.join('/');\n}\n\n/**\n * A webpack-specific function that replaces `@dojo/core/load` in its builds. In order for a module to be loaded,\n * it must first be included in a webpack chunk, whether that chunk is included in the main build, or lazy-loaded.\n * Note that this module is not intended for direct use, but rather is intended for use by a webpack plugin\n * that sets the module ID map used to translate resolved module paths to webpack module IDs.\n *\n * @param contextRequire\n * An optional function that returns the base path to use when resolving relative module IDs.\n *\n * @param ...mids\n * One or more IDs for modules to load.\n *\n * @return\n * A promise to the loaded module values.\n */\nexport default function load(contextRequire: () => string, ...mids: string[]): Promise;\nexport default function load(...mids: string[]): Promise;\nexport default function load(...args: any[]): Promise {\n\tconst req = __webpack_require__;\n\tconst context =\n\t\ttypeof args[0] === 'function'\n\t\t\t? args[0]\n\t\t\t: function() {\n\t\t\t\t\treturn '';\n\t\t\t\t};\n\n\tconst modules = __modules__ || {};\n\tconst base = getBasePath(context);\n\n\tconst results = args\n\t\t.filter((mid: string | Function) => typeof mid === 'string')\n\t\t.map((mid: string) => resolveRelative(base, mid))\n\t\t.map((mid: string) => {\n\t\t\tlet [moduleId, pluginResourceId] = mid.split('!');\n\t\t\tconst moduleMeta = modules[mid] || modules[moduleId];\n\n\t\t\tif (!moduleMeta) {\n\t\t\t\treturn Promise.reject(new Error(`Missing module: ${mid}`));\n\t\t\t}\n\n\t\t\tif (moduleMeta.lazy) {\n\t\t\t\treturn new Promise((resolve) => req(moduleMeta.id)(resolve));\n\t\t\t}\n\n\t\t\tconst module = req(moduleMeta.id);\n\t\t\tconst defaultExport = module['default'] || module;\n\n\t\t\tif (isPlugin(defaultExport)) {\n\t\t\t\tpluginResourceId =\n\t\t\t\t\ttypeof defaultExport.normalize === 'function'\n\t\t\t\t\t\t? defaultExport.normalize(pluginResourceId, (mid: string) => resolveRelative(base, mid))\n\t\t\t\t\t\t: resolveRelative(base, pluginResourceId);\n\n\t\t\t\treturn Promise.resolve(defaultExport.load(pluginResourceId, load));\n\t\t\t}\n\n\t\t\treturn Promise.resolve(module);\n\t\t});\n\n\treturn Promise.all(results);\n}\n\nexport { isPlugin, useDefault };\n"]} \ No newline at end of file diff --git a/deps/framework/core/main.d.ts b/deps/framework/core/main.d.ts deleted file mode 100644 index 72a562189a..0000000000 --- a/deps/framework/core/main.d.ts +++ /dev/null @@ -1,25 +0,0 @@ -import * as aspect from './aspect'; -import DateObject from './DateObject'; -import Evented from './Evented'; -import IdentityRegistry from './IdentityRegistry'; -import * as lang from './lang'; -import * as base64 from './base64'; -import load from './load'; -import MatchRegistry from './MatchRegistry'; -import on, { emit } from './on'; -import * as queue from './queue'; -import request from './request'; -import Scheduler from './Scheduler'; -import * as stringExtras from './stringExtras'; -import * as text from './text'; -import UrlSearchParams from './UrlSearchParams'; -import * as util from './util'; -import * as iteration from './async/iteration'; -import Task from './async/Task'; -import * as timing from './async/timing'; -declare const async: { - iteration: typeof iteration; - Task: typeof Task; - timing: typeof timing; -}; -export { aspect, async, base64, DateObject, emit, Evented, IdentityRegistry, lang, load, MatchRegistry, on, queue, request, Scheduler, stringExtras, text, UrlSearchParams, util }; diff --git a/deps/framework/core/main.js b/deps/framework/core/main.js deleted file mode 100644 index 35223f61e5..0000000000 --- a/deps/framework/core/main.js +++ /dev/null @@ -1,55 +0,0 @@ -(function (factory) { - if (typeof module === "object" && typeof module.exports === "object") { - var v = factory(require, exports); - if (v !== undefined) module.exports = v; - } - else if (typeof define === "function" && define.amd) { - define(["require", "exports", "./aspect", "./DateObject", "./Evented", "./IdentityRegistry", "./lang", "./base64", "./load", "./MatchRegistry", "./on", "./queue", "./request", "./Scheduler", "./stringExtras", "./text", "./UrlSearchParams", "./util", "./async/iteration", "./async/Task", "./async/timing"], factory); - } -})(function (require, exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - var aspect = require("./aspect"); - exports.aspect = aspect; - var DateObject_1 = require("./DateObject"); - exports.DateObject = DateObject_1.default; - var Evented_1 = require("./Evented"); - exports.Evented = Evented_1.default; - var IdentityRegistry_1 = require("./IdentityRegistry"); - exports.IdentityRegistry = IdentityRegistry_1.default; - var lang = require("./lang"); - exports.lang = lang; - var base64 = require("./base64"); - exports.base64 = base64; - var load_1 = require("./load"); - exports.load = load_1.default; - var MatchRegistry_1 = require("./MatchRegistry"); - exports.MatchRegistry = MatchRegistry_1.default; - var on_1 = require("./on"); - exports.on = on_1.default; - exports.emit = on_1.emit; - var queue = require("./queue"); - exports.queue = queue; - var request_1 = require("./request"); - exports.request = request_1.default; - var Scheduler_1 = require("./Scheduler"); - exports.Scheduler = Scheduler_1.default; - var stringExtras = require("./stringExtras"); - exports.stringExtras = stringExtras; - var text = require("./text"); - exports.text = text; - var UrlSearchParams_1 = require("./UrlSearchParams"); - exports.UrlSearchParams = UrlSearchParams_1.default; - var util = require("./util"); - exports.util = util; - var iteration = require("./async/iteration"); - var Task_1 = require("./async/Task"); - var timing = require("./async/timing"); - var async = { - iteration: iteration, - Task: Task_1.default, - timing: timing - }; - exports.async = async; -}); -//# sourceMappingURL=main.js.map \ No newline at end of file diff --git a/deps/framework/core/main.js.map b/deps/framework/core/main.js.map deleted file mode 100644 index 3744d0178c..0000000000 --- a/deps/framework/core/main.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"main.js","sourceRoot":"","sources":["main.ts"],"names":[],"mappings":";;;;;;;;;;;IAAA,iCAAmC;IA4BlC,wBAAM;IA3BP,2CAAsC;IA8BrC,qBA9BM,oBAAU,CA8BN;IA7BX,qCAAgC;IA+B/B,kBA/BM,iBAAO,CA+BN;IA9BR,uDAAkD;IA+BjD,2BA/BM,0BAAgB,CA+BN;IA9BjB,6BAA+B;IA+B9B,oBAAI;IA9BL,iCAAmC;IAyBlC,wBAAM;IAxBP,+BAA0B;IA8BzB,eA9BM,cAAI,CA8BN;IA7BL,iDAA4C;IA8B3C,wBA9BM,uBAAa,CA8BN;IA7Bd,2BAAgC;IA8B/B,aA9BM,YAAE,CA8BN;IANF,eAxBY,SAAI,CAwBZ;IAvBL,+BAAiC;IA8BhC,sBAAK;IA7BN,qCAAgC;IA8B/B,kBA9BM,iBAAO,CA8BN;IA7BR,yCAAoC;IA8BnC,oBA9BM,mBAAS,CA8BN;IA7BV,6CAA+C;IA8B9C,oCAAY;IA7Bb,6BAA+B;IA8B9B,oBAAI;IA7BL,qDAAgD;IA8B/C,0BA9BM,yBAAe,CA8BN;IA7BhB,6BAA+B;IA8B9B,oBAAI;IA5BL,6CAA+C;IAC/C,qCAAgC;IAChC,uCAAyC;IAEzC,IAAM,KAAK,GAAG;QACb,SAAS,WAAA;QACT,IAAI,gBAAA;QACJ,MAAM,QAAA;KACN,CAAC;IAID,sBAAK","sourcesContent":["import * as aspect from './aspect';\nimport DateObject from './DateObject';\nimport Evented from './Evented';\nimport IdentityRegistry from './IdentityRegistry';\nimport * as lang from './lang';\nimport * as base64 from './base64';\nimport load from './load';\nimport MatchRegistry from './MatchRegistry';\nimport on, { emit } from './on';\nimport * as queue from './queue';\nimport request from './request';\nimport Scheduler from './Scheduler';\nimport * as stringExtras from './stringExtras';\nimport * as text from './text';\nimport UrlSearchParams from './UrlSearchParams';\nimport * as util from './util';\n\nimport * as iteration from './async/iteration';\nimport Task from './async/Task';\nimport * as timing from './async/timing';\n\nconst async = {\n\titeration,\n\tTask,\n\ttiming\n};\n\nexport {\n\taspect,\n\tasync,\n\tbase64,\n\tDateObject,\n\temit,\n\tEvented,\n\tIdentityRegistry,\n\tlang,\n\tload,\n\tMatchRegistry,\n\ton,\n\tqueue,\n\trequest,\n\tScheduler,\n\tstringExtras,\n\ttext,\n\tUrlSearchParams,\n\tutil\n};\n"]} \ No newline at end of file diff --git a/deps/framework/core/main.mjs b/deps/framework/core/main.mjs deleted file mode 100644 index 52e2b4075f..0000000000 --- a/deps/framework/core/main.mjs +++ /dev/null @@ -1,26 +0,0 @@ -import * as aspect from './aspect'; -import DateObject from './DateObject'; -import Evented from './Evented'; -import IdentityRegistry from './IdentityRegistry'; -import * as lang from './lang'; -import * as base64 from './base64'; -import load from './load'; -import MatchRegistry from './MatchRegistry'; -import on, { emit } from './on'; -import * as queue from './queue'; -import request from './request'; -import Scheduler from './Scheduler'; -import * as stringExtras from './stringExtras'; -import * as text from './text'; -import UrlSearchParams from './UrlSearchParams'; -import * as util from './util'; -import * as iteration from './async/iteration'; -import Task from './async/Task'; -import * as timing from './async/timing'; -const async = { - iteration, - Task, - timing -}; -export { aspect, async, base64, DateObject, emit, Evented, IdentityRegistry, lang, load, MatchRegistry, on, queue, request, Scheduler, stringExtras, text, UrlSearchParams, util }; -//# sourceMappingURL=main.mjs.map \ No newline at end of file diff --git a/deps/framework/core/main.mjs.map b/deps/framework/core/main.mjs.map deleted file mode 100644 index 0bd1da9a53..0000000000 --- a/deps/framework/core/main.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"main.mjs","sourceRoot":"","sources":["main.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,UAAU,CAAC;AACnC,OAAO,UAAU,MAAM,cAAc,CAAC;AACtC,OAAO,OAAO,MAAM,WAAW,CAAC;AAChC,OAAO,gBAAgB,MAAM,oBAAoB,CAAC;AAClD,OAAO,KAAK,IAAI,MAAM,QAAQ,CAAC;AAC/B,OAAO,KAAK,MAAM,MAAM,UAAU,CAAC;AACnC,OAAO,IAAI,MAAM,QAAQ,CAAC;AAC1B,OAAO,aAAa,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAChC,OAAO,KAAK,KAAK,MAAM,SAAS,CAAC;AACjC,OAAO,OAAO,MAAM,WAAW,CAAC;AAChC,OAAO,SAAS,MAAM,aAAa,CAAC;AACpC,OAAO,KAAK,YAAY,MAAM,gBAAgB,CAAC;AAC/C,OAAO,KAAK,IAAI,MAAM,QAAQ,CAAC;AAC/B,OAAO,eAAe,MAAM,mBAAmB,CAAC;AAChD,OAAO,KAAK,IAAI,MAAM,QAAQ,CAAC;AAE/B,OAAO,KAAK,SAAS,MAAM,mBAAmB,CAAC;AAC/C,OAAO,IAAI,MAAM,cAAc,CAAC;AAChC,OAAO,KAAK,MAAM,MAAM,gBAAgB,CAAC;AAEzC,MAAM,KAAK,GAAG;IACb,SAAS;IACT,IAAI;IACJ,MAAM;CACN,CAAC;AAEF,OAAO,EACN,MAAM,EACN,KAAK,EACL,MAAM,EACN,UAAU,EACV,IAAI,EACJ,OAAO,EACP,gBAAgB,EAChB,IAAI,EACJ,IAAI,EACJ,aAAa,EACb,EAAE,EACF,KAAK,EACL,OAAO,EACP,SAAS,EACT,YAAY,EACZ,IAAI,EACJ,eAAe,EACf,IAAI,EACJ,CAAC","sourcesContent":["import * as aspect from './aspect';\nimport DateObject from './DateObject';\nimport Evented from './Evented';\nimport IdentityRegistry from './IdentityRegistry';\nimport * as lang from './lang';\nimport * as base64 from './base64';\nimport load from './load';\nimport MatchRegistry from './MatchRegistry';\nimport on, { emit } from './on';\nimport * as queue from './queue';\nimport request from './request';\nimport Scheduler from './Scheduler';\nimport * as stringExtras from './stringExtras';\nimport * as text from './text';\nimport UrlSearchParams from './UrlSearchParams';\nimport * as util from './util';\n\nimport * as iteration from './async/iteration';\nimport Task from './async/Task';\nimport * as timing from './async/timing';\n\nconst async = {\n\titeration,\n\tTask,\n\ttiming\n};\n\nexport {\n\taspect,\n\tasync,\n\tbase64,\n\tDateObject,\n\temit,\n\tEvented,\n\tIdentityRegistry,\n\tlang,\n\tload,\n\tMatchRegistry,\n\ton,\n\tqueue,\n\trequest,\n\tScheduler,\n\tstringExtras,\n\ttext,\n\tUrlSearchParams,\n\tutil\n};\n"]} \ No newline at end of file diff --git a/deps/framework/core/on.d.ts b/deps/framework/core/on.d.ts deleted file mode 100644 index e0731af240..0000000000 --- a/deps/framework/core/on.d.ts +++ /dev/null @@ -1,60 +0,0 @@ -import { Handle, EventObject } from './interfaces'; -import Evented, { CustomEventTypes } from './Evented'; -export interface EventCallback> { - (event: O): void; -} -export interface EventEmitter { - on(event: string, listener: EventCallback): EventEmitter; - removeListener(event: string, listener: EventCallback): EventEmitter; -} -/** - * Provides a normalized mechanism for dispatching events for event emitters, Evented objects, or DOM nodes. - * @param target The target to emit the event from - * @param event The event object to emit - * @return Boolean indicating if preventDefault was called on the event object (only relevant for DOM events; - * always false for other event emitters) - */ -export declare function emit = EventObject, K extends keyof M = keyof M>(target: Evented, event: M[K]): boolean; -export declare function emit = EventObject>(target: Evented, event: O): boolean; -export declare function emit = EventObject>(target: EventTarget | EventEmitter, event: O): boolean; -/** - * Provides a normalized mechanism for listening to events from event emitters, Evented objects, or DOM nodes. - * @param target Target to listen for event on - * @param type Event event type(s) to listen for; may a string or an array of strings - * @param listener Callback to handle the event when it fires - * @param capture Whether the listener should be registered in the capture phase (DOM events only) - * @return A handle which will remove the listener when destroy is called - */ -export default function on = EventObject>(target: Evented, type: K | K[], listener: EventCallback): Handle; -export default function on = EventObject>(target: Evented, type: T | T[], listener: EventCallback): Handle; -export default function on(target: EventEmitter, type: string | string[], listener: EventCallback): Handle; -export default function on(target: EventTarget, type: string | string[], listener: EventCallback, capture?: boolean): Handle; -/** - * Provides a mechanism for listening to the next occurrence of an event from event - * emitters, Evented objects, or DOM nodes. - * @param target Target to listen for event on - * @param type Event event type(s) to listen for; may be a string or an array of strings - * @param listener Callback to handle the event when it fires - * @param capture Whether the listener should be registered in the capture phase (DOM events only) - * @return A handle which will remove the listener when destroy is called - */ -export declare function once = EventObject>(target: Evented, type: K | K[], listener: EventCallback): Handle; -export declare function once = EventObject>(target: Evented, type: T | T[], listener: EventCallback): Handle; -export declare function once(target: EventTarget, type: string | string[], listener: EventCallback, capture?: boolean): Handle; -export declare function once(target: EventEmitter, type: string | string[], listener: EventCallback): Handle; -export interface PausableHandle extends Handle { - pause(): void; - resume(): void; -} -/** - * Provides a mechanism for creating pausable listeners for events from event emitters, Evented objects, or DOM nodes. - * @param target Target to listen for event on - * @param type Event event type(s) to listen for; may a string or an array of strings - * @param listener Callback to handle the event when it fires - * @param capture Whether the listener should be registered in the capture phase (DOM events only) - * @return A handle with additional pause and resume methods; the listener will never fire when paused - */ -export declare function pausable = EventObject>(target: Evented, type: K | K[], listener: EventCallback): PausableHandle; -export declare function pausable = EventObject>(target: Evented, type: T | T[], listener: EventCallback): PausableHandle; -export declare function pausable(target: EventTarget, type: string | string[], listener: EventCallback, capture?: boolean): PausableHandle; -export declare function pausable(target: EventEmitter, type: string | string[], listener: EventCallback): PausableHandle; diff --git a/deps/framework/core/on.js b/deps/framework/core/on.js deleted file mode 100644 index cc0e1882f1..0000000000 --- a/deps/framework/core/on.js +++ /dev/null @@ -1,103 +0,0 @@ -(function (factory) { - if (typeof module === "object" && typeof module.exports === "object") { - var v = factory(require, exports); - if (v !== undefined) module.exports = v; - } - else if (typeof define === "function" && define.amd) { - define(["require", "exports", "tslib", "./lang"], factory); - } -})(function (require, exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - var tslib_1 = require("tslib"); - var lang_1 = require("./lang"); - function emit(target, event) { - if (target.dispatchEvent /* includes window and document */ && - ((target.ownerDocument && target.ownerDocument.createEvent) /* matches nodes */ || - (target.document && target.document.createEvent) /* matches window */ || - target.createEvent) /* matches document */) { - var nativeEvent = (target.ownerDocument || target.document || target).createEvent('HTMLEvents'); - nativeEvent.initEvent(event.type, Boolean(event.bubbles), Boolean(event.cancelable)); - for (var key in event) { - if (!(key in nativeEvent)) { - nativeEvent[key] = event[key]; - } - } - return target.dispatchEvent(nativeEvent); - } - if (target.emit) { - if (target.removeListener) { - // Node.js EventEmitter - target.emit(event.type, event); - return false; - } - else if (target.on) { - // Dojo Evented or similar - target.emit(event); - return false; - } - } - throw new Error('Target must be an event emitter'); - } - exports.emit = emit; - function on(target, type, listener, capture) { - if (Array.isArray(type)) { - var handles = type.map(function (type) { - return on(target, type, listener, capture); - }); - return lang_1.createCompositeHandle.apply(void 0, tslib_1.__spread(handles)); - } - var callback = function () { - listener.apply(this, arguments); - }; - // DOM EventTarget - if (target.addEventListener && target.removeEventListener) { - target.addEventListener(type, callback, capture); - return lang_1.createHandle(function () { - target.removeEventListener(type, callback, capture); - }); - } - if (target.on) { - // EventEmitter - if (target.removeListener) { - target.on(type, callback); - return lang_1.createHandle(function () { - target.removeListener(type, callback); - }); - } - else if (target.emit) { - // Evented - return target.on(type, listener); - } - } - throw new TypeError('Unknown event emitter object'); - } - exports.default = on; - function once(target, type, listener, capture) { - // FIXME - // tslint:disable-next-line:no-var-keyword - var handle = on(target, type, function () { - handle.destroy(); - return listener.apply(this, arguments); - }, capture); - return handle; - } - exports.once = once; - function pausable(target, type, listener, capture) { - var paused; - var handle = on(target, type, function () { - if (!paused) { - return listener.apply(this, arguments); - } - }, capture); - handle.pause = function () { - paused = true; - }; - handle.resume = function () { - paused = false; - }; - return handle; - } - exports.pausable = pausable; -}); -//# sourceMappingURL=on.js.map \ No newline at end of file diff --git a/deps/framework/core/on.js.map b/deps/framework/core/on.js.map deleted file mode 100644 index fc6dc616e4..0000000000 --- a/deps/framework/core/on.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"on.js","sourceRoot":"","sources":["on.ts"],"names":[],"mappings":";;;;;;;;;;;;IACA,+BAA6D;IAmC7D,cAAqB,MAAW,EAAE,KAAuB;QACxD,EAAE,CAAC,CACF,MAAM,CAAC,aAAa,CAAC,kCAAkC;YACvD,CAAC,CAAC,MAAM,CAAC,aAAa,IAAI,MAAM,CAAC,aAAa,CAAC,WAAW,CAAC,CAAC,mBAAmB;gBAC/E,CAAC,MAAM,CAAC,QAAQ,IAAI,MAAM,CAAC,QAAQ,CAAC,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C,CAAC;YAClC,CAAC;QACF,CAAC;QAED,MAAM,IAAI,SAAS,CAAC,8BAA8B,CAAC,CAAC;IACrD,CAAC;IAnCD,qBAmCC;IAwBD,cAAqB,MAAW,EAAE,IAAS,EAAE,QAAa,EAAE,OAAiB;QAC5E,QAAQ;QACR,0CAA0C;QAC1C,IAAI,MAAM,GAAG,EAAE,CACd,MAAM,EACN,IAAI,EACJ;YACC,MAAM,CAAC,OAAO,EAAE,CAAC;YACjB,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC;QACxC,CAAC,EACD,OAAO,CACP,CAAC;QAEF,MAAM,CAAC,MAAM,CAAC;IACf,CAAC;IAdD,oBAcC;IAiCD,kBAAyB,MAAW,EAAE,IAAS,EAAE,QAAa,EAAE,OAAiB;QAChF,IAAI,MAAe,CAAC;QAEpB,IAAM,MAAM,GAAmB,EAAE,CAChC,MAAM,EACN,IAAI,EACJ;YACC,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC;gBACb,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC;YACxC,CAAC;QACF,CAAC,EACD,OAAO,CACP,CAAC;QAEF,MAAM,CAAC,KAAK,GAAG;YACd,MAAM,GAAG,IAAI,CAAC;QACf,CAAC,CAAC;QAEF,MAAM,CAAC,MAAM,GAAG;YACf,MAAM,GAAG,KAAK,CAAC;QAChB,CAAC,CAAC;QAEF,MAAM,CAAC,MAAM,CAAC;IACf,CAAC;IAvBD,4BAuBC","sourcesContent":["import { Handle, EventObject } from './interfaces';\nimport { createHandle, createCompositeHandle } from './lang';\nimport Evented, { CustomEventTypes } from './Evented';\n\nexport interface EventCallback> {\n\t(event: O): void;\n}\n\nexport interface EventEmitter {\n\ton(event: string, listener: EventCallback): EventEmitter;\n\tremoveListener(event: string, listener: EventCallback): EventEmitter;\n}\n\ninterface DOMEventObject extends EventObject {\n\tbubbles: boolean;\n\tcancelable: boolean;\n}\n\n/**\n * Provides a normalized mechanism for dispatching events for event emitters, Evented objects, or DOM nodes.\n * @param target The target to emit the event from\n * @param event The event object to emit\n * @return Boolean indicating if preventDefault was called on the event object (only relevant for DOM events;\n * always false for other event emitters)\n */\nexport function emit<\n\tM extends CustomEventTypes,\n\tT,\n\tO extends EventObject = EventObject,\n\tK extends keyof M = keyof M\n>(target: Evented, event: M[K]): boolean;\nexport function emit = EventObject>(target: Evented, event: O): boolean;\nexport function emit = EventObject>(\n\ttarget: EventTarget | EventEmitter,\n\tevent: O\n): boolean;\nexport function emit(target: any, event: EventObject): boolean {\n\tif (\n\t\ttarget.dispatchEvent /* includes window and document */ &&\n\t\t((target.ownerDocument && target.ownerDocument.createEvent) /* matches nodes */ ||\n\t\t(target.document && target.document.createEvent) /* matches window */ ||\n\t\t\ttarget.createEvent) /* matches document */\n\t) {\n\t\tconst nativeEvent = (target.ownerDocument || target.document || target).createEvent('HTMLEvents');\n\t\tnativeEvent.initEvent(\n\t\t\tevent.type,\n\t\t\tBoolean((event).bubbles),\n\t\t\tBoolean((event).cancelable)\n\t\t);\n\n\t\tfor (let key in event) {\n\t\t\tif (!(key in nativeEvent)) {\n\t\t\t\tnativeEvent[key] = (event)[key];\n\t\t\t}\n\t\t}\n\n\t\treturn target.dispatchEvent(nativeEvent);\n\t}\n\n\tif (target.emit) {\n\t\tif (target.removeListener) {\n\t\t\t// Node.js EventEmitter\n\t\t\ttarget.emit(event.type, event);\n\t\t\treturn false;\n\t\t} else if (target.on) {\n\t\t\t// Dojo Evented or similar\n\t\t\ttarget.emit(event);\n\t\t\treturn false;\n\t\t}\n\t}\n\n\tthrow new Error('Target must be an event emitter');\n}\n\n/**\n * Provides a normalized mechanism for listening to events from event emitters, Evented objects, or DOM nodes.\n * @param target Target to listen for event on\n * @param type Event event type(s) to listen for; may a string or an array of strings\n * @param listener Callback to handle the event when it fires\n * @param capture Whether the listener should be registered in the capture phase (DOM events only)\n * @return A handle which will remove the listener when destroy is called\n */\nexport default function on<\n\tM extends CustomEventTypes,\n\tT,\n\tK extends keyof M = keyof M,\n\tO extends EventObject = EventObject\n>(target: Evented, type: K | K[], listener: EventCallback): Handle;\nexport default function on = EventObject>(\n\ttarget: Evented,\n\ttype: T | T[],\n\tlistener: EventCallback\n): Handle;\nexport default function on(target: EventEmitter, type: string | string[], listener: EventCallback): Handle;\nexport default function on(\n\ttarget: EventTarget,\n\ttype: string | string[],\n\tlistener: EventCallback,\n\tcapture?: boolean\n): Handle;\nexport default function on(target: any, type: any, listener: any, capture?: boolean): Handle {\n\tif (Array.isArray(type)) {\n\t\tlet handles: Handle[] = type.map(function(type: string): Handle {\n\t\t\treturn on(target, type, listener, capture);\n\t\t});\n\n\t\treturn createCompositeHandle(...handles);\n\t}\n\n\tconst callback = function(this: any) {\n\t\tlistener.apply(this, arguments);\n\t};\n\n\t// DOM EventTarget\n\tif (target.addEventListener && target.removeEventListener) {\n\t\ttarget.addEventListener(type, callback, capture);\n\t\treturn createHandle(function() {\n\t\t\ttarget.removeEventListener(type, callback, capture);\n\t\t});\n\t}\n\n\tif (target.on) {\n\t\t// EventEmitter\n\t\tif (target.removeListener) {\n\t\t\ttarget.on(type, callback);\n\t\t\treturn createHandle(function() {\n\t\t\t\ttarget.removeListener(type, callback);\n\t\t\t});\n\t\t} else if (target.emit) {\n\t\t\t// Evented\n\t\t\treturn target.on(type, listener);\n\t\t}\n\t}\n\n\tthrow new TypeError('Unknown event emitter object');\n}\n\n/**\n * Provides a mechanism for listening to the next occurrence of an event from event\n * emitters, Evented objects, or DOM nodes.\n * @param target Target to listen for event on\n * @param type Event event type(s) to listen for; may be a string or an array of strings\n * @param listener Callback to handle the event when it fires\n * @param capture Whether the listener should be registered in the capture phase (DOM events only)\n * @return A handle which will remove the listener when destroy is called\n */\nexport function once<\n\tM extends CustomEventTypes,\n\tT,\n\tK extends keyof M = keyof M,\n\tO extends EventObject = EventObject\n>(target: Evented, type: K | K[], listener: EventCallback): Handle;\nexport function once = EventObject>(\n\ttarget: Evented,\n\ttype: T | T[],\n\tlistener: EventCallback\n): Handle;\nexport function once(target: EventTarget, type: string | string[], listener: EventCallback, capture?: boolean): Handle;\nexport function once(target: EventEmitter, type: string | string[], listener: EventCallback): Handle;\nexport function once(target: any, type: any, listener: any, capture?: boolean): Handle {\n\t// FIXME\n\t// tslint:disable-next-line:no-var-keyword\n\tvar handle = on(\n\t\ttarget,\n\t\ttype,\n\t\tfunction(this: any) {\n\t\t\thandle.destroy();\n\t\t\treturn listener.apply(this, arguments);\n\t\t},\n\t\tcapture\n\t);\n\n\treturn handle;\n}\n\nexport interface PausableHandle extends Handle {\n\tpause(): void;\n\tresume(): void;\n}\n\n/**\n * Provides a mechanism for creating pausable listeners for events from event emitters, Evented objects, or DOM nodes.\n * @param target Target to listen for event on\n * @param type Event event type(s) to listen for; may a string or an array of strings\n * @param listener Callback to handle the event when it fires\n * @param capture Whether the listener should be registered in the capture phase (DOM events only)\n * @return A handle with additional pause and resume methods; the listener will never fire when paused\n */\nexport function pausable<\n\tM extends CustomEventTypes,\n\tT,\n\tK extends keyof M = keyof M,\n\tO extends EventObject = EventObject\n>(target: Evented, type: K | K[], listener: EventCallback): PausableHandle;\nexport function pausable = EventObject>(\n\ttarget: Evented,\n\ttype: T | T[],\n\tlistener: EventCallback\n): PausableHandle;\nexport function pausable(\n\ttarget: EventTarget,\n\ttype: string | string[],\n\tlistener: EventCallback,\n\tcapture?: boolean\n): PausableHandle;\nexport function pausable(target: EventEmitter, type: string | string[], listener: EventCallback): PausableHandle;\nexport function pausable(target: any, type: any, listener: any, capture?: boolean): PausableHandle {\n\tlet paused: boolean;\n\n\tconst handle = on(\n\t\ttarget,\n\t\ttype,\n\t\tfunction(this: any) {\n\t\t\tif (!paused) {\n\t\t\t\treturn listener.apply(this, arguments);\n\t\t\t}\n\t\t},\n\t\tcapture\n\t);\n\n\thandle.pause = function() {\n\t\tpaused = true;\n\t};\n\n\thandle.resume = function() {\n\t\tpaused = false;\n\t};\n\n\treturn handle;\n}\n"]} \ No newline at end of file diff --git a/deps/framework/core/on.mjs b/deps/framework/core/on.mjs deleted file mode 100644 index fead5a2df6..0000000000 --- a/deps/framework/core/on.mjs +++ /dev/null @@ -1,86 +0,0 @@ -import { createHandle, createCompositeHandle } from './lang'; -export function emit(target, event) { - if (target.dispatchEvent /* includes window and document */ && - ((target.ownerDocument && target.ownerDocument.createEvent) /* matches nodes */ || - (target.document && target.document.createEvent) /* matches window */ || - target.createEvent) /* matches document */) { - const nativeEvent = (target.ownerDocument || target.document || target).createEvent('HTMLEvents'); - nativeEvent.initEvent(event.type, Boolean(event.bubbles), Boolean(event.cancelable)); - for (let key in event) { - if (!(key in nativeEvent)) { - nativeEvent[key] = event[key]; - } - } - return target.dispatchEvent(nativeEvent); - } - if (target.emit) { - if (target.removeListener) { - // Node.js EventEmitter - target.emit(event.type, event); - return false; - } - else if (target.on) { - // Dojo Evented or similar - target.emit(event); - return false; - } - } - throw new Error('Target must be an event emitter'); -} -export default function on(target, type, listener, capture) { - if (Array.isArray(type)) { - let handles = type.map(function (type) { - return on(target, type, listener, capture); - }); - return createCompositeHandle(...handles); - } - const callback = function () { - listener.apply(this, arguments); - }; - // DOM EventTarget - if (target.addEventListener && target.removeEventListener) { - target.addEventListener(type, callback, capture); - return createHandle(function () { - target.removeEventListener(type, callback, capture); - }); - } - if (target.on) { - // EventEmitter - if (target.removeListener) { - target.on(type, callback); - return createHandle(function () { - target.removeListener(type, callback); - }); - } - else if (target.emit) { - // Evented - return target.on(type, listener); - } - } - throw new TypeError('Unknown event emitter object'); -} -export function once(target, type, listener, capture) { - // FIXME - // tslint:disable-next-line:no-var-keyword - var handle = on(target, type, function () { - handle.destroy(); - return listener.apply(this, arguments); - }, capture); - return handle; -} -export function pausable(target, type, listener, capture) { - let paused; - const handle = on(target, type, function () { - if (!paused) { - return listener.apply(this, arguments); - } - }, capture); - handle.pause = function () { - paused = true; - }; - handle.resume = function () { - paused = false; - }; - return handle; -} -//# sourceMappingURL=on.mjs.map \ No newline at end of file diff --git a/deps/framework/core/on.mjs.map b/deps/framework/core/on.mjs.map deleted file mode 100644 index 8ae59d8163..0000000000 --- a/deps/framework/core/on.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"on.mjs","sourceRoot":"","sources":["on.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,qBAAqB,EAAE,MAAM,QAAQ,CAAC;AAmC7D,MAAM,eAAe,MAAW,EAAE,KAAuB;IACxD,EAAE,CAAC,CACF,MAAM,CAAC,aAAa,CAAC,kCAAkC;QACvD,CAAC,CAAC,MAAM,CAAC,aAAa,IAAI,MAAM,CAAC,aAAa,CAAC,WAAW,CAAC,CAAC,mBAAmB;YAC/E,CAAC,MAAM,CAAC,QAAQ,IAAI,MAAM,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC,oBAAoB;YACpE,MAAM,CAAC,WAAW,CAAC,CAAC,sBACtB,CAAC,CAAC,CAAC;QACF,MAAM,WAAW,GAAG,CAAC,MAAM,CAAC,aAAa,IAAI,MAAM,CAAC,QAAQ,IAAI,MAAM,CAAC,CAAC,WAAW,CAAC,YAAY,CAAC,CAAC;QAClG,WAAW,CAAC,SAAS,CACpB,KAAK,CAAC,IAAI,EACV,OAAO,CAAkB,KAAM,CAAC,OAAO,CAAC,EACxC,OAAO,CAAkB,KAAM,CAAC,UAAU,CAAC,CAC3C,CAAC;QAEF,GAAG,CAAC,CAAC,IAAI,GAAG,IAAI,KAAK,CAAC,CAAC,CAAC;YACvB,EAAE,CAAC,CAAC,CAAC,CAAC,GAAG,IAAI,WAAW,CAAC,CAAC,CAAC,CAAC;gBAC3B,WAAW,CAAC,GAAG,CAAC,GAAS,KAAM,CAAC,GAAG,CAAC,CAAC;YACtC,CAAC;QACF,CAAC;QAED,MAAM,CAAC,MAAM,CAAC,aAAa,CAAC,WAAW,CAAC,CAAC;IAC1C,CAAC;IAED,EAAE,CAAC,CAAC,MAAM,CAAC,IAAI,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AAC,EACD,OAAO,CACP,CAAC;IAEF,MAAM,CAAC,KAAK,GAAG;QACd,MAAM,GAAG,IAAI,CAAC;IACf,CAAC,CAAC;IAEF,MAAM,CAAC,MAAM,GAAG;QACf,MAAM,GAAG,KAAK,CAAC;IAChB,CAAC,CAAC;IAEF,MAAM,CAAC,MAAM,CAAC;AACf,CAAC","sourcesContent":["import { Handle, EventObject } from './interfaces';\nimport { createHandle, createCompositeHandle } from './lang';\nimport Evented, { CustomEventTypes } from './Evented';\n\nexport interface EventCallback> {\n\t(event: O): void;\n}\n\nexport interface EventEmitter {\n\ton(event: string, listener: EventCallback): EventEmitter;\n\tremoveListener(event: string, listener: EventCallback): EventEmitter;\n}\n\ninterface DOMEventObject extends EventObject {\n\tbubbles: boolean;\n\tcancelable: boolean;\n}\n\n/**\n * Provides a normalized mechanism for dispatching events for event emitters, Evented objects, or DOM nodes.\n * @param target The target to emit the event from\n * @param event The event object to emit\n * @return Boolean indicating if preventDefault was called on the event object (only relevant for DOM events;\n * always false for other event emitters)\n */\nexport function emit<\n\tM extends CustomEventTypes,\n\tT,\n\tO extends EventObject = EventObject,\n\tK extends keyof M = keyof M\n>(target: Evented, event: M[K]): boolean;\nexport function emit = EventObject>(target: Evented, event: O): boolean;\nexport function emit = EventObject>(\n\ttarget: EventTarget | EventEmitter,\n\tevent: O\n): boolean;\nexport function emit(target: any, event: EventObject): boolean {\n\tif (\n\t\ttarget.dispatchEvent /* includes window and document */ &&\n\t\t((target.ownerDocument && target.ownerDocument.createEvent) /* matches nodes */ ||\n\t\t(target.document && target.document.createEvent) /* matches window */ ||\n\t\t\ttarget.createEvent) /* matches document */\n\t) {\n\t\tconst nativeEvent = (target.ownerDocument || target.document || target).createEvent('HTMLEvents');\n\t\tnativeEvent.initEvent(\n\t\t\tevent.type,\n\t\t\tBoolean((event).bubbles),\n\t\t\tBoolean((event).cancelable)\n\t\t);\n\n\t\tfor (let key in event) {\n\t\t\tif (!(key in nativeEvent)) {\n\t\t\t\tnativeEvent[key] = (event)[key];\n\t\t\t}\n\t\t}\n\n\t\treturn target.dispatchEvent(nativeEvent);\n\t}\n\n\tif (target.emit) {\n\t\tif (target.removeListener) {\n\t\t\t// Node.js EventEmitter\n\t\t\ttarget.emit(event.type, event);\n\t\t\treturn false;\n\t\t} else if (target.on) {\n\t\t\t// Dojo Evented or similar\n\t\t\ttarget.emit(event);\n\t\t\treturn false;\n\t\t}\n\t}\n\n\tthrow new Error('Target must be an event emitter');\n}\n\n/**\n * Provides a normalized mechanism for listening to events from event emitters, Evented objects, or DOM nodes.\n * @param target Target to listen for event on\n * @param type Event event type(s) to listen for; may a string or an array of strings\n * @param listener Callback to handle the event when it fires\n * @param capture Whether the listener should be registered in the capture phase (DOM events only)\n * @return A handle which will remove the listener when destroy is called\n */\nexport default function on<\n\tM extends CustomEventTypes,\n\tT,\n\tK extends keyof M = keyof M,\n\tO extends EventObject = EventObject\n>(target: Evented, type: K | K[], listener: EventCallback): Handle;\nexport default function on = EventObject>(\n\ttarget: Evented,\n\ttype: T | T[],\n\tlistener: EventCallback\n): Handle;\nexport default function on(target: EventEmitter, type: string | string[], listener: EventCallback): Handle;\nexport default function on(\n\ttarget: EventTarget,\n\ttype: string | string[],\n\tlistener: EventCallback,\n\tcapture?: boolean\n): Handle;\nexport default function on(target: any, type: any, listener: any, capture?: boolean): Handle {\n\tif (Array.isArray(type)) {\n\t\tlet handles: Handle[] = type.map(function(type: string): Handle {\n\t\t\treturn on(target, type, listener, capture);\n\t\t});\n\n\t\treturn createCompositeHandle(...handles);\n\t}\n\n\tconst callback = function(this: any) {\n\t\tlistener.apply(this, arguments);\n\t};\n\n\t// DOM EventTarget\n\tif (target.addEventListener && target.removeEventListener) {\n\t\ttarget.addEventListener(type, callback, capture);\n\t\treturn createHandle(function() {\n\t\t\ttarget.removeEventListener(type, callback, capture);\n\t\t});\n\t}\n\n\tif (target.on) {\n\t\t// EventEmitter\n\t\tif (target.removeListener) {\n\t\t\ttarget.on(type, callback);\n\t\t\treturn createHandle(function() {\n\t\t\t\ttarget.removeListener(type, callback);\n\t\t\t});\n\t\t} else if (target.emit) {\n\t\t\t// Evented\n\t\t\treturn target.on(type, listener);\n\t\t}\n\t}\n\n\tthrow new TypeError('Unknown event emitter object');\n}\n\n/**\n * Provides a mechanism for listening to the next occurrence of an event from event\n * emitters, Evented objects, or DOM nodes.\n * @param target Target to listen for event on\n * @param type Event event type(s) to listen for; may be a string or an array of strings\n * @param listener Callback to handle the event when it fires\n * @param capture Whether the listener should be registered in the capture phase (DOM events only)\n * @return A handle which will remove the listener when destroy is called\n */\nexport function once<\n\tM extends CustomEventTypes,\n\tT,\n\tK extends keyof M = keyof M,\n\tO extends EventObject = EventObject\n>(target: Evented, type: K | K[], listener: EventCallback): Handle;\nexport function once = EventObject>(\n\ttarget: Evented,\n\ttype: T | T[],\n\tlistener: EventCallback\n): Handle;\nexport function once(target: EventTarget, type: string | string[], listener: EventCallback, capture?: boolean): Handle;\nexport function once(target: EventEmitter, type: string | string[], listener: EventCallback): Handle;\nexport function once(target: any, type: any, listener: any, capture?: boolean): Handle {\n\t// FIXME\n\t// tslint:disable-next-line:no-var-keyword\n\tvar handle = on(\n\t\ttarget,\n\t\ttype,\n\t\tfunction(this: any) {\n\t\t\thandle.destroy();\n\t\t\treturn listener.apply(this, arguments);\n\t\t},\n\t\tcapture\n\t);\n\n\treturn handle;\n}\n\nexport interface PausableHandle extends Handle {\n\tpause(): void;\n\tresume(): void;\n}\n\n/**\n * Provides a mechanism for creating pausable listeners for events from event emitters, Evented objects, or DOM nodes.\n * @param target Target to listen for event on\n * @param type Event event type(s) to listen for; may a string or an array of strings\n * @param listener Callback to handle the event when it fires\n * @param capture Whether the listener should be registered in the capture phase (DOM events only)\n * @return A handle with additional pause and resume methods; the listener will never fire when paused\n */\nexport function pausable<\n\tM extends CustomEventTypes,\n\tT,\n\tK extends keyof M = keyof M,\n\tO extends EventObject = EventObject\n>(target: Evented, type: K | K[], listener: EventCallback): PausableHandle;\nexport function pausable = EventObject>(\n\ttarget: Evented,\n\ttype: T | T[],\n\tlistener: EventCallback\n): PausableHandle;\nexport function pausable(\n\ttarget: EventTarget,\n\ttype: string | string[],\n\tlistener: EventCallback,\n\tcapture?: boolean\n): PausableHandle;\nexport function pausable(target: EventEmitter, type: string | string[], listener: EventCallback): PausableHandle;\nexport function pausable(target: any, type: any, listener: any, capture?: boolean): PausableHandle {\n\tlet paused: boolean;\n\n\tconst handle = on(\n\t\ttarget,\n\t\ttype,\n\t\tfunction(this: any) {\n\t\t\tif (!paused) {\n\t\t\t\treturn listener.apply(this, arguments);\n\t\t\t}\n\t\t},\n\t\tcapture\n\t);\n\n\thandle.pause = function() {\n\t\tpaused = true;\n\t};\n\n\thandle.resume = function() {\n\t\tpaused = false;\n\t};\n\n\treturn handle;\n}\n"]} \ No newline at end of file diff --git a/deps/framework/core/queue.d.ts b/deps/framework/core/queue.d.ts deleted file mode 100644 index 8d27af09ea..0000000000 --- a/deps/framework/core/queue.d.ts +++ /dev/null @@ -1 +0,0 @@ -export * from '../shim/support/queue'; diff --git a/deps/framework/core/queue.js b/deps/framework/core/queue.js deleted file mode 100644 index 613b39305a..0000000000 --- a/deps/framework/core/queue.js +++ /dev/null @@ -1,15 +0,0 @@ -(function (factory) { - if (typeof module === "object" && typeof module.exports === "object") { - var v = factory(require, exports); - if (v !== undefined) module.exports = v; - } - else if (typeof define === "function" && define.amd) { - define(["require", "exports", "tslib", "../shim/support/queue"], factory); - } -})(function (require, exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - var tslib_1 = require("tslib"); - tslib_1.__exportStar(require("../shim/support/queue"), exports); -}); -//# sourceMappingURL=queue.js.map \ No newline at end of file diff --git a/deps/framework/core/queue.js.map b/deps/framework/core/queue.js.map deleted file mode 100644 index db4e37ef8a..0000000000 --- a/deps/framework/core/queue.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"queue.js","sourceRoot":"","sources":["queue.ts"],"names":[],"mappings":";;;;;;;;;;;;IAAA,gEAAsC","sourcesContent":["export * from '../shim/support/queue';\n"]} \ No newline at end of file diff --git a/deps/framework/core/queue.mjs b/deps/framework/core/queue.mjs deleted file mode 100644 index f48c609e9e..0000000000 --- a/deps/framework/core/queue.mjs +++ /dev/null @@ -1,2 +0,0 @@ -export * from '../shim/support/queue'; -//# sourceMappingURL=queue.mjs.map \ No newline at end of file diff --git a/deps/framework/core/queue.mjs.map b/deps/framework/core/queue.mjs.map deleted file mode 100644 index 10e56b4795..0000000000 --- a/deps/framework/core/queue.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"queue.mjs","sourceRoot":"","sources":["queue.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC","sourcesContent":["export * from '../shim/support/queue';\n"]} \ No newline at end of file diff --git a/deps/framework/core/request.d.ts b/deps/framework/core/request.d.ts deleted file mode 100644 index 31ba9e2a67..0000000000 --- a/deps/framework/core/request.d.ts +++ /dev/null @@ -1,19 +0,0 @@ -import Task from './async/Task'; -import { RequestOptions, Response, Provider, UploadObservableTask } from './request/interfaces'; -import ProviderRegistry from './request/ProviderRegistry'; -export declare const providerRegistry: ProviderRegistry; -declare const request: { - (url: string, options?: RequestOptions): Task; - delete(url: string, options?: RequestOptions): Task; - get(url: string, options?: RequestOptions): Task; - head(url: string, options?: RequestOptions): Task; - options(url: string, options?: RequestOptions): Task; - post(url: string, options?: RequestOptions): UploadObservableTask; - put(url: string, options?: RequestOptions): UploadObservableTask; - setDefaultProvider(provider: Provider): void; -}; -export default request; -export * from './request/interfaces'; -export { default as Headers } from './request/Headers'; -export { default as TimeoutError } from './request/TimeoutError'; -export { ResponseData } from './request/Response'; diff --git a/deps/framework/core/request.js b/deps/framework/core/request.js deleted file mode 100644 index b5b3899bfd..0000000000 --- a/deps/framework/core/request.js +++ /dev/null @@ -1,65 +0,0 @@ -(function (factory) { - if (typeof module === "object" && typeof module.exports === "object") { - var v = factory(require, exports); - if (v !== undefined) module.exports = v; - } - else if (typeof define === "function" && define.amd) { - define(["require", "exports", "../has/has", "./async/Task", "./request/ProviderRegistry", "./request/providers/xhr", "./request/Headers", "./request/TimeoutError"], factory); - } -})(function (require, exports) { - "use strict"; - var __syncRequire = typeof module === "object" && typeof module.exports === "object"; - Object.defineProperty(exports, "__esModule", { value: true }); - var has_1 = require("../has/has"); - var Task_1 = require("./async/Task"); - var ProviderRegistry_1 = require("./request/ProviderRegistry"); - var xhr_1 = require("./request/providers/xhr"); - exports.providerRegistry = new ProviderRegistry_1.default(); - var request = function request(url, options) { - if (options === void 0) { options = {}; } - try { - return exports.providerRegistry.match(url, options)(url, options); - } - catch (error) { - return Task_1.default.reject(error); - } - }; - ['DELETE', 'GET', 'HEAD', 'OPTIONS'].forEach(function (method) { - Object.defineProperty(request, method.toLowerCase(), { - value: function (url, options) { - if (options === void 0) { options = {}; } - options = Object.create(options); - options.method = method; - return request(url, options); - } - }); - }); - ['POST', 'PUT'].forEach(function (method) { - Object.defineProperty(request, method.toLowerCase(), { - value: function (url, options) { - if (options === void 0) { options = {}; } - options = Object.create(options); - options.method = method; - return request(url, options); - } - }); - }); - Object.defineProperty(request, 'setDefaultProvider', { - value: function (provider) { - exports.providerRegistry.setDefaultProvider(provider); - } - }); - exports.providerRegistry.setDefaultProvider(xhr_1.default); - if (has_1.default('host-node')) { - // tslint:disable-next-line - (__syncRequire ? Promise.resolve().then(function () { return require('./request/providers/node'); }) : new Promise(function (resolve_1, reject_1) { require(['./request/providers/node'], resolve_1, reject_1); })).then(function (node) { - exports.providerRegistry.setDefaultProvider(node.default); - }); - } - exports.default = request; - var Headers_1 = require("./request/Headers"); - exports.Headers = Headers_1.default; - var TimeoutError_1 = require("./request/TimeoutError"); - exports.TimeoutError = TimeoutError_1.default; -}); -//# sourceMappingURL=request.js.map \ No newline at end of file diff --git a/deps/framework/core/request.js.map b/deps/framework/core/request.js.map deleted file mode 100644 index 9516811031..0000000000 --- a/deps/framework/core/request.js.map +++ /dev/null @@ -1 +0,0 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AAM,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;gBACjC,OAAO,CAAC,MAAM,GAAG,MAAM,CAAC;gBACxB,MAAM,CAAiC,OAAO,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;YAC9D,CAAC;SACD,CAAC,CAAC;IACJ,CAAC,CAAC,CAAC;IAEH,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,oBAAoB,EAAE;QACpD,KAAK,YAAC,QAAkB;YACvB,wBAAgB,CAAC,kBAAkB,CAAC,QAAQ,CAAC,CAAC;QAC/C,CAAC;KACD,CAAC,CAAC;IAEH,wBAAgB,CAAC,kBAAkB,CAAC,aAAG,CAAC,CAAC;IAEzC,EAAE,CAAC,CAAC,aAAG,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC;QACtB,2BAA2B;QAC3B,qEAAO,0BAA0B,qHAAE,IAAI,CAAC,UAAC,IAAI;YAC5C,wBAAgB,CAAC,kBAAkB,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACnD,CAAC,CAAC,CAAC;IACJ,CAAC;IAED,kBAAe,OAAO,CAAC;IAEvB,6CAAuD;IAA9C,4BAAA,OAAO,CAAW;IAC3B,uDAAiE;IAAxD,sCAAA,OAAO,CAAgB","sourcesContent":["import has from '../has/has';\nimport Task from './async/Task';\nimport { RequestOptions, Response, Provider, UploadObservableTask } from './request/interfaces';\nimport ProviderRegistry from './request/ProviderRegistry';\nimport xhr from './request/providers/xhr';\n\nexport const providerRegistry = new ProviderRegistry();\n\nconst request: {\n\t(url: string, options?: RequestOptions): Task;\n\tdelete(url: string, options?: RequestOptions): Task;\n\tget(url: string, options?: RequestOptions): Task;\n\thead(url: string, options?: RequestOptions): Task;\n\toptions(url: string, options?: RequestOptions): Task;\n\tpost(url: string, options?: RequestOptions): UploadObservableTask;\n\tput(url: string, options?: RequestOptions): UploadObservableTask;\n\n\tsetDefaultProvider(provider: Provider): void;\n} = function request(url: string, options: RequestOptions = {}): Task {\n\ttry {\n\t\treturn providerRegistry.match(url, options)(url, options);\n\t} catch (error) {\n\t\treturn Task.reject(error);\n\t}\n};\n\n['DELETE', 'GET', 'HEAD', 'OPTIONS'].forEach((method) => {\n\tObject.defineProperty(request, method.toLowerCase(), {\n\t\tvalue(url: string, options: RequestOptions = {}): Task {\n\t\t\toptions = Object.create(options);\n\t\t\toptions.method = method;\n\t\t\treturn request(url, options);\n\t\t}\n\t});\n});\n\n['POST', 'PUT'].forEach((method) => {\n\tObject.defineProperty(request, method.toLowerCase(), {\n\t\tvalue(url: string, options: RequestOptions = {}): UploadObservableTask {\n\t\t\toptions = Object.create(options);\n\t\t\toptions.method = method;\n\t\t\treturn >request(url, options);\n\t\t}\n\t});\n});\n\nObject.defineProperty(request, 'setDefaultProvider', {\n\tvalue(provider: Provider) {\n\t\tproviderRegistry.setDefaultProvider(provider);\n\t}\n});\n\nproviderRegistry.setDefaultProvider(xhr);\n\nif (has('host-node')) {\n\t// tslint:disable-next-line\n\timport('./request/providers/node').then((node) => {\n\t\tproviderRegistry.setDefaultProvider(node.default);\n\t});\n}\n\nexport default request;\nexport * from './request/interfaces';\nexport { default as Headers } from './request/Headers';\nexport { default as TimeoutError } from './request/TimeoutError';\nexport { ResponseData } from './request/Response';\n"]} \ No newline at end of file diff --git a/deps/framework/core/request.mjs b/deps/framework/core/request.mjs deleted file mode 100644 index 36aea5b02b..0000000000 --- a/deps/framework/core/request.mjs +++ /dev/null @@ -1,47 +0,0 @@ -import has from '../has/has'; -import Task from './async/Task'; -import ProviderRegistry from './request/ProviderRegistry'; -import xhr from './request/providers/xhr'; -export const providerRegistry = new ProviderRegistry(); -const request = function request(url, options = {}) { - try { - return providerRegistry.match(url, options)(url, options); - } - catch (error) { - return Task.reject(error); - } -}; -['DELETE', 'GET', 'HEAD', 'OPTIONS'].forEach((method) => { - Object.defineProperty(request, method.toLowerCase(), { - value(url, options = {}) { - options = Object.create(options); - options.method = method; - return request(url, options); - } - }); -}); -['POST', 'PUT'].forEach((method) => { - Object.defineProperty(request, method.toLowerCase(), { - value(url, options = {}) { - options = Object.create(options); - options.method = method; - return request(url, options); - } - }); -}); -Object.defineProperty(request, 'setDefaultProvider', { - value(provider) { - providerRegistry.setDefaultProvider(provider); - } -}); -providerRegistry.setDefaultProvider(xhr); -if (has('host-node')) { - // tslint:disable-next-line - import('./request/providers/node').then((node) => { - providerRegistry.setDefaultProvider(node.default); - }); -} -export default request; -export { default as Headers } from './request/Headers'; -export { default as TimeoutError } from './request/TimeoutError'; -//# sourceMappingURL=request.mjs.map \ No newline at end of file diff --git a/deps/framework/core/request.mjs.map b/deps/framework/core/request.mjs.map deleted file mode 100644 index 45c8947b67..0000000000 --- a/deps/framework/core/request.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"request.mjs","sourceRoot":"","sources":["request.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,YAAY,CAAC;AAC7B,OAAO,IAAI,MAAM,cAAc,CAAC;AAEhC,OAAO,gBAAgB,MAAM,4BAA4B,CAAC;AAC1D,OAAO,GAAG,MAAM,yBAAyB,CAAC;AAE1C,MAAM,CAAC,MAAM,gBAAgB,GAAG,IAAI,gBAAgB,EAAE,CAAC;AAEvD,MAAM,OAAO,GAUJ,iBAAiB,GAAW,EAAE,UAA0B,EAAE;IAClE,IAAI,CAAC;QACJ,MAAM,CAAC,gBAAgB,CAAC,KAAK,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;IAC3D,CAAC;IAAC,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC;QAChB,MAAM,CAAC,IAAI,CAAC,MAAM,CAAW,KAAK,CAAC,CAAC;IACrC,CAAC;AACF,CAAC,CAAC;AAEF,CAAC,QAAQ,EAAE,KAAK,EAAE,MAAM,EAAE,SAAS,CAAC,CAAC,OAAO,CAAC,CAAC,MAAM,EAAE,EAAE;IACvD,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,MAAM,CAAC,WAAW,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AM,mBAAmB,CAAC;AACvD,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,wBAAwB,CAAC","sourcesContent":["import has from '../has/has';\nimport Task from './async/Task';\nimport { RequestOptions, Response, Provider, UploadObservableTask } from './request/interfaces';\nimport ProviderRegistry from './request/ProviderRegistry';\nimport xhr from './request/providers/xhr';\n\nexport const providerRegistry = new ProviderRegistry();\n\nconst request: {\n\t(url: string, options?: RequestOptions): Task;\n\tdelete(url: string, options?: RequestOptions): Task;\n\tget(url: string, options?: RequestOptions): Task;\n\thead(url: string, options?: RequestOptions): Task;\n\toptions(url: string, options?: RequestOptions): Task;\n\tpost(url: string, options?: RequestOptions): UploadObservableTask;\n\tput(url: string, options?: RequestOptions): UploadObservableTask;\n\n\tsetDefaultProvider(provider: Provider): void;\n} = function request(url: string, options: RequestOptions = {}): Task {\n\ttry {\n\t\treturn providerRegistry.match(url, options)(url, options);\n\t} catch (error) {\n\t\treturn Task.reject(error);\n\t}\n};\n\n['DELETE', 'GET', 'HEAD', 'OPTIONS'].forEach((method) => {\n\tObject.defineProperty(request, method.toLowerCase(), {\n\t\tvalue(url: string, options: RequestOptions = {}): Task {\n\t\t\toptions = Object.create(options);\n\t\t\toptions.method = method;\n\t\t\treturn request(url, options);\n\t\t}\n\t});\n});\n\n['POST', 'PUT'].forEach((method) => {\n\tObject.defineProperty(request, method.toLowerCase(), {\n\t\tvalue(url: string, options: RequestOptions = {}): UploadObservableTask {\n\t\t\toptions = Object.create(options);\n\t\t\toptions.method = method;\n\t\t\treturn >request(url, options);\n\t\t}\n\t});\n});\n\nObject.defineProperty(request, 'setDefaultProvider', {\n\tvalue(provider: Provider) {\n\t\tproviderRegistry.setDefaultProvider(provider);\n\t}\n});\n\nproviderRegistry.setDefaultProvider(xhr);\n\nif (has('host-node')) {\n\t// tslint:disable-next-line\n\timport('./request/providers/node').then((node) => {\n\t\tproviderRegistry.setDefaultProvider(node.default);\n\t});\n}\n\nexport default request;\nexport * from './request/interfaces';\nexport { default as Headers } from './request/Headers';\nexport { default as TimeoutError } from './request/TimeoutError';\nexport { ResponseData } from './request/Response';\n"]} \ No newline at end of file diff --git a/deps/framework/core/request/Headers.d.ts b/deps/framework/core/request/Headers.d.ts deleted file mode 100644 index 952dd0d9b4..0000000000 --- a/deps/framework/core/request/Headers.d.ts +++ /dev/null @@ -1,20 +0,0 @@ -import { Headers as HeadersInterface } from './interfaces'; -import { IterableIterator } from '../../shim/iterator'; -import Map from '../../shim/Map'; -export declare class Headers implements HeadersInterface { - protected map: Map; - constructor(headers?: { - [key: string]: string; - } | HeadersInterface); - append(name: string, value: string): void; - delete(name: string): void; - entries(): IterableIterator<[string, string]>; - get(name: string): string | null; - getAll(name: string): string[]; - has(name: string): boolean; - keys(): IterableIterator; - set(name: string, value: string): void; - values(): IterableIterator; - [Symbol.iterator](): IterableIterator<[string, string]>; -} -export default Headers; diff --git a/deps/framework/core/request/Headers.js b/deps/framework/core/request/Headers.js deleted file mode 100644 index 8c191316ba..0000000000 --- a/deps/framework/core/request/Headers.js +++ /dev/null @@ -1,138 +0,0 @@ -(function (factory) { - if (typeof module === "object" && typeof module.exports === "object") { - var v = factory(require, exports); - if (v !== undefined) module.exports = v; - } - else if (typeof define === "function" && define.amd) { - define(["require", "exports", "tslib", "../../shim/iterator", "../../shim/Map"], factory); - } -})(function (require, exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - var tslib_1 = require("tslib"); - var iterator_1 = require("../../shim/iterator"); - var Map_1 = require("../../shim/Map"); - function isHeadersLike(object) { - return (typeof object.append === 'function' && - typeof object.entries === 'function' && - typeof object[Symbol.iterator] === 'function'); - } - var Headers = /** @class */ (function () { - function Headers(headers) { - this.map = new Map_1.default(); - if (headers) { - if (headers instanceof Headers) { - this.map = new Map_1.default(headers.map); - } - else if (isHeadersLike(headers)) { - try { - for (var headers_1 = tslib_1.__values(headers), headers_1_1 = headers_1.next(); !headers_1_1.done; headers_1_1 = headers_1.next()) { - var _a = tslib_1.__read(headers_1_1.value, 2), key = _a[0], value = _a[1]; - this.append(key, value); - } - } - catch (e_1_1) { e_1 = { error: e_1_1 }; } - finally { - try { - if (headers_1_1 && !headers_1_1.done && (_b = headers_1.return)) _b.call(headers_1); - } - finally { if (e_1) throw e_1.error; } - } - } - else { - for (var key in headers) { - this.set(key, headers[key]); - } - } - } - var e_1, _b; - } - Headers.prototype.append = function (name, value) { - var values = this.map.get(name.toLowerCase()); - if (values) { - values.push(value); - } - else { - this.set(name, value); - } - }; - Headers.prototype.delete = function (name) { - this.map.delete(name.toLowerCase()); - }; - Headers.prototype.entries = function () { - var entries = []; - var _loop_1 = function (key, values) { - values.forEach(function (value) { - entries.push([key, value]); - }); - }; - try { - for (var _a = tslib_1.__values(this.map.entries()), _b = _a.next(); !_b.done; _b = _a.next()) { - var _c = tslib_1.__read(_b.value, 2), key = _c[0], values = _c[1]; - _loop_1(key, values); - } - } - catch (e_2_1) { e_2 = { error: e_2_1 }; } - finally { - try { - if (_b && !_b.done && (_d = _a.return)) _d.call(_a); - } - finally { if (e_2) throw e_2.error; } - } - return new iterator_1.ShimIterator(entries); - var e_2, _d; - }; - Headers.prototype.get = function (name) { - var values = this.map.get(name.toLowerCase()); - if (values) { - return values[0]; - } - else { - return null; - } - }; - Headers.prototype.getAll = function (name) { - var values = this.map.get(name.toLowerCase()); - if (values) { - return values.slice(0); - } - else { - return []; - } - }; - Headers.prototype.has = function (name) { - return this.map.has(name.toLowerCase()); - }; - Headers.prototype.keys = function () { - return this.map.keys(); - }; - Headers.prototype.set = function (name, value) { - this.map.set(name.toLowerCase(), [value]); - }; - Headers.prototype.values = function () { - var values = []; - try { - for (var _a = tslib_1.__values(this.map.values()), _b = _a.next(); !_b.done; _b = _a.next()) { - var value = _b.value; - values.push.apply(values, tslib_1.__spread(value)); - } - } - catch (e_3_1) { e_3 = { error: e_3_1 }; } - finally { - try { - if (_b && !_b.done && (_c = _a.return)) _c.call(_a); - } - finally { if (e_3) throw e_3.error; } - } - return new iterator_1.ShimIterator(values); - var e_3, _c; - }; - Headers.prototype[Symbol.iterator] = function () { - return this.entries(); - }; - return Headers; - }()); - exports.Headers = Headers; - exports.default = Headers; -}); -//# sourceMappingURL=Headers.js.map \ No newline at end of file diff --git a/deps/framework/core/request/Headers.js.map b/deps/framework/core/request/Headers.js.map deleted file mode 100644 index cc97c9c7e4..0000000000 --- a/deps/framework/core/request/Headers.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"Headers.js","sourceRoot":"","sources":["Headers.ts"],"names":[],"mappings":";;;;;;;;;;;;IACA,gDAAqE;IACrE,sCAAiC;IAEjC,uBAAuB,MAAW;QACjC,MAAM,CAAC,CACN,OAAO,MAAM,CAAC,MAAM,KAAK,UAAU;YACnC,OAAO,MAAM,CAAC,OAAO,KAAK,UAAU;YACpC,OAAO,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,KAAK,UAAU,CAC7C,CAAC;IACH,CAAC;IAED;QAGC,iBAAY,OAAsD;YAFxD,QAAG,GAAG,IAAI,aAAG,EAAoB,CAAC;YAG3C,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC;gBACb,EAAE,CAAC,CAAC,OAAO,YAAY,OAAO,CAAC,CAAC,CAAC;oBAChC,IAAI,CAAC,GAAG,GAAG,IAAI,aAAG,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;gBACjC,CAAC;gBAAC,IAAI,CAAC,EAAE,CAAC,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;;wBACnC,GAAG,CAAC,CAAuB,IAAA,YAAA,iBAAA,OAAO,CAAA,gCAAA;4BAAvB,IAAA,yCAAY,EAAX,WAAG,EAAE,aAAK;4BACrB,IAAI,CAAC,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;yBACxB;;;;;;;;;gBACF,CAAC;gBAAC,IAAI,CAAC,CAAC;oBACP,GAAG,CAAC,CAAC,IAAI,GAAG,IAAI,OAAO,CAAC,CAAC,CAAC;wB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AjB;YACC,MAAM,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC;QACvB,CAAC;QACF,cAAC;IAAD,CAAC,AAtFD,IAsFC;IAtFY,0BAAO;IAwFpB,kBAAe,OAAO,CAAC","sourcesContent":["import { Headers as HeadersInterface } from './interfaces';\nimport { IterableIterator, ShimIterator } from '../../shim/iterator';\nimport Map from '../../shim/Map';\n\nfunction isHeadersLike(object: any): object is HeadersInterface {\n\treturn (\n\t\ttypeof object.append === 'function' &&\n\t\ttypeof object.entries === 'function' &&\n\t\ttypeof object[Symbol.iterator] === 'function'\n\t);\n}\n\nexport class Headers implements HeadersInterface {\n\tprotected map = new Map();\n\n\tconstructor(headers?: { [key: string]: string } | HeadersInterface) {\n\t\tif (headers) {\n\t\t\tif (headers instanceof Headers) {\n\t\t\t\tthis.map = new Map(headers.map);\n\t\t\t} else if (isHeadersLike(headers)) {\n\t\t\t\tfor (const [key, value] of headers) {\n\t\t\t\t\tthis.append(key, value);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tfor (let key in headers) {\n\t\t\t\t\tthis.set(key, headers[key]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tappend(name: string, value: string) {\n\t\tconst values = this.map.get(name.toLowerCase());\n\n\t\tif (values) {\n\t\t\tvalues.push(value);\n\t\t} else {\n\t\t\tthis.set(name, value);\n\t\t}\n\t}\n\n\tdelete(name: string) {\n\t\tthis.map.delete(name.toLowerCase());\n\t}\n\n\tentries(): IterableIterator<[string, string]> {\n\t\tconst entries: [string, string][] = [];\n\t\tfor (const [key, values] of this.map.entries()) {\n\t\t\tvalues.forEach((value) => {\n\t\t\t\tentries.push([key, value]);\n\t\t\t});\n\t\t}\n\t\treturn new ShimIterator(entries);\n\t}\n\n\tget(name: string): string | null {\n\t\tconst values = this.map.get(name.toLowerCase());\n\n\t\tif (values) {\n\t\t\treturn values[0];\n\t\t} else {\n\t\t\treturn null;\n\t\t}\n\t}\n\n\tgetAll(name: string): string[] {\n\t\tconst values = this.map.get(name.toLowerCase());\n\n\t\tif (values) {\n\t\t\treturn values.slice(0);\n\t\t} else {\n\t\t\treturn [];\n\t\t}\n\t}\n\n\thas(name: string): boolean {\n\t\treturn this.map.has(name.toLowerCase());\n\t}\n\n\tkeys(): IterableIterator {\n\t\treturn this.map.keys();\n\t}\n\n\tset(name: string, value: string) {\n\t\tthis.map.set(name.toLowerCase(), [value]);\n\t}\n\n\tvalues(): IterableIterator {\n\t\tconst values: string[] = [];\n\t\tfor (const value of this.map.values()) {\n\t\t\tvalues.push(...value);\n\t\t}\n\t\treturn new ShimIterator(values);\n\t}\n\n\t[Symbol.iterator]() {\n\t\treturn this.entries();\n\t}\n}\n\nexport default Headers;\n"]} \ No newline at end of file diff --git a/deps/framework/core/request/Headers.mjs b/deps/framework/core/request/Headers.mjs deleted file mode 100644 index 7c950ede2a..0000000000 --- a/deps/framework/core/request/Headers.mjs +++ /dev/null @@ -1,87 +0,0 @@ -import { ShimIterator } from '../../shim/iterator'; -import Map from '../../shim/Map'; -function isHeadersLike(object) { - return (typeof object.append === 'function' && - typeof object.entries === 'function' && - typeof object[Symbol.iterator] === 'function'); -} -export class Headers { - constructor(headers) { - this.map = new Map(); - if (headers) { - if (headers instanceof Headers) { - this.map = new Map(headers.map); - } - else if (isHeadersLike(headers)) { - for (const [key, value] of headers) { - this.append(key, value); - } - } - else { - for (let key in headers) { - this.set(key, headers[key]); - } - } - } - } - append(name, value) { - const values = this.map.get(name.toLowerCase()); - if (values) { - values.push(value); - } - else { - this.set(name, value); - } - } - delete(name) { - this.map.delete(name.toLowerCase()); - } - entries() { - const entries = []; - for (const [key, values] of this.map.entries()) { - values.forEach((value) => { - entries.push([key, value]); - }); - } - return new ShimIterator(entries); - } - get(name) { - const values = this.map.get(name.toLowerCase()); - if (values) { - return values[0]; - } - else { - return null; - } - } - getAll(name) { - const values = this.map.get(name.toLowerCase()); - if (values) { - return values.slice(0); - } - else { - return []; - } - } - has(name) { - return this.map.has(name.toLowerCase()); - } - keys() { - return this.map.keys(); - } - set(name, value) { - this.map.set(name.toLowerCase(), [value]); - } - values() { - const values = []; - for (const value of this.map.values()) { - values.push(...value); - } - return new ShimIterator(values); - } - [Symbol.iterator]() { - return this.entries(); - } -} -export default Headers; -//# sourceMappingURL=Headers.mjs.map \ No newline at end of file diff --git a/deps/framework/core/request/Headers.mjs.map b/deps/framework/core/request/Headers.mjs.map deleted file mode 100644 index 5f4ed81a38..0000000000 --- a/deps/framework/core/request/Headers.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"Headers.mjs","sourceRoot":"","sources":["Headers.ts"],"names":[],"mappings":"AACA,OAAO,EAAoB,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACrE,OAAO,GAAG,MAAM,gBAAgB,CAAC;AAEjC,uBAAuB,MAAW;IACjC,MAAM,CAAC,CACN,OAAO,MAAM,CAAC,MAAM,KAAK,UAAU;QACnC,OAAO,MAAM,CAAC,OAAO,KAAK,UAAU;QACpC,OAAO,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,KAAK,UAAU,CAC7C,CAAC;AACH,CAAC;AAED,MAAM;IAGL,YAAY,OAAsD;QAFxD,QAAG,GAAG,IAAI,GAAG,EAAoB,CAAC;QAG3C,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC;YACb,EAAE,CAAC,CAAC,OAAO,YAAY,OAAO,CAAC,CAAC,CAAC;gBAChC,IAAI,CAAC,GAAG,GAAG,IAAI,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;YACjC,CAAC;YAAC,IAAI,CAAC,EAAE,CAAC,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;gBACnC,GAAG,CAAC,CAAC,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,OAAO,CAAC,CAAC,CAAC;oBACpC,IAAI,CAAC,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;gBACzB,CAAC;YACF,CAAC;YAAC,IA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from './interfaces';\nimport { IterableIterator, ShimIterator } from '../../shim/iterator';\nimport Map from '../../shim/Map';\n\nfunction isHeadersLike(object: any): object is HeadersInterface {\n\treturn (\n\t\ttypeof object.append === 'function' &&\n\t\ttypeof object.entries === 'function' &&\n\t\ttypeof object[Symbol.iterator] === 'function'\n\t);\n}\n\nexport class Headers implements HeadersInterface {\n\tprotected map = new Map();\n\n\tconstructor(headers?: { [key: string]: string } | HeadersInterface) {\n\t\tif (headers) {\n\t\t\tif (headers instanceof Headers) {\n\t\t\t\tthis.map = new Map(headers.map);\n\t\t\t} else if (isHeadersLike(headers)) {\n\t\t\t\tfor (const [key, value] of headers) {\n\t\t\t\t\tthis.append(key, value);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tfor (let key in headers) {\n\t\t\t\t\tthis.set(key, headers[key]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tappend(name: string, value: string) {\n\t\tconst values = this.map.get(name.toLowerCase());\n\n\t\tif (values) {\n\t\t\tvalues.push(value);\n\t\t} else {\n\t\t\tthis.set(name, value);\n\t\t}\n\t}\n\n\tdelete(name: string) {\n\t\tthis.map.delete(name.toLowerCase());\n\t}\n\n\tentries(): IterableIterator<[string, string]> {\n\t\tconst entries: [string, string][] = [];\n\t\tfor (const [key, values] of this.map.entries()) {\n\t\t\tvalues.forEach((value) => {\n\t\t\t\tentries.push([key, value]);\n\t\t\t});\n\t\t}\n\t\treturn new ShimIterator(entries);\n\t}\n\n\tget(name: string): string | null {\n\t\tconst values = this.map.get(name.toLowerCase());\n\n\t\tif (values) {\n\t\t\treturn values[0];\n\t\t} else {\n\t\t\treturn null;\n\t\t}\n\t}\n\n\tgetAll(name: string): string[] {\n\t\tconst values = this.map.get(name.toLowerCase());\n\n\t\tif (values) {\n\t\t\treturn values.slice(0);\n\t\t} else {\n\t\t\treturn [];\n\t\t}\n\t}\n\n\thas(name: string): boolean {\n\t\treturn this.map.has(name.toLowerCase());\n\t}\n\n\tkeys(): IterableIterator {\n\t\treturn this.map.keys();\n\t}\n\n\tset(name: string, value: string) {\n\t\tthis.map.set(name.toLowerCase(), [value]);\n\t}\n\n\tvalues(): IterableIterator {\n\t\tconst values: string[] = [];\n\t\tfor (const value of this.map.values()) {\n\t\t\tvalues.push(...value);\n\t\t}\n\t\treturn new ShimIterator(values);\n\t}\n\n\t[Symbol.iterator]() {\n\t\treturn this.entries();\n\t}\n}\n\nexport default Headers;\n"]} \ No newline at end of file diff --git a/deps/framework/core/request/ProviderRegistry.d.ts b/deps/framework/core/request/ProviderRegistry.d.ts deleted file mode 100644 index 688c2ea03d..0000000000 --- a/deps/framework/core/request/ProviderRegistry.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { Provider, ProviderTest } from './interfaces'; -import MatchRegistry from '../MatchRegistry'; -import { Handle } from '../interfaces'; -export declare class ProviderRegistry extends MatchRegistry { - setDefaultProvider(provider: Provider): void; - register(test: string | RegExp | ProviderTest | null, value: Provider, first?: boolean): Handle; -} -export default ProviderRegistry; diff --git a/deps/framework/core/request/ProviderRegistry.js b/deps/framework/core/request/ProviderRegistry.js deleted file mode 100644 index 78c715ea44..0000000000 --- a/deps/framework/core/request/ProviderRegistry.js +++ /dev/null @@ -1,42 +0,0 @@ -(function (factory) { - if (typeof module === "object" && typeof module.exports === "object") { - var v = factory(require, exports); - if (v !== undefined) module.exports = v; - } - else if (typeof define === "function" && define.amd) { - define(["require", "exports", "tslib", "../MatchRegistry"], factory); - } -})(function (require, exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - var tslib_1 = require("tslib"); - var MatchRegistry_1 = require("../MatchRegistry"); - var ProviderRegistry = /** @class */ (function (_super) { - tslib_1.__extends(ProviderRegistry, _super); - function ProviderRegistry() { - return _super !== null && _super.apply(this, arguments) || this; - } - ProviderRegistry.prototype.setDefaultProvider = function (provider) { - this._defaultValue = provider; - }; - ProviderRegistry.prototype.register = function (test, value, first) { - var entryTest; - if (typeof test === 'string') { - entryTest = function (url, options) { return test === url; }; - } - else if (test instanceof RegExp) { - entryTest = function (url, options) { - return test ? test.test(url) : null; - }; - } - else { - entryTest = test; - } - return _super.prototype.register.call(this, entryTest, value, first); - }; - return ProviderRegistry; - }(MatchRegistry_1.default)); - exports.ProviderRegistry = ProviderRegistry; - exports.default = ProviderRegistry; -}); -//# sourceMappingURL=ProviderRegistry.js.map \ No newline at end of file diff --git a/deps/framework/core/request/ProviderRegistry.js.map b/deps/framework/core/request/ProviderRegistry.js.map deleted file mode 100644 index 12c79794b0..0000000000 --- a/deps/framework/core/request/ProviderRegistry.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"ProviderRegistry.js","sourceRoot":"","sources":["ProviderRegistry.ts"],"names":[],"mappings":";;;;;;;;;;;;IACA,kDAAuD;IAGvD;QAAsC,4CAAuB;QAA7D;;QAoBA,CAAC;QAnBA,6CAAkB,GAAlB,UAAmB,QAAkB;YACpC,IAAI,CAAC,aAAa,GAAG,QAAQ,CAAC;QAC/B,CAAC;QAED,mCAAQ,GAAR,UAAS,IAA2C,EAAE,KAAe,EAAE,KAAe;YACrF,IAAI,SAAsB,CAAC;YAE3B,EAAE,CAAC,CAAC,OAAO,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC;gBAC9B,SAAS,GAAG,UAAC,GAAG,EAAE,OAAO,IAAK,OAAA,IAAI,KAAK,GAAG,EAAZ,CAAY,CAAC;YAC5C,CAAC;YAAC,IAAI,CAAC,EAAE,CAAC,CAAC,IAAI,YAAY,MAAM,CAAC,CAAC,CAAC;gBACnC,SAAS,GAAG,UAAC,GAAG,EAAE,OAAO;oBACxB,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;gBACrC,CAAC,CAAC;YACH,CAAC;YAAC,IAAI,CAAC,CAAC;gBACP,SAAS,GAAG,IAAI,CAAC;YAClB,CAAC;YAED,MAAM,CAAC,iBAAM,QAAQ,YAAC,SAAS,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC;QAChD,CAAC;QACF,uBAAC;IAAD,CAAC,AApBD,CAAsC,uBAAa,GAoBlD;IApBY,4CAAgB;IAsB7B,kBAAe,gBAAgB,CAAC","sourcesContent":["import { Provider, ProviderTest } from './interfaces';\nimport MatchRegistry, { Test } from '../MatchRegistry';\nimport { Handle } from '../interfaces';\n\nexport class ProviderRegistry extends MatchRegistry {\n\tsetDefaultProvider(provider: Provider) {\n\t\tthis._defaultValue = provider;\n\t}\n\n\tregister(test: string | RegExp | ProviderTest | null, value: Provider, first?: boolean): Handle {\n\t\tlet entryTest: Test | null;\n\n\t\tif (typeof test === 'string') {\n\t\t\tentryTest = (url, options) => test === url;\n\t\t} else if (test instanceof RegExp) {\n\t\t\tentryTest = (url, options) => {\n\t\t\t\treturn test ? test.test(url) : null;\n\t\t\t};\n\t\t} else {\n\t\t\tentryTest = test;\n\t\t}\n\n\t\treturn super.register(entryTest, value, first);\n\t}\n}\n\nexport default ProviderRegistry;\n"]} \ No newline at end of file diff --git a/deps/framework/core/request/ProviderRegistry.mjs b/deps/framework/core/request/ProviderRegistry.mjs deleted file mode 100644 index 64ef1ff190..0000000000 --- a/deps/framework/core/request/ProviderRegistry.mjs +++ /dev/null @@ -1,23 +0,0 @@ -import MatchRegistry from '../MatchRegistry'; -export class ProviderRegistry extends MatchRegistry { - setDefaultProvider(provider) { - this._defaultValue = provider; - } - register(test, value, first) { - let entryTest; - if (typeof test === 'string') { - entryTest = (url, options) => test === url; - } - else if (test instanceof RegExp) { - entryTest = (url, options) => { - return test ? test.test(url) : null; - }; - } - else { - entryTest = test; - } - return super.register(entryTest, value, first); - } -} -export default ProviderRegistry; -//# sourceMappingURL=ProviderRegistry.mjs.map \ No newline at end of file diff --git a/deps/framework/core/request/ProviderRegistry.mjs.map b/deps/framework/core/request/ProviderRegistry.mjs.map deleted file mode 100644 index 112fef4118..0000000000 --- a/deps/framework/core/request/ProviderRegistry.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"ProviderRegistry.mjs","sourceRoot":"","sources":["ProviderRegistry.ts"],"names":[],"mappings":"AACA,OAAO,aAAuB,MAAM,kBAAkB,CAAC;AAGvD,MAAM,uBAAwB,SAAQ,aAAuB;IAC5D,kBAAkB,CAAC,QAAkB;QACpC,IAAI,CAAC,aAAa,GAAG,QAAQ,CAAC;IAC/B,CAAC;IAED,QAAQ,CAAC,IAA2C,EAAE,KAAe,EAAE,KAAe;QACrF,IAAI,SAAsB,CAAC;QAE3B,EAAE,CAAC,CAAC,OAAO,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC;YAC9B,SAAS,GAAG,CAAC,GAAG,EAAE,OAAO,EAAE,EAAE,CAAC,IAAI,KAAK,GAAG,CAAC;QAC5C,CAAC;QAAC,IAAI,CAAC,EAAE,CAAC,CAAC,IAAI,YAAY,MAAM,CAAC,CAAC,CAAC;YACnC,SAAS,GAAG,CAAC,GAAG,EAAE,OAAO,EAAE,EAAE;gBAC5B,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;YACrC,CAAC,CAAC;QACH,CAAC;QAAC,IAAI,CAAC,CAAC;YACP,SAAS,GAAG,IAAI,CAAC;QAClB,CAAC;QAED,MAAM,CAAC,KAAK,CAAC,QAAQ,CAAC,SAAS,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC;IAChD,CAAC;CACD;AAED,eAAe,gBAAgB,CAAC","sourcesContent":["import { Provider, ProviderTest } from './interfaces';\nimport MatchRegistry, { Test } from '../MatchRegistry';\nimport { Handle } from '../interfaces';\n\nexport class ProviderRegistry extends MatchRegistry {\n\tsetDefaultProvider(provider: Provider) {\n\t\tthis._defaultValue = provider;\n\t}\n\n\tregister(test: string | RegExp | ProviderTest | null, value: Provider, first?: boolean): Handle {\n\t\tlet entryTest: Test | null;\n\n\t\tif (typeof test === 'string') {\n\t\t\tentryTest = (url, options) => test === url;\n\t\t} else if (test instanceof RegExp) {\n\t\t\tentryTest = (url, options) => {\n\t\t\t\treturn test ? test.test(url) : null;\n\t\t\t};\n\t\t} else {\n\t\t\tentryTest = test;\n\t\t}\n\n\t\treturn super.register(entryTest, value, first);\n\t}\n}\n\nexport default ProviderRegistry;\n"]} \ No newline at end of file diff --git a/deps/framework/core/request/Response.d.ts b/deps/framework/core/request/Response.d.ts deleted file mode 100644 index b4489c3663..0000000000 --- a/deps/framework/core/request/Response.d.ts +++ /dev/null @@ -1,28 +0,0 @@ -import Task from '../async/Task'; -import { Headers, Response as ResponseInterface, RequestOptions } from './interfaces'; -import Observable from '../Observable'; -export interface ResponseData { - task: Task; - used: boolean; -} -declare abstract class Response implements ResponseInterface { - readonly abstract headers: Headers; - readonly abstract ok: boolean; - readonly abstract status: number; - readonly abstract statusText: string; - readonly abstract url: string; - readonly abstract bodyUsed: boolean; - readonly abstract requestOptions: RequestOptions; - readonly abstract download: Observable; - readonly abstract data: Observable; - json(): Task; - abstract arrayBuffer(): Task; - abstract blob(): Task; - abstract formData(): Task; - abstract text(): Task; -} -export default Response; -export declare function getFileReaderPromise(reader: FileReader): Promise; -export declare function getTextFromBlob(blob: Blob): Promise; -export declare function getArrayBufferFromBlob(blob: Blob): Promise; -export declare function getTextFromArrayBuffer(buffer: ArrayBuffer): string; diff --git a/deps/framework/core/request/Response.js b/deps/framework/core/request/Response.js deleted file mode 100644 index 3ad895c82f..0000000000 --- a/deps/framework/core/request/Response.js +++ /dev/null @@ -1,57 +0,0 @@ -(function (factory) { - if (typeof module === "object" && typeof module.exports === "object") { - var v = factory(require, exports); - if (v !== undefined) module.exports = v; - } - else if (typeof define === "function" && define.amd) { - define(["require", "exports", "../../shim/Promise"], factory); - } -})(function (require, exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - var Promise_1 = require("../../shim/Promise"); - var Response = /** @class */ (function () { - function Response() { - } - Response.prototype.json = function () { - return this.text().then(JSON.parse); - }; - return Response; - }()); - exports.default = Response; - function getFileReaderPromise(reader) { - return new Promise_1.default(function (resolve, reject) { - reader.onload = function () { - resolve(reader.result); - }; - reader.onerror = function () { - reject(reader.error); - }; - }); - } - exports.getFileReaderPromise = getFileReaderPromise; - function getTextFromBlob(blob) { - var reader = new FileReader(); - var promise = getFileReaderPromise(reader); - reader.readAsText(blob); - return promise; - } - exports.getTextFromBlob = getTextFromBlob; - function getArrayBufferFromBlob(blob) { - var reader = new FileReader(); - var promise = getFileReaderPromise(reader); - reader.readAsArrayBuffer(blob); - return promise; - } - exports.getArrayBufferFromBlob = getArrayBufferFromBlob; - function getTextFromArrayBuffer(buffer) { - var view = new Uint8Array(buffer); - var chars = []; - view.forEach(function (charCode, index) { - chars[index] = String.fromCharCode(charCode); - }); - return chars.join(''); - } - exports.getTextFromArrayBuffer = getTextFromArrayBuffer; -}); -//# sourceMappingURL=Response.js.map \ No newline at end of file diff --git a/deps/framework/core/request/Response.js.map b/deps/framework/core/request/Response.js.map deleted file mode 100644 index 8555a65eef..0000000000 --- a/deps/framework/core/request/Response.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"Response.js","sourceRoot":"","sources":["Response.ts"],"names":[],"mappings":";;;;;;;;;;;IAAA,8CAAyC;IAUzC;QAAA;QAoBA,CAAC;QARA,uBAAI,GAAJ;YACC,MAAM,CAAM,IAAI,CAAC,IAAI,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QAC1C,CAAC;QAMF,eAAC;IAAD,CAAC,AApBD,IAoBC;IAED,kBAAe,QAAQ,CAAC;IAExB,8BAAwC,MAAkB;QACzD,MAAM,CAAC,IAAI,iBAAO,CAAC,UAAC,OAAO,EAAE,MAAM;YAClC,MAAM,CAAC,MAAM,GAAG;gBACf,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;YACxB,CAAC,CAAC;YACF,MAAM,CAAC,OAAO,GAAG;gBAChB,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;YACtB,CAAC,CAAC;QACH,CAAC,CAAC,CAAC;IACJ,CAAC;IATD,oDASC;IAED,yBAAgC,IAAU;QACzC,IAAM,MAAM,GAAG,IAAI,UAAU,EAAE,CAAC;QAChC,IAAM,OAAO,GAAG,oBAAoB,CAAS,MAAM,CAAC,CAAC;QACrD,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;QACxB,MAAM,CAAC,OAAO,CAAC;IAChB,CAAC;IALD,0CAKC;IAED,gCAAuC,IAAU;QAChD,IAAM,MAAM,GAAG,IAAI,UAAU,EAAE,CAAC;QAChC,IAAM,OAAO,GAAG,oBAAoB,CAAc,MAAM,CAAC,CAAC;QAC1D,MAAM,CAAC,iBAAiB,CAAC,IAAI,CAAC,CAAC;QAC/B,MAAM,CAAC,OAAO,CAAC;IAChB,CAAC;IALD,wDAKC;IAED,gCAAuC,MAAmB;QACzD,IAAM,IAAI,GAAG,IAAI,UAAU,CAAC,MAAM,CAAC,CAAC;QACpC,IAAM,KAAK,GAAa,EAAE,CAAC;QAE3B,IAAI,CAAC,OAAO,CAAC,UAAC,QAAQ,EAAE,KAAK;YAC5B,KAAK,CAAC,KAAK,CAAC,GAAG,MAAM,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC;QAC9C,CAAC,CAAC,CAAC;QAEH,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACvB,CAAC;IATD,wDASC","sourcesContent":["import Promise from '../../shim/Promise';\nimport Task from '../async/Task';\nimport { Headers, Response as ResponseInterface, RequestOptions } from './interfaces';\nimport Observable from '../Observable';\n\nexport interface ResponseData {\n\ttask: Task;\n\tused: boolean;\n}\n\nabstract class Response implements ResponseInterface {\n\tabstract readonly headers: Headers;\n\tabstract readonly ok: boolean;\n\tabstract readonly status: number;\n\tabstract readonly statusText: string;\n\tabstract readonly url: string;\n\tabstract readonly bodyUsed: boolean;\n\tabstract readonly requestOptions: RequestOptions;\n\n\tabstract readonly download: Observable;\n\tabstract readonly data: Observable;\n\n\tjson(): Task {\n\t\treturn this.text().then(JSON.parse);\n\t}\n\n\tabstract arrayBuffer(): Task;\n\tabstract blob(): Task;\n\tabstract formData(): Task;\n\tabstract text(): Task;\n}\n\nexport default Response;\n\nexport function getFileReaderPromise(reader: FileReader): Promise {\n\treturn new Promise((resolve, reject) => {\n\t\treader.onload = function() {\n\t\t\tresolve(reader.result);\n\t\t};\n\t\treader.onerror = function() {\n\t\t\treject(reader.error);\n\t\t};\n\t});\n}\n\nexport function getTextFromBlob(blob: Blob) {\n\tconst reader = new FileReader();\n\tconst promise = getFileReaderPromise(reader);\n\treader.readAsText(blob);\n\treturn promise;\n}\n\nexport function getArrayBufferFromBlob(blob: Blob) {\n\tconst reader = new FileReader();\n\tconst promise = getFileReaderPromise(reader);\n\treader.readAsArrayBuffer(blob);\n\treturn promise;\n}\n\nexport function getTextFromArrayBuffer(buffer: ArrayBuffer) {\n\tconst view = new Uint8Array(buffer);\n\tconst chars: string[] = [];\n\n\tview.forEach((charCode, index) => {\n\t\tchars[index] = String.fromCharCode(charCode);\n\t});\n\n\treturn chars.join('');\n}\n"]} \ No newline at end of file diff --git a/deps/framework/core/request/Response.mjs b/deps/framework/core/request/Response.mjs deleted file mode 100644 index be5cd7dca9..0000000000 --- a/deps/framework/core/request/Response.mjs +++ /dev/null @@ -1,38 +0,0 @@ -import Promise from '../../shim/Promise'; -class Response { - json() { - return this.text().then(JSON.parse); - } -} -export default Response; -export function getFileReaderPromise(reader) { - return new Promise((resolve, reject) => { - reader.onload = function () { - resolve(reader.result); - }; - reader.onerror = function () { - reject(reader.error); - }; - }); -} -export function getTextFromBlob(blob) { - const reader = new FileReader(); - const promise = getFileReaderPromise(reader); - reader.readAsText(blob); - return promise; -} -export function getArrayBufferFromBlob(blob) { - const reader = new FileReader(); - const promise = getFileReaderPromise(reader); - reader.readAsArrayBuffer(blob); - return promise; -} -export function getTextFromArrayBuffer(buffer) { - const view = new Uint8Array(buffer); - const chars = []; - view.forEach((charCode, index) => { - chars[index] = String.fromCharCode(charCode); - }); - return chars.join(''); -} -//# sourceMappingURL=Response.mjs.map \ No newline at end of file diff --git a/deps/framework/core/request/Response.mjs.map b/deps/framework/core/request/Response.mjs.map deleted file mode 100644 index 8443c117f5..0000000000 --- a/deps/framework/core/request/Response.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"Response.mjs","sourceRoot":"","sources":["Response.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,oBAAoB,CAAC;AAUzC;IAYC,IAAI;QACH,MAAM,CAAM,IAAI,CAAC,IAAI,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAC1C,CAAC;CAMD;AAED,eAAe,QAAQ,CAAC;AAExB,MAAM,+BAAkC,MAAkB;IACzD,MAAM,CAAC,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QACtC,MAAM,CAAC,MAAM,GAAG;YACf,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;QACxB,CAAC,CAAC;QACF,MAAM,CAAC,OAAO,GAAG;YAChB,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QACtB,CAAC,CAAC;IACH,CAAC,CAAC,CAAC;AACJ,CAAC;AAED,MAAM,0BAA0B,IAAU;IACzC,MAAM,MAAM,GAAG,IAAI,UAAU,EAAE,CAAC;IAChC,MAAM,OAAO,GAAG,oBAAoB,CAAS,MAAM,CAAC,CAAC;IACrD,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;IACxB,MAAM,CAAC,OAAO,CAAC;AAChB,CAAC;AAED,MAAM,iCAAiC,IAAU;IAChD,MAAM,MAAM,GAAG,IAAI,UAAU,EAAE,CAAC;IAChC,MAAM,OAAO,GAAG,oBAAoB,CAAc,MAAM,CAAC,CAAC;IAC1D,MAAM,CAAC,iBAAiB,CAAC,IAAI,CAAC,CAAC;IAC/B,MAAM,CAAC,OAAO,CAAC;AAChB,CAAC;AAED,MAAM,iCAAiC,MAAmB;IACzD,MAAM,IAAI,GAAG,IAAI,UAAU,CAAC,MAAM,CAAC,CAAC;IACpC,MAAM,KAAK,GAAa,EAAE,CAAC;IAE3B,IAAI,CAAC,OAAO,CAAC,CAAC,QAAQ,EAAE,KAAK,EAAE,EAAE;QAChC,KAAK,CAAC,KAAK,CAAC,GAAG,MAAM,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC;IAC9C,CAAC,CAAC,CAAC;IAEH,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AACvB,CAAC","sourcesContent":["import Promise from '../../shim/Promise';\nimport Task from '../async/Task';\nimport { Headers, Response as ResponseInterface, RequestOptions } from './interfaces';\nimport Observable from '../Observable';\n\nexport interface ResponseData {\n\ttask: Task;\n\tused: boolean;\n}\n\nabstract class Response implements ResponseInterface {\n\tabstract readonly headers: Headers;\n\tabstract readonly ok: boolean;\n\tabstract readonly status: number;\n\tabstract readonly statusText: string;\n\tabstract readonly url: string;\n\tabstract readonly bodyUsed: boolean;\n\tabstract readonly requestOptions: RequestOptions;\n\n\tabstract readonly download: Observable;\n\tabstract readonly data: Observable;\n\n\tjson(): Task {\n\t\treturn this.text().then(JSON.parse);\n\t}\n\n\tabstract arrayBuffer(): Task;\n\tabstract blob(): Task;\n\tabstract formData(): Task;\n\tabstract text(): Task;\n}\n\nexport default Response;\n\nexport function getFileReaderPromise(reader: FileReader): Promise {\n\treturn new Promise((resolve, reject) => {\n\t\treader.onload = function() {\n\t\t\tresolve(reader.result);\n\t\t};\n\t\treader.onerror = function() {\n\t\t\treject(reader.error);\n\t\t};\n\t});\n}\n\nexport function getTextFromBlob(blob: Blob) {\n\tconst reader = new FileReader();\n\tconst promise = getFileReaderPromise(reader);\n\treader.readAsText(blob);\n\treturn promise;\n}\n\nexport function getArrayBufferFromBlob(blob: Blob) {\n\tconst reader = new FileReader();\n\tconst promise = getFileReaderPromise(reader);\n\treader.readAsArrayBuffer(blob);\n\treturn promise;\n}\n\nexport function getTextFromArrayBuffer(buffer: ArrayBuffer) {\n\tconst view = new Uint8Array(buffer);\n\tconst chars: string[] = [];\n\n\tview.forEach((charCode, index) => {\n\t\tchars[index] = String.fromCharCode(charCode);\n\t});\n\n\treturn chars.join('');\n}\n"]} \ No newline at end of file diff --git a/deps/framework/core/request/SubscriptionPool.d.ts b/deps/framework/core/request/SubscriptionPool.d.ts deleted file mode 100644 index 6c65b25813..0000000000 --- a/deps/framework/core/request/SubscriptionPool.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { SubscriptionObserver } from '../../shim/Observable'; -export declare class SubscriptionPool { - private _observers; - private _queue; - private _queueMaxLength; - constructor(maxLength?: number); - add(subscription: SubscriptionObserver): () => void; - next(value: T): void; - complete(): void; -} -export default SubscriptionPool; diff --git a/deps/framework/core/request/SubscriptionPool.js b/deps/framework/core/request/SubscriptionPool.js deleted file mode 100644 index b82c979586..0000000000 --- a/deps/framework/core/request/SubscriptionPool.js +++ /dev/null @@ -1,51 +0,0 @@ -(function (factory) { - if (typeof module === "object" && typeof module.exports === "object") { - var v = factory(require, exports); - if (v !== undefined) module.exports = v; - } - else if (typeof define === "function" && define.amd) { - define(["require", "exports"], factory); - } -})(function (require, exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - var SubscriptionPool = /** @class */ (function () { - function SubscriptionPool(maxLength) { - if (maxLength === void 0) { maxLength = 10; } - this._observers = []; - this._queue = []; - this._queueMaxLength = maxLength; - } - SubscriptionPool.prototype.add = function (subscription) { - var _this = this; - this._observers.push(subscription); - while (this._queue.length > 0) { - this.next(this._queue.shift()); - } - return function () { - _this._observers.splice(_this._observers.indexOf(subscription), 1); - }; - }; - SubscriptionPool.prototype.next = function (value) { - if (this._observers.length === 0) { - this._queue.push(value); - // when the queue is full, get rid of the first ones - while (this._queue.length > this._queueMaxLength) { - this._queue.shift(); - } - } - this._observers.forEach(function (observer) { - observer.next(value); - }); - }; - SubscriptionPool.prototype.complete = function () { - this._observers.forEach(function (observer) { - observer.complete(); - }); - }; - return SubscriptionPool; - }()); - exports.SubscriptionPool = SubscriptionPool; - exports.default = SubscriptionPool; -}); -//# sourceMappingURL=SubscriptionPool.js.map \ No newline at end of file diff --git a/deps/framework/core/request/SubscriptionPool.js.map b/deps/framework/core/request/SubscriptionPool.js.map deleted file mode 100644 index ca366c0a47..0000000000 --- a/deps/framework/core/request/SubscriptionPool.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"SubscriptionPool.js","sourceRoot":"","sources":["SubscriptionPool.ts"],"names":[],"mappings":";;;;;;;;;;;IAEA;QAKC,0BAAY,SAAc;YAAd,0BAAA,EAAA,cAAc;YAJlB,eAAU,GAA8B,EAAE,CAAC;YAC3C,WAAM,GAAQ,EAAE,CAAC;YAIxB,IAAI,CAAC,eAAe,GAAG,SAAS,CAAC;QAClC,CAAC;QAED,8BAAG,GAAH,UAAI,YAAqC;YAAzC,iBAUC;YATA,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;YAEnC,OAAO,IAAI,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;gBAC/B,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,EAAG,CAAC,CAAC;YACjC,CAAC;YAED,MAAM,CAAC;gBACN,KAAI,CAAC,UAAU,CAAC,MAAM,CAAC,KAAI,CAAC,UAAU,CAAC,OAAO,CAAC,YAAY,CAAC,EAAE,CAAC,CAAC,CAAC;YAClE,CAAC,CAAC;QACH,CAAC;QAED,+BAAI,GAAJ,UAAK,KAAQ;YACZ,EAAE,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC;gBAClC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;gBAExB,oDAAoD;gBACpD,OAAO,IAAI,CAAC,MAAM,CAAC,MAAM,GAAG,IAAI,CAAC,eAAe,EAAE,CAAC;oBAClD,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC;gBACrB,CAAC;YACF,CAAC;YAED,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,UAAC,QAAQ;gBAChC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;YACtB,CAAC,CAAC,CAAC;QACJ,CAAC;QAED,mCAAQ,GAAR;YACC,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,UAAC,QAAQ;gBAChC,QAAQ,CAAC,QAAQ,EAAE,CAAC;YACrB,CAAC,CAAC,CAAC;QACJ,CAAC;QACF,uBAAC;IAAD,CAAC,AAzCD,IAyCC;IAzCY,4CAAgB;IA2C7B,kBAAe,gBAAgB,CAAC","sourcesContent":["import { SubscriptionObserver } from '../../shim/Observable';\n\nexport class SubscriptionPool {\n\tprivate _observers: SubscriptionObserver[] = [];\n\tprivate _queue: T[] = [];\n\tprivate _queueMaxLength: number;\n\n\tconstructor(maxLength = 10) {\n\t\tthis._queueMaxLength = maxLength;\n\t}\n\n\tadd(subscription: SubscriptionObserver) {\n\t\tthis._observers.push(subscription);\n\n\t\twhile (this._queue.length > 0) {\n\t\t\tthis.next(this._queue.shift()!);\n\t\t}\n\n\t\treturn () => {\n\t\t\tthis._observers.splice(this._observers.indexOf(subscription), 1);\n\t\t};\n\t}\n\n\tnext(value: T) {\n\t\tif (this._observers.length === 0) {\n\t\t\tthis._queue.push(value);\n\n\t\t\t// when the queue is full, get rid of the first ones\n\t\t\twhile (this._queue.length > this._queueMaxLength) {\n\t\t\t\tthis._queue.shift();\n\t\t\t}\n\t\t}\n\n\t\tthis._observers.forEach((observer) => {\n\t\t\tobserver.next(value);\n\t\t});\n\t}\n\n\tcomplete() {\n\t\tthis._observers.forEach((observer) => {\n\t\t\tobserver.complete();\n\t\t});\n\t}\n}\n\nexport default SubscriptionPool;\n"]} \ No newline at end of file diff --git a/deps/framework/core/request/SubscriptionPool.mjs b/deps/framework/core/request/SubscriptionPool.mjs deleted file mode 100644 index 28d9dca1ce..0000000000 --- a/deps/framework/core/request/SubscriptionPool.mjs +++ /dev/null @@ -1,35 +0,0 @@ -export class SubscriptionPool { - constructor(maxLength = 10) { - this._observers = []; - this._queue = []; - this._queueMaxLength = maxLength; - } - add(subscription) { - this._observers.push(subscription); - while (this._queue.length > 0) { - this.next(this._queue.shift()); - } - return () => { - this._observers.splice(this._observers.indexOf(subscription), 1); - }; - } - next(value) { - if (this._observers.length === 0) { - this._queue.push(value); - // when the queue is full, get rid of the first ones - while (this._queue.length > this._queueMaxLength) { - this._queue.shift(); - } - } - this._observers.forEach((observer) => { - observer.next(value); - }); - } - complete() { - this._observers.forEach((observer) => { - observer.complete(); - }); - } -} -export default SubscriptionPool; -//# sourceMappingURL=SubscriptionPool.mjs.map \ No newline at end of file diff --git a/deps/framework/core/request/SubscriptionPool.mjs.map b/deps/framework/core/request/SubscriptionPool.mjs.map deleted file mode 100644 index 896816ebed..0000000000 --- a/deps/framework/core/request/SubscriptionPool.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"SubscriptionPool.mjs","sourceRoot":"","sources":["SubscriptionPool.ts"],"names":[],"mappings":"AAEA,MAAM;IAKL,YAAY,SAAS,GAAG,EAAE;QAJlB,eAAU,GAA8B,EAAE,CAAC;QAC3C,WAAM,GAAQ,EAAE,CAAC;QAIxB,IAAI,CAAC,eAAe,GAAG,SAAS,CAAC;IAClC,CAAC;IAED,GAAG,CAAC,YAAqC;QACxC,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;QAEnC,OAAO,IAAI,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YAC/B,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,EAAG,CAAC,CAAC;QACjC,CAAC;QAED,MAAM,CAAC,GAAG,EAAE;YACX,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,YAAY,CAAC,EAAE,CAAC,CAAC,CAAC;QAClE,CAAC,CAAC;IACH,CAAC;IAED,IAAI,CAAC,KAAQ;QACZ,EAAE,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC;YAClC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;YAExB,oDAAoD;YACpD,OAAO,IAAI,CAAC,MAAM,CAAC,MAAM,GAAG,IAAI,CAAC,eAAe,EAAE,CAAC;gBAClD,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC;YACrB,CAAC;QACF,CAAC;QAED,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC,QAAQ,EAAE,EAAE;YACpC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QACtB,CAAC,CAAC,CAAC;IACJ,CAAC;IAED,QAAQ;QACP,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC,QAAQ,EAAE,EAAE;YACpC,QAAQ,CAAC,QAAQ,EAAE,CAAC;QACrB,CAAC,CAAC,CAAC;IACJ,CAAC;CACD;AAED,eAAe,gBAAgB,CAAC","sourcesContent":["import { SubscriptionObserver } from '../../shim/Observable';\n\nexport class SubscriptionPool {\n\tprivate _observers: SubscriptionObserver[] = [];\n\tprivate _queue: T[] = [];\n\tprivate _queueMaxLength: number;\n\n\tconstructor(maxLength = 10) {\n\t\tthis._queueMaxLength = maxLength;\n\t}\n\n\tadd(subscription: SubscriptionObserver) {\n\t\tthis._observers.push(subscription);\n\n\t\twhile (this._queue.length > 0) {\n\t\t\tthis.next(this._queue.shift()!);\n\t\t}\n\n\t\treturn () => {\n\t\t\tthis._observers.splice(this._observers.indexOf(subscription), 1);\n\t\t};\n\t}\n\n\tnext(value: T) {\n\t\tif (this._observers.length === 0) {\n\t\t\tthis._queue.push(value);\n\n\t\t\t// when the queue is full, get rid of the first ones\n\t\t\twhile (this._queue.length > this._queueMaxLength) {\n\t\t\t\tthis._queue.shift();\n\t\t\t}\n\t\t}\n\n\t\tthis._observers.forEach((observer) => {\n\t\t\tobserver.next(value);\n\t\t});\n\t}\n\n\tcomplete() {\n\t\tthis._observers.forEach((observer) => {\n\t\t\tobserver.complete();\n\t\t});\n\t}\n}\n\nexport default SubscriptionPool;\n"]} \ No newline at end of file diff --git a/deps/framework/core/request/TimeoutError.d.ts b/deps/framework/core/request/TimeoutError.d.ts deleted file mode 100644 index 1a33be026d..0000000000 --- a/deps/framework/core/request/TimeoutError.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -export declare class TimeoutError implements Error { - readonly message: string; - readonly name: string; - constructor(message?: string); -} -export default TimeoutError; diff --git a/deps/framework/core/request/TimeoutError.js b/deps/framework/core/request/TimeoutError.js deleted file mode 100644 index fe1eb927ee..0000000000 --- a/deps/framework/core/request/TimeoutError.js +++ /dev/null @@ -1,29 +0,0 @@ -(function (factory) { - if (typeof module === "object" && typeof module.exports === "object") { - var v = factory(require, exports); - if (v !== undefined) module.exports = v; - } - else if (typeof define === "function" && define.amd) { - define(["require", "exports"], factory); - } -})(function (require, exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - var TimeoutError = /** @class */ (function () { - function TimeoutError(message) { - message = message || 'The request timed out'; - this.message = message; - } - Object.defineProperty(TimeoutError.prototype, "name", { - get: function () { - return 'TimeoutError'; - }, - enumerable: true, - configurable: true - }); - return TimeoutError; - }()); - exports.TimeoutError = TimeoutError; - exports.default = TimeoutError; -}); -//# sourceMappingURL=TimeoutError.js.map \ No newline at end of file diff --git a/deps/framework/core/request/TimeoutError.js.map b/deps/framework/core/request/TimeoutError.js.map deleted file mode 100644 index 769205ccb1..0000000000 --- a/deps/framework/core/request/TimeoutError.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"TimeoutError.js","sourceRoot":"","sources":["TimeoutError.ts"],"names":[],"mappings":";;;;;;;;;;;IAAA;QAOC,sBAAY,OAAgB;YAC3B,OAAO,GAAG,OAAO,IAAI,uBAAuB,CAAC;YAC7C,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACxB,CAAC;QAPD,sBAAI,8BAAI;iBAAR;gBACC,MAAM,CAAC,cAAc,CAAC;YACvB,CAAC;;;WAAA;QAMF,mBAAC;IAAD,CAAC,AAXD,IAWC;IAXY,oCAAY;IAazB,kBAAe,YAAY,CAAC","sourcesContent":["export class TimeoutError implements Error {\n\treadonly message: string;\n\n\tget name(): string {\n\t\treturn 'TimeoutError';\n\t}\n\n\tconstructor(message?: string) {\n\t\tmessage = message || 'The request timed out';\n\t\tthis.message = message;\n\t}\n}\n\nexport default TimeoutError;\n"]} \ No newline at end of file diff --git a/deps/framework/core/request/TimeoutError.mjs b/deps/framework/core/request/TimeoutError.mjs deleted file mode 100644 index 27c46379fa..0000000000 --- a/deps/framework/core/request/TimeoutError.mjs +++ /dev/null @@ -1,11 +0,0 @@ -export class TimeoutError { - get name() { - return 'TimeoutError'; - } - constructor(message) { - message = message || 'The request timed out'; - this.message = message; - } -} -export default TimeoutError; -//# sourceMappingURL=TimeoutError.mjs.map \ No newline at end of file diff --git a/deps/framework/core/request/TimeoutError.mjs.map b/deps/framework/core/request/TimeoutError.mjs.map deleted file mode 100644 index 0634287e2a..0000000000 --- a/deps/framework/core/request/TimeoutError.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"TimeoutError.mjs","sourceRoot":"","sources":["TimeoutError.ts"],"names":[],"mappings":"AAAA,MAAM;IAGL,IAAI,IAAI;QACP,MAAM,CAAC,cAAc,CAAC;IACvB,CAAC;IAED,YAAY,OAAgB;QAC3B,OAAO,GAAG,OAAO,IAAI,uBAAuB,CAAC;QAC7C,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IACxB,CAAC;CACD;AAED,eAAe,YAAY,CAAC","sourcesContent":["export class TimeoutError implements Error {\n\treadonly message: string;\n\n\tget name(): string {\n\t\treturn 'TimeoutError';\n\t}\n\n\tconstructor(message?: string) {\n\t\tmessage = message || 'The request timed out';\n\t\tthis.message = message;\n\t}\n}\n\nexport default TimeoutError;\n"]} \ No newline at end of file diff --git a/deps/framework/core/request/interfaces.d.ts b/deps/framework/core/request/interfaces.d.ts deleted file mode 100644 index 5a02059e97..0000000000 --- a/deps/framework/core/request/interfaces.d.ts +++ /dev/null @@ -1,84 +0,0 @@ -import { IterableIterator } from '../../shim/iterator'; -import Task from '../async/Task'; -import UrlSearchParams, { ParamList } from '../UrlSearchParams'; -import Observable from '../Observable'; - -export interface Body { - readonly bodyUsed: boolean; - - arrayBuffer(): Task; - blob(): Task; - formData(): Task; - json(): Task; - text(): Task; -} - -export interface Headers { - append(name: string, value: string): void; - delete(name: string): void; - entries(): IterableIterator<[string, string]>; - get(name: string): string | null; - getAll(name: string): string[]; - has(name: string): boolean; - keys(): IterableIterator; - set(name: string, value: string): void; - values(): IterableIterator; - [Symbol.iterator](): IterableIterator<[string, string]>; -} - -export interface UploadObservableTask extends Task { - upload: Observable; -} - -export type Provider = (url: string, options?: RequestOptions) => UploadObservableTask; - -export type ProviderTest = (url: string, options?: RequestOptions) => boolean | null; - -export interface RequestOptions { - /** - * Enable cache busting (default false). Cache busting will make a new URL by appending a parameter to the - * requested URL - */ - cacheBust?: boolean; - credentials?: 'omit' | 'same-origin' | 'include'; - /** - * Body to send along with the http request - */ - body?: Blob | BufferSource | FormData | UrlSearchParams | string; - /** - * Headers to send along with the http request - */ - headers?: Headers | { [key: string]: string }; - /** - * HTTP method - */ - method?: string; - /** - * Password for HTTP authentication - */ - password?: string; - /** - * Number of milliseconds before the request times out and is canceled - */ - timeout?: number; - /** - * User for HTTP authentication - */ - user?: string; - /** - * Optional query parameter(s) for the URL. The requested url will have these query parameters appended. - */ - query?: string | ParamList; -} - -export interface Response extends Body { - readonly headers: Headers; - readonly ok: boolean; - readonly status: number; - readonly statusText: string; - readonly url: string; - readonly requestOptions: RequestOptions; - - readonly download: Observable; - readonly data: Observable; -} diff --git a/deps/framework/core/request/providers/node.d.ts b/deps/framework/core/request/providers/node.d.ts deleted file mode 100644 index 23cc958d06..0000000000 --- a/deps/framework/core/request/providers/node.d.ts +++ /dev/null @@ -1,134 +0,0 @@ -/// -import * as http from 'http'; -import Task from '../../async/Task'; -import Headers from '../Headers'; -import { RequestOptions, UploadObservableTask } from '../interfaces'; -import Response from '../Response'; -import { Readable } from 'stream'; -import Observable from '../../Observable'; -/** - * Request options specific to a node request. For HTTPS options, see - * https://nodejs.org/api/tls.html#tls_tls_connect_options_callback for more details. - */ -export interface NodeRequestOptions extends RequestOptions { - /** - * User-agent header - */ - agent?: any; - /** - * If specified, the request body is read from the stream specified here, rather than from the `body` field. - */ - bodyStream?: Readable; - /** - * HTTPS optionally override the trusted CA certificates - */ - ca?: any; - /** - * HTTPS optional cert chains in PEM format. One cert chain should be provided per private key. - */ - cert?: string; - /** - * HTTPS optional cipher suite specification - */ - ciphers?: string; - dataEncoding?: string; - /** - * Whether or not to automatically follow redirects (default true) - */ - followRedirects?: boolean; - /** - * HTTPS optional private key in PEM format. - */ - key?: string; - /** - * Local interface to bind for network connections. - */ - localAddress?: string; - /** - * HTTPS optional shared passphrase used for a single private key and/or a PFX. - */ - passphrase?: string; - /** - * HTTPS optional PFX or PKCS12 encoded private key and certificate chain. - */ - pfx?: any; - /** - * Optional proxy address. If specified, requests will be sent through this url. - */ - proxy?: string; - /** - * HTTPS If not false the server will reject any connection which is not authorized with the list of supplied CAs - */ - rejectUnauthorized?: boolean; - /** - * HTTPS optional SSL method to use, default is "SSLv23_method" - */ - secureProtocol?: string; - /** - * Unix Domain Socket (use one of host:port or socketPath) - */ - socketPath?: string; - /** - * Whether or not to add the gzip and deflate accept headers (default true) - */ - acceptCompression?: boolean; - /** - * A set of options to set on the HTTP request - */ - socketOptions?: { - /** - * Enable/disable keep-alive functionality, and optionally set the initial delay before the first keepalive probe is sent on an idle socket. - */ - keepAlive?: number; - /** - * Disables the Nagle algorithm. By default TCP connections use the Nagle algorithm, they buffer data before sending it off. - */ - noDelay?: boolean; - /** - * Number of milliseconds before the HTTP request times out - */ - timeout?: number; - }; - /** - * Stream encoding on incoming HTTP response - */ - streamEncoding?: string; - /** - * Options to control redirect follow logic - */ - redirectOptions?: { - /** - * The limit to the number of redirects that will be followed (default 15). This is used to prevent infinite - * redirect loops. - */ - limit?: number; - count?: number; - /** - * Whether or not to keep the original HTTP method during 301 redirects (default false). - */ - keepOriginalMethod?: boolean; - }; -} -/** - * Turn a node native response object into something that resembles the fetch api - */ -export declare class NodeResponse extends Response { - readonly headers: Headers; - readonly ok: boolean; - readonly status: number; - readonly statusText: string; - downloadBody: boolean; - readonly bodyUsed: boolean; - readonly nativeResponse: http.IncomingMessage; - readonly requestOptions: NodeRequestOptions; - readonly url: string; - readonly download: Observable; - readonly data: Observable; - constructor(response: http.IncomingMessage); - arrayBuffer(): Task; - blob(): Task; - formData(): Task; - text(): Task; -} -export declare function getAuth(proxyAuth: string | undefined, options: NodeRequestOptions): string | undefined; -export default function node(url: string, options?: NodeRequestOptions): UploadObservableTask; diff --git a/deps/framework/core/request/providers/node.js b/deps/framework/core/request/providers/node.js deleted file mode 100644 index e4fc7bdad9..0000000000 --- a/deps/framework/core/request/providers/node.js +++ /dev/null @@ -1,472 +0,0 @@ -(function (factory) { - if (typeof module === "object" && typeof module.exports === "object") { - var v = factory(require, exports); - if (v !== undefined) module.exports = v; - } - else if (typeof define === "function" && define.amd) { - define(["require", "exports", "tslib", "../../../shim/Set", "../../../shim/WeakMap", "http", "https", "url", "zlib", "../../async/Task", "../../lang", "../../queue", "../../util", "../Headers", "../Response", "../TimeoutError", "../../Observable", "../SubscriptionPool"], factory); - } -})(function (require, exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - var tslib_1 = require("tslib"); - var Set_1 = require("../../../shim/Set"); - var WeakMap_1 = require("../../../shim/WeakMap"); - var http = require("http"); - var https = require("https"); - var urlUtil = require("url"); - var zlib = require("zlib"); - var Task_1 = require("../../async/Task"); - var lang_1 = require("../../lang"); - var queue_1 = require("../../queue"); - var util_1 = require("../../util"); - var Headers_1 = require("../Headers"); - var Response_1 = require("../Response"); - var TimeoutError_1 = require("../TimeoutError"); - var Observable_1 = require("../../Observable"); - var SubscriptionPool_1 = require("../SubscriptionPool"); - // TODO: This should be read from the package and not hard coded! - var version = '2.0.0-pre'; - /** - * If not overridden, redirects will only be processed this many times before aborting (per request). - * @type {number} - */ - var DEFAULT_REDIRECT_LIMIT = 15; - var dataMap = new WeakMap_1.default(); - var discardedDuplicates = new Set_1.default([ - 'age', - 'authorization', - 'content-length', - 'content-type', - 'etag', - 'expires', - 'from', - 'host', - 'if-modified-since', - 'if-unmodified-since', - 'last-modified', - 'location', - 'max-forwards', - 'proxy-authorization', - 'referer', - 'retry-after', - 'user-agent' - ]); - function getDataTask(response) { - var data = dataMap.get(response); - if (data.used) { - return Task_1.default.reject(new TypeError('Body already read')); - } - data.used = true; - return data.task.then(function (_) { return data; }); - } - /** - * Turn a node native response object into something that resembles the fetch api - */ - var NodeResponse = /** @class */ (function (_super) { - tslib_1.__extends(NodeResponse, _super); - function NodeResponse(response) { - var _this = _super.call(this) || this; - _this.downloadBody = true; - var headers = (_this.headers = new Headers_1.default()); - var _loop_1 = function (key) { - var value = response.headers[key]; - if (value) { - if (discardedDuplicates.has(key) && !Array.isArray(value)) { - headers.append(key, value); - } - (Array.isArray(value) ? value : value.split(/\s*,\s*/)).forEach(function (v) { - headers.append(key, v); - }); - } - }; - for (var key in response.headers) { - _loop_1(key); - } - _this.status = response.statusCode || 0; - _this.ok = _this.status >= 200 && _this.status < 300; - _this.statusText = response.statusMessage || ''; - return _this; - } - Object.defineProperty(NodeResponse.prototype, "bodyUsed", { - get: function () { - return dataMap.get(this).used; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(NodeResponse.prototype, "nativeResponse", { - get: function () { - return dataMap.get(this).nativeResponse; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(NodeResponse.prototype, "requestOptions", { - get: function () { - return dataMap.get(this).requestOptions; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(NodeResponse.prototype, "url", { - get: function () { - return dataMap.get(this).url; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(NodeResponse.prototype, "download", { - get: function () { - return dataMap.get(this).downloadObservable; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(NodeResponse.prototype, "data", { - get: function () { - return dataMap.get(this).dataObservable; - }, - enumerable: true, - configurable: true - }); - NodeResponse.prototype.arrayBuffer = function () { - return getDataTask(this).then(function (data) { - if (data) { - return data.data; - } - return new Buffer([]); - }); - }; - NodeResponse.prototype.blob = function () { - // Node doesn't support Blobs - return Task_1.default.reject(new Error('Blob not supported')); - }; - NodeResponse.prototype.formData = function () { - return Task_1.default.reject(new Error('FormData not supported')); - }; - NodeResponse.prototype.text = function () { - return getDataTask(this).then(function (data) { - return String(data ? data.data : ''); - }); - }; - return NodeResponse; - }(Response_1.default)); - exports.NodeResponse = NodeResponse; - function redirect(resolve, reject, originalUrl, redirectUrl, options) { - if (!options.redirectOptions) { - options.redirectOptions = {}; - } - var _a = options.redirectOptions, _b = _a.limit, redirectLimit = _b === void 0 ? DEFAULT_REDIRECT_LIMIT : _b, _c = _a.count, redirectCount = _c === void 0 ? 0 : _c; - var _d = options.followRedirects, followRedirects = _d === void 0 ? true : _d; - if (!followRedirects) { - return false; - } - // we only check for undefined here because empty string redirects are now allowed - // (they'll resolve to the current url) - if (redirectUrl === undefined || redirectUrl === null) { - reject(new Error('asked to redirect but no location header was found')); - return true; - } - if (redirectCount > redirectLimit) { - reject(new Error("too many redirects, limit reached at " + redirectLimit)); - return true; - } - options.redirectOptions.count = redirectCount + 1; - // we wrap the url in a call to node's URL.resolve which will handle relative and partial - // redirects (like "/another-page" on the same domain). - resolve(node(urlUtil.resolve(originalUrl, redirectUrl), options)); - return true; - } - function getAuth(proxyAuth, options) { - if (proxyAuth) { - return proxyAuth; - } - if (options.user || options.password) { - return (options.user || '') + ":" + (options.password || ''); - } - return undefined; - } - exports.getAuth = getAuth; - function node(url, options) { - if (options === void 0) { options = {}; } - var parsedUrl = urlUtil.parse(options.proxy || url); - var requestOptions = { - agent: options.agent, - auth: getAuth(parsedUrl.auth, options), - ca: options.ca, - cert: options.cert, - ciphers: options.ciphers, - host: parsedUrl.host, - hostname: parsedUrl.hostname, - key: options.key, - localAddress: options.localAddress, - method: options.method ? options.method.toUpperCase() : 'GET', - passphrase: options.passphrase, - path: parsedUrl.path, - pfx: options.pfx, - port: Number(parsedUrl.port), - rejectUnauthorized: options.rejectUnauthorized, - secureProtocol: options.secureProtocol, - socketPath: options.socketPath - }; - requestOptions.headers = options.headers || {}; - if (!Object.keys(requestOptions.headers) - .map(function (headerName) { return headerName.toLowerCase(); }) - .some(function (headerName) { return headerName === 'user-agent'; })) { - requestOptions.headers['user-agent'] = 'dojo/' + version + ' Node.js/' + process.version.replace(/^v/, ''); - } - if (options.proxy) { - requestOptions.path = url; - if (parsedUrl.auth) { - requestOptions.headers['proxy-authorization'] = 'Basic ' + new Buffer(parsedUrl.auth).toString('base64'); - } - var parsedProxyUrl = urlUtil.parse(url); - if (parsedProxyUrl.host) { - requestOptions.headers['host'] = parsedProxyUrl.host; - } - if (parsedProxyUrl.auth) { - requestOptions.auth = parsedProxyUrl.auth; - } - } - var _a = options.acceptCompression, acceptCompression = _a === void 0 ? true : _a; - if (acceptCompression) { - requestOptions.headers['Accept-Encoding'] = 'gzip, deflate'; - } - var request = parsedUrl.protocol === 'https:' ? https.request(requestOptions) : http.request(requestOptions); - var uploadObserverPool = new SubscriptionPool_1.default(); - var requestTask = new Task_1.default(function (resolve, reject) { - var timeoutHandle; - var timeoutReject = reject; - if (options.socketOptions) { - if (options.socketOptions.timeout) { - request.setTimeout(options.socketOptions.timeout); - } - if ('noDelay' in options.socketOptions) { - request.setNoDelay(options.socketOptions.noDelay); - } - if ('keepAlive' in options.socketOptions) { - var initialDelay = options.socketOptions.keepAlive; - if (initialDelay !== undefined) { - request.setSocketKeepAlive(initialDelay >= 0, initialDelay); - } - } - } - request.once('response', function (message) { - var response = new NodeResponse(message); - // Redirection handling defaults to true in order to harmonise with the XHR provider, which will always - // follow redirects - if (response.status >= 300 && response.status < 400) { - var redirectOptions = options.redirectOptions || {}; - var newOptions = lang_1.deepAssign({}, options); - switch (response.status) { - case 300: - /** - * Note about 300 redirects. RFC 2616 doesn't specify what to do with them, it is up to the client to "pick - * the right one". We're picking like Chrome does, just don't pick any. - */ - break; - case 301: - case 302: - /** - * RFC 2616 says, - * - * If the 301 status code is received in response to a request other - * than GET or HEAD, the user agent MUST NOT automatically redirect the - * request unless it can be confirmed by the user, since this might - * change the conditions under which the request was issued. - * - * Note: When automatically redirecting a POST request after - * receiving a 301 status code, some existing HTTP/1.0 user agents - * will erroneously change it into a GET request. - * - * We're going to be one of those erroneous agents, to prevent the request from failing.. - */ - if (requestOptions.method !== 'GET' && - requestOptions.method !== 'HEAD' && - !redirectOptions.keepOriginalMethod) { - newOptions.method = 'GET'; - } - if (redirect(resolve, reject, url, response.headers.get('location'), newOptions)) { - return; - } - break; - case 303: - /** - * The response to the request can be found under a different URI and - * SHOULD be retrieved using a GET method on that resource. - */ - if (requestOptions.method !== 'GET') { - newOptions.method = 'GET'; - } - if (redirect(resolve, reject, url, response.headers.get('location'), newOptions)) { - return; - } - break; - case 304: - // do nothing so this can fall through and return the response as normal. Nothing more can - // be done for 304 - break; - case 305: - if (!response.headers.get('location')) { - reject(new Error('expected Location header to contain a proxy url')); - } - else { - newOptions.proxy = response.headers.get('location') || ''; - if (redirect(resolve, reject, url, '', newOptions)) { - return; - } - } - break; - case 307: - /** - * If the 307 status code is received in response to a request other - * than GET or HEAD, the user agent MUST NOT automatically redirect the - * request unless it can be confirmed by the user, since this might - * change the conditions under which the request was issued. - */ - if (redirect(resolve, reject, url, response.headers.get('location'), newOptions)) { - return; - } - break; - default: - reject(new Error('unhandled redirect status ' + response.status)); - return; - } - } - options.streamEncoding && message.setEncoding(options.streamEncoding); - var downloadSubscriptionPool = new SubscriptionPool_1.default(); - var dataSubscriptionPool = new SubscriptionPool_1.default(); - /* - [RFC 2616](https://tools.ietf.org/html/rfc2616#page-118) says that content-encoding can have multiple - values, so we split them here and put them in a list to process later. - */ - var contentEncodings = response.headers.getAll('content-encoding'); - var task = new Task_1.default(function (resolve, reject) { - timeoutReject = reject; - // we queue this up for later to allow listeners to register themselves before we start receiving data - queue_1.queueTask(function () { - /* - * Note that this is the raw data, if your input stream is zipped, and you are piecing - * together the downloaded data, you'll have to decompress it yourself - */ - message.on('data', function (chunk) { - dataSubscriptionPool.next(chunk); - if (response.downloadBody) { - data.buffer.push(chunk); - } - data.size += - typeof chunk === 'string' - ? Buffer.byteLength(chunk, options.streamEncoding) - : chunk.length; - downloadSubscriptionPool.next(data.size); - }); - message.once('end', function () { - timeoutHandle && timeoutHandle.destroy(); - var dataAsBuffer = options.streamEncoding - ? new Buffer(data.buffer.join(''), 'utf8') - : Buffer.concat(data.buffer, data.size); - var handleEncoding = function () { - /* - Content encoding is ordered by the order in which they were applied to the - content, so do undo the encoding we have to start at the end and work backwards. - */ - if (contentEncodings.length) { - var encoding = contentEncodings.pop().trim().toLowerCase(); - if (encoding === '' || encoding === 'none' || encoding === 'identity') { - // do nothing, response stream is as-is - handleEncoding(); - } - else if (encoding === 'gzip') { - zlib.gunzip(dataAsBuffer, function (err, result) { - if (err) { - reject(err); - } - dataAsBuffer = result; - handleEncoding(); - }); - } - else if (encoding === 'deflate') { - zlib.inflate(dataAsBuffer, function (err, result) { - if (err) { - reject(err); - } - dataAsBuffer = result; - handleEncoding(); - }); - } - else { - reject(new Error('Unsupported content encoding, ' + encoding)); - } - } - else { - data.data = dataAsBuffer; - resolve(message); - } - }; - handleEncoding(); - }); - }); - }, function () { - request.abort(); - }); - var data = { - task: task, - buffer: [], - data: Buffer.alloc(0), - size: 0, - used: false, - url: url, - requestOptions: options, - nativeResponse: message, - downloadObservable: new Observable_1.default(function (observer) { return downloadSubscriptionPool.add(observer); }), - dataObservable: new Observable_1.default(function (observer) { return dataSubscriptionPool.add(observer); }) - }; - dataMap.set(response, data); - resolve(response); - }); - request.once('error', reject); - if (options.bodyStream) { - options.bodyStream.pipe(request); - var uploadedSize_1 = 0; - options.bodyStream.on('data', function (chunk) { - uploadedSize_1 += chunk.length; - uploadObserverPool.next(uploadedSize_1); - }); - options.bodyStream.on('end', function () { - uploadObserverPool.complete(); - request.end(); - }); - } - else if (options.body) { - var body_1 = options.body.toString(); - request.on('response', function () { - uploadObserverPool.next(body_1.length); - }); - request.end(body_1); - } - else { - request.end(); - } - if (options.timeout && options.timeout > 0 && options.timeout !== Infinity) { - timeoutHandle = util_1.createTimer(function () { - timeoutReject && timeoutReject(new TimeoutError_1.default('The request timed out')); - }, options.timeout); - } - }, function () { - request.abort(); - }).catch(function (error) { - var parsedUrl = urlUtil.parse(url); - if (parsedUrl.auth) { - parsedUrl.auth = '(redacted)'; - } - var sanitizedUrl = urlUtil.format(parsedUrl); - error.message = '[' + requestOptions.method + ' ' + sanitizedUrl + '] ' + error.message; - throw error; - }); - requestTask.upload = new Observable_1.default(function (observer) { return uploadObserverPool.add(observer); }); - return requestTask; - } - exports.default = node; -}); -//# sourceMappingURL=node.js.map \ No newline at end of file diff --git a/deps/framework/core/request/providers/node.js.map b/deps/framework/core/request/providers/node.js.map deleted file mode 100644 index bcf1581905..0000000000 --- a/deps/framework/core/request/providers/node.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"node.js","sourceRoot":"","sources":["node.ts"],"names":[],"mappings":";;;;;;;;;;;;IACA,yCAAoC;IACpC,iDAA4C;IAC5C,2BAA6B;IAC7B,6BAA+B;IAC/B,6BAA+B;IAC/B,2BAA6B;IAC7B,yCAAoC;IACpC,mCAAwC;IACxC,qCAAwC;IACxC,mCAAyC;IACzC,sCAAiC;IAEjC,wCAAmC;IACnC,gDAA2C;IAE3C,+CAA0C;IAC1C,wDAAmD;IA0GnD,iEAAiE;IACjE,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":["import { Handle } from '../../interfaces';\nimport Set from '../../../shim/Set';\nimport WeakMap from '../../../shim/WeakMap';\nimport * as http from 'http';\nimport * as https from 'https';\nimport * as urlUtil from 'url';\nimport * as zlib from 'zlib';\nimport Task from '../../async/Task';\nimport { deepAssign } from '../../lang';\nimport { queueTask } from '../../queue';\nimport { createTimer } from '../../util';\nimport Headers from '../Headers';\nimport { RequestOptions, UploadObservableTask } from '../interfaces';\nimport Response from '../Response';\nimport TimeoutError from '../TimeoutError';\nimport { Readable } from 'stream';\nimport Observable from '../../Observable';\nimport SubscriptionPool from '../SubscriptionPool';\n\n/**\n * Request options specific to a node request. For HTTPS options, see\n * https://nodejs.org/api/tls.html#tls_tls_connect_options_callback for more details.\n */\nexport interface NodeRequestOptions extends RequestOptions {\n\t/**\n\t * User-agent header\n\t */\n\tagent?: any;\n\t/**\n\t * If specified, the request body is read from the stream specified here, rather than from the `body` field.\n\t */\n\tbodyStream?: Readable;\n\t/**\n\t * HTTPS optionally override the trusted CA certificates\n\t */\n\tca?: any;\n\t/**\n\t * HTTPS optional cert chains in PEM format. One cert chain should be provided per private key.\n\t */\n\tcert?: string;\n\t/**\n\t * HTTPS optional cipher suite specification\n\t */\n\tciphers?: string;\n\tdataEncoding?: string;\n\t/**\n\t * Whether or not to automatically follow redirects (default true)\n\t */\n\tfollowRedirects?: boolean;\n\t/**\n\t * HTTPS optional private key in PEM format.\n\t */\n\tkey?: string;\n\t/**\n\t * Local interface to bind for network connections.\n\t */\n\tlocalAddress?: string;\n\t/**\n\t * HTTPS optional shared passphrase used for a single private key and/or a PFX.\n\t */\n\tpassphrase?: string;\n\t/**\n\t * HTTPS optional PFX or PKCS12 encoded private key and certificate chain.\n\t */\n\tpfx?: any;\n\t/**\n\t * Optional proxy address. If specified, requests will be sent through this url.\n\t */\n\tproxy?: string;\n\t/**\n\t * HTTPS If not false the server will reject any connection which is not authorized with the list of supplied CAs\n\t */\n\trejectUnauthorized?: boolean;\n\t/**\n\t * HTTPS optional SSL method to use, default is \"SSLv23_method\"\n\t */\n\tsecureProtocol?: string;\n\t/**\n\t * Unix Domain Socket (use one of host:port or socketPath)\n\t */\n\tsocketPath?: string;\n\t/**\n\t * Whether or not to add the gzip and deflate accept headers (default true)\n\t */\n\tacceptCompression?: boolean;\n\t/**\n\t * A set of options to set on the HTTP request\n\t */\n\tsocketOptions?: {\n\t\t/**\n\t\t * Enable/disable keep-alive functionality, and optionally set the initial delay before the first keepalive probe is sent on an idle socket.\n\t\t */\n\t\tkeepAlive?: number;\n\t\t/**\n\t\t * Disables the Nagle algorithm. By default TCP connections use the Nagle algorithm, they buffer data before sending it off.\n\t\t */\n\t\tnoDelay?: boolean;\n\t\t/**\n\t\t * Number of milliseconds before the HTTP request times out\n\t\t */\n\t\ttimeout?: number;\n\t};\n\t/**\n\t * Stream encoding on incoming HTTP response\n\t */\n\tstreamEncoding?: string;\n\t/**\n\t * Options to control redirect follow logic\n\t */\n\tredirectOptions?: {\n\t\t/**\n\t\t * The limit to the number of redirects that will be followed (default 15). This is used to prevent infinite\n\t\t * redirect loops.\n\t\t */\n\t\tlimit?: number;\n\t\tcount?: number;\n\t\t/**\n\t\t * Whether or not to keep the original HTTP method during 301 redirects (default false).\n\t\t */\n\t\tkeepOriginalMethod?: boolean;\n\t};\n}\n\n// TODO: This should be read from the package and not hard coded!\nlet version = '2.0.0-pre';\n\n/**\n * If not overridden, redirects will only be processed this many times before aborting (per request).\n * @type {number}\n */\nconst DEFAULT_REDIRECT_LIMIT = 15;\n\n/**\n * Options to be passed to node's request\n */\ninterface Options {\n\tagent?: any;\n\tauth?: string;\n\theaders?: { [name: string]: string };\n\thost?: string;\n\thostname?: string;\n\tlocalAddress?: string;\n\tmethod?: string;\n\tpath?: string;\n\tport?: number;\n\tsocketPath?: string;\n}\n\n/**\n * HTTPS specific options for node\n */\ninterface HttpsOptions extends Options {\n\tca?: any;\n\tcert?: string;\n\tciphers?: string;\n\tkey?: string;\n\tpassphrase?: string;\n\tpfx?: any;\n\trejectUnauthorized?: boolean;\n\tsecureProtocol?: string;\n}\n\ninterface RequestData {\n\ttask: Task;\n\tbuffer: any[];\n\tdata: Buffer;\n\tsize: number;\n\tused: boolean;\n\tnativeResponse: http.IncomingMessage;\n\trequestOptions: NodeRequestOptions;\n\turl: string;\n\tdownloadObservable: Observable;\n\tdataObservable: Observable;\n}\n\nconst dataMap = new WeakMap();\nconst discardedDuplicates = new Set([\n\t'age',\n\t'authorization',\n\t'content-length',\n\t'content-type',\n\t'etag',\n\t'expires',\n\t'from',\n\t'host',\n\t'if-modified-since',\n\t'if-unmodified-since',\n\t'last-modified',\n\t'location',\n\t'max-forwards',\n\t'proxy-authorization',\n\t'referer',\n\t'retry-after',\n\t'user-agent'\n]);\n\nfunction getDataTask(response: NodeResponse): Task {\n\tconst data = dataMap.get(response)!;\n\n\tif (data.used) {\n\t\treturn Task.reject(new TypeError('Body already read'));\n\t}\n\n\tdata.used = true;\n\n\treturn >data.task.then((_) => data);\n}\n\n/**\n * Turn a node native response object into something that resembles the fetch api\n */\nexport class NodeResponse extends Response {\n\treadonly headers: Headers;\n\treadonly ok: boolean;\n\treadonly status: number;\n\treadonly statusText: string;\n\n\tdownloadBody = true;\n\n\tget bodyUsed(): boolean {\n\t\treturn dataMap.get(this)!.used;\n\t}\n\n\tget nativeResponse(): http.IncomingMessage {\n\t\treturn dataMap.get(this)!.nativeResponse;\n\t}\n\n\tget requestOptions(): NodeRequestOptions {\n\t\treturn dataMap.get(this)!.requestOptions;\n\t}\n\n\tget url(): string {\n\t\treturn dataMap.get(this)!.url;\n\t}\n\n\tget download(): Observable {\n\t\treturn dataMap.get(this)!.downloadObservable;\n\t}\n\n\tget data(): Observable {\n\t\treturn dataMap.get(this)!.dataObservable;\n\t}\n\n\tconstructor(response: http.IncomingMessage) {\n\t\tsuper();\n\n\t\tconst headers = (this.headers = new Headers());\n\t\tfor (let key in response.headers) {\n\t\t\tconst value = response.headers[key];\n\t\t\tif (value) {\n\t\t\t\tif (discardedDuplicates.has(key) && !Array.isArray(value)) {\n\t\t\t\t\theaders.append(key, value);\n\t\t\t\t}\n\t\t\t\t(Array.isArray(value) ? value : value.split(/\\s*,\\s*/)).forEach((v) => {\n\t\t\t\t\theaders.append(key, v);\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\n\t\tthis.status = response.statusCode || 0;\n\t\tthis.ok = this.status >= 200 && this.status < 300;\n\t\tthis.statusText = response.statusMessage || '';\n\t}\n\n\tarrayBuffer(): Task {\n\t\treturn getDataTask(this).then((data) => {\n\t\t\tif (data) {\n\t\t\t\treturn data.data;\n\t\t\t}\n\n\t\t\treturn new Buffer([]);\n\t\t});\n\t}\n\n\tblob(): Task {\n\t\t// Node doesn't support Blobs\n\t\treturn Task.reject(new Error('Blob not supported'));\n\t}\n\n\tformData(): Task {\n\t\treturn Task.reject(new Error('FormData not supported'));\n\t}\n\n\ttext(): Task {\n\t\treturn getDataTask(this).then((data) => {\n\t\t\treturn String(data ? data.data : '');\n\t\t});\n\t}\n}\n\nfunction redirect(\n\tresolve: (p?: any) => void,\n\treject: (_?: Error) => void,\n\toriginalUrl: string,\n\tredirectUrl: string | null,\n\toptions: NodeRequestOptions\n): boolean {\n\tif (!options.redirectOptions) {\n\t\toptions.redirectOptions = {};\n\t}\n\n\tconst { limit: redirectLimit = DEFAULT_REDIRECT_LIMIT, count: redirectCount = 0 } = options.redirectOptions;\n\tconst { followRedirects = true } = options;\n\n\tif (!followRedirects) {\n\t\treturn false;\n\t}\n\n\t// we only check for undefined here because empty string redirects are now allowed\n\t// (they'll resolve to the current url)\n\tif (redirectUrl === undefined || redirectUrl === null) {\n\t\treject(new Error('asked to redirect but no location header was found'));\n\t\treturn true;\n\t}\n\n\tif (redirectCount > redirectLimit) {\n\t\treject(new Error(`too many redirects, limit reached at ${redirectLimit}`));\n\t\treturn true;\n\t}\n\n\toptions.redirectOptions.count = redirectCount + 1;\n\n\t// we wrap the url in a call to node's URL.resolve which will handle relative and partial\n\t// redirects (like \"/another-page\" on the same domain).\n\tresolve(node(urlUtil.resolve(originalUrl, redirectUrl), options));\n\n\treturn true;\n}\n\nexport function getAuth(proxyAuth: string | undefined, options: NodeRequestOptions): string | undefined {\n\tif (proxyAuth) {\n\t\treturn proxyAuth;\n\t}\n\n\tif (options.user || options.password) {\n\t\treturn `${options.user || ''}:${options.password || ''}`;\n\t}\n\n\treturn undefined;\n}\n\nexport default function node(url: string, options: NodeRequestOptions = {}): UploadObservableTask {\n\tconst parsedUrl = urlUtil.parse(options.proxy || url);\n\n\tconst requestOptions: HttpsOptions = {\n\t\tagent: options.agent,\n\t\tauth: getAuth(parsedUrl.auth, options),\n\t\tca: options.ca,\n\t\tcert: options.cert,\n\t\tciphers: options.ciphers,\n\t\thost: parsedUrl.host,\n\t\thostname: parsedUrl.hostname,\n\t\tkey: options.key,\n\t\tlocalAddress: options.localAddress,\n\t\tmethod: options.method ? options.method.toUpperCase() : 'GET',\n\t\tpassphrase: options.passphrase,\n\t\tpath: parsedUrl.path,\n\t\tpfx: options.pfx,\n\t\tport: Number(parsedUrl.port),\n\t\trejectUnauthorized: options.rejectUnauthorized,\n\t\tsecureProtocol: options.secureProtocol,\n\t\tsocketPath: options.socketPath\n\t};\n\n\trequestOptions.headers = <{ [key: string]: string }>options.headers || {};\n\n\tif (\n\t\t!Object.keys(requestOptions.headers)\n\t\t\t.map((headerName) => headerName.toLowerCase())\n\t\t\t.some((headerName) => headerName === 'user-agent')\n\t) {\n\t\trequestOptions.headers['user-agent'] = 'dojo/' + version + ' Node.js/' + process.version.replace(/^v/, '');\n\t}\n\n\tif (options.proxy) {\n\t\trequestOptions.path = url;\n\t\tif (parsedUrl.auth) {\n\t\t\trequestOptions.headers['proxy-authorization'] = 'Basic ' + new Buffer(parsedUrl.auth).toString('base64');\n\t\t}\n\n\t\tconst parsedProxyUrl = urlUtil.parse(url);\n\t\tif (parsedProxyUrl.host) {\n\t\t\trequestOptions.headers['host'] = parsedProxyUrl.host;\n\t\t}\n\n\t\tif (parsedProxyUrl.auth) {\n\t\t\trequestOptions.auth = parsedProxyUrl.auth;\n\t\t}\n\t}\n\n\tconst { acceptCompression = true } = options;\n\tif (acceptCompression) {\n\t\trequestOptions.headers['Accept-Encoding'] = 'gzip, deflate';\n\t}\n\n\tconst request = parsedUrl.protocol === 'https:' ? https.request(requestOptions) : http.request(requestOptions);\n\n\tconst uploadObserverPool = new SubscriptionPool();\n\n\tconst requestTask = >new Task(\n\t\t(resolve, reject) => {\n\t\t\tlet timeoutHandle: Handle;\n\t\t\tlet timeoutReject: Function = reject;\n\n\t\t\tif (options.socketOptions) {\n\t\t\t\tif (options.socketOptions.timeout) {\n\t\t\t\t\trequest.setTimeout(options.socketOptions.timeout);\n\t\t\t\t}\n\n\t\t\t\tif ('noDelay' in options.socketOptions) {\n\t\t\t\t\trequest.setNoDelay(options.socketOptions.noDelay);\n\t\t\t\t}\n\n\t\t\t\tif ('keepAlive' in options.socketOptions) {\n\t\t\t\t\tconst initialDelay: number | undefined = options.socketOptions.keepAlive;\n\t\t\t\t\tif (initialDelay !== undefined) {\n\t\t\t\t\t\trequest.setSocketKeepAlive(initialDelay >= 0, initialDelay);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\trequest.once('response', (message: http.IncomingMessage) => {\n\t\t\t\tconst response = new NodeResponse(message);\n\n\t\t\t\t// Redirection handling defaults to true in order to harmonise with the XHR provider, which will always\n\t\t\t\t// follow redirects\n\t\t\t\tif (response.status >= 300 && response.status < 400) {\n\t\t\t\t\tconst redirectOptions = options.redirectOptions || {};\n\t\t\t\t\tconst newOptions = deepAssign({}, options);\n\n\t\t\t\t\tswitch (response.status) {\n\t\t\t\t\t\tcase 300:\n\t\t\t\t\t\t\t/**\n\t\t\t\t\t\t\t * Note about 300 redirects. RFC 2616 doesn't specify what to do with them, it is up to the client to \"pick\n\t\t\t\t\t\t\t * the right one\". We're picking like Chrome does, just don't pick any.\n\t\t\t\t\t\t\t */\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 301:\n\t\t\t\t\t\tcase 302:\n\t\t\t\t\t\t\t/**\n\t\t\t\t\t\t\t * RFC 2616 says,\n\t\t\t\t\t\t\t *\n\t\t\t\t\t\t\t * If the 301 status code is received in response to a request other\n\t\t\t\t\t\t\t * than GET or HEAD, the user agent MUST NOT automatically redirect the\n\t\t\t\t\t\t\t * request unless it can be confirmed by the user, since this might\n\t\t\t\t\t\t\t * change the conditions under which the request was issued.\n\t\t\t\t\t\t\t *\n\t\t\t\t\t\t\t * Note: When automatically redirecting a POST request after\n\t\t\t\t\t\t\t * receiving a 301 status code, some existing HTTP/1.0 user agents\n\t\t\t\t\t\t\t * will erroneously change it into a GET request.\n\t\t\t\t\t\t\t *\n\t\t\t\t\t\t\t * We're going to be one of those erroneous agents, to prevent the request from failing..\n\t\t\t\t\t\t\t */\n\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\trequestOptions.method !== 'GET' &&\n\t\t\t\t\t\t\t\trequestOptions.method !== 'HEAD' &&\n\t\t\t\t\t\t\t\t!redirectOptions.keepOriginalMethod\n\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\tnewOptions.method = 'GET';\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif (redirect(resolve, reject, url, response.headers.get('location'), newOptions)) {\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 303:\n\t\t\t\t\t\t\t/**\n\t\t\t\t\t\t\t * The response to the request can be found under a different URI and\n\t\t\t\t\t\t\t * SHOULD be retrieved using a GET method on that resource.\n\t\t\t\t\t\t\t */\n\t\t\t\t\t\t\tif (requestOptions.method !== 'GET') {\n\t\t\t\t\t\t\t\tnewOptions.method = 'GET';\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif (redirect(resolve, reject, url, response.headers.get('location'), newOptions)) {\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 304:\n\t\t\t\t\t\t\t// do nothing so this can fall through and return the response as normal. Nothing more can\n\t\t\t\t\t\t\t// be done for 304\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 305:\n\t\t\t\t\t\t\tif (!response.headers.get('location')) {\n\t\t\t\t\t\t\t\treject(new Error('expected Location header to contain a proxy url'));\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tnewOptions.proxy = response.headers.get('location') || '';\n\t\t\t\t\t\t\t\tif (redirect(resolve, reject, url, '', newOptions)) {\n\t\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 307:\n\t\t\t\t\t\t\t/**\n\t\t\t\t\t\t\t * If the 307 status code is received in response to a request other\n\t\t\t\t\t\t\t * than GET or HEAD, the user agent MUST NOT automatically redirect the\n\t\t\t\t\t\t\t * request unless it can be confirmed by the user, since this might\n\t\t\t\t\t\t\t * change the conditions under which the request was issued.\n\t\t\t\t\t\t\t */\n\t\t\t\t\t\t\tif (redirect(resolve, reject, url, response.headers.get('location'), newOptions)) {\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\treject(new Error('unhandled redirect status ' + response.status));\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\toptions.streamEncoding && message.setEncoding(options.streamEncoding);\n\n\t\t\t\tconst downloadSubscriptionPool = new SubscriptionPool();\n\t\t\t\tconst dataSubscriptionPool = new SubscriptionPool();\n\n\t\t\t\t/*\n\t\t\t [RFC 2616](https://tools.ietf.org/html/rfc2616#page-118) says that content-encoding can have multiple\n\t\t\t values, so we split them here and put them in a list to process later.\n\t\t\t */\n\t\t\t\tconst contentEncodings = response.headers.getAll('content-encoding');\n\n\t\t\t\tconst task = new Task(\n\t\t\t\t\t(resolve, reject) => {\n\t\t\t\t\t\ttimeoutReject = reject;\n\n\t\t\t\t\t\t// we queue this up for later to allow listeners to register themselves before we start receiving data\n\t\t\t\t\t\tqueueTask(() => {\n\t\t\t\t\t\t\t/*\n\t\t\t\t\t * Note that this is the raw data, if your input stream is zipped, and you are piecing\n\t\t\t\t\t * together the downloaded data, you'll have to decompress it yourself\n\t\t\t\t\t */\n\t\t\t\t\t\t\tmessage.on('data', (chunk: any) => {\n\t\t\t\t\t\t\t\tdataSubscriptionPool.next(chunk);\n\n\t\t\t\t\t\t\t\tif (response.downloadBody) {\n\t\t\t\t\t\t\t\t\tdata.buffer.push(chunk);\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tdata.size +=\n\t\t\t\t\t\t\t\t\ttypeof chunk === 'string'\n\t\t\t\t\t\t\t\t\t\t? Buffer.byteLength(chunk, options.streamEncoding)\n\t\t\t\t\t\t\t\t\t\t: chunk.length;\n\n\t\t\t\t\t\t\t\tdownloadSubscriptionPool.next(data.size);\n\t\t\t\t\t\t\t});\n\n\t\t\t\t\t\t\tmessage.once('end', () => {\n\t\t\t\t\t\t\t\ttimeoutHandle && timeoutHandle.destroy();\n\n\t\t\t\t\t\t\t\tlet dataAsBuffer = options.streamEncoding\n\t\t\t\t\t\t\t\t\t? new Buffer(data.buffer.join(''), 'utf8')\n\t\t\t\t\t\t\t\t\t: Buffer.concat(data.buffer, data.size);\n\n\t\t\t\t\t\t\t\tconst handleEncoding = function() {\n\t\t\t\t\t\t\t\t\t/*\n\t\t\t\t\t\t\t Content encoding is ordered by the order in which they were applied to the\n\t\t\t\t\t\t\t content, so do undo the encoding we have to start at the end and work backwards.\n\t\t\t\t\t\t\t */\n\t\t\t\t\t\t\t\t\tif (contentEncodings.length) {\n\t\t\t\t\t\t\t\t\t\tconst encoding = contentEncodings.pop()!.trim().toLowerCase();\n\n\t\t\t\t\t\t\t\t\t\tif (encoding === '' || encoding === 'none' || encoding === 'identity') {\n\t\t\t\t\t\t\t\t\t\t\t// do nothing, response stream is as-is\n\t\t\t\t\t\t\t\t\t\t\thandleEncoding();\n\t\t\t\t\t\t\t\t\t\t} else if (encoding === 'gzip') {\n\t\t\t\t\t\t\t\t\t\t\tzlib.gunzip(dataAsBuffer, function(err: Error | null, result: Buffer) {\n\t\t\t\t\t\t\t\t\t\t\t\tif (err) {\n\t\t\t\t\t\t\t\t\t\t\t\t\treject(err);\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t\t\tdataAsBuffer = result;\n\t\t\t\t\t\t\t\t\t\t\t\thandleEncoding();\n\t\t\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t\t\t} else if (encoding === 'deflate') {\n\t\t\t\t\t\t\t\t\t\t\tzlib.inflate(dataAsBuffer, function(err: Error | null, result: Buffer) {\n\t\t\t\t\t\t\t\t\t\t\t\tif (err) {\n\t\t\t\t\t\t\t\t\t\t\t\t\treject(err);\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t\t\tdataAsBuffer = result;\n\t\t\t\t\t\t\t\t\t\t\t\thandleEncoding();\n\t\t\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\treject(new Error('Unsupported content encoding, ' + encoding));\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\tdata.data = dataAsBuffer;\n\n\t\t\t\t\t\t\t\t\t\tresolve(message);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t};\n\n\t\t\t\t\t\t\t\thandleEncoding();\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t});\n\t\t\t\t\t},\n\t\t\t\t\t() => {\n\t\t\t\t\t\trequest.abort();\n\t\t\t\t\t}\n\t\t\t\t);\n\n\t\t\t\tconst data: RequestData = {\n\t\t\t\t\ttask,\n\t\t\t\t\tbuffer: [],\n\t\t\t\t\tdata: Buffer.alloc(0),\n\t\t\t\t\tsize: 0,\n\t\t\t\t\tused: false,\n\t\t\t\t\turl: url,\n\t\t\t\t\trequestOptions: options,\n\t\t\t\t\tnativeResponse: message,\n\t\t\t\t\tdownloadObservable: new Observable((observer) => downloadSubscriptionPool.add(observer)),\n\t\t\t\t\tdataObservable: new Observable((observer) => dataSubscriptionPool.add(observer))\n\t\t\t\t};\n\n\t\t\t\tdataMap.set(response, data);\n\n\t\t\t\tresolve(response);\n\t\t\t});\n\n\t\t\trequest.once('error', reject);\n\n\t\t\tif (options.bodyStream) {\n\t\t\t\toptions.bodyStream.pipe(request);\n\t\t\t\tlet uploadedSize = 0;\n\n\t\t\t\toptions.bodyStream.on('data', (chunk: any) => {\n\t\t\t\t\tuploadedSize += chunk.length;\n\t\t\t\t\tuploadObserverPool.next(uploadedSize);\n\t\t\t\t});\n\n\t\t\t\toptions.bodyStream.on('end', () => {\n\t\t\t\t\tuploadObserverPool.complete();\n\t\t\t\t\trequest.end();\n\t\t\t\t});\n\t\t\t} else if (options.body) {\n\t\t\t\tconst body = options.body.toString();\n\n\t\t\t\trequest.on('response', () => {\n\t\t\t\t\tuploadObserverPool.next(body.length);\n\t\t\t\t});\n\n\t\t\t\trequest.end(body);\n\t\t\t} else {\n\t\t\t\trequest.end();\n\t\t\t}\n\n\t\t\tif (options.timeout && options.timeout > 0 && options.timeout !== Infinity) {\n\t\t\t\ttimeoutHandle = createTimer(() => {\n\t\t\t\t\ttimeoutReject && timeoutReject(new TimeoutError('The request timed out'));\n\t\t\t\t}, options.timeout);\n\t\t\t}\n\t\t},\n\t\t() => {\n\t\t\trequest.abort();\n\t\t}\n\t).catch(function(error: Error): any {\n\t\tconst parsedUrl = urlUtil.parse(url);\n\n\t\tif (parsedUrl.auth) {\n\t\t\tparsedUrl.auth = '(redacted)';\n\t\t}\n\n\t\tconst sanitizedUrl = urlUtil.format(parsedUrl);\n\n\t\terror.message = '[' + requestOptions.method + ' ' + sanitizedUrl + '] ' + error.message;\n\t\tthrow error;\n\t});\n\n\trequestTask.upload = new Observable((observer) => uploadObserverPool.add(observer));\n\n\treturn requestTask;\n}\n"]} \ No newline at end of file diff --git a/deps/framework/core/request/providers/node.mjs b/deps/framework/core/request/providers/node.mjs deleted file mode 100644 index 9636ffb742..0000000000 --- a/deps/framework/core/request/providers/node.mjs +++ /dev/null @@ -1,425 +0,0 @@ -import Set from '../../../shim/Set'; -import WeakMap from '../../../shim/WeakMap'; -import * as http from 'http'; -import * as https from 'https'; -import * as urlUtil from 'url'; -import * as zlib from 'zlib'; -import Task from '../../async/Task'; -import { deepAssign } from '../../lang'; -import { queueTask } from '../../queue'; -import { createTimer } from '../../util'; -import Headers from '../Headers'; -import Response from '../Response'; -import TimeoutError from '../TimeoutError'; -import Observable from '../../Observable'; -import SubscriptionPool from '../SubscriptionPool'; -// TODO: This should be read from the package and not hard coded! -let version = '2.0.0-pre'; -/** - * If not overridden, redirects will only be processed this many times before aborting (per request). - * @type {number} - */ -const DEFAULT_REDIRECT_LIMIT = 15; -const dataMap = new WeakMap(); -const discardedDuplicates = new Set([ - 'age', - 'authorization', - 'content-length', - 'content-type', - 'etag', - 'expires', - 'from', - 'host', - 'if-modified-since', - 'if-unmodified-since', - 'last-modified', - 'location', - 'max-forwards', - 'proxy-authorization', - 'referer', - 'retry-after', - 'user-agent' -]); -function getDataTask(response) { - const data = dataMap.get(response); - if (data.used) { - return Task.reject(new TypeError('Body already read')); - } - data.used = true; - return data.task.then((_) => data); -} -/** - * Turn a node native response object into something that resembles the fetch api - */ -export class NodeResponse extends Response { - constructor(response) { - super(); - this.downloadBody = true; - const headers = (this.headers = new Headers()); - for (let key in response.headers) { - const value = response.headers[key]; - if (value) { - if (discardedDuplicates.has(key) && !Array.isArray(value)) { - headers.append(key, value); - } - (Array.isArray(value) ? value : value.split(/\s*,\s*/)).forEach((v) => { - headers.append(key, v); - }); - } - } - this.status = response.statusCode || 0; - this.ok = this.status >= 200 && this.status < 300; - this.statusText = response.statusMessage || ''; - } - get bodyUsed() { - return dataMap.get(this).used; - } - get nativeResponse() { - return dataMap.get(this).nativeResponse; - } - get requestOptions() { - return dataMap.get(this).requestOptions; - } - get url() { - return dataMap.get(this).url; - } - get download() { - return dataMap.get(this).downloadObservable; - } - get data() { - return dataMap.get(this).dataObservable; - } - arrayBuffer() { - return getDataTask(this).then((data) => { - if (data) { - return data.data; - } - return new Buffer([]); - }); - } - blob() { - // Node doesn't support Blobs - return Task.reject(new Error('Blob not supported')); - } - formData() { - return Task.reject(new Error('FormData not supported')); - } - text() { - return getDataTask(this).then((data) => { - return String(data ? data.data : ''); - }); - } -} -function redirect(resolve, reject, originalUrl, redirectUrl, options) { - if (!options.redirectOptions) { - options.redirectOptions = {}; - } - const { limit: redirectLimit = DEFAULT_REDIRECT_LIMIT, count: redirectCount = 0 } = options.redirectOptions; - const { followRedirects = true } = options; - if (!followRedirects) { - return false; - } - // we only check for undefined here because empty string redirects are now allowed - // (they'll resolve to the current url) - if (redirectUrl === undefined || redirectUrl === null) { - reject(new Error('asked to redirect but no location header was found')); - return true; - } - if (redirectCount > redirectLimit) { - reject(new Error(`too many redirects, limit reached at ${redirectLimit}`)); - return true; - } - options.redirectOptions.count = redirectCount + 1; - // we wrap the url in a call to node's URL.resolve which will handle relative and partial - // redirects (like "/another-page" on the same domain). - resolve(node(urlUtil.resolve(originalUrl, redirectUrl), options)); - return true; -} -export function getAuth(proxyAuth, options) { - if (proxyAuth) { - return proxyAuth; - } - if (options.user || options.password) { - return `${options.user || ''}:${options.password || ''}`; - } - return undefined; -} -export default function node(url, options = {}) { - const parsedUrl = urlUtil.parse(options.proxy || url); - const requestOptions = { - agent: options.agent, - auth: getAuth(parsedUrl.auth, options), - ca: options.ca, - cert: options.cert, - ciphers: options.ciphers, - host: parsedUrl.host, - hostname: parsedUrl.hostname, - key: options.key, - localAddress: options.localAddress, - method: options.method ? options.method.toUpperCase() : 'GET', - passphrase: options.passphrase, - path: parsedUrl.path, - pfx: options.pfx, - port: Number(parsedUrl.port), - rejectUnauthorized: options.rejectUnauthorized, - secureProtocol: options.secureProtocol, - socketPath: options.socketPath - }; - requestOptions.headers = options.headers || {}; - if (!Object.keys(requestOptions.headers) - .map((headerName) => headerName.toLowerCase()) - .some((headerName) => headerName === 'user-agent')) { - requestOptions.headers['user-agent'] = 'dojo/' + version + ' Node.js/' + process.version.replace(/^v/, ''); - } - if (options.proxy) { - requestOptions.path = url; - if (parsedUrl.auth) { - requestOptions.headers['proxy-authorization'] = 'Basic ' + new Buffer(parsedUrl.auth).toString('base64'); - } - const parsedProxyUrl = urlUtil.parse(url); - if (parsedProxyUrl.host) { - requestOptions.headers['host'] = parsedProxyUrl.host; - } - if (parsedProxyUrl.auth) { - requestOptions.auth = parsedProxyUrl.auth; - } - } - const { acceptCompression = true } = options; - if (acceptCompression) { - requestOptions.headers['Accept-Encoding'] = 'gzip, deflate'; - } - const request = parsedUrl.protocol === 'https:' ? https.request(requestOptions) : http.request(requestOptions); - const uploadObserverPool = new SubscriptionPool(); - const requestTask = new Task((resolve, reject) => { - let timeoutHandle; - let timeoutReject = reject; - if (options.socketOptions) { - if (options.socketOptions.timeout) { - request.setTimeout(options.socketOptions.timeout); - } - if ('noDelay' in options.socketOptions) { - request.setNoDelay(options.socketOptions.noDelay); - } - if ('keepAlive' in options.socketOptions) { - const initialDelay = options.socketOptions.keepAlive; - if (initialDelay !== undefined) { - request.setSocketKeepAlive(initialDelay >= 0, initialDelay); - } - } - } - request.once('response', (message) => { - const response = new NodeResponse(message); - // Redirection handling defaults to true in order to harmonise with the XHR provider, which will always - // follow redirects - if (response.status >= 300 && response.status < 400) { - const redirectOptions = options.redirectOptions || {}; - const newOptions = deepAssign({}, options); - switch (response.status) { - case 300: - /** - * Note about 300 redirects. RFC 2616 doesn't specify what to do with them, it is up to the client to "pick - * the right one". We're picking like Chrome does, just don't pick any. - */ - break; - case 301: - case 302: - /** - * RFC 2616 says, - * - * If the 301 status code is received in response to a request other - * than GET or HEAD, the user agent MUST NOT automatically redirect the - * request unless it can be confirmed by the user, since this might - * change the conditions under which the request was issued. - * - * Note: When automatically redirecting a POST request after - * receiving a 301 status code, some existing HTTP/1.0 user agents - * will erroneously change it into a GET request. - * - * We're going to be one of those erroneous agents, to prevent the request from failing.. - */ - if (requestOptions.method !== 'GET' && - requestOptions.method !== 'HEAD' && - !redirectOptions.keepOriginalMethod) { - newOptions.method = 'GET'; - } - if (redirect(resolve, reject, url, response.headers.get('location'), newOptions)) { - return; - } - break; - case 303: - /** - * The response to the request can be found under a different URI and - * SHOULD be retrieved using a GET method on that resource. - */ - if (requestOptions.method !== 'GET') { - newOptions.method = 'GET'; - } - if (redirect(resolve, reject, url, response.headers.get('location'), newOptions)) { - return; - } - break; - case 304: - // do nothing so this can fall through and return the response as normal. Nothing more can - // be done for 304 - break; - case 305: - if (!response.headers.get('location')) { - reject(new Error('expected Location header to contain a proxy url')); - } - else { - newOptions.proxy = response.headers.get('location') || ''; - if (redirect(resolve, reject, url, '', newOptions)) { - return; - } - } - break; - case 307: - /** - * If the 307 status code is received in response to a request other - * than GET or HEAD, the user agent MUST NOT automatically redirect the - * request unless it can be confirmed by the user, since this might - * change the conditions under which the request was issued. - */ - if (redirect(resolve, reject, url, response.headers.get('location'), newOptions)) { - return; - } - break; - default: - reject(new Error('unhandled redirect status ' + response.status)); - return; - } - } - options.streamEncoding && message.setEncoding(options.streamEncoding); - const downloadSubscriptionPool = new SubscriptionPool(); - const dataSubscriptionPool = new SubscriptionPool(); - /* - [RFC 2616](https://tools.ietf.org/html/rfc2616#page-118) says that content-encoding can have multiple - values, so we split them here and put them in a list to process later. - */ - const contentEncodings = response.headers.getAll('content-encoding'); - const task = new Task((resolve, reject) => { - timeoutReject = reject; - // we queue this up for later to allow listeners to register themselves before we start receiving data - queueTask(() => { - /* - * Note that this is the raw data, if your input stream is zipped, and you are piecing - * together the downloaded data, you'll have to decompress it yourself - */ - message.on('data', (chunk) => { - dataSubscriptionPool.next(chunk); - if (response.downloadBody) { - data.buffer.push(chunk); - } - data.size += - typeof chunk === 'string' - ? Buffer.byteLength(chunk, options.streamEncoding) - : chunk.length; - downloadSubscriptionPool.next(data.size); - }); - message.once('end', () => { - timeoutHandle && timeoutHandle.destroy(); - let dataAsBuffer = options.streamEncoding - ? new Buffer(data.buffer.join(''), 'utf8') - : Buffer.concat(data.buffer, data.size); - const handleEncoding = function () { - /* - Content encoding is ordered by the order in which they were applied to the - content, so do undo the encoding we have to start at the end and work backwards. - */ - if (contentEncodings.length) { - const encoding = contentEncodings.pop().trim().toLowerCase(); - if (encoding === '' || encoding === 'none' || encoding === 'identity') { - // do nothing, response stream is as-is - handleEncoding(); - } - else if (encoding === 'gzip') { - zlib.gunzip(dataAsBuffer, function (err, result) { - if (err) { - reject(err); - } - dataAsBuffer = result; - handleEncoding(); - }); - } - else if (encoding === 'deflate') { - zlib.inflate(dataAsBuffer, function (err, result) { - if (err) { - reject(err); - } - dataAsBuffer = result; - handleEncoding(); - }); - } - else { - reject(new Error('Unsupported content encoding, ' + encoding)); - } - } - else { - data.data = dataAsBuffer; - resolve(message); - } - }; - handleEncoding(); - }); - }); - }, () => { - request.abort(); - }); - const data = { - task, - buffer: [], - data: Buffer.alloc(0), - size: 0, - used: false, - url: url, - requestOptions: options, - nativeResponse: message, - downloadObservable: new Observable((observer) => downloadSubscriptionPool.add(observer)), - dataObservable: new Observable((observer) => dataSubscriptionPool.add(observer)) - }; - dataMap.set(response, data); - resolve(response); - }); - request.once('error', reject); - if (options.bodyStream) { - options.bodyStream.pipe(request); - let uploadedSize = 0; - options.bodyStream.on('data', (chunk) => { - uploadedSize += chunk.length; - uploadObserverPool.next(uploadedSize); - }); - options.bodyStream.on('end', () => { - uploadObserverPool.complete(); - request.end(); - }); - } - else if (options.body) { - const body = options.body.toString(); - request.on('response', () => { - uploadObserverPool.next(body.length); - }); - request.end(body); - } - else { - request.end(); - } - if (options.timeout && options.timeout > 0 && options.timeout !== Infinity) { - timeoutHandle = createTimer(() => { - timeoutReject && timeoutReject(new TimeoutError('The request timed out')); - }, options.timeout); - } - }, () => { - request.abort(); - }).catch(function (error) { - const parsedUrl = urlUtil.parse(url); - if (parsedUrl.auth) { - parsedUrl.auth = '(redacted)'; - } - const sanitizedUrl = urlUtil.format(parsedUrl); - error.message = '[' + requestOptions.method + ' ' + sanitizedUrl + '] ' + error.message; - throw error; - }); - requestTask.upload = new Observable((observer) => uploadObserverPool.add(observer)); - return requestTask; -} -//# sourceMappingURL=node.mjs.map \ No newline at end of file diff --git a/deps/framework/core/request/providers/node.mjs.map b/deps/framework/core/request/providers/node.mjs.map deleted file mode 100644 index 2a95522d28..0000000000 --- a/deps/framework/core/request/providers/node.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"node.mjs","sourceRoot":"","sources":["node.ts"],"names":[],"mappings":"AACA,OAAO,GAAG,MAAM,mBAAmB,CAAC;AACpC,OAAO,OAAO,MAAM,uBAAuB,CAAC;AAC5C,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAC7B,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,OAAO,MAAM,KAAK,CAAC;AAC/B,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAC7B,OAAO,IAAI,MAAM,kBAAkB,CAAC;AACpC,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AACxC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AACzC,OAAO,OAAO,MAAM,YAAY,CAAC;AAEjC,OAAO,QAAQ,MAAM,aAAa,CAAC;AACnC,OAAO,YAAY,MAAM,iBAAiB,CAAC;AAE3C,OAAO,UAAU,MAAM,kBAAkB,CAAC;AAC1C,OAAO,gBAAgB,MAAM,qBAAqB,CAAC;AA0GnD,iEAAiE;AACjE,I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C,CAAC;QACnB,CAAC;QAAC,IAAI,CAAC,CAAC;YACP,OAAO,CAAC,GAAG,EAAE,CAAC;QACf,CAAC;QAED,EAAE,CAAC,CAAC,OAAO,CAAC,OAAO,IAAI,OAAO,CAAC,OAAO,GAAG,CAAC,IAAI,OAAO,CAAC,OAAO,KAAK,QAAQ,CAAC,CAAC,CAAC;YAC5E,aAAa,GAAG,WAAW,CAAC,GAAG,EAAE;gBAChC,aAAa,IAAI,aAAa,CAAC,IAAI,YAAY,CAAC,uBAAuB,CAAC,CAAC,CAAC;YAC3E,CAAC,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC;QACrB,CAAC;IACF,CAAC,EACD,GAAG,EAAE;QACJ,OAAO,CAAC,KAAK,EAAE,CAAC;IACjB,CAAC,CACD,CAAC,KAAK,CAAC,UAAS,KAAY;QAC5B,MAAM,SAAS,GAAG,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QAErC,EAAE,CAAC,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC;YACpB,SAAS,CAAC,IAAI,GAAG,YAAY,CAAC;QAC/B,CAAC;QAED,MAAM,YAAY,GAAG,OAAO,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;QAE/C,KAAK,CAAC,OAAO,GAAG,GAAG,GAAG,cAAc,CAAC,MAAM,GAAG,GAAG,GAAG,YAAY,GAAG,IAAI,GAAG,KAAK,CAAC,OAAO,CAAC;QACxF,MAAM,KAAK,CAAC;IACb,CAAC,CAAC,CAAC;IAEH,WAAW,CAAC,MAAM,GAAG,IAAI,UAAU,CAAS,CAAC,QAAQ,EAAE,EAAE,CAAC,kBAAkB,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC;IAE5F,MAAM,CAAC,WAAW,CAAC;AACpB,CAAC","sourcesContent":["import { Handle } from '../../interfaces';\nimport Set from '../../../shim/Set';\nimport WeakMap from '../../../shim/WeakMap';\nimport * as http from 'http';\nimport * as https from 'https';\nimport * as urlUtil from 'url';\nimport * as zlib from 'zlib';\nimport Task from '../../async/Task';\nimport { deepAssign } from '../../lang';\nimport { queueTask } from '../../queue';\nimport { createTimer } from '../../util';\nimport Headers from '../Headers';\nimport { RequestOptions, UploadObservableTask } from '../interfaces';\nimport Response from '../Response';\nimport TimeoutError from '../TimeoutError';\nimport { Readable } from 'stream';\nimport Observable from '../../Observable';\nimport SubscriptionPool from '../SubscriptionPool';\n\n/**\n * Request options specific to a node request. For HTTPS options, see\n * https://nodejs.org/api/tls.html#tls_tls_connect_options_callback for more details.\n */\nexport interface NodeRequestOptions extends RequestOptions {\n\t/**\n\t * User-agent header\n\t */\n\tagent?: any;\n\t/**\n\t * If specified, the request body is read from the stream specified here, rather than from the `body` field.\n\t */\n\tbodyStream?: Readable;\n\t/**\n\t * HTTPS optionally override the trusted CA certificates\n\t */\n\tca?: any;\n\t/**\n\t * HTTPS optional cert chains in PEM format. One cert chain should be provided per private key.\n\t */\n\tcert?: string;\n\t/**\n\t * HTTPS optional cipher suite specification\n\t */\n\tciphers?: string;\n\tdataEncoding?: string;\n\t/**\n\t * Whether or not to automatically follow redirects (default true)\n\t */\n\tfollowRedirects?: boolean;\n\t/**\n\t * HTTPS optional private key in PEM format.\n\t */\n\tkey?: string;\n\t/**\n\t * Local interface to bind for network connections.\n\t */\n\tlocalAddress?: string;\n\t/**\n\t * HTTPS optional shared passphrase used for a single private key and/or a PFX.\n\t */\n\tpassphrase?: string;\n\t/**\n\t * HTTPS optional PFX or PKCS12 encoded private key and certificate chain.\n\t */\n\tpfx?: any;\n\t/**\n\t * Optional proxy address. If specified, requests will be sent through this url.\n\t */\n\tproxy?: string;\n\t/**\n\t * HTTPS If not false the server will reject any connection which is not authorized with the list of supplied CAs\n\t */\n\trejectUnauthorized?: boolean;\n\t/**\n\t * HTTPS optional SSL method to use, default is \"SSLv23_method\"\n\t */\n\tsecureProtocol?: string;\n\t/**\n\t * Unix Domain Socket (use one of host:port or socketPath)\n\t */\n\tsocketPath?: string;\n\t/**\n\t * Whether or not to add the gzip and deflate accept headers (default true)\n\t */\n\tacceptCompression?: boolean;\n\t/**\n\t * A set of options to set on the HTTP request\n\t */\n\tsocketOptions?: {\n\t\t/**\n\t\t * Enable/disable keep-alive functionality, and optionally set the initial delay before the first keepalive probe is sent on an idle socket.\n\t\t */\n\t\tkeepAlive?: number;\n\t\t/**\n\t\t * Disables the Nagle algorithm. By default TCP connections use the Nagle algorithm, they buffer data before sending it off.\n\t\t */\n\t\tnoDelay?: boolean;\n\t\t/**\n\t\t * Number of milliseconds before the HTTP request times out\n\t\t */\n\t\ttimeout?: number;\n\t};\n\t/**\n\t * Stream encoding on incoming HTTP response\n\t */\n\tstreamEncoding?: string;\n\t/**\n\t * Options to control redirect follow logic\n\t */\n\tredirectOptions?: {\n\t\t/**\n\t\t * The limit to the number of redirects that will be followed (default 15). This is used to prevent infinite\n\t\t * redirect loops.\n\t\t */\n\t\tlimit?: number;\n\t\tcount?: number;\n\t\t/**\n\t\t * Whether or not to keep the original HTTP method during 301 redirects (default false).\n\t\t */\n\t\tkeepOriginalMethod?: boolean;\n\t};\n}\n\n// TODO: This should be read from the package and not hard coded!\nlet version = '2.0.0-pre';\n\n/**\n * If not overridden, redirects will only be processed this many times before aborting (per request).\n * @type {number}\n */\nconst DEFAULT_REDIRECT_LIMIT = 15;\n\n/**\n * Options to be passed to node's request\n */\ninterface Options {\n\tagent?: any;\n\tauth?: string;\n\theaders?: { [name: string]: string };\n\thost?: string;\n\thostname?: string;\n\tlocalAddress?: string;\n\tmethod?: string;\n\tpath?: string;\n\tport?: number;\n\tsocketPath?: string;\n}\n\n/**\n * HTTPS specific options for node\n */\ninterface HttpsOptions extends Options {\n\tca?: any;\n\tcert?: string;\n\tciphers?: string;\n\tkey?: string;\n\tpassphrase?: string;\n\tpfx?: any;\n\trejectUnauthorized?: boolean;\n\tsecureProtocol?: string;\n}\n\ninterface RequestData {\n\ttask: Task;\n\tbuffer: any[];\n\tdata: Buffer;\n\tsize: number;\n\tused: boolean;\n\tnativeResponse: http.IncomingMessage;\n\trequestOptions: NodeRequestOptions;\n\turl: string;\n\tdownloadObservable: Observable;\n\tdataObservable: Observable;\n}\n\nconst dataMap = new WeakMap();\nconst discardedDuplicates = new Set([\n\t'age',\n\t'authorization',\n\t'content-length',\n\t'content-type',\n\t'etag',\n\t'expires',\n\t'from',\n\t'host',\n\t'if-modified-since',\n\t'if-unmodified-since',\n\t'last-modified',\n\t'location',\n\t'max-forwards',\n\t'proxy-authorization',\n\t'referer',\n\t'retry-after',\n\t'user-agent'\n]);\n\nfunction getDataTask(response: NodeResponse): Task {\n\tconst data = dataMap.get(response)!;\n\n\tif (data.used) {\n\t\treturn Task.reject(new TypeError('Body already read'));\n\t}\n\n\tdata.used = true;\n\n\treturn >data.task.then((_) => data);\n}\n\n/**\n * Turn a node native response object into something that resembles the fetch api\n */\nexport class NodeResponse extends Response {\n\treadonly headers: Headers;\n\treadonly ok: boolean;\n\treadonly status: number;\n\treadonly statusText: string;\n\n\tdownloadBody = true;\n\n\tget bodyUsed(): boolean {\n\t\treturn dataMap.get(this)!.used;\n\t}\n\n\tget nativeResponse(): http.IncomingMessage {\n\t\treturn dataMap.get(this)!.nativeResponse;\n\t}\n\n\tget requestOptions(): NodeRequestOptions {\n\t\treturn dataMap.get(this)!.requestOptions;\n\t}\n\n\tget url(): string {\n\t\treturn dataMap.get(this)!.url;\n\t}\n\n\tget download(): Observable {\n\t\treturn dataMap.get(this)!.downloadObservable;\n\t}\n\n\tget data(): Observable {\n\t\treturn dataMap.get(this)!.dataObservable;\n\t}\n\n\tconstructor(response: http.IncomingMessage) {\n\t\tsuper();\n\n\t\tconst headers = (this.headers = new Headers());\n\t\tfor (let key in response.headers) {\n\t\t\tconst value = response.headers[key];\n\t\t\tif (value) {\n\t\t\t\tif (discardedDuplicates.has(key) && !Array.isArray(value)) {\n\t\t\t\t\theaders.append(key, value);\n\t\t\t\t}\n\t\t\t\t(Array.isArray(value) ? value : value.split(/\\s*,\\s*/)).forEach((v) => {\n\t\t\t\t\theaders.append(key, v);\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\n\t\tthis.status = response.statusCode || 0;\n\t\tthis.ok = this.status >= 200 && this.status < 300;\n\t\tthis.statusText = response.statusMessage || '';\n\t}\n\n\tarrayBuffer(): Task {\n\t\treturn getDataTask(this).then((data) => {\n\t\t\tif (data) {\n\t\t\t\treturn data.data;\n\t\t\t}\n\n\t\t\treturn new Buffer([]);\n\t\t});\n\t}\n\n\tblob(): Task {\n\t\t// Node doesn't support Blobs\n\t\treturn Task.reject(new Error('Blob not supported'));\n\t}\n\n\tformData(): Task {\n\t\treturn Task.reject(new Error('FormData not supported'));\n\t}\n\n\ttext(): Task {\n\t\treturn getDataTask(this).then((data) => {\n\t\t\treturn String(data ? data.data : '');\n\t\t});\n\t}\n}\n\nfunction redirect(\n\tresolve: (p?: any) => void,\n\treject: (_?: Error) => void,\n\toriginalUrl: string,\n\tredirectUrl: string | null,\n\toptions: NodeRequestOptions\n): boolean {\n\tif (!options.redirectOptions) {\n\t\toptions.redirectOptions = {};\n\t}\n\n\tconst { limit: redirectLimit = DEFAULT_REDIRECT_LIMIT, count: redirectCount = 0 } = options.redirectOptions;\n\tconst { followRedirects = true } = options;\n\n\tif (!followRedirects) {\n\t\treturn false;\n\t}\n\n\t// we only check for undefined here because empty string redirects are now allowed\n\t// (they'll resolve to the current url)\n\tif (redirectUrl === undefined || redirectUrl === null) {\n\t\treject(new Error('asked to redirect but no location header was found'));\n\t\treturn true;\n\t}\n\n\tif (redirectCount > redirectLimit) {\n\t\treject(new Error(`too many redirects, limit reached at ${redirectLimit}`));\n\t\treturn true;\n\t}\n\n\toptions.redirectOptions.count = redirectCount + 1;\n\n\t// we wrap the url in a call to node's URL.resolve which will handle relative and partial\n\t// redirects (like \"/another-page\" on the same domain).\n\tresolve(node(urlUtil.resolve(originalUrl, redirectUrl), options));\n\n\treturn true;\n}\n\nexport function getAuth(proxyAuth: string | undefined, options: NodeRequestOptions): string | undefined {\n\tif (proxyAuth) {\n\t\treturn proxyAuth;\n\t}\n\n\tif (options.user || options.password) {\n\t\treturn `${options.user || ''}:${options.password || ''}`;\n\t}\n\n\treturn undefined;\n}\n\nexport default function node(url: string, options: NodeRequestOptions = {}): UploadObservableTask {\n\tconst parsedUrl = urlUtil.parse(options.proxy || url);\n\n\tconst requestOptions: HttpsOptions = {\n\t\tagent: options.agent,\n\t\tauth: getAuth(parsedUrl.auth, options),\n\t\tca: options.ca,\n\t\tcert: options.cert,\n\t\tciphers: options.ciphers,\n\t\thost: parsedUrl.host,\n\t\thostname: parsedUrl.hostname,\n\t\tkey: options.key,\n\t\tlocalAddress: options.localAddress,\n\t\tmethod: options.method ? options.method.toUpperCase() : 'GET',\n\t\tpassphrase: options.passphrase,\n\t\tpath: parsedUrl.path,\n\t\tpfx: options.pfx,\n\t\tport: Number(parsedUrl.port),\n\t\trejectUnauthorized: options.rejectUnauthorized,\n\t\tsecureProtocol: options.secureProtocol,\n\t\tsocketPath: options.socketPath\n\t};\n\n\trequestOptions.headers = <{ [key: string]: string }>options.headers || {};\n\n\tif (\n\t\t!Object.keys(requestOptions.headers)\n\t\t\t.map((headerName) => headerName.toLowerCase())\n\t\t\t.some((headerName) => headerName === 'user-agent')\n\t) {\n\t\trequestOptions.headers['user-agent'] = 'dojo/' + version + ' Node.js/' + process.version.replace(/^v/, '');\n\t}\n\n\tif (options.proxy) {\n\t\trequestOptions.path = url;\n\t\tif (parsedUrl.auth) {\n\t\t\trequestOptions.headers['proxy-authorization'] = 'Basic ' + new Buffer(parsedUrl.auth).toString('base64');\n\t\t}\n\n\t\tconst parsedProxyUrl = urlUtil.parse(url);\n\t\tif (parsedProxyUrl.host) {\n\t\t\trequestOptions.headers['host'] = parsedProxyUrl.host;\n\t\t}\n\n\t\tif (parsedProxyUrl.auth) {\n\t\t\trequestOptions.auth = parsedProxyUrl.auth;\n\t\t}\n\t}\n\n\tconst { acceptCompression = true } = options;\n\tif (acceptCompression) {\n\t\trequestOptions.headers['Accept-Encoding'] = 'gzip, deflate';\n\t}\n\n\tconst request = parsedUrl.protocol === 'https:' ? https.request(requestOptions) : http.request(requestOptions);\n\n\tconst uploadObserverPool = new SubscriptionPool();\n\n\tconst requestTask = >new Task(\n\t\t(resolve, reject) => {\n\t\t\tlet timeoutHandle: Handle;\n\t\t\tlet timeoutReject: Function = reject;\n\n\t\t\tif (options.socketOptions) {\n\t\t\t\tif (options.socketOptions.timeout) {\n\t\t\t\t\trequest.setTimeout(options.socketOptions.timeout);\n\t\t\t\t}\n\n\t\t\t\tif ('noDelay' in options.socketOptions) {\n\t\t\t\t\trequest.setNoDelay(options.socketOptions.noDelay);\n\t\t\t\t}\n\n\t\t\t\tif ('keepAlive' in options.socketOptions) {\n\t\t\t\t\tconst initialDelay: number | undefined = options.socketOptions.keepAlive;\n\t\t\t\t\tif (initialDelay !== undefined) {\n\t\t\t\t\t\trequest.setSocketKeepAlive(initialDelay >= 0, initialDelay);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\trequest.once('response', (message: http.IncomingMessage) => {\n\t\t\t\tconst response = new NodeResponse(message);\n\n\t\t\t\t// Redirection handling defaults to true in order to harmonise with the XHR provider, which will always\n\t\t\t\t// follow redirects\n\t\t\t\tif (response.status >= 300 && response.status < 400) {\n\t\t\t\t\tconst redirectOptions = options.redirectOptions || {};\n\t\t\t\t\tconst newOptions = deepAssign({}, options);\n\n\t\t\t\t\tswitch (response.status) {\n\t\t\t\t\t\tcase 300:\n\t\t\t\t\t\t\t/**\n\t\t\t\t\t\t\t * Note about 300 redirects. RFC 2616 doesn't specify what to do with them, it is up to the client to \"pick\n\t\t\t\t\t\t\t * the right one\". We're picking like Chrome does, just don't pick any.\n\t\t\t\t\t\t\t */\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 301:\n\t\t\t\t\t\tcase 302:\n\t\t\t\t\t\t\t/**\n\t\t\t\t\t\t\t * RFC 2616 says,\n\t\t\t\t\t\t\t *\n\t\t\t\t\t\t\t * If the 301 status code is received in response to a request other\n\t\t\t\t\t\t\t * than GET or HEAD, the user agent MUST NOT automatically redirect the\n\t\t\t\t\t\t\t * request unless it can be confirmed by the user, since this might\n\t\t\t\t\t\t\t * change the conditions under which the request was issued.\n\t\t\t\t\t\t\t *\n\t\t\t\t\t\t\t * Note: When automatically redirecting a POST request after\n\t\t\t\t\t\t\t * receiving a 301 status code, some existing HTTP/1.0 user agents\n\t\t\t\t\t\t\t * will erroneously change it into a GET request.\n\t\t\t\t\t\t\t *\n\t\t\t\t\t\t\t * We're going to be one of those erroneous agents, to prevent the request from failing..\n\t\t\t\t\t\t\t */\n\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\trequestOptions.method !== 'GET' &&\n\t\t\t\t\t\t\t\trequestOptions.method !== 'HEAD' &&\n\t\t\t\t\t\t\t\t!redirectOptions.keepOriginalMethod\n\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\tnewOptions.method = 'GET';\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif (redirect(resolve, reject, url, response.headers.get('location'), newOptions)) {\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 303:\n\t\t\t\t\t\t\t/**\n\t\t\t\t\t\t\t * The response to the request can be found under a different URI and\n\t\t\t\t\t\t\t * SHOULD be retrieved using a GET method on that resource.\n\t\t\t\t\t\t\t */\n\t\t\t\t\t\t\tif (requestOptions.method !== 'GET') {\n\t\t\t\t\t\t\t\tnewOptions.method = 'GET';\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif (redirect(resolve, reject, url, response.headers.get('location'), newOptions)) {\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 304:\n\t\t\t\t\t\t\t// do nothing so this can fall through and return the response as normal. Nothing more can\n\t\t\t\t\t\t\t// be done for 304\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 305:\n\t\t\t\t\t\t\tif (!response.headers.get('location')) {\n\t\t\t\t\t\t\t\treject(new Error('expected Location header to contain a proxy url'));\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tnewOptions.proxy = response.headers.get('location') || '';\n\t\t\t\t\t\t\t\tif (redirect(resolve, reject, url, '', newOptions)) {\n\t\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 307:\n\t\t\t\t\t\t\t/**\n\t\t\t\t\t\t\t * If the 307 status code is received in response to a request other\n\t\t\t\t\t\t\t * than GET or HEAD, the user agent MUST NOT automatically redirect the\n\t\t\t\t\t\t\t * request unless it can be confirmed by the user, since this might\n\t\t\t\t\t\t\t * change the conditions under which the request was issued.\n\t\t\t\t\t\t\t */\n\t\t\t\t\t\t\tif (redirect(resolve, reject, url, response.headers.get('location'), newOptions)) {\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\treject(new Error('unhandled redirect status ' + response.status));\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\toptions.streamEncoding && message.setEncoding(options.streamEncoding);\n\n\t\t\t\tconst downloadSubscriptionPool = new SubscriptionPool();\n\t\t\t\tconst dataSubscriptionPool = new SubscriptionPool();\n\n\t\t\t\t/*\n\t\t\t [RFC 2616](https://tools.ietf.org/html/rfc2616#page-118) says that content-encoding can have multiple\n\t\t\t values, so we split them here and put them in a list to process later.\n\t\t\t */\n\t\t\t\tconst contentEncodings = response.headers.getAll('content-encoding');\n\n\t\t\t\tconst task = new Task(\n\t\t\t\t\t(resolve, reject) => {\n\t\t\t\t\t\ttimeoutReject = reject;\n\n\t\t\t\t\t\t// we queue this up for later to allow listeners to register themselves before we start receiving data\n\t\t\t\t\t\tqueueTask(() => {\n\t\t\t\t\t\t\t/*\n\t\t\t\t\t * Note that this is the raw data, if your input stream is zipped, and you are piecing\n\t\t\t\t\t * together the downloaded data, you'll have to decompress it yourself\n\t\t\t\t\t */\n\t\t\t\t\t\t\tmessage.on('data', (chunk: any) => {\n\t\t\t\t\t\t\t\tdataSubscriptionPool.next(chunk);\n\n\t\t\t\t\t\t\t\tif (response.downloadBody) {\n\t\t\t\t\t\t\t\t\tdata.buffer.push(chunk);\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tdata.size +=\n\t\t\t\t\t\t\t\t\ttypeof chunk === 'string'\n\t\t\t\t\t\t\t\t\t\t? Buffer.byteLength(chunk, options.streamEncoding)\n\t\t\t\t\t\t\t\t\t\t: chunk.length;\n\n\t\t\t\t\t\t\t\tdownloadSubscriptionPool.next(data.size);\n\t\t\t\t\t\t\t});\n\n\t\t\t\t\t\t\tmessage.once('end', () => {\n\t\t\t\t\t\t\t\ttimeoutHandle && timeoutHandle.destroy();\n\n\t\t\t\t\t\t\t\tlet dataAsBuffer = options.streamEncoding\n\t\t\t\t\t\t\t\t\t? new Buffer(data.buffer.join(''), 'utf8')\n\t\t\t\t\t\t\t\t\t: Buffer.concat(data.buffer, data.size);\n\n\t\t\t\t\t\t\t\tconst handleEncoding = function() {\n\t\t\t\t\t\t\t\t\t/*\n\t\t\t\t\t\t\t Content encoding is ordered by the order in which they were applied to the\n\t\t\t\t\t\t\t content, so do undo the encoding we have to start at the end and work backwards.\n\t\t\t\t\t\t\t */\n\t\t\t\t\t\t\t\t\tif (contentEncodings.length) {\n\t\t\t\t\t\t\t\t\t\tconst encoding = contentEncodings.pop()!.trim().toLowerCase();\n\n\t\t\t\t\t\t\t\t\t\tif (encoding === '' || encoding === 'none' || encoding === 'identity') {\n\t\t\t\t\t\t\t\t\t\t\t// do nothing, response stream is as-is\n\t\t\t\t\t\t\t\t\t\t\thandleEncoding();\n\t\t\t\t\t\t\t\t\t\t} else if (encoding === 'gzip') {\n\t\t\t\t\t\t\t\t\t\t\tzlib.gunzip(dataAsBuffer, function(err: Error | null, result: Buffer) {\n\t\t\t\t\t\t\t\t\t\t\t\tif (err) {\n\t\t\t\t\t\t\t\t\t\t\t\t\treject(err);\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t\t\tdataAsBuffer = result;\n\t\t\t\t\t\t\t\t\t\t\t\thandleEncoding();\n\t\t\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t\t\t} else if (encoding === 'deflate') {\n\t\t\t\t\t\t\t\t\t\t\tzlib.inflate(dataAsBuffer, function(err: Error | null, result: Buffer) {\n\t\t\t\t\t\t\t\t\t\t\t\tif (err) {\n\t\t\t\t\t\t\t\t\t\t\t\t\treject(err);\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t\t\tdataAsBuffer = result;\n\t\t\t\t\t\t\t\t\t\t\t\thandleEncoding();\n\t\t\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\treject(new Error('Unsupported content encoding, ' + encoding));\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\tdata.data = dataAsBuffer;\n\n\t\t\t\t\t\t\t\t\t\tresolve(message);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t};\n\n\t\t\t\t\t\t\t\thandleEncoding();\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t});\n\t\t\t\t\t},\n\t\t\t\t\t() => {\n\t\t\t\t\t\trequest.abort();\n\t\t\t\t\t}\n\t\t\t\t);\n\n\t\t\t\tconst data: RequestData = {\n\t\t\t\t\ttask,\n\t\t\t\t\tbuffer: [],\n\t\t\t\t\tdata: Buffer.alloc(0),\n\t\t\t\t\tsize: 0,\n\t\t\t\t\tused: false,\n\t\t\t\t\turl: url,\n\t\t\t\t\trequestOptions: options,\n\t\t\t\t\tnativeResponse: message,\n\t\t\t\t\tdownloadObservable: new Observable((observer) => downloadSubscriptionPool.add(observer)),\n\t\t\t\t\tdataObservable: new Observable((observer) => dataSubscriptionPool.add(observer))\n\t\t\t\t};\n\n\t\t\t\tdataMap.set(response, data);\n\n\t\t\t\tresolve(response);\n\t\t\t});\n\n\t\t\trequest.once('error', reject);\n\n\t\t\tif (options.bodyStream) {\n\t\t\t\toptions.bodyStream.pipe(request);\n\t\t\t\tlet uploadedSize = 0;\n\n\t\t\t\toptions.bodyStream.on('data', (chunk: any) => {\n\t\t\t\t\tuploadedSize += chunk.length;\n\t\t\t\t\tuploadObserverPool.next(uploadedSize);\n\t\t\t\t});\n\n\t\t\t\toptions.bodyStream.on('end', () => {\n\t\t\t\t\tuploadObserverPool.complete();\n\t\t\t\t\trequest.end();\n\t\t\t\t});\n\t\t\t} else if (options.body) {\n\t\t\t\tconst body = options.body.toString();\n\n\t\t\t\trequest.on('response', () => {\n\t\t\t\t\tuploadObserverPool.next(body.length);\n\t\t\t\t});\n\n\t\t\t\trequest.end(body);\n\t\t\t} else {\n\t\t\t\trequest.end();\n\t\t\t}\n\n\t\t\tif (options.timeout && options.timeout > 0 && options.timeout !== Infinity) {\n\t\t\t\ttimeoutHandle = createTimer(() => {\n\t\t\t\t\ttimeoutReject && timeoutReject(new TimeoutError('The request timed out'));\n\t\t\t\t}, options.timeout);\n\t\t\t}\n\t\t},\n\t\t() => {\n\t\t\trequest.abort();\n\t\t}\n\t).catch(function(error: Error): any {\n\t\tconst parsedUrl = urlUtil.parse(url);\n\n\t\tif (parsedUrl.auth) {\n\t\t\tparsedUrl.auth = '(redacted)';\n\t\t}\n\n\t\tconst sanitizedUrl = urlUtil.format(parsedUrl);\n\n\t\terror.message = '[' + requestOptions.method + ' ' + sanitizedUrl + '] ' + error.message;\n\t\tthrow error;\n\t});\n\n\trequestTask.upload = new Observable((observer) => uploadObserverPool.add(observer));\n\n\treturn requestTask;\n}\n"]} \ No newline at end of file diff --git a/deps/framework/core/request/providers/xhr.d.ts b/deps/framework/core/request/providers/xhr.d.ts deleted file mode 100644 index 4c4a9d28fd..0000000000 --- a/deps/framework/core/request/providers/xhr.d.ts +++ /dev/null @@ -1,46 +0,0 @@ -import Task from '../../async/Task'; -import Observable from '../../Observable'; -import Headers from '../Headers'; -import { RequestOptions, UploadObservableTask } from '../interfaces'; -import Response from '../Response'; -/** - * Request options specific to an XHR request - */ -export interface XhrRequestOptions extends RequestOptions { - /** - * Controls whether or not the request is synchronous (blocks the main thread) or asynchronous (default). - */ - blockMainThread?: boolean; - /** - * Controls whether or not the X-Requested-With header is added to the request (default true). Set to false to not - * include the header. - */ - includeRequestedWithHeader?: boolean; - /** - * Controls whether or not to subscribe to events on `XMLHttpRequest.upload`, if available. This causes all requests - * to be preflighted (https://xhr.spec.whatwg.org/#request) - */ - includeUploadProgress?: boolean; -} -/** - * Wraps an XHR request in a response that mimics the fetch API - */ -export declare class XhrResponse extends Response { - readonly headers: Headers; - readonly ok: boolean; - readonly status: number; - readonly statusText: string; - readonly bodyUsed: boolean; - readonly nativeResponse: XMLHttpRequest; - readonly requestOptions: XhrRequestOptions; - readonly url: string; - readonly download: Observable; - readonly data: Observable; - constructor(request: XMLHttpRequest); - arrayBuffer(): Task; - blob(): Task; - formData(): Task; - text(): Task; - xml(): Task; -} -export default function xhr(url: string, options?: XhrRequestOptions): UploadObservableTask; diff --git a/deps/framework/core/request/providers/xhr.js b/deps/framework/core/request/providers/xhr.js deleted file mode 100644 index bf376591c6..0000000000 --- a/deps/framework/core/request/providers/xhr.js +++ /dev/null @@ -1,288 +0,0 @@ -(function (factory) { - if (typeof module === "object" && typeof module.exports === "object") { - var v = factory(require, exports); - if (v !== undefined) module.exports = v; - } - else if (typeof define === "function" && define.amd) { - define(["require", "exports", "tslib", "../../../shim/global", "../../../shim/WeakMap", "../../async/Task", "../../has", "../../Observable", "../../util", "../Headers", "../Response", "../SubscriptionPool", "../TimeoutError", "../util"], factory); - } -})(function (require, exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - var tslib_1 = require("tslib"); - var global_1 = require("../../../shim/global"); - var WeakMap_1 = require("../../../shim/WeakMap"); - var Task_1 = require("../../async/Task"); - var has_1 = require("../../has"); - var Observable_1 = require("../../Observable"); - var util_1 = require("../../util"); - var Headers_1 = require("../Headers"); - var Response_1 = require("../Response"); - var SubscriptionPool_1 = require("../SubscriptionPool"); - var TimeoutError_1 = require("../TimeoutError"); - var util_2 = require("../util"); - var dataMap = new WeakMap_1.default(); - function getDataTask(response) { - var data = dataMap.get(response); - if (data.used) { - return Task_1.default.reject(new TypeError('Body already read')); - } - data.used = true; - return data.task; - } - /** - * Wraps an XHR request in a response that mimics the fetch API - */ - var XhrResponse = /** @class */ (function (_super) { - tslib_1.__extends(XhrResponse, _super); - function XhrResponse(request) { - var _this = _super.call(this) || this; - var headers = (_this.headers = new Headers_1.default()); - var responseHeaders = request.getAllResponseHeaders(); - if (responseHeaders) { - var lines = responseHeaders.split(/\r\n/g); - for (var i = 0; i < lines.length; i++) { - var match = lines[i].match(/^(.*?): (.*)$/); - if (match) { - headers.append(match[1], match[2]); - } - } - } - _this.status = request.status; - _this.ok = _this.status >= 200 && _this.status < 300; - _this.statusText = request.statusText || 'OK'; - return _this; - } - Object.defineProperty(XhrResponse.prototype, "bodyUsed", { - get: function () { - return dataMap.get(this).used; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(XhrResponse.prototype, "nativeResponse", { - get: function () { - return dataMap.get(this).nativeResponse; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(XhrResponse.prototype, "requestOptions", { - get: function () { - return dataMap.get(this).requestOptions; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(XhrResponse.prototype, "url", { - get: function () { - return dataMap.get(this).url; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(XhrResponse.prototype, "download", { - get: function () { - return dataMap.get(this).downloadObservable; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(XhrResponse.prototype, "data", { - get: function () { - return dataMap.get(this).dataObservable; - }, - enumerable: true, - configurable: true - }); - XhrResponse.prototype.arrayBuffer = function () { - return Task_1.default.reject(new Error('ArrayBuffer not supported')); - }; - XhrResponse.prototype.blob = function () { - return Task_1.default.reject(new Error('Blob not supported')); - }; - XhrResponse.prototype.formData = function () { - return Task_1.default.reject(new Error('FormData not supported')); - }; - XhrResponse.prototype.text = function () { - return getDataTask(this).then(function (request) { - return String(request.responseText); - }); - }; - XhrResponse.prototype.xml = function () { - var _this = this; - return this.text().then(function (text) { - var parser = new DOMParser(); - var contentType = _this.headers.get('content-type'); - return parser.parseFromString(text, contentType ? contentType.split(';')[0] : 'text/html'); - }); - }; - return XhrResponse; - }(Response_1.default)); - exports.XhrResponse = XhrResponse; - if (has_1.default('blob')) { - XhrResponse.prototype.blob = function () { - return getDataTask(this).then(function (request) { return request.response; }); - }; - XhrResponse.prototype.text = function () { - return this.blob().then(Response_1.getTextFromBlob); - }; - if (has_1.default('arraybuffer')) { - XhrResponse.prototype.arrayBuffer = function () { - return this.blob().then(Response_1.getArrayBufferFromBlob); - }; - } - } - if (has_1.default('formdata')) { - XhrResponse.prototype.formData = function () { - return this.text().then(function (text) { - var data = new FormData(); - text - .trim() - .split('&') - .forEach(function (keyValues) { - if (keyValues) { - var pairs = keyValues.split('='); - var name_1 = (pairs.shift() || '').replace(/\+/, ' '); - var value = pairs.join('=').replace(/\+/, ' '); - data.append(decodeURIComponent(name_1), decodeURIComponent(value)); - } - }); - return data; - }); - }; - } - function noop() { } - function setOnError(request, reject) { - request.addEventListener('error', function (event) { - reject(new TypeError(event.error || 'Network request failed')); - }); - } - function xhr(url, options) { - if (options === void 0) { options = {}; } - var request = new XMLHttpRequest(); - var requestUrl = util_2.generateRequestUrl(url, options); - options = Object.create(options); - if (!options.method) { - options.method = 'GET'; - } - var isAborted = false; - function abort() { - isAborted = true; - if (request) { - request.abort(); - request.onreadystatechange = noop; - } - } - var timeoutHandle; - var timeoutReject; - var task = new Task_1.default(function (resolve, reject) { - timeoutReject = reject; - request.onreadystatechange = function () { - if (isAborted) { - return; - } - if (request.readyState === 2) { - var response = new XhrResponse(request); - var downloadSubscriptionPool_1 = new SubscriptionPool_1.default(); - var dataSubscriptionPool_1 = new SubscriptionPool_1.default(); - var task_1 = new Task_1.default(function (resolve, reject) { - timeoutReject = reject; - request.onprogress = function (event) { - if (isAborted) { - return; - } - downloadSubscriptionPool_1.next(event.loaded); - }; - request.onreadystatechange = function () { - if (isAborted) { - return; - } - if (request.readyState === 4) { - request.onreadystatechange = noop; - timeoutHandle && timeoutHandle.destroy(); - dataSubscriptionPool_1.next(request.response); - dataSubscriptionPool_1.complete(); - resolve(request); - } - }; - setOnError(request, reject); - }, abort); - dataMap.set(response, { - task: task_1, - used: false, - nativeResponse: request, - requestOptions: options, - url: requestUrl, - downloadObservable: new Observable_1.default(function (observer) { return downloadSubscriptionPool_1.add(observer); }), - dataObservable: new Observable_1.default(function (observer) { return dataSubscriptionPool_1.add(observer); }) - }); - resolve(response); - } - }; - setOnError(request, reject); - }, abort); - request.open(options.method, requestUrl, !options.blockMainThread, options.user, options.password); - if (has_1.default('filereader') && has_1.default('blob')) { - request.responseType = 'blob'; - } - if (options.timeout && options.timeout > 0 && options.timeout !== Infinity) { - timeoutHandle = util_1.createTimer(function () { - // Reject first, since aborting will also fire onreadystatechange which would reject with a - // less specific error. (This is also why we set up our own timeout rather than using - // native timeout and ontimeout, because that aborts and fires onreadystatechange before ontimeout.) - timeoutReject && timeoutReject(new TimeoutError_1.default('The XMLHttpRequest request timed out')); - abort(); - }, options.timeout); - } - var hasContentTypeHeader = false; - var hasRequestedWithHeader = false; - var _a = options.includeRequestedWithHeader, includeRequestedWithHeader = _a === void 0 ? true : _a, _b = options.includeUploadProgress, includeUploadProgress = _b === void 0 ? true : _b; - if (options.headers) { - var requestHeaders = new Headers_1.default(options.headers); - hasRequestedWithHeader = requestHeaders.has('x-requested-with'); - hasContentTypeHeader = requestHeaders.has('content-type'); - try { - for (var requestHeaders_1 = tslib_1.__values(requestHeaders), requestHeaders_1_1 = requestHeaders_1.next(); !requestHeaders_1_1.done; requestHeaders_1_1 = requestHeaders_1.next()) { - var _c = tslib_1.__read(requestHeaders_1_1.value, 2), key = _c[0], value = _c[1]; - request.setRequestHeader(key, value); - } - } - catch (e_1_1) { e_1 = { error: e_1_1 }; } - finally { - try { - if (requestHeaders_1_1 && !requestHeaders_1_1.done && (_d = requestHeaders_1.return)) _d.call(requestHeaders_1); - } - finally { if (e_1) throw e_1.error; } - } - } - if (!hasRequestedWithHeader && includeRequestedWithHeader) { - request.setRequestHeader('X-Requested-With', 'XMLHttpRequest'); - } - if (!hasContentTypeHeader && has_1.default('formdata') && options.body instanceof global_1.default.FormData) { - // Assume that most forms do not contain large binary files. If that is not the case, - // then "multipart/form-data" should be manually specified as the "Content-Type" header. - request.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded'); - } - task.finally(function () { - if (task.state !== 0 /* Fulfilled */) { - request.onreadystatechange = noop; - timeoutHandle && timeoutHandle.destroy(); - } - }); - if (includeUploadProgress) { - var uploadObserverPool_1 = new SubscriptionPool_1.default(); - task.upload = new Observable_1.default(function (observer) { return uploadObserverPool_1.add(observer); }); - if (has_1.default('host-browser') || has_1.default('web-worker-xhr-upload')) { - request.upload.addEventListener('progress', function (event) { - uploadObserverPool_1.next(event.loaded); - }); - } - } - request.send(options.body || null); - return task; - var e_1, _d; - } - exports.default = xhr; -}); -//# sourceMappingURL=xhr.js.map \ No newline at end of file diff --git a/deps/framework/core/request/providers/xhr.js.map b/deps/framework/core/request/providers/xhr.js.map deleted file mode 100644 index 555ccde05e..0000000000 --- a/deps/framework/core/request/providers/xhr.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"xhr.js","sourceRoot":"","sources":["xhr.ts"],"names":[],"mappings":";;;;;;;;;;;;IACA,+CAA0C;IA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AC;gBACzD,OAAO,CAAC,MAAM,CAAC,gBAAgB,CAAC,UAAU,EAAE,UAAC,KAAK;oBACjD,oBAAkB,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;gBACvC,CAAC,CAAC,CAAC;YACJ,CAAC;QACF,CAAC;QAED,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,IAAI,IAAI,CAAC,CAAC;QAEnC,MAAM,CAAC,IAAI,CAAC;;IACb,CAAC;IAlJD,sBAkJC","sourcesContent":["import { Handle } from '../../interfaces';\nimport global from '../../../shim/global';\nimport WeakMap from '../../../shim/WeakMap';\nimport Task, { State } from '../../async/Task';\nimport has from '../../has';\nimport Observable from '../../Observable';\nimport { createTimer } from '../../util';\nimport Headers from '../Headers';\nimport { RequestOptions, UploadObservableTask } from '../interfaces';\nimport Response, { getArrayBufferFromBlob, getTextFromBlob } from '../Response';\nimport SubscriptionPool from '../SubscriptionPool';\nimport TimeoutError from '../TimeoutError';\nimport { generateRequestUrl } from '../util';\n\n/**\n * Request options specific to an XHR request\n */\nexport interface XhrRequestOptions extends RequestOptions {\n\t/**\n\t * Controls whether or not the request is synchronous (blocks the main thread) or asynchronous (default).\n\t */\n\tblockMainThread?: boolean;\n\t/**\n\t * Controls whether or not the X-Requested-With header is added to the request (default true). Set to false to not\n\t * include the header.\n\t */\n\tincludeRequestedWithHeader?: boolean;\n\t/**\n\t * Controls whether or not to subscribe to events on `XMLHttpRequest.upload`, if available. This causes all requests\n\t * to be preflighted (https://xhr.spec.whatwg.org/#request)\n\t */\n\tincludeUploadProgress?: boolean;\n}\n\ninterface RequestData {\n\ttask: Task;\n\tused: boolean;\n\trequestOptions: XhrRequestOptions;\n\tnativeResponse: XMLHttpRequest;\n\turl: string;\n\tdownloadObservable: Observable;\n\tdataObservable: Observable;\n}\n\nconst dataMap = new WeakMap();\n\nfunction getDataTask(response: XhrResponse): Task {\n\tconst data = dataMap.get(response)!;\n\n\tif (data.used) {\n\t\treturn Task.reject(new TypeError('Body already read'));\n\t}\n\n\tdata.used = true;\n\n\treturn data.task;\n}\n\n/**\n * Wraps an XHR request in a response that mimics the fetch API\n */\nexport class XhrResponse extends Response {\n\treadonly headers: Headers;\n\treadonly ok: boolean;\n\treadonly status: number;\n\treadonly statusText: string;\n\n\tget bodyUsed(): boolean {\n\t\treturn dataMap.get(this)!.used;\n\t}\n\n\tget nativeResponse(): XMLHttpRequest {\n\t\treturn dataMap.get(this)!.nativeResponse;\n\t}\n\n\tget requestOptions(): XhrRequestOptions {\n\t\treturn dataMap.get(this)!.requestOptions;\n\t}\n\n\tget url(): string {\n\t\treturn dataMap.get(this)!.url;\n\t}\n\n\tget download(): Observable {\n\t\treturn dataMap.get(this)!.downloadObservable;\n\t}\n\n\tget data(): Observable {\n\t\treturn dataMap.get(this)!.dataObservable;\n\t}\n\n\tconstructor(request: XMLHttpRequest) {\n\t\tsuper();\n\n\t\tconst headers = (this.headers = new Headers());\n\n\t\tconst responseHeaders = request.getAllResponseHeaders();\n\t\tif (responseHeaders) {\n\t\t\tconst lines = responseHeaders.split(/\\r\\n/g);\n\n\t\t\tfor (let i = 0; i < lines.length; i++) {\n\t\t\t\tconst match = lines[i].match(/^(.*?): (.*)$/);\n\t\t\t\tif (match) {\n\t\t\t\t\theaders.append(match[1], match[2]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tthis.status = request.status;\n\t\tthis.ok = this.status >= 200 && this.status < 300;\n\t\tthis.statusText = request.statusText || 'OK';\n\t}\n\n\tarrayBuffer(): Task {\n\t\treturn Task.reject(new Error('ArrayBuffer not supported'));\n\t}\n\n\tblob(): Task {\n\t\treturn Task.reject(new Error('Blob not supported'));\n\t}\n\n\tformData(): Task {\n\t\treturn Task.reject(new Error('FormData not supported'));\n\t}\n\n\ttext(): Task {\n\t\treturn getDataTask(this).then((request: XMLHttpRequest) => {\n\t\t\treturn String(request.responseText);\n\t\t});\n\t}\n\n\txml(): Task {\n\t\treturn this.text().then((text: string) => {\n\t\t\tconst parser = new DOMParser();\n\t\t\tconst contentType = this.headers.get('content-type');\n\t\t\treturn parser.parseFromString(text, contentType ? contentType.split(';')[0] : 'text/html');\n\t\t});\n\t}\n}\n\nif (has('blob')) {\n\tXhrResponse.prototype.blob = function(this: XhrResponse): Task {\n\t\treturn getDataTask(this).then((request: XMLHttpRequest) => request.response);\n\t};\n\n\tXhrResponse.prototype.text = function(this: XhrResponse): Task {\n\t\treturn this.blob().then(getTextFromBlob);\n\t};\n\n\tif (has('arraybuffer')) {\n\t\tXhrResponse.prototype.arrayBuffer = function(this: XhrResponse): Task {\n\t\t\treturn this.blob().then(getArrayBufferFromBlob);\n\t\t};\n\t}\n}\n\nif (has('formdata')) {\n\tXhrResponse.prototype.formData = function(this: XhrResponse): Task {\n\t\treturn this.text().then((text: string) => {\n\t\t\tconst data = new FormData();\n\n\t\t\ttext\n\t\t\t\t.trim()\n\t\t\t\t.split('&')\n\t\t\t\t.forEach((keyValues) => {\n\t\t\t\t\tif (keyValues) {\n\t\t\t\t\t\tconst pairs = keyValues.split('=');\n\t\t\t\t\t\tconst name = (pairs.shift() || '').replace(/\\+/, ' ');\n\t\t\t\t\t\tconst value = pairs.join('=').replace(/\\+/, ' ');\n\n\t\t\t\t\t\tdata.append(decodeURIComponent(name), decodeURIComponent(value));\n\t\t\t\t\t}\n\t\t\t\t});\n\n\t\t\treturn data;\n\t\t});\n\t};\n}\n\nfunction noop() {}\n\nfunction setOnError(request: XMLHttpRequest, reject: Function) {\n\trequest.addEventListener('error', function(event) {\n\t\treject(new TypeError(event.error || 'Network request failed'));\n\t});\n}\n\nexport default function xhr(url: string, options: XhrRequestOptions = {}): UploadObservableTask {\n\tconst request = new XMLHttpRequest();\n\tconst requestUrl = generateRequestUrl(url, options);\n\n\toptions = Object.create(options);\n\n\tif (!options.method) {\n\t\toptions.method = 'GET';\n\t}\n\n\tlet isAborted = false;\n\n\tfunction abort() {\n\t\tisAborted = true;\n\t\tif (request) {\n\t\t\trequest.abort();\n\t\t\trequest.onreadystatechange = noop;\n\t\t}\n\t}\n\n\tlet timeoutHandle: Handle;\n\tlet timeoutReject: Function;\n\n\tconst task = >new Task((resolve, reject) => {\n\t\ttimeoutReject = reject;\n\n\t\trequest.onreadystatechange = function() {\n\t\t\tif (isAborted) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (request.readyState === 2) {\n\t\t\t\tconst response = new XhrResponse(request);\n\n\t\t\t\tconst downloadSubscriptionPool = new SubscriptionPool();\n\t\t\t\tconst dataSubscriptionPool = new SubscriptionPool();\n\n\t\t\t\tconst task = new Task((resolve, reject) => {\n\t\t\t\t\ttimeoutReject = reject;\n\n\t\t\t\t\trequest.onprogress = function(event: any) {\n\t\t\t\t\t\tif (isAborted) {\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tdownloadSubscriptionPool.next(event.loaded);\n\t\t\t\t\t};\n\n\t\t\t\t\trequest.onreadystatechange = function() {\n\t\t\t\t\t\tif (isAborted) {\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (request.readyState === 4) {\n\t\t\t\t\t\t\trequest.onreadystatechange = noop;\n\t\t\t\t\t\t\ttimeoutHandle && timeoutHandle.destroy();\n\n\t\t\t\t\t\t\tdataSubscriptionPool.next(request.response);\n\t\t\t\t\t\t\tdataSubscriptionPool.complete();\n\n\t\t\t\t\t\t\tresolve(request);\n\t\t\t\t\t\t}\n\t\t\t\t\t};\n\n\t\t\t\t\tsetOnError(request, reject);\n\t\t\t\t}, abort);\n\n\t\t\t\tdataMap.set(response, {\n\t\t\t\t\ttask,\n\t\t\t\t\tused: false,\n\t\t\t\t\tnativeResponse: request,\n\t\t\t\t\trequestOptions: options,\n\t\t\t\t\turl: requestUrl,\n\t\t\t\t\tdownloadObservable: new Observable((observer) => downloadSubscriptionPool.add(observer)),\n\t\t\t\t\tdataObservable: new Observable((observer) => dataSubscriptionPool.add(observer))\n\t\t\t\t});\n\n\t\t\t\tresolve(response);\n\t\t\t}\n\t\t};\n\n\t\tsetOnError(request, reject);\n\t}, abort);\n\n\trequest.open(options.method, requestUrl, !options.blockMainThread, options.user, options.password);\n\n\tif (has('filereader') && has('blob')) {\n\t\trequest.responseType = 'blob';\n\t}\n\n\tif (options.timeout && options.timeout > 0 && options.timeout !== Infinity) {\n\t\ttimeoutHandle = createTimer(() => {\n\t\t\t// Reject first, since aborting will also fire onreadystatechange which would reject with a\n\t\t\t// less specific error. (This is also why we set up our own timeout rather than using\n\t\t\t// native timeout and ontimeout, because that aborts and fires onreadystatechange before ontimeout.)\n\t\t\ttimeoutReject && timeoutReject(new TimeoutError('The XMLHttpRequest request timed out'));\n\t\t\tabort();\n\t\t}, options.timeout);\n\t}\n\n\tlet hasContentTypeHeader = false;\n\tlet hasRequestedWithHeader = false;\n\tconst { includeRequestedWithHeader = true, includeUploadProgress = true } = options;\n\n\tif (options.headers) {\n\t\tconst requestHeaders = new Headers(options.headers);\n\n\t\thasRequestedWithHeader = requestHeaders.has('x-requested-with');\n\t\thasContentTypeHeader = requestHeaders.has('content-type');\n\n\t\tfor (const [key, value] of requestHeaders) {\n\t\t\trequest.setRequestHeader(key, value);\n\t\t}\n\t}\n\n\tif (!hasRequestedWithHeader && includeRequestedWithHeader) {\n\t\trequest.setRequestHeader('X-Requested-With', 'XMLHttpRequest');\n\t}\n\n\tif (!hasContentTypeHeader && has('formdata') && options.body instanceof global.FormData) {\n\t\t// Assume that most forms do not contain large binary files. If that is not the case,\n\t\t// then \"multipart/form-data\" should be manually specified as the \"Content-Type\" header.\n\t\trequest.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');\n\t}\n\n\ttask.finally(() => {\n\t\tif (task.state !== State.Fulfilled) {\n\t\t\trequest.onreadystatechange = noop;\n\t\t\ttimeoutHandle && timeoutHandle.destroy();\n\t\t}\n\t});\n\n\tif (includeUploadProgress) {\n\t\tconst uploadObserverPool = new SubscriptionPool();\n\t\ttask.upload = new Observable((observer) => uploadObserverPool.add(observer));\n\n\t\tif (has('host-browser') || has('web-worker-xhr-upload')) {\n\t\t\trequest.upload.addEventListener('progress', (event) => {\n\t\t\t\tuploadObserverPool.next(event.loaded);\n\t\t\t});\n\t\t}\n\t}\n\n\trequest.send(options.body || null);\n\n\treturn task;\n}\n"]} \ No newline at end of file diff --git a/deps/framework/core/request/providers/xhr.mjs b/deps/framework/core/request/providers/xhr.mjs deleted file mode 100644 index 4d071af4e4..0000000000 --- a/deps/framework/core/request/providers/xhr.mjs +++ /dev/null @@ -1,233 +0,0 @@ -import global from '../../../shim/global'; -import WeakMap from '../../../shim/WeakMap'; -import Task from '../../async/Task'; -import has from '../../has'; -import Observable from '../../Observable'; -import { createTimer } from '../../util'; -import Headers from '../Headers'; -import Response, { getArrayBufferFromBlob, getTextFromBlob } from '../Response'; -import SubscriptionPool from '../SubscriptionPool'; -import TimeoutError from '../TimeoutError'; -import { generateRequestUrl } from '../util'; -const dataMap = new WeakMap(); -function getDataTask(response) { - const data = dataMap.get(response); - if (data.used) { - return Task.reject(new TypeError('Body already read')); - } - data.used = true; - return data.task; -} -/** - * Wraps an XHR request in a response that mimics the fetch API - */ -export class XhrResponse extends Response { - get bodyUsed() { - return dataMap.get(this).used; - } - get nativeResponse() { - return dataMap.get(this).nativeResponse; - } - get requestOptions() { - return dataMap.get(this).requestOptions; - } - get url() { - return dataMap.get(this).url; - } - get download() { - return dataMap.get(this).downloadObservable; - } - get data() { - return dataMap.get(this).dataObservable; - } - constructor(request) { - super(); - const headers = (this.headers = new Headers()); - const responseHeaders = request.getAllResponseHeaders(); - if (responseHeaders) { - const lines = responseHeaders.split(/\r\n/g); - for (let i = 0; i < lines.length; i++) { - const match = lines[i].match(/^(.*?): (.*)$/); - if (match) { - headers.append(match[1], match[2]); - } - } - } - this.status = request.status; - this.ok = this.status >= 200 && this.status < 300; - this.statusText = request.statusText || 'OK'; - } - arrayBuffer() { - return Task.reject(new Error('ArrayBuffer not supported')); - } - blob() { - return Task.reject(new Error('Blob not supported')); - } - formData() { - return Task.reject(new Error('FormData not supported')); - } - text() { - return getDataTask(this).then((request) => { - return String(request.responseText); - }); - } - xml() { - return this.text().then((text) => { - const parser = new DOMParser(); - const contentType = this.headers.get('content-type'); - return parser.parseFromString(text, contentType ? contentType.split(';')[0] : 'text/html'); - }); - } -} -if (has('blob')) { - XhrResponse.prototype.blob = function () { - return getDataTask(this).then((request) => request.response); - }; - XhrResponse.prototype.text = function () { - return this.blob().then(getTextFromBlob); - }; - if (has('arraybuffer')) { - XhrResponse.prototype.arrayBuffer = function () { - return this.blob().then(getArrayBufferFromBlob); - }; - } -} -if (has('formdata')) { - XhrResponse.prototype.formData = function () { - return this.text().then((text) => { - const data = new FormData(); - text - .trim() - .split('&') - .forEach((keyValues) => { - if (keyValues) { - const pairs = keyValues.split('='); - const name = (pairs.shift() || '').replace(/\+/, ' '); - const value = pairs.join('=').replace(/\+/, ' '); - data.append(decodeURIComponent(name), decodeURIComponent(value)); - } - }); - return data; - }); - }; -} -function noop() { } -function setOnError(request, reject) { - request.addEventListener('error', function (event) { - reject(new TypeError(event.error || 'Network request failed')); - }); -} -export default function xhr(url, options = {}) { - const request = new XMLHttpRequest(); - const requestUrl = generateRequestUrl(url, options); - options = Object.create(options); - if (!options.method) { - options.method = 'GET'; - } - let isAborted = false; - function abort() { - isAborted = true; - if (request) { - request.abort(); - request.onreadystatechange = noop; - } - } - let timeoutHandle; - let timeoutReject; - const task = new Task((resolve, reject) => { - timeoutReject = reject; - request.onreadystatechange = function () { - if (isAborted) { - return; - } - if (request.readyState === 2) { - const response = new XhrResponse(request); - const downloadSubscriptionPool = new SubscriptionPool(); - const dataSubscriptionPool = new SubscriptionPool(); - const task = new Task((resolve, reject) => { - timeoutReject = reject; - request.onprogress = function (event) { - if (isAborted) { - return; - } - downloadSubscriptionPool.next(event.loaded); - }; - request.onreadystatechange = function () { - if (isAborted) { - return; - } - if (request.readyState === 4) { - request.onreadystatechange = noop; - timeoutHandle && timeoutHandle.destroy(); - dataSubscriptionPool.next(request.response); - dataSubscriptionPool.complete(); - resolve(request); - } - }; - setOnError(request, reject); - }, abort); - dataMap.set(response, { - task, - used: false, - nativeResponse: request, - requestOptions: options, - url: requestUrl, - downloadObservable: new Observable((observer) => downloadSubscriptionPool.add(observer)), - dataObservable: new Observable((observer) => dataSubscriptionPool.add(observer)) - }); - resolve(response); - } - }; - setOnError(request, reject); - }, abort); - request.open(options.method, requestUrl, !options.blockMainThread, options.user, options.password); - if (has('filereader') && has('blob')) { - request.responseType = 'blob'; - } - if (options.timeout && options.timeout > 0 && options.timeout !== Infinity) { - timeoutHandle = createTimer(() => { - // Reject first, since aborting will also fire onreadystatechange which would reject with a - // less specific error. (This is also why we set up our own timeout rather than using - // native timeout and ontimeout, because that aborts and fires onreadystatechange before ontimeout.) - timeoutReject && timeoutReject(new TimeoutError('The XMLHttpRequest request timed out')); - abort(); - }, options.timeout); - } - let hasContentTypeHeader = false; - let hasRequestedWithHeader = false; - const { includeRequestedWithHeader = true, includeUploadProgress = true } = options; - if (options.headers) { - const requestHeaders = new Headers(options.headers); - hasRequestedWithHeader = requestHeaders.has('x-requested-with'); - hasContentTypeHeader = requestHeaders.has('content-type'); - for (const [key, value] of requestHeaders) { - request.setRequestHeader(key, value); - } - } - if (!hasRequestedWithHeader && includeRequestedWithHeader) { - request.setRequestHeader('X-Requested-With', 'XMLHttpRequest'); - } - if (!hasContentTypeHeader && has('formdata') && options.body instanceof global.FormData) { - // Assume that most forms do not contain large binary files. If that is not the case, - // then "multipart/form-data" should be manually specified as the "Content-Type" header. - request.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded'); - } - task.finally(() => { - if (task.state !== 0 /* Fulfilled */) { - request.onreadystatechange = noop; - timeoutHandle && timeoutHandle.destroy(); - } - }); - if (includeUploadProgress) { - const uploadObserverPool = new SubscriptionPool(); - task.upload = new Observable((observer) => uploadObserverPool.add(observer)); - if (has('host-browser') || has('web-worker-xhr-upload')) { - request.upload.addEventListener('progress', (event) => { - uploadObserverPool.next(event.loaded); - }); - } - } - request.send(options.body || null); - return task; -} -//# sourceMappingURL=xhr.mjs.map \ No newline at end of file diff --git a/deps/framework/core/request/providers/xhr.mjs.map b/deps/framework/core/request/providers/xhr.mjs.map deleted file mode 100644 index 5767d8a75b..0000000000 --- a/deps/framework/core/request/providers/xhr.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"xhr.mjs","sourceRoot":"","sources":["xhr.ts"],"names":[],"mappings":"AACA,OAAO,MAAM,MAAM,sBAAsB,CAAC;AAC1C,OAAO,OAAO,MAAM,uBAAuB,CAAC;AAC5C,OAAO,IAAe,MAAM,kBAAkB,CAAC;AAC/C,OAAO,GAAG,MAAM,WAAW,CAAC;AAC5B,OAAO,UAAU,MAAM,kBAAkB,CAAC;AAC1C,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AACzC,OAAO,OAAO,MAAM,YAAY,CAAC;AAEjC,OAAO,QAAQ,EAAE,EAAE,sBAAsB,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAChF,OAAO,gBAAgB,MAAM,qBAAqB,CAAC;AACnD,OAAO,YAAY,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAgC7C,MAAM,OAAO,GAAG,IAAI,OAAO,EAA4B,CAAC;AAExD,qBAAqB,QAAqB;IACzC,MAAM,IAAI,GAAG,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAE,CAAC;IAEpC,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;QACf,MAAM,CAAC,IAAI,CAAC,MAAM,CAAM,IAAI,SAAS,CAAC,mBAAmB,CAAC,CAAC,CAAC;IAC7D,CAAC;IAED,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IAEjB,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC;AAClB,CAAC;AAED;;GAEG;AACH,MAAM,kBAAmB,SAAQ,QA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IAAI,aAAa,CAAC,OAAO,EAAE,CAAC;QAC1C,CAAC;IACF,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,CAAC,qBAAqB,CAAC,CAAC,CAAC;QAC3B,MAAM,kBAAkB,GAAG,IAAI,gBAAgB,EAAU,CAAC;QAC1D,IAAI,CAAC,MAAM,GAAG,IAAI,UAAU,CAAS,CAAC,QAAQ,EAAE,EAAE,CAAC,kBAAkB,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC;QAErF,EAAE,CAAC,CAAC,GAAG,CAAC,cAAc,CAAC,IAAI,GAAG,CAAC,uBAAuB,CAAC,CAAC,CAAC,CAAC;YACzD,OAAO,CAAC,MAAM,CAAC,gBAAgB,CAAC,UAAU,EAAE,CAAC,KAAK,EAAE,EAAE;gBACrD,kBAAkB,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;YACvC,CAAC,CAAC,CAAC;QACJ,CAAC;IACF,CAAC;IAED,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,IAAI,IAAI,CAAC,CAAC;IAEnC,MAAM,CAAC,IAAI,CAAC;AACb,CAAC","sourcesContent":["import { Handle } from '../../interfaces';\nimport global from '../../../shim/global';\nimport WeakMap from '../../../shim/WeakMap';\nimport Task, { State } from '../../async/Task';\nimport has from '../../has';\nimport Observable from '../../Observable';\nimport { createTimer } from '../../util';\nimport Headers from '../Headers';\nimport { RequestOptions, UploadObservableTask } from '../interfaces';\nimport Response, { getArrayBufferFromBlob, getTextFromBlob } from '../Response';\nimport SubscriptionPool from '../SubscriptionPool';\nimport TimeoutError from '../TimeoutError';\nimport { generateRequestUrl } from '../util';\n\n/**\n * Request options specific to an XHR request\n */\nexport interface XhrRequestOptions extends RequestOptions {\n\t/**\n\t * Controls whether or not the request is synchronous (blocks the main thread) or asynchronous (default).\n\t */\n\tblockMainThread?: boolean;\n\t/**\n\t * Controls whether or not the X-Requested-With header is added to the request (default true). Set to false to not\n\t * include the header.\n\t */\n\tincludeRequestedWithHeader?: boolean;\n\t/**\n\t * Controls whether or not to subscribe to events on `XMLHttpRequest.upload`, if available. This causes all requests\n\t * to be preflighted (https://xhr.spec.whatwg.org/#request)\n\t */\n\tincludeUploadProgress?: boolean;\n}\n\ninterface RequestData {\n\ttask: Task;\n\tused: boolean;\n\trequestOptions: XhrRequestOptions;\n\tnativeResponse: XMLHttpRequest;\n\turl: string;\n\tdownloadObservable: Observable;\n\tdataObservable: Observable;\n}\n\nconst dataMap = new WeakMap();\n\nfunction getDataTask(response: XhrResponse): Task {\n\tconst data = dataMap.get(response)!;\n\n\tif (data.used) {\n\t\treturn Task.reject(new TypeError('Body already read'));\n\t}\n\n\tdata.used = true;\n\n\treturn data.task;\n}\n\n/**\n * Wraps an XHR request in a response that mimics the fetch API\n */\nexport class XhrResponse extends Response {\n\treadonly headers: Headers;\n\treadonly ok: boolean;\n\treadonly status: number;\n\treadonly statusText: string;\n\n\tget bodyUsed(): boolean {\n\t\treturn dataMap.get(this)!.used;\n\t}\n\n\tget nativeResponse(): XMLHttpRequest {\n\t\treturn dataMap.get(this)!.nativeResponse;\n\t}\n\n\tget requestOptions(): XhrRequestOptions {\n\t\treturn dataMap.get(this)!.requestOptions;\n\t}\n\n\tget url(): string {\n\t\treturn dataMap.get(this)!.url;\n\t}\n\n\tget download(): Observable {\n\t\treturn dataMap.get(this)!.downloadObservable;\n\t}\n\n\tget data(): Observable {\n\t\treturn dataMap.get(this)!.dataObservable;\n\t}\n\n\tconstructor(request: XMLHttpRequest) {\n\t\tsuper();\n\n\t\tconst headers = (this.headers = new Headers());\n\n\t\tconst responseHeaders = request.getAllResponseHeaders();\n\t\tif (responseHeaders) {\n\t\t\tconst lines = responseHeaders.split(/\\r\\n/g);\n\n\t\t\tfor (let i = 0; i < lines.length; i++) {\n\t\t\t\tconst match = lines[i].match(/^(.*?): (.*)$/);\n\t\t\t\tif (match) {\n\t\t\t\t\theaders.append(match[1], match[2]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tthis.status = request.status;\n\t\tthis.ok = this.status >= 200 && this.status < 300;\n\t\tthis.statusText = request.statusText || 'OK';\n\t}\n\n\tarrayBuffer(): Task {\n\t\treturn Task.reject(new Error('ArrayBuffer not supported'));\n\t}\n\n\tblob(): Task {\n\t\treturn Task.reject(new Error('Blob not supported'));\n\t}\n\n\tformData(): Task {\n\t\treturn Task.reject(new Error('FormData not supported'));\n\t}\n\n\ttext(): Task {\n\t\treturn getDataTask(this).then((request: XMLHttpRequest) => {\n\t\t\treturn String(request.responseText);\n\t\t});\n\t}\n\n\txml(): Task {\n\t\treturn this.text().then((text: string) => {\n\t\t\tconst parser = new DOMParser();\n\t\t\tconst contentType = this.headers.get('content-type');\n\t\t\treturn parser.parseFromString(text, contentType ? contentType.split(';')[0] : 'text/html');\n\t\t});\n\t}\n}\n\nif (has('blob')) {\n\tXhrResponse.prototype.blob = function(this: XhrResponse): Task {\n\t\treturn getDataTask(this).then((request: XMLHttpRequest) => request.response);\n\t};\n\n\tXhrResponse.prototype.text = function(this: XhrResponse): Task {\n\t\treturn this.blob().then(getTextFromBlob);\n\t};\n\n\tif (has('arraybuffer')) {\n\t\tXhrResponse.prototype.arrayBuffer = function(this: XhrResponse): Task {\n\t\t\treturn this.blob().then(getArrayBufferFromBlob);\n\t\t};\n\t}\n}\n\nif (has('formdata')) {\n\tXhrResponse.prototype.formData = function(this: XhrResponse): Task {\n\t\treturn this.text().then((text: string) => {\n\t\t\tconst data = new FormData();\n\n\t\t\ttext\n\t\t\t\t.trim()\n\t\t\t\t.split('&')\n\t\t\t\t.forEach((keyValues) => {\n\t\t\t\t\tif (keyValues) {\n\t\t\t\t\t\tconst pairs = keyValues.split('=');\n\t\t\t\t\t\tconst name = (pairs.shift() || '').replace(/\\+/, ' ');\n\t\t\t\t\t\tconst value = pairs.join('=').replace(/\\+/, ' ');\n\n\t\t\t\t\t\tdata.append(decodeURIComponent(name), decodeURIComponent(value));\n\t\t\t\t\t}\n\t\t\t\t});\n\n\t\t\treturn data;\n\t\t});\n\t};\n}\n\nfunction noop() {}\n\nfunction setOnError(request: XMLHttpRequest, reject: Function) {\n\trequest.addEventListener('error', function(event) {\n\t\treject(new TypeError(event.error || 'Network request failed'));\n\t});\n}\n\nexport default function xhr(url: string, options: XhrRequestOptions = {}): UploadObservableTask {\n\tconst request = new XMLHttpRequest();\n\tconst requestUrl = generateRequestUrl(url, options);\n\n\toptions = Object.create(options);\n\n\tif (!options.method) {\n\t\toptions.method = 'GET';\n\t}\n\n\tlet isAborted = false;\n\n\tfunction abort() {\n\t\tisAborted = true;\n\t\tif (request) {\n\t\t\trequest.abort();\n\t\t\trequest.onreadystatechange = noop;\n\t\t}\n\t}\n\n\tlet timeoutHandle: Handle;\n\tlet timeoutReject: Function;\n\n\tconst task = >new Task((resolve, reject) => {\n\t\ttimeoutReject = reject;\n\n\t\trequest.onreadystatechange = function() {\n\t\t\tif (isAborted) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (request.readyState === 2) {\n\t\t\t\tconst response = new XhrResponse(request);\n\n\t\t\t\tconst downloadSubscriptionPool = new SubscriptionPool();\n\t\t\t\tconst dataSubscriptionPool = new SubscriptionPool();\n\n\t\t\t\tconst task = new Task((resolve, reject) => {\n\t\t\t\t\ttimeoutReject = reject;\n\n\t\t\t\t\trequest.onprogress = function(event: any) {\n\t\t\t\t\t\tif (isAborted) {\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tdownloadSubscriptionPool.next(event.loaded);\n\t\t\t\t\t};\n\n\t\t\t\t\trequest.onreadystatechange = function() {\n\t\t\t\t\t\tif (isAborted) {\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (request.readyState === 4) {\n\t\t\t\t\t\t\trequest.onreadystatechange = noop;\n\t\t\t\t\t\t\ttimeoutHandle && timeoutHandle.destroy();\n\n\t\t\t\t\t\t\tdataSubscriptionPool.next(request.response);\n\t\t\t\t\t\t\tdataSubscriptionPool.complete();\n\n\t\t\t\t\t\t\tresolve(request);\n\t\t\t\t\t\t}\n\t\t\t\t\t};\n\n\t\t\t\t\tsetOnError(request, reject);\n\t\t\t\t}, abort);\n\n\t\t\t\tdataMap.set(response, {\n\t\t\t\t\ttask,\n\t\t\t\t\tused: false,\n\t\t\t\t\tnativeResponse: request,\n\t\t\t\t\trequestOptions: options,\n\t\t\t\t\turl: requestUrl,\n\t\t\t\t\tdownloadObservable: new Observable((observer) => downloadSubscriptionPool.add(observer)),\n\t\t\t\t\tdataObservable: new Observable((observer) => dataSubscriptionPool.add(observer))\n\t\t\t\t});\n\n\t\t\t\tresolve(response);\n\t\t\t}\n\t\t};\n\n\t\tsetOnError(request, reject);\n\t}, abort);\n\n\trequest.open(options.method, requestUrl, !options.blockMainThread, options.user, options.password);\n\n\tif (has('filereader') && has('blob')) {\n\t\trequest.responseType = 'blob';\n\t}\n\n\tif (options.timeout && options.timeout > 0 && options.timeout !== Infinity) {\n\t\ttimeoutHandle = createTimer(() => {\n\t\t\t// Reject first, since aborting will also fire onreadystatechange which would reject with a\n\t\t\t// less specific error. (This is also why we set up our own timeout rather than using\n\t\t\t// native timeout and ontimeout, because that aborts and fires onreadystatechange before ontimeout.)\n\t\t\ttimeoutReject && timeoutReject(new TimeoutError('The XMLHttpRequest request timed out'));\n\t\t\tabort();\n\t\t}, options.timeout);\n\t}\n\n\tlet hasContentTypeHeader = false;\n\tlet hasRequestedWithHeader = false;\n\tconst { includeRequestedWithHeader = true, includeUploadProgress = true } = options;\n\n\tif (options.headers) {\n\t\tconst requestHeaders = new Headers(options.headers);\n\n\t\thasRequestedWithHeader = requestHeaders.has('x-requested-with');\n\t\thasContentTypeHeader = requestHeaders.has('content-type');\n\n\t\tfor (const [key, value] of requestHeaders) {\n\t\t\trequest.setRequestHeader(key, value);\n\t\t}\n\t}\n\n\tif (!hasRequestedWithHeader && includeRequestedWithHeader) {\n\t\trequest.setRequestHeader('X-Requested-With', 'XMLHttpRequest');\n\t}\n\n\tif (!hasContentTypeHeader && has('formdata') && options.body instanceof global.FormData) {\n\t\t// Assume that most forms do not contain large binary files. If that is not the case,\n\t\t// then \"multipart/form-data\" should be manually specified as the \"Content-Type\" header.\n\t\trequest.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');\n\t}\n\n\ttask.finally(() => {\n\t\tif (task.state !== State.Fulfilled) {\n\t\t\trequest.onreadystatechange = noop;\n\t\t\ttimeoutHandle && timeoutHandle.destroy();\n\t\t}\n\t});\n\n\tif (includeUploadProgress) {\n\t\tconst uploadObserverPool = new SubscriptionPool();\n\t\ttask.upload = new Observable((observer) => uploadObserverPool.add(observer));\n\n\t\tif (has('host-browser') || has('web-worker-xhr-upload')) {\n\t\t\trequest.upload.addEventListener('progress', (event) => {\n\t\t\t\tuploadObserverPool.next(event.loaded);\n\t\t\t});\n\t\t}\n\t}\n\n\trequest.send(options.body || null);\n\n\treturn task;\n}\n"]} \ No newline at end of file diff --git a/deps/framework/core/request/util.d.ts b/deps/framework/core/request/util.d.ts deleted file mode 100644 index 91be96f436..0000000000 --- a/deps/framework/core/request/util.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { RequestOptions } from './interfaces'; -/** - * Returns a URL formatted with optional query string and cache-busting segments. - * - * @param url The base URL. - * @param options The RequestOptions used to generate the query string or cacheBust. - */ -export declare function generateRequestUrl(url: string, options?: RequestOptions): string; -export declare function getStringFromFormData(formData: any): string; diff --git a/deps/framework/core/request/util.js b/deps/framework/core/request/util.js deleted file mode 100644 index 5a88c6f6df..0000000000 --- a/deps/framework/core/request/util.js +++ /dev/null @@ -1,51 +0,0 @@ -(function (factory) { - if (typeof module === "object" && typeof module.exports === "object") { - var v = factory(require, exports); - if (v !== undefined) module.exports = v; - } - else if (typeof define === "function" && define.amd) { - define(["require", "exports", "tslib", "../UrlSearchParams"], factory); - } -})(function (require, exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - var tslib_1 = require("tslib"); - var UrlSearchParams_1 = require("../UrlSearchParams"); - /** - * Returns a URL formatted with optional query string and cache-busting segments. - * - * @param url The base URL. - * @param options The RequestOptions used to generate the query string or cacheBust. - */ - function generateRequestUrl(url, options) { - if (options === void 0) { options = {}; } - var query = new UrlSearchParams_1.default(options.query).toString(); - if (options.cacheBust) { - var bustString = String(Date.now()); - query += query ? "&" + bustString : bustString; - } - var separator = url.indexOf('?') > -1 ? '&' : '?'; - return query ? "" + url + separator + query : url; - } - exports.generateRequestUrl = generateRequestUrl; - function getStringFromFormData(formData) { - var fields = []; - try { - for (var _a = tslib_1.__values(formData.keys()), _b = _a.next(); !_b.done; _b = _a.next()) { - var key = _b.value; - fields.push(encodeURIComponent(key) + '=' + encodeURIComponent(formData.get(key))); - } - } - catch (e_1_1) { e_1 = { error: e_1_1 }; } - finally { - try { - if (_b && !_b.done && (_c = _a.return)) _c.call(_a); - } - finally { if (e_1) throw e_1.error; } - } - return fields.join('&'); - var e_1, _c; - } - exports.getStringFromFormData = getStringFromFormData; -}); -//# sourceMappingURL=util.js.map \ No newline at end of file diff --git a/deps/framework/core/request/util.js.map b/deps/framework/core/request/util.js.map deleted file mode 100644 index 3b9e3b8e0f..0000000000 --- a/deps/framework/core/request/util.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"util.js","sourceRoot":"","sources":["util.ts"],"names":[],"mappings":";;;;;;;;;;;;IACA,sDAAiD;IAEjD;;;;;OAKG;IACH,4BAAmC,GAAW,EAAE,OAA4B;QAA5B,wBAAA,EAAA,YAA4B;QAC3E,IAAI,KAAK,GAAG,IAAI,yBAAe,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,QAAQ,EAAE,CAAC;QAC1D,EAAE,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC;YACvB,IAAM,UAAU,GAAG,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,CAAC;YACtC,KAAK,IAAI,KAAK,CAAC,CAAC,CAAC,MAAI,UAAY,CAAC,CAAC,CAAC,UAAU,CAAC;QAChD,CAAC;QACD,IAAM,SAAS,GAAG,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC;QACpD,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,KAAG,GAAG,GAAG,SAAS,GAAG,KAAO,CAAC,CAAC,CAAC,GAAG,CAAC;IACnD,CAAC;IARD,gDAQC;IAED,+BAAsC,QAAa;QAClD,IAAM,MAAM,GAAa,EAAE,CAAC;;YAE5B,GAAG,CAAC,CAAc,IAAA,KAAA,iBAAA,QAAQ,CAAC,IAAI,EAAE,CAAA,gBAAA;gBAA5B,IAAM,GAAG,WAAA;gBACb,MAAM,CAAC,IAAI,CAAC,kBAAkB,CAAC,GAAG,CAAC,GAAG,GAAG,GAAG,kBAAkB,CAAC,QAAQ,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;aACnF;;;;;;;;;QAED,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;;IACzB,CAAC;IARD,sDAQC","sourcesContent":["import { RequestOptions } from './interfaces';\nimport UrlSearchParams from '../UrlSearchParams';\n\n/**\n * Returns a URL formatted with optional query string and cache-busting segments.\n *\n * @param url The base URL.\n * @param options The RequestOptions used to generate the query string or cacheBust.\n */\nexport function generateRequestUrl(url: string, options: RequestOptions = {}): string {\n\tlet query = new UrlSearchParams(options.query).toString();\n\tif (options.cacheBust) {\n\t\tconst bustString = String(Date.now());\n\t\tquery += query ? `&${bustString}` : bustString;\n\t}\n\tconst separator = url.indexOf('?') > -1 ? '&' : '?';\n\treturn query ? `${url}${separator}${query}` : url;\n}\n\nexport function getStringFromFormData(formData: any): string {\n\tconst fields: string[] = [];\n\n\tfor (const key of formData.keys()) {\n\t\tfields.push(encodeURIComponent(key) + '=' + encodeURIComponent(formData.get(key)));\n\t}\n\n\treturn fields.join('&');\n}\n"]} \ No newline at end of file diff --git a/deps/framework/core/request/util.mjs b/deps/framework/core/request/util.mjs deleted file mode 100644 index 742a649920..0000000000 --- a/deps/framework/core/request/util.mjs +++ /dev/null @@ -1,24 +0,0 @@ -import UrlSearchParams from '../UrlSearchParams'; -/** - * Returns a URL formatted with optional query string and cache-busting segments. - * - * @param url The base URL. - * @param options The RequestOptions used to generate the query string or cacheBust. - */ -export function generateRequestUrl(url, options = {}) { - let query = new UrlSearchParams(options.query).toString(); - if (options.cacheBust) { - const bustString = String(Date.now()); - query += query ? `&${bustString}` : bustString; - } - const separator = url.indexOf('?') > -1 ? '&' : '?'; - return query ? `${url}${separator}${query}` : url; -} -export function getStringFromFormData(formData) { - const fields = []; - for (const key of formData.keys()) { - fields.push(encodeURIComponent(key) + '=' + encodeURIComponent(formData.get(key))); - } - return fields.join('&'); -} -//# sourceMappingURL=util.mjs.map \ No newline at end of file diff --git a/deps/framework/core/request/util.mjs.map b/deps/framework/core/request/util.mjs.map deleted file mode 100644 index 6d692eae8f..0000000000 --- a/deps/framework/core/request/util.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"util.mjs","sourceRoot":"","sources":["util.ts"],"names":[],"mappings":"AACA,OAAO,eAAe,MAAM,oBAAoB,CAAC;AAEjD;;;;;GAKG;AACH,MAAM,6BAA6B,GAAW,EAAE,UAA0B,EAAE;IAC3E,IAAI,KAAK,GAAG,IAAI,eAAe,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,QAAQ,EAAE,CAAC;IAC1D,EAAE,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC;QACvB,MAAM,UAAU,GAAG,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,CAAC;QACtC,KAAK,IAAI,KAAK,CAAC,CAAC,CAAC,IAAI,UAAU,EAAE,CAAC,CAAC,CAAC,UAAU,CAAC;IAChD,CAAC;IACD,MAAM,SAAS,GAAG,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC;IACpD,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,GAAG,GAAG,SAAS,GAAG,KAAK,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC;AACnD,CAAC;AAED,MAAM,gCAAgC,QAAa;IAClD,MAAM,MAAM,GAAa,EAAE,CAAC;IAE5B,GAAG,CAAC,CAAC,MAAM,GAAG,IAAI,QAAQ,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;QACnC,MAAM,CAAC,IAAI,CAAC,kBAAkB,CAAC,GAAG,CAAC,GAAG,GAAG,GAAG,kBAAkB,CAAC,QAAQ,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;IACpF,CAAC;IAED,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AACzB,CAAC","sourcesContent":["import { RequestOptions } from './interfaces';\nimport UrlSearchParams from '../UrlSearchParams';\n\n/**\n * Returns a URL formatted with optional query string and cache-busting segments.\n *\n * @param url The base URL.\n * @param options The RequestOptions used to generate the query string or cacheBust.\n */\nexport function generateRequestUrl(url: string, options: RequestOptions = {}): string {\n\tlet query = new UrlSearchParams(options.query).toString();\n\tif (options.cacheBust) {\n\t\tconst bustString = String(Date.now());\n\t\tquery += query ? `&${bustString}` : bustString;\n\t}\n\tconst separator = url.indexOf('?') > -1 ? '&' : '?';\n\treturn query ? `${url}${separator}${query}` : url;\n}\n\nexport function getStringFromFormData(formData: any): string {\n\tconst fields: string[] = [];\n\n\tfor (const key of formData.keys()) {\n\t\tfields.push(encodeURIComponent(key) + '=' + encodeURIComponent(formData.get(key)));\n\t}\n\n\treturn fields.join('&');\n}\n"]} \ No newline at end of file diff --git a/deps/framework/core/stringExtras.d.ts b/deps/framework/core/stringExtras.d.ts deleted file mode 100644 index fc1a7f58cb..0000000000 --- a/deps/framework/core/stringExtras.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -/** - * Escapes a string so that it can safely be passed to the RegExp constructor. - * @param text The string to be escaped - * @return The escaped string - */ -export declare function escapeRegExp(text: string): string; -/** - * Sanitizes a string to protect against tag injection. - * @param xml The string to be escaped - * @param forAttribute Whether to also escape ', ", and > in addition to < and & - * @return The escaped string - */ -export declare function escapeXml(xml: string, forAttribute?: boolean): string; diff --git a/deps/framework/core/stringExtras.js b/deps/framework/core/stringExtras.js deleted file mode 100644 index 44bd7e6ca2..0000000000 --- a/deps/framework/core/stringExtras.js +++ /dev/null @@ -1,49 +0,0 @@ -(function (factory) { - if (typeof module === "object" && typeof module.exports === "object") { - var v = factory(require, exports); - if (v !== undefined) module.exports = v; - } - else if (typeof define === "function" && define.amd) { - define(["require", "exports"], factory); - } -})(function (require, exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - var escapeRegExpPattern = /[[\]{}()|\/\\^$.*+?]/g; - var escapeXmlPattern = /[&<]/g; - var escapeXmlForPattern = /[&<>'"]/g; - var escapeXmlMap = { - '&': '&', - '<': '<', - '>': '>', - '"': '"', - "'": ''' - }; - /** - * Escapes a string so that it can safely be passed to the RegExp constructor. - * @param text The string to be escaped - * @return The escaped string - */ - function escapeRegExp(text) { - return !text ? text : text.replace(escapeRegExpPattern, '\\$&'); - } - exports.escapeRegExp = escapeRegExp; - /** - * Sanitizes a string to protect against tag injection. - * @param xml The string to be escaped - * @param forAttribute Whether to also escape ', ", and > in addition to < and & - * @return The escaped string - */ - function escapeXml(xml, forAttribute) { - if (forAttribute === void 0) { forAttribute = true; } - if (!xml) { - return xml; - } - var pattern = forAttribute ? escapeXmlForPattern : escapeXmlPattern; - return xml.replace(pattern, function (character) { - return escapeXmlMap[character]; - }); - } - exports.escapeXml = escapeXml; -}); -//# sourceMappingURL=stringExtras.js.map \ No newline at end of file diff --git a/deps/framework/core/stringExtras.js.map b/deps/framework/core/stringExtras.js.map deleted file mode 100644 index 0c0026d1b5..0000000000 --- a/deps/framework/core/stringExtras.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"stringExtras.js","sourceRoot":"","sources":["stringExtras.ts"],"names":[],"mappings":";;;;;;;;;;;IAEA,IAAM,mBAAmB,GAAG,uBAAuB,CAAC;IACpD,IAAM,gBAAgB,GAAG,OAAO,CAAC;IACjC,IAAM,mBAAmB,GAAG,UAAU,CAAC;IACvC,IAAM,YAAY,GAAiB;QAClC,GAAG,EAAE,OAAO;QACZ,GAAG,EAAE,MAAM;QACX,GAAG,EAAE,MAAM;QACX,GAAG,EAAE,QAAQ;QACb,GAAG,EAAE,OAAO;KACZ,CAAC;IAEF;;;;OAIG;IACH,sBAA6B,IAAY;QACxC,MAAM,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,mBAAmB,EAAE,MAAM,CAAC,CAAC;IACjE,CAAC;IAFD,oCAEC;IAED;;;;;OAKG;IACH,mBAA0B,GAAW,EAAE,YAA4B;QAA5B,6BAAA,EAAA,mBAA4B;QAClE,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;YACV,MAAM,CAAC,GAAG,CAAC;QACZ,CAAC;QAED,IAAM,OAAO,GAAG,YAAY,CAAC,CAAC,CAAC,mBAAmB,CAAC,CAAC,CAAC,gBAAgB,CAAC;QAEtE,MAAM,CAAC,GAAG,CAAC,OAAO,CAAC,OAAO,EAAE,UAAS,SAAiB;YACrD,MAAM,CAAC,YAAY,CAAC,SAAS,CAAC,CAAC;QAChC,CAAC,CAAC,CAAC;IACJ,CAAC;IAVD,8BAUC","sourcesContent":["import { Hash } from './interfaces';\n\nconst escapeRegExpPattern = /[[\\]{}()|\\/\\\\^$.*+?]/g;\nconst escapeXmlPattern = /[&<]/g;\nconst escapeXmlForPattern = /[&<>'\"]/g;\nconst escapeXmlMap: Hash = {\n\t'&': '&',\n\t'<': '<',\n\t'>': '>',\n\t'\"': '"',\n\t\"'\": '''\n};\n\n/**\n * Escapes a string so that it can safely be passed to the RegExp constructor.\n * @param text The string to be escaped\n * @return The escaped string\n */\nexport function escapeRegExp(text: string): string {\n\treturn !text ? text : text.replace(escapeRegExpPattern, '\\\\$&');\n}\n\n/**\n * Sanitizes a string to protect against tag injection.\n * @param xml The string to be escaped\n * @param forAttribute Whether to also escape ', \", and > in addition to < and &\n * @return The escaped string\n */\nexport function escapeXml(xml: string, forAttribute: boolean = true): string {\n\tif (!xml) {\n\t\treturn xml;\n\t}\n\n\tconst pattern = forAttribute ? escapeXmlForPattern : escapeXmlPattern;\n\n\treturn xml.replace(pattern, function(character: string): string {\n\t\treturn escapeXmlMap[character];\n\t});\n}\n"]} \ No newline at end of file diff --git a/deps/framework/core/stringExtras.mjs b/deps/framework/core/stringExtras.mjs deleted file mode 100644 index 4777a3b3d1..0000000000 --- a/deps/framework/core/stringExtras.mjs +++ /dev/null @@ -1,34 +0,0 @@ -const escapeRegExpPattern = /[[\]{}()|\/\\^$.*+?]/g; -const escapeXmlPattern = /[&<]/g; -const escapeXmlForPattern = /[&<>'"]/g; -const escapeXmlMap = { - '&': '&', - '<': '<', - '>': '>', - '"': '"', - "'": ''' -}; -/** - * Escapes a string so that it can safely be passed to the RegExp constructor. - * @param text The string to be escaped - * @return The escaped string - */ -export function escapeRegExp(text) { - return !text ? text : text.replace(escapeRegExpPattern, '\\$&'); -} -/** - * Sanitizes a string to protect against tag injection. - * @param xml The string to be escaped - * @param forAttribute Whether to also escape ', ", and > in addition to < and & - * @return The escaped string - */ -export function escapeXml(xml, forAttribute = true) { - if (!xml) { - return xml; - } - const pattern = forAttribute ? escapeXmlForPattern : escapeXmlPattern; - return xml.replace(pattern, function (character) { - return escapeXmlMap[character]; - }); -} -//# sourceMappingURL=stringExtras.mjs.map \ No newline at end of file diff --git a/deps/framework/core/stringExtras.mjs.map b/deps/framework/core/stringExtras.mjs.map deleted file mode 100644 index 846c1d03af..0000000000 --- a/deps/framework/core/stringExtras.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"stringExtras.mjs","sourceRoot":"","sources":["stringExtras.ts"],"names":[],"mappings":"AAEA,MAAM,mBAAmB,GAAG,uBAAuB,CAAC;AACpD,MAAM,gBAAgB,GAAG,OAAO,CAAC;AACjC,MAAM,mBAAmB,GAAG,UAAU,CAAC;AACvC,MAAM,YAAY,GAAiB;IAClC,GAAG,EAAE,OAAO;IACZ,GAAG,EAAE,MAAM;IACX,GAAG,EAAE,MAAM;IACX,GAAG,EAAE,QAAQ;IACb,GAAG,EAAE,OAAO;CACZ,CAAC;AAEF;;;;GAIG;AACH,MAAM,uBAAuB,IAAY;IACxC,MAAM,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,mBAAmB,EAAE,MAAM,CAAC,CAAC;AACjE,CAAC;AAED;;;;;GAKG;AACH,MAAM,oBAAoB,GAAW,EAAE,eAAwB,IAAI;IAClE,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;QACV,MAAM,CAAC,GAAG,CAAC;IACZ,CAAC;IAED,MAAM,OAAO,GAAG,YAAY,CAAC,CAAC,CAAC,mBAAmB,CAAC,CAAC,CAAC,gBAAgB,CAAC;IAEtE,MAAM,CAAC,GAAG,CAAC,OAAO,CAAC,OAAO,EAAE,UAAS,SAAiB;QACrD,MAAM,CAAC,YAAY,CAAC,SAAS,CAAC,CAAC;IAChC,CAAC,CAAC,CAAC;AACJ,CAAC","sourcesContent":["import { Hash } from './interfaces';\n\nconst escapeRegExpPattern = /[[\\]{}()|\\/\\\\^$.*+?]/g;\nconst escapeXmlPattern = /[&<]/g;\nconst escapeXmlForPattern = /[&<>'\"]/g;\nconst escapeXmlMap: Hash = {\n\t'&': '&',\n\t'<': '<',\n\t'>': '>',\n\t'\"': '"',\n\t\"'\": '''\n};\n\n/**\n * Escapes a string so that it can safely be passed to the RegExp constructor.\n * @param text The string to be escaped\n * @return The escaped string\n */\nexport function escapeRegExp(text: string): string {\n\treturn !text ? text : text.replace(escapeRegExpPattern, '\\\\$&');\n}\n\n/**\n * Sanitizes a string to protect against tag injection.\n * @param xml The string to be escaped\n * @param forAttribute Whether to also escape ', \", and > in addition to < and &\n * @return The escaped string\n */\nexport function escapeXml(xml: string, forAttribute: boolean = true): string {\n\tif (!xml) {\n\t\treturn xml;\n\t}\n\n\tconst pattern = forAttribute ? escapeXmlForPattern : escapeXmlPattern;\n\n\treturn xml.replace(pattern, function(character: string): string {\n\t\treturn escapeXmlMap[character];\n\t});\n}\n"]} \ No newline at end of file diff --git a/deps/framework/core/text.d.ts b/deps/framework/core/text.d.ts deleted file mode 100644 index 05999a7557..0000000000 --- a/deps/framework/core/text.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import { AmdRequire, AmdConfig } from './interfaces'; -export declare function get(url: string): Promise; -export declare function normalize(id: string, toAbsMid: (moduleId: string) => string): string; -export declare function load(id: string, require: AmdRequire, load: (value?: any) => void, config?: AmdConfig): void; diff --git a/deps/framework/core/text.js b/deps/framework/core/text.js deleted file mode 100644 index 11bc90b09f..0000000000 --- a/deps/framework/core/text.js +++ /dev/null @@ -1,118 +0,0 @@ -(function (factory) { - if (typeof module === "object" && typeof module.exports === "object") { - var v = factory(require, exports); - if (v !== undefined) module.exports = v; - } - else if (typeof define === "function" && define.amd) { - define(["require", "exports", "../shim/Promise", "./has", "./request", "./load"], factory); - } -})(function (require, exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - var Promise_1 = require("../shim/Promise"); - var has_1 = require("./has"); - var request_1 = require("./request"); - var load_1 = require("./load"); - /* - * Strips declarations so that external SVG and XML - * documents can be added to a document without worry. Also, if the string - * is an HTML document, only the part inside the body tag is returned. - */ - function strip(text) { - if (!text) { - return ''; - } - text = text.replace(/^\s*<\?xml(\s)+version=[\'\"](\d)*.(\d)*[\'\"](\s)*\?>/im, ''); - var matches = text.match(/]*>\s*([\s\S]+)\s*<\/body>/im); - text = matches ? matches[1] : text; - return text; - } - /* - * Host-specific method to retrieve text - */ - var getText; - if (has_1.default('host-browser')) { - getText = function (url, callback) { - request_1.default(url).then(function (response) { - response.text().then(function (data) { - callback(data); - }); - }); - }; - } - else if (has_1.default('host-node')) { - var fs_1 = load_1.isAmdRequire(require) && require.nodeRequire ? require.nodeRequire('fs') : require('fs'); - getText = function (url, callback) { - fs_1.readFile(url, { encoding: 'utf8' }, function (error, data) { - if (error) { - throw error; - } - callback(data); - }); - }; - } - else { - getText = function () { - throw new Error('dojo/text not supported on this platform'); - }; - } - /* - * Cache of previously-loaded text resources - */ - var textCache = {}; - /* - * Cache of pending text resources - */ - var pending = {}; - function get(url) { - var promise = new Promise_1.default(function (resolve, reject) { - getText(url, function (text) { - resolve(text); - }); - }); - return promise; - } - exports.get = get; - function normalize(id, toAbsMid) { - var parts = id.split('!'); - var url = parts[0]; - return (/^\./.test(url) ? toAbsMid(url) : url) + (parts[1] ? '!' + parts[1] : ''); - } - exports.normalize = normalize; - function load(id, require, load, config) { - var parts = id.split('!'); - var stripFlag = parts.length > 1; - var mid = parts[0]; - var url = require.toUrl(mid); - var text; - function finish(text) { - load(stripFlag ? strip(text) : text); - } - if (mid in textCache) { - text = textCache[mid]; - } - else if (url in textCache) { - text = textCache[url]; - } - if (!text) { - if (pending[url]) { - pending[url].push(finish); - } - else { - var pendingList_1 = (pending[url] = [finish]); - getText(url, function (value) { - textCache[mid] = textCache[url] = value; - for (var i = 0; i < pendingList_1.length;) { - pendingList_1[i++](value || ''); - } - delete pending[url]; - }); - } - } - else { - finish(text); - } - } - exports.load = load; -}); -//# sourceMappingURL=text.js.map \ No newline at end of file diff --git a/deps/framework/core/text.js.map b/deps/framework/core/text.js.map deleted file mode 100644 index 97f1164a9e..0000000000 --- a/deps/framework/core/text.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"text.js","sourceRoot":"","sources":["text.ts"],"names":[],"mappings":";;;;;;;;;;;IAAA,2CAAsC;IACtC,6BAAwB;IACxB,qC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AAC,GAAG,CAAC,CAAC;gBACrB,CAAC,CAAC,CAAC;YACJ,CAAC;QACF,CAAC;QAAC,IAAI,CAAC,CAAC;YACP,MAAM,CAAC,IAAI,CAAC,CAAC;QACd,CAAC;IACF,CAAC;IAjCD,oBAiCC","sourcesContent":["import Promise from '../shim/Promise';\nimport has from './has';\nimport request from './request';\nimport { NodeRequire, AmdRequire, AmdConfig } from './interfaces';\nimport { Require, isAmdRequire } from './load';\n\ndeclare const require: Require;\n\n/*\n * Strips declarations so that external SVG and XML\n * documents can be added to a document without worry. Also, if the string\n * is an HTML document, only the part inside the body tag is returned.\n */\nfunction strip(text: string): string {\n\tif (!text) {\n\t\treturn '';\n\t}\n\n\ttext = text.replace(/^\\s*<\\?xml(\\s)+version=[\\'\\\"](\\d)*.(\\d)*[\\'\\\"](\\s)*\\?>/im, '');\n\tlet matches = text.match(/]*>\\s*([\\s\\S]+)\\s*<\\/body>/im);\n\ttext = matches ? matches[1] : text;\n\n\treturn text;\n}\n\n/*\n * Host-specific method to retrieve text\n */\nlet getText: (url: string, callback: (value: string | null) => void) => void;\n\nif (has('host-browser')) {\n\tgetText = function(url: string, callback: (value: string | null) => void): void {\n\t\trequest(url).then((response) => {\n\t\t\tresponse.text().then((data) => {\n\t\t\t\tcallback(data);\n\t\t\t});\n\t\t});\n\t};\n} else if (has('host-node')) {\n\tlet fs = isAmdRequire(require) && require.nodeRequire ? require.nodeRequire('fs') : (require)('fs');\n\tgetText = function(url: string, callback: (value: string) => void): void {\n\t\tfs.readFile(url, { encoding: 'utf8' }, function(error: Error, data: string): void {\n\t\t\tif (error) {\n\t\t\t\tthrow error;\n\t\t\t}\n\n\t\t\tcallback(data);\n\t\t});\n\t};\n} else {\n\tgetText = function(): void {\n\t\tthrow new Error('dojo/text not supported on this platform');\n\t};\n}\n\n/*\n * Cache of previously-loaded text resources\n */\nlet textCache: { [key: string]: any } = {};\n\n/*\n * Cache of pending text resources\n */\nlet pending: { [key: string]: any } = {};\n\nexport function get(url: string): Promise {\n\tlet promise = new Promise(function(resolve, reject) {\n\t\tgetText(url, function(text) {\n\t\t\tresolve(text);\n\t\t});\n\t});\n\n\treturn promise;\n}\n\nexport function normalize(id: string, toAbsMid: (moduleId: string) => string): string {\n\tlet parts = id.split('!');\n\tlet url = parts[0];\n\n\treturn (/^\\./.test(url) ? toAbsMid(url) : url) + (parts[1] ? '!' + parts[1] : '');\n}\n\nexport function load(id: string, require: AmdRequire, load: (value?: any) => void, config?: AmdConfig): void {\n\tlet parts = id.split('!');\n\tlet stripFlag = parts.length > 1;\n\tlet mid = parts[0];\n\tlet url = require.toUrl(mid);\n\tlet text: string | undefined;\n\n\tfunction finish(text: string): void {\n\t\tload(stripFlag ? strip(text) : text);\n\t}\n\n\tif (mid in textCache) {\n\t\ttext = textCache[mid];\n\t} else if (url in textCache) {\n\t\ttext = textCache[url];\n\t}\n\n\tif (!text) {\n\t\tif (pending[url]) {\n\t\t\tpending[url].push(finish);\n\t\t} else {\n\t\t\tlet pendingList = (pending[url] = [finish]);\n\t\t\tgetText(url, function(value) {\n\t\t\t\ttextCache[mid] = textCache[url] = value;\n\t\t\t\tfor (let i = 0; i < pendingList.length; ) {\n\t\t\t\t\tpendingList[i++](value || '');\n\t\t\t\t}\n\t\t\t\tdelete pending[url];\n\t\t\t});\n\t\t}\n\t} else {\n\t\tfinish(text);\n\t}\n}\n"]} \ No newline at end of file diff --git a/deps/framework/core/text.mjs b/deps/framework/core/text.mjs deleted file mode 100644 index 8c5166ac74..0000000000 --- a/deps/framework/core/text.mjs +++ /dev/null @@ -1,103 +0,0 @@ -import Promise from '../shim/Promise'; -import has from './has'; -import request from './request'; -import { isAmdRequire } from './load'; -/* - * Strips declarations so that external SVG and XML - * documents can be added to a document without worry. Also, if the string - * is an HTML document, only the part inside the body tag is returned. - */ -function strip(text) { - if (!text) { - return ''; - } - text = text.replace(/^\s*<\?xml(\s)+version=[\'\"](\d)*.(\d)*[\'\"](\s)*\?>/im, ''); - let matches = text.match(/]*>\s*([\s\S]+)\s*<\/body>/im); - text = matches ? matches[1] : text; - return text; -} -/* - * Host-specific method to retrieve text - */ -let getText; -if (has('host-browser')) { - getText = function (url, callback) { - request(url).then((response) => { - response.text().then((data) => { - callback(data); - }); - }); - }; -} -else if (has('host-node')) { - let fs = isAmdRequire(require) && require.nodeRequire ? require.nodeRequire('fs') : require('fs'); - getText = function (url, callback) { - fs.readFile(url, { encoding: 'utf8' }, function (error, data) { - if (error) { - throw error; - } - callback(data); - }); - }; -} -else { - getText = function () { - throw new Error('dojo/text not supported on this platform'); - }; -} -/* - * Cache of previously-loaded text resources - */ -let textCache = {}; -/* - * Cache of pending text resources - */ -let pending = {}; -export function get(url) { - let promise = new Promise(function (resolve, reject) { - getText(url, function (text) { - resolve(text); - }); - }); - return promise; -} -export function normalize(id, toAbsMid) { - let parts = id.split('!'); - let url = parts[0]; - return (/^\./.test(url) ? toAbsMid(url) : url) + (parts[1] ? '!' + parts[1] : ''); -} -export function load(id, require, load, config) { - let parts = id.split('!'); - let stripFlag = parts.length > 1; - let mid = parts[0]; - let url = require.toUrl(mid); - let text; - function finish(text) { - load(stripFlag ? strip(text) : text); - } - if (mid in textCache) { - text = textCache[mid]; - } - else if (url in textCache) { - text = textCache[url]; - } - if (!text) { - if (pending[url]) { - pending[url].push(finish); - } - else { - let pendingList = (pending[url] = [finish]); - getText(url, function (value) { - textCache[mid] = textCache[url] = value; - for (let i = 0; i < pendingList.length;) { - pendingList[i++](value || ''); - } - delete pending[url]; - }); - } - } - else { - finish(text); - } -} -//# sourceMappingURL=text.mjs.map \ No newline at end of file diff --git a/deps/framework/core/text.mjs.map b/deps/framework/core/text.mjs.map deleted file mode 100644 index ba825e4713..0000000000 --- a/deps/framework/core/text.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"text.mjs","sourceRoot":"","sources":["text.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,iBAAiB,CAAC;AACtC,OAAO,GAAG,MAAM,OAAO,CA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,CAAC,KAAK,IAAI,EAAE,CAAC,CAAC;gBAC/B,CAAC;gBACD,OAAO,OAAO,CAAC,GAAG,CAAC,CAAC;YACrB,CAAC,CAAC,CAAC;QACJ,CAAC;IACF,CAAC;IAAC,IAAI,CAAC,CAAC;QACP,MAAM,CAAC,IAAI,CAAC,CAAC;IACd,CAAC;AACF,CAAC","sourcesContent":["import Promise from '../shim/Promise';\nimport has from './has';\nimport request from './request';\nimport { NodeRequire, AmdRequire, AmdConfig } from './interfaces';\nimport { Require, isAmdRequire } from './load';\n\ndeclare const require: Require;\n\n/*\n * Strips declarations so that external SVG and XML\n * documents can be added to a document without worry. Also, if the string\n * is an HTML document, only the part inside the body tag is returned.\n */\nfunction strip(text: string): string {\n\tif (!text) {\n\t\treturn '';\n\t}\n\n\ttext = text.replace(/^\\s*<\\?xml(\\s)+version=[\\'\\\"](\\d)*.(\\d)*[\\'\\\"](\\s)*\\?>/im, '');\n\tlet matches = text.match(/]*>\\s*([\\s\\S]+)\\s*<\\/body>/im);\n\ttext = matches ? matches[1] : text;\n\n\treturn text;\n}\n\n/*\n * Host-specific method to retrieve text\n */\nlet getText: (url: string, callback: (value: string | null) => void) => void;\n\nif (has('host-browser')) {\n\tgetText = function(url: string, callback: (value: string | null) => void): void {\n\t\trequest(url).then((response) => {\n\t\t\tresponse.text().then((data) => {\n\t\t\t\tcallback(data);\n\t\t\t});\n\t\t});\n\t};\n} else if (has('host-node')) {\n\tlet fs = isAmdRequire(require) && require.nodeRequire ? require.nodeRequire('fs') : (require)('fs');\n\tgetText = function(url: string, callback: (value: string) => void): void {\n\t\tfs.readFile(url, { encoding: 'utf8' }, function(error: Error, data: string): void {\n\t\t\tif (error) {\n\t\t\t\tthrow error;\n\t\t\t}\n\n\t\t\tcallback(data);\n\t\t});\n\t};\n} else {\n\tgetText = function(): void {\n\t\tthrow new Error('dojo/text not supported on this platform');\n\t};\n}\n\n/*\n * Cache of previously-loaded text resources\n */\nlet textCache: { [key: string]: any } = {};\n\n/*\n * Cache of pending text resources\n */\nlet pending: { [key: string]: any } = {};\n\nexport function get(url: string): Promise {\n\tlet promise = new Promise(function(resolve, reject) {\n\t\tgetText(url, function(text) {\n\t\t\tresolve(text);\n\t\t});\n\t});\n\n\treturn promise;\n}\n\nexport function normalize(id: string, toAbsMid: (moduleId: string) => string): string {\n\tlet parts = id.split('!');\n\tlet url = parts[0];\n\n\treturn (/^\\./.test(url) ? toAbsMid(url) : url) + (parts[1] ? '!' + parts[1] : '');\n}\n\nexport function load(id: string, require: AmdRequire, load: (value?: any) => void, config?: AmdConfig): void {\n\tlet parts = id.split('!');\n\tlet stripFlag = parts.length > 1;\n\tlet mid = parts[0];\n\tlet url = require.toUrl(mid);\n\tlet text: string | undefined;\n\n\tfunction finish(text: string): void {\n\t\tload(stripFlag ? strip(text) : text);\n\t}\n\n\tif (mid in textCache) {\n\t\ttext = textCache[mid];\n\t} else if (url in textCache) {\n\t\ttext = textCache[url];\n\t}\n\n\tif (!text) {\n\t\tif (pending[url]) {\n\t\t\tpending[url].push(finish);\n\t\t} else {\n\t\t\tlet pendingList = (pending[url] = [finish]);\n\t\t\tgetText(url, function(value) {\n\t\t\t\ttextCache[mid] = textCache[url] = value;\n\t\t\t\tfor (let i = 0; i < pendingList.length; ) {\n\t\t\t\t\tpendingList[i++](value || '');\n\t\t\t\t}\n\t\t\t\tdelete pending[url];\n\t\t\t});\n\t\t}\n\t} else {\n\t\tfinish(text);\n\t}\n}\n"]} \ No newline at end of file diff --git a/deps/framework/core/util.d.ts b/deps/framework/core/util.d.ts deleted file mode 100644 index cb295dc525..0000000000 --- a/deps/framework/core/util.d.ts +++ /dev/null @@ -1,35 +0,0 @@ -import { Handle } from './interfaces'; -/** - * Wraps a setTimeout call in a handle, allowing the timeout to be cleared by calling destroy. - * - * @param callback Callback to be called when the timeout elapses - * @param delay Number of milliseconds to wait before calling the callback - * @return Handle which can be destroyed to clear the timeout - */ -export declare function createTimer(callback: (...args: any[]) => void, delay?: number): Handle; -/** - * Wraps a callback, returning a function which fires after no further calls are received over a set interval. - * - * @param callback Callback to wrap - * @param delay Number of milliseconds to wait after any invocations before calling the original callback - * @return Debounced function - */ -export declare function debounce void>(callback: T, delay: number): T; -/** - * Wraps a callback, returning a function which fires at most once per set interval. - * - * @param callback Callback to wrap - * @param delay Number of milliseconds to wait before allowing the original callback to be called again - * @return Throttled function - */ -export declare function throttle void>(callback: T, delay: number): T; -/** - * Like throttle, but calls the callback at the end of each interval rather than the beginning. - * Useful for e.g. resize or scroll events, when debounce would appear unresponsive. - * - * @param callback Callback to wrap - * @param delay Number of milliseconds to wait before calling the original callback and allowing it to be called again - * @return Throttled function - */ -export declare function throttleAfter void>(callback: T, delay: number): T; -export declare function guaranteeMinimumTimeout(callback: (...args: any[]) => void, delay?: number): Handle; diff --git a/deps/framework/core/util.js b/deps/framework/core/util.js deleted file mode 100644 index 89229a63a3..0000000000 --- a/deps/framework/core/util.js +++ /dev/null @@ -1,123 +0,0 @@ -(function (factory) { - if (typeof module === "object" && typeof module.exports === "object") { - var v = factory(require, exports); - if (v !== undefined) module.exports = v; - } - else if (typeof define === "function" && define.amd) { - define(["require", "exports", "./lang"], factory); - } -})(function (require, exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - var lang_1 = require("./lang"); - /** - * Wraps a setTimeout call in a handle, allowing the timeout to be cleared by calling destroy. - * - * @param callback Callback to be called when the timeout elapses - * @param delay Number of milliseconds to wait before calling the callback - * @return Handle which can be destroyed to clear the timeout - */ - function createTimer(callback, delay) { - var timerId = setTimeout(callback, delay); - return lang_1.createHandle(function () { - if (timerId) { - clearTimeout(timerId); - timerId = null; - } - }); - } - exports.createTimer = createTimer; - /** - * Wraps a callback, returning a function which fires after no further calls are received over a set interval. - * - * @param callback Callback to wrap - * @param delay Number of milliseconds to wait after any invocations before calling the original callback - * @return Debounced function - */ - function debounce(callback, delay) { - // node.d.ts clobbers setTimeout/clearTimeout with versions that return/receive NodeJS.Timer, - // but browsers return/receive a number - var timer; - return function () { - timer && timer.destroy(); - var context = this; - var args = arguments; - timer = guaranteeMinimumTimeout(function () { - callback.apply(context, args); - args = context = timer = null; - }, delay); - }; - } - exports.debounce = debounce; - /** - * Wraps a callback, returning a function which fires at most once per set interval. - * - * @param callback Callback to wrap - * @param delay Number of milliseconds to wait before allowing the original callback to be called again - * @return Throttled function - */ - function throttle(callback, delay) { - var ran; - return function () { - if (ran) { - return; - } - ran = true; - callback.apply(this, arguments); - guaranteeMinimumTimeout(function () { - ran = null; - }, delay); - }; - } - exports.throttle = throttle; - /** - * Like throttle, but calls the callback at the end of each interval rather than the beginning. - * Useful for e.g. resize or scroll events, when debounce would appear unresponsive. - * - * @param callback Callback to wrap - * @param delay Number of milliseconds to wait before calling the original callback and allowing it to be called again - * @return Throttled function - */ - function throttleAfter(callback, delay) { - var ran; - return function () { - if (ran) { - return; - } - ran = true; - var context = this; - var args = arguments; - guaranteeMinimumTimeout(function () { - callback.apply(context, args); - args = context = ran = null; - }, delay); - }; - } - exports.throttleAfter = throttleAfter; - function guaranteeMinimumTimeout(callback, delay) { - var startTime = Date.now(); - var timerId; - function timeoutHandler() { - var delta = Date.now() - startTime; - if (delay == null || delta >= delay) { - callback(); - } - else { - // Cast setTimeout return value to fix TypeScript parsing bug. Without it, - // it thinks we are using the Node version of setTimeout. - // Revisit this with the next TypeScript update. - // Set another timer for the mount of time that we came up short. - timerId = setTimeout(timeoutHandler, delay - delta); - } - } - timerId = setTimeout(timeoutHandler, delay); - return lang_1.createHandle(function () { - if (timerId != null) { - clearTimeout(timerId); - timerId = null; - } - }); - } - exports.guaranteeMinimumTimeout = guaranteeMinimumTimeout; -}); -//# sourceMappingURL=util.js.map \ No newline at end of file diff --git a/deps/framework/core/util.js.map b/deps/framework/core/util.js.map deleted file mode 100644 index c476b34069..0000000000 --- a/deps/framework/core/util.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"util.js","sourceRoot":"","sources":["util.ts"],"names":[],"mappings":";;;;;;;;;;;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DAuBC","sourcesContent":["import { Handle } from './interfaces';\nimport { createHandle } from './lang';\n\n/**\n * Wraps a setTimeout call in a handle, allowing the timeout to be cleared by calling destroy.\n *\n * @param callback Callback to be called when the timeout elapses\n * @param delay Number of milliseconds to wait before calling the callback\n * @return Handle which can be destroyed to clear the timeout\n */\nexport function createTimer(callback: (...args: any[]) => void, delay?: number): Handle {\n\tlet timerId: number | null = setTimeout(callback, delay);\n\n\treturn createHandle(function() {\n\t\tif (timerId) {\n\t\t\tclearTimeout(timerId);\n\t\t\ttimerId = null;\n\t\t}\n\t});\n}\n\n/**\n * Wraps a callback, returning a function which fires after no further calls are received over a set interval.\n *\n * @param callback Callback to wrap\n * @param delay Number of milliseconds to wait after any invocations before calling the original callback\n * @return Debounced function\n */\nexport function debounce void>(callback: T, delay: number): T {\n\t// node.d.ts clobbers setTimeout/clearTimeout with versions that return/receive NodeJS.Timer,\n\t// but browsers return/receive a number\n\tlet timer: Handle | null;\n\n\treturn function() {\n\t\ttimer && timer.destroy();\n\n\t\tlet context = this;\n\t\tlet args: IArguments | null = arguments;\n\n\t\ttimer = guaranteeMinimumTimeout(function() {\n\t\t\tcallback.apply(context, args);\n\t\t\targs = context = timer = null;\n\t\t}, delay);\n\t};\n}\n\n/**\n * Wraps a callback, returning a function which fires at most once per set interval.\n *\n * @param callback Callback to wrap\n * @param delay Number of milliseconds to wait before allowing the original callback to be called again\n * @return Throttled function\n */\nexport function throttle void>(callback: T, delay: number): T {\n\tlet ran: boolean | null;\n\n\treturn function() {\n\t\tif (ran) {\n\t\t\treturn;\n\t\t}\n\n\t\tran = true;\n\n\t\tcallback.apply(this, arguments);\n\t\tguaranteeMinimumTimeout(function() {\n\t\t\tran = null;\n\t\t}, delay);\n\t};\n}\n\n/**\n * Like throttle, but calls the callback at the end of each interval rather than the beginning.\n * Useful for e.g. resize or scroll events, when debounce would appear unresponsive.\n *\n * @param callback Callback to wrap\n * @param delay Number of milliseconds to wait before calling the original callback and allowing it to be called again\n * @return Throttled function\n */\nexport function throttleAfter void>(callback: T, delay: number): T {\n\tlet ran: boolean | null;\n\n\treturn function() {\n\t\tif (ran) {\n\t\t\treturn;\n\t\t}\n\n\t\tran = true;\n\n\t\tlet context = this;\n\t\tlet args: IArguments | null = arguments;\n\n\t\tguaranteeMinimumTimeout(function() {\n\t\t\tcallback.apply(context, args);\n\t\t\targs = context = ran = null;\n\t\t}, delay);\n\t};\n}\n\nexport function guaranteeMinimumTimeout(callback: (...args: any[]) => void, delay?: number): Handle {\n\tconst startTime = Date.now();\n\tlet timerId: number | null;\n\n\tfunction timeoutHandler() {\n\t\tconst delta = Date.now() - startTime;\n\t\tif (delay == null || delta >= delay) {\n\t\t\tcallback();\n\t\t} else {\n\t\t\t// Cast setTimeout return value to fix TypeScript parsing bug. Without it,\n\t\t\t// it thinks we are using the Node version of setTimeout.\n\t\t\t// Revisit this with the next TypeScript update.\n\t\t\t// Set another timer for the mount of time that we came up short.\n\t\t\ttimerId = setTimeout(timeoutHandler, delay - delta);\n\t\t}\n\t}\n\ttimerId = setTimeout(timeoutHandler, delay);\n\treturn createHandle(() => {\n\t\tif (timerId != null) {\n\t\t\tclearTimeout(timerId);\n\t\t\ttimerId = null;\n\t\t}\n\t});\n}\n"]} \ No newline at end of file diff --git a/deps/framework/core/util.mjs b/deps/framework/core/util.mjs deleted file mode 100644 index 045272b042..0000000000 --- a/deps/framework/core/util.mjs +++ /dev/null @@ -1,106 +0,0 @@ -import { createHandle } from './lang'; -/** - * Wraps a setTimeout call in a handle, allowing the timeout to be cleared by calling destroy. - * - * @param callback Callback to be called when the timeout elapses - * @param delay Number of milliseconds to wait before calling the callback - * @return Handle which can be destroyed to clear the timeout - */ -export function createTimer(callback, delay) { - let timerId = setTimeout(callback, delay); - return createHandle(function () { - if (timerId) { - clearTimeout(timerId); - timerId = null; - } - }); -} -/** - * Wraps a callback, returning a function which fires after no further calls are received over a set interval. - * - * @param callback Callback to wrap - * @param delay Number of milliseconds to wait after any invocations before calling the original callback - * @return Debounced function - */ -export function debounce(callback, delay) { - // node.d.ts clobbers setTimeout/clearTimeout with versions that return/receive NodeJS.Timer, - // but browsers return/receive a number - let timer; - return function () { - timer && timer.destroy(); - let context = this; - let args = arguments; - timer = guaranteeMinimumTimeout(function () { - callback.apply(context, args); - args = context = timer = null; - }, delay); - }; -} -/** - * Wraps a callback, returning a function which fires at most once per set interval. - * - * @param callback Callback to wrap - * @param delay Number of milliseconds to wait before allowing the original callback to be called again - * @return Throttled function - */ -export function throttle(callback, delay) { - let ran; - return function () { - if (ran) { - return; - } - ran = true; - callback.apply(this, arguments); - guaranteeMinimumTimeout(function () { - ran = null; - }, delay); - }; -} -/** - * Like throttle, but calls the callback at the end of each interval rather than the beginning. - * Useful for e.g. resize or scroll events, when debounce would appear unresponsive. - * - * @param callback Callback to wrap - * @param delay Number of milliseconds to wait before calling the original callback and allowing it to be called again - * @return Throttled function - */ -export function throttleAfter(callback, delay) { - let ran; - return function () { - if (ran) { - return; - } - ran = true; - let context = this; - let args = arguments; - guaranteeMinimumTimeout(function () { - callback.apply(context, args); - args = context = ran = null; - }, delay); - }; -} -export function guaranteeMinimumTimeout(callback, delay) { - const startTime = Date.now(); - let timerId; - function timeoutHandler() { - const delta = Date.now() - startTime; - if (delay == null || delta >= delay) { - callback(); - } - else { - // Cast setTimeout return value to fix TypeScript parsing bug. Without it, - // it thinks we are using the Node version of setTimeout. - // Revisit this with the next TypeScript update. - // Set another timer for the mount of time that we came up short. - timerId = setTimeout(timeoutHandler, delay - delta); - } - } - timerId = setTimeout(timeoutHandler, delay); - return createHandle(() => { - if (timerId != null) { - clearTimeout(timerId); - timerId = null; - } - }); -} -//# sourceMappingURL=util.mjs.map \ No newline at end of file diff --git a/deps/framework/core/util.mjs.map b/deps/framework/core/util.mjs.map deleted file mode 100644 index e1c4c978b0..0000000000 --- a/deps/framework/core/util.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"util.mjs","sourceRoot":"","sources":["util.ts"],"names":[],"mapp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ent":["import { Handle } from './interfaces';\nimport { createHandle } from './lang';\n\n/**\n * Wraps a setTimeout call in a handle, allowing the timeout to be cleared by calling destroy.\n *\n * @param callback Callback to be called when the timeout elapses\n * @param delay Number of milliseconds to wait before calling the callback\n * @return Handle which can be destroyed to clear the timeout\n */\nexport function createTimer(callback: (...args: any[]) => void, delay?: number): Handle {\n\tlet timerId: number | null = setTimeout(callback, delay);\n\n\treturn createHandle(function() {\n\t\tif (timerId) {\n\t\t\tclearTimeout(timerId);\n\t\t\ttimerId = null;\n\t\t}\n\t});\n}\n\n/**\n * Wraps a callback, returning a function which fires after no further calls are received over a set interval.\n *\n * @param callback Callback to wrap\n * @param delay Number of milliseconds to wait after any invocations before calling the original callback\n * @return Debounced function\n */\nexport function debounce void>(callback: T, delay: number): T {\n\t// node.d.ts clobbers setTimeout/clearTimeout with versions that return/receive NodeJS.Timer,\n\t// but browsers return/receive a number\n\tlet timer: Handle | null;\n\n\treturn function() {\n\t\ttimer && timer.destroy();\n\n\t\tlet context = this;\n\t\tlet args: IArguments | null = arguments;\n\n\t\ttimer = guaranteeMinimumTimeout(function() {\n\t\t\tcallback.apply(context, args);\n\t\t\targs = context = timer = null;\n\t\t}, delay);\n\t};\n}\n\n/**\n * Wraps a callback, returning a function which fires at most once per set interval.\n *\n * @param callback Callback to wrap\n * @param delay Number of milliseconds to wait before allowing the original callback to be called again\n * @return Throttled function\n */\nexport function throttle void>(callback: T, delay: number): T {\n\tlet ran: boolean | null;\n\n\treturn function() {\n\t\tif (ran) {\n\t\t\treturn;\n\t\t}\n\n\t\tran = true;\n\n\t\tcallback.apply(this, arguments);\n\t\tguaranteeMinimumTimeout(function() {\n\t\t\tran = null;\n\t\t}, delay);\n\t};\n}\n\n/**\n * Like throttle, but calls the callback at the end of each interval rather than the beginning.\n * Useful for e.g. resize or scroll events, when debounce would appear unresponsive.\n *\n * @param callback Callback to wrap\n * @param delay Number of milliseconds to wait before calling the original callback and allowing it to be called again\n * @return Throttled function\n */\nexport function throttleAfter void>(callback: T, delay: number): T {\n\tlet ran: boolean | null;\n\n\treturn function() {\n\t\tif (ran) {\n\t\t\treturn;\n\t\t}\n\n\t\tran = true;\n\n\t\tlet context = this;\n\t\tlet args: IArguments | null = arguments;\n\n\t\tguaranteeMinimumTimeout(function() {\n\t\t\tcallback.apply(context, args);\n\t\t\targs = context = ran = null;\n\t\t}, delay);\n\t};\n}\n\nexport function guaranteeMinimumTimeout(callback: (...args: any[]) => void, delay?: number): Handle {\n\tconst startTime = Date.now();\n\tlet timerId: number | null;\n\n\tfunction timeoutHandler() {\n\t\tconst delta = Date.now() - startTime;\n\t\tif (delay == null || delta >= delay) {\n\t\t\tcallback();\n\t\t} else {\n\t\t\t// Cast setTimeout return value to fix TypeScript parsing bug. Without it,\n\t\t\t// it thinks we are using the Node version of setTimeout.\n\t\t\t// Revisit this with the next TypeScript update.\n\t\t\t// Set another timer for the mount of time that we came up short.\n\t\t\ttimerId = setTimeout(timeoutHandler, delay - delta);\n\t\t}\n\t}\n\ttimerId = setTimeout(timeoutHandler, delay);\n\treturn createHandle(() => {\n\t\tif (timerId != null) {\n\t\t\tclearTimeout(timerId);\n\t\t\ttimerId = null;\n\t\t}\n\t});\n}\n"]} \ No newline at end of file diff --git a/deps/framework/core/uuid.d.ts b/deps/framework/core/uuid.d.ts deleted file mode 100644 index 794a692ae6..0000000000 --- a/deps/framework/core/uuid.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -/** - * Returns a v4 compliant UUID. - * - * @returns {string} - */ -export default function uuid(): string; diff --git a/deps/framework/core/uuid.js b/deps/framework/core/uuid.js deleted file mode 100644 index 6625098cee..0000000000 --- a/deps/framework/core/uuid.js +++ /dev/null @@ -1,25 +0,0 @@ -(function (factory) { - if (typeof module === "object" && typeof module.exports === "object") { - var v = factory(require, exports); - if (v !== undefined) module.exports = v; - } - else if (typeof define === "function" && define.amd) { - define(["require", "exports"], factory); - } -})(function (require, exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - /** - * Returns a v4 compliant UUID. - * - * @returns {string} - */ - function uuid() { - return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) { - var r = (Math.random() * 16) | 0, v = c === 'x' ? r : (r & 0x3) | 0x8; - return v.toString(16); - }); - } - exports.default = uuid; -}); -//# sourceMappingURL=uuid.js.map \ No newline at end of file diff --git a/deps/framework/core/uuid.js.map b/deps/framework/core/uuid.js.map deleted file mode 100644 index f160ce934e..0000000000 --- a/deps/framework/core/uuid.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"uuid.js","sourceRoot":"","sources":["uuid.ts"],"names":[],"mappings":";;;;;;;;;;;IAAA;;;;OAIG;IACH;QACC,MAAM,CAAC,sCAAsC,CAAC,OAAO,CAAC,OAAO,EAAE,UAAS,CAAC;YACxE,IAAM,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,EACjC,CAAC,GAAG,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC,GAAG,GAAG,CAAC;YACrC,MAAM,CAAC,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;QACvB,CAAC,CAAC,CAAC;IACJ,CAAC;IAND,uBAMC","sourcesContent":["/**\n * Returns a v4 compliant UUID.\n *\n * @returns {string}\n */\nexport default function uuid(): string {\n\treturn 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) {\n\t\tconst r = (Math.random() * 16) | 0,\n\t\t\tv = c === 'x' ? r : (r & 0x3) | 0x8;\n\t\treturn v.toString(16);\n\t});\n}\n"]} \ No newline at end of file diff --git a/deps/framework/core/uuid.mjs b/deps/framework/core/uuid.mjs deleted file mode 100644 index 7ff6daaa0b..0000000000 --- a/deps/framework/core/uuid.mjs +++ /dev/null @@ -1,12 +0,0 @@ -/** - * Returns a v4 compliant UUID. - * - * @returns {string} - */ -export default function uuid() { - return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) { - const r = (Math.random() * 16) | 0, v = c === 'x' ? r : (r & 0x3) | 0x8; - return v.toString(16); - }); -} -//# sourceMappingURL=uuid.mjs.map \ No newline at end of file diff --git a/deps/framework/core/uuid.mjs.map b/deps/framework/core/uuid.mjs.map deleted file mode 100644 index f9b31845b4..0000000000 --- a/deps/framework/core/uuid.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"uuid.mjs","sourceRoot":"","sources":["uuid.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,CAAC,OAAO;IACb,MAAM,CAAC,sCAAsC,CAAC,OAAO,CAAC,OAAO,EAAE,UAAS,CAAC;QACxE,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,EACjC,CAAC,GAAG,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC,GAAG,GAAG,CAAC;QACrC,MAAM,CAAC,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;IACvB,CAAC,CAAC,CAAC;AACJ,CAAC","sourcesContent":["/**\n * Returns a v4 compliant UUID.\n *\n * @returns {string}\n */\nexport default function uuid(): string {\n\treturn 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) {\n\t\tconst r = (Math.random() * 16) | 0,\n\t\t\tv = c === 'x' ? r : (r & 0x3) | 0x8;\n\t\treturn v.toString(16);\n\t});\n}\n"]} \ No newline at end of file diff --git a/deps/framework/has/has.d.ts b/deps/framework/has/has.d.ts deleted file mode 100644 index 30dfa164b6..0000000000 --- a/deps/framework/has/has.d.ts +++ /dev/null @@ -1,80 +0,0 @@ -import { Require, Config } from './loader'; -/** - * The valid return types from a feature test - */ -export declare type FeatureTestResult = boolean | string | number | undefined | void; -/** - * A function that tests for a feature and returns a result - */ -export declare type FeatureTest = () => FeatureTestResult; -export declare type FeatureTestThenable = PromiseLike; -/** - * A cache of results of feature tests - */ -export declare const testCache: { - [feature: string]: FeatureTestResult; -}; -/** - * A cache of the un-resolved feature tests - */ -export declare const testFunctions: { - [feature: string]: FeatureTest; -}; -export interface StaticHasFeatures { - [feature: string]: FeatureTestResult; -} -export interface DojoHasEnvironment { - /** - * Static features defined in the enviornment that should be used by the `has` module - * instead of run-time detection. - */ - staticFeatures?: StaticHasFeatures | (() => StaticHasFeatures); -} -declare global { - interface Window { - /** - * The `dojo/has` enviornment which provides configuration when the module is - * loaded. - */ - DojoHasEnvironment?: DojoHasEnvironment; - } -} -export declare function load(resourceId: string, require: Require, load: (value?: any) => void, config?: Config): void; -/** - * AMD plugin function. - * - * Resolves resourceId into a module id based on possibly-nested tenary expression that branches on has feature test - * value(s). - * - * @param resourceId The id of the module - * @param normalize Resolves a relative module id into an absolute module id - */ -export declare function normalize(resourceId: string, normalize: (moduleId: string) => string): string | null; -/** - * Check if a feature has already been registered - * - * @param feature the name of the feature - */ -export declare function exists(feature: string): boolean; -/** - * Register a new test for a named feature. - * - * @example - * has.add('dom-addeventlistener', !!document.addEventListener); - * - * @example - * has.add('touch-events', function () { - * return 'ontouchstart' in document - * }); - * - * @param feature the name of the feature - * @param value the value reported of the feature, or a function that will be executed once on first test - * @param overwrite if an existing value should be overwritten. Defaults to false. - */ -export declare function add(feature: string, value: FeatureTest | FeatureTestResult | FeatureTestThenable, overwrite?: boolean): void; -/** - * Return the current value of a named feature. - * - * @param feature The name (if a string) or identifier (if an integer) of the feature to test. - */ -export default function has(feature: string): FeatureTestResult; diff --git a/deps/framework/has/has.js b/deps/framework/has/has.js deleted file mode 100644 index a50d030daa..0000000000 --- a/deps/framework/has/has.js +++ /dev/null @@ -1,214 +0,0 @@ -(function (factory) { - if (typeof module === "object" && typeof module.exports === "object") { - var v = factory(require, exports); - if (v !== undefined) module.exports = v; - } - else if (typeof define === "function" && define.amd) { - define(["require", "exports"], factory); - } -})(function (require, exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - function isFeatureTestThenable(value) { - return value && value.then; - } - /** - * A cache of results of feature tests - */ - exports.testCache = {}; - /** - * A cache of the un-resolved feature tests - */ - exports.testFunctions = {}; - /** - * A cache of unresolved thenables (probably promises) - * @type {{}} - */ - var testThenables = {}; - /** - * A reference to the global scope (`window` in a browser, `global` in NodeJS) - */ - var globalScope = (function () { - /* istanbul ignore else */ - if (typeof window !== 'undefined') { - // Browsers - return window; - } - else if (typeof global !== 'undefined') { - // Node - return global; - } - else if (typeof self !== 'undefined') { - // Web workers - return self; - } - /* istanbul ignore next */ - return {}; - })(); - /* Grab the staticFeatures if there are available */ - var staticFeatures = (globalScope.DojoHasEnvironment || {}).staticFeatures; - /* Cleaning up the DojoHasEnviornment */ - if ('DojoHasEnvironment' in globalScope) { - delete globalScope.DojoHasEnvironment; - } - /** - * Custom type guard to narrow the `staticFeatures` to either a map or a function that - * returns a map. - * - * @param value The value to guard for - */ - function isStaticFeatureFunction(value) { - return typeof value === 'function'; - } - /** - * The cache of asserted features that were available in the global scope when the - * module loaded - */ - var staticCache = staticFeatures - ? isStaticFeatureFunction(staticFeatures) ? staticFeatures.apply(globalScope) : staticFeatures - : {}; /* Providing an empty cache, if none was in the environment - -/** - * AMD plugin function. - * - * Conditional loads modules based on a has feature test value. - * - * @param resourceId Gives the resolved module id to load. - * @param require The loader require function with respect to the module that contained the plugin resource in its - * dependency list. - * @param load Callback to loader that consumes result of plugin demand. - */ - function load(resourceId, require, load, config) { - resourceId ? require([resourceId], load) : load(); - } - exports.load = load; - /** - * AMD plugin function. - * - * Resolves resourceId into a module id based on possibly-nested tenary expression that branches on has feature test - * value(s). - * - * @param resourceId The id of the module - * @param normalize Resolves a relative module id into an absolute module id - */ - function normalize(resourceId, normalize) { - var tokens = resourceId.match(/[\?:]|[^:\?]*/g) || []; - var i = 0; - function get(skip) { - var term = tokens[i++]; - if (term === ':') { - // empty string module name, resolves to null - return null; - } - else { - // postfixed with a ? means it is a feature to branch on, the term is the name of the feature - if (tokens[i++] === '?') { - if (!skip && has(term)) { - // matched the feature, get the first value from the options - return get(); - } - else { - // did not match, get the second value, passing over the first - get(true); - return get(skip); - } - } - // a module - return term; - } - } - var id = get(); - return id && normalize(id); - } - exports.normalize = normalize; - /** - * Check if a feature has already been registered - * - * @param feature the name of the feature - */ - function exists(feature) { - var normalizedFeature = feature.toLowerCase(); - return Boolean(normalizedFeature in staticCache || normalizedFeature in exports.testCache || exports.testFunctions[normalizedFeature]); - } - exports.exists = exists; - /** - * Register a new test for a named feature. - * - * @example - * has.add('dom-addeventlistener', !!document.addEventListener); - * - * @example - * has.add('touch-events', function () { - * return 'ontouchstart' in document - * }); - * - * @param feature the name of the feature - * @param value the value reported of the feature, or a function that will be executed once on first test - * @param overwrite if an existing value should be overwritten. Defaults to false. - */ - function add(feature, value, overwrite) { - if (overwrite === void 0) { overwrite = false; } - var normalizedFeature = feature.toLowerCase(); - if (exists(normalizedFeature) && !overwrite && !(normalizedFeature in staticCache)) { - throw new TypeError("Feature \"" + feature + "\" exists and overwrite not true."); - } - if (typeof value === 'function') { - exports.testFunctions[normalizedFeature] = value; - } - else if (isFeatureTestThenable(value)) { - testThenables[feature] = value.then(function (resolvedValue) { - exports.testCache[feature] = resolvedValue; - delete testThenables[feature]; - }, function () { - delete testThenables[feature]; - }); - } - else { - exports.testCache[normalizedFeature] = value; - delete exports.testFunctions[normalizedFeature]; - } - } - exports.add = add; - /** - * Return the current value of a named feature. - * - * @param feature The name (if a string) or identifier (if an integer) of the feature to test. - */ - function has(feature) { - var result; - var normalizedFeature = feature.toLowerCase(); - if (normalizedFeature in staticCache) { - result = staticCache[normalizedFeature]; - } - else if (exports.testFunctions[normalizedFeature]) { - result = exports.testCache[normalizedFeature] = exports.testFunctions[normalizedFeature].call(null); - delete exports.testFunctions[normalizedFeature]; - } - else if (normalizedFeature in exports.testCache) { - result = exports.testCache[normalizedFeature]; - } - else if (feature in testThenables) { - return false; - } - else { - throw new TypeError("Attempt to detect unregistered has feature \"" + feature + "\""); - } - return result; - } - exports.default = has; - /* - * Out of the box feature tests - */ - /* Environments */ - /* Used as a value to provide a debug only code path */ - add('debug', true); - /* Detects if the environment is "browser like" */ - add('host-browser', typeof document !== 'undefined' && typeof location !== 'undefined'); - /* Detects if the environment appears to be NodeJS */ - add('host-node', function () { - if (typeof process === 'object' && process.versions && process.versions.node) { - return process.versions.node; - } - }); -}); -//# sourceMappingURL=has.js.map \ No newline at end of file diff --git a/deps/framework/has/has.js.map b/deps/framework/has/has.js.map deleted file mode 100644 index 928df0c7d6..0000000000 --- a/deps/framework/has/has.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"has.js","sourceRoot":"","sources":["has.ts"],"names":[],"mappings":";;;;;;;;;;;IAcA,+BAA+B,KAAU;QACxC,MAAM,CAAC,KAAK,IAAI,KAAK,CAAC,IAAI,CAAC;IAC5B,CAAC;IAED;;OAEG;IACU,QAAA,SAAS,GAA6C,EAAE,CAAC;IAEtE;;OAEG;IACU,QAAA,aAAa,GAAuC,EAAE,CAAC;IAEpE;;;OAGG;IACH,IAAM,aAAa,GAA+C,EAAE,CAAC;IAwBrE;;OAEG;IACH,IAAM,WAAW,GAAG,CAAC;QACpB,0BAA0B;QAC1B,EAAE,CAAC,CAAC,OAAO,MAAM,KAAK,WAAW,CAAC,CAAC,CAAC;YACnC,WAAW;YACX,MAAM,CAAC,MAAM,CAAC;QACf,CAAC;QAAC,IAAI,CAAC,EAAE,CAAC,CAAC,OAAO,MAAM,KAAK,WAAW,CAAC,CAAC,CAAC;YAC1C,OAAO;YACP,MAAM,CAAC,MAAM,CAAC;QACf,CAAC;QAAC,IAAI,CAAC,EAAE,CAAC,CAAC,OAAO,IAAI,KAAK,WAAW,CAAC,CAAC,CAAC;YACxC,cAAc;YACd,MAAM,CAAC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I,aAAa,CAAC,CAAC,CAAC;YACrC,MAAM,CAAC,KAAK,CAAC;QACd,CAAC;QAAC,IAAI,CAAC,CAAC;YACP,MAAM,IAAI,SAAS,CAAC,kDAA+C,OAAO,OAAG,CAAC,CAAC;QAChF,CAAC;QAED,MAAM,CAAC,MAAM,CAAC;IACf,CAAC;IAnBD,sBAmBC;IAED;;OAEG;IAEH,kBAAkB;IAElB,uDAAuD;IACvD,GAAG,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;IAEnB,kDAAkD;IAClD,GAAG,CAAC,cAAc,EAAE,OAAO,QAAQ,KAAK,WAAW,IAAI,OAAO,QAAQ,KAAK,WAAW,CAAC,CAAC;IAExF,qDAAqD;IACrD,GAAG,CAAC,WAAW,EAAE;QAChB,EAAE,CAAC,CAAC,OAAO,OAAO,KAAK,QAAQ,IAAI,OAAO,CAAC,QAAQ,IAAI,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC;YAC9E,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC;QAC9B,CAAC;IACF,CAAC,CAAC,CAAC","sourcesContent":["import { Require, Config } from './loader';\n\n/**\n * The valid return types from a feature test\n */\nexport type FeatureTestResult = boolean | string | number | undefined | void;\n\n/**\n * A function that tests for a feature and returns a result\n */\nexport type FeatureTest = () => FeatureTestResult;\n\nexport type FeatureTestThenable = PromiseLike;\n\nfunction isFeatureTestThenable(value: any): value is FeatureTestThenable {\n\treturn value && value.then;\n}\n\n/**\n * A cache of results of feature tests\n */\nexport const testCache: { [feature: string]: FeatureTestResult } = {};\n\n/**\n * A cache of the un-resolved feature tests\n */\nexport const testFunctions: { [feature: string]: FeatureTest } = {};\n\n/**\n * A cache of unresolved thenables (probably promises)\n * @type {{}}\n */\nconst testThenables: { [feature: string]: FeatureTestThenable } = {};\n\nexport interface StaticHasFeatures {\n\t[feature: string]: FeatureTestResult;\n}\n\nexport interface DojoHasEnvironment {\n\t/**\n\t * Static features defined in the enviornment that should be used by the `has` module\n\t * instead of run-time detection.\n\t */\n\tstaticFeatures?: StaticHasFeatures | (() => StaticHasFeatures);\n}\n\ndeclare global {\n\tinterface Window {\n\t\t/**\n\t\t * The `dojo/has` enviornment which provides configuration when the module is\n\t\t * loaded.\n\t\t */\n\t\tDojoHasEnvironment?: DojoHasEnvironment;\n\t}\n}\n\n/**\n * A reference to the global scope (`window` in a browser, `global` in NodeJS)\n */\nconst globalScope = (function(): any {\n\t/* istanbul ignore else */\n\tif (typeof window !== 'undefined') {\n\t\t// Browsers\n\t\treturn window;\n\t} else if (typeof global !== 'undefined') {\n\t\t// Node\n\t\treturn global;\n\t} else if (typeof self !== 'undefined') {\n\t\t// Web workers\n\t\treturn self;\n\t}\n\t/* istanbul ignore next */\n\treturn {};\n})();\n\n/* Grab the staticFeatures if there are available */\nconst { staticFeatures }: DojoHasEnvironment = globalScope.DojoHasEnvironment || {};\n\n/* Cleaning up the DojoHasEnviornment */\nif ('DojoHasEnvironment' in globalScope) {\n\tdelete globalScope.DojoHasEnvironment;\n}\n\n/**\n * Custom type guard to narrow the `staticFeatures` to either a map or a function that\n * returns a map.\n *\n * @param value The value to guard for\n */\nfunction isStaticFeatureFunction(value: any): value is (() => StaticHasFeatures) {\n\treturn typeof value === 'function';\n}\n\n/**\n * The cache of asserted features that were available in the global scope when the\n * module loaded\n */\nconst staticCache: StaticHasFeatures = staticFeatures\n\t? isStaticFeatureFunction(staticFeatures) ? staticFeatures.apply(globalScope) : staticFeatures\n\t: {}; /* Providing an empty cache, if none was in the environment\n\n/**\n * AMD plugin function.\n *\n * Conditional loads modules based on a has feature test value.\n *\n * @param resourceId Gives the resolved module id to load.\n * @param require The loader require function with respect to the module that contained the plugin resource in its\n * dependency list.\n * @param load Callback to loader that consumes result of plugin demand.\n */\nexport function load(resourceId: string, require: Require, load: (value?: any) => void, config?: Config): void {\n\tresourceId ? require([resourceId], load) : load();\n}\n\n/**\n * AMD plugin function.\n *\n * Resolves resourceId into a module id based on possibly-nested tenary expression that branches on has feature test\n * value(s).\n *\n * @param resourceId The id of the module\n * @param normalize Resolves a relative module id into an absolute module id\n */\nexport function normalize(resourceId: string, normalize: (moduleId: string) => string): string | null {\n\tconst tokens: RegExpMatchArray = resourceId.match(/[\\?:]|[^:\\?]*/g) || [];\n\tlet i = 0;\n\n\tfunction get(skip?: boolean): string | null {\n\t\tconst term = tokens[i++];\n\t\tif (term === ':') {\n\t\t\t// empty string module name, resolves to null\n\t\t\treturn null;\n\t\t} else {\n\t\t\t// postfixed with a ? means it is a feature to branch on, the term is the name of the feature\n\t\t\tif (tokens[i++] === '?') {\n\t\t\t\tif (!skip && has(term)) {\n\t\t\t\t\t// matched the feature, get the first value from the options\n\t\t\t\t\treturn get();\n\t\t\t\t} else {\n\t\t\t\t\t// did not match, get the second value, passing over the first\n\t\t\t\t\tget(true);\n\t\t\t\t\treturn get(skip);\n\t\t\t\t}\n\t\t\t}\n\t\t\t// a module\n\t\t\treturn term;\n\t\t}\n\t}\n\n\tconst id = get();\n\n\treturn id && normalize(id);\n}\n\n/**\n * Check if a feature has already been registered\n *\n * @param feature the name of the feature\n */\nexport function exists(feature: string): boolean {\n\tconst normalizedFeature = feature.toLowerCase();\n\n\treturn Boolean(\n\t\tnormalizedFeature in staticCache || normalizedFeature in testCache || testFunctions[normalizedFeature]\n\t);\n}\n\n/**\n * Register a new test for a named feature.\n *\n * @example\n * has.add('dom-addeventlistener', !!document.addEventListener);\n *\n * @example\n * has.add('touch-events', function () {\n * return 'ontouchstart' in document\n * });\n *\n * @param feature the name of the feature\n * @param value the value reported of the feature, or a function that will be executed once on first test\n * @param overwrite if an existing value should be overwritten. Defaults to false.\n */\nexport function add(\n\tfeature: string,\n\tvalue: FeatureTest | FeatureTestResult | FeatureTestThenable,\n\toverwrite: boolean = false\n): void {\n\tconst normalizedFeature = feature.toLowerCase();\n\n\tif (exists(normalizedFeature) && !overwrite && !(normalizedFeature in staticCache)) {\n\t\tthrow new TypeError(`Feature \"${feature}\" exists and overwrite not true.`);\n\t}\n\n\tif (typeof value === 'function') {\n\t\ttestFunctions[normalizedFeature] = value;\n\t} else if (isFeatureTestThenable(value)) {\n\t\ttestThenables[feature] = value.then(\n\t\t\t(resolvedValue: FeatureTestResult) => {\n\t\t\t\ttestCache[feature] = resolvedValue;\n\t\t\t\tdelete testThenables[feature];\n\t\t\t},\n\t\t\t() => {\n\t\t\t\tdelete testThenables[feature];\n\t\t\t}\n\t\t);\n\t} else {\n\t\ttestCache[normalizedFeature] = value;\n\t\tdelete testFunctions[normalizedFeature];\n\t}\n}\n\n/**\n * Return the current value of a named feature.\n *\n * @param feature The name (if a string) or identifier (if an integer) of the feature to test.\n */\nexport default function has(feature: string): FeatureTestResult {\n\tlet result: FeatureTestResult;\n\n\tconst normalizedFeature = feature.toLowerCase();\n\n\tif (normalizedFeature in staticCache) {\n\t\tresult = staticCache[normalizedFeature];\n\t} else if (testFunctions[normalizedFeature]) {\n\t\tresult = testCache[normalizedFeature] = testFunctions[normalizedFeature].call(null);\n\t\tdelete testFunctions[normalizedFeature];\n\t} else if (normalizedFeature in testCache) {\n\t\tresult = testCache[normalizedFeature];\n\t} else if (feature in testThenables) {\n\t\treturn false;\n\t} else {\n\t\tthrow new TypeError(`Attempt to detect unregistered has feature \"${feature}\"`);\n\t}\n\n\treturn result;\n}\n\n/*\n * Out of the box feature tests\n */\n\n/* Environments */\n\n/* Used as a value to provide a debug only code path */\nadd('debug', true);\n\n/* Detects if the environment is \"browser like\" */\nadd('host-browser', typeof document !== 'undefined' && typeof location !== 'undefined');\n\n/* Detects if the environment appears to be NodeJS */\nadd('host-node', function() {\n\tif (typeof process === 'object' && process.versions && process.versions.node) {\n\t\treturn process.versions.node;\n\t}\n});\n"]} \ No newline at end of file diff --git a/deps/framework/has/has.mjs b/deps/framework/has/has.mjs deleted file mode 100644 index d8b87aa771..0000000000 --- a/deps/framework/has/has.mjs +++ /dev/null @@ -1,196 +0,0 @@ -function isFeatureTestThenable(value) { - return value && value.then; -} -/** - * A cache of results of feature tests - */ -export const testCache = {}; -/** - * A cache of the un-resolved feature tests - */ -export const testFunctions = {}; -/** - * A cache of unresolved thenables (probably promises) - * @type {{}} - */ -const testThenables = {}; -/** - * A reference to the global scope (`window` in a browser, `global` in NodeJS) - */ -const globalScope = (function () { - /* istanbul ignore else */ - if (typeof window !== 'undefined') { - // Browsers - return window; - } - else if (typeof global !== 'undefined') { - // Node - return global; - } - else if (typeof self !== 'undefined') { - // Web workers - return self; - } - /* istanbul ignore next */ - return {}; -})(); -/* Grab the staticFeatures if there are available */ -const { staticFeatures } = globalScope.DojoHasEnvironment || {}; -/* Cleaning up the DojoHasEnviornment */ -if ('DojoHasEnvironment' in globalScope) { - delete globalScope.DojoHasEnvironment; -} -/** - * Custom type guard to narrow the `staticFeatures` to either a map or a function that - * returns a map. - * - * @param value The value to guard for - */ -function isStaticFeatureFunction(value) { - return typeof value === 'function'; -} -/** - * The cache of asserted features that were available in the global scope when the - * module loaded - */ -const staticCache = staticFeatures - ? isStaticFeatureFunction(staticFeatures) ? staticFeatures.apply(globalScope) : staticFeatures - : {}; /* Providing an empty cache, if none was in the environment - -/** -* AMD plugin function. -* -* Conditional loads modules based on a has feature test value. -* -* @param resourceId Gives the resolved module id to load. -* @param require The loader require function with respect to the module that contained the plugin resource in its -* dependency list. -* @param load Callback to loader that consumes result of plugin demand. -*/ -export function load(resourceId, require, load, config) { - resourceId ? require([resourceId], load) : load(); -} -/** - * AMD plugin function. - * - * Resolves resourceId into a module id based on possibly-nested tenary expression that branches on has feature test - * value(s). - * - * @param resourceId The id of the module - * @param normalize Resolves a relative module id into an absolute module id - */ -export function normalize(resourceId, normalize) { - const tokens = resourceId.match(/[\?:]|[^:\?]*/g) || []; - let i = 0; - function get(skip) { - const term = tokens[i++]; - if (term === ':') { - // empty string module name, resolves to null - return null; - } - else { - // postfixed with a ? means it is a feature to branch on, the term is the name of the feature - if (tokens[i++] === '?') { - if (!skip && has(term)) { - // matched the feature, get the first value from the options - return get(); - } - else { - // did not match, get the second value, passing over the first - get(true); - return get(skip); - } - } - // a module - return term; - } - } - const id = get(); - return id && normalize(id); -} -/** - * Check if a feature has already been registered - * - * @param feature the name of the feature - */ -export function exists(feature) { - const normalizedFeature = feature.toLowerCase(); - return Boolean(normalizedFeature in staticCache || normalizedFeature in testCache || testFunctions[normalizedFeature]); -} -/** - * Register a new test for a named feature. - * - * @example - * has.add('dom-addeventlistener', !!document.addEventListener); - * - * @example - * has.add('touch-events', function () { - * return 'ontouchstart' in document - * }); - * - * @param feature the name of the feature - * @param value the value reported of the feature, or a function that will be executed once on first test - * @param overwrite if an existing value should be overwritten. Defaults to false. - */ -export function add(feature, value, overwrite = false) { - const normalizedFeature = feature.toLowerCase(); - if (exists(normalizedFeature) && !overwrite && !(normalizedFeature in staticCache)) { - throw new TypeError(`Feature "${feature}" exists and overwrite not true.`); - } - if (typeof value === 'function') { - testFunctions[normalizedFeature] = value; - } - else if (isFeatureTestThenable(value)) { - testThenables[feature] = value.then((resolvedValue) => { - testCache[feature] = resolvedValue; - delete testThenables[feature]; - }, () => { - delete testThenables[feature]; - }); - } - else { - testCache[normalizedFeature] = value; - delete testFunctions[normalizedFeature]; - } -} -/** - * Return the current value of a named feature. - * - * @param feature The name (if a string) or identifier (if an integer) of the feature to test. - */ -export default function has(feature) { - let result; - const normalizedFeature = feature.toLowerCase(); - if (normalizedFeature in staticCache) { - result = staticCache[normalizedFeature]; - } - else if (testFunctions[normalizedFeature]) { - result = testCache[normalizedFeature] = testFunctions[normalizedFeature].call(null); - delete testFunctions[normalizedFeature]; - } - else if (normalizedFeature in testCache) { - result = testCache[normalizedFeature]; - } - else if (feature in testThenables) { - return false; - } - else { - throw new TypeError(`Attempt to detect unregistered has feature "${feature}"`); - } - return result; -} -/* - * Out of the box feature tests - */ -/* Environments */ -/* Used as a value to provide a debug only code path */ -add('debug', true); -/* Detects if the environment is "browser like" */ -add('host-browser', typeof document !== 'undefined' && typeof location !== 'undefined'); -/* Detects if the environment appears to be NodeJS */ -add('host-node', function () { - if (typeof process === 'object' && process.versions && process.versions.node) { - return process.versions.node; - } -}); -//# sourceMappingURL=has.mjs.map \ No newline at end of file diff --git a/deps/framework/has/has.mjs.map b/deps/framework/has/has.mjs.map deleted file mode 100644 index c66247cf62..0000000000 --- a/deps/framework/has/has.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"has.mjs","sourceRoot":"","sources":["has.ts"],"names":[],"mappings":"AAcA,+BAA+B,KAAU;IACxC,MAAM,CAAC,KAAK,IAAI,KAAK,CAAC,IAAI,CAAC;AAC5B,CAAC;AAED;;GAEG;AACH,MAAM,CAAC,MAAM,SAAS,GAA6C,EAAE,CAAC;AAEtE;;GAEG;AACH,MAAM,CAAC,MAAM,aAAa,GAAuC,EAAE,CAAC;AAEpE;;;GAGG;AACH,MAAM,aAAa,GAA+C,EAAE,CAAC;AAwBrE;;GAEG;AACH,MAAM,WAAW,GAAG,CAAC;IACpB,0BAA0B;IAC1B,EAAE,CAAC,CAAC,OAAO,MAAM,KAAK,WAAW,CAAC,CAAC,CAAC;QACnC,WAAW;QACX,MAAM,CAAC,MAAM,CAAC;IACf,CAAC;IAAC,IAAI,CAAC,EAAE,CAAC,CAAC,OAAO,MAAM,KAAK,WAAW,CAAC,CAAC,CAAC;QAC1C,OAAO;QACP,MAAM,CAAC,MAAM,CAAC;IACf,CAAC;IAAC,IAAI,CAAC,EAAE,CAAC,CAAC,OAAO,IAAI,KAAK,WAAW,CAAC,CAAC,CAAC;QACxC,cAAc;QACd,MAAM,CAAC,IAAI,CAAC;IACb,CAAC;IACD,0BAA0B;IAC1B,MAAM,CAAC,EAAE,CAAC;AACX,CAAC,CAAC,EAAE,CAAC;AAEL,oDAAoD;AACpD,MAAM,EAAE,cAAc,EAAE,GAAuB,WAAW,CAAC,kBAAkB,IAAI,EAAE,CAAC;AAEpF,wCAAwC;AACxC,EAAE,CAAC,CAAC,oBAAoB,IAAI,WAAW,CAAC,CAAC,CAAC;IACzC,OAA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,EAAE,IAAI,CAAC,CAAC;AAEnB,kDAAkD;AAClD,GAAG,CAAC,cAAc,EAAE,OAAO,QAAQ,KAAK,WAAW,IAAI,OAAO,QAAQ,KAAK,WAAW,CAAC,CAAC;AAExF,qDAAqD;AACrD,GAAG,CAAC,WAAW,EAAE;IAChB,EAAE,CAAC,CAAC,OAAO,OAAO,KAAK,QAAQ,IAAI,OAAO,CAAC,QAAQ,IAAI,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC;QAC9E,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC;IAC9B,CAAC;AACF,CAAC,CAAC,CAAC","sourcesContent":["import { Require, Config } from './loader';\n\n/**\n * The valid return types from a feature test\n */\nexport type FeatureTestResult = boolean | string | number | undefined | void;\n\n/**\n * A function that tests for a feature and returns a result\n */\nexport type FeatureTest = () => FeatureTestResult;\n\nexport type FeatureTestThenable = PromiseLike;\n\nfunction isFeatureTestThenable(value: any): value is FeatureTestThenable {\n\treturn value && value.then;\n}\n\n/**\n * A cache of results of feature tests\n */\nexport const testCache: { [feature: string]: FeatureTestResult } = {};\n\n/**\n * A cache of the un-resolved feature tests\n */\nexport const testFunctions: { [feature: string]: FeatureTest } = {};\n\n/**\n * A cache of unresolved thenables (probably promises)\n * @type {{}}\n */\nconst testThenables: { [feature: string]: FeatureTestThenable } = {};\n\nexport interface StaticHasFeatures {\n\t[feature: string]: FeatureTestResult;\n}\n\nexport interface DojoHasEnvironment {\n\t/**\n\t * Static features defined in the enviornment that should be used by the `has` module\n\t * instead of run-time detection.\n\t */\n\tstaticFeatures?: StaticHasFeatures | (() => StaticHasFeatures);\n}\n\ndeclare global {\n\tinterface Window {\n\t\t/**\n\t\t * The `dojo/has` enviornment which provides configuration when the module is\n\t\t * loaded.\n\t\t */\n\t\tDojoHasEnvironment?: DojoHasEnvironment;\n\t}\n}\n\n/**\n * A reference to the global scope (`window` in a browser, `global` in NodeJS)\n */\nconst globalScope = (function(): any {\n\t/* istanbul ignore else */\n\tif (typeof window !== 'undefined') {\n\t\t// Browsers\n\t\treturn window;\n\t} else if (typeof global !== 'undefined') {\n\t\t// Node\n\t\treturn global;\n\t} else if (typeof self !== 'undefined') {\n\t\t// Web workers\n\t\treturn self;\n\t}\n\t/* istanbul ignore next */\n\treturn {};\n})();\n\n/* Grab the staticFeatures if there are available */\nconst { staticFeatures }: DojoHasEnvironment = globalScope.DojoHasEnvironment || {};\n\n/* Cleaning up the DojoHasEnviornment */\nif ('DojoHasEnvironment' in globalScope) {\n\tdelete globalScope.DojoHasEnvironment;\n}\n\n/**\n * Custom type guard to narrow the `staticFeatures` to either a map or a function that\n * returns a map.\n *\n * @param value The value to guard for\n */\nfunction isStaticFeatureFunction(value: any): value is (() => StaticHasFeatures) {\n\treturn typeof value === 'function';\n}\n\n/**\n * The cache of asserted features that were available in the global scope when the\n * module loaded\n */\nconst staticCache: StaticHasFeatures = staticFeatures\n\t? isStaticFeatureFunction(staticFeatures) ? staticFeatures.apply(globalScope) : staticFeatures\n\t: {}; /* Providing an empty cache, if none was in the environment\n\n/**\n * AMD plugin function.\n *\n * Conditional loads modules based on a has feature test value.\n *\n * @param resourceId Gives the resolved module id to load.\n * @param require The loader require function with respect to the module that contained the plugin resource in its\n * dependency list.\n * @param load Callback to loader that consumes result of plugin demand.\n */\nexport function load(resourceId: string, require: Require, load: (value?: any) => void, config?: Config): void {\n\tresourceId ? require([resourceId], load) : load();\n}\n\n/**\n * AMD plugin function.\n *\n * Resolves resourceId into a module id based on possibly-nested tenary expression that branches on has feature test\n * value(s).\n *\n * @param resourceId The id of the module\n * @param normalize Resolves a relative module id into an absolute module id\n */\nexport function normalize(resourceId: string, normalize: (moduleId: string) => string): string | null {\n\tconst tokens: RegExpMatchArray = resourceId.match(/[\\?:]|[^:\\?]*/g) || [];\n\tlet i = 0;\n\n\tfunction get(skip?: boolean): string | null {\n\t\tconst term = tokens[i++];\n\t\tif (term === ':') {\n\t\t\t// empty string module name, resolves to null\n\t\t\treturn null;\n\t\t} else {\n\t\t\t// postfixed with a ? means it is a feature to branch on, the term is the name of the feature\n\t\t\tif (tokens[i++] === '?') {\n\t\t\t\tif (!skip && has(term)) {\n\t\t\t\t\t// matched the feature, get the first value from the options\n\t\t\t\t\treturn get();\n\t\t\t\t} else {\n\t\t\t\t\t// did not match, get the second value, passing over the first\n\t\t\t\t\tget(true);\n\t\t\t\t\treturn get(skip);\n\t\t\t\t}\n\t\t\t}\n\t\t\t// a module\n\t\t\treturn term;\n\t\t}\n\t}\n\n\tconst id = get();\n\n\treturn id && normalize(id);\n}\n\n/**\n * Check if a feature has already been registered\n *\n * @param feature the name of the feature\n */\nexport function exists(feature: string): boolean {\n\tconst normalizedFeature = feature.toLowerCase();\n\n\treturn Boolean(\n\t\tnormalizedFeature in staticCache || normalizedFeature in testCache || testFunctions[normalizedFeature]\n\t);\n}\n\n/**\n * Register a new test for a named feature.\n *\n * @example\n * has.add('dom-addeventlistener', !!document.addEventListener);\n *\n * @example\n * has.add('touch-events', function () {\n * return 'ontouchstart' in document\n * });\n *\n * @param feature the name of the feature\n * @param value the value reported of the feature, or a function that will be executed once on first test\n * @param overwrite if an existing value should be overwritten. Defaults to false.\n */\nexport function add(\n\tfeature: string,\n\tvalue: FeatureTest | FeatureTestResult | FeatureTestThenable,\n\toverwrite: boolean = false\n): void {\n\tconst normalizedFeature = feature.toLowerCase();\n\n\tif (exists(normalizedFeature) && !overwrite && !(normalizedFeature in staticCache)) {\n\t\tthrow new TypeError(`Feature \"${feature}\" exists and overwrite not true.`);\n\t}\n\n\tif (typeof value === 'function') {\n\t\ttestFunctions[normalizedFeature] = value;\n\t} else if (isFeatureTestThenable(value)) {\n\t\ttestThenables[feature] = value.then(\n\t\t\t(resolvedValue: FeatureTestResult) => {\n\t\t\t\ttestCache[feature] = resolvedValue;\n\t\t\t\tdelete testThenables[feature];\n\t\t\t},\n\t\t\t() => {\n\t\t\t\tdelete testThenables[feature];\n\t\t\t}\n\t\t);\n\t} else {\n\t\ttestCache[normalizedFeature] = value;\n\t\tdelete testFunctions[normalizedFeature];\n\t}\n}\n\n/**\n * Return the current value of a named feature.\n *\n * @param feature The name (if a string) or identifier (if an integer) of the feature to test.\n */\nexport default function has(feature: string): FeatureTestResult {\n\tlet result: FeatureTestResult;\n\n\tconst normalizedFeature = feature.toLowerCase();\n\n\tif (normalizedFeature in staticCache) {\n\t\tresult = staticCache[normalizedFeature];\n\t} else if (testFunctions[normalizedFeature]) {\n\t\tresult = testCache[normalizedFeature] = testFunctions[normalizedFeature].call(null);\n\t\tdelete testFunctions[normalizedFeature];\n\t} else if (normalizedFeature in testCache) {\n\t\tresult = testCache[normalizedFeature];\n\t} else if (feature in testThenables) {\n\t\treturn false;\n\t} else {\n\t\tthrow new TypeError(`Attempt to detect unregistered has feature \"${feature}\"`);\n\t}\n\n\treturn result;\n}\n\n/*\n * Out of the box feature tests\n */\n\n/* Environments */\n\n/* Used as a value to provide a debug only code path */\nadd('debug', true);\n\n/* Detects if the environment is \"browser like\" */\nadd('host-browser', typeof document !== 'undefined' && typeof location !== 'undefined');\n\n/* Detects if the environment appears to be NodeJS */\nadd('host-node', function() {\n\tif (typeof process === 'object' && process.versions && process.versions.node) {\n\t\treturn process.versions.node;\n\t}\n});\n"]} \ No newline at end of file diff --git a/deps/framework/has/loader.d.ts b/deps/framework/has/loader.d.ts deleted file mode 100644 index 0c4651e6ee..0000000000 --- a/deps/framework/has/loader.d.ts +++ /dev/null @@ -1,50 +0,0 @@ -export interface Config { - baseUrl?: string; - map?: ModuleMap; - packages?: Package[]; - paths?: { - [path: string]: string; - }; - pkgs?: { - [path: string]: Package; - }; -} -export interface ModuleMap extends ModuleMapItem { - [sourceMid: string]: ModuleMapReplacement; -} -export interface ModuleMapItem { - [mid: string]: any; -} -export interface ModuleMapReplacement extends ModuleMapItem { - [findMid: string]: string; -} -export interface Package { - location?: string; - main?: string; - name?: string; -} -export interface Require { - (dependencies: string[], callback: RequireCallback): void; - (moduleId: string): ModuleType; - toAbsMid(moduleId: string): string; - toUrl(path: string): string; -} -export interface Has { - (name: string): any; - add(name: string, value: (global: Window, document?: HTMLDocument, element?: HTMLDivElement) => any, now?: boolean, force?: boolean): void; - add(name: string, value: any, now?: boolean, force?: boolean): void; -} -export declare type SignalType = 'error'; -export interface RootRequire extends Require { - has: Has; - on(type: SignalType, listener: any): { - remove: () => void; - }; - config(config: Config): void; - inspect?(name: string): any; - nodeRequire?(id: string): any; - undef(moduleId: string): void; -} -export interface RequireCallback { - (...modules: any[]): void; -} diff --git a/deps/framework/has/loader.js b/deps/framework/has/loader.js deleted file mode 100644 index 1a1bda801f..0000000000 --- a/deps/framework/has/loader.js +++ /dev/null @@ -1,13 +0,0 @@ -(function (factory) { - if (typeof module === "object" && typeof module.exports === "object") { - var v = factory(require, exports); - if (v !== undefined) module.exports = v; - } - else if (typeof define === "function" && define.amd) { - define(["require", "exports"], factory); - } -})(function (require, exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); -}); -//# sourceMappingURL=loader.js.map \ No newline at end of file diff --git a/deps/framework/has/loader.js.map b/deps/framework/has/loader.js.map deleted file mode 100644 index e15e09db6a..0000000000 --- a/deps/framework/has/loader.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"loader.js","sourceRoot":"","sources":["loader.ts"],"names":[],"mappings":"","sourcesContent":["export interface Config {\n\tbaseUrl?: string;\n\tmap?: ModuleMap;\n\tpackages?: Package[];\n\tpaths?: { [path: string]: string };\n\tpkgs?: { [path: string]: Package };\n}\n\nexport interface ModuleMap extends ModuleMapItem {\n\t[sourceMid: string]: ModuleMapReplacement;\n}\n\nexport interface ModuleMapItem {\n\t[mid: string]: any;\n}\n\nexport interface ModuleMapReplacement extends ModuleMapItem {\n\t[findMid: string]: string;\n}\n\nexport interface Package {\n\tlocation?: string;\n\tmain?: string;\n\tname?: string;\n}\n\nexport interface Require {\n\t(dependencies: string[], callback: RequireCallback): void;\n\t(moduleId: string): ModuleType;\n\n\ttoAbsMid(moduleId: string): string;\n\ttoUrl(path: string): string;\n}\n\nexport interface Has {\n\t(name: string): any;\n\tadd(\n\t\tname: string,\n\t\tvalue: (global: Window, document?: HTMLDocument, element?: HTMLDivElement) => any,\n\t\tnow?: boolean,\n\t\tforce?: boolean\n\t): void;\n\tadd(name: string, value: any, now?: boolean, force?: boolean): void;\n}\n\nexport type SignalType = 'error';\n\nexport interface RootRequire extends Require {\n\thas: Has;\n\ton(type: SignalType, listener: any): { remove: () => void };\n\tconfig(config: Config): void;\n\tinspect?(name: string): any;\n\tnodeRequire?(id: string): any;\n\tundef(moduleId: string): void;\n}\n\nexport interface RequireCallback {\n\t(...modules: any[]): void;\n}\n"]} \ No newline at end of file diff --git a/deps/framework/has/loader.mjs b/deps/framework/has/loader.mjs deleted file mode 100644 index 23601972a2..0000000000 --- a/deps/framework/has/loader.mjs +++ /dev/null @@ -1 +0,0 @@ -//# sourceMappingURL=loader.mjs.map \ No newline at end of file diff --git a/deps/framework/has/loader.mjs.map b/deps/framework/has/loader.mjs.map deleted file mode 100644 index 8232d0aa95..0000000000 --- a/deps/framework/has/loader.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"loader.mjs","sourceRoot":"","sources":["loader.ts"],"names":[],"mappings":"","sourcesContent":["export interface Config {\n\tbaseUrl?: string;\n\tmap?: ModuleMap;\n\tpackages?: Package[];\n\tpaths?: { [path: string]: string };\n\tpkgs?: { [path: string]: Package };\n}\n\nexport interface ModuleMap extends ModuleMapItem {\n\t[sourceMid: string]: ModuleMapReplacement;\n}\n\nexport interface ModuleMapItem {\n\t[mid: string]: any;\n}\n\nexport interface ModuleMapReplacement extends ModuleMapItem {\n\t[findMid: string]: string;\n}\n\nexport interface Package {\n\tlocation?: string;\n\tmain?: string;\n\tname?: string;\n}\n\nexport interface Require {\n\t(dependencies: string[], callback: RequireCallback): void;\n\t(moduleId: string): ModuleType;\n\n\ttoAbsMid(moduleId: string): string;\n\ttoUrl(path: string): string;\n}\n\nexport interface Has {\n\t(name: string): any;\n\tadd(\n\t\tname: string,\n\t\tvalue: (global: Window, document?: HTMLDocument, element?: HTMLDivElement) => any,\n\t\tnow?: boolean,\n\t\tforce?: boolean\n\t): void;\n\tadd(name: string, value: any, now?: boolean, force?: boolean): void;\n}\n\nexport type SignalType = 'error';\n\nexport interface RootRequire extends Require {\n\thas: Has;\n\ton(type: SignalType, listener: any): { remove: () => void };\n\tconfig(config: Config): void;\n\tinspect?(name: string): any;\n\tnodeRequire?(id: string): any;\n\tundef(moduleId: string): void;\n}\n\nexport interface RequireCallback {\n\t(...modules: any[]): void;\n}\n"]} \ No newline at end of file diff --git a/deps/framework/has/main.d.ts b/deps/framework/has/main.d.ts deleted file mode 100644 index eff7b1ea30..0000000000 --- a/deps/framework/has/main.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import has from './has'; -export * from './has'; -export default has; diff --git a/deps/framework/has/main.js b/deps/framework/has/main.js deleted file mode 100644 index 64d847ccbf..0000000000 --- a/deps/framework/has/main.js +++ /dev/null @@ -1,17 +0,0 @@ -(function (factory) { - if (typeof module === "object" && typeof module.exports === "object") { - var v = factory(require, exports); - if (v !== undefined) module.exports = v; - } - else if (typeof define === "function" && define.amd) { - define(["require", "exports", "tslib", "./has", "./has"], factory); - } -})(function (require, exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - var tslib_1 = require("tslib"); - var has_1 = require("./has"); - tslib_1.__exportStar(require("./has"), exports); - exports.default = has_1.default; -}); -//# sourceMappingURL=main.js.map \ No newline at end of file diff --git a/deps/framework/has/main.js.map b/deps/framework/has/main.js.map deleted file mode 100644 index 15ac5a92dd..0000000000 --- a/deps/framework/has/main.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"main.js","sourceRoot":"","sources":["main.ts"],"names":[],"mappings":";;;;;;;;;;;;IAAA,6BAAwB;IACxB,gDAAsB;IACtB,kBAAe,aAAG,CAAC","sourcesContent":["import has from './has';\nexport * from './has';\nexport default has;\n"]} \ No newline at end of file diff --git a/deps/framework/has/main.mjs b/deps/framework/has/main.mjs deleted file mode 100644 index 7b3c99aac1..0000000000 --- a/deps/framework/has/main.mjs +++ /dev/null @@ -1,4 +0,0 @@ -import has from './has'; -export * from './has'; -export default has; -//# sourceMappingURL=main.mjs.map \ No newline at end of file diff --git a/deps/framework/has/main.mjs.map b/deps/framework/has/main.mjs.map deleted file mode 100644 index d924b52630..0000000000 --- a/deps/framework/has/main.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"main.mjs","sourceRoot":"","sources":["main.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,OAAO,CAAC;AACxB,cAAc,OAAO,CAAC;AACtB,eAAe,GAAG,CAAC","sourcesContent":["import has from './has';\nexport * from './has';\nexport default has;\n"]} \ No newline at end of file diff --git a/deps/framework/i18n/cldr/load.d.ts b/deps/framework/i18n/cldr/load.d.ts deleted file mode 100644 index 1ffb358624..0000000000 --- a/deps/framework/i18n/cldr/load.d.ts +++ /dev/null @@ -1,48 +0,0 @@ -import 'cldrjs/dist/cldr/unresolved'; -export interface CldrData { - main?: LocaleData; - supplemental?: any; -} -export declare type CldrGroup = 'main' | 'supplemental'; -export interface LocaleData { - [locale: string]: any; -} -/** - * A list of all required CLDR packages for an individual locale. - */ -export declare const mainPackages: ReadonlyArray; -/** - * A list of all required CLDR supplement packages. - */ -export declare const supplementalPackages: ReadonlyArray; -/** - * Determine whether a particular CLDR package has been loaded. - * - * Example: to check that `supplemental.likelySubtags` has been loaded, `isLoaded` would be called as - * `isLoaded('supplemental', 'likelySubtags')`. - * - * @param groupName - * The group to check; either "main" or "supplemental". - * - * @param ...args - * Any remaining keys in the path to the desired package. - * - * @return - * `true` if the deepest value exists; `false` otherwise. - */ -export declare function isLoaded(groupName: CldrGroup, ...args: string[]): boolean; -/** - * Load the specified CLDR data with the i18n ecosystem. - * - * @param data - * A data object containing `main` and/or `supplemental` objects with CLDR data. - */ -export default function loadCldrData(data: CldrData): Promise; -/** - * Clear the load cache, either the entire cache for the specified group. After calling this method, - * `isLoaded` will return false for keys within the specified group(s). - * - * @param group - * An optional group name. If not provided, then both the "main" and "supplemental" caches will be cleared. - */ -export declare function reset(group?: CldrGroup): void; diff --git a/deps/framework/i18n/cldr/load.js b/deps/framework/i18n/cldr/load.js deleted file mode 100644 index d995623ad8..0000000000 --- a/deps/framework/i18n/cldr/load.js +++ /dev/null @@ -1,234 +0,0 @@ -(function (factory) { - if (typeof module === "object" && typeof module.exports === "object") { - var v = factory(require, exports); - if (v !== undefined) module.exports = v; - } - else if (typeof define === "function" && define.amd) { - define(["require", "exports", "cldrjs/dist/cldr/unresolved", "./locales", "../util/main"], factory); - } -})(function (require, exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - require("cldrjs/dist/cldr/unresolved"); - var locales_1 = require("./locales"); - var main_1 = require("../util/main"); - // TODO: use normal imports after landing https://github.com/DefinitelyTyped/DefinitelyTyped/pull/27271 - var Globalize = require('globalize/dist/globalize'); - /** - * A list of all required CLDR packages for an individual locale. - */ - exports.mainPackages = Object.freeze([ - 'dates/calendars/gregorian', - 'dates/fields', - 'dates/timeZoneNames', - 'numbers', - 'numbers/currencies', - 'units' - ]); - /** - * A list of all required CLDR supplement packages. - */ - exports.supplementalPackages = Object.freeze([ - 'currencyData', - 'likelySubtags', - 'numberingSystems', - 'plurals-type-cardinal', - 'plurals-type-ordinal', - 'timeData', - 'weekData' - ]); - /** - * @private - * A simple map containing boolean flags indicating whether a particular CLDR package has been loaded. - */ - var loadCache = { - main: Object.create(null), - supplemental: generateSupplementalCache() - }; - /** - * @private - * Generate the locale-specific data cache from a list of keys. Nested objects will be generated from - * slash-separated strings. - * - * @param cache - * An empty locale cache object. - * - * @param keys - * The list of keys. - */ - function generateLocaleCache(cache, keys) { - return keys.reduce(function (tree, key) { - var parts = key.split('/'); - if (parts.length === 1) { - tree[key] = false; - return tree; - } - parts.reduce(function (tree, key, i) { - if (typeof tree[key] !== 'object') { - tree[key] = i === parts.length - 1 ? false : Object.create(null); - } - return tree[key]; - }, tree); - return tree; - }, cache); - } - /** - * @private - * Generate the supplemental data cache. - */ - function generateSupplementalCache() { - return exports.supplementalPackages.reduce(function (map, key) { - map[key] = false; - return map; - }, Object.create(null)); - } - /** - * @private - * Recursively determine whether a list of packages have been loaded for the specified CLDR group. - * - * @param group - * The CLDR group object (e.g., the supplemental data, or a specific locale group) - * - * @param args - * A list of keys to recursively check from left to right. For example, if [ "en", "numbers" ], - * then `group.en.numbers` must exist for the test to pass. - * - * @return - * `true` if the deepest value exists; `false` otherwise. - */ - function isLoadedForGroup(group, args) { - return args.every(function (arg) { - var next = group[arg]; - group = next; - return Boolean(next); - }); - } - /** - * @private - * Recursively flag as loaded all recognized keys on the provided CLDR data object. - * - * @param cache - * The load cache (either the entire object, or a nested segment of it). - * - * @param localeData - * The CLDR data object being loaded (either the entire object, or a nested segment of it). - */ - function registerLocaleData(cache, localeData) { - Object.keys(localeData).forEach(function (key) { - if (key in cache) { - var value = cache[key]; - if (typeof value === 'boolean') { - cache[key] = true; - } - else { - registerLocaleData(value, localeData[key]); - } - } - }); - } - /** - * @private - * Flag all supplied CLDR packages for a specific locale as loaded. - * - * @param data - * The `main` locale data. - */ - function registerMain(data) { - if (!data) { - return; - } - Object.keys(data).forEach(function (locale) { - if (locales_1.default.indexOf(locale) < 0) { - return; - } - var loadedData = loadCache.main[locale]; - if (!loadedData) { - loadedData = loadCache.main[locale] = generateLocaleCache(Object.create(null), exports.mainPackages); - } - registerLocaleData(loadedData, data[locale]); - }); - } - /** - * @private - * Flag all supplied CLDR supplemental packages as loaded. - * - * @param data - * The supplemental data. - */ - function registerSupplemental(data) { - if (!data) { - return; - } - var supplemental = loadCache.supplemental; - Object.keys(data).forEach(function (key) { - if (key in supplemental) { - supplemental[key] = true; - } - }); - } - /** - * Determine whether a particular CLDR package has been loaded. - * - * Example: to check that `supplemental.likelySubtags` has been loaded, `isLoaded` would be called as - * `isLoaded('supplemental', 'likelySubtags')`. - * - * @param groupName - * The group to check; either "main" or "supplemental". - * - * @param ...args - * Any remaining keys in the path to the desired package. - * - * @return - * `true` if the deepest value exists; `false` otherwise. - */ - function isLoaded(groupName) { - var args = []; - for (var _i = 1; _i < arguments.length; _i++) { - args[_i - 1] = arguments[_i]; - } - var group = loadCache[groupName]; - if (groupName === 'main' && args.length > 0) { - var locale = args[0]; - if (!main_1.validateLocale(locale)) { - return false; - } - args = args.slice(1); - return main_1.generateLocales(locale).some(function (locale) { - var next = group[locale]; - return next ? isLoadedForGroup(next, args) : false; - }); - } - return isLoadedForGroup(group, args); - } - exports.isLoaded = isLoaded; - /** - * Load the specified CLDR data with the i18n ecosystem. - * - * @param data - * A data object containing `main` and/or `supplemental` objects with CLDR data. - */ - function loadCldrData(data) { - registerMain(data.main); - registerSupplemental(data.supplemental); - Globalize.load(data); - return Promise.resolve(); - } - exports.default = loadCldrData; - /** - * Clear the load cache, either the entire cache for the specified group. After calling this method, - * `isLoaded` will return false for keys within the specified group(s). - * - * @param group - * An optional group name. If not provided, then both the "main" and "supplemental" caches will be cleared. - */ - function reset(group) { - if (group !== 'supplemental') { - loadCache.main = Object.create(null); - } - if (group !== 'main') { - loadCache.supplemental = generateSupplementalCache(); - } - } - exports.reset = reset; -}); -//# sourceMappingURL=load.js.map \ No newline at end of file diff --git a/deps/framework/i18n/cldr/load.js.map b/deps/framework/i18n/cldr/load.js.map deleted file mode 100644 index 12732a717f..0000000000 --- a/deps/framework/i18n/cldr/load.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"load.js","sourceRoot":"","sources":["load.ts"],"names":[],"mappings":";;;;;;;;;;;IAEA,uCAAqC;IACrC,qCAAyC;IACzC,qCAA+D;IAE/D,uGAAuG;IACvG,IAAM,SAAS,GAAyB,OAAO,CAAC,0BAA0B,CAAC,CAAC;IAa5E;;OAEG;IACU,QAAA,YAAY,GAAG,MAAM,CAAC,MAAM,CAAC;QACzC,2BAA2B;QAC3B,cAAc;QAC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CAAC,qBAAc,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;gBAC7B,MAAM,CAAC,KAAK,CAAC;YACd,CAAC;YAED,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;YACrB,MAAM,CAAC,sBAAe,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,UAAC,MAAc;gBAClD,IAAM,IAAI,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC;gBAC3B,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,gBAAgB,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;YACpD,CAAC,CAAC,CAAC;QACJ,CAAC;QAED,MAAM,CAAC,gBAAgB,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;IACtC,CAAC;IAlBD,4BAkBC;IAED;;;;;OAKG;IACH,sBAAqC,IAAc;QAClD,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACxB,oBAAoB,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;QACxC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACrB,MAAM,CAAC,OAAO,CAAC,OAAO,EAAE,CAAC;IAC1B,CAAC;IALD,+BAKC;IAED;;;;;;OAMG;IACH,eAAsB,KAAiB;QACtC,EAAE,CAAC,CAAC,KAAK,KAAK,cAAc,CAAC,CAAC,CAAC;YAC9B,SAAS,CAAC,IAAI,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;QACtC,CAAC;QAED,EAAE,CAAC,CAAC,KAAK,KAAK,MAAM,CAAC,CAAC,CAAC;YACtB,SAAS,CAAC,YAAY,GAAG,yBAAyB,EAAE,CAAC;QACtD,CAAC;IACF,CAAC;IARD,sBAQC","sourcesContent":["// required for Globalize/Cldr to properly resolve locales in the browser.\nimport * as GlobalizeType from 'globalize';\nimport 'cldrjs/dist/cldr/unresolved';\nimport supportedLocales from './locales';\nimport { generateLocales, validateLocale } from '../util/main';\n\n// TODO: use normal imports after landing https://github.com/DefinitelyTyped/DefinitelyTyped/pull/27271\nconst Globalize: typeof GlobalizeType = require('globalize/dist/globalize');\n\nexport interface CldrData {\n\tmain?: LocaleData;\n\tsupplemental?: any;\n}\n\nexport type CldrGroup = 'main' | 'supplemental';\n\nexport interface LocaleData {\n\t[locale: string]: any;\n}\n\n/**\n * A list of all required CLDR packages for an individual locale.\n */\nexport const mainPackages = Object.freeze([\n\t'dates/calendars/gregorian',\n\t'dates/fields',\n\t'dates/timeZoneNames',\n\t'numbers',\n\t'numbers/currencies',\n\t'units'\n]);\n\n/**\n * A list of all required CLDR supplement packages.\n */\nexport const supplementalPackages = Object.freeze([\n\t'currencyData',\n\t'likelySubtags',\n\t'numberingSystems',\n\t'plurals-type-cardinal',\n\t'plurals-type-ordinal',\n\t'timeData',\n\t'weekData'\n]);\n\n/**\n * @private\n * A simple map containing boolean flags indicating whether a particular CLDR package has been loaded.\n */\nconst loadCache = {\n\tmain: Object.create(null),\n\tsupplemental: generateSupplementalCache()\n};\n\n/**\n * @private\n * Generate the locale-specific data cache from a list of keys. Nested objects will be generated from\n * slash-separated strings.\n *\n * @param cache\n * An empty locale cache object.\n *\n * @param keys\n * The list of keys.\n */\nfunction generateLocaleCache(cache: any, keys: ReadonlyArray) {\n\treturn keys.reduce((tree: any, key: string) => {\n\t\tconst parts = key.split('/');\n\n\t\tif (parts.length === 1) {\n\t\t\ttree[key] = false;\n\t\t\treturn tree;\n\t\t}\n\n\t\tparts.reduce((tree: any, key: string, i: number) => {\n\t\t\tif (typeof tree[key] !== 'object') {\n\t\t\t\ttree[key] = i === parts.length - 1 ? false : Object.create(null);\n\t\t\t}\n\t\t\treturn tree[key];\n\t\t}, tree);\n\n\t\treturn tree;\n\t}, cache);\n}\n\n/**\n * @private\n * Generate the supplemental data cache.\n */\nfunction generateSupplementalCache() {\n\treturn supplementalPackages.reduce((map: any, key: string) => {\n\t\tmap[key] = false;\n\t\treturn map;\n\t}, Object.create(null));\n}\n\n/**\n * @private\n * Recursively determine whether a list of packages have been loaded for the specified CLDR group.\n *\n * @param group\n * The CLDR group object (e.g., the supplemental data, or a specific locale group)\n *\n * @param args\n * A list of keys to recursively check from left to right. For example, if [ \"en\", \"numbers\" ],\n * then `group.en.numbers` must exist for the test to pass.\n *\n * @return\n * `true` if the deepest value exists; `false` otherwise.\n */\nfunction isLoadedForGroup(group: any, args: string[]) {\n\treturn args.every((arg: string) => {\n\t\tconst next = group[arg];\n\t\tgroup = next;\n\t\treturn Boolean(next);\n\t});\n}\n\n/**\n * @private\n * Recursively flag as loaded all recognized keys on the provided CLDR data object.\n *\n * @param cache\n * The load cache (either the entire object, or a nested segment of it).\n *\n * @param localeData\n * The CLDR data object being loaded (either the entire object, or a nested segment of it).\n */\nfunction registerLocaleData(cache: any, localeData: any) {\n\tObject.keys(localeData).forEach((key: string) => {\n\t\tif (key in cache) {\n\t\t\tconst value = cache[key];\n\n\t\t\tif (typeof value === 'boolean') {\n\t\t\t\tcache[key] = true;\n\t\t\t} else {\n\t\t\t\tregisterLocaleData(value, localeData[key]);\n\t\t\t}\n\t\t}\n\t});\n}\n\n/**\n * @private\n * Flag all supplied CLDR packages for a specific locale as loaded.\n *\n * @param data\n * The `main` locale data.\n */\nfunction registerMain(data?: LocaleData) {\n\tif (!data) {\n\t\treturn;\n\t}\n\n\tObject.keys(data).forEach((locale: string) => {\n\t\tif (supportedLocales.indexOf(locale) < 0) {\n\t\t\treturn;\n\t\t}\n\n\t\tlet loadedData = loadCache.main[locale];\n\t\tif (!loadedData) {\n\t\t\tloadedData = loadCache.main[locale] = generateLocaleCache(Object.create(null), mainPackages);\n\t\t}\n\n\t\tregisterLocaleData(loadedData, data[locale]);\n\t});\n}\n\n/**\n * @private\n * Flag all supplied CLDR supplemental packages as loaded.\n *\n * @param data\n * The supplemental data.\n */\nfunction registerSupplemental(data?: any) {\n\tif (!data) {\n\t\treturn;\n\t}\n\n\tconst supplemental = loadCache.supplemental;\n\tObject.keys(data).forEach((key: string) => {\n\t\tif (key in supplemental) {\n\t\t\tsupplemental[key] = true;\n\t\t}\n\t});\n}\n\n/**\n * Determine whether a particular CLDR package has been loaded.\n *\n * Example: to check that `supplemental.likelySubtags` has been loaded, `isLoaded` would be called as\n * `isLoaded('supplemental', 'likelySubtags')`.\n *\n * @param groupName\n * The group to check; either \"main\" or \"supplemental\".\n *\n * @param ...args\n * Any remaining keys in the path to the desired package.\n *\n * @return\n * `true` if the deepest value exists; `false` otherwise.\n */\nexport function isLoaded(groupName: CldrGroup, ...args: string[]) {\n\tlet group: any = loadCache[groupName];\n\n\tif (groupName === 'main' && args.length > 0) {\n\t\tconst locale = args[0];\n\n\t\tif (!validateLocale(locale)) {\n\t\t\treturn false;\n\t\t}\n\n\t\targs = args.slice(1);\n\t\treturn generateLocales(locale).some((locale: string) => {\n\t\t\tconst next = group[locale];\n\t\t\treturn next ? isLoadedForGroup(next, args) : false;\n\t\t});\n\t}\n\n\treturn isLoadedForGroup(group, args);\n}\n\n/**\n * Load the specified CLDR data with the i18n ecosystem.\n *\n * @param data\n * A data object containing `main` and/or `supplemental` objects with CLDR data.\n */\nexport default function loadCldrData(data: CldrData): Promise {\n\tregisterMain(data.main);\n\tregisterSupplemental(data.supplemental);\n\tGlobalize.load(data);\n\treturn Promise.resolve();\n}\n\n/**\n * Clear the load cache, either the entire cache for the specified group. After calling this method,\n * `isLoaded` will return false for keys within the specified group(s).\n *\n * @param group\n * An optional group name. If not provided, then both the \"main\" and \"supplemental\" caches will be cleared.\n */\nexport function reset(group?: CldrGroup) {\n\tif (group !== 'supplemental') {\n\t\tloadCache.main = Object.create(null);\n\t}\n\n\tif (group !== 'main') {\n\t\tloadCache.supplemental = generateSupplementalCache();\n\t}\n}\n"]} \ No newline at end of file diff --git a/deps/framework/i18n/cldr/load.mjs b/deps/framework/i18n/cldr/load.mjs deleted file mode 100644 index bbc9141dae..0000000000 --- a/deps/framework/i18n/cldr/load.mjs +++ /dev/null @@ -1,215 +0,0 @@ -import 'cldrjs/dist/cldr/unresolved'; -import supportedLocales from './locales'; -import { generateLocales, validateLocale } from '../util/main'; -// TODO: use normal imports after landing https://github.com/DefinitelyTyped/DefinitelyTyped/pull/27271 -const Globalize = require('globalize/dist/globalize'); -/** - * A list of all required CLDR packages for an individual locale. - */ -export const mainPackages = Object.freeze([ - 'dates/calendars/gregorian', - 'dates/fields', - 'dates/timeZoneNames', - 'numbers', - 'numbers/currencies', - 'units' -]); -/** - * A list of all required CLDR supplement packages. - */ -export const supplementalPackages = Object.freeze([ - 'currencyData', - 'likelySubtags', - 'numberingSystems', - 'plurals-type-cardinal', - 'plurals-type-ordinal', - 'timeData', - 'weekData' -]); -/** - * @private - * A simple map containing boolean flags indicating whether a particular CLDR package has been loaded. - */ -const loadCache = { - main: Object.create(null), - supplemental: generateSupplementalCache() -}; -/** - * @private - * Generate the locale-specific data cache from a list of keys. Nested objects will be generated from - * slash-separated strings. - * - * @param cache - * An empty locale cache object. - * - * @param keys - * The list of keys. - */ -function generateLocaleCache(cache, keys) { - return keys.reduce((tree, key) => { - const parts = key.split('/'); - if (parts.length === 1) { - tree[key] = false; - return tree; - } - parts.reduce((tree, key, i) => { - if (typeof tree[key] !== 'object') { - tree[key] = i === parts.length - 1 ? false : Object.create(null); - } - return tree[key]; - }, tree); - return tree; - }, cache); -} -/** - * @private - * Generate the supplemental data cache. - */ -function generateSupplementalCache() { - return supplementalPackages.reduce((map, key) => { - map[key] = false; - return map; - }, Object.create(null)); -} -/** - * @private - * Recursively determine whether a list of packages have been loaded for the specified CLDR group. - * - * @param group - * The CLDR group object (e.g., the supplemental data, or a specific locale group) - * - * @param args - * A list of keys to recursively check from left to right. For example, if [ "en", "numbers" ], - * then `group.en.numbers` must exist for the test to pass. - * - * @return - * `true` if the deepest value exists; `false` otherwise. - */ -function isLoadedForGroup(group, args) { - return args.every((arg) => { - const next = group[arg]; - group = next; - return Boolean(next); - }); -} -/** - * @private - * Recursively flag as loaded all recognized keys on the provided CLDR data object. - * - * @param cache - * The load cache (either the entire object, or a nested segment of it). - * - * @param localeData - * The CLDR data object being loaded (either the entire object, or a nested segment of it). - */ -function registerLocaleData(cache, localeData) { - Object.keys(localeData).forEach((key) => { - if (key in cache) { - const value = cache[key]; - if (typeof value === 'boolean') { - cache[key] = true; - } - else { - registerLocaleData(value, localeData[key]); - } - } - }); -} -/** - * @private - * Flag all supplied CLDR packages for a specific locale as loaded. - * - * @param data - * The `main` locale data. - */ -function registerMain(data) { - if (!data) { - return; - } - Object.keys(data).forEach((locale) => { - if (supportedLocales.indexOf(locale) < 0) { - return; - } - let loadedData = loadCache.main[locale]; - if (!loadedData) { - loadedData = loadCache.main[locale] = generateLocaleCache(Object.create(null), mainPackages); - } - registerLocaleData(loadedData, data[locale]); - }); -} -/** - * @private - * Flag all supplied CLDR supplemental packages as loaded. - * - * @param data - * The supplemental data. - */ -function registerSupplemental(data) { - if (!data) { - return; - } - const supplemental = loadCache.supplemental; - Object.keys(data).forEach((key) => { - if (key in supplemental) { - supplemental[key] = true; - } - }); -} -/** - * Determine whether a particular CLDR package has been loaded. - * - * Example: to check that `supplemental.likelySubtags` has been loaded, `isLoaded` would be called as - * `isLoaded('supplemental', 'likelySubtags')`. - * - * @param groupName - * The group to check; either "main" or "supplemental". - * - * @param ...args - * Any remaining keys in the path to the desired package. - * - * @return - * `true` if the deepest value exists; `false` otherwise. - */ -export function isLoaded(groupName, ...args) { - let group = loadCache[groupName]; - if (groupName === 'main' && args.length > 0) { - const locale = args[0]; - if (!validateLocale(locale)) { - return false; - } - args = args.slice(1); - return generateLocales(locale).some((locale) => { - const next = group[locale]; - return next ? isLoadedForGroup(next, args) : false; - }); - } - return isLoadedForGroup(group, args); -} -/** - * Load the specified CLDR data with the i18n ecosystem. - * - * @param data - * A data object containing `main` and/or `supplemental` objects with CLDR data. - */ -export default function loadCldrData(data) { - registerMain(data.main); - registerSupplemental(data.supplemental); - Globalize.load(data); - return Promise.resolve(); -} -/** - * Clear the load cache, either the entire cache for the specified group. After calling this method, - * `isLoaded` will return false for keys within the specified group(s). - * - * @param group - * An optional group name. If not provided, then both the "main" and "supplemental" caches will be cleared. - */ -export function reset(group) { - if (group !== 'supplemental') { - loadCache.main = Object.create(null); - } - if (group !== 'main') { - loadCache.supplemental = generateSupplementalCache(); - } -} -//# sourceMappingURL=load.mjs.map \ No newline at end of file diff --git a/deps/framework/i18n/cldr/load.mjs.map b/deps/framework/i18n/cldr/load.mjs.map deleted file mode 100644 index 69170043ee..0000000000 --- a/deps/framework/i18n/cldr/load.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"load.mjs","sourceRoot":"","sources":["load.ts"],"names":[],"mappings":"AAEA,OAAO,6BAA6B,CAAC;AACrC,OAAO,gBAAgB,MAAM,WAAW,CAAC;AACzC,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAE/D,uGAAuG;AACvG,MAAM,SAAS,GAAyB,OAAO,CAAC,0BAA0B,CAAC,CAAC;AAa5E;;GAEG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,MAAM,CAAC,MAAM,CAAC;IACzC,2BAA2B;IAC3B,cAAc;IACd,qBAAqB;IACrB,SAAS;IACT,oBAAoB;IACpB,OAAO;CACP,CAAC,CAAC;AAEH;;GAEG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,MAAM,CAAC,MAAM,CAAC;IACjD,cAAc;IACd,eAAe;IACf,kBAAkB;IAClB,uBAAuB;IACvB,sBAAsB;IACtB,UAAU;IACV,UAAU;CACV,CAAC,CAAC;AAEH;;;GAGG;AACH,MAAM,SAAS,GAAG;IACjB,IAAI,EAAE,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC;IACzB,YAAY,EAAE,yBAAyB,EAAE;CACzC,CAAC;AAEF;;;;;;;;;;GAUG;AACH,6BAA6B,KAAU,EAAE,IAA2B;IACnE,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,IAAS,EAAE,GAAW,EAAE,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,IAAI,CAAC,CAAC;AACtC,CAAC;AAED;;;;;GAKG;AACH,MAAM,CAAC,OAAO,uBAAuB,IAAc;IAClD,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACxB,oBAAoB,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;IACxC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACrB,MAAM,CAAC,OAAO,CAAC,OAAO,EAAE,CAAC;AAC1B,CAAC;AAED;;;;;;GAMG;AACH,MAAM,gBAAgB,KAAiB;IACtC,EAAE,CAAC,CAAC,KAAK,KAAK,cAAc,CAAC,CAAC,CAAC;QAC9B,SAAS,CAAC,IAAI,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IACtC,CAAC;IAED,EAAE,CAAC,CAAC,KAAK,KAAK,MAAM,CAAC,CAAC,CAAC;QACtB,SAAS,CAAC,YAAY,GAAG,yBAAyB,EAAE,CAAC;IACtD,CAAC;AACF,CAAC","sourcesContent":["// required for Globalize/Cldr to properly resolve locales in the browser.\nimport * as GlobalizeType from 'globalize';\nimport 'cldrjs/dist/cldr/unresolved';\nimport supportedLocales from './locales';\nimport { generateLocales, validateLocale } from '../util/main';\n\n// TODO: use normal imports after landing https://github.com/DefinitelyTyped/DefinitelyTyped/pull/27271\nconst Globalize: typeof GlobalizeType = require('globalize/dist/globalize');\n\nexport interface CldrData {\n\tmain?: LocaleData;\n\tsupplemental?: any;\n}\n\nexport type CldrGroup = 'main' | 'supplemental';\n\nexport interface LocaleData {\n\t[locale: string]: any;\n}\n\n/**\n * A list of all required CLDR packages for an individual locale.\n */\nexport const mainPackages = Object.freeze([\n\t'dates/calendars/gregorian',\n\t'dates/fields',\n\t'dates/timeZoneNames',\n\t'numbers',\n\t'numbers/currencies',\n\t'units'\n]);\n\n/**\n * A list of all required CLDR supplement packages.\n */\nexport const supplementalPackages = Object.freeze([\n\t'currencyData',\n\t'likelySubtags',\n\t'numberingSystems',\n\t'plurals-type-cardinal',\n\t'plurals-type-ordinal',\n\t'timeData',\n\t'weekData'\n]);\n\n/**\n * @private\n * A simple map containing boolean flags indicating whether a particular CLDR package has been loaded.\n */\nconst loadCache = {\n\tmain: Object.create(null),\n\tsupplemental: generateSupplementalCache()\n};\n\n/**\n * @private\n * Generate the locale-specific data cache from a list of keys. Nested objects will be generated from\n * slash-separated strings.\n *\n * @param cache\n * An empty locale cache object.\n *\n * @param keys\n * The list of keys.\n */\nfunction generateLocaleCache(cache: any, keys: ReadonlyArray) {\n\treturn keys.reduce((tree: any, key: string) => {\n\t\tconst parts = key.split('/');\n\n\t\tif (parts.length === 1) {\n\t\t\ttree[key] = false;\n\t\t\treturn tree;\n\t\t}\n\n\t\tparts.reduce((tree: any, key: string, i: number) => {\n\t\t\tif (typeof tree[key] !== 'object') {\n\t\t\t\ttree[key] = i === parts.length - 1 ? false : Object.create(null);\n\t\t\t}\n\t\t\treturn tree[key];\n\t\t}, tree);\n\n\t\treturn tree;\n\t}, cache);\n}\n\n/**\n * @private\n * Generate the supplemental data cache.\n */\nfunction generateSupplementalCache() {\n\treturn supplementalPackages.reduce((map: any, key: string) => {\n\t\tmap[key] = false;\n\t\treturn map;\n\t}, Object.create(null));\n}\n\n/**\n * @private\n * Recursively determine whether a list of packages have been loaded for the specified CLDR group.\n *\n * @param group\n * The CLDR group object (e.g., the supplemental data, or a specific locale group)\n *\n * @param args\n * A list of keys to recursively check from left to right. For example, if [ \"en\", \"numbers\" ],\n * then `group.en.numbers` must exist for the test to pass.\n *\n * @return\n * `true` if the deepest value exists; `false` otherwise.\n */\nfunction isLoadedForGroup(group: any, args: string[]) {\n\treturn args.every((arg: string) => {\n\t\tconst next = group[arg];\n\t\tgroup = next;\n\t\treturn Boolean(next);\n\t});\n}\n\n/**\n * @private\n * Recursively flag as loaded all recognized keys on the provided CLDR data object.\n *\n * @param cache\n * The load cache (either the entire object, or a nested segment of it).\n *\n * @param localeData\n * The CLDR data object being loaded (either the entire object, or a nested segment of it).\n */\nfunction registerLocaleData(cache: any, localeData: any) {\n\tObject.keys(localeData).forEach((key: string) => {\n\t\tif (key in cache) {\n\t\t\tconst value = cache[key];\n\n\t\t\tif (typeof value === 'boolean') {\n\t\t\t\tcache[key] = true;\n\t\t\t} else {\n\t\t\t\tregisterLocaleData(value, localeData[key]);\n\t\t\t}\n\t\t}\n\t});\n}\n\n/**\n * @private\n * Flag all supplied CLDR packages for a specific locale as loaded.\n *\n * @param data\n * The `main` locale data.\n */\nfunction registerMain(data?: LocaleData) {\n\tif (!data) {\n\t\treturn;\n\t}\n\n\tObject.keys(data).forEach((locale: string) => {\n\t\tif (supportedLocales.indexOf(locale) < 0) {\n\t\t\treturn;\n\t\t}\n\n\t\tlet loadedData = loadCache.main[locale];\n\t\tif (!loadedData) {\n\t\t\tloadedData = loadCache.main[locale] = generateLocaleCache(Object.create(null), mainPackages);\n\t\t}\n\n\t\tregisterLocaleData(loadedData, data[locale]);\n\t});\n}\n\n/**\n * @private\n * Flag all supplied CLDR supplemental packages as loaded.\n *\n * @param data\n * The supplemental data.\n */\nfunction registerSupplemental(data?: any) {\n\tif (!data) {\n\t\treturn;\n\t}\n\n\tconst supplemental = loadCache.supplemental;\n\tObject.keys(data).forEach((key: string) => {\n\t\tif (key in supplemental) {\n\t\t\tsupplemental[key] = true;\n\t\t}\n\t});\n}\n\n/**\n * Determine whether a particular CLDR package has been loaded.\n *\n * Example: to check that `supplemental.likelySubtags` has been loaded, `isLoaded` would be called as\n * `isLoaded('supplemental', 'likelySubtags')`.\n *\n * @param groupName\n * The group to check; either \"main\" or \"supplemental\".\n *\n * @param ...args\n * Any remaining keys in the path to the desired package.\n *\n * @return\n * `true` if the deepest value exists; `false` otherwise.\n */\nexport function isLoaded(groupName: CldrGroup, ...args: string[]) {\n\tlet group: any = loadCache[groupName];\n\n\tif (groupName === 'main' && args.length > 0) {\n\t\tconst locale = args[0];\n\n\t\tif (!validateLocale(locale)) {\n\t\t\treturn false;\n\t\t}\n\n\t\targs = args.slice(1);\n\t\treturn generateLocales(locale).some((locale: string) => {\n\t\t\tconst next = group[locale];\n\t\t\treturn next ? isLoadedForGroup(next, args) : false;\n\t\t});\n\t}\n\n\treturn isLoadedForGroup(group, args);\n}\n\n/**\n * Load the specified CLDR data with the i18n ecosystem.\n *\n * @param data\n * A data object containing `main` and/or `supplemental` objects with CLDR data.\n */\nexport default function loadCldrData(data: CldrData): Promise {\n\tregisterMain(data.main);\n\tregisterSupplemental(data.supplemental);\n\tGlobalize.load(data);\n\treturn Promise.resolve();\n}\n\n/**\n * Clear the load cache, either the entire cache for the specified group. After calling this method,\n * `isLoaded` will return false for keys within the specified group(s).\n *\n * @param group\n * An optional group name. If not provided, then both the \"main\" and \"supplemental\" caches will be cleared.\n */\nexport function reset(group?: CldrGroup) {\n\tif (group !== 'supplemental') {\n\t\tloadCache.main = Object.create(null);\n\t}\n\n\tif (group !== 'main') {\n\t\tloadCache.supplemental = generateSupplementalCache();\n\t}\n}\n"]} \ No newline at end of file diff --git a/deps/framework/i18n/cldr/locales.d.ts b/deps/framework/i18n/cldr/locales.d.ts deleted file mode 100644 index e197f74e66..0000000000 --- a/deps/framework/i18n/cldr/locales.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -/** - * A list of `cldr-data/main` directories used to load the correct CLDR data for a given locale. - */ -declare const localesList: string[]; -export default localesList; diff --git a/deps/framework/i18n/cldr/locales.js b/deps/framework/i18n/cldr/locales.js deleted file mode 100644 index 90cb424d96..0000000000 --- a/deps/framework/i18n/cldr/locales.js +++ /dev/null @@ -1,533 +0,0 @@ -(function (factory) { - if (typeof module === "object" && typeof module.exports === "object") { - var v = factory(require, exports); - if (v !== undefined) module.exports = v; - } - else if (typeof define === "function" && define.amd) { - define(["require", "exports"], factory); - } -})(function (require, exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - /** - * A list of `cldr-data/main` directories used to load the correct CLDR data for a given locale. - */ - var localesList = [ - 'af-NA', - 'af', - 'agq', - 'ak', - 'am', - 'ar-AE', - 'ar-BH', - 'ar-DJ', - 'ar-DZ', - 'ar-EG', - 'ar-EH', - 'ar-ER', - 'ar-IL', - 'ar-IQ', - 'ar-JO', - 'ar-KM', - 'ar-KW', - 'ar-LB', - 'ar-LY', - 'ar-MA', - 'ar-MR', - 'ar-OM', - 'ar-PS', - 'ar-QA', - 'ar-SA', - 'ar-SD', - 'ar-SO', - 'ar-SS', - 'ar-SY', - 'ar-TD', - 'ar-TN', - 'ar-YE', - 'ar', - 'as', - 'asa', - 'ast', - 'az-Cyrl', - 'az-Latn', - 'az', - 'bas', - 'be', - 'bem', - 'bez', - 'bg', - 'bm', - 'bn-IN', - 'bn', - 'bo-IN', - 'bo', - 'br', - 'brx', - 'bs-Cyrl', - 'bs-Latn', - 'bs', - 'ca-AD', - 'ca-ES-VALENCIA', - 'ca-FR', - 'ca-IT', - 'ca', - 'ce', - 'cgg', - 'chr', - 'ckb-IR', - 'ckb', - 'cs', - 'cu', - 'cy', - 'da-GL', - 'da', - 'dav', - 'de-AT', - 'de-BE', - 'de-CH', - 'de-IT', - 'de-LI', - 'de-LU', - 'de', - 'dje', - 'dsb', - 'dua', - 'dyo', - 'dz', - 'ebu', - 'ee-TG', - 'ee', - 'el-CY', - 'el', - 'en-001', - 'en-150', - 'en-AG', - 'en-AI', - 'en-AS', - 'en-AT', - 'en-AU', - 'en-BB', - 'en-BE', - 'en-BI', - 'en-BM', - 'en-BS', - 'en-BW', - 'en-BZ', - 'en-CA', - 'en-CC', - 'en-CH', - 'en-CK', - 'en-CM', - 'en-CX', - 'en-CY', - 'en-DE', - 'en-DG', - 'en-DK', - 'en-DM', - 'en-ER', - 'en-FI', - 'en-FJ', - 'en-FK', - 'en-FM', - 'en-GB', - 'en-GD', - 'en-GG', - 'en-GH', - 'en-GI', - 'en-GM', - 'en-GU', - 'en-GY', - 'en-HK', - 'en-IE', - 'en-IL', - 'en-IM', - 'en-IN', - 'en-IO', - 'en-JE', - 'en-JM', - 'en-KE', - 'en-KI', - 'en-KN', - 'en-KY', - 'en-LC', - 'en-LR', - 'en-LS', - 'en-MG', - 'en-MH', - 'en-MO', - 'en-MP', - 'en-MS', - 'en-MT', - 'en-MU', - 'en-MW', - 'en-MY', - 'en-NA', - 'en-NF', - 'en-NG', - 'en-NL', - 'en-NR', - 'en-NU', - 'en-NZ', - 'en-PG', - 'en-PH', - 'en-PK', - 'en-PN', - 'en-PR', - 'en-PW', - 'en-RW', - 'en-SB', - 'en-SC', - 'en-SD', - 'en-SE', - 'en-SG', - 'en-SH', - 'en-SI', - 'en-SL', - 'en-SS', - 'en-SX', - 'en-SZ', - 'en-TC', - 'en-TK', - 'en-TO', - 'en-TT', - 'en-TV', - 'en-TZ', - 'en-UG', - 'en-UM', - 'en-US-POSIX', - 'en-VC', - 'en-VG', - 'en-VI', - 'en-VU', - 'en-WS', - 'en-ZA', - 'en-ZM', - 'en-ZW', - 'en', - 'eo', - 'es-419', - 'es-AR', - 'es-BO', - 'es-BR', - 'es-CL', - 'es-CO', - 'es-CR', - 'es-CU', - 'es-DO', - 'es-EA', - 'es-EC', - 'es-GQ', - 'es-GT', - 'es-HN', - 'es-IC', - 'es-MX', - 'es-NI', - 'es-PA', - 'es-PE', - 'es-PH', - 'es-PR', - 'es-PY', - 'es-SV', - 'es-US', - 'es-UY', - 'es-VE', - 'es', - 'et', - 'eu', - 'ewo', - 'fa-AF', - 'fa', - 'ff-CM', - 'ff-GN', - 'ff-MR', - 'ff', - 'fi', - 'fil', - 'fo-DK', - 'fo', - 'fr-BE', - 'fr-BF', - 'fr-BI', - 'fr-BJ', - 'fr-BL', - 'fr-CA', - 'fr-CD', - 'fr-CF', - 'fr-CG', - 'fr-CH', - 'fr-CI', - 'fr-CM', - 'fr-DJ', - 'fr-DZ', - 'fr-GA', - 'fr-GF', - 'fr-GN', - 'fr-GP', - 'fr-GQ', - 'fr-HT', - 'fr-KM', - 'fr-LU', - 'fr-MA', - 'fr-MC', - 'fr-MF', - 'fr-MG', - 'fr-ML', - 'fr-MQ', - 'fr-MR', - 'fr-MU', - 'fr-NC', - 'fr-NE', - 'fr-PF', - 'fr-PM', - 'fr-RE', - 'fr-RW', - 'fr-SC', - 'fr-SN', - 'fr-SY', - 'fr-TD', - 'fr-TG', - 'fr-TN', - 'fr-VU', - 'fr-WF', - 'fr-YT', - 'fr', - 'fur', - 'fy', - 'ga', - 'gd', - 'gl', - 'gsw-FR', - 'gsw-LI', - 'gsw', - 'gu', - 'guz', - 'gv', - 'ha-GH', - 'ha-NE', - 'ha', - 'haw', - 'he', - 'hi', - 'hr-BA', - 'hr', - 'hsb', - 'hu', - 'hy', - 'id', - 'ig', - 'ii', - 'is', - 'it-CH', - 'it-SM', - 'it', - 'ja', - 'jgo', - 'jmc', - 'ka', - 'kab', - 'kam', - 'kde', - 'kea', - 'khq', - 'ki', - 'kk', - 'kkj', - 'kl', - 'kln', - 'km', - 'kn', - 'ko-KP', - 'ko', - 'kok', - 'ks', - 'ksb', - 'ksf', - 'ksh', - 'kw', - 'ky', - 'lag', - 'lb', - 'lg', - 'lkt', - 'ln-AO', - 'ln-CF', - 'ln-CG', - 'ln', - 'lo', - 'lrc-IQ', - 'lrc', - 'lt', - 'lu', - 'luo', - 'luy', - 'lv', - 'mas-TZ', - 'mas', - 'mer', - 'mfe', - 'mg', - 'mgh', - 'mgo', - 'mk', - 'ml', - 'mn', - 'mr', - 'ms-BN', - 'ms-SG', - 'ms', - 'mt', - 'mua', - 'my', - 'mzn', - 'naq', - 'nb-SJ', - 'nb', - 'nd', - 'nds-NL', - 'nds', - 'ne-IN', - 'ne', - 'nl-AW', - 'nl-BE', - 'nl-BQ', - 'nl-CW', - 'nl-SR', - 'nl-SX', - 'nl', - 'nmg', - 'nn', - 'nnh', - 'nus', - 'nyn', - 'om-KE', - 'om', - 'or', - 'os-RU', - 'os', - 'pa-Arab', - 'pa-Guru', - 'pa', - 'pl', - 'prg', - 'ps', - 'pt-AO', - 'pt-CH', - 'pt-CV', - 'pt-GQ', - 'pt-GW', - 'pt-LU', - 'pt-MO', - 'pt-MZ', - 'pt-PT', - 'pt-ST', - 'pt-TL', - 'pt', - 'qu-BO', - 'qu-EC', - 'qu', - 'rm', - 'rn', - 'ro-MD', - 'ro', - 'rof', - 'root', - 'ru-BY', - 'ru-KG', - 'ru-KZ', - 'ru-MD', - 'ru-UA', - 'ru', - 'rw', - 'rwk', - 'sah', - 'saq', - 'sbp', - 'se-FI', - 'se-SE', - 'se', - 'seh', - 'ses', - 'sg', - 'shi-Latn', - 'shi-Tfng', - 'shi', - 'si', - 'sk', - 'sl', - 'smn', - 'sn', - 'so-DJ', - 'so-ET', - 'so-KE', - 'so', - 'sq-MK', - 'sq-XK', - 'sq', - 'sr-Cyrl-BA', - 'sr-Cyrl-ME', - 'sr-Cyrl-XK', - 'sr-Cyrl', - 'sr-Latn-BA', - 'sr-Latn-ME', - 'sr-Latn-XK', - 'sr-Latn', - 'sr', - 'sv-AX', - 'sv-FI', - 'sv', - 'sw-CD', - 'sw-KE', - 'sw-UG', - 'sw', - 'ta-LK', - 'ta-MY', - 'ta-SG', - 'ta', - 'te', - 'teo-KE', - 'teo', - 'th', - 'ti-ER', - 'ti', - 'tk', - 'to', - 'tr-CY', - 'tr', - 'twq', - 'tzm', - 'ug', - 'uk', - 'ur-IN', - 'ur', - 'uz-Arab', - 'uz-Cyrl', - 'uz-Latn', - 'uz', - 'vai-Latn', - 'vai-Vaii', - 'vai', - 'vi', - 'vo', - 'vun', - 'wae', - 'xog', - 'yav', - 'yi', - 'yo-BJ', - 'yo', - 'yue', - 'zgh', - 'zh-Hans-HK', - 'zh-Hans-MO', - 'zh-Hans-SG', - 'zh-Hans', - 'zh-Hant-HK', - 'zh-Hant-MO', - 'zh-Hant', - 'zh', - 'zu' - ]; - exports.default = localesList; -}); -//# sourceMappingURL=locales.js.map \ No newline at end of file diff --git a/deps/framework/i18n/cldr/locales.js.map b/deps/framework/i18n/cldr/locales.js.map deleted file mode 100644 index 101d4aa8dc..0000000000 --- a/deps/framework/i18n/cldr/locales.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"locales.js","sourceRoot":"","sources":["locales.ts"],"names":[],"mappings":";;;;;;;;;;;IAAA;;OAEG;IACH,IAAM,WAAW,GAAG;QACnB,OAAO;QACP,IAAI;QACJ,KAAK;QACL,IAAI;QACJ,IAAI;QACJ,OAAO;QACP,OAAO;QACP,OAAO;QACP,OAAO;QACP,OAAO;QACP,OAAO;QACP,OAAO;QACP,OAAO;QACP,OAAO;QACP,OAAO;QACP,OAAO;QACP,OAAO;QACP,OAAO;QACP,OAAO;QACP,OAAO;QACP,OAAO;QACP,OAAO;QACP,OAAO;QACP,OAAO;QACP,OAAO;QACP,OAAO;QACP,OAAO;QACP,OAAO;QACP,OAAO;QACP,OAAO;QACP,OAAO;QACP,OAAO;QACP,IAAI;QACJ,IAAI;QACJ,KAAK;QACL,KAAK;QACL,SAAS;QACT,SAAS;QACT,IAAI;QACJ,KAAK;QACL,IAAI;QACJ,KAAK;QACL,KAAK;QACL,IAAI;QACJ,IAAI;QACJ,OAAO;QACP,IAAI;QACJ,OAAO;QACP,IAAI;QACJ,IAAI;QACJ,KAAK;QACL,SAAS;QACT,SAAS;QACT,IAAI;QACJ,OAAO;QACP,gBAAgB;QAChB,OAAO;QACP,OAAO;QACP,IAAI;QACJ,IAAI;QACJ,KAAK;QACL,KAAK;QACL,QAAQ;QACR,KAAK;QACL,IAAI;QACJ,IAAI;QACJ,IAAI;QACJ,OAAO;QACP,IAAI;QACJ,KAAK;QACL,OAAO;QACP,OAAO;QACP,OAAO;QACP,OAAO;QACP,OAAO;QACP,OAAO;QACP,IAAI;QACJ,KAAK;QACL,KAAK;QACL,KAAK;QACL,KAAK;QACL,IAAI;QACJ,KAAK;QACL,OAAO;QACP,IAAI;QACJ,OAAO;QACP,IAAI;QACJ,QAAQ;QACR,QAAQ;QACR,OAAO;QACP,OAAO;QACP,OAAO;QACP,OAAO;QACP,OAAO;QACP,OAAO;QACP,OAAO;QACP,OAAO;QACP,OAAO;QACP,OAAO;QACP,OAAO;QACP,OAAO;QACP,OAAO;QACP,OAAO;QACP,OAAO;QACP,OAAO;QACP,OAAO;QACP,OAAO;QACP,OAAO;QACP,OAAO;QACP,OAAO;QACP,OAAO;QACP,OAAO;QACP,OAAO;QACP,OAAO;QACP,OAAO;QACP,OAAO;QACP,OAAO;QACP,OAAO;QACP,OAAO;QACP,OAAO;QACP,OAAO;QACP,OAAO;QACP,OAAO;QACP,OAAO;QACP,OAAO;QACP,OAAO;QACP,OAAO;QACP,OAAO;QACP,OAAO;QACP,OAAO;QACP,OAAO;QACP,OAAO;QACP,OAAO;QACP,OAAO;QACP,OAAO;QACP,OAAO;QACP,OAAO;QACP,OAAO;QACP,OAAO;QACP,OAAO;QACP,OAAO;QACP,OAAO;QACP,OAAO;QACP,OAAO;QACP,OAAO;QACP,OAAO;QACP,OAAO;QACP,OAAO;QACP,OAAO;QACP,OAAO;QACP,OAAO;QACP,OAAO;QACP,OAAO;QACP,OAAO;QACP,OAAO;QACP,OAAO;QACP,OAAO;QACP,OAAO;QACP,OAAO;QACP,OAAO;QACP,OAAO;QACP,OAAO;QACP,OAAO;QACP,OAAO;QACP,OAAO;QACP,OAAO;QACP,OAAO;QACP,OAAO;QACP,OAAO;QACP,OAAO;QACP,OAAO;QACP,OAAO;QACP,OAAO;QACP,OAAO;QACP,OAAO;QACP,OAAO;QACP,OAAO;QACP,OAAO;QACP,OAAO;QACP,OAAO;QACP,OAAO;QACP,OAAO;QACP,aAAa;QACb,OAAO;QACP,OAAO;QACP,OAAO;QACP,OAAO;QACP,OAAO;QACP,OAAO;QACP,OAAO;QACP,OAAO;QACP,IAAI;QACJ,IAAI;QACJ,QAAQ;QACR,OAAO;QACP,OAAO;QACP,OAAO;QACP,OAAO;QACP,OAAO;QACP,OAAO;QACP,OAAO;QACP,OAAO;QACP,OAAO;QACP,OAAO;QACP,OAAO;QACP,OAAO;QACP,OAAO;QACP,OAAO;QACP,OAAO;QACP,OAAO;QACP,OA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QACL,OAAO;QACP,OAAO;QACP,IAAI;QACJ,KAAK;QACL,KAAK;QACL,IAAI;QACJ,UAAU;QACV,UAAU;QACV,KAAK;QACL,IAAI;QACJ,IAAI;QACJ,IAAI;QACJ,KAAK;QACL,IAAI;QACJ,OAAO;QACP,OAAO;QACP,OAAO;QACP,IAAI;QACJ,OAAO;QACP,OAAO;QACP,IAAI;QACJ,YAAY;QACZ,YAAY;QACZ,YAAY;QACZ,SAAS;QACT,YAAY;QACZ,YAAY;QACZ,YAAY;QACZ,SAAS;QACT,IAAI;QACJ,OAAO;QACP,OAAO;QACP,IAAI;QACJ,OAAO;QACP,OAAO;QACP,OAAO;QACP,IAAI;QACJ,OAAO;QACP,OAAO;QACP,OAAO;QACP,IAAI;QACJ,IAAI;QACJ,QAAQ;QACR,KAAK;QACL,IAAI;QACJ,OAAO;QACP,IAAI;QACJ,IAAI;QACJ,IAAI;QACJ,OAAO;QACP,IAAI;QACJ,KAAK;QACL,KAAK;QACL,IAAI;QACJ,IAAI;QACJ,OAAO;QACP,IAAI;QACJ,SAAS;QACT,SAAS;QACT,SAAS;QACT,IAAI;QACJ,UAAU;QACV,UAAU;QACV,KAAK;QACL,IAAI;QACJ,IAAI;QACJ,KAAK;QACL,KAAK;QACL,KAAK;QACL,KAAK;QACL,IAAI;QACJ,OAAO;QACP,IAAI;QACJ,KAAK;QACL,KAAK;QACL,YAAY;QACZ,YAAY;QACZ,YAAY;QACZ,SAAS;QACT,YAAY;QACZ,YAAY;QACZ,SAAS;QACT,IAAI;QACJ,IAAI;KACJ,CAAC;IACF,kBAAe,WAAW,CAAC","sourcesContent":["/**\n * A list of `cldr-data/main` directories used to load the correct CLDR data for a given locale.\n */\nconst localesList = [\n\t'af-NA',\n\t'af',\n\t'agq',\n\t'ak',\n\t'am',\n\t'ar-AE',\n\t'ar-BH',\n\t'ar-DJ',\n\t'ar-DZ',\n\t'ar-EG',\n\t'ar-EH',\n\t'ar-ER',\n\t'ar-IL',\n\t'ar-IQ',\n\t'ar-JO',\n\t'ar-KM',\n\t'ar-KW',\n\t'ar-LB',\n\t'ar-LY',\n\t'ar-MA',\n\t'ar-MR',\n\t'ar-OM',\n\t'ar-PS',\n\t'ar-QA',\n\t'ar-SA',\n\t'ar-SD',\n\t'ar-SO',\n\t'ar-SS',\n\t'ar-SY',\n\t'ar-TD',\n\t'ar-TN',\n\t'ar-YE',\n\t'ar',\n\t'as',\n\t'asa',\n\t'ast',\n\t'az-Cyrl',\n\t'az-Latn',\n\t'az',\n\t'bas',\n\t'be',\n\t'bem',\n\t'bez',\n\t'bg',\n\t'bm',\n\t'bn-IN',\n\t'bn',\n\t'bo-IN',\n\t'bo',\n\t'br',\n\t'brx',\n\t'bs-Cyrl',\n\t'bs-Latn',\n\t'bs',\n\t'ca-AD',\n\t'ca-ES-VALENCIA',\n\t'ca-FR',\n\t'ca-IT',\n\t'ca',\n\t'ce',\n\t'cgg',\n\t'chr',\n\t'ckb-IR',\n\t'ckb',\n\t'cs',\n\t'cu',\n\t'cy',\n\t'da-GL',\n\t'da',\n\t'dav',\n\t'de-AT',\n\t'de-BE',\n\t'de-CH',\n\t'de-IT',\n\t'de-LI',\n\t'de-LU',\n\t'de',\n\t'dje',\n\t'dsb',\n\t'dua',\n\t'dyo',\n\t'dz',\n\t'ebu',\n\t'ee-TG',\n\t'ee',\n\t'el-CY',\n\t'el',\n\t'en-001',\n\t'en-150',\n\t'en-AG',\n\t'en-AI',\n\t'en-AS',\n\t'en-AT',\n\t'en-AU',\n\t'en-BB',\n\t'en-BE',\n\t'en-BI',\n\t'en-BM',\n\t'en-BS',\n\t'en-BW',\n\t'en-BZ',\n\t'en-CA',\n\t'en-CC',\n\t'en-CH',\n\t'en-CK',\n\t'en-CM',\n\t'en-CX',\n\t'en-CY',\n\t'en-DE',\n\t'en-DG',\n\t'en-DK',\n\t'en-DM',\n\t'en-ER',\n\t'en-FI',\n\t'en-FJ',\n\t'en-FK',\n\t'en-FM',\n\t'en-GB',\n\t'en-GD',\n\t'en-GG',\n\t'en-GH',\n\t'en-GI',\n\t'en-GM',\n\t'en-GU',\n\t'en-GY',\n\t'en-HK',\n\t'en-IE',\n\t'en-IL',\n\t'en-IM',\n\t'en-IN',\n\t'en-IO',\n\t'en-JE',\n\t'en-JM',\n\t'en-KE',\n\t'en-KI',\n\t'en-KN',\n\t'en-KY',\n\t'en-LC',\n\t'en-LR',\n\t'en-LS',\n\t'en-MG',\n\t'en-MH',\n\t'en-MO',\n\t'en-MP',\n\t'en-MS',\n\t'en-MT',\n\t'en-MU',\n\t'en-MW',\n\t'en-MY',\n\t'en-NA',\n\t'en-NF',\n\t'en-NG',\n\t'en-NL',\n\t'en-NR',\n\t'en-NU',\n\t'en-NZ',\n\t'en-PG',\n\t'en-PH',\n\t'en-PK',\n\t'en-PN',\n\t'en-PR',\n\t'en-PW',\n\t'en-RW',\n\t'en-SB',\n\t'en-SC',\n\t'en-SD',\n\t'en-SE',\n\t'en-SG',\n\t'en-SH',\n\t'en-SI',\n\t'en-SL',\n\t'en-SS',\n\t'en-SX',\n\t'en-SZ',\n\t'en-TC',\n\t'en-TK',\n\t'en-TO',\n\t'en-TT',\n\t'en-TV',\n\t'en-TZ',\n\t'en-UG',\n\t'en-UM',\n\t'en-US-POSIX',\n\t'en-VC',\n\t'en-VG',\n\t'en-VI',\n\t'en-VU',\n\t'en-WS',\n\t'en-ZA',\n\t'en-ZM',\n\t'en-ZW',\n\t'en',\n\t'eo',\n\t'es-419',\n\t'es-AR',\n\t'es-BO',\n\t'es-BR',\n\t'es-CL',\n\t'es-CO',\n\t'es-CR',\n\t'es-CU',\n\t'es-DO',\n\t'es-EA',\n\t'es-EC',\n\t'es-GQ',\n\t'es-GT',\n\t'es-HN',\n\t'es-IC',\n\t'es-MX',\n\t'es-NI',\n\t'es-PA',\n\t'es-PE',\n\t'es-PH',\n\t'es-PR',\n\t'es-PY',\n\t'es-SV',\n\t'es-US',\n\t'es-UY',\n\t'es-VE',\n\t'es',\n\t'et',\n\t'eu',\n\t'ewo',\n\t'fa-AF',\n\t'fa',\n\t'ff-CM',\n\t'ff-GN',\n\t'ff-MR',\n\t'ff',\n\t'fi',\n\t'fil',\n\t'fo-DK',\n\t'fo',\n\t'fr-BE',\n\t'fr-BF',\n\t'fr-BI',\n\t'fr-BJ',\n\t'fr-BL',\n\t'fr-CA',\n\t'fr-CD',\n\t'fr-CF',\n\t'fr-CG',\n\t'fr-CH',\n\t'fr-CI',\n\t'fr-CM',\n\t'fr-DJ',\n\t'fr-DZ',\n\t'fr-GA',\n\t'fr-GF',\n\t'fr-GN',\n\t'fr-GP',\n\t'fr-GQ',\n\t'fr-HT',\n\t'fr-KM',\n\t'fr-LU',\n\t'fr-MA',\n\t'fr-MC',\n\t'fr-MF',\n\t'fr-MG',\n\t'fr-ML',\n\t'fr-MQ',\n\t'fr-MR',\n\t'fr-MU',\n\t'fr-NC',\n\t'fr-NE',\n\t'fr-PF',\n\t'fr-PM',\n\t'fr-RE',\n\t'fr-RW',\n\t'fr-SC',\n\t'fr-SN',\n\t'fr-SY',\n\t'fr-TD',\n\t'fr-TG',\n\t'fr-TN',\n\t'fr-VU',\n\t'fr-WF',\n\t'fr-YT',\n\t'fr',\n\t'fur',\n\t'fy',\n\t'ga',\n\t'gd',\n\t'gl',\n\t'gsw-FR',\n\t'gsw-LI',\n\t'gsw',\n\t'gu',\n\t'guz',\n\t'gv',\n\t'ha-GH',\n\t'ha-NE',\n\t'ha',\n\t'haw',\n\t'he',\n\t'hi',\n\t'hr-BA',\n\t'hr',\n\t'hsb',\n\t'hu',\n\t'hy',\n\t'id',\n\t'ig',\n\t'ii',\n\t'is',\n\t'it-CH',\n\t'it-SM',\n\t'it',\n\t'ja',\n\t'jgo',\n\t'jmc',\n\t'ka',\n\t'kab',\n\t'kam',\n\t'kde',\n\t'kea',\n\t'khq',\n\t'ki',\n\t'kk',\n\t'kkj',\n\t'kl',\n\t'kln',\n\t'km',\n\t'kn',\n\t'ko-KP',\n\t'ko',\n\t'kok',\n\t'ks',\n\t'ksb',\n\t'ksf',\n\t'ksh',\n\t'kw',\n\t'ky',\n\t'lag',\n\t'lb',\n\t'lg',\n\t'lkt',\n\t'ln-AO',\n\t'ln-CF',\n\t'ln-CG',\n\t'ln',\n\t'lo',\n\t'lrc-IQ',\n\t'lrc',\n\t'lt',\n\t'lu',\n\t'luo',\n\t'luy',\n\t'lv',\n\t'mas-TZ',\n\t'mas',\n\t'mer',\n\t'mfe',\n\t'mg',\n\t'mgh',\n\t'mgo',\n\t'mk',\n\t'ml',\n\t'mn',\n\t'mr',\n\t'ms-BN',\n\t'ms-SG',\n\t'ms',\n\t'mt',\n\t'mua',\n\t'my',\n\t'mzn',\n\t'naq',\n\t'nb-SJ',\n\t'nb',\n\t'nd',\n\t'nds-NL',\n\t'nds',\n\t'ne-IN',\n\t'ne',\n\t'nl-AW',\n\t'nl-BE',\n\t'nl-BQ',\n\t'nl-CW',\n\t'nl-SR',\n\t'nl-SX',\n\t'nl',\n\t'nmg',\n\t'nn',\n\t'nnh',\n\t'nus',\n\t'nyn',\n\t'om-KE',\n\t'om',\n\t'or',\n\t'os-RU',\n\t'os',\n\t'pa-Arab',\n\t'pa-Guru',\n\t'pa',\n\t'pl',\n\t'prg',\n\t'ps',\n\t'pt-AO',\n\t'pt-CH',\n\t'pt-CV',\n\t'pt-GQ',\n\t'pt-GW',\n\t'pt-LU',\n\t'pt-MO',\n\t'pt-MZ',\n\t'pt-PT',\n\t'pt-ST',\n\t'pt-TL',\n\t'pt',\n\t'qu-BO',\n\t'qu-EC',\n\t'qu',\n\t'rm',\n\t'rn',\n\t'ro-MD',\n\t'ro',\n\t'rof',\n\t'root',\n\t'ru-BY',\n\t'ru-KG',\n\t'ru-KZ',\n\t'ru-MD',\n\t'ru-UA',\n\t'ru',\n\t'rw',\n\t'rwk',\n\t'sah',\n\t'saq',\n\t'sbp',\n\t'se-FI',\n\t'se-SE',\n\t'se',\n\t'seh',\n\t'ses',\n\t'sg',\n\t'shi-Latn',\n\t'shi-Tfng',\n\t'shi',\n\t'si',\n\t'sk',\n\t'sl',\n\t'smn',\n\t'sn',\n\t'so-DJ',\n\t'so-ET',\n\t'so-KE',\n\t'so',\n\t'sq-MK',\n\t'sq-XK',\n\t'sq',\n\t'sr-Cyrl-BA',\n\t'sr-Cyrl-ME',\n\t'sr-Cyrl-XK',\n\t'sr-Cyrl',\n\t'sr-Latn-BA',\n\t'sr-Latn-ME',\n\t'sr-Latn-XK',\n\t'sr-Latn',\n\t'sr',\n\t'sv-AX',\n\t'sv-FI',\n\t'sv',\n\t'sw-CD',\n\t'sw-KE',\n\t'sw-UG',\n\t'sw',\n\t'ta-LK',\n\t'ta-MY',\n\t'ta-SG',\n\t'ta',\n\t'te',\n\t'teo-KE',\n\t'teo',\n\t'th',\n\t'ti-ER',\n\t'ti',\n\t'tk',\n\t'to',\n\t'tr-CY',\n\t'tr',\n\t'twq',\n\t'tzm',\n\t'ug',\n\t'uk',\n\t'ur-IN',\n\t'ur',\n\t'uz-Arab',\n\t'uz-Cyrl',\n\t'uz-Latn',\n\t'uz',\n\t'vai-Latn',\n\t'vai-Vaii',\n\t'vai',\n\t'vi',\n\t'vo',\n\t'vun',\n\t'wae',\n\t'xog',\n\t'yav',\n\t'yi',\n\t'yo-BJ',\n\t'yo',\n\t'yue',\n\t'zgh',\n\t'zh-Hans-HK',\n\t'zh-Hans-MO',\n\t'zh-Hans-SG',\n\t'zh-Hans',\n\t'zh-Hant-HK',\n\t'zh-Hant-MO',\n\t'zh-Hant',\n\t'zh',\n\t'zu'\n];\nexport default localesList;\n"]} \ No newline at end of file diff --git a/deps/framework/i18n/cldr/locales.mjs b/deps/framework/i18n/cldr/locales.mjs deleted file mode 100644 index b202de3939..0000000000 --- a/deps/framework/i18n/cldr/locales.mjs +++ /dev/null @@ -1,521 +0,0 @@ -/** - * A list of `cldr-data/main` directories used to load the correct CLDR data for a given locale. - */ -const localesList = [ - 'af-NA', - 'af', - 'agq', - 'ak', - 'am', - 'ar-AE', - 'ar-BH', - 'ar-DJ', - 'ar-DZ', - 'ar-EG', - 'ar-EH', - 'ar-ER', - 'ar-IL', - 'ar-IQ', - 'ar-JO', - 'ar-KM', - 'ar-KW', - 'ar-LB', - 'ar-LY', - 'ar-MA', - 'ar-MR', - 'ar-OM', - 'ar-PS', - 'ar-QA', - 'ar-SA', - 'ar-SD', - 'ar-SO', - 'ar-SS', - 'ar-SY', - 'ar-TD', - 'ar-TN', - 'ar-YE', - 'ar', - 'as', - 'asa', - 'ast', - 'az-Cyrl', - 'az-Latn', - 'az', - 'bas', - 'be', - 'bem', - 'bez', - 'bg', - 'bm', - 'bn-IN', - 'bn', - 'bo-IN', - 'bo', - 'br', - 'brx', - 'bs-Cyrl', - 'bs-Latn', - 'bs', - 'ca-AD', - 'ca-ES-VALENCIA', - 'ca-FR', - 'ca-IT', - 'ca', - 'ce', - 'cgg', - 'chr', - 'ckb-IR', - 'ckb', - 'cs', - 'cu', - 'cy', - 'da-GL', - 'da', - 'dav', - 'de-AT', - 'de-BE', - 'de-CH', - 'de-IT', - 'de-LI', - 'de-LU', - 'de', - 'dje', - 'dsb', - 'dua', - 'dyo', - 'dz', - 'ebu', - 'ee-TG', - 'ee', - 'el-CY', - 'el', - 'en-001', - 'en-150', - 'en-AG', - 'en-AI', - 'en-AS', - 'en-AT', - 'en-AU', - 'en-BB', - 'en-BE', - 'en-BI', - 'en-BM', - 'en-BS', - 'en-BW', - 'en-BZ', - 'en-CA', - 'en-CC', - 'en-CH', - 'en-CK', - 'en-CM', - 'en-CX', - 'en-CY', - 'en-DE', - 'en-DG', - 'en-DK', - 'en-DM', - 'en-ER', - 'en-FI', - 'en-FJ', - 'en-FK', - 'en-FM', - 'en-GB', - 'en-GD', - 'en-GG', - 'en-GH', - 'en-GI', - 'en-GM', - 'en-GU', - 'en-GY', - 'en-HK', - 'en-IE', - 'en-IL', - 'en-IM', - 'en-IN', - 'en-IO', - 'en-JE', - 'en-JM', - 'en-KE', - 'en-KI', - 'en-KN', - 'en-KY', - 'en-LC', - 'en-LR', - 'en-LS', - 'en-MG', - 'en-MH', - 'en-MO', - 'en-MP', - 'en-MS', - 'en-MT', - 'en-MU', - 'en-MW', - 'en-MY', - 'en-NA', - 'en-NF', - 'en-NG', - 'en-NL', - 'en-NR', - 'en-NU', - 'en-NZ', - 'en-PG', - 'en-PH', - 'en-PK', - 'en-PN', - 'en-PR', - 'en-PW', - 'en-RW', - 'en-SB', - 'en-SC', - 'en-SD', - 'en-SE', - 'en-SG', - 'en-SH', - 'en-SI', - 'en-SL', - 'en-SS', - 'en-SX', - 'en-SZ', - 'en-TC', - 'en-TK', - 'en-TO', - 'en-TT', - 'en-TV', - 'en-TZ', - 'en-UG', - 'en-UM', - 'en-US-POSIX', - 'en-VC', - 'en-VG', - 'en-VI', - 'en-VU', - 'en-WS', - 'en-ZA', - 'en-ZM', - 'en-ZW', - 'en', - 'eo', - 'es-419', - 'es-AR', - 'es-BO', - 'es-BR', - 'es-CL', - 'es-CO', - 'es-CR', - 'es-CU', - 'es-DO', - 'es-EA', - 'es-EC', - 'es-GQ', - 'es-GT', - 'es-HN', - 'es-IC', - 'es-MX', - 'es-NI', - 'es-PA', - 'es-PE', - 'es-PH', - 'es-PR', - 'es-PY', - 'es-SV', - 'es-US', - 'es-UY', - 'es-VE', - 'es', - 'et', - 'eu', - 'ewo', - 'fa-AF', - 'fa', - 'ff-CM', - 'ff-GN', - 'ff-MR', - 'ff', - 'fi', - 'fil', - 'fo-DK', - 'fo', - 'fr-BE', - 'fr-BF', - 'fr-BI', - 'fr-BJ', - 'fr-BL', - 'fr-CA', - 'fr-CD', - 'fr-CF', - 'fr-CG', - 'fr-CH', - 'fr-CI', - 'fr-CM', - 'fr-DJ', - 'fr-DZ', - 'fr-GA', - 'fr-GF', - 'fr-GN', - 'fr-GP', - 'fr-GQ', - 'fr-HT', - 'fr-KM', - 'fr-LU', - 'fr-MA', - 'fr-MC', - 'fr-MF', - 'fr-MG', - 'fr-ML', - 'fr-MQ', - 'fr-MR', - 'fr-MU', - 'fr-NC', - 'fr-NE', - 'fr-PF', - 'fr-PM', - 'fr-RE', - 'fr-RW', - 'fr-SC', - 'fr-SN', - 'fr-SY', - 'fr-TD', - 'fr-TG', - 'fr-TN', - 'fr-VU', - 'fr-WF', - 'fr-YT', - 'fr', - 'fur', - 'fy', - 'ga', - 'gd', - 'gl', - 'gsw-FR', - 'gsw-LI', - 'gsw', - 'gu', - 'guz', - 'gv', - 'ha-GH', - 'ha-NE', - 'ha', - 'haw', - 'he', - 'hi', - 'hr-BA', - 'hr', - 'hsb', - 'hu', - 'hy', - 'id', - 'ig', - 'ii', - 'is', - 'it-CH', - 'it-SM', - 'it', - 'ja', - 'jgo', - 'jmc', - 'ka', - 'kab', - 'kam', - 'kde', - 'kea', - 'khq', - 'ki', - 'kk', - 'kkj', - 'kl', - 'kln', - 'km', - 'kn', - 'ko-KP', - 'ko', - 'kok', - 'ks', - 'ksb', - 'ksf', - 'ksh', - 'kw', - 'ky', - 'lag', - 'lb', - 'lg', - 'lkt', - 'ln-AO', - 'ln-CF', - 'ln-CG', - 'ln', - 'lo', - 'lrc-IQ', - 'lrc', - 'lt', - 'lu', - 'luo', - 'luy', - 'lv', - 'mas-TZ', - 'mas', - 'mer', - 'mfe', - 'mg', - 'mgh', - 'mgo', - 'mk', - 'ml', - 'mn', - 'mr', - 'ms-BN', - 'ms-SG', - 'ms', - 'mt', - 'mua', - 'my', - 'mzn', - 'naq', - 'nb-SJ', - 'nb', - 'nd', - 'nds-NL', - 'nds', - 'ne-IN', - 'ne', - 'nl-AW', - 'nl-BE', - 'nl-BQ', - 'nl-CW', - 'nl-SR', - 'nl-SX', - 'nl', - 'nmg', - 'nn', - 'nnh', - 'nus', - 'nyn', - 'om-KE', - 'om', - 'or', - 'os-RU', - 'os', - 'pa-Arab', - 'pa-Guru', - 'pa', - 'pl', - 'prg', - 'ps', - 'pt-AO', - 'pt-CH', - 'pt-CV', - 'pt-GQ', - 'pt-GW', - 'pt-LU', - 'pt-MO', - 'pt-MZ', - 'pt-PT', - 'pt-ST', - 'pt-TL', - 'pt', - 'qu-BO', - 'qu-EC', - 'qu', - 'rm', - 'rn', - 'ro-MD', - 'ro', - 'rof', - 'root', - 'ru-BY', - 'ru-KG', - 'ru-KZ', - 'ru-MD', - 'ru-UA', - 'ru', - 'rw', - 'rwk', - 'sah', - 'saq', - 'sbp', - 'se-FI', - 'se-SE', - 'se', - 'seh', - 'ses', - 'sg', - 'shi-Latn', - 'shi-Tfng', - 'shi', - 'si', - 'sk', - 'sl', - 'smn', - 'sn', - 'so-DJ', - 'so-ET', - 'so-KE', - 'so', - 'sq-MK', - 'sq-XK', - 'sq', - 'sr-Cyrl-BA', - 'sr-Cyrl-ME', - 'sr-Cyrl-XK', - 'sr-Cyrl', - 'sr-Latn-BA', - 'sr-Latn-ME', - 'sr-Latn-XK', - 'sr-Latn', - 'sr', - 'sv-AX', - 'sv-FI', - 'sv', - 'sw-CD', - 'sw-KE', - 'sw-UG', - 'sw', - 'ta-LK', - 'ta-MY', - 'ta-SG', - 'ta', - 'te', - 'teo-KE', - 'teo', - 'th', - 'ti-ER', - 'ti', - 'tk', - 'to', - 'tr-CY', - 'tr', - 'twq', - 'tzm', - 'ug', - 'uk', - 'ur-IN', - 'ur', - 'uz-Arab', - 'uz-Cyrl', - 'uz-Latn', - 'uz', - 'vai-Latn', - 'vai-Vaii', - 'vai', - 'vi', - 'vo', - 'vun', - 'wae', - 'xog', - 'yav', - 'yi', - 'yo-BJ', - 'yo', - 'yue', - 'zgh', - 'zh-Hans-HK', - 'zh-Hans-MO', - 'zh-Hans-SG', - 'zh-Hans', - 'zh-Hant-HK', - 'zh-Hant-MO', - 'zh-Hant', - 'zh', - 'zu' -]; -export default localesList; -//# sourceMappingURL=locales.mjs.map \ No newline at end of file diff --git a/deps/framework/i18n/cldr/locales.mjs.map b/deps/framework/i18n/cldr/locales.mjs.map deleted file mode 100644 index 241d52a043..0000000000 --- a/deps/framework/i18n/cldr/locales.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"locales.mjs","sourceRoot":"","sources":["locales.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,GAAG;IACnB,OAAO;IACP,IAAI;IACJ,KAAK;IACL,IAAI;IACJ,IAAI;IACJ,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,IAAI;IACJ,IAAI;IACJ,KAAK;IACL,KAAK;IACL,SAAS;IACT,SAAS;IACT,IAAI;IACJ,KAAK;IACL,IAAI;IACJ,KAAK;IACL,KAAK;IACL,IAAI;IACJ,IAAI;IACJ,OAAO;IACP,IAAI;IACJ,OAAO;IACP,IAAI;IACJ,IAAI;IACJ,KAAK;IACL,SAAS;IACT,SAAS;IACT,IAAI;IACJ,OAAO;IACP,gBAAgB;IAChB,OAAO;IACP,OAAO;IACP,IAAI;IACJ,IAAI;IACJ,KAAK;IACL,KAAK;IACL,QAAQ;IACR,KAAK;IACL,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,OAAO;IACP,IAAI;IACJ,KAAK;IACL,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,IAAI;IACJ,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,IAAI;IACJ,KAAK;IACL,OAAO;IACP,IAAI;IACJ,OAAO;IACP,IAAI;IACJ,QAAQ;IACR,QAAQ;IACR,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,aAAa;IACb,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,IAAI;IACJ,IAAI;IACJ,QAAQ;IACR,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;I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IAAI;IACJ,KAAK;IACL,KAAK;IACL,IAAI;IACJ,UAAU;IACV,UAAU;IACV,KAAK;IACL,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,KAAK;IACL,IAAI;IACJ,OAAO;IACP,OAAO;IACP,OAAO;IACP,IAAI;IACJ,OAAO;IACP,OAAO;IACP,IAAI;IACJ,YAAY;IACZ,YAAY;IACZ,YAAY;IACZ,SAAS;IACT,YAAY;IACZ,YAAY;IACZ,YAAY;IACZ,SAAS;IACT,IAAI;IACJ,OAAO;IACP,OAAO;IACP,IAAI;IACJ,OAAO;IACP,OAAO;IACP,OAAO;IACP,IAAI;IACJ,OAAO;IACP,OAAO;IACP,OAAO;IACP,IAAI;IACJ,IAAI;IACJ,QAAQ;IACR,KAAK;IACL,IAAI;IACJ,OAAO;IACP,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,OAAO;IACP,IAAI;IACJ,KAAK;IACL,KAAK;IACL,IAAI;IACJ,IAAI;IACJ,OAAO;IACP,IAAI;IACJ,SAAS;IACT,SAAS;IACT,SAAS;IACT,IAAI;IACJ,UAAU;IACV,UAAU;IACV,KAAK;IACL,IAAI;IACJ,IAAI;IACJ,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,IAAI;IACJ,OAAO;IACP,IAAI;IACJ,KAAK;IACL,KAAK;IACL,YAAY;IACZ,YAAY;IACZ,YAAY;IACZ,SAAS;IACT,YAAY;IACZ,YAAY;IACZ,SAAS;IACT,IAAI;IACJ,IAAI;CACJ,CAAC;AACF,eAAe,WAAW,CAAC","sourcesContent":["/**\n * A list of `cldr-data/main` directories used to load the correct CLDR data for a given locale.\n */\nconst localesList = [\n\t'af-NA',\n\t'af',\n\t'agq',\n\t'ak',\n\t'am',\n\t'ar-AE',\n\t'ar-BH',\n\t'ar-DJ',\n\t'ar-DZ',\n\t'ar-EG',\n\t'ar-EH',\n\t'ar-ER',\n\t'ar-IL',\n\t'ar-IQ',\n\t'ar-JO',\n\t'ar-KM',\n\t'ar-KW',\n\t'ar-LB',\n\t'ar-LY',\n\t'ar-MA',\n\t'ar-MR',\n\t'ar-OM',\n\t'ar-PS',\n\t'ar-QA',\n\t'ar-SA',\n\t'ar-SD',\n\t'ar-SO',\n\t'ar-SS',\n\t'ar-SY',\n\t'ar-TD',\n\t'ar-TN',\n\t'ar-YE',\n\t'ar',\n\t'as',\n\t'asa',\n\t'ast',\n\t'az-Cyrl',\n\t'az-Latn',\n\t'az',\n\t'bas',\n\t'be',\n\t'bem',\n\t'bez',\n\t'bg',\n\t'bm',\n\t'bn-IN',\n\t'bn',\n\t'bo-IN',\n\t'bo',\n\t'br',\n\t'brx',\n\t'bs-Cyrl',\n\t'bs-Latn',\n\t'bs',\n\t'ca-AD',\n\t'ca-ES-VALENCIA',\n\t'ca-FR',\n\t'ca-IT',\n\t'ca',\n\t'ce',\n\t'cgg',\n\t'chr',\n\t'ckb-IR',\n\t'ckb',\n\t'cs',\n\t'cu',\n\t'cy',\n\t'da-GL',\n\t'da',\n\t'dav',\n\t'de-AT',\n\t'de-BE',\n\t'de-CH',\n\t'de-IT',\n\t'de-LI',\n\t'de-LU',\n\t'de',\n\t'dje',\n\t'dsb',\n\t'dua',\n\t'dyo',\n\t'dz',\n\t'ebu',\n\t'ee-TG',\n\t'ee',\n\t'el-CY',\n\t'el',\n\t'en-001',\n\t'en-150',\n\t'en-AG',\n\t'en-AI',\n\t'en-AS',\n\t'en-AT',\n\t'en-AU',\n\t'en-BB',\n\t'en-BE',\n\t'en-BI',\n\t'en-BM',\n\t'en-BS',\n\t'en-BW',\n\t'en-BZ',\n\t'en-CA',\n\t'en-CC',\n\t'en-CH',\n\t'en-CK',\n\t'en-CM',\n\t'en-CX',\n\t'en-CY',\n\t'en-DE',\n\t'en-DG',\n\t'en-DK',\n\t'en-DM',\n\t'en-ER',\n\t'en-FI',\n\t'en-FJ',\n\t'en-FK',\n\t'en-FM',\n\t'en-GB',\n\t'en-GD',\n\t'en-GG',\n\t'en-GH',\n\t'en-GI',\n\t'en-GM',\n\t'en-GU',\n\t'en-GY',\n\t'en-HK',\n\t'en-IE',\n\t'en-IL',\n\t'en-IM',\n\t'en-IN',\n\t'en-IO',\n\t'en-JE',\n\t'en-JM',\n\t'en-KE',\n\t'en-KI',\n\t'en-KN',\n\t'en-KY',\n\t'en-LC',\n\t'en-LR',\n\t'en-LS',\n\t'en-MG',\n\t'en-MH',\n\t'en-MO',\n\t'en-MP',\n\t'en-MS',\n\t'en-MT',\n\t'en-MU',\n\t'en-MW',\n\t'en-MY',\n\t'en-NA',\n\t'en-NF',\n\t'en-NG',\n\t'en-NL',\n\t'en-NR',\n\t'en-NU',\n\t'en-NZ',\n\t'en-PG',\n\t'en-PH',\n\t'en-PK',\n\t'en-PN',\n\t'en-PR',\n\t'en-PW',\n\t'en-RW',\n\t'en-SB',\n\t'en-SC',\n\t'en-SD',\n\t'en-SE',\n\t'en-SG',\n\t'en-SH',\n\t'en-SI',\n\t'en-SL',\n\t'en-SS',\n\t'en-SX',\n\t'en-SZ',\n\t'en-TC',\n\t'en-TK',\n\t'en-TO',\n\t'en-TT',\n\t'en-TV',\n\t'en-TZ',\n\t'en-UG',\n\t'en-UM',\n\t'en-US-POSIX',\n\t'en-VC',\n\t'en-VG',\n\t'en-VI',\n\t'en-VU',\n\t'en-WS',\n\t'en-ZA',\n\t'en-ZM',\n\t'en-ZW',\n\t'en',\n\t'eo',\n\t'es-419',\n\t'es-AR',\n\t'es-BO',\n\t'es-BR',\n\t'es-CL',\n\t'es-CO',\n\t'es-CR',\n\t'es-CU',\n\t'es-DO',\n\t'es-EA',\n\t'es-EC',\n\t'es-GQ',\n\t'es-GT',\n\t'es-HN',\n\t'es-IC',\n\t'es-MX',\n\t'es-NI',\n\t'es-PA',\n\t'es-PE',\n\t'es-PH',\n\t'es-PR',\n\t'es-PY',\n\t'es-SV',\n\t'es-US',\n\t'es-UY',\n\t'es-VE',\n\t'es',\n\t'et',\n\t'eu',\n\t'ewo',\n\t'fa-AF',\n\t'fa',\n\t'ff-CM',\n\t'ff-GN',\n\t'ff-MR',\n\t'ff',\n\t'fi',\n\t'fil',\n\t'fo-DK',\n\t'fo',\n\t'fr-BE',\n\t'fr-BF',\n\t'fr-BI',\n\t'fr-BJ',\n\t'fr-BL',\n\t'fr-CA',\n\t'fr-CD',\n\t'fr-CF',\n\t'fr-CG',\n\t'fr-CH',\n\t'fr-CI',\n\t'fr-CM',\n\t'fr-DJ',\n\t'fr-DZ',\n\t'fr-GA',\n\t'fr-GF',\n\t'fr-GN',\n\t'fr-GP',\n\t'fr-GQ',\n\t'fr-HT',\n\t'fr-KM',\n\t'fr-LU',\n\t'fr-MA',\n\t'fr-MC',\n\t'fr-MF',\n\t'fr-MG',\n\t'fr-ML',\n\t'fr-MQ',\n\t'fr-MR',\n\t'fr-MU',\n\t'fr-NC',\n\t'fr-NE',\n\t'fr-PF',\n\t'fr-PM',\n\t'fr-RE',\n\t'fr-RW',\n\t'fr-SC',\n\t'fr-SN',\n\t'fr-SY',\n\t'fr-TD',\n\t'fr-TG',\n\t'fr-TN',\n\t'fr-VU',\n\t'fr-WF',\n\t'fr-YT',\n\t'fr',\n\t'fur',\n\t'fy',\n\t'ga',\n\t'gd',\n\t'gl',\n\t'gsw-FR',\n\t'gsw-LI',\n\t'gsw',\n\t'gu',\n\t'guz',\n\t'gv',\n\t'ha-GH',\n\t'ha-NE',\n\t'ha',\n\t'haw',\n\t'he',\n\t'hi',\n\t'hr-BA',\n\t'hr',\n\t'hsb',\n\t'hu',\n\t'hy',\n\t'id',\n\t'ig',\n\t'ii',\n\t'is',\n\t'it-CH',\n\t'it-SM',\n\t'it',\n\t'ja',\n\t'jgo',\n\t'jmc',\n\t'ka',\n\t'kab',\n\t'kam',\n\t'kde',\n\t'kea',\n\t'khq',\n\t'ki',\n\t'kk',\n\t'kkj',\n\t'kl',\n\t'kln',\n\t'km',\n\t'kn',\n\t'ko-KP',\n\t'ko',\n\t'kok',\n\t'ks',\n\t'ksb',\n\t'ksf',\n\t'ksh',\n\t'kw',\n\t'ky',\n\t'lag',\n\t'lb',\n\t'lg',\n\t'lkt',\n\t'ln-AO',\n\t'ln-CF',\n\t'ln-CG',\n\t'ln',\n\t'lo',\n\t'lrc-IQ',\n\t'lrc',\n\t'lt',\n\t'lu',\n\t'luo',\n\t'luy',\n\t'lv',\n\t'mas-TZ',\n\t'mas',\n\t'mer',\n\t'mfe',\n\t'mg',\n\t'mgh',\n\t'mgo',\n\t'mk',\n\t'ml',\n\t'mn',\n\t'mr',\n\t'ms-BN',\n\t'ms-SG',\n\t'ms',\n\t'mt',\n\t'mua',\n\t'my',\n\t'mzn',\n\t'naq',\n\t'nb-SJ',\n\t'nb',\n\t'nd',\n\t'nds-NL',\n\t'nds',\n\t'ne-IN',\n\t'ne',\n\t'nl-AW',\n\t'nl-BE',\n\t'nl-BQ',\n\t'nl-CW',\n\t'nl-SR',\n\t'nl-SX',\n\t'nl',\n\t'nmg',\n\t'nn',\n\t'nnh',\n\t'nus',\n\t'nyn',\n\t'om-KE',\n\t'om',\n\t'or',\n\t'os-RU',\n\t'os',\n\t'pa-Arab',\n\t'pa-Guru',\n\t'pa',\n\t'pl',\n\t'prg',\n\t'ps',\n\t'pt-AO',\n\t'pt-CH',\n\t'pt-CV',\n\t'pt-GQ',\n\t'pt-GW',\n\t'pt-LU',\n\t'pt-MO',\n\t'pt-MZ',\n\t'pt-PT',\n\t'pt-ST',\n\t'pt-TL',\n\t'pt',\n\t'qu-BO',\n\t'qu-EC',\n\t'qu',\n\t'rm',\n\t'rn',\n\t'ro-MD',\n\t'ro',\n\t'rof',\n\t'root',\n\t'ru-BY',\n\t'ru-KG',\n\t'ru-KZ',\n\t'ru-MD',\n\t'ru-UA',\n\t'ru',\n\t'rw',\n\t'rwk',\n\t'sah',\n\t'saq',\n\t'sbp',\n\t'se-FI',\n\t'se-SE',\n\t'se',\n\t'seh',\n\t'ses',\n\t'sg',\n\t'shi-Latn',\n\t'shi-Tfng',\n\t'shi',\n\t'si',\n\t'sk',\n\t'sl',\n\t'smn',\n\t'sn',\n\t'so-DJ',\n\t'so-ET',\n\t'so-KE',\n\t'so',\n\t'sq-MK',\n\t'sq-XK',\n\t'sq',\n\t'sr-Cyrl-BA',\n\t'sr-Cyrl-ME',\n\t'sr-Cyrl-XK',\n\t'sr-Cyrl',\n\t'sr-Latn-BA',\n\t'sr-Latn-ME',\n\t'sr-Latn-XK',\n\t'sr-Latn',\n\t'sr',\n\t'sv-AX',\n\t'sv-FI',\n\t'sv',\n\t'sw-CD',\n\t'sw-KE',\n\t'sw-UG',\n\t'sw',\n\t'ta-LK',\n\t'ta-MY',\n\t'ta-SG',\n\t'ta',\n\t'te',\n\t'teo-KE',\n\t'teo',\n\t'th',\n\t'ti-ER',\n\t'ti',\n\t'tk',\n\t'to',\n\t'tr-CY',\n\t'tr',\n\t'twq',\n\t'tzm',\n\t'ug',\n\t'uk',\n\t'ur-IN',\n\t'ur',\n\t'uz-Arab',\n\t'uz-Cyrl',\n\t'uz-Latn',\n\t'uz',\n\t'vai-Latn',\n\t'vai-Vaii',\n\t'vai',\n\t'vi',\n\t'vo',\n\t'vun',\n\t'wae',\n\t'xog',\n\t'yav',\n\t'yi',\n\t'yo-BJ',\n\t'yo',\n\t'yue',\n\t'zgh',\n\t'zh-Hans-HK',\n\t'zh-Hans-MO',\n\t'zh-Hans-SG',\n\t'zh-Hans',\n\t'zh-Hant-HK',\n\t'zh-Hant-MO',\n\t'zh-Hant',\n\t'zh',\n\t'zu'\n];\nexport default localesList;\n"]} \ No newline at end of file diff --git a/deps/framework/i18n/date.d.ts b/deps/framework/i18n/date.d.ts deleted file mode 100644 index e7f7931555..0000000000 --- a/deps/framework/i18n/date.d.ts +++ /dev/null @@ -1,146 +0,0 @@ -import 'globalize/dist/globalize'; -import 'globalize/dist/globalize/number'; -import 'globalize/dist/globalize/date'; -import 'globalize/dist/globalize/relative-time'; -import { NumberFormatter } from './number'; -export declare type DateLength = 'short' | 'medium' | 'long' | 'full'; -export declare type RelativeTimeLength = 'short' | 'narrow'; -export interface DateFormatter { - /** - * Any function that converts a date object into a string. - */ - (value: Date): string; -} -export declare type DateFormatterOptions = { - /** - * String value indicating a skeleton, eg. { skeleton: "GyMMMd" }. - * Skeleton provides a more flexible formatting mechanism than the predefined list full, long, medium, or short represented by date, time, or datetime. - * Instead, they are an open-ended list of patterns containing only date field information, and in a canonical order. - */ - skeleton?: string; - /** - * One of the following String values: full, long, medium, or short, eg. { date: "full" }. - */ - date?: DateLength; - /** - * One of the following String values: full, long, medium, or short, eg. { time: "full" }. - */ - time?: DateLength; - /** - * One of the following String values: full, long, medium, or short, eg. { datetime: "full" } - */ - datetime?: DateLength; -}; -export interface DateParser { - /** - * Any function that parses a Date object from a string. - */ - (value: string): Date; -} -export declare type RelativeTimeFormatterOptions = { - /** - * eg. "short" or "narrow". Or falsy for default long form - */ - form?: RelativeTimeLength; -}; -/** - * Format a date according to the specified options for the specified or current locale. - * - * @param value - * The date to format. - * - * @param options - * An optional object of formatting options. - * - * @param locale - * An optional locale. Defaults to the root locale. - * - * @return - * The formatted date string. - */ -export declare function formatDate(value: Date, options?: DateFormatterOptions, locale?: string): string; -export declare function formatDate(value: Date, locale?: string): string; -/** - * Format a number as a unit of relative time for the specified unit and optional locale. - * E.g., `formatRelativeTime(1, 'week', { form: 'short' }, 'fr'` ("la semaine prochaine") - * - * @param value - * The relative unit number. Positive numbers indicate future events (e.g., "in 2 days") while negative numbers - * represent past events (e.g., "1 day ago"). - * - * @param unit - * E.g., "week", "day", "month", etc. - * - * @param options - * An optional object of formatting options. - * - * @param locale - * An optional locale. Defaults to the current locale. - */ -export declare function formatRelativeTime(value: number, unit: string, options?: RelativeTimeFormatterOptions, locale?: string): string; -export declare function formatRelativeTime(value: number, unit: string, locale?: string): string; -/** - * Return a date formatter that accepts a date and formats it according to the specified options for the - * specified or current locale. - * - * @param options - * An optional object of formatting options. - * - * @param locale - * The optional locale. Defaults to the root locale. - * - * @return - * A function that accepts a date and returns a formatted date string. - */ -export declare function getDateFormatter(options?: DateFormatterOptions, locale?: string): DateFormatter; -export declare function getDateFormatter(locale?: string): DateFormatter; -/** - * Return a function that parses a string into a date object, according any optional settings or locale. - * - * @param options - * An optional config that describes the format of the string. - * - * @param locale - * The optional locale. Defaults to the root locale. - * - * @return - * A function that accepts a string and returns a date object. - */ -export declare function getDateParser(options?: DateFormatterOptions, locale?: string): DateParser; -export declare function getDateParser(locale?: string): DateParser; -/** - * Format a number as a unit of relative time for the specified unit and optional locale. - * E.g., `formatRelativeTime(1, 'week', { form: 'short' }, 'fr'` ("la semaine prochaine") - * - * @param unit - * E.g., "week", "day", "month", etc. - * - * @param options - * An optional object of formatting options. - * - * @param locale - * The optional locale. Defaults to the root locale. - * - * @return - * A function that accepts a relative time number and returns a formatted string. Positive numbers indicate future - * events (e.g., "in 2 days") while negative numbers represent past events (e.g., "1 day ago"). - */ -export declare function getRelativeTimeFormatter(unit: string, options?: RelativeTimeFormatterOptions, locale?: string): NumberFormatter; -export declare function getRelativeTimeFormatter(unit: string, locale?: string): NumberFormatter; -/** - * Convert a string into a date object, according any optional settings or locale. - * - * @param value - * The date string to convert. - * - * @param options - * An optional config that describes the format of the string. - * - * @param locale - * The optional locale. Defaults to the root locale. - * - * @return - * The formatted date. - */ -export declare function parseDate(value: string, options?: DateFormatterOptions, locale?: string): Date; -export declare function parseDate(value: string, locale?: string): Date; diff --git a/deps/framework/i18n/date.js b/deps/framework/i18n/date.js deleted file mode 100644 index a5e30f261f..0000000000 --- a/deps/framework/i18n/date.js +++ /dev/null @@ -1,65 +0,0 @@ -(function (factory) { - if (typeof module === "object" && typeof module.exports === "object") { - var v = factory(require, exports); - if (v !== undefined) module.exports = v; - } - else if (typeof define === "function" && define.amd) { - define(["require", "exports", "globalize/dist/globalize", "globalize/dist/globalize/number", "globalize/dist/globalize/date", "globalize/dist/globalize/relative-time", "./util/globalize"], factory); - } -})(function (require, exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - require("globalize/dist/globalize"); - require("globalize/dist/globalize/number"); - require("globalize/dist/globalize/date"); - require("globalize/dist/globalize/relative-time"); - var globalize_1 = require("./util/globalize"); - function formatDate(value, optionsOrLocale, locale) { - return globalize_1.globalizeDelegator('formatDate', { - locale: locale, - optionsOrLocale: optionsOrLocale, - value: value - }); - } - exports.formatDate = formatDate; - function formatRelativeTime(value, unit, optionsOrLocale, locale) { - return globalize_1.globalizeDelegator('formatRelativeTime', { - locale: locale, - optionsOrLocale: optionsOrLocale, - unit: unit, - value: value - }); - } - exports.formatRelativeTime = formatRelativeTime; - function getDateFormatter(optionsOrLocale, locale) { - return globalize_1.globalizeDelegator('dateFormatter', { - locale: locale, - optionsOrLocale: optionsOrLocale - }); - } - exports.getDateFormatter = getDateFormatter; - function getDateParser(optionsOrLocale, locale) { - return globalize_1.globalizeDelegator('dateParser', { - locale: locale, - optionsOrLocale: optionsOrLocale - }); - } - exports.getDateParser = getDateParser; - function getRelativeTimeFormatter(unit, optionsOrLocale, locale) { - return globalize_1.globalizeDelegator('relativeTimeFormatter', { - locale: locale, - optionsOrLocale: optionsOrLocale, - unit: unit - }); - } - exports.getRelativeTimeFormatter = getRelativeTimeFormatter; - function parseDate(value, optionsOrLocale, locale) { - return globalize_1.globalizeDelegator('parseDate', { - locale: locale, - optionsOrLocale: optionsOrLocale, - value: value - }); - } - exports.parseDate = parseDate; -}); -//# sourceMappingURL=date.js.map \ No newline at end of file diff --git a/deps/framework/i18n/date.js.map b/deps/framework/i18n/date.js.map deleted file mode 100644 index d253a51768..0000000000 --- a/deps/framework/i18n/date.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"date.js","sourceRoot":"","sources":["date.ts"],"names":[],"mappings":";;;;;;;;;;;IAAA,oCAAkC;IAClC,2CAAyC;IACzC,yCAAuC;IACvC,kDAAgD;IAEhD,8CAAsD;IAmEtD,oBAA2B,KAAW,EAAE,eAA+C,EAAE,MAAe;QACvG,MAAM,CAAC,8BAAkB,CAAqC,YAAY,EAAE;YAC3E,MAAM,QAAA;YACN,eAAe,iBAAA;YACf,KAAK,OAAA;SACL,CAAC,CAAC;IACJ,CAAC;IAND,gCAMC;IA0BD,4BACC,KAAa,EACb,IAAY,EACZ,eAAuD,EACvD,MAAe;QAEf,MAAM,CAAC,8BAAkB,CAA+C,oBAAoB,EAAE;YAC7F,MAAM,QAAA;YACN,eAAe,iBAAA;YACf,IAAI,MAAA;YACJ,KAAK,OAAA;SACL,CAAC,CAAC;IACJ,CAAC;IAZD,gDAYC;IAiBD,0BAAiC,eAA+C,EAAE,MAAe;QAChG,MAAM,CAAC,8BAAkB,CAAsC,eAAe,EAAE;YAC/E,MAAM,QAAA;YACN,eAAe,iBAAA;SACf,CAAC,CAAC;IACJ,CAAC;IALD,4CAKC;IAgBD,uBAA8B,eAA+C,EAAE,MAAe;QAC7F,MAAM,CAAC,8BAAkB,CAAmC,YAAY,EAAE;YACzE,MAAM,QAAA;YACN,eAAe,iBAAA;SACf,CAAC,CAAC;IACJ,CAAC;IALD,sCAKC;IAyBD,kCACC,IAAY,EACZ,eAAuD,EACvD,MAAe;QAEf,MAAM,CAAC,8BAAkB,CAAwD,uBAAuB,EAAE;YACzG,MAAM,QAAA;YACN,eAAe,iBAAA;YACf,IAAI,MAAA;SACJ,CAAC,CAAC;IACJ,CAAC;IAVD,4DAUC;IAmBD,mBAA0B,KAAa,EAAE,eAA+C,EAAE,MAAe;QACxG,MAAM,CAAC,8BAAkB,CAAqC,WAAW,EAAE;YAC1E,MAAM,QAAA;YACN,eAAe,iBAAA;YACf,KAAK,OAAA;SACL,CAAC,CAAC;IACJ,CAAC;IAND,8BAMC","sourcesContent":["import 'globalize/dist/globalize';\nimport 'globalize/dist/globalize/number';\nimport 'globalize/dist/globalize/date';\nimport 'globalize/dist/globalize/relative-time';\nimport { NumberFormatter } from './number';\nimport { globalizeDelegator } from './util/globalize';\n\nexport type DateLength = 'short' | 'medium' | 'long' | 'full';\nexport type RelativeTimeLength = 'short' | 'narrow';\n\nexport interface DateFormatter {\n\t/**\n\t * Any function that converts a date object into a string.\n\t */\n\t(value: Date): string;\n}\n\nexport type DateFormatterOptions = {\n\t/**\n\t * String value indicating a skeleton, eg. { skeleton: \"GyMMMd\" }.\n\t * Skeleton provides a more flexible formatting mechanism than the predefined list full, long, medium, or short represented by date, time, or datetime.\n\t * Instead, they are an open-ended list of patterns containing only date field information, and in a canonical order.\n\t */\n\tskeleton?: string;\n\n\t/**\n\t * One of the following String values: full, long, medium, or short, eg. { date: \"full\" }.\n\t */\n\tdate?: DateLength;\n\n\t/**\n\t * One of the following String values: full, long, medium, or short, eg. { time: \"full\" }.\n\t */\n\ttime?: DateLength;\n\n\t/**\n\t * One of the following String values: full, long, medium, or short, eg. { datetime: \"full\" }\n\t */\n\tdatetime?: DateLength;\n};\n\nexport interface DateParser {\n\t/**\n\t * Any function that parses a Date object from a string.\n\t */\n\t(value: string): Date;\n}\n\nexport type RelativeTimeFormatterOptions = {\n\t/**\n\t * eg. \"short\" or \"narrow\". Or falsy for default long form\n\t */\n\tform?: RelativeTimeLength;\n};\n\n/**\n * Format a date according to the specified options for the specified or current locale.\n *\n * @param value\n * The date to format.\n *\n * @param options\n * An optional object of formatting options.\n *\n * @param locale\n * An optional locale. Defaults to the root locale.\n *\n * @return\n * The formatted date string.\n */\nexport function formatDate(value: Date, options?: DateFormatterOptions, locale?: string): string;\nexport function formatDate(value: Date, locale?: string): string;\nexport function formatDate(value: Date, optionsOrLocale?: DateFormatterOptions | string, locale?: string): string {\n\treturn globalizeDelegator('formatDate', {\n\t\tlocale,\n\t\toptionsOrLocale,\n\t\tvalue\n\t});\n}\n\n/**\n * Format a number as a unit of relative time for the specified unit and optional locale.\n * E.g., `formatRelativeTime(1, 'week', { form: 'short' }, 'fr'` (\"la semaine prochaine\")\n *\n * @param value\n * The relative unit number. Positive numbers indicate future events (e.g., \"in 2 days\") while negative numbers\n * represent past events (e.g., \"1 day ago\").\n *\n * @param unit\n * E.g., \"week\", \"day\", \"month\", etc.\n *\n * @param options\n * An optional object of formatting options.\n *\n * @param locale\n * An optional locale. Defaults to the current locale.\n */\nexport function formatRelativeTime(\n\tvalue: number,\n\tunit: string,\n\toptions?: RelativeTimeFormatterOptions,\n\tlocale?: string\n): string;\nexport function formatRelativeTime(value: number, unit: string, locale?: string): string;\nexport function formatRelativeTime(\n\tvalue: number,\n\tunit: string,\n\toptionsOrLocale?: RelativeTimeFormatterOptions | string,\n\tlocale?: string\n): string {\n\treturn globalizeDelegator('formatRelativeTime', {\n\t\tlocale,\n\t\toptionsOrLocale,\n\t\tunit,\n\t\tvalue\n\t});\n}\n\n/**\n * Return a date formatter that accepts a date and formats it according to the specified options for the\n * specified or current locale.\n *\n * @param options\n * An optional object of formatting options.\n *\n * @param locale\n * The optional locale. Defaults to the root locale.\n *\n * @return\n * A function that accepts a date and returns a formatted date string.\n */\nexport function getDateFormatter(options?: DateFormatterOptions, locale?: string): DateFormatter;\nexport function getDateFormatter(locale?: string): DateFormatter;\nexport function getDateFormatter(optionsOrLocale?: DateFormatterOptions | string, locale?: string): DateFormatter {\n\treturn globalizeDelegator('dateFormatter', {\n\t\tlocale,\n\t\toptionsOrLocale\n\t});\n}\n\n/**\n * Return a function that parses a string into a date object, according any optional settings or locale.\n *\n * @param options\n * An optional config that describes the format of the string.\n *\n * @param locale\n * The optional locale. Defaults to the root locale.\n *\n * @return\n * A function that accepts a string and returns a date object.\n */\nexport function getDateParser(options?: DateFormatterOptions, locale?: string): DateParser;\nexport function getDateParser(locale?: string): DateParser;\nexport function getDateParser(optionsOrLocale?: DateFormatterOptions | string, locale?: string): DateParser {\n\treturn globalizeDelegator('dateParser', {\n\t\tlocale,\n\t\toptionsOrLocale\n\t});\n}\n\n/**\n * Format a number as a unit of relative time for the specified unit and optional locale.\n * E.g., `formatRelativeTime(1, 'week', { form: 'short' }, 'fr'` (\"la semaine prochaine\")\n *\n * @param unit\n * E.g., \"week\", \"day\", \"month\", etc.\n *\n * @param options\n * An optional object of formatting options.\n *\n * @param locale\n * The optional locale. Defaults to the root locale.\n *\n * @return\n * A function that accepts a relative time number and returns a formatted string. Positive numbers indicate future\n * events (e.g., \"in 2 days\") while negative numbers represent past events (e.g., \"1 day ago\").\n */\nexport function getRelativeTimeFormatter(\n\tunit: string,\n\toptions?: RelativeTimeFormatterOptions,\n\tlocale?: string\n): NumberFormatter;\nexport function getRelativeTimeFormatter(unit: string, locale?: string): NumberFormatter;\nexport function getRelativeTimeFormatter(\n\tunit: string,\n\toptionsOrLocale?: RelativeTimeFormatterOptions | string,\n\tlocale?: string\n): NumberFormatter {\n\treturn globalizeDelegator('relativeTimeFormatter', {\n\t\tlocale,\n\t\toptionsOrLocale,\n\t\tunit\n\t});\n}\n\n/**\n * Convert a string into a date object, according any optional settings or locale.\n *\n * @param value\n * The date string to convert.\n *\n * @param options\n * An optional config that describes the format of the string.\n *\n * @param locale\n * The optional locale. Defaults to the root locale.\n *\n * @return\n * The formatted date.\n */\nexport function parseDate(value: string, options?: DateFormatterOptions, locale?: string): Date;\nexport function parseDate(value: string, locale?: string): Date;\nexport function parseDate(value: string, optionsOrLocale?: DateFormatterOptions | string, locale?: string): Date {\n\treturn globalizeDelegator('parseDate', {\n\t\tlocale,\n\t\toptionsOrLocale,\n\t\tvalue\n\t});\n}\n"]} \ No newline at end of file diff --git a/deps/framework/i18n/date.mjs b/deps/framework/i18n/date.mjs deleted file mode 100644 index 428e6f6c39..0000000000 --- a/deps/framework/i18n/date.mjs +++ /dev/null @@ -1,47 +0,0 @@ -import 'globalize/dist/globalize'; -import 'globalize/dist/globalize/number'; -import 'globalize/dist/globalize/date'; -import 'globalize/dist/globalize/relative-time'; -import { globalizeDelegator } from './util/globalize'; -export function formatDate(value, optionsOrLocale, locale) { - return globalizeDelegator('formatDate', { - locale, - optionsOrLocale, - value - }); -} -export function formatRelativeTime(value, unit, optionsOrLocale, locale) { - return globalizeDelegator('formatRelativeTime', { - locale, - optionsOrLocale, - unit, - value - }); -} -export function getDateFormatter(optionsOrLocale, locale) { - return globalizeDelegator('dateFormatter', { - locale, - optionsOrLocale - }); -} -export function getDateParser(optionsOrLocale, locale) { - return globalizeDelegator('dateParser', { - locale, - optionsOrLocale - }); -} -export function getRelativeTimeFormatter(unit, optionsOrLocale, locale) { - return globalizeDelegator('relativeTimeFormatter', { - locale, - optionsOrLocale, - unit - }); -} -export function parseDate(value, optionsOrLocale, locale) { - return globalizeDelegator('parseDate', { - locale, - optionsOrLocale, - value - }); -} -//# sourceMappingURL=date.mjs.map \ No newline at end of file diff --git a/deps/framework/i18n/date.mjs.map b/deps/framework/i18n/date.mjs.map deleted file mode 100644 index 6860ae716a..0000000000 --- a/deps/framework/i18n/date.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"date.mjs","sourceRoot":"","sources":["date.ts"],"names":[],"mappings":"AAAA,OAAO,0BAA0B,CAAC;AAClC,OAAO,iCAAiC,CAAC;AACzC,OAAO,+BAA+B,CAAC;AACvC,OAAO,wCAAwC,CAAC;AAEhD,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAmEtD,MAAM,qBAAqB,KAAW,EAAE,eAA+C,EAAE,MAAe;IACvG,MAAM,CAAC,kBAAkB,CAAqC,YAAY,EAAE;QAC3E,MAAM;QACN,eAAe;QACf,KAAK;KACL,CAAC,CAAC;AACJ,CAAC;AA0BD,MAAM,6BACL,KAAa,EACb,IAAY,EACZ,eAAuD,EACvD,MAAe;IAEf,MAAM,CAAC,kBAAkB,CAA+C,oBAAoB,EAAE;QAC7F,MAAM;QACN,eAAe;QACf,IAAI;QACJ,KAAK;KACL,CAAC,CAAC;AACJ,CAAC;AAiBD,MAAM,2BAA2B,eAA+C,EAAE,MAAe;IAChG,MAAM,CAAC,kBAAkB,CAAsC,eAAe,EAAE;QAC/E,MAAM;QACN,eAAe;KACf,CAAC,CAAC;AACJ,CAAC;AAgBD,MAAM,wBAAwB,eAA+C,EAAE,MAAe;IAC7F,MAAM,CAAC,kBAAkB,CAAmC,YAAY,EAAE;QACzE,MAAM;QACN,eAAe;KACf,CAAC,CAAC;AACJ,CAAC;AAyBD,MAAM,mCACL,IAAY,EACZ,eAAuD,EACvD,MAAe;IAEf,MAAM,CAAC,kBAAkB,CAAwD,uBAAuB,EAAE;QACzG,MAAM;QACN,eAAe;QACf,IAAI;KACJ,CAAC,CAAC;AACJ,CAAC;AAmBD,MAAM,oBAAoB,KAAa,EAAE,eAA+C,EAAE,MAAe;IACxG,MAAM,CAAC,kBAAkB,CAAqC,WAAW,EAAE;QAC1E,MAAM;QACN,eAAe;QACf,KAAK;KACL,CAAC,CAAC;AACJ,CAAC","sourcesContent":["import 'globalize/dist/globalize';\nimport 'globalize/dist/globalize/number';\nimport 'globalize/dist/globalize/date';\nimport 'globalize/dist/globalize/relative-time';\nimport { NumberFormatter } from './number';\nimport { globalizeDelegator } from './util/globalize';\n\nexport type DateLength = 'short' | 'medium' | 'long' | 'full';\nexport type RelativeTimeLength = 'short' | 'narrow';\n\nexport interface DateFormatter {\n\t/**\n\t * Any function that converts a date object into a string.\n\t */\n\t(value: Date): string;\n}\n\nexport type DateFormatterOptions = {\n\t/**\n\t * String value indicating a skeleton, eg. { skeleton: \"GyMMMd\" }.\n\t * Skeleton provides a more flexible formatting mechanism than the predefined list full, long, medium, or short represented by date, time, or datetime.\n\t * Instead, they are an open-ended list of patterns containing only date field information, and in a canonical order.\n\t */\n\tskeleton?: string;\n\n\t/**\n\t * One of the following String values: full, long, medium, or short, eg. { date: \"full\" }.\n\t */\n\tdate?: DateLength;\n\n\t/**\n\t * One of the following String values: full, long, medium, or short, eg. { time: \"full\" }.\n\t */\n\ttime?: DateLength;\n\n\t/**\n\t * One of the following String values: full, long, medium, or short, eg. { datetime: \"full\" }\n\t */\n\tdatetime?: DateLength;\n};\n\nexport interface DateParser {\n\t/**\n\t * Any function that parses a Date object from a string.\n\t */\n\t(value: string): Date;\n}\n\nexport type RelativeTimeFormatterOptions = {\n\t/**\n\t * eg. \"short\" or \"narrow\". Or falsy for default long form\n\t */\n\tform?: RelativeTimeLength;\n};\n\n/**\n * Format a date according to the specified options for the specified or current locale.\n *\n * @param value\n * The date to format.\n *\n * @param options\n * An optional object of formatting options.\n *\n * @param locale\n * An optional locale. Defaults to the root locale.\n *\n * @return\n * The formatted date string.\n */\nexport function formatDate(value: Date, options?: DateFormatterOptions, locale?: string): string;\nexport function formatDate(value: Date, locale?: string): string;\nexport function formatDate(value: Date, optionsOrLocale?: DateFormatterOptions | string, locale?: string): string {\n\treturn globalizeDelegator('formatDate', {\n\t\tlocale,\n\t\toptionsOrLocale,\n\t\tvalue\n\t});\n}\n\n/**\n * Format a number as a unit of relative time for the specified unit and optional locale.\n * E.g., `formatRelativeTime(1, 'week', { form: 'short' }, 'fr'` (\"la semaine prochaine\")\n *\n * @param value\n * The relative unit number. Positive numbers indicate future events (e.g., \"in 2 days\") while negative numbers\n * represent past events (e.g., \"1 day ago\").\n *\n * @param unit\n * E.g., \"week\", \"day\", \"month\", etc.\n *\n * @param options\n * An optional object of formatting options.\n *\n * @param locale\n * An optional locale. Defaults to the current locale.\n */\nexport function formatRelativeTime(\n\tvalue: number,\n\tunit: string,\n\toptions?: RelativeTimeFormatterOptions,\n\tlocale?: string\n): string;\nexport function formatRelativeTime(value: number, unit: string, locale?: string): string;\nexport function formatRelativeTime(\n\tvalue: number,\n\tunit: string,\n\toptionsOrLocale?: RelativeTimeFormatterOptions | string,\n\tlocale?: string\n): string {\n\treturn globalizeDelegator('formatRelativeTime', {\n\t\tlocale,\n\t\toptionsOrLocale,\n\t\tunit,\n\t\tvalue\n\t});\n}\n\n/**\n * Return a date formatter that accepts a date and formats it according to the specified options for the\n * specified or current locale.\n *\n * @param options\n * An optional object of formatting options.\n *\n * @param locale\n * The optional locale. Defaults to the root locale.\n *\n * @return\n * A function that accepts a date and returns a formatted date string.\n */\nexport function getDateFormatter(options?: DateFormatterOptions, locale?: string): DateFormatter;\nexport function getDateFormatter(locale?: string): DateFormatter;\nexport function getDateFormatter(optionsOrLocale?: DateFormatterOptions | string, locale?: string): DateFormatter {\n\treturn globalizeDelegator('dateFormatter', {\n\t\tlocale,\n\t\toptionsOrLocale\n\t});\n}\n\n/**\n * Return a function that parses a string into a date object, according any optional settings or locale.\n *\n * @param options\n * An optional config that describes the format of the string.\n *\n * @param locale\n * The optional locale. Defaults to the root locale.\n *\n * @return\n * A function that accepts a string and returns a date object.\n */\nexport function getDateParser(options?: DateFormatterOptions, locale?: string): DateParser;\nexport function getDateParser(locale?: string): DateParser;\nexport function getDateParser(optionsOrLocale?: DateFormatterOptions | string, locale?: string): DateParser {\n\treturn globalizeDelegator('dateParser', {\n\t\tlocale,\n\t\toptionsOrLocale\n\t});\n}\n\n/**\n * Format a number as a unit of relative time for the specified unit and optional locale.\n * E.g., `formatRelativeTime(1, 'week', { form: 'short' }, 'fr'` (\"la semaine prochaine\")\n *\n * @param unit\n * E.g., \"week\", \"day\", \"month\", etc.\n *\n * @param options\n * An optional object of formatting options.\n *\n * @param locale\n * The optional locale. Defaults to the root locale.\n *\n * @return\n * A function that accepts a relative time number and returns a formatted string. Positive numbers indicate future\n * events (e.g., \"in 2 days\") while negative numbers represent past events (e.g., \"1 day ago\").\n */\nexport function getRelativeTimeFormatter(\n\tunit: string,\n\toptions?: RelativeTimeFormatterOptions,\n\tlocale?: string\n): NumberFormatter;\nexport function getRelativeTimeFormatter(unit: string, locale?: string): NumberFormatter;\nexport function getRelativeTimeFormatter(\n\tunit: string,\n\toptionsOrLocale?: RelativeTimeFormatterOptions | string,\n\tlocale?: string\n): NumberFormatter {\n\treturn globalizeDelegator('relativeTimeFormatter', {\n\t\tlocale,\n\t\toptionsOrLocale,\n\t\tunit\n\t});\n}\n\n/**\n * Convert a string into a date object, according any optional settings or locale.\n *\n * @param value\n * The date string to convert.\n *\n * @param options\n * An optional config that describes the format of the string.\n *\n * @param locale\n * The optional locale. Defaults to the root locale.\n *\n * @return\n * The formatted date.\n */\nexport function parseDate(value: string, options?: DateFormatterOptions, locale?: string): Date;\nexport function parseDate(value: string, locale?: string): Date;\nexport function parseDate(value: string, optionsOrLocale?: DateFormatterOptions | string, locale?: string): Date {\n\treturn globalizeDelegator('parseDate', {\n\t\tlocale,\n\t\toptionsOrLocale,\n\t\tvalue\n\t});\n}\n"]} \ No newline at end of file diff --git a/deps/framework/i18n/i18n.d.ts b/deps/framework/i18n/i18n.d.ts deleted file mode 100644 index d66f5b1361..0000000000 --- a/deps/framework/i18n/i18n.d.ts +++ /dev/null @@ -1,177 +0,0 @@ -import 'globalize/dist/globalize/message'; -import { Handle } from '../core/interfaces'; -/** - * A default bundle used as basis for loading locale-specific bundles. - */ -export interface Bundle { - /** - * A unique identifier for the bundle that will be generated automatically when it is registered. - */ - readonly id?: string; - /** - * A list of supported locales. Any included locale MUST have an associated bundle. - */ - readonly locales?: LocaleLoaders; - /** - * The map of default messages that will be used when locale-specific messages are unavailable. - * Note that any message key used in the i18n system MUST have a default specified here. - */ - readonly messages: T; -} -/** - * Options object passed to message formatters and used for token replacement. - */ -export interface FormatOptions { - [key: string]: any; -} -export interface I18n { - (bundle: Bundle, locale?: string): Promise; - /** - * The current namespace as set via `switchLocale`. Defaults to `systemLocale`. - */ - readonly locale: string; -} -/** - * A map of locales to functions responsible for loading their respective translations. - */ -export interface LocaleLoaders { - [locale: string]: () => LocaleTranslations | Promise>; -} -/** - * An object of locale-specific translations. - */ -export declare type LocaleTranslations = Partial | { - default?: Partial; -}; -/** - * Describes a compiled ICU message formatter function. - */ -export interface MessageFormatter { - (options?: FormatOptions): string; -} -/** - * An object of keys to locale messages. - */ -export interface Messages { - [key: string]: string; -} -/** - * Return a formatted message. - * - * If both the "supplemental/likelySubtags" and "supplemental/plurals-type-cardinal" CLDR data have been loaded, then - * the ICU message format is supported. Otherwise, a simple token-replacement mechanism is used. - * - * Usage: - * formatMessage(bundle, 'guestInfo', { - * host: 'Bill', - * guest: 'John' - * }, 'fr'); - * - * @param bundle - * The bundle containing the target message. - * - * @param key - * The message's key. - * - * @param options - * An optional value used by the formatter to replace tokens with values. - * - * @param locale - * An optional locale for the formatter. If no locale is supplied, or if the locale is not supported, the - * default locale is used. - * - * @return - * The formatted message. - */ -export declare function formatMessage(bundle: Bundle, key: string, options?: FormatOptions, locale?: string): string; -/** - * Return the cached messages for the specified bundle and locale. If messages have not been previously loaded for the - * specified locale, no value will be returned. - * - * @param bundle - * The default bundle that is used to determine where the locale-specific bundles are located. - * - * @param locale - * The locale of the desired messages. - * - * @return The cached messages object, if it exists. - */ -export declare function getCachedMessages(bundle: Bundle, locale: string): T | void; -/** - * Return a function that formats a specific message, and takes an optional value for token replacement. - * - * If both the "supplemental/likelySubtags" and "supplemental/plurals-type-cardinal" CLDR data have been loaded, then - * the returned function will have ICU message format support. Otherwise, the returned function will perform a simple - * token replacement on the message string. - * - * Usage: - * const formatter = getMessageFormatter(bundle, 'guestInfo', 'fr'); - * const message = formatter({ - * host: 'Miles', - * gender: 'male', - * guest: 'Oscar', - * guestCount: '15' - * }); - * - * @param bundle - * The bundle containing the target message. - * - * @param key - * The message's key. - * - * @param locale - * An optional locale for the formatter. If no locale is supplied, or if the locale is not supported, the - * default locale is used. - * - * @return - * The message formatter. - */ -export declare function getMessageFormatter(bundle: Bundle, key: string, locale?: string): MessageFormatter; -declare const _default: I18n; -export default _default; -/** - * Invalidate the cache for a particular bundle, or invalidate the entire cache. Note that cached messages for all - * locales for a given bundle will be cleared. - * - * @param bundle - * An optional bundle to invalidate. If no bundle is provided, then the cache is cleared for all bundles. - */ -export declare function invalidate(bundle?: Bundle): void; -/** - * Register an observer to be notified when the root locale changes. - * - * @param callback - * A callback function which will receive the updated locale string on updates. - * - * @return - * A handle object that can be used to unsubscribe from updates. - */ -export declare const observeLocale: (callback: (locale: string) => {}) => Handle; -/** - * Pre-load locale-specific messages into the i18n system. - * - * @param bundle - * The default bundle that is used to merge locale-specific messages with the default messages. - * - * @param messages - * The messages to cache. - * - * @param locale - * The locale for the messages - */ -export declare function setLocaleMessages(bundle: Bundle, localeMessages: Partial, locale: string): void; -/** - * Change the root locale, and notify any registered observers. - * - * @param locale - * The new locale. - */ -export declare function switchLocale(locale: string): void; -/** - * The default environment locale. - * - * It should be noted that while the system locale will be normalized to a single - * format when loading message bundles, this value represents the unaltered - * locale returned directly by the environment. - */ -export declare const systemLocale: string; diff --git a/deps/framework/i18n/i18n.js b/deps/framework/i18n/i18n.js deleted file mode 100644 index 41ade6db76..0000000000 --- a/deps/framework/i18n/i18n.js +++ /dev/null @@ -1,394 +0,0 @@ -(function (factory) { - if (typeof module === "object" && typeof module.exports === "object") { - var v = factory(require, exports); - if (v !== undefined) module.exports = v; - } - else if (typeof define === "function" && define.amd) { - define(["require", "exports", "tslib", "globalize/dist/globalize/message", "../shim/global", "../shim/Map", "../core/Evented", "../core/has", "../core/uuid", "../core/load/util", "./cldr/load", "./util/main"], factory); - } -})(function (require, exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - var tslib_1 = require("tslib"); - /* tslint:disable:interface-name */ - require("globalize/dist/globalize/message"); - var global_1 = require("../shim/global"); - var Map_1 = require("../shim/Map"); - var Evented_1 = require("../core/Evented"); - var has_1 = require("../core/has"); - var uuid_1 = require("../core/uuid"); - var util_1 = require("../core/load/util"); - var load_1 = require("./cldr/load"); - var main_1 = require("./util/main"); - // TODO: use normal imports after landing https://github.com/DefinitelyTyped/DefinitelyTyped/pull/27271 - var Globalize = require('globalize/dist/globalize'); - var TOKEN_PATTERN = /\{([a-z0-9_]+)\}/gi; - var bundleMap = new Map_1.default(); - var formatterMap = new Map_1.default(); - var localeProducer = new Evented_1.default(); - var rootLocale; - /** - * Return the bundle's unique identifier, creating one if it does not already exist. - * - * @param bundle A message bundle - * @return The bundle's unique identifier - */ - function getBundleId(bundle) { - if (bundle.id) { - return bundle.id; - } - var id = uuid_1.default(); - Object.defineProperty(bundle, 'id', { - value: id - }); - return id; - } - /** - * @private - * Return a function that formats an ICU-style message, and takes an optional value for token replacement. - * - * Usage: - * const formatter = getMessageFormatter(bundle, 'guestInfo', 'fr'); - * const message = formatter({ - * host: 'Miles', - * gender: 'male', - * guest: 'Oscar', - * guestCount: '15' - * }); - * - * @param id - * The message's bundle id. - * - * @param key - * The message's key. - * - * @param locale - * An optional locale for the formatter. If no locale is supplied, or if the locale is not supported, the - * default locale is used. - * - * @return - * The message formatter. - */ - function getIcuMessageFormatter(id, key, locale) { - locale = main_1.normalizeLocale(locale || getRootLocale()); - var formatterKey = locale + ":" + id + ":" + key; - var formatter = formatterMap.get(formatterKey); - if (formatter) { - return formatter; - } - var globalize = locale !== getRootLocale() ? new Globalize(main_1.normalizeLocale(locale)) : Globalize; - formatter = globalize.messageFormatter(id + "/" + key); - var cached = bundleMap.get(id); - if (cached && cached.get(locale)) { - formatterMap.set(formatterKey, formatter); - } - return formatter; - } - /** - * @private - * Load the specified locale-specific bundles, mapping the default exports to simple `Messages` objects. - */ - function loadLocaleBundles(locales, supported) { - return Promise.all(supported.map(function (locale) { return locales[locale](); })).then(function (bundles) { - return bundles.map(function (bundle) { return util_1.useDefault(bundle); }); - }); - } - /** - * @private - * Return the root locale. Defaults to the system locale. - */ - function getRootLocale() { - return rootLocale || exports.systemLocale; - } - /** - * @private - * Retrieve a list of supported locales that can provide messages for the specified locale. - * - * @param locale - * The target locale. - * - * @param supported - * The locales that are supported by the bundle. - * - * @return - * A list of supported locales that match the target locale. - */ - function getSupportedLocales(locale, supported) { - if (supported === void 0) { supported = []; } - return main_1.generateLocales(locale).filter(function (locale) { return supported.indexOf(locale) > -1; }); - } - /** - * @private - * Inject messages for the specified locale into the i18n system. - * - * @param id - * The bundle's unique identifier - * - * @param messages - * The messages to inject - * - * @param locale - * An optional locale. If not specified, then it is assumed that the messages are the defaults for the given - * bundle path. - */ - function loadMessages(id, messages, locale) { - if (locale === void 0) { locale = 'root'; } - var cached = bundleMap.get(id); - if (!cached) { - cached = new Map_1.default(); - bundleMap.set(id, cached); - } - cached.set(locale, messages); - Globalize.loadMessages((_a = {}, - _a[locale] = (_b = {}, - _b[id] = messages, - _b), - _a)); - var _a, _b; - } - /** - * Return a formatted message. - * - * If both the "supplemental/likelySubtags" and "supplemental/plurals-type-cardinal" CLDR data have been loaded, then - * the ICU message format is supported. Otherwise, a simple token-replacement mechanism is used. - * - * Usage: - * formatMessage(bundle, 'guestInfo', { - * host: 'Bill', - * guest: 'John' - * }, 'fr'); - * - * @param bundle - * The bundle containing the target message. - * - * @param key - * The message's key. - * - * @param options - * An optional value used by the formatter to replace tokens with values. - * - * @param locale - * An optional locale for the formatter. If no locale is supplied, or if the locale is not supported, the - * default locale is used. - * - * @return - * The formatted message. - */ - function formatMessage(bundle, key, options, locale) { - return getMessageFormatter(bundle, key, locale)(options); - } - exports.formatMessage = formatMessage; - /** - * Return the cached messages for the specified bundle and locale. If messages have not been previously loaded for the - * specified locale, no value will be returned. - * - * @param bundle - * The default bundle that is used to determine where the locale-specific bundles are located. - * - * @param locale - * The locale of the desired messages. - * - * @return The cached messages object, if it exists. - */ - function getCachedMessages(bundle, locale) { - var _a = bundle.id, id = _a === void 0 ? getBundleId(bundle) : _a, locales = bundle.locales, messages = bundle.messages; - var cached = bundleMap.get(id); - if (!cached) { - loadMessages(id, messages); - } - else { - var localeMessages = cached.get(locale); - if (localeMessages) { - return localeMessages; - } - } - var supportedLocales = getSupportedLocales(locale, locales && Object.keys(locales)); - if (!supportedLocales.length) { - return messages; - } - if (cached) { - return cached.get(supportedLocales[supportedLocales.length - 1]); - } - } - exports.getCachedMessages = getCachedMessages; - /** - * Return a function that formats a specific message, and takes an optional value for token replacement. - * - * If both the "supplemental/likelySubtags" and "supplemental/plurals-type-cardinal" CLDR data have been loaded, then - * the returned function will have ICU message format support. Otherwise, the returned function will perform a simple - * token replacement on the message string. - * - * Usage: - * const formatter = getMessageFormatter(bundle, 'guestInfo', 'fr'); - * const message = formatter({ - * host: 'Miles', - * gender: 'male', - * guest: 'Oscar', - * guestCount: '15' - * }); - * - * @param bundle - * The bundle containing the target message. - * - * @param key - * The message's key. - * - * @param locale - * An optional locale for the formatter. If no locale is supplied, or if the locale is not supported, the - * default locale is used. - * - * @return - * The message formatter. - */ - function getMessageFormatter(bundle, key, locale) { - var _a = bundle.id, id = _a === void 0 ? getBundleId(bundle) : _a; - if (load_1.isLoaded('supplemental', 'likelySubtags') && load_1.isLoaded('supplemental', 'plurals-type-cardinal')) { - return getIcuMessageFormatter(id, key, locale); - } - var cached = bundleMap.get(id); - var messages = cached ? cached.get(locale || getRootLocale()) || cached.get('root') : null; - if (!messages) { - throw new Error("The bundle has not been registered."); - } - return function (options) { - if (options === void 0) { options = Object.create(null); } - return messages[key].replace(TOKEN_PATTERN, function (token, property) { - var value = options[property]; - if (typeof value === 'undefined') { - throw new Error("Missing property " + property); - } - return value; - }); - }; - } - exports.getMessageFormatter = getMessageFormatter; - /** - * Load locale-specific messages for the specified bundle and locale. - * - * @param bundle - * The default bundle that is used to determine where the locale-specific bundles are located. - * - * @param locale - * An optional locale. If no locale is provided, then the current locale is assumed. - * - * @return A promise to the locale-specific messages. - */ - function i18n(bundle, locale) { - return tslib_1.__awaiter(this, void 0, void 0, function () { - var currentLocale, cachedMessages, locales, supportedLocales, bundles; - return tslib_1.__generator(this, function (_a) { - switch (_a.label) { - case 0: - currentLocale = locale ? main_1.normalizeLocale(locale) : getRootLocale(); - cachedMessages = getCachedMessages(bundle, currentLocale); - if (cachedMessages) { - return [2 /*return*/, cachedMessages]; - } - locales = bundle.locales; - supportedLocales = getSupportedLocales(currentLocale, Object.keys(locales)); - return [4 /*yield*/, loadLocaleBundles(locales, supportedLocales)]; - case 1: - bundles = _a.sent(); - return [2 /*return*/, bundles.reduce(function (previous, partial) { - var localeMessages = tslib_1.__assign({}, previous, partial); - loadMessages(getBundleId(bundle), Object.freeze(localeMessages), currentLocale); - return localeMessages; - }, bundle.messages)]; - } - }); - }); - } - Object.defineProperty(i18n, 'locale', { - get: getRootLocale - }); - exports.default = i18n; - /** - * Invalidate the cache for a particular bundle, or invalidate the entire cache. Note that cached messages for all - * locales for a given bundle will be cleared. - * - * @param bundle - * An optional bundle to invalidate. If no bundle is provided, then the cache is cleared for all bundles. - */ - function invalidate(bundle) { - if (bundle) { - bundle.id && bundleMap.delete(bundle.id); - } - else { - bundleMap.clear(); - } - } - exports.invalidate = invalidate; - /** - * Register an observer to be notified when the root locale changes. - * - * @param callback - * A callback function which will receive the updated locale string on updates. - * - * @return - * A handle object that can be used to unsubscribe from updates. - */ - exports.observeLocale = function (callback) { - return localeProducer.on('change', function (event) { - callback(event.target); - }); - }; - /** - * Pre-load locale-specific messages into the i18n system. - * - * @param bundle - * The default bundle that is used to merge locale-specific messages with the default messages. - * - * @param messages - * The messages to cache. - * - * @param locale - * The locale for the messages - */ - function setLocaleMessages(bundle, localeMessages, locale) { - var messages = tslib_1.__assign({}, bundle.messages, localeMessages); - loadMessages(getBundleId(bundle), Object.freeze(messages), locale); - } - exports.setLocaleMessages = setLocaleMessages; - /** - * Change the root locale, and notify any registered observers. - * - * @param locale - * The new locale. - */ - function switchLocale(locale) { - var previous = rootLocale; - rootLocale = locale ? main_1.normalizeLocale(locale) : ''; - if (previous !== rootLocale) { - if (load_1.isLoaded('supplemental', 'likelySubtags')) { - Globalize.load({ - main: (_a = {}, - _a[rootLocale] = {}, - _a) - }); - Globalize.locale(rootLocale); - } - localeProducer.emit({ type: 'change', target: rootLocale }); - } - var _a; - } - exports.switchLocale = switchLocale; - /** - * The default environment locale. - * - * It should be noted that while the system locale will be normalized to a single - * format when loading message bundles, this value represents the unaltered - * locale returned directly by the environment. - */ - exports.systemLocale = (function () { - var systemLocale = 'en'; - if (has_1.default('host-browser')) { - var navigator_1 = global_1.default.navigator; - systemLocale = navigator_1.language || navigator_1.userLanguage; - } - else if (has_1.default('host-node')) { - systemLocale = process.env.LANG || systemLocale; - } - return main_1.normalizeLocale(systemLocale); - })(); -}); -//# sourceMappingURL=i18n.js.map \ No newline at end of file diff --git a/deps/framework/i18n/i18n.js.map b/deps/framework/i18n/i18n.js.map deleted file mode 100644 index a399ba1937..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AS,CAAC,IAAI,CAAC;oBACd,IAAI;wBACH,GAAC,UAAU,IAAG,EAAE;2BAChB;iBACD,CAAC,CAAC;gBACH,SAAS,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC;YAC9B,CAAC;YAED,cAAc,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,UAAU,EAAE,CAAC,CAAC;QAC7D,CAAC;;IACF,CAAC;IAhBD,oCAgBC;IAED;;;;;;OAMG;IACU,QAAA,YAAY,GAAW,CAAC;QACpC,IAAI,YAAY,GAAG,IAAI,CAAC;QACxB,EAAE,CAAC,CAAC,aAAG,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC;YACzB,IAAM,WAAS,GAAG,gBAAM,CAAC,SAAS,CAAC;YACnC,YAAY,GAAG,WAAS,CAAC,QAAQ,IAAI,WAAS,CAAC,YAAY,CAAC;QAC7D,CAAC;QAAC,IAAI,CAAC,EAAE,CAAC,CAAC,aAAG,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC;YAC7B,YAAY,GAAG,OAAO,CAAC,GAAG,CAAC,IAAI,IAAI,YAAY,CAAC;QACjD,CAAC;QACD,MAAM,CAAC,sBAAe,CAAC,YAAY,CAAC,CAAC;IACtC,CAAC,CAAC,EAAE,CAAC","sourcesContent":["/* tslint:disable:interface-name */\nimport 'globalize/dist/globalize/message';\nimport global from '../shim/global';\nimport Map from '../shim/Map';\nimport Evented from '../core/Evented';\nimport has from '../core/has';\nimport uuid from '../core/uuid';\nimport { Handle } from '../core/interfaces';\nimport { useDefault } from '../core/load/util';\nimport * as GlobalizeType from 'globalize';\nimport { isLoaded } from './cldr/load';\nimport { generateLocales, normalizeLocale } from './util/main';\n\n// TODO: use normal imports after landing https://github.com/DefinitelyTyped/DefinitelyTyped/pull/27271\nconst Globalize: typeof GlobalizeType = require('globalize/dist/globalize');\n\n/**\n * A default bundle used as basis for loading locale-specific bundles.\n */\nexport interface Bundle {\n\t/**\n\t * A unique identifier for the bundle that will be generated automatically when it is registered.\n\t */\n\treadonly id?: string;\n\n\t/**\n\t * A list of supported locales. Any included locale MUST have an associated bundle.\n\t */\n\treadonly locales?: LocaleLoaders;\n\n\t/**\n\t * The map of default messages that will be used when locale-specific messages are unavailable.\n\t * Note that any message key used in the i18n system MUST have a default specified here.\n\t */\n\treadonly messages: T;\n}\n\n/**\n * Options object passed to message formatters and used for token replacement.\n */\nexport interface FormatOptions {\n\t[key: string]: any;\n}\n\nexport interface I18n {\n\t(bundle: Bundle, locale?: string): Promise;\n\n\t/**\n\t * The current namespace as set via `switchLocale`. Defaults to `systemLocale`.\n\t */\n\treadonly locale: string;\n}\n\n/**\n * A map of locales to functions responsible for loading their respective translations.\n */\nexport interface LocaleLoaders {\n\t[locale: string]: () => LocaleTranslations | Promise>;\n}\n\n/**\n * An object of locale-specific translations.\n */\nexport type LocaleTranslations = Partial | { default?: Partial };\n\n/**\n * Describes a compiled ICU message formatter function.\n */\nexport interface MessageFormatter {\n\t(options?: FormatOptions): string;\n}\n\n/**\n * An object of keys to locale messages.\n */\nexport interface Messages {\n\t[key: string]: string;\n}\n\nconst TOKEN_PATTERN = /\\{([a-z0-9_]+)\\}/gi;\nconst bundleMap = new Map>();\nconst formatterMap = new Map();\nconst localeProducer = new Evented();\nlet rootLocale: string;\n\n/**\n * Return the bundle's unique identifier, creating one if it does not already exist.\n *\n * @param bundle A message bundle\n * @return The bundle's unique identifier\n */\nfunction getBundleId(bundle: Bundle): string {\n\tif (bundle.id) {\n\t\treturn bundle.id;\n\t}\n\n\tconst id = uuid();\n\tObject.defineProperty(bundle, 'id', {\n\t\tvalue: id\n\t});\n\treturn id;\n}\n\n/**\n * @private\n * Return a function that formats an ICU-style message, and takes an optional value for token replacement.\n *\n * Usage:\n * const formatter = getMessageFormatter(bundle, 'guestInfo', 'fr');\n * const message = formatter({\n * host: 'Miles',\n * gender: 'male',\n * guest: 'Oscar',\n * guestCount: '15'\n * });\n *\n * @param id\n * The message's bundle id.\n *\n * @param key\n * The message's key.\n *\n * @param locale\n * An optional locale for the formatter. If no locale is supplied, or if the locale is not supported, the\n * default locale is used.\n *\n * @return\n * The message formatter.\n */\nfunction getIcuMessageFormatter(id: string, key: string, locale?: string): MessageFormatter {\n\tlocale = normalizeLocale(locale || getRootLocale());\n\tconst formatterKey = `${locale}:${id}:${key}`;\n\tlet formatter = formatterMap.get(formatterKey);\n\n\tif (formatter) {\n\t\treturn formatter;\n\t}\n\n\tconst globalize = locale !== getRootLocale() ? new Globalize(normalizeLocale(locale)) : Globalize;\n\tformatter = globalize.messageFormatter(`${id}/${key}`);\n\n\tconst cached = bundleMap.get(id);\n\tif (cached && cached.get(locale)) {\n\t\tformatterMap.set(formatterKey, formatter);\n\t}\n\n\treturn formatter;\n}\n\n/**\n * @private\n * Load the specified locale-specific bundles, mapping the default exports to simple `Messages` objects.\n */\nfunction loadLocaleBundles(locales: LocaleLoaders, supported: string[]): Promise {\n\treturn Promise.all(supported.map((locale) => locales[locale]())).then((bundles) => {\n\t\treturn bundles.map((bundle) => useDefault(bundle));\n\t});\n}\n\n/**\n * @private\n * Return the root locale. Defaults to the system locale.\n */\nfunction getRootLocale(): string {\n\treturn rootLocale || systemLocale;\n}\n\n/**\n * @private\n * Retrieve a list of supported locales that can provide messages for the specified locale.\n *\n * @param locale\n * The target locale.\n *\n * @param supported\n * The locales that are supported by the bundle.\n *\n * @return\n * A list of supported locales that match the target locale.\n */\nfunction getSupportedLocales(locale: string, supported: string[] = []): string[] {\n\treturn generateLocales(locale).filter((locale: string) => supported.indexOf(locale) > -1);\n}\n\n/**\n * @private\n * Inject messages for the specified locale into the i18n system.\n *\n * @param id\n * The bundle's unique identifier\n *\n * @param messages\n * The messages to inject\n *\n * @param locale\n * An optional locale. If not specified, then it is assumed that the messages are the defaults for the given\n * bundle path.\n */\nfunction loadMessages(id: string, messages: T, locale: string = 'root') {\n\tlet cached = bundleMap.get(id);\n\n\tif (!cached) {\n\t\tcached = new Map();\n\t\tbundleMap.set(id, cached);\n\t}\n\n\tcached.set(locale, messages);\n\tGlobalize.loadMessages({\n\t\t[locale]: {\n\t\t\t[id]: messages\n\t\t}\n\t});\n}\n\n/**\n * Return a formatted message.\n *\n * If both the \"supplemental/likelySubtags\" and \"supplemental/plurals-type-cardinal\" CLDR data have been loaded, then\n * the ICU message format is supported. Otherwise, a simple token-replacement mechanism is used.\n *\n * Usage:\n * formatMessage(bundle, 'guestInfo', {\n * host: 'Bill',\n * guest: 'John'\n * }, 'fr');\n *\n * @param bundle\n * The bundle containing the target message.\n *\n * @param key\n * The message's key.\n *\n * @param options\n * An optional value used by the formatter to replace tokens with values.\n *\n * @param locale\n * An optional locale for the formatter. If no locale is supplied, or if the locale is not supported, the\n * default locale is used.\n *\n * @return\n * The formatted message.\n */\nexport function formatMessage(\n\tbundle: Bundle,\n\tkey: string,\n\toptions?: FormatOptions,\n\tlocale?: string\n): string {\n\treturn getMessageFormatter(bundle, key, locale)(options);\n}\n\n/**\n * Return the cached messages for the specified bundle and locale. If messages have not been previously loaded for the\n * specified locale, no value will be returned.\n *\n * @param bundle\n * The default bundle that is used to determine where the locale-specific bundles are located.\n *\n * @param locale\n * The locale of the desired messages.\n *\n * @return The cached messages object, if it exists.\n */\nexport function getCachedMessages(bundle: Bundle, locale: string): T | void {\n\tconst { id = getBundleId(bundle), locales, messages } = bundle;\n\tconst cached = bundleMap.get(id);\n\n\tif (!cached) {\n\t\tloadMessages(id, messages);\n\t} else {\n\t\tconst localeMessages = cached.get(locale);\n\t\tif (localeMessages) {\n\t\t\treturn localeMessages as T;\n\t\t}\n\t}\n\n\tconst supportedLocales = getSupportedLocales(locale, locales && Object.keys(locales));\n\tif (!supportedLocales.length) {\n\t\treturn messages;\n\t}\n\n\tif (cached) {\n\t\treturn cached.get(supportedLocales[supportedLocales.length - 1]) as T;\n\t}\n}\n\n/**\n * Return a function that formats a specific message, and takes an optional value for token replacement.\n *\n * If both the \"supplemental/likelySubtags\" and \"supplemental/plurals-type-cardinal\" CLDR data have been loaded, then\n * the returned function will have ICU message format support. Otherwise, the returned function will perform a simple\n * token replacement on the message string.\n *\n * Usage:\n * const formatter = getMessageFormatter(bundle, 'guestInfo', 'fr');\n * const message = formatter({\n * host: 'Miles',\n * gender: 'male',\n * guest: 'Oscar',\n * guestCount: '15'\n * });\n *\n * @param bundle\n * The bundle containing the target message.\n *\n * @param key\n * The message's key.\n *\n * @param locale\n * An optional locale for the formatter. If no locale is supplied, or if the locale is not supported, the\n * default locale is used.\n *\n * @return\n * The message formatter.\n */\nexport function getMessageFormatter(\n\tbundle: Bundle,\n\tkey: string,\n\tlocale?: string\n): MessageFormatter {\n\tconst { id = getBundleId(bundle) } = bundle;\n\n\tif (isLoaded('supplemental', 'likelySubtags') && isLoaded('supplemental', 'plurals-type-cardinal')) {\n\t\treturn getIcuMessageFormatter(id, key, locale);\n\t}\n\n\tconst cached = bundleMap.get(id);\n\tconst messages = cached ? cached.get(locale || getRootLocale()) || cached.get('root') : null;\n\n\tif (!messages) {\n\t\tthrow new Error(`The bundle has not been registered.`);\n\t}\n\n\treturn function(options: FormatOptions = Object.create(null)) {\n\t\treturn messages[key].replace(TOKEN_PATTERN, (token: string, property: string) => {\n\t\t\tconst value = options[property];\n\n\t\t\tif (typeof value === 'undefined') {\n\t\t\t\tthrow new Error(`Missing property ${property}`);\n\t\t\t}\n\n\t\t\treturn value;\n\t\t});\n\t};\n}\n\n/**\n * Load locale-specific messages for the specified bundle and locale.\n *\n * @param bundle\n * The default bundle that is used to determine where the locale-specific bundles are located.\n *\n * @param locale\n * An optional locale. If no locale is provided, then the current locale is assumed.\n *\n * @return A promise to the locale-specific messages.\n */\nasync function i18n(bundle: Bundle, locale?: string): Promise {\n\tconst currentLocale = locale ? normalizeLocale(locale) : getRootLocale();\n\tconst cachedMessages = getCachedMessages(bundle, currentLocale);\n\n\tif (cachedMessages) {\n\t\treturn cachedMessages;\n\t}\n\n\tconst locales = bundle.locales as LocaleLoaders;\n\tconst supportedLocales = getSupportedLocales(currentLocale, Object.keys(locales));\n\tconst bundles = await loadLocaleBundles(locales, supportedLocales);\n\treturn bundles.reduce((previous: any, partial: any): T => {\n\t\tconst localeMessages: T = { ...previous, ...partial };\n\t\tloadMessages(getBundleId(bundle), Object.freeze(localeMessages), currentLocale);\n\t\treturn localeMessages;\n\t}, bundle.messages);\n}\n\nObject.defineProperty(i18n, 'locale', {\n\tget: getRootLocale\n});\n\nexport default i18n as I18n;\n\n/**\n * Invalidate the cache for a particular bundle, or invalidate the entire cache. Note that cached messages for all\n * locales for a given bundle will be cleared.\n *\n * @param bundle\n * An optional bundle to invalidate. If no bundle is provided, then the cache is cleared for all bundles.\n */\nexport function invalidate(bundle?: Bundle) {\n\tif (bundle) {\n\t\tbundle.id && bundleMap.delete(bundle.id);\n\t} else {\n\t\tbundleMap.clear();\n\t}\n}\n\n/**\n * Register an observer to be notified when the root locale changes.\n *\n * @param callback\n * A callback function which will receive the updated locale string on updates.\n *\n * @return\n * A handle object that can be used to unsubscribe from updates.\n */\nexport const observeLocale = function(callback: (locale: string) => {}): Handle {\n\treturn localeProducer.on('change', (event: any) => {\n\t\tcallback(event.target);\n\t});\n};\n\n/**\n * Pre-load locale-specific messages into the i18n system.\n *\n * @param bundle\n * The default bundle that is used to merge locale-specific messages with the default messages.\n *\n * @param messages\n * The messages to cache.\n *\n * @param locale\n * The locale for the messages\n */\nexport function setLocaleMessages(\n\tbundle: Bundle,\n\tlocaleMessages: Partial,\n\tlocale: string\n): void {\n\tconst messages: T = { ...(bundle.messages as any), ...(localeMessages as any) };\n\tloadMessages(getBundleId(bundle), Object.freeze(messages), locale);\n}\n\n/**\n * Change the root locale, and notify any registered observers.\n *\n * @param locale\n * The new locale.\n */\nexport function switchLocale(locale: string): void {\n\tconst previous = rootLocale;\n\trootLocale = locale ? normalizeLocale(locale) : '';\n\n\tif (previous !== rootLocale) {\n\t\tif (isLoaded('supplemental', 'likelySubtags')) {\n\t\t\tGlobalize.load({\n\t\t\t\tmain: {\n\t\t\t\t\t[rootLocale]: {}\n\t\t\t\t}\n\t\t\t});\n\t\t\tGlobalize.locale(rootLocale);\n\t\t}\n\n\t\tlocaleProducer.emit({ type: 'change', target: rootLocale });\n\t}\n}\n\n/**\n * The default environment locale.\n *\n * It should be noted that while the system locale will be normalized to a single\n * format when loading message bundles, this value represents the unaltered\n * locale returned directly by the environment.\n */\nexport const systemLocale: string = (function() {\n\tlet systemLocale = 'en';\n\tif (has('host-browser')) {\n\t\tconst navigator = global.navigator;\n\t\tsystemLocale = navigator.language || navigator.userLanguage;\n\t} else if (has('host-node')) {\n\t\tsystemLocale = process.env.LANG || systemLocale;\n\t}\n\treturn normalizeLocale(systemLocale);\n})();\n"]} \ No newline at end of file diff --git a/deps/framework/i18n/i18n.mjs b/deps/framework/i18n/i18n.mjs deleted file mode 100644 index 0bc1c8c8e2..0000000000 --- a/deps/framework/i18n/i18n.mjs +++ /dev/null @@ -1,363 +0,0 @@ -import * as tslib_1 from "tslib"; -/* tslint:disable:interface-name */ -import 'globalize/dist/globalize/message'; -import global from '../shim/global'; -import Map from '../shim/Map'; -import Evented from '../core/Evented'; -import has from '../core/has'; -import uuid from '../core/uuid'; -import { useDefault } from '../core/load/util'; -import { isLoaded } from './cldr/load'; -import { generateLocales, normalizeLocale } from './util/main'; -// TODO: use normal imports after landing https://github.com/DefinitelyTyped/DefinitelyTyped/pull/27271 -const Globalize = require('globalize/dist/globalize'); -const TOKEN_PATTERN = /\{([a-z0-9_]+)\}/gi; -const bundleMap = new Map(); -const formatterMap = new Map(); -const localeProducer = new Evented(); -let rootLocale; -/** - * Return the bundle's unique identifier, creating one if it does not already exist. - * - * @param bundle A message bundle - * @return The bundle's unique identifier - */ -function getBundleId(bundle) { - if (bundle.id) { - return bundle.id; - } - const id = uuid(); - Object.defineProperty(bundle, 'id', { - value: id - }); - return id; -} -/** - * @private - * Return a function that formats an ICU-style message, and takes an optional value for token replacement. - * - * Usage: - * const formatter = getMessageFormatter(bundle, 'guestInfo', 'fr'); - * const message = formatter({ - * host: 'Miles', - * gender: 'male', - * guest: 'Oscar', - * guestCount: '15' - * }); - * - * @param id - * The message's bundle id. - * - * @param key - * The message's key. - * - * @param locale - * An optional locale for the formatter. If no locale is supplied, or if the locale is not supported, the - * default locale is used. - * - * @return - * The message formatter. - */ -function getIcuMessageFormatter(id, key, locale) { - locale = normalizeLocale(locale || getRootLocale()); - const formatterKey = `${locale}:${id}:${key}`; - let formatter = formatterMap.get(formatterKey); - if (formatter) { - return formatter; - } - const globalize = locale !== getRootLocale() ? new Globalize(normalizeLocale(locale)) : Globalize; - formatter = globalize.messageFormatter(`${id}/${key}`); - const cached = bundleMap.get(id); - if (cached && cached.get(locale)) { - formatterMap.set(formatterKey, formatter); - } - return formatter; -} -/** - * @private - * Load the specified locale-specific bundles, mapping the default exports to simple `Messages` objects. - */ -function loadLocaleBundles(locales, supported) { - return Promise.all(supported.map((locale) => locales[locale]())).then((bundles) => { - return bundles.map((bundle) => useDefault(bundle)); - }); -} -/** - * @private - * Return the root locale. Defaults to the system locale. - */ -function getRootLocale() { - return rootLocale || systemLocale; -} -/** - * @private - * Retrieve a list of supported locales that can provide messages for the specified locale. - * - * @param locale - * The target locale. - * - * @param supported - * The locales that are supported by the bundle. - * - * @return - * A list of supported locales that match the target locale. - */ -function getSupportedLocales(locale, supported = []) { - return generateLocales(locale).filter((locale) => supported.indexOf(locale) > -1); -} -/** - * @private - * Inject messages for the specified locale into the i18n system. - * - * @param id - * The bundle's unique identifier - * - * @param messages - * The messages to inject - * - * @param locale - * An optional locale. If not specified, then it is assumed that the messages are the defaults for the given - * bundle path. - */ -function loadMessages(id, messages, locale = 'root') { - let cached = bundleMap.get(id); - if (!cached) { - cached = new Map(); - bundleMap.set(id, cached); - } - cached.set(locale, messages); - Globalize.loadMessages({ - [locale]: { - [id]: messages - } - }); -} -/** - * Return a formatted message. - * - * If both the "supplemental/likelySubtags" and "supplemental/plurals-type-cardinal" CLDR data have been loaded, then - * the ICU message format is supported. Otherwise, a simple token-replacement mechanism is used. - * - * Usage: - * formatMessage(bundle, 'guestInfo', { - * host: 'Bill', - * guest: 'John' - * }, 'fr'); - * - * @param bundle - * The bundle containing the target message. - * - * @param key - * The message's key. - * - * @param options - * An optional value used by the formatter to replace tokens with values. - * - * @param locale - * An optional locale for the formatter. If no locale is supplied, or if the locale is not supported, the - * default locale is used. - * - * @return - * The formatted message. - */ -export function formatMessage(bundle, key, options, locale) { - return getMessageFormatter(bundle, key, locale)(options); -} -/** - * Return the cached messages for the specified bundle and locale. If messages have not been previously loaded for the - * specified locale, no value will be returned. - * - * @param bundle - * The default bundle that is used to determine where the locale-specific bundles are located. - * - * @param locale - * The locale of the desired messages. - * - * @return The cached messages object, if it exists. - */ -export function getCachedMessages(bundle, locale) { - const { id = getBundleId(bundle), locales, messages } = bundle; - const cached = bundleMap.get(id); - if (!cached) { - loadMessages(id, messages); - } - else { - const localeMessages = cached.get(locale); - if (localeMessages) { - return localeMessages; - } - } - const supportedLocales = getSupportedLocales(locale, locales && Object.keys(locales)); - if (!supportedLocales.length) { - return messages; - } - if (cached) { - return cached.get(supportedLocales[supportedLocales.length - 1]); - } -} -/** - * Return a function that formats a specific message, and takes an optional value for token replacement. - * - * If both the "supplemental/likelySubtags" and "supplemental/plurals-type-cardinal" CLDR data have been loaded, then - * the returned function will have ICU message format support. Otherwise, the returned function will perform a simple - * token replacement on the message string. - * - * Usage: - * const formatter = getMessageFormatter(bundle, 'guestInfo', 'fr'); - * const message = formatter({ - * host: 'Miles', - * gender: 'male', - * guest: 'Oscar', - * guestCount: '15' - * }); - * - * @param bundle - * The bundle containing the target message. - * - * @param key - * The message's key. - * - * @param locale - * An optional locale for the formatter. If no locale is supplied, or if the locale is not supported, the - * default locale is used. - * - * @return - * The message formatter. - */ -export function getMessageFormatter(bundle, key, locale) { - const { id = getBundleId(bundle) } = bundle; - if (isLoaded('supplemental', 'likelySubtags') && isLoaded('supplemental', 'plurals-type-cardinal')) { - return getIcuMessageFormatter(id, key, locale); - } - const cached = bundleMap.get(id); - const messages = cached ? cached.get(locale || getRootLocale()) || cached.get('root') : null; - if (!messages) { - throw new Error(`The bundle has not been registered.`); - } - return function (options = Object.create(null)) { - return messages[key].replace(TOKEN_PATTERN, (token, property) => { - const value = options[property]; - if (typeof value === 'undefined') { - throw new Error(`Missing property ${property}`); - } - return value; - }); - }; -} -/** - * Load locale-specific messages for the specified bundle and locale. - * - * @param bundle - * The default bundle that is used to determine where the locale-specific bundles are located. - * - * @param locale - * An optional locale. If no locale is provided, then the current locale is assumed. - * - * @return A promise to the locale-specific messages. - */ -function i18n(bundle, locale) { - return tslib_1.__awaiter(this, void 0, void 0, function* () { - const currentLocale = locale ? normalizeLocale(locale) : getRootLocale(); - const cachedMessages = getCachedMessages(bundle, currentLocale); - if (cachedMessages) { - return cachedMessages; - } - const locales = bundle.locales; - const supportedLocales = getSupportedLocales(currentLocale, Object.keys(locales)); - const bundles = yield loadLocaleBundles(locales, supportedLocales); - return bundles.reduce((previous, partial) => { - const localeMessages = Object.assign({}, previous, partial); - loadMessages(getBundleId(bundle), Object.freeze(localeMessages), currentLocale); - return localeMessages; - }, bundle.messages); - }); -} -Object.defineProperty(i18n, 'locale', { - get: getRootLocale -}); -export default i18n; -/** - * Invalidate the cache for a particular bundle, or invalidate the entire cache. Note that cached messages for all - * locales for a given bundle will be cleared. - * - * @param bundle - * An optional bundle to invalidate. If no bundle is provided, then the cache is cleared for all bundles. - */ -export function invalidate(bundle) { - if (bundle) { - bundle.id && bundleMap.delete(bundle.id); - } - else { - bundleMap.clear(); - } -} -/** - * Register an observer to be notified when the root locale changes. - * - * @param callback - * A callback function which will receive the updated locale string on updates. - * - * @return - * A handle object that can be used to unsubscribe from updates. - */ -export const observeLocale = function (callback) { - return localeProducer.on('change', (event) => { - callback(event.target); - }); -}; -/** - * Pre-load locale-specific messages into the i18n system. - * - * @param bundle - * The default bundle that is used to merge locale-specific messages with the default messages. - * - * @param messages - * The messages to cache. - * - * @param locale - * The locale for the messages - */ -export function setLocaleMessages(bundle, localeMessages, locale) { - const messages = Object.assign({}, bundle.messages, localeMessages); - loadMessages(getBundleId(bundle), Object.freeze(messages), locale); -} -/** - * Change the root locale, and notify any registered observers. - * - * @param locale - * The new locale. - */ -export function switchLocale(locale) { - const previous = rootLocale; - rootLocale = locale ? normalizeLocale(locale) : ''; - if (previous !== rootLocale) { - if (isLoaded('supplemental', 'likelySubtags')) { - Globalize.load({ - main: { - [rootLocale]: {} - } - }); - Globalize.locale(rootLocale); - } - localeProducer.emit({ type: 'change', target: rootLocale }); - } -} -/** - * The default environment locale. - * - * It should be noted that while the system locale will be normalized to a single - * format when loading message bundles, this value represents the unaltered - * locale returned directly by the environment. - */ -export const systemLocale = (function () { - let systemLocale = 'en'; - if (has('host-browser')) { - const navigator = global.navigator; - systemLocale = navigator.language || navigator.userLanguage; - } - else if (has('host-node')) { - systemLocale = process.env.LANG || systemLocale; - } - return normalizeLocale(systemLocale); -})(); -//# sourceMappingURL=i18n.mjs.map \ No newline at end of file diff --git a/deps/framework/i18n/i18n.mjs.map b/deps/framework/i18n/i18n.mjs.map deleted file mode 100644 index 8259e4d979..0000000000 --- a/deps/framework/i18n/i18n.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"i18n.mjs","sourceRoot":"","sources":["i18n.ts"],"names":[],"mappings":";AAAA,mCAAmC;AACnC,OAAO,kCAAkC,CAAC;AAC1C,OAAO,MAAM,MAAM,gBAAgB,CAAC;AACpC,OAAO,GAAG,MAAM,aAAa,CAAC;AAC9B,OAAO,OAAO,MAAM,iBAAiB,CAAC;AACtC,OAAO,GAAG,MAAM,aAAa,CAAC;AAC9B,OAAO,IAAI,MAAM,cAAc,CAAC;AAEhC,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAE/C,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAE/D,uGAAuG;AACvG,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,CAAC;AACF,CAAC;AAED;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,YAAY,GAAW,CAAC;IACpC,IAAI,YAAY,GAAG,IAAI,CAAC;IACxB,EAAE,CAAC,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC;QACzB,MAAM,SAAS,GAAG,MAAM,CAAC,SAAS,CAAC;QACnC,YAAY,GAAG,SAAS,CAAC,QAAQ,IAAI,SAAS,CAAC,YAAY,CAAC;IAC7D,CAAC;IAAC,IAAI,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC;QAC7B,YAAY,GAAG,OAAO,CAAC,GAAG,CAAC,IAAI,IAAI,YAAY,CAAC;IACjD,CAAC;IACD,MAAM,CAAC,eAAe,CAAC,YAAY,CAAC,CAAC;AACtC,CAAC,CAAC,EAAE,CAAC","sourcesContent":["/* tslint:disable:interface-name */\nimport 'globalize/dist/globalize/message';\nimport global from '../shim/global';\nimport Map from '../shim/Map';\nimport Evented from '../core/Evented';\nimport has from '../core/has';\nimport uuid from '../core/uuid';\nimport { Handle } from '../core/interfaces';\nimport { useDefault } from '../core/load/util';\nimport * as GlobalizeType from 'globalize';\nimport { isLoaded } from './cldr/load';\nimport { generateLocales, normalizeLocale } from './util/main';\n\n// TODO: use normal imports after landing https://github.com/DefinitelyTyped/DefinitelyTyped/pull/27271\nconst Globalize: typeof GlobalizeType = require('globalize/dist/globalize');\n\n/**\n * A default bundle used as basis for loading locale-specific bundles.\n */\nexport interface Bundle {\n\t/**\n\t * A unique identifier for the bundle that will be generated automatically when it is registered.\n\t */\n\treadonly id?: string;\n\n\t/**\n\t * A list of supported locales. Any included locale MUST have an associated bundle.\n\t */\n\treadonly locales?: LocaleLoaders;\n\n\t/**\n\t * The map of default messages that will be used when locale-specific messages are unavailable.\n\t * Note that any message key used in the i18n system MUST have a default specified here.\n\t */\n\treadonly messages: T;\n}\n\n/**\n * Options object passed to message formatters and used for token replacement.\n */\nexport interface FormatOptions {\n\t[key: string]: any;\n}\n\nexport interface I18n {\n\t(bundle: Bundle, locale?: string): Promise;\n\n\t/**\n\t * The current namespace as set via `switchLocale`. Defaults to `systemLocale`.\n\t */\n\treadonly locale: string;\n}\n\n/**\n * A map of locales to functions responsible for loading their respective translations.\n */\nexport interface LocaleLoaders {\n\t[locale: string]: () => LocaleTranslations | Promise>;\n}\n\n/**\n * An object of locale-specific translations.\n */\nexport type LocaleTranslations = Partial | { default?: Partial };\n\n/**\n * Describes a compiled ICU message formatter function.\n */\nexport interface MessageFormatter {\n\t(options?: FormatOptions): string;\n}\n\n/**\n * An object of keys to locale messages.\n */\nexport interface Messages {\n\t[key: string]: string;\n}\n\nconst TOKEN_PATTERN = /\\{([a-z0-9_]+)\\}/gi;\nconst bundleMap = new Map>();\nconst formatterMap = new Map();\nconst localeProducer = new Evented();\nlet rootLocale: string;\n\n/**\n * Return the bundle's unique identifier, creating one if it does not already exist.\n *\n * @param bundle A message bundle\n * @return The bundle's unique identifier\n */\nfunction getBundleId(bundle: Bundle): string {\n\tif (bundle.id) {\n\t\treturn bundle.id;\n\t}\n\n\tconst id = uuid();\n\tObject.defineProperty(bundle, 'id', {\n\t\tvalue: id\n\t});\n\treturn id;\n}\n\n/**\n * @private\n * Return a function that formats an ICU-style message, and takes an optional value for token replacement.\n *\n * Usage:\n * const formatter = getMessageFormatter(bundle, 'guestInfo', 'fr');\n * const message = formatter({\n * host: 'Miles',\n * gender: 'male',\n * guest: 'Oscar',\n * guestCount: '15'\n * });\n *\n * @param id\n * The message's bundle id.\n *\n * @param key\n * The message's key.\n *\n * @param locale\n * An optional locale for the formatter. If no locale is supplied, or if the locale is not supported, the\n * default locale is used.\n *\n * @return\n * The message formatter.\n */\nfunction getIcuMessageFormatter(id: string, key: string, locale?: string): MessageFormatter {\n\tlocale = normalizeLocale(locale || getRootLocale());\n\tconst formatterKey = `${locale}:${id}:${key}`;\n\tlet formatter = formatterMap.get(formatterKey);\n\n\tif (formatter) {\n\t\treturn formatter;\n\t}\n\n\tconst globalize = locale !== getRootLocale() ? new Globalize(normalizeLocale(locale)) : Globalize;\n\tformatter = globalize.messageFormatter(`${id}/${key}`);\n\n\tconst cached = bundleMap.get(id);\n\tif (cached && cached.get(locale)) {\n\t\tformatterMap.set(formatterKey, formatter);\n\t}\n\n\treturn formatter;\n}\n\n/**\n * @private\n * Load the specified locale-specific bundles, mapping the default exports to simple `Messages` objects.\n */\nfunction loadLocaleBundles(locales: LocaleLoaders, supported: string[]): Promise {\n\treturn Promise.all(supported.map((locale) => locales[locale]())).then((bundles) => {\n\t\treturn bundles.map((bundle) => useDefault(bundle));\n\t});\n}\n\n/**\n * @private\n * Return the root locale. Defaults to the system locale.\n */\nfunction getRootLocale(): string {\n\treturn rootLocale || systemLocale;\n}\n\n/**\n * @private\n * Retrieve a list of supported locales that can provide messages for the specified locale.\n *\n * @param locale\n * The target locale.\n *\n * @param supported\n * The locales that are supported by the bundle.\n *\n * @return\n * A list of supported locales that match the target locale.\n */\nfunction getSupportedLocales(locale: string, supported: string[] = []): string[] {\n\treturn generateLocales(locale).filter((locale: string) => supported.indexOf(locale) > -1);\n}\n\n/**\n * @private\n * Inject messages for the specified locale into the i18n system.\n *\n * @param id\n * The bundle's unique identifier\n *\n * @param messages\n * The messages to inject\n *\n * @param locale\n * An optional locale. If not specified, then it is assumed that the messages are the defaults for the given\n * bundle path.\n */\nfunction loadMessages(id: string, messages: T, locale: string = 'root') {\n\tlet cached = bundleMap.get(id);\n\n\tif (!cached) {\n\t\tcached = new Map();\n\t\tbundleMap.set(id, cached);\n\t}\n\n\tcached.set(locale, messages);\n\tGlobalize.loadMessages({\n\t\t[locale]: {\n\t\t\t[id]: messages\n\t\t}\n\t});\n}\n\n/**\n * Return a formatted message.\n *\n * If both the \"supplemental/likelySubtags\" and \"supplemental/plurals-type-cardinal\" CLDR data have been loaded, then\n * the ICU message format is supported. Otherwise, a simple token-replacement mechanism is used.\n *\n * Usage:\n * formatMessage(bundle, 'guestInfo', {\n * host: 'Bill',\n * guest: 'John'\n * }, 'fr');\n *\n * @param bundle\n * The bundle containing the target message.\n *\n * @param key\n * The message's key.\n *\n * @param options\n * An optional value used by the formatter to replace tokens with values.\n *\n * @param locale\n * An optional locale for the formatter. If no locale is supplied, or if the locale is not supported, the\n * default locale is used.\n *\n * @return\n * The formatted message.\n */\nexport function formatMessage(\n\tbundle: Bundle,\n\tkey: string,\n\toptions?: FormatOptions,\n\tlocale?: string\n): string {\n\treturn getMessageFormatter(bundle, key, locale)(options);\n}\n\n/**\n * Return the cached messages for the specified bundle and locale. If messages have not been previously loaded for the\n * specified locale, no value will be returned.\n *\n * @param bundle\n * The default bundle that is used to determine where the locale-specific bundles are located.\n *\n * @param locale\n * The locale of the desired messages.\n *\n * @return The cached messages object, if it exists.\n */\nexport function getCachedMessages(bundle: Bundle, locale: string): T | void {\n\tconst { id = getBundleId(bundle), locales, messages } = bundle;\n\tconst cached = bundleMap.get(id);\n\n\tif (!cached) {\n\t\tloadMessages(id, messages);\n\t} else {\n\t\tconst localeMessages = cached.get(locale);\n\t\tif (localeMessages) {\n\t\t\treturn localeMessages as T;\n\t\t}\n\t}\n\n\tconst supportedLocales = getSupportedLocales(locale, locales && Object.keys(locales));\n\tif (!supportedLocales.length) {\n\t\treturn messages;\n\t}\n\n\tif (cached) {\n\t\treturn cached.get(supportedLocales[supportedLocales.length - 1]) as T;\n\t}\n}\n\n/**\n * Return a function that formats a specific message, and takes an optional value for token replacement.\n *\n * If both the \"supplemental/likelySubtags\" and \"supplemental/plurals-type-cardinal\" CLDR data have been loaded, then\n * the returned function will have ICU message format support. Otherwise, the returned function will perform a simple\n * token replacement on the message string.\n *\n * Usage:\n * const formatter = getMessageFormatter(bundle, 'guestInfo', 'fr');\n * const message = formatter({\n * host: 'Miles',\n * gender: 'male',\n * guest: 'Oscar',\n * guestCount: '15'\n * });\n *\n * @param bundle\n * The bundle containing the target message.\n *\n * @param key\n * The message's key.\n *\n * @param locale\n * An optional locale for the formatter. If no locale is supplied, or if the locale is not supported, the\n * default locale is used.\n *\n * @return\n * The message formatter.\n */\nexport function getMessageFormatter(\n\tbundle: Bundle,\n\tkey: string,\n\tlocale?: string\n): MessageFormatter {\n\tconst { id = getBundleId(bundle) } = bundle;\n\n\tif (isLoaded('supplemental', 'likelySubtags') && isLoaded('supplemental', 'plurals-type-cardinal')) {\n\t\treturn getIcuMessageFormatter(id, key, locale);\n\t}\n\n\tconst cached = bundleMap.get(id);\n\tconst messages = cached ? cached.get(locale || getRootLocale()) || cached.get('root') : null;\n\n\tif (!messages) {\n\t\tthrow new Error(`The bundle has not been registered.`);\n\t}\n\n\treturn function(options: FormatOptions = Object.create(null)) {\n\t\treturn messages[key].replace(TOKEN_PATTERN, (token: string, property: string) => {\n\t\t\tconst value = options[property];\n\n\t\t\tif (typeof value === 'undefined') {\n\t\t\t\tthrow new Error(`Missing property ${property}`);\n\t\t\t}\n\n\t\t\treturn value;\n\t\t});\n\t};\n}\n\n/**\n * Load locale-specific messages for the specified bundle and locale.\n *\n * @param bundle\n * The default bundle that is used to determine where the locale-specific bundles are located.\n *\n * @param locale\n * An optional locale. If no locale is provided, then the current locale is assumed.\n *\n * @return A promise to the locale-specific messages.\n */\nasync function i18n(bundle: Bundle, locale?: string): Promise {\n\tconst currentLocale = locale ? normalizeLocale(locale) : getRootLocale();\n\tconst cachedMessages = getCachedMessages(bundle, currentLocale);\n\n\tif (cachedMessages) {\n\t\treturn cachedMessages;\n\t}\n\n\tconst locales = bundle.locales as LocaleLoaders;\n\tconst supportedLocales = getSupportedLocales(currentLocale, Object.keys(locales));\n\tconst bundles = await loadLocaleBundles(locales, supportedLocales);\n\treturn bundles.reduce((previous: any, partial: any): T => {\n\t\tconst localeMessages: T = { ...previous, ...partial };\n\t\tloadMessages(getBundleId(bundle), Object.freeze(localeMessages), currentLocale);\n\t\treturn localeMessages;\n\t}, bundle.messages);\n}\n\nObject.defineProperty(i18n, 'locale', {\n\tget: getRootLocale\n});\n\nexport default i18n as I18n;\n\n/**\n * Invalidate the cache for a particular bundle, or invalidate the entire cache. Note that cached messages for all\n * locales for a given bundle will be cleared.\n *\n * @param bundle\n * An optional bundle to invalidate. If no bundle is provided, then the cache is cleared for all bundles.\n */\nexport function invalidate(bundle?: Bundle) {\n\tif (bundle) {\n\t\tbundle.id && bundleMap.delete(bundle.id);\n\t} else {\n\t\tbundleMap.clear();\n\t}\n}\n\n/**\n * Register an observer to be notified when the root locale changes.\n *\n * @param callback\n * A callback function which will receive the updated locale string on updates.\n *\n * @return\n * A handle object that can be used to unsubscribe from updates.\n */\nexport const observeLocale = function(callback: (locale: string) => {}): Handle {\n\treturn localeProducer.on('change', (event: any) => {\n\t\tcallback(event.target);\n\t});\n};\n\n/**\n * Pre-load locale-specific messages into the i18n system.\n *\n * @param bundle\n * The default bundle that is used to merge locale-specific messages with the default messages.\n *\n * @param messages\n * The messages to cache.\n *\n * @param locale\n * The locale for the messages\n */\nexport function setLocaleMessages(\n\tbundle: Bundle,\n\tlocaleMessages: Partial,\n\tlocale: string\n): void {\n\tconst messages: T = { ...(bundle.messages as any), ...(localeMessages as any) };\n\tloadMessages(getBundleId(bundle), Object.freeze(messages), locale);\n}\n\n/**\n * Change the root locale, and notify any registered observers.\n *\n * @param locale\n * The new locale.\n */\nexport function switchLocale(locale: string): void {\n\tconst previous = rootLocale;\n\trootLocale = locale ? normalizeLocale(locale) : '';\n\n\tif (previous !== rootLocale) {\n\t\tif (isLoaded('supplemental', 'likelySubtags')) {\n\t\t\tGlobalize.load({\n\t\t\t\tmain: {\n\t\t\t\t\t[rootLocale]: {}\n\t\t\t\t}\n\t\t\t});\n\t\t\tGlobalize.locale(rootLocale);\n\t\t}\n\n\t\tlocaleProducer.emit({ type: 'change', target: rootLocale });\n\t}\n}\n\n/**\n * The default environment locale.\n *\n * It should be noted that while the system locale will be normalized to a single\n * format when loading message bundles, this value represents the unaltered\n * locale returned directly by the environment.\n */\nexport const systemLocale: string = (function() {\n\tlet systemLocale = 'en';\n\tif (has('host-browser')) {\n\t\tconst navigator = global.navigator;\n\t\tsystemLocale = navigator.language || navigator.userLanguage;\n\t} else if (has('host-node')) {\n\t\tsystemLocale = process.env.LANG || systemLocale;\n\t}\n\treturn normalizeLocale(systemLocale);\n})();\n"]} \ No newline at end of file diff --git a/deps/framework/i18n/main.d.ts b/deps/framework/i18n/main.d.ts deleted file mode 100644 index fe78feae7a..0000000000 --- a/deps/framework/i18n/main.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { DateFormatterOptions, DateLength, formatDate, formatRelativeTime, getDateFormatter, getDateParser, getRelativeTimeFormatter, parseDate, RelativeTimeFormatterOptions, RelativeTimeLength } from './date'; -import i18n, { Bundle, formatMessage, FormatOptions, getCachedMessages, getMessageFormatter, I18n, invalidate, LocaleLoaders, LocaleTranslations, MessageFormatter, Messages, setLocaleMessages, switchLocale, systemLocale } from './i18n'; -import { CurrencyFormatterOptions, CurrencyStyleOption, formatCurrency, formatNumber, getCurrencyFormatter, getNumberFormatter, getNumberParser, getPluralGenerator, NumberFormatterOptions, NumberParserOptions, NumberStyleOption, parseNumber, PluralGeneratorOptions, PluralGroup, pluralize, PluralTypeOption, RoundNumberOption } from './number'; -import { formatUnit, getUnitFormatter, UnitFormatterOptions, UnitLength } from './unit'; -import { generateLocales, normalizeLocale } from './util/main'; -import loadCldrData from './cldr/load'; -export default i18n; -export { Bundle, CurrencyFormatterOptions, CurrencyStyleOption, DateFormatterOptions, DateLength, formatCurrency, formatDate, formatMessage, formatNumber, FormatOptions, formatRelativeTime, formatUnit, generateLocales, getCachedMessages, getCurrencyFormatter, getDateFormatter, getDateParser, getMessageFormatter, getNumberFormatter, getNumberParser, getPluralGenerator, getRelativeTimeFormatter, getUnitFormatter, I18n, invalidate, loadCldrData, LocaleLoaders, LocaleTranslations, MessageFormatter, Messages, normalizeLocale, NumberFormatterOptions, NumberParserOptions, NumberStyleOption, parseDate, parseNumber, PluralGeneratorOptions, PluralGroup, pluralize, PluralTypeOption, RelativeTimeFormatterOptions, RelativeTimeLength, RoundNumberOption, setLocaleMessages, switchLocale, systemLocale, UnitFormatterOptions, UnitLength }; diff --git a/deps/framework/i18n/main.js b/deps/framework/i18n/main.js deleted file mode 100644 index 9018523a93..0000000000 --- a/deps/framework/i18n/main.js +++ /dev/null @@ -1,46 +0,0 @@ -(function (factory) { - if (typeof module === "object" && typeof module.exports === "object") { - var v = factory(require, exports); - if (v !== undefined) module.exports = v; - } - else if (typeof define === "function" && define.amd) { - define(["require", "exports", "./date", "./i18n", "./number", "./unit", "./util/main", "./cldr/load"], factory); - } -})(function (require, exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - var date_1 = require("./date"); - exports.formatDate = date_1.formatDate; - exports.formatRelativeTime = date_1.formatRelativeTime; - exports.getDateFormatter = date_1.getDateFormatter; - exports.getDateParser = date_1.getDateParser; - exports.getRelativeTimeFormatter = date_1.getRelativeTimeFormatter; - exports.parseDate = date_1.parseDate; - var i18n_1 = require("./i18n"); - exports.formatMessage = i18n_1.formatMessage; - exports.getCachedMessages = i18n_1.getCachedMessages; - exports.getMessageFormatter = i18n_1.getMessageFormatter; - exports.invalidate = i18n_1.invalidate; - exports.setLocaleMessages = i18n_1.setLocaleMessages; - exports.switchLocale = i18n_1.switchLocale; - exports.systemLocale = i18n_1.systemLocale; - var number_1 = require("./number"); - exports.formatCurrency = number_1.formatCurrency; - exports.formatNumber = number_1.formatNumber; - exports.getCurrencyFormatter = number_1.getCurrencyFormatter; - exports.getNumberFormatter = number_1.getNumberFormatter; - exports.getNumberParser = number_1.getNumberParser; - exports.getPluralGenerator = number_1.getPluralGenerator; - exports.parseNumber = number_1.parseNumber; - exports.pluralize = number_1.pluralize; - var unit_1 = require("./unit"); - exports.formatUnit = unit_1.formatUnit; - exports.getUnitFormatter = unit_1.getUnitFormatter; - var main_1 = require("./util/main"); - exports.generateLocales = main_1.generateLocales; - exports.normalizeLocale = main_1.normalizeLocale; - var load_1 = require("./cldr/load"); - exports.loadCldrData = load_1.default; - exports.default = i18n_1.default; -}); -//# sourceMappingURL=main.js.map \ No newline at end of file diff --git a/deps/framework/i18n/main.js.map b/deps/framework/i18n/main.js.map deleted file mode 100644 index e52768b79a..0000000000 --- a/deps/framework/i18n/main.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"main.js","sourceRoot":"","sources":["main.ts"],"names":[],"mappings":";;;;;;;;;;;IAAA,+BAWgB;IAiDf,qBAzDA,iBAAU,CAyDA;IAIV,6BA5DA,yBAAkB,CA4DA;IAKlB,2BAhEA,uBAAgB,CAgEA;IAChB,wBAhEA,oBAAa,CAgEA;IAKb,mCApEA,+BAAwB,CAoEA;IAaxB,oBAhFA,gBAAS,CAgFA;IA5EV,+BAegB;IAkCf,wBA/CA,oBAAa,CA+CA;IAMb,4BAnDA,wBAAiB,CAmDA;IAIjB,8BAtDA,0BAAmB,CAsDA;IAOnB,qBA3DA,iBAAU,CA2DA;IAmBV,4BAzEA,wBAAiB,CAyEA;IACjB,uBAzEA,mBAAY,CAyEA;IACZ,uBAzEA,mBAAY,CAyEA;IAvEb,mCAkBkB;IAajB,yBA5BA,uBAAc,CA4BA;IAGd,uBA9BA,qBAAY,CA8BA;IAMZ,+BAnCA,6BAAoB,CAmCA;IAIpB,6BAtCA,2BAAkB,CAsCA;IAClB,0BAtCA,wBAAe,CAsCA;IACf,6BAtCA,2BAAkB,CAsCA;IAelB,sBAjDA,oBAAW,CAiDA;IAGX,oBAjDA,kBAAS,CAiDA;IA7CV,+BAAwF;IAkBvF,qBAlBQ,iBAAU,CAkBR;IAWV,2BA7BoB,uBAAgB,CA6BpB;IA5BjB,oCAA+D;IAkB9D,0BAlBQ,sBAAe,CAkBR;IAkBf,0BApCyB,sBAAe,CAoCzB;IAnChB,oCAAuC;IA8BtC,uBA9BM,cAAY,CA8BN;IA5Bb,kBAAe,cAAI,CAAC","sourcesContent":["import {\n\tDateFormatterOptions,\n\tDateLength,\n\tformatDate,\n\tformatRelativeTime,\n\tgetDateFormatter,\n\tgetDateParser,\n\tgetRelativeTimeFormatter,\n\tparseDate,\n\tRelativeTimeFormatterOptions,\n\tRelativeTimeLength\n} from './date';\nimport i18n, {\n\tBundle,\n\tformatMessage,\n\tFormatOptions,\n\tgetCachedMessages,\n\tgetMessageFormatter,\n\tI18n,\n\tinvalidate,\n\tLocaleLoaders,\n\tLocaleTranslations,\n\tMessageFormatter,\n\tMessages,\n\tsetLocaleMessages,\n\tswitchLocale,\n\tsystemLocale\n} from './i18n';\nimport {\n\tCurrencyFormatterOptions,\n\tCurrencyStyleOption,\n\tformatCurrency,\n\tformatNumber,\n\tgetCurrencyFormatter,\n\tgetNumberFormatter,\n\tgetNumberParser,\n\tgetPluralGenerator,\n\tNumberFormatterOptions,\n\tNumberParserOptions,\n\tNumberStyleOption,\n\tparseNumber,\n\tPluralGeneratorOptions,\n\tPluralGroup,\n\tpluralize,\n\tPluralTypeOption,\n\tRoundNumberOption\n} from './number';\nimport { formatUnit, getUnitFormatter, UnitFormatterOptions, UnitLength } from './unit';\nimport { generateLocales, normalizeLocale } from './util/main';\nimport loadCldrData from './cldr/load';\n\nexport default i18n;\n\nexport {\n\tBundle,\n\tCurrencyFormatterOptions,\n\tCurrencyStyleOption,\n\tDateFormatterOptions,\n\tDateLength,\n\tformatCurrency,\n\tformatDate,\n\tformatMessage,\n\tformatNumber,\n\tFormatOptions,\n\tformatRelativeTime,\n\tformatUnit,\n\tgenerateLocales,\n\tgetCachedMessages,\n\tgetCurrencyFormatter,\n\tgetDateFormatter,\n\tgetDateParser,\n\tgetMessageFormatter,\n\tgetNumberFormatter,\n\tgetNumberParser,\n\tgetPluralGenerator,\n\tgetRelativeTimeFormatter,\n\tgetUnitFormatter,\n\tI18n,\n\tinvalidate,\n\tloadCldrData,\n\tLocaleLoaders,\n\tLocaleTranslations,\n\tMessageFormatter,\n\tMessages,\n\tnormalizeLocale,\n\tNumberFormatterOptions,\n\tNumberParserOptions,\n\tNumberStyleOption,\n\tparseDate,\n\tparseNumber,\n\tPluralGeneratorOptions,\n\tPluralGroup,\n\tpluralize,\n\tPluralTypeOption,\n\tRelativeTimeFormatterOptions,\n\tRelativeTimeLength,\n\tRoundNumberOption,\n\tsetLocaleMessages,\n\tswitchLocale,\n\tsystemLocale,\n\tUnitFormatterOptions,\n\tUnitLength\n};\n"]} \ No newline at end of file diff --git a/deps/framework/i18n/main.mjs b/deps/framework/i18n/main.mjs deleted file mode 100644 index 4a20859c34..0000000000 --- a/deps/framework/i18n/main.mjs +++ /dev/null @@ -1,9 +0,0 @@ -import { formatDate, formatRelativeTime, getDateFormatter, getDateParser, getRelativeTimeFormatter, parseDate } from './date'; -import i18n, { formatMessage, getCachedMessages, getMessageFormatter, invalidate, setLocaleMessages, switchLocale, systemLocale } from './i18n'; -import { formatCurrency, formatNumber, getCurrencyFormatter, getNumberFormatter, getNumberParser, getPluralGenerator, parseNumber, pluralize } from './number'; -import { formatUnit, getUnitFormatter } from './unit'; -import { generateLocales, normalizeLocale } from './util/main'; -import loadCldrData from './cldr/load'; -export default i18n; -export { formatCurrency, formatDate, formatMessage, formatNumber, formatRelativeTime, formatUnit, generateLocales, getCachedMessages, getCurrencyFormatter, getDateFormatter, getDateParser, getMessageFormatter, getNumberFormatter, getNumberParser, getPluralGenerator, getRelativeTimeFormatter, getUnitFormatter, invalidate, loadCldrData, normalizeLocale, parseDate, parseNumber, pluralize, setLocaleMessages, switchLocale, systemLocale }; -//# sourceMappingURL=main.mjs.map \ No newline at end of file diff --git a/deps/framework/i18n/main.mjs.map b/deps/framework/i18n/main.mjs.map deleted file mode 100644 index beb5fe4614..0000000000 --- a/deps/framework/i18n/main.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"main.mjs","sourceRoot":"","sources":["main.ts"],"names":[],"mappings":"AAAA,OAAO,EAGN,UAAU,EACV,kBAAkB,EAClB,gBAAgB,EAChB,aAAa,EACb,wBAAwB,EACxB,SAAS,EAGT,MAAM,QAAQ,CAAC;AAChB,OAAO,IAAI,EAAE,EAEZ,aAAa,EAEb,iBAAiB,EACjB,mBAAmB,EAEnB,UAAU,EAKV,iBAAiB,EACjB,YAAY,EACZ,YAAY,EACZ,MAAM,QAAQ,CAAC;AAChB,OAAO,EAGN,cAAc,EACd,YAAY,EACZ,oBAAoB,EACpB,kBAAkB,EAClB,eAAe,EACf,kBAAkB,EAIlB,WAAW,EAGX,SAAS,EAGT,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAoC,MAAM,QAAQ,CAAC;AACxF,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAC/D,OAAO,YAAY,MAAM,aAAa,CAAC;AAEvC,eAAe,IAAI,CAAC;AAEpB,OAAO,EAMN,cAAc,EACd,UAAU,EACV,aAAa,EACb,YAAY,EAEZ,kBAAkB,EAClB,UAAU,EACV,eAAe,EACf,iBAAiB,EACjB,oBAAoB,EACpB,gBAAgB,EAChB,aAAa,EACb,mBAAmB,EACnB,kBAAkB,EAClB,eAAe,EACf,kBAAkB,EAClB,wBAAwB,EACxB,gBAAgB,EAEhB,UAAU,EACV,YAAY,EAKZ,eAAe,EAIf,SAAS,EACT,WAAW,EAGX,SAAS,EAKT,iBAAiB,EACjB,YAAY,EACZ,YAAY,EAGZ,CAAC","sourcesContent":["import {\n\tDateFormatterOptions,\n\tDateLength,\n\tformatDate,\n\tformatRelativeTime,\n\tgetDateFormatter,\n\tgetDateParser,\n\tgetRelativeTimeFormatter,\n\tparseDate,\n\tRelativeTimeFormatterOptions,\n\tRelativeTimeLength\n} from './date';\nimport i18n, {\n\tBundle,\n\tformatMessage,\n\tFormatOptions,\n\tgetCachedMessages,\n\tgetMessageFormatter,\n\tI18n,\n\tinvalidate,\n\tLocaleLoaders,\n\tLocaleTranslations,\n\tMessageFormatter,\n\tMessages,\n\tsetLocaleMessages,\n\tswitchLocale,\n\tsystemLocale\n} from './i18n';\nimport {\n\tCurrencyFormatterOptions,\n\tCurrencyStyleOption,\n\tformatCurrency,\n\tformatNumber,\n\tgetCurrencyFormatter,\n\tgetNumberFormatter,\n\tgetNumberParser,\n\tgetPluralGenerator,\n\tNumberFormatterOptions,\n\tNumberParserOptions,\n\tNumberStyleOption,\n\tparseNumber,\n\tPluralGeneratorOptions,\n\tPluralGroup,\n\tpluralize,\n\tPluralTypeOption,\n\tRoundNumberOption\n} from './number';\nimport { formatUnit, getUnitFormatter, UnitFormatterOptions, UnitLength } from './unit';\nimport { generateLocales, normalizeLocale } from './util/main';\nimport loadCldrData from './cldr/load';\n\nexport default i18n;\n\nexport {\n\tBundle,\n\tCurrencyFormatterOptions,\n\tCurrencyStyleOption,\n\tDateFormatterOptions,\n\tDateLength,\n\tformatCurrency,\n\tformatDate,\n\tformatMessage,\n\tformatNumber,\n\tFormatOptions,\n\tformatRelativeTime,\n\tformatUnit,\n\tgenerateLocales,\n\tgetCachedMessages,\n\tgetCurrencyFormatter,\n\tgetDateFormatter,\n\tgetDateParser,\n\tgetMessageFormatter,\n\tgetNumberFormatter,\n\tgetNumberParser,\n\tgetPluralGenerator,\n\tgetRelativeTimeFormatter,\n\tgetUnitFormatter,\n\tI18n,\n\tinvalidate,\n\tloadCldrData,\n\tLocaleLoaders,\n\tLocaleTranslations,\n\tMessageFormatter,\n\tMessages,\n\tnormalizeLocale,\n\tNumberFormatterOptions,\n\tNumberParserOptions,\n\tNumberStyleOption,\n\tparseDate,\n\tparseNumber,\n\tPluralGeneratorOptions,\n\tPluralGroup,\n\tpluralize,\n\tPluralTypeOption,\n\tRelativeTimeFormatterOptions,\n\tRelativeTimeLength,\n\tRoundNumberOption,\n\tsetLocaleMessages,\n\tswitchLocale,\n\tsystemLocale,\n\tUnitFormatterOptions,\n\tUnitLength\n};\n"]} \ No newline at end of file diff --git a/deps/framework/i18n/number.d.ts b/deps/framework/i18n/number.d.ts deleted file mode 100644 index f263518090..0000000000 --- a/deps/framework/i18n/number.d.ts +++ /dev/null @@ -1,223 +0,0 @@ -import 'globalize/dist/globalize'; -import 'globalize/dist/globalize/number'; -import 'globalize/dist/globalize/plural'; -import 'globalize/dist/globalize/currency'; -export declare type CurrencyStyleOption = 'accounting' | 'code' | 'name' | 'symbol'; -export declare type NumberStyleOption = 'decimal' | 'percent'; -export declare type PluralGroup = 'zero' | 'one' | 'two' | 'few' | 'many' | 'other'; -export declare type PluralTypeOption = 'cardinal' | 'ordinal'; -export declare type RoundNumberOption = 'ceil' | 'floor' | 'round' | 'truncate'; -export interface CommonNumberFormatterOptions { - /** - * Non-negative integer Number value indicating the minimum integer digits to be used. Numbers will be padded with - * leading zeroes if necessary. - */ - minimumIntegerDigits?: number; - /** - * Non-negative integer Number values indicating the minimum and maximum fraction digits to be used. - * Numbers will be rounded or padded with trailing zeroes if necessary. - * Either one or both of these properties must be present. - * If they are, they will override minimum and maximum fraction digits derived from the CLDR patterns. - */ - minimumFractionDigits?: number; - /** - * Non-negative integer Number values indicating the minimum and maximum fraction digits to be used. - * Numbers will be rounded or padded with trailing zeroes if necessary. - * Either one or both of these properties must be present. - * If they are, they will override minimum and maximum fraction digits derived from the CLDR patterns. - */ - maximumFractionDigits?: number; - /** - * Positive integer Number values indicating the minimum and maximum fraction digits to be shown. - * Either none or both of these properties are present - * If they are, they override minimum and maximum integer and fraction digits. - * The formatter uses however many integer and fraction digits are required to display the specified number of - * significant digits. - */ - minimumSignificantDigits?: number; - /** - * Positive integer Number values indicating the minimum and maximum fraction digits to be shown. - * Either none or both of these properties are present. - * If they are, they override minimum and maximum integer and fraction digits. - * The formatter uses however many integer and fraction digits are required to display the specified number of - * significant digits. - */ - maximumSignificantDigits?: number; - /** - * String with rounding method ceil, floor, round (default), or truncate. - */ - round?: RoundNumberOption; - /** - * Boolean (default is true) value indicating whether a grouping separator should be used. - */ - useGrouping?: boolean; -} -export declare type CurrencyFormatterOptions = CommonNumberFormatterOptions & { - /** - * symbol (default), accounting, code or name. - */ - style?: CurrencyStyleOption; -}; -export interface NumberFormatter { - /** - * Any function that formats a number as string. - */ - (value: number): string; -} -export declare type NumberFormatterOptions = CommonNumberFormatterOptions & { - /** - * decimal (default), or percent - */ - style?: NumberStyleOption; -}; -export interface NumberParser { - /** - * Any function that parses a number value from a string. - */ - (value: string): number; -} -export declare type NumberParserOptions = { - /** - * decimal (default), or percent. - */ - style?: NumberStyleOption; -}; -export declare type PluralGeneratorOptions = { - /** - * cardinal (default), or ordinal. - */ - type?: PluralTypeOption; -}; -/** - * Format a number as the specified currency, according to the specified configuration and or locale. - * - * @param value - * The number to format. - * - * @param currency - * The currency to which the number should be converted. - * - * @param options - * An optional configuration of settings that determine how the currency string will be formatted. - * - * @param locale - * An optional locale. Defaults to the root locale. - * - * @return - * The formatted currency string. - */ -export declare function formatCurrency(value: number, currency: string, options?: CurrencyFormatterOptions, locale?: string): string; -export declare function formatCurrency(value: number, currency: string, locale?: string): string; -/** - * Format a number according to the specified configuration and or locale. - * - * @param value - * The number to format. - * - * @param options - * An optional configuration of settings that determine how the number string will be formatted. - * - * @param locale - * An optional locale. Defaults to the root locale. - * - * @return - * The formatted number string. - */ -export declare function formatNumber(value: number, options?: NumberFormatterOptions, locale?: string): string; -export declare function formatNumber(value: number, locale?: string): string; -/** - * Return a function that formats a number as the specified currency, according to the specified configuration - * and or locale. - * - * @param currency - * The currency to which the number should be converted. - * - * @param options - * An optional configuration of settings that determine how the currency string will be formatted. - * - * @param locale - * An optional locale. Defaults to the root locale. - * - * @return - * A function that accepts a number and returns a formatted currency string. - */ -export declare function getCurrencyFormatter(currency: string, options?: CurrencyFormatterOptions, locale?: string): NumberFormatter; -export declare function getCurrencyFormatter(currency: string, locale?: string): NumberFormatter; -/** - * Return a function that formats a number according to the specified configuration and or locale. - * - * @param options - * An optional configuration of settings that determine how the number string will be formatted. - * - * @param locale - * An optional locale. Defaults to the root locale. - * - * @return - * A function that accepts a number and returns a formatted string. - */ -export declare function getNumberFormatter(options?: NumberFormatterOptions, locale?: string): NumberFormatter; -export declare function getNumberFormatter(locale?: string): NumberFormatter; -/** - * Parse a number from a string based on the provided configuration and or locale. - * - * @param options - * An optional config that describes the format of the string. - * - * @param locale - * An optional locale. Defaults to the root locale. - * - * @return - * The parsed number. - */ -export declare function getNumberParser(options?: NumberFormatterOptions, locale?: string): NumberParser; -export declare function getNumberParser(locale?: string): NumberParser; -/** - * Return a function that accepts a number and returns that number's plural group. - * - * @param options - * An optional configuration that determines whether the numerical value should be treated as a cardinal - * or ordinal number. - * - * @param locale - * An optional locale. Defaults to the root locale. - * - * @return - * A function that accepts a number and returns the corresponding plural group. - */ -export declare function getPluralGenerator(options?: PluralGeneratorOptions, locale?: string): NumberFormatter; -export declare function getPluralGenerator(locale?: string): NumberFormatter; -/** - * Return a function that parses a number from a string based on the provided configuration and or locale. - * - * @param value - * The string to parse. - * - * @param options - * An optional config that describes the format of the string. - * - * @param locale - * An optional locale. Defaults to the root locale. - * - * @return - * A function that accepts a string and returns a number. - */ -export declare function parseNumber(value: string, options?: NumberFormatterOptions, locale?: string): number; -export declare function parseNumber(value: string, locale?: string): number; -/** - * Return the plural group from a number. - * - * @param value - * The number. - * - * @param options - * An optional configuration that determines whether the numerical value should be treated as a cardinal - * or ordinal number. - * - * @param locale - * An optional locale. Defaults to the root locale. - * - * @return - * The plural group. - */ -export declare function pluralize(value: number, options?: PluralGeneratorOptions, locale?: string): string; -export declare function pluralize(value: number, locale?: string): string; diff --git a/deps/framework/i18n/number.js b/deps/framework/i18n/number.js deleted file mode 100644 index 5e0005ab42..0000000000 --- a/deps/framework/i18n/number.js +++ /dev/null @@ -1,80 +0,0 @@ -(function (factory) { - if (typeof module === "object" && typeof module.exports === "object") { - var v = factory(require, exports); - if (v !== undefined) module.exports = v; - } - else if (typeof define === "function" && define.amd) { - define(["require", "exports", "globalize/dist/globalize", "globalize/dist/globalize/number", "globalize/dist/globalize/plural", "globalize/dist/globalize/currency", "./util/globalize"], factory); - } -})(function (require, exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - require("globalize/dist/globalize"); - require("globalize/dist/globalize/number"); - require("globalize/dist/globalize/plural"); - require("globalize/dist/globalize/currency"); - var globalize_1 = require("./util/globalize"); - function formatCurrency(value, currency, optionsOrLocale, locale) { - return globalize_1.globalizeDelegator('formatCurrency', { - locale: locale, - optionsOrLocale: optionsOrLocale, - unit: currency, - value: value - }); - } - exports.formatCurrency = formatCurrency; - function formatNumber(value, optionsOrLocale, locale) { - return globalize_1.globalizeDelegator('formatNumber', { - locale: locale, - optionsOrLocale: optionsOrLocale, - value: value - }); - } - exports.formatNumber = formatNumber; - function getCurrencyFormatter(currency, optionsOrLocale, locale) { - return globalize_1.globalizeDelegator('currencyFormatter', { - locale: locale, - optionsOrLocale: optionsOrLocale, - unit: currency - }); - } - exports.getCurrencyFormatter = getCurrencyFormatter; - function getNumberFormatter(optionsOrLocale, locale) { - return globalize_1.globalizeDelegator('numberFormatter', { - locale: locale, - optionsOrLocale: optionsOrLocale - }); - } - exports.getNumberFormatter = getNumberFormatter; - function getNumberParser(optionsOrLocale, locale) { - return globalize_1.globalizeDelegator('numberParser', { - locale: locale, - optionsOrLocale: optionsOrLocale - }); - } - exports.getNumberParser = getNumberParser; - function getPluralGenerator(optionsOrLocale, locale) { - return globalize_1.globalizeDelegator('pluralGenerator', { - locale: locale, - optionsOrLocale: optionsOrLocale - }); - } - exports.getPluralGenerator = getPluralGenerator; - function parseNumber(value, optionsOrLocale, locale) { - return globalize_1.globalizeDelegator('parseNumber', { - locale: locale, - optionsOrLocale: optionsOrLocale, - value: value - }); - } - exports.parseNumber = parseNumber; - function pluralize(value, optionsOrLocale, locale) { - return globalize_1.globalizeDelegator('plural', { - locale: locale, - optionsOrLocale: optionsOrLocale, - value: value - }); - } - exports.pluralize = pluralize; -}); -//# sourceMappingURL=number.js.map \ No newline at end of file diff --git a/deps/framework/i18n/number.js.map b/deps/framework/i18n/number.js.map deleted file mode 100644 index 4053d63f11..0000000000 --- a/deps/framework/i18n/number.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"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,eAAiD,EAAE,MAAe;QAC5G,MAAM,CAAC,8BAAkB,CAAyC,aAAa,EAAE;YAChF,MAAM,QAAA;YACN,eAAe,iBAAA;YACf,KAAK,OAAA;SACL,CAAC,CAAC;IACJ,CAAC;IAND,kCAMC;IAoBD,mBAA0B,KAAa,EAAE,eAAiD,EAAE,MAAe;QAC1G,MAAM,CAAC,8BAAkB,CAAyC,QAAQ,EAAE;YAC3E,MAAM,QAAA;YACN,eAAe,iBAAA;YACf,KAAK,OAAA;SACL,CAAC,CAAC;IACJ,CAAC;IAND,8BAMC","sourcesContent":["import 'globalize/dist/globalize';\nimport 'globalize/dist/globalize/number';\nimport 'globalize/dist/globalize/plural';\nimport 'globalize/dist/globalize/currency';\nimport { globalizeDelegator } from './util/globalize';\n\nexport type CurrencyStyleOption = 'accounting' | 'code' | 'name' | 'symbol';\nexport type NumberStyleOption = 'decimal' | 'percent';\nexport type PluralGroup = 'zero' | 'one' | 'two' | 'few' | 'many' | 'other';\nexport type PluralTypeOption = 'cardinal' | 'ordinal';\nexport type RoundNumberOption = 'ceil' | 'floor' | 'round' | 'truncate';\n\nexport interface CommonNumberFormatterOptions {\n\t/**\n\t * Non-negative integer Number value indicating the minimum integer digits to be used. Numbers will be padded with\n\t * leading zeroes if necessary.\n\t */\n\tminimumIntegerDigits?: number;\n\n\t/**\n\t * Non-negative integer Number values indicating the minimum and maximum fraction digits to be used.\n\t * Numbers will be rounded or padded with trailing zeroes if necessary.\n\t * Either one or both of these properties must be present.\n\t * If they are, they will override minimum and maximum fraction digits derived from the CLDR patterns.\n\t */\n\tminimumFractionDigits?: number;\n\n\t/**\n\t * Non-negative integer Number values indicating the minimum and maximum fraction digits to be used.\n\t * Numbers will be rounded or padded with trailing zeroes if necessary.\n\t * Either one or both of these properties must be present.\n\t * If they are, they will override minimum and maximum fraction digits derived from the CLDR patterns.\n\t */\n\tmaximumFractionDigits?: number;\n\n\t/**\n\t * Positive integer Number values indicating the minimum and maximum fraction digits to be shown.\n\t * Either none or both of these properties are present\n\t * If they are, they override minimum and maximum integer and fraction digits.\n\t * The formatter uses however many integer and fraction digits are required to display the specified number of\n\t * significant digits.\n\t */\n\tminimumSignificantDigits?: number;\n\n\t/**\n\t * Positive integer Number values indicating the minimum and maximum fraction digits to be shown.\n\t * Either none or both of these properties are present.\n\t * If they are, they override minimum and maximum integer and fraction digits.\n\t * The formatter uses however many integer and fraction digits are required to display the specified number of\n\t * significant digits.\n\t */\n\tmaximumSignificantDigits?: number;\n\n\t/**\n\t * String with rounding method ceil, floor, round (default), or truncate.\n\t */\n\tround?: RoundNumberOption;\n\n\t/**\n\t * Boolean (default is true) value indicating whether a grouping separator should be used.\n\t */\n\tuseGrouping?: boolean;\n}\n\nexport type CurrencyFormatterOptions = CommonNumberFormatterOptions & {\n\t/**\n\t * symbol (default), accounting, code or name.\n\t */\n\tstyle?: CurrencyStyleOption;\n};\n\nexport interface NumberFormatter {\n\t/**\n\t * Any function that formats a number as string.\n\t */\n\t(value: number): string;\n}\n\nexport type NumberFormatterOptions = CommonNumberFormatterOptions & {\n\t/**\n\t * decimal (default), or percent\n\t */\n\tstyle?: NumberStyleOption;\n};\n\nexport interface NumberParser {\n\t/**\n\t * Any function that parses a number value from a string.\n\t */\n\t(value: string): number;\n}\n\nexport type NumberParserOptions = {\n\t/**\n\t * decimal (default), or percent.\n\t */\n\tstyle?: NumberStyleOption;\n};\n\nexport type PluralGeneratorOptions = {\n\t/**\n\t * cardinal (default), or ordinal.\n\t */\n\ttype?: PluralTypeOption;\n};\n\n/**\n * Format a number as the specified currency, according to the specified configuration and or locale.\n *\n * @param value\n * The number to format.\n *\n * @param currency\n * The currency to which the number should be converted.\n *\n * @param options\n * An optional configuration of settings that determine how the currency string will be formatted.\n *\n * @param locale\n * An optional locale. Defaults to the root locale.\n *\n * @return\n * The formatted currency string.\n */\nexport function formatCurrency(\n\tvalue: number,\n\tcurrency: string,\n\toptions?: CurrencyFormatterOptions,\n\tlocale?: string\n): string;\nexport function formatCurrency(value: number, currency: string, locale?: string): string;\nexport function formatCurrency(\n\tvalue: number,\n\tcurrency: string,\n\toptionsOrLocale?: CurrencyFormatterOptions | string,\n\tlocale?: string\n): string {\n\treturn globalizeDelegator('formatCurrency', {\n\t\tlocale,\n\t\toptionsOrLocale,\n\t\tunit: currency,\n\t\tvalue\n\t});\n}\n\n/**\n * Format a number according to the specified configuration and or locale.\n *\n * @param value\n * The number to format.\n *\n * @param options\n * An optional configuration of settings that determine how the number string will be formatted.\n *\n * @param locale\n * An optional locale. Defaults to the root locale.\n *\n * @return\n * The formatted number string.\n */\nexport function formatNumber(value: number, options?: NumberFormatterOptions, locale?: string): string;\nexport function formatNumber(value: number, locale?: string): string;\nexport function formatNumber(\n\tvalue: number,\n\toptionsOrLocale?: NumberFormatterOptions | string,\n\tlocale?: string\n): string {\n\treturn globalizeDelegator('formatNumber', {\n\t\tlocale,\n\t\toptionsOrLocale,\n\t\tvalue\n\t});\n}\n\n/**\n * Return a function that formats a number as the specified currency, according to the specified configuration\n * and or locale.\n *\n * @param currency\n * The currency to which the number should be converted.\n *\n * @param options\n * An optional configuration of settings that determine how the currency string will be formatted.\n *\n * @param locale\n * An optional locale. Defaults to the root locale.\n *\n * @return\n * A function that accepts a number and returns a formatted currency string.\n */\nexport function getCurrencyFormatter(\n\tcurrency: string,\n\toptions?: CurrencyFormatterOptions,\n\tlocale?: string\n): NumberFormatter;\nexport function getCurrencyFormatter(currency: string, locale?: string): NumberFormatter;\nexport function getCurrencyFormatter(\n\tcurrency: string,\n\toptionsOrLocale?: CurrencyFormatterOptions | string,\n\tlocale?: string\n): NumberFormatter {\n\treturn globalizeDelegator('currencyFormatter', {\n\t\tlocale,\n\t\toptionsOrLocale,\n\t\tunit: currency\n\t});\n}\n\n/**\n * Return a function that formats a number according to the specified configuration and or locale.\n *\n * @param options\n * An optional configuration of settings that determine how the number string will be formatted.\n *\n * @param locale\n * An optional locale. Defaults to the root locale.\n *\n * @return\n * A function that accepts a number and returns a formatted string.\n */\nexport function getNumberFormatter(options?: NumberFormatterOptions, locale?: string): NumberFormatter;\nexport function getNumberFormatter(locale?: string): NumberFormatter;\nexport function getNumberFormatter(\n\toptionsOrLocale?: NumberFormatterOptions | string,\n\tlocale?: string\n): NumberFormatter {\n\treturn globalizeDelegator('numberFormatter', {\n\t\tlocale,\n\t\toptionsOrLocale\n\t});\n}\n\n/**\n * Parse a number from a string based on the provided configuration and or locale.\n *\n * @param options\n * An optional config that describes the format of the string.\n *\n * @param locale\n * An optional locale. Defaults to the root locale.\n *\n * @return\n * The parsed number.\n */\nexport function getNumberParser(options?: NumberFormatterOptions, locale?: string): NumberParser;\nexport function getNumberParser(locale?: string): NumberParser;\nexport function getNumberParser(optionsOrLocale?: NumberFormatterOptions | string, locale?: string): NumberParser {\n\treturn globalizeDelegator('numberParser', {\n\t\tlocale,\n\t\toptionsOrLocale\n\t});\n}\n\n/**\n * Return a function that accepts a number and returns that number's plural group.\n *\n * @param options\n * An optional configuration that determines whether the numerical value should be treated as a cardinal\n * or ordinal number.\n *\n * @param locale\n * An optional locale. Defaults to the root locale.\n *\n * @return\n * A function that accepts a number and returns the corresponding plural group.\n */\nexport function getPluralGenerator(options?: PluralGeneratorOptions, locale?: string): NumberFormatter;\nexport function getPluralGenerator(locale?: string): NumberFormatter;\nexport function getPluralGenerator(\n\toptionsOrLocale?: PluralGeneratorOptions | string,\n\tlocale?: string\n): NumberFormatter {\n\treturn globalizeDelegator('pluralGenerator', {\n\t\tlocale,\n\t\toptionsOrLocale\n\t});\n}\n\n/**\n * Return a function that parses a number from a string based on the provided configuration and or locale.\n *\n * @param value\n * The string to parse.\n *\n * @param options\n * An optional config that describes the format of the string.\n *\n * @param locale\n * An optional locale. Defaults to the root locale.\n *\n * @return\n * A function that accepts a string and returns a number.\n */\nexport function parseNumber(value: string, options?: NumberFormatterOptions, locale?: string): number;\nexport function parseNumber(value: string, locale?: string): number;\nexport function parseNumber(value: string, optionsOrLocale?: NumberFormatterOptions | string, locale?: string): number {\n\treturn globalizeDelegator('parseNumber', {\n\t\tlocale,\n\t\toptionsOrLocale,\n\t\tvalue\n\t});\n}\n\n/**\n * Return the plural group from a number.\n *\n * @param value\n * The number.\n *\n * @param options\n * An optional configuration that determines whether the numerical value should be treated as a cardinal\n * or ordinal number.\n *\n * @param locale\n * An optional locale. Defaults to the root locale.\n *\n * @return\n * The plural group.\n */\nexport function pluralize(value: number, options?: PluralGeneratorOptions, locale?: string): string;\nexport function pluralize(value: number, locale?: string): string;\nexport function pluralize(value: number, optionsOrLocale?: PluralGeneratorOptions | string, locale?: string): string {\n\treturn globalizeDelegator('plural', {\n\t\tlocale,\n\t\toptionsOrLocale,\n\t\tvalue\n\t});\n}\n"]} \ No newline at end of file diff --git a/deps/framework/i18n/number.mjs b/deps/framework/i18n/number.mjs deleted file mode 100644 index e7354e53e5..0000000000 --- a/deps/framework/i18n/number.mjs +++ /dev/null @@ -1,60 +0,0 @@ -import 'globalize/dist/globalize'; -import 'globalize/dist/globalize/number'; -import 'globalize/dist/globalize/plural'; -import 'globalize/dist/globalize/currency'; -import { globalizeDelegator } from './util/globalize'; -export function formatCurrency(value, currency, optionsOrLocale, locale) { - return globalizeDelegator('formatCurrency', { - locale, - optionsOrLocale, - unit: currency, - value - }); -} -export function formatNumber(value, optionsOrLocale, locale) { - return globalizeDelegator('formatNumber', { - locale, - optionsOrLocale, - value - }); -} -export function getCurrencyFormatter(currency, optionsOrLocale, locale) { - return globalizeDelegator('currencyFormatter', { - locale, - optionsOrLocale, - unit: currency - }); -} -export function getNumberFormatter(optionsOrLocale, locale) { - return globalizeDelegator('numberFormatter', { - locale, - optionsOrLocale - }); -} -export function getNumberParser(optionsOrLocale, locale) { - return globalizeDelegator('numberParser', { - locale, - optionsOrLocale - }); -} -export function getPluralGenerator(optionsOrLocale, locale) { - return globalizeDelegator('pluralGenerator', { - locale, - optionsOrLocale - }); -} -export function parseNumber(value, optionsOrLocale, locale) { - return globalizeDelegator('parseNumber', { - locale, - optionsOrLocale, - value - }); -} -export function pluralize(value, optionsOrLocale, locale) { - return globalizeDelegator('plural', { - locale, - optionsOrLocale, - value - }); -} -//# sourceMappingURL=number.mjs.map \ No newline at end of file diff --git a/deps/framework/i18n/number.mjs.map b/deps/framework/i18n/number.mjs.map deleted file mode 100644 index 90446eedd0..0000000000 --- a/deps/framework/i18n/number.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"number.mjs","sourceRoot":"","sources":["number.ts"],"names":[],"mappings":"AAAA,OAAO,0BAA0B,CAAC;AAClC,OAAO,iCAAiC,CAAC;AACzC,OAAO,iCAAiC,CAAC;AACzC,OAAO,mCAAmC,CAAC;AAC3C,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AA+HtD,MAAM,yBACL,KAAa,EACb,QAAgB,EAChB,eAAmD,EACnD,MAAe;IAEf,MAAM,CAAC,kBAAkB,CAA2C,gBAAgB,EAAE;QACrF,MAAM;QACN,eAAe;QACf,IAAI,EAAE,QAAQ;QACd,KAAK;KACL,CAAC,CAAC;AACJ,CAAC;AAmBD,MAAM,uBACL,KAAa,EACb,eAAiD,EACjD,MAAe;IAEf,MAAM,CAAC,kBAAkB,CAAyC,cAAc,EAAE;QACjF,MAAM;QACN,eAAe;QACf,KAAK;KACL,CAAC,CAAC;AACJ,CAAC;AAwBD,MAAM,+BACL,QAAgB,EAChB,eAAmD,EACnD,MAAe;IAEf,MAAM,CAAC,kBAAkB,CAAoD,mBAAmB,EAAE;QACjG,MAAM;QACN,eAAe;QACf,IAAI,EAAE,QAAQ;KACd,CAAC,CAAC;AACJ,CAAC;AAgBD,MAAM,6BACL,eAAiD,EACjD,MAAe;IAEf,MAAM,CAAC,kBAAkB,CAA0C,iBAAiB,EAAE;QACrF,MAAM;QACN,eAAe;KACf,CAAC,CAAC;AACJ,CAAC;AAgBD,MAAM,0BAA0B,eAAiD,EAAE,MAAe;IACjG,MAAM,CAAC,kBAAkB,CAAuC,cAAc,EAAE;QAC/E,MAAM;QACN,eAAe;KACf,CAAC,CAAC;AACJ,CAAC;AAiBD,MAAM,6BACL,eAAiD,EACjD,MAAe;IAEf,MAAM,CAAC,kBAAkB,CAA0C,iBAAiB,EAAE;QACrF,MAAM;QACN,eAAe;KACf,CAAC,CAAC;AACJ,CAAC;AAmBD,MAAM,sBAAsB,KAAa,EAAE,eAAiD,EAAE,MAAe;IAC5G,MAAM,CAAC,kBAAkB,CAAyC,aAAa,EAAE;QAChF,MAAM;QACN,eAAe;QACf,KAAK;KACL,CAAC,CAAC;AACJ,CAAC;AAoBD,MAAM,oBAAoB,KAAa,EAAE,eAAiD,EAAE,MAAe;IAC1G,MAAM,CAAC,kBAAkB,CAAyC,QAAQ,EAAE;QAC3E,MAAM;QACN,eAAe;QACf,KAAK;KACL,CAAC,CAAC;AACJ,CAAC","sourcesContent":["import 'globalize/dist/globalize';\nimport 'globalize/dist/globalize/number';\nimport 'globalize/dist/globalize/plural';\nimport 'globalize/dist/globalize/currency';\nimport { globalizeDelegator } from './util/globalize';\n\nexport type CurrencyStyleOption = 'accounting' | 'code' | 'name' | 'symbol';\nexport type NumberStyleOption = 'decimal' | 'percent';\nexport type PluralGroup = 'zero' | 'one' | 'two' | 'few' | 'many' | 'other';\nexport type PluralTypeOption = 'cardinal' | 'ordinal';\nexport type RoundNumberOption = 'ceil' | 'floor' | 'round' | 'truncate';\n\nexport interface CommonNumberFormatterOptions {\n\t/**\n\t * Non-negative integer Number value indicating the minimum integer digits to be used. Numbers will be padded with\n\t * leading zeroes if necessary.\n\t */\n\tminimumIntegerDigits?: number;\n\n\t/**\n\t * Non-negative integer Number values indicating the minimum and maximum fraction digits to be used.\n\t * Numbers will be rounded or padded with trailing zeroes if necessary.\n\t * Either one or both of these properties must be present.\n\t * If they are, they will override minimum and maximum fraction digits derived from the CLDR patterns.\n\t */\n\tminimumFractionDigits?: number;\n\n\t/**\n\t * Non-negative integer Number values indicating the minimum and maximum fraction digits to be used.\n\t * Numbers will be rounded or padded with trailing zeroes if necessary.\n\t * Either one or both of these properties must be present.\n\t * If they are, they will override minimum and maximum fraction digits derived from the CLDR patterns.\n\t */\n\tmaximumFractionDigits?: number;\n\n\t/**\n\t * Positive integer Number values indicating the minimum and maximum fraction digits to be shown.\n\t * Either none or both of these properties are present\n\t * If they are, they override minimum and maximum integer and fraction digits.\n\t * The formatter uses however many integer and fraction digits are required to display the specified number of\n\t * significant digits.\n\t */\n\tminimumSignificantDigits?: number;\n\n\t/**\n\t * Positive integer Number values indicating the minimum and maximum fraction digits to be shown.\n\t * Either none or both of these properties are present.\n\t * If they are, they override minimum and maximum integer and fraction digits.\n\t * The formatter uses however many integer and fraction digits are required to display the specified number of\n\t * significant digits.\n\t */\n\tmaximumSignificantDigits?: number;\n\n\t/**\n\t * String with rounding method ceil, floor, round (default), or truncate.\n\t */\n\tround?: RoundNumberOption;\n\n\t/**\n\t * Boolean (default is true) value indicating whether a grouping separator should be used.\n\t */\n\tuseGrouping?: boolean;\n}\n\nexport type CurrencyFormatterOptions = CommonNumberFormatterOptions & {\n\t/**\n\t * symbol (default), accounting, code or name.\n\t */\n\tstyle?: CurrencyStyleOption;\n};\n\nexport interface NumberFormatter {\n\t/**\n\t * Any function that formats a number as string.\n\t */\n\t(value: number): string;\n}\n\nexport type NumberFormatterOptions = CommonNumberFormatterOptions & {\n\t/**\n\t * decimal (default), or percent\n\t */\n\tstyle?: NumberStyleOption;\n};\n\nexport interface NumberParser {\n\t/**\n\t * Any function that parses a number value from a string.\n\t */\n\t(value: string): number;\n}\n\nexport type NumberParserOptions = {\n\t/**\n\t * decimal (default), or percent.\n\t */\n\tstyle?: NumberStyleOption;\n};\n\nexport type PluralGeneratorOptions = {\n\t/**\n\t * cardinal (default), or ordinal.\n\t */\n\ttype?: PluralTypeOption;\n};\n\n/**\n * Format a number as the specified currency, according to the specified configuration and or locale.\n *\n * @param value\n * The number to format.\n *\n * @param currency\n * The currency to which the number should be converted.\n *\n * @param options\n * An optional configuration of settings that determine how the currency string will be formatted.\n *\n * @param locale\n * An optional locale. Defaults to the root locale.\n *\n * @return\n * The formatted currency string.\n */\nexport function formatCurrency(\n\tvalue: number,\n\tcurrency: string,\n\toptions?: CurrencyFormatterOptions,\n\tlocale?: string\n): string;\nexport function formatCurrency(value: number, currency: string, locale?: string): string;\nexport function formatCurrency(\n\tvalue: number,\n\tcurrency: string,\n\toptionsOrLocale?: CurrencyFormatterOptions | string,\n\tlocale?: string\n): string {\n\treturn globalizeDelegator('formatCurrency', {\n\t\tlocale,\n\t\toptionsOrLocale,\n\t\tunit: currency,\n\t\tvalue\n\t});\n}\n\n/**\n * Format a number according to the specified configuration and or locale.\n *\n * @param value\n * The number to format.\n *\n * @param options\n * An optional configuration of settings that determine how the number string will be formatted.\n *\n * @param locale\n * An optional locale. Defaults to the root locale.\n *\n * @return\n * The formatted number string.\n */\nexport function formatNumber(value: number, options?: NumberFormatterOptions, locale?: string): string;\nexport function formatNumber(value: number, locale?: string): string;\nexport function formatNumber(\n\tvalue: number,\n\toptionsOrLocale?: NumberFormatterOptions | string,\n\tlocale?: string\n): string {\n\treturn globalizeDelegator('formatNumber', {\n\t\tlocale,\n\t\toptionsOrLocale,\n\t\tvalue\n\t});\n}\n\n/**\n * Return a function that formats a number as the specified currency, according to the specified configuration\n * and or locale.\n *\n * @param currency\n * The currency to which the number should be converted.\n *\n * @param options\n * An optional configuration of settings that determine how the currency string will be formatted.\n *\n * @param locale\n * An optional locale. Defaults to the root locale.\n *\n * @return\n * A function that accepts a number and returns a formatted currency string.\n */\nexport function getCurrencyFormatter(\n\tcurrency: string,\n\toptions?: CurrencyFormatterOptions,\n\tlocale?: string\n): NumberFormatter;\nexport function getCurrencyFormatter(currency: string, locale?: string): NumberFormatter;\nexport function getCurrencyFormatter(\n\tcurrency: string,\n\toptionsOrLocale?: CurrencyFormatterOptions | string,\n\tlocale?: string\n): NumberFormatter {\n\treturn globalizeDelegator('currencyFormatter', {\n\t\tlocale,\n\t\toptionsOrLocale,\n\t\tunit: currency\n\t});\n}\n\n/**\n * Return a function that formats a number according to the specified configuration and or locale.\n *\n * @param options\n * An optional configuration of settings that determine how the number string will be formatted.\n *\n * @param locale\n * An optional locale. Defaults to the root locale.\n *\n * @return\n * A function that accepts a number and returns a formatted string.\n */\nexport function getNumberFormatter(options?: NumberFormatterOptions, locale?: string): NumberFormatter;\nexport function getNumberFormatter(locale?: string): NumberFormatter;\nexport function getNumberFormatter(\n\toptionsOrLocale?: NumberFormatterOptions | string,\n\tlocale?: string\n): NumberFormatter {\n\treturn globalizeDelegator('numberFormatter', {\n\t\tlocale,\n\t\toptionsOrLocale\n\t});\n}\n\n/**\n * Parse a number from a string based on the provided configuration and or locale.\n *\n * @param options\n * An optional config that describes the format of the string.\n *\n * @param locale\n * An optional locale. Defaults to the root locale.\n *\n * @return\n * The parsed number.\n */\nexport function getNumberParser(options?: NumberFormatterOptions, locale?: string): NumberParser;\nexport function getNumberParser(locale?: string): NumberParser;\nexport function getNumberParser(optionsOrLocale?: NumberFormatterOptions | string, locale?: string): NumberParser {\n\treturn globalizeDelegator('numberParser', {\n\t\tlocale,\n\t\toptionsOrLocale\n\t});\n}\n\n/**\n * Return a function that accepts a number and returns that number's plural group.\n *\n * @param options\n * An optional configuration that determines whether the numerical value should be treated as a cardinal\n * or ordinal number.\n *\n * @param locale\n * An optional locale. Defaults to the root locale.\n *\n * @return\n * A function that accepts a number and returns the corresponding plural group.\n */\nexport function getPluralGenerator(options?: PluralGeneratorOptions, locale?: string): NumberFormatter;\nexport function getPluralGenerator(locale?: string): NumberFormatter;\nexport function getPluralGenerator(\n\toptionsOrLocale?: PluralGeneratorOptions | string,\n\tlocale?: string\n): NumberFormatter {\n\treturn globalizeDelegator('pluralGenerator', {\n\t\tlocale,\n\t\toptionsOrLocale\n\t});\n}\n\n/**\n * Return a function that parses a number from a string based on the provided configuration and or locale.\n *\n * @param value\n * The string to parse.\n *\n * @param options\n * An optional config that describes the format of the string.\n *\n * @param locale\n * An optional locale. Defaults to the root locale.\n *\n * @return\n * A function that accepts a string and returns a number.\n */\nexport function parseNumber(value: string, options?: NumberFormatterOptions, locale?: string): number;\nexport function parseNumber(value: string, locale?: string): number;\nexport function parseNumber(value: string, optionsOrLocale?: NumberFormatterOptions | string, locale?: string): number {\n\treturn globalizeDelegator('parseNumber', {\n\t\tlocale,\n\t\toptionsOrLocale,\n\t\tvalue\n\t});\n}\n\n/**\n * Return the plural group from a number.\n *\n * @param value\n * The number.\n *\n * @param options\n * An optional configuration that determines whether the numerical value should be treated as a cardinal\n * or ordinal number.\n *\n * @param locale\n * An optional locale. Defaults to the root locale.\n *\n * @return\n * The plural group.\n */\nexport function pluralize(value: number, options?: PluralGeneratorOptions, locale?: string): string;\nexport function pluralize(value: number, locale?: string): string;\nexport function pluralize(value: number, optionsOrLocale?: PluralGeneratorOptions | string, locale?: string): string {\n\treturn globalizeDelegator('plural', {\n\t\tlocale,\n\t\toptionsOrLocale,\n\t\tvalue\n\t});\n}\n"]} \ No newline at end of file diff --git a/deps/framework/i18n/unit.d.ts b/deps/framework/i18n/unit.d.ts deleted file mode 100644 index 4823138aef..0000000000 --- a/deps/framework/i18n/unit.d.ts +++ /dev/null @@ -1,53 +0,0 @@ -import 'globalize/dist/globalize'; -import 'globalize/dist/globalize/number'; -import 'globalize/dist/globalize/plural'; -import 'globalize/dist/globalize/unit'; -import { NumberFormatter } from './number'; -export declare type UnitLength = 'long' | 'narrow' | 'short'; -export declare type UnitFormatterOptions = { - /** - * form: [String] eg. "long", "short" or "narrow". - */ - form?: UnitLength; - /** - * numberFormatter: [Function] a number formatter function. Defaults to Globalize .numberFormatter() for the current locale using the default options. - */ - numberFormatter?: NumberFormatter; -}; -/** - * Return a string formatted for the specified number, unit, and options/locale. - * - * @param value - * The number of units. - * - * @param unit - * The unit, singular (e.g., "day", "meter", "foot"). - * - * @param options - * An optional configuration object that determines how the number and unit are formatted. - * - * @param locale - * The optional locale. Defaults to the root locale. - * - * @return - * The formatted string. - */ -export declare function formatUnit(value: number, unit: string, options?: UnitFormatterOptions, locale?: string): string; -export declare function formatUnit(value: number, unit: string, locale?: string): string; -/** - * Return a function that formats a number according to specified unit and options/locale. - * - * @param unit - * The unit, singular (e.g., "day", "meter", "foot"). - * - * @param options - * An optional configuration object that determines how the number and unit are formatted. - * - * @param locale - * The optional locale. Defaults to the root locale. - * - * @return - * A function that accepts a number and returns a string formatted according to the specified unit and options/locale. - */ -export declare function getUnitFormatter(unit: string, options?: UnitFormatterOptions, locale?: string): NumberFormatter; -export declare function getUnitFormatter(unit: string, locale?: string): NumberFormatter; diff --git a/deps/framework/i18n/unit.js b/deps/framework/i18n/unit.js deleted file mode 100644 index 74e533a913..0000000000 --- a/deps/framework/i18n/unit.js +++ /dev/null @@ -1,35 +0,0 @@ -(function (factory) { - if (typeof module === "object" && typeof module.exports === "object") { - var v = factory(require, exports); - if (v !== undefined) module.exports = v; - } - else if (typeof define === "function" && define.amd) { - define(["require", "exports", "globalize/dist/globalize", "globalize/dist/globalize/number", "globalize/dist/globalize/plural", "globalize/dist/globalize/unit", "./util/globalize"], factory); - } -})(function (require, exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - require("globalize/dist/globalize"); - require("globalize/dist/globalize/number"); - require("globalize/dist/globalize/plural"); - require("globalize/dist/globalize/unit"); - var globalize_1 = require("./util/globalize"); - function formatUnit(value, unit, optionsOrLocale, locale) { - return globalize_1.globalizeDelegator('formatUnit', { - locale: locale, - optionsOrLocale: optionsOrLocale, - unit: unit, - value: value - }); - } - exports.formatUnit = formatUnit; - function getUnitFormatter(unit, optionsOrLocale, locale) { - return globalize_1.globalizeDelegator('unitFormatter', { - locale: locale, - optionsOrLocale: optionsOrLocale, - unit: unit - }); - } - exports.getUnitFormatter = getUnitFormatter; -}); -//# sourceMappingURL=unit.js.map \ No newline at end of file diff --git a/deps/framework/i18n/unit.js.map b/deps/framework/i18n/unit.js.map deleted file mode 100644 index 70d5c79286..0000000000 --- a/deps/framework/i18n/unit.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"unit.js","sourceRoot":"","sources":["unit.ts"],"names":[],"mappings":";;;;;;;;;;;IAAA,oCAAkC;IAClC,2CAAyC;IACzC,2CAAyC;IACzC,yCAAuC;IAEvC,8CAAsD;IAoCtD,oBACC,KAAa,EACb,IAAY,EACZ,eAA+C,EAC/C,MAAe;QAEf,MAAM,CAAC,8BAAkB,CAAuC,YAAY,EAAE;YAC7E,MAAM,QAAA;YACN,eAAe,iBAAA;YACf,IAAI,MAAA;YACJ,KAAK,OAAA;SACL,CAAC,CAAC;IACJ,CAAC;IAZD,gCAYC;IAmBD,0BACC,IAAY,EACZ,eAA+C,EAC/C,MAAe;QAEf,MAAM,CAAC,8BAAkB,CAAgD,eAAe,EAAE;YACzF,MAAM,QAAA;YACN,eAAe,iBAAA;YACf,IAAI,MAAA;SACJ,CAAC,CAAC;IACJ,CAAC;IAVD,4CAUC","sourcesContent":["import 'globalize/dist/globalize';\nimport 'globalize/dist/globalize/number';\nimport 'globalize/dist/globalize/plural';\nimport 'globalize/dist/globalize/unit';\nimport { NumberFormatter } from './number';\nimport { globalizeDelegator } from './util/globalize';\n\nexport type UnitLength = 'long' | 'narrow' | 'short';\n\nexport type UnitFormatterOptions = {\n\t/**\n\t * form: [String] eg. \"long\", \"short\" or \"narrow\".\n\t */\n\tform?: UnitLength;\n\n\t/**\n\t * numberFormatter: [Function] a number formatter function. Defaults to Globalize .numberFormatter() for the current locale using the default options.\n\t */\n\tnumberFormatter?: NumberFormatter;\n};\n\n/**\n * Return a string formatted for the specified number, unit, and options/locale.\n *\n * @param value\n * The number of units.\n *\n * @param unit\n * The unit, singular (e.g., \"day\", \"meter\", \"foot\").\n *\n * @param options\n * An optional configuration object that determines how the number and unit are formatted.\n *\n * @param locale\n * The optional locale. Defaults to the root locale.\n *\n * @return\n * The formatted string.\n */\nexport function formatUnit(value: number, unit: string, options?: UnitFormatterOptions, locale?: string): string;\nexport function formatUnit(value: number, unit: string, locale?: string): string;\nexport function formatUnit(\n\tvalue: number,\n\tunit: string,\n\toptionsOrLocale?: UnitFormatterOptions | string,\n\tlocale?: string\n): string {\n\treturn globalizeDelegator('formatUnit', {\n\t\tlocale,\n\t\toptionsOrLocale,\n\t\tunit,\n\t\tvalue\n\t});\n}\n\n/**\n * Return a function that formats a number according to specified unit and options/locale.\n *\n * @param unit\n * The unit, singular (e.g., \"day\", \"meter\", \"foot\").\n *\n * @param options\n * An optional configuration object that determines how the number and unit are formatted.\n *\n * @param locale\n * The optional locale. Defaults to the root locale.\n *\n * @return\n * A function that accepts a number and returns a string formatted according to the specified unit and options/locale.\n */\nexport function getUnitFormatter(unit: string, options?: UnitFormatterOptions, locale?: string): NumberFormatter;\nexport function getUnitFormatter(unit: string, locale?: string): NumberFormatter;\nexport function getUnitFormatter(\n\tunit: string,\n\toptionsOrLocale?: UnitFormatterOptions | string,\n\tlocale?: string\n): NumberFormatter {\n\treturn globalizeDelegator('unitFormatter', {\n\t\tlocale,\n\t\toptionsOrLocale,\n\t\tunit\n\t});\n}\n"]} \ No newline at end of file diff --git a/deps/framework/i18n/unit.mjs b/deps/framework/i18n/unit.mjs deleted file mode 100644 index 43c131aad2..0000000000 --- a/deps/framework/i18n/unit.mjs +++ /dev/null @@ -1,21 +0,0 @@ -import 'globalize/dist/globalize'; -import 'globalize/dist/globalize/number'; -import 'globalize/dist/globalize/plural'; -import 'globalize/dist/globalize/unit'; -import { globalizeDelegator } from './util/globalize'; -export function formatUnit(value, unit, optionsOrLocale, locale) { - return globalizeDelegator('formatUnit', { - locale, - optionsOrLocale, - unit, - value - }); -} -export function getUnitFormatter(unit, optionsOrLocale, locale) { - return globalizeDelegator('unitFormatter', { - locale, - optionsOrLocale, - unit - }); -} -//# sourceMappingURL=unit.mjs.map \ No newline at end of file diff --git a/deps/framework/i18n/unit.mjs.map b/deps/framework/i18n/unit.mjs.map deleted file mode 100644 index fda30bf525..0000000000 --- a/deps/framework/i18n/unit.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"unit.mjs","sourceRoot":"","sources":["unit.ts"],"names":[],"mappings":"AAAA,OAAO,0BAA0B,CAAC;AAClC,OAAO,iCAAiC,CAAC;AACzC,OAAO,iCAAiC,CAAC;AACzC,OAAO,+BAA+B,CAAC;AAEvC,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAoCtD,MAAM,qBACL,KAAa,EACb,IAAY,EACZ,eAA+C,EAC/C,MAAe;IAEf,MAAM,CAAC,kBAAkB,CAAuC,YAAY,EAAE;QAC7E,MAAM;QACN,eAAe;QACf,IAAI;QACJ,KAAK;KACL,CAAC,CAAC;AACJ,CAAC;AAmBD,MAAM,2BACL,IAAY,EACZ,eAA+C,EAC/C,MAAe;IAEf,MAAM,CAAC,kBAAkB,CAAgD,eAAe,EAAE;QACzF,MAAM;QACN,eAAe;QACf,IAAI;KACJ,CAAC,CAAC;AACJ,CAAC","sourcesContent":["import 'globalize/dist/globalize';\nimport 'globalize/dist/globalize/number';\nimport 'globalize/dist/globalize/plural';\nimport 'globalize/dist/globalize/unit';\nimport { NumberFormatter } from './number';\nimport { globalizeDelegator } from './util/globalize';\n\nexport type UnitLength = 'long' | 'narrow' | 'short';\n\nexport type UnitFormatterOptions = {\n\t/**\n\t * form: [String] eg. \"long\", \"short\" or \"narrow\".\n\t */\n\tform?: UnitLength;\n\n\t/**\n\t * numberFormatter: [Function] a number formatter function. Defaults to Globalize .numberFormatter() for the current locale using the default options.\n\t */\n\tnumberFormatter?: NumberFormatter;\n};\n\n/**\n * Return a string formatted for the specified number, unit, and options/locale.\n *\n * @param value\n * The number of units.\n *\n * @param unit\n * The unit, singular (e.g., \"day\", \"meter\", \"foot\").\n *\n * @param options\n * An optional configuration object that determines how the number and unit are formatted.\n *\n * @param locale\n * The optional locale. Defaults to the root locale.\n *\n * @return\n * The formatted string.\n */\nexport function formatUnit(value: number, unit: string, options?: UnitFormatterOptions, locale?: string): string;\nexport function formatUnit(value: number, unit: string, locale?: string): string;\nexport function formatUnit(\n\tvalue: number,\n\tunit: string,\n\toptionsOrLocale?: UnitFormatterOptions | string,\n\tlocale?: string\n): string {\n\treturn globalizeDelegator('formatUnit', {\n\t\tlocale,\n\t\toptionsOrLocale,\n\t\tunit,\n\t\tvalue\n\t});\n}\n\n/**\n * Return a function that formats a number according to specified unit and options/locale.\n *\n * @param unit\n * The unit, singular (e.g., \"day\", \"meter\", \"foot\").\n *\n * @param options\n * An optional configuration object that determines how the number and unit are formatted.\n *\n * @param locale\n * The optional locale. Defaults to the root locale.\n *\n * @return\n * A function that accepts a number and returns a string formatted according to the specified unit and options/locale.\n */\nexport function getUnitFormatter(unit: string, options?: UnitFormatterOptions, locale?: string): NumberFormatter;\nexport function getUnitFormatter(unit: string, locale?: string): NumberFormatter;\nexport function getUnitFormatter(\n\tunit: string,\n\toptionsOrLocale?: UnitFormatterOptions | string,\n\tlocale?: string\n): NumberFormatter {\n\treturn globalizeDelegator('unitFormatter', {\n\t\tlocale,\n\t\toptionsOrLocale,\n\t\tunit\n\t});\n}\n"]} \ No newline at end of file diff --git a/deps/framework/i18n/util/globalize.d.ts b/deps/framework/i18n/util/globalize.d.ts deleted file mode 100644 index a1ae283998..0000000000 --- a/deps/framework/i18n/util/globalize.d.ts +++ /dev/null @@ -1,35 +0,0 @@ -import 'globalize/dist/globalize'; -import * as GlobalizeType from 'globalize'; -export interface DelegatorOptions { - locale?: string; - optionsOrLocale?: O | string; -} -export interface FormatterDelegatorOptions extends DelegatorOptions { - unit?: string; - value?: T; -} -/** - * Return a Globalize.js object for the specified locale. If no locale is provided, then the root - * locale is assumed. - * - * @param string - * An optional locale for the Globalize.js object. - * - * @return - * The localized Globalize.js object. - */ -export default function getGlobalize(locale?: string): GlobalizeType.Static; -/** - * Call the specified Globalize.js method with the specified value, unit, and options, for the specified locale. - * - * @param method - * The name of the static method on the `Globalize` object (required). - * - * @param args - * An object containing any locale, options, value, or unit required by the underlying Globalize.js method. - * - * @return - * The value returned by the underlying Globalize.js method. - */ -export declare function globalizeDelegator(method: string, args: DelegatorOptions): R; -export declare function globalizeDelegator(method: string, args: FormatterDelegatorOptions): R; diff --git a/deps/framework/i18n/util/globalize.js b/deps/framework/i18n/util/globalize.js deleted file mode 100644 index b39ca63fec..0000000000 --- a/deps/framework/i18n/util/globalize.js +++ /dev/null @@ -1,64 +0,0 @@ -(function (factory) { - if (typeof module === "object" && typeof module.exports === "object") { - var v = factory(require, exports); - if (v !== undefined) module.exports = v; - } - else if (typeof define === "function" && define.amd) { - define(["require", "exports", "globalize/dist/globalize", "../i18n"], factory); - } -})(function (require, exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - require("globalize/dist/globalize"); - var i18n_1 = require("../i18n"); - // TODO: use normal imports after landing https://github.com/DefinitelyTyped/DefinitelyTyped/pull/27271 - var Globalize = require('globalize/dist/globalize'); - /** - * @private - * Normalize an array of formatter arguments into a discrete object with `locale`, `options`, `value` and - * `unit` properties for use with the various Globalize.js formatter methods. - * - * @param args - * An object with an optional locale, options, value, and/or unit. - * - * @return - * The normalized object map. - */ - function normalizeFormatterArguments(args) { - var _a = args, locale = _a.locale, optionsOrLocale = _a.optionsOrLocale, unit = _a.unit, value = _a.value; - var options = optionsOrLocale; - if (typeof optionsOrLocale === 'string') { - locale = optionsOrLocale; - options = undefined; - } - return { locale: locale, options: options, unit: unit, value: value }; - } - /** - * Return a Globalize.js object for the specified locale. If no locale is provided, then the root - * locale is assumed. - * - * @param string - * An optional locale for the Globalize.js object. - * - * @return - * The localized Globalize.js object. - */ - function getGlobalize(locale) { - return locale && locale !== i18n_1.default.locale ? new Globalize(locale) : Globalize; - } - exports.default = getGlobalize; - function globalizeDelegator(method, args) { - var _a = normalizeFormatterArguments(args), locale = _a.locale, options = _a.options, value = _a.value, unit = _a.unit; - var methodArgs = typeof value !== 'undefined' ? [value] : []; - if (typeof unit !== 'undefined') { - methodArgs.push(unit); - } - if (typeof options !== 'undefined') { - methodArgs.push(options); - } - var globalize = getGlobalize(locale); - return globalize[method].apply(globalize, methodArgs); - } - exports.globalizeDelegator = globalizeDelegator; -}); -//# sourceMappingURL=globalize.js.map \ No newline at end of file diff --git a/deps/framework/i18n/util/globalize.js.map b/deps/framework/i18n/util/globalize.js.map deleted file mode 100644 index 8a5137d8f0..0000000000 --- a/deps/framework/i18n/util/globalize.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"globalize.js","sourceRoot":"","sources":["globalize.ts"],"names":[],"mappings":";;;;;;;;;;;IAAA,oCAAkC;IAElC,gCAA2B;IAE3B,uGAAuG;IACvG,IAAM,SAAS,GAAyB,OAAO,CAAC,0BAA0B,CAAC,CAAC;IAE5E;;;;;;;;;;OAUG;IACH,qCAA2C,IAA2D;QACjG,IAAA,SAAkF,EAAhF,kBAAM,EAAE,oCAAe,EAAE,cAAI,EAAE,gBAAK,CAA6C;QACvF,IAAI,OAAO,GAAG,eAAe,CAAC;QAE9B,EAAE,CAAC,CAAC,OAAO,eAAe,KAAK,QAAQ,CAAC,CAAC,CAAC;YACzC,MAAM,GAAG,eAAe,CAAC;YACzB,OAAO,GAAG,SAAS,CAAC;QACrB,CAAC;QAED,MAAM,CAAC,EAAE,MAAM,QAAA,EAAE,OAAO,SAAA,EAAE,IAAI,MAAA,EAAE,KAAK,OAAA,EAAE,CAAC;IACzC,CAAC;IAYD;;;;;;;;;OASG;IACH,sBAAqC,MAAe;QACnD,MAAM,CAAC,MAAM,IAAI,MAAM,KAAK,cAAI,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;IAC7E,CAAC;IAFD,+BAEC;IAgBD,4BACC,MAAc,EACd,IAA2D;QAErD,IAAA,sCAA0E,EAAxE,kBAAM,EAAE,oBAAO,EAAE,gBAAK,EAAE,cAAI,CAA6C;QACjF,IAAM,UAAU,GAAU,OAAO,KAAK,KAAK,WAAW,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;QAEtE,EAAE,CAAC,CAAC,OAAO,IAAI,KAAK,WAAW,CAAC,CAAC,CAAC;YACjC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACvB,CAAC;QAED,EAAE,CAAC,CAAC,OAAO,OAAO,KAAK,WAAW,CAAC,CAAC,CAAC;YACpC,UAAU,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAC1B,CAAC;QAED,IAAM,SAAS,GAAG,YAAY,CAAC,MAAM,CAAC,CAAC;QACvC,MAAM,CAAO,SAAU,CAAC,MAAM,CAAC,CAAC,KAAK,CAAC,SAAS,EAAE,UAAU,CAAC,CAAC;IAC9D,CAAC;IAjBD,gDAiBC","sourcesContent":["import 'globalize/dist/globalize';\nimport * as GlobalizeType from 'globalize';\nimport i18n from '../i18n';\n\n// TODO: use normal imports after landing https://github.com/DefinitelyTyped/DefinitelyTyped/pull/27271\nconst Globalize: typeof GlobalizeType = require('globalize/dist/globalize');\n\n/**\n * @private\n * Normalize an array of formatter arguments into a discrete object with `locale`, `options`, `value` and\n * `unit` properties for use with the various Globalize.js formatter methods.\n *\n * @param args\n * An object with an optional locale, options, value, and/or unit.\n *\n * @return\n * The normalized object map.\n */\nfunction normalizeFormatterArguments(args: DelegatorOptions | FormatterDelegatorOptions) {\n\tlet { locale, optionsOrLocale, unit, value } = args as FormatterDelegatorOptions;\n\tlet options = optionsOrLocale;\n\n\tif (typeof optionsOrLocale === 'string') {\n\t\tlocale = optionsOrLocale;\n\t\toptions = undefined;\n\t}\n\n\treturn { locale, options, unit, value };\n}\n\nexport interface DelegatorOptions {\n\tlocale?: string;\n\toptionsOrLocale?: O | string;\n}\n\nexport interface FormatterDelegatorOptions extends DelegatorOptions {\n\tunit?: string;\n\tvalue?: T;\n}\n\n/**\n * Return a Globalize.js object for the specified locale. If no locale is provided, then the root\n * locale is assumed.\n *\n * @param string\n * An optional locale for the Globalize.js object.\n *\n * @return\n * The localized Globalize.js object.\n */\nexport default function getGlobalize(locale?: string) {\n\treturn locale && locale !== i18n.locale ? new Globalize(locale) : Globalize;\n}\n\n/**\n * Call the specified Globalize.js method with the specified value, unit, and options, for the specified locale.\n *\n * @param method\n * The name of the static method on the `Globalize` object (required).\n *\n * @param args\n * An object containing any locale, options, value, or unit required by the underlying Globalize.js method.\n *\n * @return\n * The value returned by the underlying Globalize.js method.\n */\nexport function globalizeDelegator(method: string, args: DelegatorOptions): R;\nexport function globalizeDelegator(method: string, args: FormatterDelegatorOptions): R;\nexport function globalizeDelegator(\n\tmethod: string,\n\targs: DelegatorOptions | FormatterDelegatorOptions\n): R {\n\tconst { locale, options, value, unit } = normalizeFormatterArguments(args);\n\tconst methodArgs: any[] = typeof value !== 'undefined' ? [value] : [];\n\n\tif (typeof unit !== 'undefined') {\n\t\tmethodArgs.push(unit);\n\t}\n\n\tif (typeof options !== 'undefined') {\n\t\tmethodArgs.push(options);\n\t}\n\n\tconst globalize = getGlobalize(locale);\n\treturn (globalize)[method].apply(globalize, methodArgs);\n}\n"]} \ No newline at end of file diff --git a/deps/framework/i18n/util/globalize.mjs b/deps/framework/i18n/util/globalize.mjs deleted file mode 100644 index 102b26b276..0000000000 --- a/deps/framework/i18n/util/globalize.mjs +++ /dev/null @@ -1,50 +0,0 @@ -import 'globalize/dist/globalize'; -import i18n from '../i18n'; -// TODO: use normal imports after landing https://github.com/DefinitelyTyped/DefinitelyTyped/pull/27271 -const Globalize = require('globalize/dist/globalize'); -/** - * @private - * Normalize an array of formatter arguments into a discrete object with `locale`, `options`, `value` and - * `unit` properties for use with the various Globalize.js formatter methods. - * - * @param args - * An object with an optional locale, options, value, and/or unit. - * - * @return - * The normalized object map. - */ -function normalizeFormatterArguments(args) { - let { locale, optionsOrLocale, unit, value } = args; - let options = optionsOrLocale; - if (typeof optionsOrLocale === 'string') { - locale = optionsOrLocale; - options = undefined; - } - return { locale, options, unit, value }; -} -/** - * Return a Globalize.js object for the specified locale. If no locale is provided, then the root - * locale is assumed. - * - * @param string - * An optional locale for the Globalize.js object. - * - * @return - * The localized Globalize.js object. - */ -export default function getGlobalize(locale) { - return locale && locale !== i18n.locale ? new Globalize(locale) : Globalize; -} -export function globalizeDelegator(method, args) { - const { locale, options, value, unit } = normalizeFormatterArguments(args); - const methodArgs = typeof value !== 'undefined' ? [value] : []; - if (typeof unit !== 'undefined') { - methodArgs.push(unit); - } - if (typeof options !== 'undefined') { - methodArgs.push(options); - } - const globalize = getGlobalize(locale); - return globalize[method].apply(globalize, methodArgs); -} -//# sourceMappingURL=globalize.mjs.map \ No newline at end of file diff --git a/deps/framework/i18n/util/globalize.mjs.map b/deps/framework/i18n/util/globalize.mjs.map deleted file mode 100644 index eacf8f640c..0000000000 --- a/deps/framework/i18n/util/globalize.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"globalize.mjs","sourceRoot":"","sources":["globalize.ts"],"names":[],"mappings":"AAAA,OAAO,0BAA0B,CAAC;AAElC,OAAO,IAAI,MAAM,SAAS,CAAC;AAE3B,uGAAuG;AACvG,MAAM,SAAS,GAAyB,OAAO,CAAC,0BAA0B,CAAC,CAAC;AAE5E;;;;;;;;;;GAUG;AACH,qCAA2C,IAA2D;IACrG,IAAI,EAAE,MAAM,EAAE,eAAe,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,IAAuC,CAAC;IACvF,IAAI,OAAO,GAAG,eAAe,CAAC;IAE9B,EAAE,CAAC,CAAC,OAAO,eAAe,KAAK,QAAQ,CAAC,CAAC,CAAC;QACzC,MAAM,GAAG,eAAe,CAAC;QACzB,OAAO,GAAG,SAAS,CAAC;IACrB,CAAC;IAED,MAAM,CAAC,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;AACzC,CAAC;AAYD;;;;;;;;;GASG;AACH,MAAM,CAAC,OAAO,uBAAuB,MAAe;IACnD,MAAM,CAAC,MAAM,IAAI,MAAM,KAAK,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;AAC7E,CAAC;AAgBD,MAAM,6BACL,MAAc,EACd,IAA2D;IAE3D,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,GAAG,2BAA2B,CAAO,IAAI,CAAC,CAAC;IACjF,MAAM,UAAU,GAAU,OAAO,KAAK,KAAK,WAAW,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;IAEtE,EAAE,CAAC,CAAC,OAAO,IAAI,KAAK,WAAW,CAAC,CAAC,CAAC;QACjC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACvB,CAAC;IAED,EAAE,CAAC,CAAC,OAAO,OAAO,KAAK,WAAW,CAAC,CAAC,CAAC;QACpC,UAAU,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAC1B,CAAC;IAED,MAAM,SAAS,GAAG,YAAY,CAAC,MAAM,CAAC,CAAC;IACvC,MAAM,CAAO,SAAU,CAAC,MAAM,CAAC,CAAC,KAAK,CAAC,SAAS,EAAE,UAAU,CAAC,CAAC;AAC9D,CAAC","sourcesContent":["import 'globalize/dist/globalize';\nimport * as GlobalizeType from 'globalize';\nimport i18n from '../i18n';\n\n// TODO: use normal imports after landing https://github.com/DefinitelyTyped/DefinitelyTyped/pull/27271\nconst Globalize: typeof GlobalizeType = require('globalize/dist/globalize');\n\n/**\n * @private\n * Normalize an array of formatter arguments into a discrete object with `locale`, `options`, `value` and\n * `unit` properties for use with the various Globalize.js formatter methods.\n *\n * @param args\n * An object with an optional locale, options, value, and/or unit.\n *\n * @return\n * The normalized object map.\n */\nfunction normalizeFormatterArguments(args: DelegatorOptions | FormatterDelegatorOptions) {\n\tlet { locale, optionsOrLocale, unit, value } = args as FormatterDelegatorOptions;\n\tlet options = optionsOrLocale;\n\n\tif (typeof optionsOrLocale === 'string') {\n\t\tlocale = optionsOrLocale;\n\t\toptions = undefined;\n\t}\n\n\treturn { locale, options, unit, value };\n}\n\nexport interface DelegatorOptions {\n\tlocale?: string;\n\toptionsOrLocale?: O | string;\n}\n\nexport interface FormatterDelegatorOptions extends DelegatorOptions {\n\tunit?: string;\n\tvalue?: T;\n}\n\n/**\n * Return a Globalize.js object for the specified locale. If no locale is provided, then the root\n * locale is assumed.\n *\n * @param string\n * An optional locale for the Globalize.js object.\n *\n * @return\n * The localized Globalize.js object.\n */\nexport default function getGlobalize(locale?: string) {\n\treturn locale && locale !== i18n.locale ? new Globalize(locale) : Globalize;\n}\n\n/**\n * Call the specified Globalize.js method with the specified value, unit, and options, for the specified locale.\n *\n * @param method\n * The name of the static method on the `Globalize` object (required).\n *\n * @param args\n * An object containing any locale, options, value, or unit required by the underlying Globalize.js method.\n *\n * @return\n * The value returned by the underlying Globalize.js method.\n */\nexport function globalizeDelegator(method: string, args: DelegatorOptions): R;\nexport function globalizeDelegator(method: string, args: FormatterDelegatorOptions): R;\nexport function globalizeDelegator(\n\tmethod: string,\n\targs: DelegatorOptions | FormatterDelegatorOptions\n): R {\n\tconst { locale, options, value, unit } = normalizeFormatterArguments(args);\n\tconst methodArgs: any[] = typeof value !== 'undefined' ? [value] : [];\n\n\tif (typeof unit !== 'undefined') {\n\t\tmethodArgs.push(unit);\n\t}\n\n\tif (typeof options !== 'undefined') {\n\t\tmethodArgs.push(options);\n\t}\n\n\tconst globalize = getGlobalize(locale);\n\treturn (globalize)[method].apply(globalize, methodArgs);\n}\n"]} \ No newline at end of file diff --git a/deps/framework/i18n/util/main.d.ts b/deps/framework/i18n/util/main.d.ts deleted file mode 100644 index bf14a39c7d..0000000000 --- a/deps/framework/i18n/util/main.d.ts +++ /dev/null @@ -1,36 +0,0 @@ -/** - * Retrieve a list of locales that can provide substitute for the specified locale - * (including itself). - * - * For example, if 'fr-CA' is specified, then `[ 'fr', 'fr-CA' ]` is returned. - * - * @param locale - * The target locale. - * - * @return - * A list of locales that match the target locale. - */ -export declare function generateLocales(locale: string): string[]; -/** - * Normalize a locale so that it can be converted to a bundle path. - * - * @param locale - * The target locale. - * - * @return The normalized locale. - */ -export declare const normalizeLocale: (locale: string) => string; -/** - * Validates that the provided locale at least begins with a ISO 639.1/639.2 comptabile language subtag, - * and that any additional subtags contain only valid characters. - * - * While locales should adhere to the guidelines set forth by RFC 5646 (https://tools.ietf.org/html/rfc5646), - * only the language subtag is strictly enforced. - * - * @param locale - * The locale to validate. - * - * @return - * `true` if the locale is valid; `false` otherwise. - */ -export declare function validateLocale(locale: string): boolean; diff --git a/deps/framework/i18n/util/main.js b/deps/framework/i18n/util/main.js deleted file mode 100644 index 08026008de..0000000000 --- a/deps/framework/i18n/util/main.js +++ /dev/null @@ -1,88 +0,0 @@ -(function (factory) { - if (typeof module === "object" && typeof module.exports === "object") { - var v = factory(require, exports); - if (v !== undefined) module.exports = v; - } - else if (typeof define === "function" && define.amd) { - define(["require", "exports"], factory); - } -})(function (require, exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - // Matches an ISO 639.1/639.2 compatible language, followed by optional subtags. - var VALID_LOCALE_PATTERN = /^[a-z]{2,3}(-[a-z0-9\-\_]+)?$/i; - /** - * Retrieve a list of locales that can provide substitute for the specified locale - * (including itself). - * - * For example, if 'fr-CA' is specified, then `[ 'fr', 'fr-CA' ]` is returned. - * - * @param locale - * The target locale. - * - * @return - * A list of locales that match the target locale. - */ - function generateLocales(locale) { - var normalized = exports.normalizeLocale(locale); - var parts = normalized.split('-'); - var current = parts[0]; - var result = [current]; - for (var i = 0; i < parts.length - 1; i += 1) { - current += '-' + parts[i + 1]; - result.push(current); - } - return result; - } - exports.generateLocales = generateLocales; - /** - * Normalize a locale so that it can be converted to a bundle path. - * - * @param locale - * The target locale. - * - * @return The normalized locale. - */ - exports.normalizeLocale = (function () { - function removeTrailingSeparator(value) { - return value.replace(/(\-|_)$/, ''); - } - function normalize(locale) { - if (locale.indexOf('.') === -1) { - return removeTrailingSeparator(locale); - } - return locale - .split('.') - .slice(0, -1) - .map(function (part) { - return removeTrailingSeparator(part).replace(/_/g, '-'); - }) - .join('-'); - } - return function (locale) { - var normalized = normalize(locale); - if (!validateLocale(normalized)) { - throw new Error(normalized + " is not a valid locale."); - } - return normalized; - }; - })(); - /** - * Validates that the provided locale at least begins with a ISO 639.1/639.2 comptabile language subtag, - * and that any additional subtags contain only valid characters. - * - * While locales should adhere to the guidelines set forth by RFC 5646 (https://tools.ietf.org/html/rfc5646), - * only the language subtag is strictly enforced. - * - * @param locale - * The locale to validate. - * - * @return - * `true` if the locale is valid; `false` otherwise. - */ - function validateLocale(locale) { - return VALID_LOCALE_PATTERN.test(locale); - } - exports.validateLocale = validateLocale; -}); -//# sourceMappingURL=main.js.map \ No newline at end of file diff --git a/deps/framework/i18n/util/main.js.map b/deps/framework/i18n/util/main.js.map deleted file mode 100644 index 9a2c345111..0000000000 --- a/deps/framework/i18n/util/main.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"main.js","sourceRoot":"","sources":["main.ts"],"names":[],"mappings":";;;;;;;;;;;IAAA,gFAAgF;IAChF,IAAM,oBAAoB,GAAG,gCAAgC,CAAC;IAE9D;;;;;;;;;;;OAWG;IACH,yBAAgC,MAAc;QAC7C,IAAM,UAAU,GAAG,uBAAe,CAAC,MAAM,CAAC,CAAC;QAC3C,IAAM,KAAK,GAAG,UAAU,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QACpC,IAAI,OAAO,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;QACvB,IAAM,MAAM,GAAa,CAAC,OAAO,CAAC,CAAC;QAEnC,GAAG,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC;YAC9C,OAAO,IAAI,GAAG,GAAG,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;YAC9B,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACtB,CAA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\n/**\n * Retrieve a list of locales that can provide substitute for the specified locale\n * (including itself).\n *\n * For example, if 'fr-CA' is specified, then `[ 'fr', 'fr-CA' ]` is returned.\n *\n * @param locale\n * The target locale.\n *\n * @return\n * A list of locales that match the target locale.\n */\nexport function generateLocales(locale: string): string[] {\n\tconst normalized = normalizeLocale(locale);\n\tconst parts = normalized.split('-');\n\tlet current = parts[0];\n\tconst result: string[] = [current];\n\n\tfor (let i = 0; i < parts.length - 1; i += 1) {\n\t\tcurrent += '-' + parts[i + 1];\n\t\tresult.push(current);\n\t}\n\n\treturn result;\n}\n\n/**\n * Normalize a locale so that it can be converted to a bundle path.\n *\n * @param locale\n * The target locale.\n *\n * @return The normalized locale.\n */\nexport const normalizeLocale = (function() {\n\tfunction removeTrailingSeparator(value: string): string {\n\t\treturn value.replace(/(\\-|_)$/, '');\n\t}\n\n\tfunction normalize(locale: string): string {\n\t\tif (locale.indexOf('.') === -1) {\n\t\t\treturn removeTrailingSeparator(locale);\n\t\t}\n\n\t\treturn locale\n\t\t\t.split('.')\n\t\t\t.slice(0, -1)\n\t\t\t.map((part: string): string => {\n\t\t\t\treturn removeTrailingSeparator(part).replace(/_/g, '-');\n\t\t\t})\n\t\t\t.join('-');\n\t}\n\n\treturn function(locale: string): string {\n\t\tconst normalized = normalize(locale);\n\n\t\tif (!validateLocale(normalized)) {\n\t\t\tthrow new Error(`${normalized} is not a valid locale.`);\n\t\t}\n\n\t\treturn normalized;\n\t};\n})();\n\n/**\n * Validates that the provided locale at least begins with a ISO 639.1/639.2 comptabile language subtag,\n * and that any additional subtags contain only valid characters.\n *\n * While locales should adhere to the guidelines set forth by RFC 5646 (https://tools.ietf.org/html/rfc5646),\n * only the language subtag is strictly enforced.\n *\n * @param locale\n * The locale to validate.\n *\n * @return\n * `true` if the locale is valid; `false` otherwise.\n */\nexport function validateLocale(locale: string): boolean {\n\treturn VALID_LOCALE_PATTERN.test(locale);\n}\n"]} \ No newline at end of file diff --git a/deps/framework/i18n/util/main.mjs b/deps/framework/i18n/util/main.mjs deleted file mode 100644 index 11154fdee4..0000000000 --- a/deps/framework/i18n/util/main.mjs +++ /dev/null @@ -1,74 +0,0 @@ -// Matches an ISO 639.1/639.2 compatible language, followed by optional subtags. -const VALID_LOCALE_PATTERN = /^[a-z]{2,3}(-[a-z0-9\-\_]+)?$/i; -/** - * Retrieve a list of locales that can provide substitute for the specified locale - * (including itself). - * - * For example, if 'fr-CA' is specified, then `[ 'fr', 'fr-CA' ]` is returned. - * - * @param locale - * The target locale. - * - * @return - * A list of locales that match the target locale. - */ -export function generateLocales(locale) { - const normalized = normalizeLocale(locale); - const parts = normalized.split('-'); - let current = parts[0]; - const result = [current]; - for (let i = 0; i < parts.length - 1; i += 1) { - current += '-' + parts[i + 1]; - result.push(current); - } - return result; -} -/** - * Normalize a locale so that it can be converted to a bundle path. - * - * @param locale - * The target locale. - * - * @return The normalized locale. - */ -export const normalizeLocale = (function () { - function removeTrailingSeparator(value) { - return value.replace(/(\-|_)$/, ''); - } - function normalize(locale) { - if (locale.indexOf('.') === -1) { - return removeTrailingSeparator(locale); - } - return locale - .split('.') - .slice(0, -1) - .map((part) => { - return removeTrailingSeparator(part).replace(/_/g, '-'); - }) - .join('-'); - } - return function (locale) { - const normalized = normalize(locale); - if (!validateLocale(normalized)) { - throw new Error(`${normalized} is not a valid locale.`); - } - return normalized; - }; -})(); -/** - * Validates that the provided locale at least begins with a ISO 639.1/639.2 comptabile language subtag, - * and that any additional subtags contain only valid characters. - * - * While locales should adhere to the guidelines set forth by RFC 5646 (https://tools.ietf.org/html/rfc5646), - * only the language subtag is strictly enforced. - * - * @param locale - * The locale to validate. - * - * @return - * `true` if the locale is valid; `false` otherwise. - */ -export function validateLocale(locale) { - return VALID_LOCALE_PATTERN.test(locale); -} -//# sourceMappingURL=main.mjs.map \ No newline at end of file diff --git a/deps/framework/i18n/util/main.mjs.map b/deps/framework/i18n/util/main.mjs.map deleted file mode 100644 index 2b0ba4ff81..0000000000 --- a/deps/framework/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AM,CAAC,uBAAuB,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;QACzD,CAAC,CAAC;aACD,IAAI,CAAC,GAAG,CAAC,CAAC;IACb,CAAC;IAED,MAAM,CAAC,UAAS,MAAc;QAC7B,MAAM,UAAU,GAAG,SAAS,CAAC,MAAM,CAAC,CAAC;QAErC,EAAE,CAAC,CAAC,CAAC,cAAc,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;YACjC,MAAM,IAAI,KAAK,CAAC,GAAG,UAAU,yBAAyB,CAAC,CAAC;QACzD,CAAC;QAED,MAAM,CAAC,UAAU,CAAC;IACnB,CAAC,CAAC;AACH,CAAC,CAAC,EAAE,CAAC;AAEL;;;;;;;;;;;;GAYG;AACH,MAAM,yBAAyB,MAAc;IAC5C,MAAM,CAAC,oBAAoB,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;AAC1C,CAAC","sourcesContent":["// Matches an ISO 639.1/639.2 compatible language, followed by optional subtags.\nconst VALID_LOCALE_PATTERN = /^[a-z]{2,3}(-[a-z0-9\\-\\_]+)?$/i;\n\n/**\n * Retrieve a list of locales that can provide substitute for the specified locale\n * (including itself).\n *\n * For example, if 'fr-CA' is specified, then `[ 'fr', 'fr-CA' ]` is returned.\n *\n * @param locale\n * The target locale.\n *\n * @return\n * A list of locales that match the target locale.\n */\nexport function generateLocales(locale: string): string[] {\n\tconst normalized = normalizeLocale(locale);\n\tconst parts = normalized.split('-');\n\tlet current = parts[0];\n\tconst result: string[] = [current];\n\n\tfor (let i = 0; i < parts.length - 1; i += 1) {\n\t\tcurrent += '-' + parts[i + 1];\n\t\tresult.push(current);\n\t}\n\n\treturn result;\n}\n\n/**\n * Normalize a locale so that it can be converted to a bundle path.\n *\n * @param locale\n * The target locale.\n *\n * @return The normalized locale.\n */\nexport const normalizeLocale = (function() {\n\tfunction removeTrailingSeparator(value: string): string {\n\t\treturn value.replace(/(\\-|_)$/, '');\n\t}\n\n\tfunction normalize(locale: string): string {\n\t\tif (locale.indexOf('.') === -1) {\n\t\t\treturn removeTrailingSeparator(locale);\n\t\t}\n\n\t\treturn locale\n\t\t\t.split('.')\n\t\t\t.slice(0, -1)\n\t\t\t.map((part: string): string => {\n\t\t\t\treturn removeTrailingSeparator(part).replace(/_/g, '-');\n\t\t\t})\n\t\t\t.join('-');\n\t}\n\n\treturn function(locale: string): string {\n\t\tconst normalized = normalize(locale);\n\n\t\tif (!validateLocale(normalized)) {\n\t\t\tthrow new Error(`${normalized} is not a valid locale.`);\n\t\t}\n\n\t\treturn normalized;\n\t};\n})();\n\n/**\n * Validates that the provided locale at least begins with a ISO 639.1/639.2 comptabile language subtag,\n * and that any additional subtags contain only valid characters.\n *\n * While locales should adhere to the guidelines set forth by RFC 5646 (https://tools.ietf.org/html/rfc5646),\n * only the language subtag is strictly enforced.\n *\n * @param locale\n * The locale to validate.\n *\n * @return\n * `true` if the locale is valid; `false` otherwise.\n */\nexport function validateLocale(locale: string): boolean {\n\treturn VALID_LOCALE_PATTERN.test(locale);\n}\n"]} \ No newline at end of file diff --git a/deps/framework/package.json b/deps/framework/package.json deleted file mode 100644 index ad82b84755..0000000000 --- a/deps/framework/package.json +++ /dev/null @@ -1,76 +0,0 @@ -{ - "name": "@dojo/framework", - "version": "3.0.0-pre", - "description": "The Dojo Framework", - "directories": { - "doc": "docs", - "example": "examples", - "test": "tests" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/dojo/framework.git" - }, - "author": "", - "license": "BSD-3-Clause", - "bugs": { - "url": "https://github.com/dojo/framework/issues" - }, - "homepage": "https://github.com/dojo/framework#readme", - "dependencies": { - "@types/cldrjs": "~0.4.20", - "@types/globalize": "0.0.33", - "@types/web-animations-js": "2.2.5", - "@webcomponents/webcomponentsjs": "1.1.0", - "cldr-data": "~32.0.0", - "css-select-umd": "1.3.0-rc0", - "diff": "3.4.0", - "globalize": "1.3.0", - "intersection-observer": "0.4.2", - "pepjs": "0.4.2", - "tslib": "~1.8.0", - "web-animations-js": "2.3.1" - }, - "devDependencies": { - "@dojo/loader": "^2.0.0", - "@dojo/scripts": "~0.2.0", - "@types/benchmark": "~1.0.0", - "@types/jsdom": "2.0.*", - "@types/multer": "~1.3.3", - "@types/node": "~9.6.5", - "@types/ramda": "0.25.5", - "@types/selenium-webdriver": "^3.0.8", - "@types/sinon": "~4.1.2", - "benchmark": "^1.0.0", - "bootstrap": "^3.3.7", - "codecov": "~3.0.4", - "concurrently": "~3.6.0", - "cpx": "~1.5.0", - "husky": "~0.14.3", - "intern": "~4.2.0", - "jsdom": "^9.5.0", - "lint-staged": "6.0.0", - "multer": "~1.3.0", - "prettier": "1.9.2", - "ramda": "0.25.0", - "rimraf": "~2.6.2", - "selenium-webdriver": "3.6.0", - "sinon": "~4.1.3", - "tslint": "5.8.0", - "typescript": "~2.6.1" - }, - "lint-staged": { - "*.{ts,tsx}": [ - "prettier --write", - "git add" - ] - }, - "prettier": { - "singleQuote": true, - "tabWidth": 4, - "useTabs": true, - "parser": "typescript", - "printWidth": 120, - "arrowParens": "always" - } -} \ No newline at end of file diff --git a/deps/framework/routing/Link.d.ts b/deps/framework/routing/Link.d.ts deleted file mode 100644 index 53408be3ca..0000000000 --- a/deps/framework/routing/Link.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { WidgetBase } from '../widget-core/WidgetBase'; -import { Constructor, DNode } from '../widget-core/interfaces'; -import { LinkProperties } from './interfaces'; -export declare class BaseLink extends WidgetBase { - private _onClick(event); - protected render(): DNode; -} -export declare function createLink(routerKey: string): Constructor; -export declare const Link: Constructor; -export default Link; diff --git a/deps/framework/routing/Link.js b/deps/framework/routing/Link.js deleted file mode 100644 index 90b8641617..0000000000 --- a/deps/framework/routing/Link.js +++ /dev/null @@ -1,60 +0,0 @@ -(function (factory) { - if (typeof module === "object" && typeof module.exports === "object") { - var v = factory(require, exports); - if (v !== undefined) module.exports = v; - } - else if (typeof define === "function" && define.amd) { - define(["require", "exports", "tslib", "../widget-core/WidgetBase", "../widget-core/d", "../widget-core/decorators/inject"], factory); - } -})(function (require, exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - var tslib_1 = require("tslib"); - var WidgetBase_1 = require("../widget-core/WidgetBase"); - var d_1 = require("../widget-core/d"); - var inject_1 = require("../widget-core/decorators/inject"); - var getProperties = function (router, properties) { - var to = properties.to, _a = properties.isOutlet, isOutlet = _a === void 0 ? true : _a, _b = properties.params, params = _b === void 0 ? {} : _b, onClick = properties.onClick, props = tslib_1.__rest(properties, ["to", "isOutlet", "params", "onClick"]); - var href = isOutlet ? router.link(to, params) : to; - var handleOnClick = function (event) { - onClick && onClick(event); - if (!event.defaultPrevented && event.button === 0 && !properties.target) { - event.preventDefault(); - href !== undefined && router.setPath(href); - } - }; - return tslib_1.__assign({ href: href, onClick: handleOnClick }, props); - }; - var BaseLink = /** @class */ (function (_super) { - tslib_1.__extends(BaseLink, _super); - function BaseLink() { - return _super !== null && _super.apply(this, arguments) || this; - } - BaseLink.prototype._onClick = function (event) { - this.properties.onClick && this.properties.onClick(event); - }; - BaseLink.prototype.render = function () { - var props = tslib_1.__assign({}, this.properties, { onclick: this._onClick, onClick: undefined, to: undefined, isOutlet: undefined, params: undefined, routerKey: undefined, router: undefined }); - return d_1.v('a', props, this.children); - }; - return BaseLink; - }(WidgetBase_1.WidgetBase)); - exports.BaseLink = BaseLink; - function createLink(routerKey) { - var Link = /** @class */ (function (_super) { - tslib_1.__extends(Link, _super); - function Link() { - return _super !== null && _super.apply(this, arguments) || this; - } - Link = tslib_1.__decorate([ - inject_1.inject({ name: routerKey, getProperties: getProperties }) - ], Link); - return Link; - }(BaseLink)); - return Link; - } - exports.createLink = createLink; - exports.Link = createLink('router'); - exports.default = exports.Link; -}); -//# sourceMappingURL=Link.js.map \ No newline at end of file diff --git a/deps/framework/routing/Link.js.map b/deps/framework/routing/Link.js.map deleted file mode 100644 index 443b0bd067..0000000000 --- a/deps/framework/routing/Link.js.map +++ /dev/null @@ -1 +0,0 @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AS,EACjB,SAAS,EAAE,SAAS,EACpB,MAAM,EAAE,SAAS,GACjB,CAAC;YACF,MAAM,CAAC,KAAC,CAAC,GAAG,EAAE,KAAK,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC;QACrC,CAAC;QACF,eAAC;IAAD,CAAC,AAlBD,CAA8B,uBAAU,GAkBvC;IAlBY,4BAAQ;IAoBrB,oBAA2B,SAAiB;QAE3C;YAAmB,gCAAQ;YAA3B;;YAA6B,CAAC;YAAxB,IAAI;gBADT,eAAM,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,aAAa,eAAA,EAAE,CAAC;eACrC,IAAI,CAAoB;YAAD,WAAC;SAAA,AAA9B,CAAmB,QAAQ,GAAG;QAC9B,MAAM,CAAC,IAAI,CAAC;IACb,CAAC;IAJD,gCAIC;IAEY,QAAA,IAAI,GAAG,UAAU,CAAC,QAAQ,CAAC,CAAC;IAEzC,kBAAe,YAAI,CAAC","sourcesContent":["import { WidgetBase } from '../widget-core/WidgetBase';\nimport { v } from '../widget-core/d';\nimport { inject } from '../widget-core/decorators/inject';\nimport { Constructor, DNode, VNodeProperties } from '../widget-core/interfaces';\nimport { LinkProperties } from './interfaces';\nimport { Router } from './Router';\n\nconst getProperties = (router: Router, properties: LinkProperties): VNodeProperties => {\n\tconst { to, isOutlet = true, params = {}, onClick, ...props } = properties;\n\tconst href = isOutlet ? router.link(to, params) : to;\n\n\tconst handleOnClick = (event: MouseEvent) => {\n\t\tonClick && onClick(event);\n\n\t\tif (!event.defaultPrevented && event.button === 0 && !properties.target) {\n\t\t\tevent.preventDefault();\n\t\t\thref !== undefined && router.setPath(href);\n\t\t}\n\t};\n\treturn {\n\t\thref,\n\t\tonClick: handleOnClick,\n\t\t...props\n\t};\n};\n\nexport class BaseLink extends WidgetBase {\n\tprivate _onClick(event: MouseEvent): void {\n\t\tthis.properties.onClick && this.properties.onClick(event);\n\t}\n\n\tprotected render(): DNode {\n\t\tconst props = {\n\t\t\t...this.properties,\n\t\t\tonclick: this._onClick,\n\t\t\tonClick: undefined,\n\t\t\tto: undefined,\n\t\t\tisOutlet: undefined,\n\t\t\tparams: undefined,\n\t\t\trouterKey: undefined,\n\t\t\trouter: undefined\n\t\t};\n\t\treturn v('a', props, this.children);\n\t}\n}\n\nexport function createLink(routerKey: string): Constructor {\n\t@inject({ name: routerKey, getProperties })\n\tclass Link extends BaseLink {}\n\treturn Link;\n}\n\nexport const Link = createLink('router');\n\nexport default Link;\n"]} \ No newline at end of file diff --git a/deps/framework/routing/Link.mjs b/deps/framework/routing/Link.mjs deleted file mode 100644 index 3c66199dac..0000000000 --- a/deps/framework/routing/Link.mjs +++ /dev/null @@ -1,36 +0,0 @@ -import * as tslib_1 from "tslib"; -import { WidgetBase } from '../widget-core/WidgetBase'; -import { v } from '../widget-core/d'; -import { inject } from '../widget-core/decorators/inject'; -const getProperties = (router, properties) => { - const { to, isOutlet = true, params = {}, onClick } = properties, props = tslib_1.__rest(properties, ["to", "isOutlet", "params", "onClick"]); - const href = isOutlet ? router.link(to, params) : to; - const handleOnClick = (event) => { - onClick && onClick(event); - if (!event.defaultPrevented && event.button === 0 && !properties.target) { - event.preventDefault(); - href !== undefined && router.setPath(href); - } - }; - return Object.assign({ href, onClick: handleOnClick }, props); -}; -export class BaseLink extends WidgetBase { - _onClick(event) { - this.properties.onClick && this.properties.onClick(event); - } - render() { - const props = Object.assign({}, this.properties, { onclick: this._onClick, onClick: undefined, to: undefined, isOutlet: undefined, params: undefined, routerKey: undefined, router: undefined }); - return v('a', props, this.children); - } -} -export function createLink(routerKey) { - let Link = class Link extends BaseLink { - }; - Link = tslib_1.__decorate([ - inject({ name: routerKey, getProperties }) - ], Link); - return Link; -} -export const Link = createLink('router'); -export default Link; -//# sourceMappingURL=Link.mjs.map \ No newline at end of file diff --git a/deps/framework/routing/Link.mjs.map b/deps/framework/routing/Link.mjs.map deleted file mode 100644 index c653f1f522..0000000000 --- a/deps/framework/routing/Link.mjs.map +++ /dev/null @@ -1 +0,0 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QAAQ,EACtB,OAAO,EAAE,SAAS,EAClB,EAAE,EAAE,SAAS,EACb,QAAQ,EAAE,SAAS,EACnB,MAAM,EAAE,SAAS,EACjB,SAAS,EAAE,SAAS,EACpB,MAAM,EAAE,SAAS,GACjB,CAAC;QACF,MAAM,CAAC,CAAC,CAAC,GAAG,EAAE,KAAK,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC;IACrC,CAAC;CACD;AAED,MAAM,qBAAqB,SAAiB;IAE3C,IAAM,IAAI,GAAV,UAAW,SAAQ,QAAQ;KAAG,CAAA;IAAxB,IAAI;QADT,MAAM,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,aAAa,EAAE,CAAC;OACrC,IAAI,CAAoB;IAC9B,MAAM,CAAC,IAAI,CAAC;AACb,CAAC;AAED,MAAM,CAAC,MAAM,IAAI,GAAG,UAAU,CAAC,QAAQ,CAAC,CAAC;AAEzC,eAAe,IAAI,CAAC","sourcesContent":["import { WidgetBase } from '../widget-core/WidgetBase';\nimport { v } from '../widget-core/d';\nimport { inject } from '../widget-core/decorators/inject';\nimport { Constructor, DNode, VNodeProperties } from '../widget-core/interfaces';\nimport { LinkProperties } from './interfaces';\nimport { Router } from './Router';\n\nconst getProperties = (router: Router, properties: LinkProperties): VNodeProperties => {\n\tconst { to, isOutlet = true, params = {}, onClick, ...props } = properties;\n\tconst href = isOutlet ? router.link(to, params) : to;\n\n\tconst handleOnClick = (event: MouseEvent) => {\n\t\tonClick && onClick(event);\n\n\t\tif (!event.defaultPrevented && event.button === 0 && !properties.target) {\n\t\t\tevent.preventDefault();\n\t\t\thref !== undefined && router.setPath(href);\n\t\t}\n\t};\n\treturn {\n\t\thref,\n\t\tonClick: handleOnClick,\n\t\t...props\n\t};\n};\n\nexport class BaseLink extends WidgetBase {\n\tprivate _onClick(event: MouseEvent): void {\n\t\tthis.properties.onClick && this.properties.onClick(event);\n\t}\n\n\tprotected render(): DNode {\n\t\tconst props = {\n\t\t\t...this.properties,\n\t\t\tonclick: this._onClick,\n\t\t\tonClick: undefined,\n\t\t\tto: undefined,\n\t\t\tisOutlet: undefined,\n\t\t\tparams: undefined,\n\t\t\trouterKey: undefined,\n\t\t\trouter: undefined\n\t\t};\n\t\treturn v('a', props, this.children);\n\t}\n}\n\nexport function createLink(routerKey: string): Constructor {\n\t@inject({ name: routerKey, getProperties })\n\tclass Link extends BaseLink {}\n\treturn Link;\n}\n\nexport const Link = createLink('router');\n\nexport default Link;\n"]} \ No newline at end of file diff --git a/deps/framework/routing/Outlet.d.ts b/deps/framework/routing/Outlet.d.ts deleted file mode 100644 index af5af1507d..0000000000 --- a/deps/framework/routing/Outlet.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { WidgetBaseInterface } from '../widget-core/interfaces'; -import { Component, OutletOptions, OutletComponents, Outlet } from './interfaces'; -import { Router } from './Router'; -export declare function isComponent(value: any): value is Component; -export declare function getProperties(router: Router, properties: any): { - router: Router; -}; -export declare function Outlet(outletComponents: Component | OutletComponents, outlet: string, options?: OutletOptions): Outlet; -export default Outlet; diff --git a/deps/framework/routing/Outlet.js b/deps/framework/routing/Outlet.js deleted file mode 100644 index f1ecb00aca..0000000000 --- a/deps/framework/routing/Outlet.js +++ /dev/null @@ -1,108 +0,0 @@ -(function (factory) { - if (typeof module === "object" && typeof module.exports === "object") { - var v = factory(require, exports); - if (v !== undefined) module.exports = v; - } - else if (typeof define === "function" && define.amd) { - define(["require", "exports", "tslib", "../widget-core/WidgetBase", "../widget-core/d", "../widget-core/decorators/inject", "../widget-core/decorators/alwaysRender"], factory); - } -})(function (require, exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - var tslib_1 = require("tslib"); - var WidgetBase_1 = require("../widget-core/WidgetBase"); - var d_1 = require("../widget-core/d"); - var inject_1 = require("../widget-core/decorators/inject"); - var alwaysRender_1 = require("../widget-core/decorators/alwaysRender"); - function isComponent(value) { - return Boolean(value && (typeof value === 'string' || typeof value === 'function' || typeof value === 'symbol')); - } - exports.isComponent = isComponent; - function getProperties(router, properties) { - return { router: router }; - } - exports.getProperties = getProperties; - function Outlet(outletComponents, outlet, options) { - if (options === void 0) { options = {}; } - var indexComponent = isComponent(outletComponents) ? undefined : outletComponents.index; - var mainComponent = isComponent(outletComponents) ? outletComponents : outletComponents.main; - var errorComponent = isComponent(outletComponents) ? undefined : outletComponents.error; - var mapParams = options.mapParams, _a = options.key, key = _a === void 0 ? 'router' : _a; - var OutletComponent = /** @class */ (function (_super) { - tslib_1.__extends(OutletComponent, _super); - function OutletComponent() { - var _this = _super !== null && _super.apply(this, arguments) || this; - _this._matched = false; - _this._matchedParams = {}; - return _this; - } - OutletComponent.prototype._hasRouteChanged = function (params) { - if (!this._matched) { - return true; - } - var newParamKeys = Object.keys(params); - for (var i = 0; i < newParamKeys.length; i++) { - var key_1 = newParamKeys[i]; - if (this._matchedParams[key_1] !== params[key_1]) { - return true; - } - } - return false; - }; - OutletComponent.prototype._onEnter = function (outletContext, onEnterCallback) { - var params = outletContext.params, type = outletContext.type; - if (this._hasRouteChanged(params)) { - onEnterCallback && onEnterCallback(params, type); - this._matched = true; - this._matchedParams = params; - } - }; - OutletComponent.prototype.onDetach = function () { - if (this._matched) { - this._onExit && this._onExit(); - this._matched = false; - } - }; - OutletComponent.prototype.render = function () { - var _a = this.properties, router = _a.router, properties = tslib_1.__rest(_a, ["router"]); - var outletContext = router.getOutlet(outlet); - if (outletContext) { - var queryParams = outletContext.queryParams, params = outletContext.params, type = outletContext.type, onEnter = outletContext.onEnter, onExit = outletContext.onExit; - this._onExit = onExit; - if (mapParams) { - properties = tslib_1.__assign({}, properties, mapParams({ queryParams: queryParams, params: params, type: type, router: router })); - } - if (type === 'index' && indexComponent) { - this._onEnter(outletContext, onEnter); - return d_1.w(indexComponent, properties, this.children); - } - else if (type === 'error' && errorComponent) { - this._onEnter(outletContext, onEnter); - return d_1.w(errorComponent, properties, this.children); - } - else if (type === 'error' && indexComponent) { - this._onEnter(outletContext, onEnter); - return d_1.w(indexComponent, properties, this.children); - } - else if (type !== 'error' && mainComponent) { - this._onEnter(outletContext, onEnter); - return d_1.w(mainComponent, properties, this.children); - } - } - if (this._matched) { - this._onExit && this._onExit(); - this._matched = false; - } - return null; - }; - OutletComponent = tslib_1.__decorate([ - inject_1.inject({ name: key, getProperties: getProperties }), - alwaysRender_1.alwaysRender() - ], OutletComponent); - return OutletComponent; - }(WidgetBase_1.WidgetBase)); - return OutletComponent; - } - exports.Outlet = Outlet; -}); -//# sourceMappingURL=Outlet.js.map \ No newline at end of file diff --git a/deps/framework/routing/Outlet.js.map b/deps/framework/routing/Outlet.js.map deleted file mode 100644 index a3e224ed27..0000000000 --- a/deps/framework/routing/Outlet.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"Outlet.js","sourceRoot":"","sources":["Outlet.ts"],"names":[],"mappings":";;;;;;;;;;;;IACA,wDAAuD;IACvD,sCAAqC;IACrC,2DAA0D;IAC1D,uEAAsE;IAItE,qBAA2D,KAAU;QACpE,MAAM,CAAC,OAAO,CAAC,KAAK,IAAI,CAAC,OAAO,KAAK,KAAK,QAAQ,IAAI,OAAO,KAAK,KAAK,UAAU,IAAI,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC;IAClH,CAAC;IAFD,kCAEC;IAED,uBAA8B,MAAc,EAAE,UAAe;QAC5D,MAAM,CAAC,EAAE,MAAM,QAAA,EAAE,CAAC;IACnB,CAAC;IAFD,sCAEC;IAED,gBACC,gBAA0D,EAC1D,MAAc,EACd,OAA2B;QAA3B,wBAAA,EAAA,YAA2B;QAE3B,IAAM,cAAc,GAAG,WAAW,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,gBAAgB,CAAC,KAAK,CAAC;QAC1F,IAAM,aAAa,GAAG,WAAW,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC,gBAAgB,CAAC,CAAC,CAAC,gBAAgB,CAAC,IAAI,CAAC;QAC/F,IAAM,cAAc,GAAG,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,CAAC,IAAI,KAAK,OAAO,IAAI,cAAc,CAAC,CAAC,CAAC;wBAC/C,IAAI,CAAC,QAAQ,CAAC,aAAa,EAAE,OAAO,CAAC,CAAC;wBACtC,MAAM,CAAC,KAAC,CAAC,cAAc,EAAE,UAAU,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC;oBACrD,CAAC;oBAAC,IAAI,CAAC,EAAE,CAAC,CAAC,IAAI,KAAK,OAAO,IAAI,aAAa,CAAC,CAAC,CAAC;wBAC9C,IAAI,CAAC,QAAQ,CAAC,aAAa,EAAE,OAAO,CAAC,CAAC;wBACtC,MAAM,CAAC,KAAC,CAAC,aAAa,EAAE,UAAU,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC;oBACpD,CAAC;gBACF,CAAC;gBAED,EAAE,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC;oBACnB,IAAI,CAAC,OAAO,IAAI,IAAI,CAAC,OAAO,EAAE,CAAC;oBAC/B,IAAI,CAAC,QAAQ,GAAG,KAAK,CAAC;gBACvB,CAAC;gBACD,MAAM,CAAC,IAAI,CAAC;YACb,CAAC;YAlEI,eAAe;gBAFpB,eAAM,CAAC,EAAE,IAAI,EAAE,GAAG,EAAE,aAAa,eAAA,EAAE,CAAC;gBACpC,2BAAY,EAAE;eACT,eAAe,CAmEpB;YAAD,sBAAC;SAAA,AAnED,CAA8B,uBAAU,GAmEvC;QACD,MAAM,CAAC,eAAe,CAAC;IACxB,CAAC;IAjFD,wBAiFC","sourcesContent":["import { DNode, WidgetBaseInterface } from '../widget-core/interfaces';\nimport { WidgetBase } from '../widget-core/WidgetBase';\nimport { w } from '../widget-core/d';\nimport { inject } from '../widget-core/decorators/inject';\nimport { alwaysRender } from '../widget-core/decorators/alwaysRender';\nimport { OnEnter, Component, OutletOptions, OutletComponents, Outlet, Params, OutletContext } from './interfaces';\nimport { Router } from './Router';\n\nexport function isComponent(value: any): value is Component {\n\treturn Boolean(value && (typeof value === 'string' || typeof value === 'function' || typeof value === 'symbol'));\n}\n\nexport function getProperties(router: Router, properties: any) {\n\treturn { router };\n}\n\nexport function Outlet(\n\toutletComponents: Component | OutletComponents,\n\toutlet: string,\n\toptions: OutletOptions = {}\n): Outlet {\n\tconst indexComponent = isComponent(outletComponents) ? undefined : outletComponents.index;\n\tconst mainComponent = isComponent(outletComponents) ? outletComponents : outletComponents.main;\n\tconst errorComponent = isComponent(outletComponents) ? undefined : outletComponents.error;\n\tconst { mapParams, key = 'router' } = options;\n\n\t@inject({ name: key, getProperties })\n\t@alwaysRender()\n\tclass OutletComponent extends WidgetBase & { router: Router }, null> {\n\t\tprivate _matched = false;\n\t\tprivate _matchedParams: Params = {};\n\t\tprivate _onExit?: () => void;\n\n\t\tprivate _hasRouteChanged(params: Params): boolean {\n\t\t\tif (!this._matched) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\tconst newParamKeys = Object.keys(params);\n\t\t\tfor (let i = 0; i < newParamKeys.length; i++) {\n\t\t\t\tconst key = newParamKeys[i];\n\t\t\t\tif (this._matchedParams[key] !== params[key]) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\n\t\tprivate _onEnter(outletContext: OutletContext, onEnterCallback?: OnEnter) {\n\t\t\tconst { params, type } = outletContext;\n\t\t\tif (this._hasRouteChanged(params)) {\n\t\t\t\tonEnterCallback && onEnterCallback(params, type);\n\t\t\t\tthis._matched = true;\n\t\t\t\tthis._matchedParams = params;\n\t\t\t}\n\t\t}\n\n\t\tprotected onDetach() {\n\t\t\tif (this._matched) {\n\t\t\t\tthis._onExit && this._onExit();\n\t\t\t\tthis._matched = false;\n\t\t\t}\n\t\t}\n\n\t\tprotected render(): DNode {\n\t\t\tlet { router, ...properties } = this.properties;\n\n\t\t\tconst outletContext = router.getOutlet(outlet);\n\t\t\tif (outletContext) {\n\t\t\t\tconst { queryParams, params, type, onEnter, onExit } = outletContext;\n\t\t\t\tthis._onExit = onExit;\n\t\t\t\tif (mapParams) {\n\t\t\t\t\tproperties = { ...properties, ...mapParams({ queryParams, params, type, router }) };\n\t\t\t\t}\n\n\t\t\t\tif (type === 'index' && indexComponent) {\n\t\t\t\t\tthis._onEnter(outletContext, onEnter);\n\t\t\t\t\treturn w(indexComponent, properties, this.children);\n\t\t\t\t} else if (type === 'error' && errorComponent) {\n\t\t\t\t\tthis._onEnter(outletContext, onEnter);\n\t\t\t\t\treturn w(errorComponent, properties, this.children);\n\t\t\t\t} else if (type === 'error' && indexComponent) {\n\t\t\t\t\tthis._onEnter(outletContext, onEnter);\n\t\t\t\t\treturn w(indexComponent, properties, this.children);\n\t\t\t\t} else if (type !== 'error' && mainComponent) {\n\t\t\t\t\tthis._onEnter(outletContext, onEnter);\n\t\t\t\t\treturn w(mainComponent, properties, this.children);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (this._matched) {\n\t\t\t\tthis._onExit && this._onExit();\n\t\t\t\tthis._matched = false;\n\t\t\t}\n\t\t\treturn null;\n\t\t}\n\t}\n\treturn OutletComponent;\n}\n\nexport default Outlet;\n"]} \ No newline at end of file diff --git a/deps/framework/routing/Outlet.mjs b/deps/framework/routing/Outlet.mjs deleted file mode 100644 index ccb056fc48..0000000000 --- a/deps/framework/routing/Outlet.mjs +++ /dev/null @@ -1,89 +0,0 @@ -import * as tslib_1 from "tslib"; -import { WidgetBase } from '../widget-core/WidgetBase'; -import { w } from '../widget-core/d'; -import { inject } from '../widget-core/decorators/inject'; -import { alwaysRender } from '../widget-core/decorators/alwaysRender'; -export function isComponent(value) { - return Boolean(value && (typeof value === 'string' || typeof value === 'function' || typeof value === 'symbol')); -} -export function getProperties(router, properties) { - return { router }; -} -export function Outlet(outletComponents, outlet, options = {}) { - const indexComponent = isComponent(outletComponents) ? undefined : outletComponents.index; - const mainComponent = isComponent(outletComponents) ? outletComponents : outletComponents.main; - const errorComponent = isComponent(outletComponents) ? undefined : outletComponents.error; - const { mapParams, key = 'router' } = options; - let OutletComponent = class OutletComponent extends WidgetBase { - constructor() { - super(...arguments); - this._matched = false; - this._matchedParams = {}; - } - _hasRouteChanged(params) { - if (!this._matched) { - return true; - } - const newParamKeys = Object.keys(params); - for (let i = 0; i < newParamKeys.length; i++) { - const key = newParamKeys[i]; - if (this._matchedParams[key] !== params[key]) { - return true; - } - } - return false; - } - _onEnter(outletContext, onEnterCallback) { - const { params, type } = outletContext; - if (this._hasRouteChanged(params)) { - onEnterCallback && onEnterCallback(params, type); - this._matched = true; - this._matchedParams = params; - } - } - onDetach() { - if (this._matched) { - this._onExit && this._onExit(); - this._matched = false; - } - } - render() { - let _a = this.properties, { router } = _a, properties = tslib_1.__rest(_a, ["router"]); - const outletContext = router.getOutlet(outlet); - if (outletContext) { - const { queryParams, params, type, onEnter, onExit } = outletContext; - this._onExit = onExit; - if (mapParams) { - properties = Object.assign({}, properties, mapParams({ queryParams, params, type, router })); - } - if (type === 'index' && indexComponent) { - this._onEnter(outletContext, onEnter); - return w(indexComponent, properties, this.children); - } - else if (type === 'error' && errorComponent) { - this._onEnter(outletContext, onEnter); - return w(errorComponent, properties, this.children); - } - else if (type === 'error' && indexComponent) { - this._onEnter(outletContext, onEnter); - return w(indexComponent, properties, this.children); - } - else if (type !== 'error' && mainComponent) { - this._onEnter(outletContext, onEnter); - return w(mainComponent, properties, this.children); - } - } - if (this._matched) { - this._onExit && this._onExit(); - this._matched = false; - } - return null; - } - }; - OutletComponent = tslib_1.__decorate([ - inject({ name: key, getProperties }), - alwaysRender() - ], OutletComponent); - return OutletComponent; -} -//# sourceMappingURL=Outlet.mjs.map \ No newline at end of file diff --git a/deps/framework/routing/Outlet.mjs.map b/deps/framework/routing/Outlet.mjs.map deleted file mode 100644 index 799eea81d2..0000000000 --- a/deps/framework/routing/Outlet.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"Outlet.mjs","sourceRoot":"","sources":["Outlet.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,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,CAAC;YACF,CAAC;YAED,EAAE,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC;gBACnB,IAAI,CAAC,OAAO,IAAI,IAAI,CAAC,OAAO,EAAE,CAAC;gBAC/B,IAAI,CAAC,QAAQ,GAAG,KAAK,CAAC;YACvB,CAAC;YACD,MAAM,CAAC,IAAI,CAAC;QACb,CAAC;KACD,CAAA;IAnEK,eAAe;QAFpB,MAAM,CAAC,EAAE,IAAI,EAAE,GAAG,EAAE,aAAa,EAAE,CAAC;QACpC,YAAY,EAAE;OACT,eAAe,CAmEpB;IACD,MAAM,CAAC,eAAe,CAAC;AACxB,CAAC","sourcesContent":["import { DNode, WidgetBaseInterface } from '../widget-core/interfaces';\nimport { WidgetBase } from '../widget-core/WidgetBase';\nimport { w } from '../widget-core/d';\nimport { inject } from '../widget-core/decorators/inject';\nimport { alwaysRender } from '../widget-core/decorators/alwaysRender';\nimport { OnEnter, Component, OutletOptions, OutletComponents, Outlet, Params, OutletContext } from './interfaces';\nimport { Router } from './Router';\n\nexport function isComponent(value: any): value is Component {\n\treturn Boolean(value && (typeof value === 'string' || typeof value === 'function' || typeof value === 'symbol'));\n}\n\nexport function getProperties(router: Router, properties: any) {\n\treturn { router };\n}\n\nexport function Outlet(\n\toutletComponents: Component | OutletComponents,\n\toutlet: string,\n\toptions: OutletOptions = {}\n): Outlet {\n\tconst indexComponent = isComponent(outletComponents) ? undefined : outletComponents.index;\n\tconst mainComponent = isComponent(outletComponents) ? outletComponents : outletComponents.main;\n\tconst errorComponent = isComponent(outletComponents) ? undefined : outletComponents.error;\n\tconst { mapParams, key = 'router' } = options;\n\n\t@inject({ name: key, getProperties })\n\t@alwaysRender()\n\tclass OutletComponent extends WidgetBase & { router: Router }, null> {\n\t\tprivate _matched = false;\n\t\tprivate _matchedParams: Params = {};\n\t\tprivate _onExit?: () => void;\n\n\t\tprivate _hasRouteChanged(params: Params): boolean {\n\t\t\tif (!this._matched) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\tconst newParamKeys = Object.keys(params);\n\t\t\tfor (let i = 0; i < newParamKeys.length; i++) {\n\t\t\t\tconst key = newParamKeys[i];\n\t\t\t\tif (this._matchedParams[key] !== params[key]) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\n\t\tprivate _onEnter(outletContext: OutletContext, onEnterCallback?: OnEnter) {\n\t\t\tconst { params, type } = outletContext;\n\t\t\tif (this._hasRouteChanged(params)) {\n\t\t\t\tonEnterCallback && onEnterCallback(params, type);\n\t\t\t\tthis._matched = true;\n\t\t\t\tthis._matchedParams = params;\n\t\t\t}\n\t\t}\n\n\t\tprotected onDetach() {\n\t\t\tif (this._matched) {\n\t\t\t\tthis._onExit && this._onExit();\n\t\t\t\tthis._matched = false;\n\t\t\t}\n\t\t}\n\n\t\tprotected render(): DNode {\n\t\t\tlet { router, ...properties } = this.properties;\n\n\t\t\tconst outletContext = router.getOutlet(outlet);\n\t\t\tif (outletContext) {\n\t\t\t\tconst { queryParams, params, type, onEnter, onExit } = outletContext;\n\t\t\t\tthis._onExit = onExit;\n\t\t\t\tif (mapParams) {\n\t\t\t\t\tproperties = { ...properties, ...mapParams({ queryParams, params, type, router }) };\n\t\t\t\t}\n\n\t\t\t\tif (type === 'index' && indexComponent) {\n\t\t\t\t\tthis._onEnter(outletContext, onEnter);\n\t\t\t\t\treturn w(indexComponent, properties, this.children);\n\t\t\t\t} else if (type === 'error' && errorComponent) {\n\t\t\t\t\tthis._onEnter(outletContext, onEnter);\n\t\t\t\t\treturn w(errorComponent, properties, this.children);\n\t\t\t\t} else if (type === 'error' && indexComponent) {\n\t\t\t\t\tthis._onEnter(outletContext, onEnter);\n\t\t\t\t\treturn w(indexComponent, properties, this.children);\n\t\t\t\t} else if (type !== 'error' && mainComponent) {\n\t\t\t\t\tthis._onEnter(outletContext, onEnter);\n\t\t\t\t\treturn w(mainComponent, properties, this.children);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (this._matched) {\n\t\t\t\tthis._onExit && this._onExit();\n\t\t\t\tthis._matched = false;\n\t\t\t}\n\t\t\treturn null;\n\t\t}\n\t}\n\treturn OutletComponent;\n}\n\nexport default Outlet;\n"]} \ No newline at end of file diff --git a/deps/framework/routing/Router.d.ts b/deps/framework/routing/Router.d.ts deleted file mode 100644 index 9333f61bc7..0000000000 --- a/deps/framework/routing/Router.d.ts +++ /dev/null @@ -1,70 +0,0 @@ -import QueuingEvented from '../core/QueuingEvented'; -import { RouteConfig, OutletContext, Params, RouterInterface, RouterOptions } from './interfaces'; -import { EventObject } from '../core/interfaces'; -export interface NavEvent extends EventObject { - outlet: string; - context: OutletContext; -} -export declare class Router extends QueuingEvented<{ - nav: NavEvent; -}> implements RouterInterface { - private _routes; - private _outletMap; - private _matchedOutlets; - private _currentParams; - private _currentQueryParams; - private _defaultOutlet; - private _history; - constructor(config: RouteConfig[], options?: RouterOptions); - /** - * Sets the path against the registered history manager - * - * @param path The path to set on the history manager - */ - setPath(path: string): void; - /** - * Generate a link for a given outlet identifier and optional params. - * - * @param outlet The outlet to generate a link for - * @param params Optional Params for the generated link - */ - link(outlet: string, params?: Params): string | undefined; - /** - * Returns the outlet context for the outlet identifier if one has been matched - * - * @param outletIdentifier The outlet identifer - */ - getOutlet(outletIdentifier: string): OutletContext | undefined; - /** - * Returns all the params for the current matched outlets - */ - readonly currentParams: Params; - /** - * Strips the leading slash on a path if one exists - * - * @param path The path to strip a leading slash - */ - private _stripLeadingSlash(path); - /** - * Registers the routing configuration - * - * @param config The configuration - * @param routes The routes - * @param parentRoute The parent route - */ - private _register(config, routes?, parentRoute?); - /** - * Returns an object of query params - * - * @param queryParamString The string of query params, e.g `paramOne=one¶mTwo=two` - */ - private _getQueryParams(queryParamString?); - /** - * Called on change of the route by the the registered history manager. Matches the path against - * the registered outlets. - * - * @param requestedPath The path of the requested route - */ - private _onChange; -} -export default Router; diff --git a/deps/framework/routing/Router.js b/deps/framework/routing/Router.js deleted file mode 100644 index 6f2620acdd..0000000000 --- a/deps/framework/routing/Router.js +++ /dev/null @@ -1,271 +0,0 @@ -(function (factory) { - if (typeof module === "object" && typeof module.exports === "object") { - var v = factory(require, exports); - if (v !== undefined) module.exports = v; - } - else if (typeof define === "function" && define.amd) { - define(["require", "exports", "tslib", "../core/QueuingEvented", "./history/HashHistory"], factory); - } -})(function (require, exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - var tslib_1 = require("tslib"); - var QueuingEvented_1 = require("../core/QueuingEvented"); - var HashHistory_1 = require("./history/HashHistory"); - var PARAM = Symbol('routing param'); - var Router = /** @class */ (function (_super) { - tslib_1.__extends(Router, _super); - function Router(config, options) { - if (options === void 0) { options = {}; } - var _this = _super.call(this) || this; - _this._routes = []; - _this._outletMap = Object.create(null); - _this._matchedOutlets = Object.create(null); - _this._currentParams = {}; - _this._currentQueryParams = {}; - /** - * Called on change of the route by the the registered history manager. Matches the path against - * the registered outlets. - * - * @param requestedPath The path of the requested route - */ - _this._onChange = function (requestedPath) { - _this.emit({ type: 'navstart' }); - _this._matchedOutlets = Object.create(null); - _this._currentParams = {}; - requestedPath = _this._stripLeadingSlash(requestedPath); - var _a = tslib_1.__read(requestedPath.split('?'), 2), path = _a[0], queryParamString = _a[1]; - _this._currentQueryParams = _this._getQueryParams(queryParamString); - var matchedOutletContext; - var matchedOutlet; - var routes = tslib_1.__spread(_this._routes); - var paramIndex = 0; - var segments = path.split('/'); - var routeMatched = false; - var previousOutlet; - while (routes.length > 0) { - if (segments.length === 0) { - break; - } - var route = routes.shift(); - var onEnter = route.onEnter, onExit = route.onExit; - var type = 'index'; - var segmentsForRoute = tslib_1.__spread(segments); - var routeMatch = true; - var segmentIndex = 0; - if (segments.length < route.segments.length) { - routeMatch = false; - } - else { - while (segments.length > 0) { - if (route.segments[segmentIndex] === undefined) { - type = 'partial'; - break; - } - var segment = segments.shift(); - if (route.segments[segmentIndex] === PARAM) { - _this._currentParams[route.params[paramIndex++]] = segment; - } - else if (route.segments[segmentIndex] !== segment) { - routeMatch = false; - break; - } - segmentIndex++; - } - } - if (routeMatch === true) { - previousOutlet = route.outlet; - routeMatched = true; - _this._matchedOutlets[route.outlet] = { - queryParams: _this._currentQueryParams, - params: tslib_1.__assign({}, _this._currentParams), - type: type, - onEnter: onEnter, - onExit: onExit - }; - matchedOutletContext = _this._matchedOutlets[route.outlet]; - matchedOutlet = route.outlet; - if (route.children.length) { - paramIndex = 0; - } - routes = tslib_1.__spread(route.children); - } - else { - if (previousOutlet !== undefined && routes.length === 0) { - _this._matchedOutlets[previousOutlet].type = 'error'; - } - segments = tslib_1.__spread(segmentsForRoute); - } - } - if (routeMatched === false) { - _this._matchedOutlets.errorOutlet = { - queryParams: _this._currentQueryParams, - params: tslib_1.__assign({}, _this._currentParams), - type: 'error' - }; - } - if (matchedOutlet && matchedOutletContext) { - _this.emit({ type: 'nav', outlet: matchedOutlet, context: matchedOutletContext }); - } - }; - var _a = options.HistoryManager, HistoryManager = _a === void 0 ? HashHistory_1.HashHistory : _a, base = options.base, window = options.window; - _this._register(config); - _this._history = new HistoryManager({ onChange: _this._onChange, base: base, window: window }); - if (_this._matchedOutlets.errorOutlet && _this._defaultOutlet) { - var path = _this.link(_this._defaultOutlet); - if (path) { - _this.setPath(path); - } - } - return _this; - } - /** - * Sets the path against the registered history manager - * - * @param path The path to set on the history manager - */ - Router.prototype.setPath = function (path) { - this._history.set(path); - }; - /** - * Generate a link for a given outlet identifier and optional params. - * - * @param outlet The outlet to generate a link for - * @param params Optional Params for the generated link - */ - Router.prototype.link = function (outlet, params) { - if (params === void 0) { params = {}; } - var _a = this, _outletMap = _a._outletMap, _currentParams = _a._currentParams, _currentQueryParams = _a._currentQueryParams; - var route = _outletMap[outlet]; - if (route === undefined) { - return; - } - var linkPath = route.fullPath; - if (route.fullQueryParams.length > 0) { - var queryString = route.fullQueryParams.reduce(function (queryParamString, param, index) { - if (index > 0) { - return queryParamString + "&" + param + "={" + param + "}"; - } - return "?" + param + "={" + param + "}"; - }, ''); - linkPath = "" + linkPath + queryString; - } - params = tslib_1.__assign({}, route.defaultParams, _currentQueryParams, _currentParams, params); - if (Object.keys(params).length === 0 && route.fullParams.length > 0) { - return undefined; - } - var fullParams = tslib_1.__spread(route.fullParams, route.fullQueryParams); - for (var i = 0; i < fullParams.length; i++) { - var param = fullParams[i]; - if (params[param]) { - linkPath = linkPath.replace("{" + param + "}", params[param]); - } - else { - return undefined; - } - } - return linkPath; - }; - /** - * Returns the outlet context for the outlet identifier if one has been matched - * - * @param outletIdentifier The outlet identifer - */ - Router.prototype.getOutlet = function (outletIdentifier) { - return this._matchedOutlets[outletIdentifier]; - }; - Object.defineProperty(Router.prototype, "currentParams", { - /** - * Returns all the params for the current matched outlets - */ - get: function () { - return this._currentParams; - }, - enumerable: true, - configurable: true - }); - /** - * Strips the leading slash on a path if one exists - * - * @param path The path to strip a leading slash - */ - Router.prototype._stripLeadingSlash = function (path) { - if (path[0] === '/') { - return path.slice(1); - } - return path; - }; - /** - * Registers the routing configuration - * - * @param config The configuration - * @param routes The routes - * @param parentRoute The parent route - */ - Router.prototype._register = function (config, routes, parentRoute) { - routes = routes ? routes : this._routes; - for (var i = 0; i < config.length; i++) { - var _a = config[i], onEnter = _a.onEnter, onExit = _a.onExit, path = _a.path, outlet = _a.outlet, children = _a.children, _b = _a.defaultRoute, defaultRoute = _b === void 0 ? false : _b, _c = _a.defaultParams, defaultParams = _c === void 0 ? {} : _c; - var _d = tslib_1.__read(path.split('?'), 2), parsedPath = _d[0], queryParamString = _d[1]; - var queryParams = []; - parsedPath = this._stripLeadingSlash(parsedPath); - var segments = parsedPath.split('/'); - var route = { - params: [], - outlet: outlet, - path: parsedPath, - segments: segments, - defaultParams: parentRoute ? tslib_1.__assign({}, parentRoute.defaultParams, defaultParams) : defaultParams, - children: [], - fullPath: parentRoute ? parentRoute.fullPath + "/" + parsedPath : parsedPath, - fullParams: [], - fullQueryParams: [], - onEnter: onEnter, - onExit: onExit - }; - if (defaultRoute) { - this._defaultOutlet = outlet; - } - for (var i_1 = 0; i_1 < segments.length; i_1++) { - var segment = segments[i_1]; - if (typeof segment === 'string' && segment[0] === '{') { - route.params.push(segment.replace('{', '').replace('}', '')); - segments[i_1] = PARAM; - } - } - if (queryParamString) { - queryParams = queryParamString.split('$').map(function (queryParam) { - return queryParam.replace('{', '').replace('}', ''); - }); - } - route.fullQueryParams = parentRoute ? tslib_1.__spread(parentRoute.fullQueryParams, queryParams) : queryParams; - route.fullParams = parentRoute ? tslib_1.__spread(parentRoute.fullParams, route.params) : route.params; - if (children && children.length > 0) { - this._register(children, route.children, route); - } - this._outletMap[outlet] = route; - routes.push(route); - } - }; - /** - * Returns an object of query params - * - * @param queryParamString The string of query params, e.g `paramOne=one¶mTwo=two` - */ - Router.prototype._getQueryParams = function (queryParamString) { - var queryParams = {}; - if (queryParamString) { - var queryParameters = queryParamString.split('&'); - for (var i = 0; i < queryParameters.length; i++) { - var _a = tslib_1.__read(queryParameters[i].split('='), 2), key = _a[0], value = _a[1]; - queryParams[key] = value; - } - } - return queryParams; - }; - return Router; - }(QueuingEvented_1.default)); - exports.Router = Router; - exports.default = Router; -}); -//# sourceMappingURL=Router.js.map \ No newline at end of file diff --git a/deps/framework/routing/Router.js.map b/deps/framework/routing/Router.js.map deleted file mode 100644 index e571f0e7d5..0000000000 --- a/deps/framework/routing/Router.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"Router.js","sourceRoot":"","sources":["Router.ts"],"names":[],"mappings":";;;;;;;;;;;;IAAA,yDAAoD;IAWpD,qDAAoD;IAGpD,IAAM,KAAK,GAAG,MAAM,CAAC,eAAe,CAAC,CAAC;IAOtC;QAA4B,kCAAiC;QAS5D,gBAAY,MAAqB,EAAE,OAA2B;YAA3B,wBAAA,EAAA,YAA2B;YAA9D,YACC,iBAAO,SAUP;YAnBO,aAAO,GAAY,EAAE,CAAC;YACtB,gBAAU,GAA+B,MAAM,CAAC,MAAM,CAAC,IAAI,CAA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;gBAE7F,EAAE,CAAC,CAAC,QAAQ,IAAI,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC;oBACrC,IAAI,CAAC,SAAS,CAAC,QAAQ,EAAE,KAAK,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC;gBACjD,CAAC;gBACD,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,GAAG,KAAK,CAAC;gBAChC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;YACpB,CAAC;QACF,CAAC;QAED;;;;WAIG;QACK,gCAAe,GAAvB,UAAwB,gBAAyB;YAChD,IAAM,WAAW,GAAgC,EAAE,CAAC;YACpD,EAAE,CAAC,CAAC,gBAAgB,CAAC,CAAC,CAAC;gBACtB,IAAM,eAAe,GAAG,gBAAgB,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;gBACpD,GAAG,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,eAAe,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;oBAC3C,IAAA,qDAA4C,EAA3C,WAAG,EAAE,aAAK,CAAkC;oBACnD,WAAW,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;gBAC1B,CAAC;YACF,CAAC;YACD,MAAM,CAAC,WAAW,CAAC;QACpB,CAAC;QAsFF,aAAC;IAAD,CAAC,AAjQD,CAA4B,wBAAc,GAiQzC;IAjQY,wBAAM;IAmQnB,kBAAe,MAAM,CAAC","sourcesContent":["import QueuingEvented from '../core/QueuingEvented';\nimport {\n\tRouteConfig,\n\tHistory,\n\tMatchType,\n\tOutletContext,\n\tParams,\n\tRouterInterface,\n\tRoute,\n\tRouterOptions\n} from './interfaces';\nimport { HashHistory } from './history/HashHistory';\nimport { EventObject } from '../core/interfaces';\n\nconst PARAM = Symbol('routing param');\n\nexport interface NavEvent extends EventObject {\n\toutlet: string;\n\tcontext: OutletContext;\n}\n\nexport class Router extends QueuingEvented<{ nav: NavEvent }> implements RouterInterface {\n\tprivate _routes: Route[] = [];\n\tprivate _outletMap: { [index: string]: Route } = Object.create(null);\n\tprivate _matchedOutlets: { [index: string]: OutletContext } = Object.create(null);\n\tprivate _currentParams: Params = {};\n\tprivate _currentQueryParams: Params = {};\n\tprivate _defaultOutlet: string | undefined;\n\tprivate _history: History;\n\n\tconstructor(config: RouteConfig[], options: RouterOptions = {}) {\n\t\tsuper();\n\t\tconst { HistoryManager = HashHistory, base, window } = options;\n\t\tthis._register(config);\n\t\tthis._history = new HistoryManager({ onChange: this._onChange, base, window });\n\t\tif (this._matchedOutlets.errorOutlet && this._defaultOutlet) {\n\t\t\tconst path = this.link(this._defaultOutlet);\n\t\t\tif (path) {\n\t\t\t\tthis.setPath(path);\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Sets the path against the registered history manager\n\t *\n\t * @param path The path to set on the history manager\n\t */\n\tpublic setPath(path: string): void {\n\t\tthis._history.set(path);\n\t}\n\n\t/**\n\t * Generate a link for a given outlet identifier and optional params.\n\t *\n\t * @param outlet The outlet to generate a link for\n\t * @param params Optional Params for the generated link\n\t */\n\tpublic link(outlet: string, params: Params = {}): string | undefined {\n\t\tconst { _outletMap, _currentParams, _currentQueryParams } = this;\n\t\tlet route = _outletMap[outlet];\n\t\tif (route === undefined) {\n\t\t\treturn;\n\t\t}\n\n\t\tlet linkPath: string | undefined = route.fullPath;\n\t\tif (route.fullQueryParams.length > 0) {\n\t\t\tlet queryString = route.fullQueryParams.reduce((queryParamString, param, index) => {\n\t\t\t\tif (index > 0) {\n\t\t\t\t\treturn `${queryParamString}&${param}={${param}}`;\n\t\t\t\t}\n\t\t\t\treturn `?${param}={${param}}`;\n\t\t\t}, '');\n\t\t\tlinkPath = `${linkPath}${queryString}`;\n\t\t}\n\t\tparams = { ...route.defaultParams, ..._currentQueryParams, ..._currentParams, ...params };\n\n\t\tif (Object.keys(params).length === 0 && route.fullParams.length > 0) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\tconst fullParams = [...route.fullParams, ...route.fullQueryParams];\n\t\tfor (let i = 0; i < fullParams.length; i++) {\n\t\t\tconst param = fullParams[i];\n\t\t\tif (params[param]) {\n\t\t\t\tlinkPath = linkPath.replace(`{${param}}`, params[param]);\n\t\t\t} else {\n\t\t\t\treturn undefined;\n\t\t\t}\n\t\t}\n\t\treturn linkPath;\n\t}\n\n\t/**\n\t * Returns the outlet context for the outlet identifier if one has been matched\n\t *\n\t * @param outletIdentifier The outlet identifer\n\t */\n\tpublic getOutlet(outletIdentifier: string): OutletContext | undefined {\n\t\treturn this._matchedOutlets[outletIdentifier];\n\t}\n\n\t/**\n\t * Returns all the params for the current matched outlets\n\t */\n\tpublic get currentParams() {\n\t\treturn this._currentParams;\n\t}\n\n\t/**\n\t * Strips the leading slash on a path if one exists\n\t *\n\t * @param path The path to strip a leading slash\n\t */\n\tprivate _stripLeadingSlash(path: string): string {\n\t\tif (path[0] === '/') {\n\t\t\treturn path.slice(1);\n\t\t}\n\t\treturn path;\n\t}\n\n\t/**\n\t * Registers the routing configuration\n\t *\n\t * @param config The configuration\n\t * @param routes The routes\n\t * @param parentRoute The parent route\n\t */\n\tprivate _register(config: RouteConfig[], routes?: Route[], parentRoute?: Route): void {\n\t\troutes = routes ? routes : this._routes;\n\t\tfor (let i = 0; i < config.length; i++) {\n\t\t\tlet { onEnter, onExit, path, outlet, children, defaultRoute = false, defaultParams = {} } = config[i];\n\t\t\tlet [parsedPath, queryParamString] = path.split('?');\n\t\t\tlet queryParams: string[] = [];\n\t\t\tparsedPath = this._stripLeadingSlash(parsedPath);\n\n\t\t\tconst segments: (symbol | string)[] = parsedPath.split('/');\n\t\t\tconst route: Route = {\n\t\t\t\tparams: [],\n\t\t\t\toutlet,\n\t\t\t\tpath: parsedPath,\n\t\t\t\tsegments,\n\t\t\t\tdefaultParams: parentRoute ? { ...parentRoute.defaultParams, ...defaultParams } : defaultParams,\n\t\t\t\tchildren: [],\n\t\t\t\tfullPath: parentRoute ? `${parentRoute.fullPath}/${parsedPath}` : parsedPath,\n\t\t\t\tfullParams: [],\n\t\t\t\tfullQueryParams: [],\n\t\t\t\tonEnter,\n\t\t\t\tonExit\n\t\t\t};\n\t\t\tif (defaultRoute) {\n\t\t\t\tthis._defaultOutlet = outlet;\n\t\t\t}\n\t\t\tfor (let i = 0; i < segments.length; i++) {\n\t\t\t\tconst segment = segments[i];\n\t\t\t\tif (typeof segment === 'string' && segment[0] === '{') {\n\t\t\t\t\troute.params.push(segment.replace('{', '').replace('}', ''));\n\t\t\t\t\tsegments[i] = PARAM;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (queryParamString) {\n\t\t\t\tqueryParams = queryParamString.split('$').map((queryParam) => {\n\t\t\t\t\treturn queryParam.replace('{', '').replace('}', '');\n\t\t\t\t});\n\t\t\t}\n\t\t\troute.fullQueryParams = parentRoute ? [...parentRoute.fullQueryParams, ...queryParams] : queryParams;\n\n\t\t\troute.fullParams = parentRoute ? [...parentRoute.fullParams, ...route.params] : route.params;\n\n\t\t\tif (children && children.length > 0) {\n\t\t\t\tthis._register(children, route.children, route);\n\t\t\t}\n\t\t\tthis._outletMap[outlet] = route;\n\t\t\troutes.push(route);\n\t\t}\n\t}\n\n\t/**\n\t * Returns an object of query params\n\t *\n\t * @param queryParamString The string of query params, e.g `paramOne=one¶mTwo=two`\n\t */\n\tprivate _getQueryParams(queryParamString?: string): { [index: string]: string } {\n\t\tconst queryParams: { [index: string]: string } = {};\n\t\tif (queryParamString) {\n\t\t\tconst queryParameters = queryParamString.split('&');\n\t\t\tfor (let i = 0; i < queryParameters.length; i++) {\n\t\t\t\tconst [key, value] = queryParameters[i].split('=');\n\t\t\t\tqueryParams[key] = value;\n\t\t\t}\n\t\t}\n\t\treturn queryParams;\n\t}\n\n\t/**\n\t * Called on change of the route by the the registered history manager. Matches the path against\n\t * the registered outlets.\n\t *\n\t * @param requestedPath The path of the requested route\n\t */\n\tprivate _onChange = (requestedPath: string): void => {\n\t\tthis.emit({ type: 'navstart' });\n\t\tthis._matchedOutlets = Object.create(null);\n\t\tthis._currentParams = {};\n\t\trequestedPath = this._stripLeadingSlash(requestedPath);\n\n\t\tconst [path, queryParamString] = requestedPath.split('?');\n\t\tthis._currentQueryParams = this._getQueryParams(queryParamString);\n\t\tlet matchedOutletContext: OutletContext | undefined;\n\t\tlet matchedOutlet: string | undefined;\n\t\tlet routes = [...this._routes];\n\t\tlet paramIndex = 0;\n\t\tlet segments = path.split('/');\n\t\tlet routeMatched = false;\n\t\tlet previousOutlet: string | undefined;\n\t\twhile (routes.length > 0) {\n\t\t\tif (segments.length === 0) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tconst route = routes.shift()!;\n\t\t\tconst { onEnter, onExit } = route;\n\t\t\tlet type: MatchType = 'index';\n\t\t\tconst segmentsForRoute = [...segments];\n\t\t\tlet routeMatch = true;\n\t\t\tlet segmentIndex = 0;\n\n\t\t\tif (segments.length < route.segments.length) {\n\t\t\t\trouteMatch = false;\n\t\t\t} else {\n\t\t\t\twhile (segments.length > 0) {\n\t\t\t\t\tif (route.segments[segmentIndex] === undefined) {\n\t\t\t\t\t\ttype = 'partial';\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tconst segment = segments.shift()!;\n\t\t\t\t\tif (route.segments[segmentIndex] === PARAM) {\n\t\t\t\t\t\tthis._currentParams[route.params[paramIndex++]] = segment;\n\t\t\t\t\t} else if (route.segments[segmentIndex] !== segment) {\n\t\t\t\t\t\trouteMatch = false;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tsegmentIndex++;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (routeMatch === true) {\n\t\t\t\tpreviousOutlet = route.outlet;\n\t\t\t\trouteMatched = true;\n\t\t\t\tthis._matchedOutlets[route.outlet] = {\n\t\t\t\t\tqueryParams: this._currentQueryParams,\n\t\t\t\t\tparams: { ...this._currentParams },\n\t\t\t\t\ttype,\n\t\t\t\t\tonEnter,\n\t\t\t\t\tonExit\n\t\t\t\t};\n\t\t\t\tmatchedOutletContext = this._matchedOutlets[route.outlet];\n\t\t\t\tmatchedOutlet = route.outlet;\n\t\t\t\tif (route.children.length) {\n\t\t\t\t\tparamIndex = 0;\n\t\t\t\t}\n\t\t\t\troutes = [...route.children];\n\t\t\t} else {\n\t\t\t\tif (previousOutlet !== undefined && routes.length === 0) {\n\t\t\t\t\tthis._matchedOutlets[previousOutlet].type = 'error';\n\t\t\t\t}\n\t\t\t\tsegments = [...segmentsForRoute];\n\t\t\t}\n\t\t}\n\t\tif (routeMatched === false) {\n\t\t\tthis._matchedOutlets.errorOutlet = {\n\t\t\t\tqueryParams: this._currentQueryParams,\n\t\t\t\tparams: { ...this._currentParams },\n\t\t\t\ttype: 'error'\n\t\t\t};\n\t\t}\n\t\tif (matchedOutlet && matchedOutletContext) {\n\t\t\tthis.emit({ type: 'nav', outlet: matchedOutlet, context: matchedOutletContext });\n\t\t}\n\t};\n}\n\nexport default Router;\n"]} \ No newline at end of file diff --git a/deps/framework/routing/Router.mjs b/deps/framework/routing/Router.mjs deleted file mode 100644 index 7de528eb1c..0000000000 --- a/deps/framework/routing/Router.mjs +++ /dev/null @@ -1,248 +0,0 @@ -import QueuingEvented from '../core/QueuingEvented'; -import { HashHistory } from './history/HashHistory'; -const PARAM = Symbol('routing param'); -export class Router extends QueuingEvented { - constructor(config, options = {}) { - super(); - this._routes = []; - this._outletMap = Object.create(null); - this._matchedOutlets = Object.create(null); - this._currentParams = {}; - this._currentQueryParams = {}; - /** - * Called on change of the route by the the registered history manager. Matches the path against - * the registered outlets. - * - * @param requestedPath The path of the requested route - */ - this._onChange = (requestedPath) => { - this.emit({ type: 'navstart' }); - this._matchedOutlets = Object.create(null); - this._currentParams = {}; - requestedPath = this._stripLeadingSlash(requestedPath); - const [path, queryParamString] = requestedPath.split('?'); - this._currentQueryParams = this._getQueryParams(queryParamString); - let matchedOutletContext; - let matchedOutlet; - let routes = [...this._routes]; - let paramIndex = 0; - let segments = path.split('/'); - let routeMatched = false; - let previousOutlet; - while (routes.length > 0) { - if (segments.length === 0) { - break; - } - const route = routes.shift(); - const { onEnter, onExit } = route; - let type = 'index'; - const segmentsForRoute = [...segments]; - let routeMatch = true; - let segmentIndex = 0; - if (segments.length < route.segments.length) { - routeMatch = false; - } - else { - while (segments.length > 0) { - if (route.segments[segmentIndex] === undefined) { - type = 'partial'; - break; - } - const segment = segments.shift(); - if (route.segments[segmentIndex] === PARAM) { - this._currentParams[route.params[paramIndex++]] = segment; - } - else if (route.segments[segmentIndex] !== segment) { - routeMatch = false; - break; - } - segmentIndex++; - } - } - if (routeMatch === true) { - previousOutlet = route.outlet; - routeMatched = true; - this._matchedOutlets[route.outlet] = { - queryParams: this._currentQueryParams, - params: Object.assign({}, this._currentParams), - type, - onEnter, - onExit - }; - matchedOutletContext = this._matchedOutlets[route.outlet]; - matchedOutlet = route.outlet; - if (route.children.length) { - paramIndex = 0; - } - routes = [...route.children]; - } - else { - if (previousOutlet !== undefined && routes.length === 0) { - this._matchedOutlets[previousOutlet].type = 'error'; - } - segments = [...segmentsForRoute]; - } - } - if (routeMatched === false) { - this._matchedOutlets.errorOutlet = { - queryParams: this._currentQueryParams, - params: Object.assign({}, this._currentParams), - type: 'error' - }; - } - if (matchedOutlet && matchedOutletContext) { - this.emit({ type: 'nav', outlet: matchedOutlet, context: matchedOutletContext }); - } - }; - const { HistoryManager = HashHistory, base, window } = options; - this._register(config); - this._history = new HistoryManager({ onChange: this._onChange, base, window }); - if (this._matchedOutlets.errorOutlet && this._defaultOutlet) { - const path = this.link(this._defaultOutlet); - if (path) { - this.setPath(path); - } - } - } - /** - * Sets the path against the registered history manager - * - * @param path The path to set on the history manager - */ - setPath(path) { - this._history.set(path); - } - /** - * Generate a link for a given outlet identifier and optional params. - * - * @param outlet The outlet to generate a link for - * @param params Optional Params for the generated link - */ - link(outlet, params = {}) { - const { _outletMap, _currentParams, _currentQueryParams } = this; - let route = _outletMap[outlet]; - if (route === undefined) { - return; - } - let linkPath = route.fullPath; - if (route.fullQueryParams.length > 0) { - let queryString = route.fullQueryParams.reduce((queryParamString, param, index) => { - if (index > 0) { - return `${queryParamString}&${param}={${param}}`; - } - return `?${param}={${param}}`; - }, ''); - linkPath = `${linkPath}${queryString}`; - } - params = Object.assign({}, route.defaultParams, _currentQueryParams, _currentParams, params); - if (Object.keys(params).length === 0 && route.fullParams.length > 0) { - return undefined; - } - const fullParams = [...route.fullParams, ...route.fullQueryParams]; - for (let i = 0; i < fullParams.length; i++) { - const param = fullParams[i]; - if (params[param]) { - linkPath = linkPath.replace(`{${param}}`, params[param]); - } - else { - return undefined; - } - } - return linkPath; - } - /** - * Returns the outlet context for the outlet identifier if one has been matched - * - * @param outletIdentifier The outlet identifer - */ - getOutlet(outletIdentifier) { - return this._matchedOutlets[outletIdentifier]; - } - /** - * Returns all the params for the current matched outlets - */ - get currentParams() { - return this._currentParams; - } - /** - * Strips the leading slash on a path if one exists - * - * @param path The path to strip a leading slash - */ - _stripLeadingSlash(path) { - if (path[0] === '/') { - return path.slice(1); - } - return path; - } - /** - * Registers the routing configuration - * - * @param config The configuration - * @param routes The routes - * @param parentRoute The parent route - */ - _register(config, routes, parentRoute) { - routes = routes ? routes : this._routes; - for (let i = 0; i < config.length; i++) { - let { onEnter, onExit, path, outlet, children, defaultRoute = false, defaultParams = {} } = config[i]; - let [parsedPath, queryParamString] = path.split('?'); - let queryParams = []; - parsedPath = this._stripLeadingSlash(parsedPath); - const segments = parsedPath.split('/'); - const route = { - params: [], - outlet, - path: parsedPath, - segments, - defaultParams: parentRoute ? Object.assign({}, parentRoute.defaultParams, defaultParams) : defaultParams, - children: [], - fullPath: parentRoute ? `${parentRoute.fullPath}/${parsedPath}` : parsedPath, - fullParams: [], - fullQueryParams: [], - onEnter, - onExit - }; - if (defaultRoute) { - this._defaultOutlet = outlet; - } - for (let i = 0; i < segments.length; i++) { - const segment = segments[i]; - if (typeof segment === 'string' && segment[0] === '{') { - route.params.push(segment.replace('{', '').replace('}', '')); - segments[i] = PARAM; - } - } - if (queryParamString) { - queryParams = queryParamString.split('$').map((queryParam) => { - return queryParam.replace('{', '').replace('}', ''); - }); - } - route.fullQueryParams = parentRoute ? [...parentRoute.fullQueryParams, ...queryParams] : queryParams; - route.fullParams = parentRoute ? [...parentRoute.fullParams, ...route.params] : route.params; - if (children && children.length > 0) { - this._register(children, route.children, route); - } - this._outletMap[outlet] = route; - routes.push(route); - } - } - /** - * Returns an object of query params - * - * @param queryParamString The string of query params, e.g `paramOne=one¶mTwo=two` - */ - _getQueryParams(queryParamString) { - const queryParams = {}; - if (queryParamString) { - const queryParameters = queryParamString.split('&'); - for (let i = 0; i < queryParameters.length; i++) { - const [key, value] = queryParameters[i].split('='); - queryParams[key] = value; - } - } - return queryParams; - } -} -export default Router; -//# sourceMappingURL=Router.mjs.map \ No newline at end of file diff --git a/deps/framework/routing/Router.mjs.map b/deps/framework/routing/Router.mjs.map deleted file mode 100644 index 740af34885..0000000000 --- a/deps/framework/routing/Router.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"Router.mjs","sourceRoot":"","sources":["Router.ts"],"names":[],"mappings":"AAAA,OAAO,cAAc,MAAM,wBAAwB,CAAC;AAWpD,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAGpD,MAAM,KAAK,GAAG,MAAM,CAAC,eAAe,CAAC,CAAC;AAOtC,MAAM,aAAc,SAAQ,cAAiC;IAS5D,YAAY,MAAqB,EAAE,UAAyB,EAAE;QAC7D,KAAK,EAAE,CAAC;QATD,YAAO,GAAY,EAAE,CAAC;QACtB,eAAU,GAA+B,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;QAC7D,oBAAe,GAAuC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;QAC1E,mBAAc,GAAW,EAAE,CAAC;QAC5B,wBAAmB,GAAW,EAAE,CAAC;QAwKzC;;;;;WAKG;QACK,cAAS,GAAG,CAAC,aAAqB,EAAQ,EAA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IAAI,CAAC,SAAS,CAAC,QAAQ,EAAE,KAAK,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC;YACjD,CAAC;YACD,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,GAAG,KAAK,CAAC;YAChC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QACpB,CAAC;IACF,CAAC;IAED;;;;OAIG;IACK,eAAe,CAAC,gBAAyB;QAChD,MAAM,WAAW,GAAgC,EAAE,CAAC;QACpD,EAAE,CAAC,CAAC,gBAAgB,CAAC,CAAC,CAAC;YACtB,MAAM,eAAe,GAAG,gBAAgB,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;YACpD,GAAG,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,eAAe,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;gBACjD,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,GAAG,eAAe,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;gBACnD,WAAW,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;YAC1B,CAAC;QACF,CAAC;QACD,MAAM,CAAC,WAAW,CAAC;IACpB,CAAC;CAsFD;AAED,eAAe,MAAM,CAAC","sourcesContent":["import QueuingEvented from '../core/QueuingEvented';\nimport {\n\tRouteConfig,\n\tHistory,\n\tMatchType,\n\tOutletContext,\n\tParams,\n\tRouterInterface,\n\tRoute,\n\tRouterOptions\n} from './interfaces';\nimport { HashHistory } from './history/HashHistory';\nimport { EventObject } from '../core/interfaces';\n\nconst PARAM = Symbol('routing param');\n\nexport interface NavEvent extends EventObject {\n\toutlet: string;\n\tcontext: OutletContext;\n}\n\nexport class Router extends QueuingEvented<{ nav: NavEvent }> implements RouterInterface {\n\tprivate _routes: Route[] = [];\n\tprivate _outletMap: { [index: string]: Route } = Object.create(null);\n\tprivate _matchedOutlets: { [index: string]: OutletContext } = Object.create(null);\n\tprivate _currentParams: Params = {};\n\tprivate _currentQueryParams: Params = {};\n\tprivate _defaultOutlet: string | undefined;\n\tprivate _history: History;\n\n\tconstructor(config: RouteConfig[], options: RouterOptions = {}) {\n\t\tsuper();\n\t\tconst { HistoryManager = HashHistory, base, window } = options;\n\t\tthis._register(config);\n\t\tthis._history = new HistoryManager({ onChange: this._onChange, base, window });\n\t\tif (this._matchedOutlets.errorOutlet && this._defaultOutlet) {\n\t\t\tconst path = this.link(this._defaultOutlet);\n\t\t\tif (path) {\n\t\t\t\tthis.setPath(path);\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Sets the path against the registered history manager\n\t *\n\t * @param path The path to set on the history manager\n\t */\n\tpublic setPath(path: string): void {\n\t\tthis._history.set(path);\n\t}\n\n\t/**\n\t * Generate a link for a given outlet identifier and optional params.\n\t *\n\t * @param outlet The outlet to generate a link for\n\t * @param params Optional Params for the generated link\n\t */\n\tpublic link(outlet: string, params: Params = {}): string | undefined {\n\t\tconst { _outletMap, _currentParams, _currentQueryParams } = this;\n\t\tlet route = _outletMap[outlet];\n\t\tif (route === undefined) {\n\t\t\treturn;\n\t\t}\n\n\t\tlet linkPath: string | undefined = route.fullPath;\n\t\tif (route.fullQueryParams.length > 0) {\n\t\t\tlet queryString = route.fullQueryParams.reduce((queryParamString, param, index) => {\n\t\t\t\tif (index > 0) {\n\t\t\t\t\treturn `${queryParamString}&${param}={${param}}`;\n\t\t\t\t}\n\t\t\t\treturn `?${param}={${param}}`;\n\t\t\t}, '');\n\t\t\tlinkPath = `${linkPath}${queryString}`;\n\t\t}\n\t\tparams = { ...route.defaultParams, ..._currentQueryParams, ..._currentParams, ...params };\n\n\t\tif (Object.keys(params).length === 0 && route.fullParams.length > 0) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\tconst fullParams = [...route.fullParams, ...route.fullQueryParams];\n\t\tfor (let i = 0; i < fullParams.length; i++) {\n\t\t\tconst param = fullParams[i];\n\t\t\tif (params[param]) {\n\t\t\t\tlinkPath = linkPath.replace(`{${param}}`, params[param]);\n\t\t\t} else {\n\t\t\t\treturn undefined;\n\t\t\t}\n\t\t}\n\t\treturn linkPath;\n\t}\n\n\t/**\n\t * Returns the outlet context for the outlet identifier if one has been matched\n\t *\n\t * @param outletIdentifier The outlet identifer\n\t */\n\tpublic getOutlet(outletIdentifier: string): OutletContext | undefined {\n\t\treturn this._matchedOutlets[outletIdentifier];\n\t}\n\n\t/**\n\t * Returns all the params for the current matched outlets\n\t */\n\tpublic get currentParams() {\n\t\treturn this._currentParams;\n\t}\n\n\t/**\n\t * Strips the leading slash on a path if one exists\n\t *\n\t * @param path The path to strip a leading slash\n\t */\n\tprivate _stripLeadingSlash(path: string): string {\n\t\tif (path[0] === '/') {\n\t\t\treturn path.slice(1);\n\t\t}\n\t\treturn path;\n\t}\n\n\t/**\n\t * Registers the routing configuration\n\t *\n\t * @param config The configuration\n\t * @param routes The routes\n\t * @param parentRoute The parent route\n\t */\n\tprivate _register(config: RouteConfig[], routes?: Route[], parentRoute?: Route): void {\n\t\troutes = routes ? routes : this._routes;\n\t\tfor (let i = 0; i < config.length; i++) {\n\t\t\tlet { onEnter, onExit, path, outlet, children, defaultRoute = false, defaultParams = {} } = config[i];\n\t\t\tlet [parsedPath, queryParamString] = path.split('?');\n\t\t\tlet queryParams: string[] = [];\n\t\t\tparsedPath = this._stripLeadingSlash(parsedPath);\n\n\t\t\tconst segments: (symbol | string)[] = parsedPath.split('/');\n\t\t\tconst route: Route = {\n\t\t\t\tparams: [],\n\t\t\t\toutlet,\n\t\t\t\tpath: parsedPath,\n\t\t\t\tsegments,\n\t\t\t\tdefaultParams: parentRoute ? { ...parentRoute.defaultParams, ...defaultParams } : defaultParams,\n\t\t\t\tchildren: [],\n\t\t\t\tfullPath: parentRoute ? `${parentRoute.fullPath}/${parsedPath}` : parsedPath,\n\t\t\t\tfullParams: [],\n\t\t\t\tfullQueryParams: [],\n\t\t\t\tonEnter,\n\t\t\t\tonExit\n\t\t\t};\n\t\t\tif (defaultRoute) {\n\t\t\t\tthis._defaultOutlet = outlet;\n\t\t\t}\n\t\t\tfor (let i = 0; i < segments.length; i++) {\n\t\t\t\tconst segment = segments[i];\n\t\t\t\tif (typeof segment === 'string' && segment[0] === '{') {\n\t\t\t\t\troute.params.push(segment.replace('{', '').replace('}', ''));\n\t\t\t\t\tsegments[i] = PARAM;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (queryParamString) {\n\t\t\t\tqueryParams = queryParamString.split('$').map((queryParam) => {\n\t\t\t\t\treturn queryParam.replace('{', '').replace('}', '');\n\t\t\t\t});\n\t\t\t}\n\t\t\troute.fullQueryParams = parentRoute ? [...parentRoute.fullQueryParams, ...queryParams] : queryParams;\n\n\t\t\troute.fullParams = parentRoute ? [...parentRoute.fullParams, ...route.params] : route.params;\n\n\t\t\tif (children && children.length > 0) {\n\t\t\t\tthis._register(children, route.children, route);\n\t\t\t}\n\t\t\tthis._outletMap[outlet] = route;\n\t\t\troutes.push(route);\n\t\t}\n\t}\n\n\t/**\n\t * Returns an object of query params\n\t *\n\t * @param queryParamString The string of query params, e.g `paramOne=one¶mTwo=two`\n\t */\n\tprivate _getQueryParams(queryParamString?: string): { [index: string]: string } {\n\t\tconst queryParams: { [index: string]: string } = {};\n\t\tif (queryParamString) {\n\t\t\tconst queryParameters = queryParamString.split('&');\n\t\t\tfor (let i = 0; i < queryParameters.length; i++) {\n\t\t\t\tconst [key, value] = queryParameters[i].split('=');\n\t\t\t\tqueryParams[key] = value;\n\t\t\t}\n\t\t}\n\t\treturn queryParams;\n\t}\n\n\t/**\n\t * Called on change of the route by the the registered history manager. Matches the path against\n\t * the registered outlets.\n\t *\n\t * @param requestedPath The path of the requested route\n\t */\n\tprivate _onChange = (requestedPath: string): void => {\n\t\tthis.emit({ type: 'navstart' });\n\t\tthis._matchedOutlets = Object.create(null);\n\t\tthis._currentParams = {};\n\t\trequestedPath = this._stripLeadingSlash(requestedPath);\n\n\t\tconst [path, queryParamString] = requestedPath.split('?');\n\t\tthis._currentQueryParams = this._getQueryParams(queryParamString);\n\t\tlet matchedOutletContext: OutletContext | undefined;\n\t\tlet matchedOutlet: string | undefined;\n\t\tlet routes = [...this._routes];\n\t\tlet paramIndex = 0;\n\t\tlet segments = path.split('/');\n\t\tlet routeMatched = false;\n\t\tlet previousOutlet: string | undefined;\n\t\twhile (routes.length > 0) {\n\t\t\tif (segments.length === 0) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tconst route = routes.shift()!;\n\t\t\tconst { onEnter, onExit } = route;\n\t\t\tlet type: MatchType = 'index';\n\t\t\tconst segmentsForRoute = [...segments];\n\t\t\tlet routeMatch = true;\n\t\t\tlet segmentIndex = 0;\n\n\t\t\tif (segments.length < route.segments.length) {\n\t\t\t\trouteMatch = false;\n\t\t\t} else {\n\t\t\t\twhile (segments.length > 0) {\n\t\t\t\t\tif (route.segments[segmentIndex] === undefined) {\n\t\t\t\t\t\ttype = 'partial';\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tconst segment = segments.shift()!;\n\t\t\t\t\tif (route.segments[segmentIndex] === PARAM) {\n\t\t\t\t\t\tthis._currentParams[route.params[paramIndex++]] = segment;\n\t\t\t\t\t} else if (route.segments[segmentIndex] !== segment) {\n\t\t\t\t\t\trouteMatch = false;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tsegmentIndex++;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (routeMatch === true) {\n\t\t\t\tpreviousOutlet = route.outlet;\n\t\t\t\trouteMatched = true;\n\t\t\t\tthis._matchedOutlets[route.outlet] = {\n\t\t\t\t\tqueryParams: this._currentQueryParams,\n\t\t\t\t\tparams: { ...this._currentParams },\n\t\t\t\t\ttype,\n\t\t\t\t\tonEnter,\n\t\t\t\t\tonExit\n\t\t\t\t};\n\t\t\t\tmatchedOutletContext = this._matchedOutlets[route.outlet];\n\t\t\t\tmatchedOutlet = route.outlet;\n\t\t\t\tif (route.children.length) {\n\t\t\t\t\tparamIndex = 0;\n\t\t\t\t}\n\t\t\t\troutes = [...route.children];\n\t\t\t} else {\n\t\t\t\tif (previousOutlet !== undefined && routes.length === 0) {\n\t\t\t\t\tthis._matchedOutlets[previousOutlet].type = 'error';\n\t\t\t\t}\n\t\t\t\tsegments = [...segmentsForRoute];\n\t\t\t}\n\t\t}\n\t\tif (routeMatched === false) {\n\t\t\tthis._matchedOutlets.errorOutlet = {\n\t\t\t\tqueryParams: this._currentQueryParams,\n\t\t\t\tparams: { ...this._currentParams },\n\t\t\t\ttype: 'error'\n\t\t\t};\n\t\t}\n\t\tif (matchedOutlet && matchedOutletContext) {\n\t\t\tthis.emit({ type: 'nav', outlet: matchedOutlet, context: matchedOutletContext });\n\t\t}\n\t};\n}\n\nexport default Router;\n"]} \ No newline at end of file diff --git a/deps/framework/routing/RouterInjector.d.ts b/deps/framework/routing/RouterInjector.d.ts deleted file mode 100644 index b3f60ea18f..0000000000 --- a/deps/framework/routing/RouterInjector.d.ts +++ /dev/null @@ -1,20 +0,0 @@ -import { Registry } from '../widget-core/Registry'; -import { RegistryLabel } from '../widget-core/interfaces'; -import { Router } from './Router'; -import { RouteConfig, RouterOptions } from './interfaces'; -/** - * Router Injector Options - * - */ -export interface RouterInjectorOptions extends RouterOptions { - key?: RegistryLabel; -} -/** - * Creates a router instance for a specific History manager (default is `HashHistory`) and registers - * the route configuration. - * - * @param config The route config to register for the router - * @param registry An optional registry that defaults to the global registry - * @param options The router injector options - */ -export declare function registerRouterInjector(config: RouteConfig[], registry: Registry, options?: RouterInjectorOptions): Router; diff --git a/deps/framework/routing/RouterInjector.js b/deps/framework/routing/RouterInjector.js deleted file mode 100644 index de578eb81c..0000000000 --- a/deps/framework/routing/RouterInjector.js +++ /dev/null @@ -1,37 +0,0 @@ -(function (factory) { - if (typeof module === "object" && typeof module.exports === "object") { - var v = factory(require, exports); - if (v !== undefined) module.exports = v; - } - else if (typeof define === "function" && define.amd) { - define(["require", "exports", "tslib", "./Router"], factory); - } -})(function (require, exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - var tslib_1 = require("tslib"); - var Router_1 = require("./Router"); - /** - * Creates a router instance for a specific History manager (default is `HashHistory`) and registers - * the route configuration. - * - * @param config The route config to register for the router - * @param registry An optional registry that defaults to the global registry - * @param options The router injector options - */ - function registerRouterInjector(config, registry, options) { - if (options === void 0) { options = {}; } - var _a = options.key, key = _a === void 0 ? 'router' : _a, routerOptions = tslib_1.__rest(options, ["key"]); - if (registry.hasInjector(key)) { - throw new Error('Router has already been defined'); - } - var router = new Router_1.Router(config, routerOptions); - registry.defineInjector(key, function (invalidator) { - router.on('navstart', function () { return invalidator(); }); - return function () { return router; }; - }); - return router; - } - exports.registerRouterInjector = registerRouterInjector; -}); -//# sourceMappingURL=RouterInjector.js.map \ No newline at end of file diff --git a/deps/framework/routing/RouterInjector.js.map b/deps/framework/routing/RouterInjector.js.map deleted file mode 100644 index 76d251d72b..0000000000 --- a/deps/framework/routing/RouterInjector.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"RouterInjector.js","sourceRoot":"","sources":["RouterInjector.ts"],"names":[],"mappings":";;;;;;;;;;;;IAGA,mCAAkC;IAWlC;;;;;;;OAOG;IACH,gCACC,MAAqB,EACrB,QAAkB,EAClB,OAAmC;QAAnC,wBAAA,EAAA,YAAmC;QAE3B,IAAA,gBAAc,EAAd,mCAAc,EAAE,gDAAgB,CAAa;QAErD,EAAE,CAAC,CAAC,QAAQ,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;YAC/B,MAAM,IAAI,KAAK,CAAC,iCAAiC,CAAC,CAAC;QACpD,CAAC;QACD,IAAM,MAAM,GAAG,IAAI,eAAM,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC;QACjD,QAAQ,CAAC,cAAc,CAAC,GAAG,EAAE,UAAC,WAAuB;YACpD,MAAM,CAAC,EAAE,CAAC,UAAU,EAAE,cAAM,OAAA,WAAW,EAAE,EAAb,CAAa,CAAC,CAAC;YAC3C,MAAM,CAAC,cAAM,OAAA,MAAM,EAAN,CAAM,CAAC;QACrB,CAAC,CAAC,CAAC;QACH,MAAM,CAAC,MAAM,CAAC;IACf,CAAC;IAhBD,wDAgBC","sourcesContent":["import { Registry } from '../widget-core/Registry';\nimport { RegistryLabel } from '../widget-core/interfaces';\n\nimport { Router } from './Router';\nimport { RouteConfig, RouterOptions } from './interfaces';\n\n/**\n * Router Injector Options\n *\n */\nexport interface RouterInjectorOptions extends RouterOptions {\n\tkey?: RegistryLabel;\n}\n\n/**\n * Creates a router instance for a specific History manager (default is `HashHistory`) and registers\n * the route configuration.\n *\n * @param config The route config to register for the router\n * @param registry An optional registry that defaults to the global registry\n * @param options The router injector options\n */\nexport function registerRouterInjector(\n\tconfig: RouteConfig[],\n\tregistry: Registry,\n\toptions: RouterInjectorOptions = {}\n): Router {\n\tconst { key = 'router', ...routerOptions } = options;\n\n\tif (registry.hasInjector(key)) {\n\t\tthrow new Error('Router has already been defined');\n\t}\n\tconst router = new Router(config, routerOptions);\n\tregistry.defineInjector(key, (invalidator: () => void) => {\n\t\trouter.on('navstart', () => invalidator());\n\t\treturn () => router;\n\t});\n\treturn router;\n}\n"]} \ No newline at end of file diff --git a/deps/framework/routing/RouterInjector.mjs b/deps/framework/routing/RouterInjector.mjs deleted file mode 100644 index 28f9c17b50..0000000000 --- a/deps/framework/routing/RouterInjector.mjs +++ /dev/null @@ -1,23 +0,0 @@ -import * as tslib_1 from "tslib"; -import { Router } from './Router'; -/** - * Creates a router instance for a specific History manager (default is `HashHistory`) and registers - * the route configuration. - * - * @param config The route config to register for the router - * @param registry An optional registry that defaults to the global registry - * @param options The router injector options - */ -export function registerRouterInjector(config, registry, options = {}) { - const { key = 'router' } = options, routerOptions = tslib_1.__rest(options, ["key"]); - if (registry.hasInjector(key)) { - throw new Error('Router has already been defined'); - } - const router = new Router(config, routerOptions); - registry.defineInjector(key, (invalidator) => { - router.on('navstart', () => invalidator()); - return () => router; - }); - return router; -} -//# sourceMappingURL=RouterInjector.mjs.map \ No newline at end of file diff --git a/deps/framework/routing/RouterInjector.mjs.map b/deps/framework/routing/RouterInjector.mjs.map deleted file mode 100644 index a808bffa0d..0000000000 --- a/deps/framework/routing/RouterInjector.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"RouterInjector.mjs","sourceRoot":"","sources":["RouterInjector.ts"],"names":[],"mappings":";AAGA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAWlC;;;;;;;GAOG;AACH,MAAM,iCACL,MAAqB,EACrB,QAAkB,EAClB,UAAiC,EAAE;IAEnC,MAAM,EAAE,GAAG,GAAG,QAAQ,KAAuB,OAAO,EAA5B,gDAA4B,CAAC;IAErD,EAAE,CAAC,CAAC,QAAQ,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;QAC/B,MAAM,IAAI,KAAK,CAAC,iCAAiC,CAAC,CAAC;IACpD,CAAC;IACD,MAAM,MAAM,GAAG,IAAI,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC;IACjD,QAAQ,CAAC,cAAc,CAAC,GAAG,EAAE,CAAC,WAAuB,EAAE,EAAE;QACxD,MAAM,CAAC,EAAE,CAAC,UAAU,EAAE,GAAG,EAAE,CAAC,WAAW,EAAE,CAAC,CAAC;QAC3C,MAAM,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC;IACrB,CAAC,CAAC,CAAC;IACH,MAAM,CAAC,MAAM,CAAC;AACf,CAAC","sourcesContent":["import { Registry } from '../widget-core/Registry';\nimport { RegistryLabel } from '../widget-core/interfaces';\n\nimport { Router } from './Router';\nimport { RouteConfig, RouterOptions } from './interfaces';\n\n/**\n * Router Injector Options\n *\n */\nexport interface RouterInjectorOptions extends RouterOptions {\n\tkey?: RegistryLabel;\n}\n\n/**\n * Creates a router instance for a specific History manager (default is `HashHistory`) and registers\n * the route configuration.\n *\n * @param config The route config to register for the router\n * @param registry An optional registry that defaults to the global registry\n * @param options The router injector options\n */\nexport function registerRouterInjector(\n\tconfig: RouteConfig[],\n\tregistry: Registry,\n\toptions: RouterInjectorOptions = {}\n): Router {\n\tconst { key = 'router', ...routerOptions } = options;\n\n\tif (registry.hasInjector(key)) {\n\t\tthrow new Error('Router has already been defined');\n\t}\n\tconst router = new Router(config, routerOptions);\n\tregistry.defineInjector(key, (invalidator: () => void) => {\n\t\trouter.on('navstart', () => invalidator());\n\t\treturn () => router;\n\t});\n\treturn router;\n}\n"]} \ No newline at end of file diff --git a/deps/framework/routing/history/HashHistory.d.ts b/deps/framework/routing/history/HashHistory.d.ts deleted file mode 100644 index abc41ce919..0000000000 --- a/deps/framework/routing/history/HashHistory.d.ts +++ /dev/null @@ -1,14 +0,0 @@ -import { History, HistoryOptions } from './../interfaces'; -export declare class HashHistory implements History { - private _onChangeFunction; - private _current; - private _window; - constructor({window, onChange}: HistoryOptions); - normalizePath(path: string): string; - prefix(path: string): string; - set(path: string): void; - readonly current: string; - destroy(): void; - private _onChange; -} -export default HashHistory; diff --git a/deps/framework/routing/history/HashHistory.js b/deps/framework/routing/history/HashHistory.js deleted file mode 100644 index c7dc8145f2..0000000000 --- a/deps/framework/routing/history/HashHistory.js +++ /dev/null @@ -1,54 +0,0 @@ -(function (factory) { - if (typeof module === "object" && typeof module.exports === "object") { - var v = factory(require, exports); - if (v !== undefined) module.exports = v; - } - else if (typeof define === "function" && define.amd) { - define(["require", "exports", "../../shim/global"], factory); - } -})(function (require, exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - var global_1 = require("../../shim/global"); - var HashHistory = /** @class */ (function () { - function HashHistory(_a) { - var _b = _a.window, window = _b === void 0 ? global_1.default.window : _b, onChange = _a.onChange; - var _this = this; - this._onChange = function () { - _this._current = _this.normalizePath(_this._window.location.hash); - _this._onChangeFunction(_this._current); - }; - this._onChangeFunction = onChange; - this._window = window; - this._window.addEventListener('hashchange', this._onChange, false); - this._current = this.normalizePath(this._window.location.hash); - this._onChangeFunction(this._current); - } - HashHistory.prototype.normalizePath = function (path) { - return path.replace('#', ''); - }; - HashHistory.prototype.prefix = function (path) { - if (path[0] !== '#') { - return "#" + path; - } - return path; - }; - HashHistory.prototype.set = function (path) { - this._window.location.hash = this.prefix(path); - }; - Object.defineProperty(HashHistory.prototype, "current", { - get: function () { - return this._current; - }, - enumerable: true, - configurable: true - }); - HashHistory.prototype.destroy = function () { - this._window.removeEventListener('hashchange', this._onChange); - }; - return HashHistory; - }()); - exports.HashHistory = HashHistory; - exports.default = HashHistory; -}); -//# sourceMappingURL=HashHistory.js.map \ No newline at end of file diff --git a/deps/framework/routing/history/HashHistory.js.map b/deps/framework/routing/history/HashHistory.js.map deleted file mode 100644 index 01c73bdbc0..0000000000 --- a/deps/framework/routing/history/HashHistory.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"HashHistory.js","sourceRoot":"","sources":["HashHistory.ts"],"names":[],"mappings":";;;;;;;;;;;IAAA,4CAAuC;IAGvC;QAKC,qBAAY,EAAoD;gBAAlD,cAAsB,EAAtB,qDAAsB,EAAE,sBAAQ;YAA9C,iBAMC;YAyBO,cAAS,GAAG;gBACnB,KAAI,CAAC,QAAQ,GAAG,KAAI,CAAC,aAAa,CAAC,KAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;gBAC/D,KAAI,CAAC,iBAAiB,CAAC,KAAI,CAAC,QAAQ,CAAC,CAAC;YACvC,CAAC,CAAC;YAjCD,IAAI,CAAC,iBAAiB,GAAG,QAAQ,CAAC;YAClC,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;YACtB,IAAI,CAAC,OAAO,CAAC,gBAAgB,CAAC,YAAY,EAAE,IAAI,CAAC,SAAS,EAAE,KAAK,CAAC,CAAC;YACnE,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;YAC/D,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QACvC,CAAC;QAEM,mCAAa,GAApB,UAAqB,IAAY;YAChC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;QAC9B,CAAC;QAEM,4BAAM,GAAb,UAAc,IAAY;YACzB,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC;gBACrB,MAAM,CAAC,MAAI,IAAM,CAAC;YACnB,CAAC;YACD,MAAM,CAAC,IAAI,CAAC;QACb,CAAC;QAEM,yBAAG,GAAV,UAAW,IAAY;YACtB,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,IAAI,GAAG,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;QAChD,CAAC;QAED,sBAAW,gCAAO;iBAAlB;gBACC,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC;YACtB,CAAC;;;WAAA;QAEM,6BAAO,GAAd;YACC,IAAI,CAAC,OAAO,CAAC,mBAAmB,CAAC,YAAY,EAAE,IAAI,CAAC,SAAS,CAAC,CAAC;QAChE,CAAC;QAMF,kBAAC;IAAD,CAAC,AAxCD,IAwCC;IAxCY,kCAAW;IA0CxB,kBAAe,WAAW,CAAC","sourcesContent":["import global from '../../shim/global';\nimport { History, HistoryOptions, OnChangeFunction } from './../interfaces';\n\nexport class HashHistory implements History {\n\tprivate _onChangeFunction: OnChangeFunction;\n\tprivate _current: string;\n\tprivate _window: Window;\n\n\tconstructor({ window = global.window, onChange }: HistoryOptions) {\n\t\tthis._onChangeFunction = onChange;\n\t\tthis._window = window;\n\t\tthis._window.addEventListener('hashchange', this._onChange, false);\n\t\tthis._current = this.normalizePath(this._window.location.hash);\n\t\tthis._onChangeFunction(this._current);\n\t}\n\n\tpublic normalizePath(path: string): string {\n\t\treturn path.replace('#', '');\n\t}\n\n\tpublic prefix(path: string) {\n\t\tif (path[0] !== '#') {\n\t\t\treturn `#${path}`;\n\t\t}\n\t\treturn path;\n\t}\n\n\tpublic set(path: string) {\n\t\tthis._window.location.hash = this.prefix(path);\n\t}\n\n\tpublic get current(): string {\n\t\treturn this._current;\n\t}\n\n\tpublic destroy() {\n\t\tthis._window.removeEventListener('hashchange', this._onChange);\n\t}\n\n\tprivate _onChange = () => {\n\t\tthis._current = this.normalizePath(this._window.location.hash);\n\t\tthis._onChangeFunction(this._current);\n\t};\n}\n\nexport default HashHistory;\n"]} \ No newline at end of file diff --git a/deps/framework/routing/history/HashHistory.mjs b/deps/framework/routing/history/HashHistory.mjs deleted file mode 100644 index add88ba706..0000000000 --- a/deps/framework/routing/history/HashHistory.mjs +++ /dev/null @@ -1,34 +0,0 @@ -import global from '../../shim/global'; -export class HashHistory { - constructor({ window = global.window, onChange }) { - this._onChange = () => { - this._current = this.normalizePath(this._window.location.hash); - this._onChangeFunction(this._current); - }; - this._onChangeFunction = onChange; - this._window = window; - this._window.addEventListener('hashchange', this._onChange, false); - this._current = this.normalizePath(this._window.location.hash); - this._onChangeFunction(this._current); - } - normalizePath(path) { - return path.replace('#', ''); - } - prefix(path) { - if (path[0] !== '#') { - return `#${path}`; - } - return path; - } - set(path) { - this._window.location.hash = this.prefix(path); - } - get current() { - return this._current; - } - destroy() { - this._window.removeEventListener('hashchange', this._onChange); - } -} -export default HashHistory; -//# sourceMappingURL=HashHistory.mjs.map \ No newline at end of file diff --git a/deps/framework/routing/history/HashHistory.mjs.map b/deps/framework/routing/history/HashHistory.mjs.map deleted file mode 100644 index ffc0f5b034..0000000000 --- a/deps/framework/routing/history/HashHistory.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"HashHistory.mjs","sourceRoot":"","sources":["HashHistory.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,mBAAmB,CAAC;AAGvC,MAAM;IAKL,YAAY,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,QAAQ,EAAkB;QA+BxD,cAAS,GAAG,GAAG,EAAE;YACxB,I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global';\nimport { History, HistoryOptions, OnChangeFunction } from './../interfaces';\n\nexport class HashHistory implements History {\n\tprivate _onChangeFunction: OnChangeFunction;\n\tprivate _current: string;\n\tprivate _window: Window;\n\n\tconstructor({ window = global.window, onChange }: HistoryOptions) {\n\t\tthis._onChangeFunction = onChange;\n\t\tthis._window = window;\n\t\tthis._window.addEventListener('hashchange', this._onChange, false);\n\t\tthis._current = this.normalizePath(this._window.location.hash);\n\t\tthis._onChangeFunction(this._current);\n\t}\n\n\tpublic normalizePath(path: string): string {\n\t\treturn path.replace('#', '');\n\t}\n\n\tpublic prefix(path: string) {\n\t\tif (path[0] !== '#') {\n\t\t\treturn `#${path}`;\n\t\t}\n\t\treturn path;\n\t}\n\n\tpublic set(path: string) {\n\t\tthis._window.location.hash = this.prefix(path);\n\t}\n\n\tpublic get current(): string {\n\t\treturn this._current;\n\t}\n\n\tpublic destroy() {\n\t\tthis._window.removeEventListener('hashchange', this._onChange);\n\t}\n\n\tprivate _onChange = () => {\n\t\tthis._current = this.normalizePath(this._window.location.hash);\n\t\tthis._onChangeFunction(this._current);\n\t};\n}\n\nexport default HashHistory;\n"]} \ No newline at end of file diff --git a/deps/framework/routing/history/MemoryHistory.d.ts b/deps/framework/routing/history/MemoryHistory.d.ts deleted file mode 100644 index 08bb1a9a6c..0000000000 --- a/deps/framework/routing/history/MemoryHistory.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { History, HistoryOptions } from './../interfaces'; -export declare class MemoryHistory implements History { - private _onChangeFunction; - private _current; - constructor({onChange}: HistoryOptions); - prefix(path: string): string; - set(path: string): void; - readonly current: string; - private _onChange(); -} -export default MemoryHistory; diff --git a/deps/framework/routing/history/MemoryHistory.js b/deps/framework/routing/history/MemoryHistory.js deleted file mode 100644 index ca05b25eb7..0000000000 --- a/deps/framework/routing/history/MemoryHistory.js +++ /dev/null @@ -1,44 +0,0 @@ -(function (factory) { - if (typeof module === "object" && typeof module.exports === "object") { - var v = factory(require, exports); - if (v !== undefined) module.exports = v; - } - else if (typeof define === "function" && define.amd) { - define(["require", "exports"], factory); - } -})(function (require, exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - var MemoryHistory = /** @class */ (function () { - function MemoryHistory(_a) { - var onChange = _a.onChange; - this._current = '/'; - this._onChangeFunction = onChange; - this._onChange(); - } - MemoryHistory.prototype.prefix = function (path) { - return path; - }; - MemoryHistory.prototype.set = function (path) { - if (this._current === path) { - return; - } - this._current = path; - this._onChange(); - }; - Object.defineProperty(MemoryHistory.prototype, "current", { - get: function () { - return this._current; - }, - enumerable: true, - configurable: true - }); - MemoryHistory.prototype._onChange = function () { - this._onChangeFunction(this._current); - }; - return MemoryHistory; - }()); - exports.MemoryHistory = MemoryHistory; - exports.default = MemoryHistory; -}); -//# sourceMappingURL=MemoryHistory.js.map \ No newline at end of file diff --git a/deps/framework/routing/history/MemoryHistory.js.map b/deps/framework/routing/history/MemoryHistory.js.map deleted file mode 100644 index 2e56b4a679..0000000000 --- a/deps/framework/routing/history/MemoryHistory.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"MemoryHistory.js","sourceRoot":"","sources":["MemoryHistory.ts"],"names":[],"mappings":";;;;;;;;;;;IAEA;QAIC,uBAAY,EAA4B;gBAA1B,sBAAQ;YAFd,aAAQ,GAAG,GAAG,CAAC;YAGtB,IAAI,CAAC,iBAAiB,GAAG,QAAQ,CAAC;YAClC,IAAI,CAAC,SAAS,EAAE,CAAC;QAClB,CAAC;QAEM,8BAAM,GAAb,UAAc,IAAY;YACzB,MAAM,CAAC,IAAI,CAAC;QACb,CAAC;QAEM,2BAAG,GAAV,UAAW,IAAY;YACtB,EAAE,CAAC,CAAC,IAAI,CAAC,QAAQ,KAAK,IAAI,CAAC,CAAC,CAAC;gBAC5B,MAAM,CAAC;YACR,CAAC;YACD,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC;YACrB,IAAI,CAAC,SAAS,EAAE,CAAC;QAClB,CAAC;QAED,sBAAW,kCAAO;iBAAlB;gBACC,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC;YACtB,CAAC;;;WAAA;QAEO,iCAAS,GAAjB;YACC,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QACvC,CAAC;QACF,oBAAC;IAAD,CAAC,AA5BD,IA4BC;IA5BY,sCAAa;IA8B1B,kBAAe,aAAa,CAAC","sourcesContent":["import { History, HistoryOptions, OnChangeFunction } from './../interfaces';\n\nexport class MemoryHistory implements History {\n\tprivate _onChangeFunction: OnChangeFunction;\n\tprivate _current = '/';\n\n\tconstructor({ onChange }: HistoryOptions) {\n\t\tthis._onChangeFunction = onChange;\n\t\tthis._onChange();\n\t}\n\n\tpublic prefix(path: string) {\n\t\treturn path;\n\t}\n\n\tpublic set(path: string) {\n\t\tif (this._current === path) {\n\t\t\treturn;\n\t\t}\n\t\tthis._current = path;\n\t\tthis._onChange();\n\t}\n\n\tpublic get current(): string {\n\t\treturn this._current;\n\t}\n\n\tprivate _onChange() {\n\t\tthis._onChangeFunction(this._current);\n\t}\n}\n\nexport default MemoryHistory;\n"]} \ No newline at end of file diff --git a/deps/framework/routing/history/MemoryHistory.mjs b/deps/framework/routing/history/MemoryHistory.mjs deleted file mode 100644 index 74e413c156..0000000000 --- a/deps/framework/routing/history/MemoryHistory.mjs +++ /dev/null @@ -1,25 +0,0 @@ -export class MemoryHistory { - constructor({ onChange }) { - this._current = '/'; - this._onChangeFunction = onChange; - this._onChange(); - } - prefix(path) { - return path; - } - set(path) { - if (this._current === path) { - return; - } - this._current = path; - this._onChange(); - } - get current() { - return this._current; - } - _onChange() { - this._onChangeFunction(this._current); - } -} -export default MemoryHistory; -//# sourceMappingURL=MemoryHistory.mjs.map \ No newline at end of file diff --git a/deps/framework/routing/history/MemoryHistory.mjs.map b/deps/framework/routing/history/MemoryHistory.mjs.map deleted file mode 100644 index 9c1225e92b..0000000000 --- a/deps/framework/routing/history/MemoryHistory.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"MemoryHistory.mjs","sourceRoot":"","sources":["MemoryHistory.ts"],"names":[],"mappings":"AAEA,MAAM;IAIL,YAAY,EAAE,QAAQ,EAAkB;QAFhC,aAAQ,GAAG,GAAG,CAAC;QAGtB,IAAI,CAAC,iBAAiB,GAAG,QAAQ,CAAC;QAClC,IAAI,CAAC,SAAS,EAAE,CAAC;IAClB,CAAC;IAEM,MAAM,CAAC,IAAY;QACzB,MAAM,CAAC,IAAI,CAAC;IACb,CAAC;IAEM,GAAG,CAAC,IAAY;QACtB,EAAE,CAAC,CAAC,IAAI,CAAC,QAAQ,KAAK,IAAI,CAAC,CAAC,CAAC;YAC5B,MAAM,CAAC;QACR,CAAC;QACD,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC;QACrB,IAAI,CAAC,SAAS,EAAE,CAAC;IAClB,CAAC;IAED,IAAW,OAAO;QACjB,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC;IACtB,CAAC;IAEO,SAAS;QAChB,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IACvC,CAAC;CACD;AAED,eAAe,aAAa,CAAC","sourcesContent":["import { History, HistoryOptions, OnChangeFunction } from './../interfaces';\n\nexport class MemoryHistory implements History {\n\tprivate _onChangeFunction: OnChangeFunction;\n\tprivate _current = '/';\n\n\tconstructor({ onChange }: HistoryOptions) {\n\t\tthis._onChangeFunction = onChange;\n\t\tthis._onChange();\n\t}\n\n\tpublic prefix(path: string) {\n\t\treturn path;\n\t}\n\n\tpublic set(path: string) {\n\t\tif (this._current === path) {\n\t\t\treturn;\n\t\t}\n\t\tthis._current = path;\n\t\tthis._onChange();\n\t}\n\n\tpublic get current(): string {\n\t\treturn this._current;\n\t}\n\n\tprivate _onChange() {\n\t\tthis._onChangeFunction(this._current);\n\t}\n}\n\nexport default MemoryHistory;\n"]} \ No newline at end of file diff --git a/deps/framework/routing/history/StateHistory.d.ts b/deps/framework/routing/history/StateHistory.d.ts deleted file mode 100644 index b29e9e0ffa..0000000000 --- a/deps/framework/routing/history/StateHistory.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { History as HistoryInterface, HistoryOptions } from './../interfaces'; -export declare class StateHistory implements HistoryInterface { - private _current; - private _onChangeFunction; - private _window; - private _base; - constructor({onChange, window, base}: HistoryOptions); - prefix(path: string): string; - set(path: string): void; - readonly current: string; - private _onChange; -} -export default StateHistory; diff --git a/deps/framework/routing/history/StateHistory.js b/deps/framework/routing/history/StateHistory.js deleted file mode 100644 index 73cf4493db..0000000000 --- a/deps/framework/routing/history/StateHistory.js +++ /dev/null @@ -1,82 +0,0 @@ -(function (factory) { - if (typeof module === "object" && typeof module.exports === "object") { - var v = factory(require, exports); - if (v !== undefined) module.exports = v; - } - else if (typeof define === "function" && define.amd) { - define(["require", "exports", "../../shim/global"], factory); - } -})(function (require, exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - var global_1 = require("../../shim/global"); - var StateHistory = /** @class */ (function () { - function StateHistory(_a) { - var onChange = _a.onChange, _b = _a.window, window = _b === void 0 ? global_1.default.window : _b, _c = _a.base, base = _c === void 0 ? '/' : _c; - var _this = this; - this._onChange = function () { - var value = stripBase(_this._base, _this._window.location.pathname + _this._window.location.search); - if (_this._current === value) { - return; - } - _this._current = value; - _this._onChangeFunction(_this._current); - }; - if (/(#|\?)/.test(base)) { - throw new TypeError("base must not contain '#' or '?'"); - } - this._onChangeFunction = onChange; - this._window = window; - this._base = base; - this._current = this._window.location.pathname + this._window.location.search; - this._window.addEventListener('popstate', this._onChange, false); - this._onChange(); - } - StateHistory.prototype.prefix = function (path) { - var baseEndsWithSlash = /\/$/.test(this._base); - var pathStartsWithSlash = /^\//.test(path); - if (baseEndsWithSlash && pathStartsWithSlash) { - return this._base + path.slice(1); - } - else if (!baseEndsWithSlash && !pathStartsWithSlash) { - return this._base + "/" + path; - } - else { - return this._base + path; - } - }; - StateHistory.prototype.set = function (path) { - var value = ensureLeadingSlash(path); - this._window.history.pushState({}, '', this.prefix(value)); - this._onChange(); - }; - Object.defineProperty(StateHistory.prototype, "current", { - get: function () { - return this._current; - }, - enumerable: true, - configurable: true - }); - return StateHistory; - }()); - exports.StateHistory = StateHistory; - function stripBase(base, path) { - if (base === '/') { - return path; - } - if (path.indexOf(base) === 0) { - return ensureLeadingSlash(path.slice(base.length)); - } - else { - return '/'; - } - } - function ensureLeadingSlash(path) { - if (path[0] !== '/') { - return "/" + path; - } - return path; - } - exports.default = StateHistory; -}); -//# sourceMappingURL=StateHistory.js.map \ No newline at end of file diff --git a/deps/framework/routing/history/StateHistory.js.map b/deps/framework/routing/history/StateHistory.js.map deleted file mode 100644 index 239656ebbd..0000000000 --- a/deps/framework/routing/history/StateHistory.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"StateHistory.js","sourceRoot":"","sources":["StateHistory.ts"],"names":[],"mappings":";;;;;;;;;;;IAAA,4CAAuC;IAGvC;QAMC,sBAAY,EAAgE;gBAA9D,sBAAQ,EAAE,cAAsB,EAAtB,qDAAsB,EAAE,YAAU,EAAV,+BAAU;YAA1D,iBAUC;YAwBO,cAAS,GAAG;gBACnB,IAAM,KAAK,GAAG,SAAS,CAAC,KAAI,CAAC,KAAK,EAAE,KAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,QAAQ,GAAG,KAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;gBACnG,EAAE,CAAC,CAAC,KAAI,CAAC,QAAQ,KAAK,KAAK,CAAC,CAAC,CAAC;oBAC7B,MAAM,CAAC;gBACR,CAAC;gBACD,KAAI,CAAC,QAAQ,GAAG,KAAK,CAAC;gBACtB,KAAI,CAAC,iBAAiB,CAAC,KAAI,CAAC,QAAQ,CAAC,CAAC;YACvC,CAAC,CAAC;YAxCD,EAAE,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;gBACzB,MAAM,IAAI,SAAS,CAAC,kCA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AAK,CAAC,CAAC,CAAC;YAC3D,IAAI,CAAC,SAAS,EAAE,CAAC;QAClB,CAAC;QAED,sBAAW,iCAAO;iBAAlB;gBACC,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC;YACtB,CAAC;;;WAAA;QAUF,mBAAC;IAAD,CAAC,AAhDD,IAgDC;IAhDY,oCAAY;IAkDzB,mBAAmB,IAAY,EAAE,IAAY;QAC5C,EAAE,CAAC,CAAC,IAAI,KAAK,GAAG,CAAC,CAAC,CAAC;YAClB,MAAM,CAAC,IAAI,CAAC;QACb,CAAC;QAED,EAAE,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;YAC9B,MAAM,CAAC,kBAAkB,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC;QACpD,CAAC;QAAC,IAAI,CAAC,CAAC;YACP,MAAM,CAAC,GAAG,CAAC;QACZ,CAAC;IACF,CAAC;IAED,4BAA4B,IAAY;QACvC,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC;YACrB,MAAM,CAAC,MAAI,IAAM,CAAC;QACnB,CAAC;QACD,MAAM,CAAC,IAAI,CAAC;IACb,CAAC;IAED,kBAAe,YAAY,CAAC","sourcesContent":["import global from '../../shim/global';\nimport { History as HistoryInterface, HistoryOptions, OnChangeFunction } from './../interfaces';\n\nexport class StateHistory implements HistoryInterface {\n\tprivate _current: string;\n\tprivate _onChangeFunction: OnChangeFunction;\n\tprivate _window: Window;\n\tprivate _base: string;\n\n\tconstructor({ onChange, window = global.window, base = '/' }: HistoryOptions) {\n\t\tif (/(#|\\?)/.test(base)) {\n\t\t\tthrow new TypeError(\"base must not contain '#' or '?'\");\n\t\t}\n\t\tthis._onChangeFunction = onChange;\n\t\tthis._window = window;\n\t\tthis._base = base;\n\t\tthis._current = this._window.location.pathname + this._window.location.search;\n\t\tthis._window.addEventListener('popstate', this._onChange, false);\n\t\tthis._onChange();\n\t}\n\n\tpublic prefix(path: string) {\n\t\tconst baseEndsWithSlash = /\\/$/.test(this._base);\n\t\tconst pathStartsWithSlash = /^\\//.test(path);\n\t\tif (baseEndsWithSlash && pathStartsWithSlash) {\n\t\t\treturn this._base + path.slice(1);\n\t\t} else if (!baseEndsWithSlash && !pathStartsWithSlash) {\n\t\t\treturn `${this._base}/${path}`;\n\t\t} else {\n\t\t\treturn this._base + path;\n\t\t}\n\t}\n\n\tpublic set(path: string) {\n\t\tconst value = ensureLeadingSlash(path);\n\t\tthis._window.history.pushState({}, '', this.prefix(value));\n\t\tthis._onChange();\n\t}\n\n\tpublic get current(): string {\n\t\treturn this._current;\n\t}\n\n\tprivate _onChange = () => {\n\t\tconst value = stripBase(this._base, this._window.location.pathname + this._window.location.search);\n\t\tif (this._current === value) {\n\t\t\treturn;\n\t\t}\n\t\tthis._current = value;\n\t\tthis._onChangeFunction(this._current);\n\t};\n}\n\nfunction stripBase(base: string, path: string): string {\n\tif (base === '/') {\n\t\treturn path;\n\t}\n\n\tif (path.indexOf(base) === 0) {\n\t\treturn ensureLeadingSlash(path.slice(base.length));\n\t} else {\n\t\treturn '/';\n\t}\n}\n\nfunction ensureLeadingSlash(path: string): string {\n\tif (path[0] !== '/') {\n\t\treturn `/${path}`;\n\t}\n\treturn path;\n}\n\nexport default StateHistory;\n"]} \ No newline at end of file diff --git a/deps/framework/routing/history/StateHistory.mjs b/deps/framework/routing/history/StateHistory.mjs deleted file mode 100644 index 8da70dac7f..0000000000 --- a/deps/framework/routing/history/StateHistory.mjs +++ /dev/null @@ -1,62 +0,0 @@ -import global from '../../shim/global'; -export class StateHistory { - constructor({ onChange, window = global.window, base = '/' }) { - this._onChange = () => { - const value = stripBase(this._base, this._window.location.pathname + this._window.location.search); - if (this._current === value) { - return; - } - this._current = value; - this._onChangeFunction(this._current); - }; - if (/(#|\?)/.test(base)) { - throw new TypeError("base must not contain '#' or '?'"); - } - this._onChangeFunction = onChange; - this._window = window; - this._base = base; - this._current = this._window.location.pathname + this._window.location.search; - this._window.addEventListener('popstate', this._onChange, false); - this._onChange(); - } - prefix(path) { - const baseEndsWithSlash = /\/$/.test(this._base); - const pathStartsWithSlash = /^\//.test(path); - if (baseEndsWithSlash && pathStartsWithSlash) { - return this._base + path.slice(1); - } - else if (!baseEndsWithSlash && !pathStartsWithSlash) { - return `${this._base}/${path}`; - } - else { - return this._base + path; - } - } - set(path) { - const value = ensureLeadingSlash(path); - this._window.history.pushState({}, '', this.prefix(value)); - this._onChange(); - } - get current() { - return this._current; - } -} -function stripBase(base, path) { - if (base === '/') { - return path; - } - if (path.indexOf(base) === 0) { - return ensureLeadingSlash(path.slice(base.length)); - } - else { - return '/'; - } -} -function ensureLeadingSlash(path) { - if (path[0] !== '/') { - return `/${path}`; - } - return path; -} -export default StateHistory; -//# sourceMappingURL=StateHistory.mjs.map \ No newline at end of file diff --git a/deps/framework/routing/history/StateHistory.mjs.map b/deps/framework/routing/history/StateHistory.mjs.map deleted file mode 100644 index 4f3b9c3253..0000000000 --- a/deps/framework/routing/history/StateHistory.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"StateHistory.mjs","sourceRoot":"","sources":["StateHistory.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,mBAAmB,CAAC;AAGvC,MAAM;IAML,YAAY,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,IAAI,GAAG,GAAG,EAAkB;QAkCpE,cAAS,GAAG,GAAG,EAAE;YACxB,MAAM,KAAK,GAAG,SAAS,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,QAAQ,GAAG,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;YACnG,EAAE,CAAC,CAAC,IAAI,CAAC,QAAQ,KAAK,KAAK,CAAC,CAAC,CAAC;gBAC7B,MAAM,CAAC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IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;QAC1B,CAAC;IACF,CAAC;IAEM,GAAG,CAAC,IAAY;QACtB,MAAM,KAAK,GAAG,kBAAkB,CAAC,IAAI,CAAC,CAAC;QACvC,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,SAAS,CAAC,EAAE,EAAE,EAAE,EAAE,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;QAC3D,IAAI,CAAC,SAAS,EAAE,CAAC;IAClB,CAAC;IAED,IAAW,OAAO;QACjB,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC;IACtB,CAAC;CAUD;AAED,mBAAmB,IAAY,EAAE,IAAY;IAC5C,EAAE,CAAC,CAAC,IAAI,KAAK,GAAG,CAAC,CAAC,CAAC;QAClB,MAAM,CAAC,IAAI,CAAC;IACb,CAAC;IAED,EAAE,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;QAC9B,MAAM,CAAC,kBAAkB,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC;IACpD,CAAC;IAAC,IAAI,CAAC,CAAC;QACP,MAAM,CAAC,GAAG,CAAC;IACZ,CAAC;AACF,CAAC;AAED,4BAA4B,IAAY;IACvC,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC;QACrB,MAAM,CAAC,IAAI,IAAI,EAAE,CAAC;IACnB,CAAC;IACD,MAAM,CAAC,IAAI,CAAC;AACb,CAAC;AAED,eAAe,YAAY,CAAC","sourcesContent":["import global from '../../shim/global';\nimport { History as HistoryInterface, HistoryOptions, OnChangeFunction } from './../interfaces';\n\nexport class StateHistory implements HistoryInterface {\n\tprivate _current: string;\n\tprivate _onChangeFunction: OnChangeFunction;\n\tprivate _window: Window;\n\tprivate _base: string;\n\n\tconstructor({ onChange, window = global.window, base = '/' }: HistoryOptions) {\n\t\tif (/(#|\\?)/.test(base)) {\n\t\t\tthrow new TypeError(\"base must not contain '#' or '?'\");\n\t\t}\n\t\tthis._onChangeFunction = onChange;\n\t\tthis._window = window;\n\t\tthis._base = base;\n\t\tthis._current = this._window.location.pathname + this._window.location.search;\n\t\tthis._window.addEventListener('popstate', this._onChange, false);\n\t\tthis._onChange();\n\t}\n\n\tpublic prefix(path: string) {\n\t\tconst baseEndsWithSlash = /\\/$/.test(this._base);\n\t\tconst pathStartsWithSlash = /^\\//.test(path);\n\t\tif (baseEndsWithSlash && pathStartsWithSlash) {\n\t\t\treturn this._base + path.slice(1);\n\t\t} else if (!baseEndsWithSlash && !pathStartsWithSlash) {\n\t\t\treturn `${this._base}/${path}`;\n\t\t} else {\n\t\t\treturn this._base + path;\n\t\t}\n\t}\n\n\tpublic set(path: string) {\n\t\tconst value = ensureLeadingSlash(path);\n\t\tthis._window.history.pushState({}, '', this.prefix(value));\n\t\tthis._onChange();\n\t}\n\n\tpublic get current(): string {\n\t\treturn this._current;\n\t}\n\n\tprivate _onChange = () => {\n\t\tconst value = stripBase(this._base, this._window.location.pathname + this._window.location.search);\n\t\tif (this._current === value) {\n\t\t\treturn;\n\t\t}\n\t\tthis._current = value;\n\t\tthis._onChangeFunction(this._current);\n\t};\n}\n\nfunction stripBase(base: string, path: string): string {\n\tif (base === '/') {\n\t\treturn path;\n\t}\n\n\tif (path.indexOf(base) === 0) {\n\t\treturn ensureLeadingSlash(path.slice(base.length));\n\t} else {\n\t\treturn '/';\n\t}\n}\n\nfunction ensureLeadingSlash(path: string): string {\n\tif (path[0] !== '/') {\n\t\treturn `/${path}`;\n\t}\n\treturn path;\n}\n\nexport default StateHistory;\n"]} \ No newline at end of file diff --git a/deps/framework/routing/interfaces.d.ts b/deps/framework/routing/interfaces.d.ts deleted file mode 100644 index faa74d70d3..0000000000 --- a/deps/framework/routing/interfaces.d.ts +++ /dev/null @@ -1,227 +0,0 @@ -import { - Constructor, - RegistryLabel, - VNodeProperties, - WidgetBaseInterface, - WidgetProperties -} from '../widget-core/interfaces'; -import { WidgetBase } from '../widget-core/WidgetBase'; - -/** - * Description of a registered route - */ -export interface Route { - path: string; - outlet: string; - params: string[]; - segments: (symbol | string)[]; - children: Route[]; - fullPath: string; - fullParams: string[]; - fullQueryParams: string[]; - defaultParams: Params; - onEnter?: OnEnter; - onExit?: OnExit; -} - -/** - * Route configuration - */ -export interface RouteConfig { - path: string; - outlet: string; - children?: RouteConfig[]; - defaultParams?: Params; - defaultRoute?: boolean; - onEnter?: OnEnter; - onExit?: OnExit; -} - -/** - * Route Params - */ -export interface Params { - [index: string]: string; -} - -/** - * Options passed to the mapParams callback - */ -export interface MapParamsOptions { - queryParams: Params; - params: Params; - type: MatchType; - router: RouterInterface; -} - -/** - * Type of outlet matches - */ -export type MatchType = 'error' | 'index' | 'partial'; - -/** - * Context stored for matched outlets - */ -export interface OutletContext { - /** - * The type of match for the outlet - */ - type: MatchType; - - /** - * The params for the specific outlet - */ - params: Params; - - /** - * The query params for the route - */ - queryParams: Params; - - /** - * On enter for the route - */ - onEnter?: OnEnter; - - /** - * On exit for the route - */ - onExit?: OnExit; -} - -/** - * Interface for Router - */ -export interface RouterInterface { - /** - * Generates a link from the outlet and the optional params - */ - link(outlet: string, params?: Params): string | undefined; - - /** - * Sets the path on the underlying history manager - */ - setPath(path: string): void; - - /** - * Returns the outlet context if matched - */ - getOutlet(outletId: string): OutletContext | undefined; - - /** - * The current params for matched routes - */ - readonly currentParams: Params; -} - -/** - * Function for mapping params to properties - */ -export interface MapParams { - (options: MapParamsOptions): any; -} - -export interface OnEnter { - (params: Params, type: MatchType): void; -} - -export interface OnExit { - (): void; -} - -/** - * Outlet options that can be configured - */ -export interface OutletOptions { - key?: RegistryLabel; - mapParams?: MapParams; -} - -/** - * Component type - */ -export type Component = Constructor | RegistryLabel; - -/** - * Outlet component options - */ -export interface OutletComponents< - W extends WidgetBaseInterface, - I extends WidgetBaseInterface, - E extends WidgetBaseInterface -> { - main?: Component; - index?: Component; - error?: Component; -} - -/** - * Type for Outlet - */ -export type Outlet< - W extends WidgetBaseInterface, - F extends WidgetBaseInterface, - E extends WidgetBaseInterface -> = Constructor< - WidgetBase & Partial & Partial & WidgetProperties, null> ->; - -/** - * Properties for the Link widget - */ -export interface LinkProperties extends VNodeProperties { - key?: string; - isOutlet?: boolean; - params?: Params; - onClick?: (event: MouseEvent) => void; - to: string; -} - -/** - * The `onChange` function signature - */ -export interface OnChangeFunction { - (path: string): void; -} - -/** - * Options for a history provider - */ -export interface HistoryOptions { - onChange: OnChangeFunction; - window?: Window; - base?: string; -} - -/** - * History Constructor - */ -export interface HistoryConstructor { - new (options: HistoryOptions): History; -} - -/** - * History interface - */ -export interface History { - /** - * Sets the path on the history manager - */ - set(path: string): void; - - /** - * Adds a prefix to the path if the history manager requires - */ - prefix(path: string): string; - - /** - * Returns the current path - */ - readonly current: string; -} - -export interface RouterOptions { - window?: Window; - base?: string; - HistoryManager?: HistoryConstructor; -} diff --git a/deps/framework/shim/Map.d.ts b/deps/framework/shim/Map.d.ts deleted file mode 100644 index 40c283e58f..0000000000 --- a/deps/framework/shim/Map.d.ts +++ /dev/null @@ -1,105 +0,0 @@ -import { Iterable, IterableIterator } from './iterator'; -import './Symbol'; -export interface Map { - /** - * Deletes all keys and their associated values. - */ - clear(): void; - /** - * Deletes a given key and its associated value. - * - * @param key The key to delete - * @return true if the key exists, false if it does not - */ - delete(key: K): boolean; - /** - * Returns an iterator that yields each key/value pair as an array. - * - * @return An iterator for each key/value pair in the instance. - */ - entries(): IterableIterator<[K, V]>; - /** - * Executes a given function for each map entry. The function - * is invoked with three arguments: the element value, the - * element key, and the associated Map instance. - * - * @param callbackfn The function to execute for each map entry, - * @param thisArg The value to use for `this` for each execution of the calback - */ - forEach(callbackfn: (value: V, key: K, map: Map) => void, thisArg?: any): void; - /** - * Returns the value associated with a given key. - * - * @param key The key to look up - * @return The value if one exists or undefined - */ - get(key: K): V | undefined; - /** - * Returns an iterator that yields each key in the map. - * - * @return An iterator containing the instance's keys. - */ - keys(): IterableIterator; - /** - * Checks for the presence of a given key. - * - * @param key The key to check for - * @return true if the key exists, false if it does not - */ - has(key: K): boolean; - /** - * Sets the value associated with a given key. - * - * @param key The key to define a value to - * @param value The value to assign - * @return The Map instance - */ - set(key: K, value: V): this; - /** - * Returns the number of key / value pairs in the Map. - */ - readonly size: number; - /** - * Returns an iterator that yields each value in the map. - * - * @return An iterator containing the instance's values. - */ - values(): IterableIterator; - /** Returns an iterable of entries in the map. */ - [Symbol.iterator](): IterableIterator<[K, V]>; - readonly [Symbol.toStringTag]: string; -} -export interface MapConstructor { - /** - * Creates a new Map - * - * @constructor - */ - new (): Map; - /** - * Creates a new Map - * - * @constructor - * - * @param iterator - * Array or iterator containing two-item tuples used to initially populate the map. - * The first item in each tuple corresponds to the key of the map entry. - * The second item corresponds to the value of the map entry. - */ - new (iterator?: [K, V][]): Map; - /** - * Creates a new Map - * - * @constructor - * - * @param iterator - * Array or iterator containing two-item tuples used to initially populate the map. - * The first item in each tuple corresponds to the key of the map entry. - * The second item corresponds to the value of the map entry. - */ - new (iterator: Iterable<[K, V]>): Map; - readonly prototype: Map; - readonly [Symbol.species]: MapConstructor; -} -export declare let Map: MapConstructor; -export default Map; diff --git a/deps/framework/shim/Map.js b/deps/framework/shim/Map.js deleted file mode 100644 index 63e25f4287..0000000000 --- a/deps/framework/shim/Map.js +++ /dev/null @@ -1,126 +0,0 @@ -(function (factory) { - if (typeof module === "object" && typeof module.exports === "object") { - var v = factory(require, exports); - if (v !== undefined) module.exports = v; - } - else if (typeof define === "function" && define.amd) { - define(["require", "exports", "tslib", "./iterator", "./global", "./object", "./support/has", "./Symbol"], factory); - } -})(function (require, exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - var tslib_1 = require("tslib"); - var iterator_1 = require("./iterator"); - var global_1 = require("./global"); - var object_1 = require("./object"); - var has_1 = require("./support/has"); - require("./Symbol"); - exports.Map = global_1.default.Map; - if (!has_1.default('es6-map')) { - exports.Map = (_a = /** @class */ (function () { - function Map(iterable) { - this._keys = []; - this._values = []; - this[Symbol.toStringTag] = 'Map'; - if (iterable) { - if (iterator_1.isArrayLike(iterable)) { - for (var i = 0; i < iterable.length; i++) { - var value = iterable[i]; - this.set(value[0], value[1]); - } - } - else { - try { - for (var iterable_1 = tslib_1.__values(iterable), iterable_1_1 = iterable_1.next(); !iterable_1_1.done; iterable_1_1 = iterable_1.next()) { - var value = iterable_1_1.value; - this.set(value[0], value[1]); - } - } - catch (e_1_1) { e_1 = { error: e_1_1 }; } - finally { - try { - if (iterable_1_1 && !iterable_1_1.done && (_a = iterable_1.return)) _a.call(iterable_1); - } - finally { if (e_1) throw e_1.error; } - } - } - } - var e_1, _a; - } - /** - * An alternative to Array.prototype.indexOf using Object.is - * to check for equality. See http://mzl.la/1zuKO2V - */ - Map.prototype._indexOfKey = function (keys, key) { - for (var i = 0, length_1 = keys.length; i < length_1; i++) { - if (object_1.is(keys[i], key)) { - return i; - } - } - return -1; - }; - Object.defineProperty(Map.prototype, "size", { - get: function () { - return this._keys.length; - }, - enumerable: true, - configurable: true - }); - Map.prototype.clear = function () { - this._keys.length = this._values.length = 0; - }; - Map.prototype.delete = function (key) { - var index = this._indexOfKey(this._keys, key); - if (index < 0) { - return false; - } - this._keys.splice(index, 1); - this._values.splice(index, 1); - return true; - }; - Map.prototype.entries = function () { - var _this = this; - var values = this._keys.map(function (key, i) { - return [key, _this._values[i]]; - }); - return new iterator_1.ShimIterator(values); - }; - Map.prototype.forEach = function (callback, context) { - var keys = this._keys; - var values = this._values; - for (var i = 0, length_2 = keys.length; i < length_2; i++) { - callback.call(context, values[i], keys[i], this); - } - }; - Map.prototype.get = function (key) { - var index = this._indexOfKey(this._keys, key); - return index < 0 ? undefined : this._values[index]; - }; - Map.prototype.has = function (key) { - return this._indexOfKey(this._keys, key) > -1; - }; - Map.prototype.keys = function () { - return new iterator_1.ShimIterator(this._keys); - }; - Map.prototype.set = function (key, value) { - var index = this._indexOfKey(this._keys, key); - index = index < 0 ? this._keys.length : index; - this._keys[index] = key; - this._values[index] = value; - return this; - }; - Map.prototype.values = function () { - return new iterator_1.ShimIterator(this._values); - }; - Map.prototype[Symbol.iterator] = function () { - return this.entries(); - }; - return Map; - }()), - _a[Symbol.species] = _a, - _a); - } - exports.default = exports.Map; - var _a; -}); -//# sourceMappingURL=Map.js.map \ No newline at end of file diff --git a/deps/framework/shim/Map.js.map b/deps/framework/shim/Map.js.map deleted file mode 100644 index e2b5616200..0000000000 --- a/deps/framework/shim/Map.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"Map.js","sourceRoot":"","sources":["Map.ts"],"names":[],"mappings":";;;;;;;;;;;;IAAA,uCAAmF;IACnF,mCAA8B;IAC9B,mCAA0C;IAC1C,qCAAgC;IAChC,oBAAkB;IAwHP,QAAA,GAAG,GAAmB,gBAAM,CAAC,GAAG,CAAC;IAE5C,EAAE,CAAC,CAAC,CAAC,aAAG,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;QACrB,WAAG;gBAmBF,aAAY,QAA+C;oBAlBxC,UAAK,GAAQ,EAAE,CAAC;oBAChB,YAAO,GAAQ,EAAE,CAAC;oBA+FrC,KAAC,MAAM,CAAC,WAAW,CAAC,GAAU,KAAK,CAAC;oBA7EnC,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC;wBACd,EAAE,CAAC,CAAC,sBAAW,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;4BAC3B,GAAG,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,QAAQ,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;gCAC1C,IAAM,KAAK,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC;gCAC1B,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;4BAC9B,CAAC;wBACF,CAAC;wBAAC,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BAAI,GAAJ;oBACC,MAAM,CAAC,IAAI,uBAAY,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;gBACrC,CAAC;gBAED,iBAAG,GAAH,UAAI,GAAM,EAAE,KAAQ;oBACnB,IAAI,KAAK,GAAG,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;oBAC9C,KAAK,GAAG,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC;oBAC9C,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,GAAG,CAAC;oBACxB,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,GAAG,KAAK,CAAC;oBAC5B,MAAM,CAAC,IAAI,CAAC;gBACb,CAAC;gBAED,oBAAM,GAAN;oBACC,MAAM,CAAC,IAAI,uBAAY,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;gBACvC,CAAC;gBAED,cAAC,MAAM,CAAC,QAAQ,CAAC,GAAjB;oBACC,MAAM,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC;gBACvB,CAAC;gBAGF,UAAC;YAAD,CAAC,AAlGK;YAiBE,GAAC,MAAM,CAAC,OAAO,CAAC,GAAG,EAAI;eAiF9B,CAAC;IACH,CAAC;IAED,kBAAe,WAAG,CAAC","sourcesContent":["import { isArrayLike, Iterable, IterableIterator, ShimIterator } from './iterator';\nimport global from './global';\nimport { is as objectIs } from './object';\nimport has from './support/has';\nimport './Symbol';\n\nexport interface Map {\n\t/**\n\t * Deletes all keys and their associated values.\n\t */\n\tclear(): void;\n\n\t/**\n\t * Deletes a given key and its associated value.\n\t *\n\t * @param key The key to delete\n\t * @return true if the key exists, false if it does not\n\t */\n\tdelete(key: K): boolean;\n\n\t/**\n\t * Returns an iterator that yields each key/value pair as an array.\n\t *\n\t * @return An iterator for each key/value pair in the instance.\n\t */\n\tentries(): IterableIterator<[K, V]>;\n\n\t/**\n\t * Executes a given function for each map entry. The function\n\t * is invoked with three arguments: the element value, the\n\t * element key, and the associated Map instance.\n\t *\n\t * @param callbackfn The function to execute for each map entry,\n\t * @param thisArg The value to use for `this` for each execution of the calback\n\t */\n\tforEach(callbackfn: (value: V, key: K, map: Map) => void, thisArg?: any): void;\n\n\t/**\n\t * Returns the value associated with a given key.\n\t *\n\t * @param key The key to look up\n\t * @return The value if one exists or undefined\n\t */\n\tget(key: K): V | undefined;\n\n\t/**\n\t * Returns an iterator that yields each key in the map.\n\t *\n\t * @return An iterator containing the instance's keys.\n\t */\n\tkeys(): IterableIterator;\n\n\t/**\n\t * Checks for the presence of a given key.\n\t *\n\t * @param key The key to check for\n\t * @return true if the key exists, false if it does not\n\t */\n\thas(key: K): boolean;\n\n\t/**\n\t * Sets the value associated with a given key.\n\t *\n\t * @param key The key to define a value to\n\t * @param value The value to assign\n\t * @return The Map instance\n\t */\n\tset(key: K, value: V): this;\n\n\t/**\n\t * Returns the number of key / value pairs in the Map.\n\t */\n\treadonly size: number;\n\n\t/**\n\t * Returns an iterator that yields each value in the map.\n\t *\n\t * @return An iterator containing the instance's values.\n\t */\n\tvalues(): IterableIterator;\n\n\t/** Returns an iterable of entries in the map. */\n\t[Symbol.iterator](): IterableIterator<[K, V]>;\n\n\treadonly [Symbol.toStringTag]: string;\n}\n\nexport interface MapConstructor {\n\t/**\n\t * Creates a new Map\n\t *\n\t * @constructor\n\t */\n\tnew (): Map;\n\n\t/**\n\t * Creates a new Map\n\t *\n\t * @constructor\n\t *\n\t * @param iterator\n\t * Array or iterator containing two-item tuples used to initially populate the map.\n\t * The first item in each tuple corresponds to the key of the map entry.\n\t * The second item corresponds to the value of the map entry.\n\t */\n\tnew (iterator?: [K, V][]): Map;\n\n\t/**\n\t * Creates a new Map\n\t *\n\t * @constructor\n\t *\n\t * @param iterator\n\t * Array or iterator containing two-item tuples used to initially populate the map.\n\t * The first item in each tuple corresponds to the key of the map entry.\n\t * The second item corresponds to the value of the map entry.\n\t */\n\tnew (iterator: Iterable<[K, V]>): Map;\n\n\treadonly prototype: Map;\n\n\treadonly [Symbol.species]: MapConstructor;\n}\n\nexport let Map: MapConstructor = global.Map;\n\nif (!has('es6-map')) {\n\tMap = class Map {\n\t\tprotected readonly _keys: K[] = [];\n\t\tprotected readonly _values: V[] = [];\n\n\t\t/**\n\t\t * An alternative to Array.prototype.indexOf using Object.is\n\t\t * to check for equality. See http://mzl.la/1zuKO2V\n\t\t */\n\t\tprotected _indexOfKey(keys: K[], key: K): number {\n\t\t\tfor (let i = 0, length = keys.length; i < length; i++) {\n\t\t\t\tif (objectIs(keys[i], key)) {\n\t\t\t\t\treturn i;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn -1;\n\t\t}\n\n\t\tstatic [Symbol.species] = Map;\n\n\t\tconstructor(iterable?: ArrayLike<[K, V]> | Iterable<[K, V]>) {\n\t\t\tif (iterable) {\n\t\t\t\tif (isArrayLike(iterable)) {\n\t\t\t\t\tfor (let i = 0; i < iterable.length; i++) {\n\t\t\t\t\t\tconst value = iterable[i];\n\t\t\t\t\t\tthis.set(value[0], value[1]);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tfor (const value of iterable) {\n\t\t\t\t\t\tthis.set(value[0], value[1]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tget size(): number {\n\t\t\treturn this._keys.length;\n\t\t}\n\n\t\tclear(): void {\n\t\t\tthis._keys.length = this._values.length = 0;\n\t\t}\n\n\t\tdelete(key: K): boolean {\n\t\t\tconst index = this._indexOfKey(this._keys, key);\n\t\t\tif (index < 0) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tthis._keys.splice(index, 1);\n\t\t\tthis._values.splice(index, 1);\n\t\t\treturn true;\n\t\t}\n\n\t\tentries(): IterableIterator<[K, V]> {\n\t\t\tconst values = this._keys.map((key: K, i: number): [K, V] => {\n\t\t\t\treturn [key, this._values[i]];\n\t\t\t});\n\n\t\t\treturn new ShimIterator(values);\n\t\t}\n\n\t\tforEach(callback: (value: V, key: K, mapInstance: Map) => any, context?: {}) {\n\t\t\tconst keys = this._keys;\n\t\t\tconst values = this._values;\n\t\t\tfor (let i = 0, length = keys.length; i < length; i++) {\n\t\t\t\tcallback.call(context, values[i], keys[i], this);\n\t\t\t}\n\t\t}\n\n\t\tget(key: K): V | undefined {\n\t\t\tconst index = this._indexOfKey(this._keys, key);\n\t\t\treturn index < 0 ? undefined : this._values[index];\n\t\t}\n\n\t\thas(key: K): boolean {\n\t\t\treturn this._indexOfKey(this._keys, key) > -1;\n\t\t}\n\n\t\tkeys(): IterableIterator {\n\t\t\treturn new ShimIterator(this._keys);\n\t\t}\n\n\t\tset(key: K, value: V): Map {\n\t\t\tlet index = this._indexOfKey(this._keys, key);\n\t\t\tindex = index < 0 ? this._keys.length : index;\n\t\t\tthis._keys[index] = key;\n\t\t\tthis._values[index] = value;\n\t\t\treturn this;\n\t\t}\n\n\t\tvalues(): IterableIterator {\n\t\t\treturn new ShimIterator(this._values);\n\t\t}\n\n\t\t[Symbol.iterator](): IterableIterator<[K, V]> {\n\t\t\treturn this.entries();\n\t\t}\n\n\t\t[Symbol.toStringTag]: 'Map' = 'Map';\n\t};\n}\n\nexport default Map;\n"]} \ No newline at end of file diff --git a/deps/framework/shim/Map.mjs b/deps/framework/shim/Map.mjs deleted file mode 100644 index ba8c3d73e0..0000000000 --- a/deps/framework/shim/Map.mjs +++ /dev/null @@ -1,96 +0,0 @@ -import { isArrayLike, ShimIterator } from './iterator'; -import global from './global'; -import { is as objectIs } from './object'; -import has from './support/has'; -import './Symbol'; -export let Map = global.Map; -if (!has('es6-map')) { - Map = (_a = class Map { - constructor(iterable) { - this._keys = []; - this._values = []; - this[Symbol.toStringTag] = 'Map'; - if (iterable) { - if (isArrayLike(iterable)) { - for (let i = 0; i < iterable.length; i++) { - const value = iterable[i]; - this.set(value[0], value[1]); - } - } - else { - for (const value of iterable) { - this.set(value[0], value[1]); - } - } - } - } - /** - * An alternative to Array.prototype.indexOf using Object.is - * to check for equality. See http://mzl.la/1zuKO2V - */ - _indexOfKey(keys, key) { - for (let i = 0, length = keys.length; i < length; i++) { - if (objectIs(keys[i], key)) { - return i; - } - } - return -1; - } - get size() { - return this._keys.length; - } - clear() { - this._keys.length = this._values.length = 0; - } - delete(key) { - const index = this._indexOfKey(this._keys, key); - if (index < 0) { - return false; - } - this._keys.splice(index, 1); - this._values.splice(index, 1); - return true; - } - entries() { - const values = this._keys.map((key, i) => { - return [key, this._values[i]]; - }); - return new ShimIterator(values); - } - forEach(callback, context) { - const keys = this._keys; - const values = this._values; - for (let i = 0, length = keys.length; i < length; i++) { - callback.call(context, values[i], keys[i], this); - } - } - get(key) { - const index = this._indexOfKey(this._keys, key); - return index < 0 ? undefined : this._values[index]; - } - has(key) { - return this._indexOfKey(this._keys, key) > -1; - } - keys() { - return new ShimIterator(this._keys); - } - set(key, value) { - let index = this._indexOfKey(this._keys, key); - index = index < 0 ? this._keys.length : index; - this._keys[index] = key; - this._values[index] = value; - return this; - } - values() { - return new ShimIterator(this._values); - } - [Symbol.iterator]() { - return this.entries(); - } - }, - _a[Symbol.species] = _a, - _a); -} -export default Map; -var _a; -//# sourceMappingURL=Map.mjs.map \ No newline at end of file diff --git a/deps/framework/shim/Map.mjs.map b/deps/framework/shim/Map.mjs.map deleted file mode 100644 index c38c131763..0000000000 --- a/deps/framework/shim/Map.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"Map.mjs","sourceRoot":"","sources":["Map.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAA8B,YAAY,EAAE,MAAM,YAAY,CAAC;AACnF,OAAO,MAAM,MAAM,UAAU,CAAC;AAC9B,OAAO,EAAE,EAAE,IAAI,QAAQ,EAAE,MAAM,UAAU,CAAC;AAC1C,OAAO,GAAG,MAAM,eAAe,CAAC;AAChC,OAAO,UAAU,CAAC;AAwHlB,MAAM,CAAC,IAAI,GAAG,GAAm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;YACvB,CAAC;SAGD;QAjFO,GAAC,MAAM,CAAC,OAAO,CAAC,GAAG,EAAI;WAiF9B,CAAC;AACH,CAAC;AAED,eAAe,GAAG,CAAC","sourcesContent":["import { isArrayLike, Iterable, IterableIterator, ShimIterator } from './iterator';\nimport global from './global';\nimport { is as objectIs } from './object';\nimport has from './support/has';\nimport './Symbol';\n\nexport interface Map {\n\t/**\n\t * Deletes all keys and their associated values.\n\t */\n\tclear(): void;\n\n\t/**\n\t * Deletes a given key and its associated value.\n\t *\n\t * @param key The key to delete\n\t * @return true if the key exists, false if it does not\n\t */\n\tdelete(key: K): boolean;\n\n\t/**\n\t * Returns an iterator that yields each key/value pair as an array.\n\t *\n\t * @return An iterator for each key/value pair in the instance.\n\t */\n\tentries(): IterableIterator<[K, V]>;\n\n\t/**\n\t * Executes a given function for each map entry. The function\n\t * is invoked with three arguments: the element value, the\n\t * element key, and the associated Map instance.\n\t *\n\t * @param callbackfn The function to execute for each map entry,\n\t * @param thisArg The value to use for `this` for each execution of the calback\n\t */\n\tforEach(callbackfn: (value: V, key: K, map: Map) => void, thisArg?: any): void;\n\n\t/**\n\t * Returns the value associated with a given key.\n\t *\n\t * @param key The key to look up\n\t * @return The value if one exists or undefined\n\t */\n\tget(key: K): V | undefined;\n\n\t/**\n\t * Returns an iterator that yields each key in the map.\n\t *\n\t * @return An iterator containing the instance's keys.\n\t */\n\tkeys(): IterableIterator;\n\n\t/**\n\t * Checks for the presence of a given key.\n\t *\n\t * @param key The key to check for\n\t * @return true if the key exists, false if it does not\n\t */\n\thas(key: K): boolean;\n\n\t/**\n\t * Sets the value associated with a given key.\n\t *\n\t * @param key The key to define a value to\n\t * @param value The value to assign\n\t * @return The Map instance\n\t */\n\tset(key: K, value: V): this;\n\n\t/**\n\t * Returns the number of key / value pairs in the Map.\n\t */\n\treadonly size: number;\n\n\t/**\n\t * Returns an iterator that yields each value in the map.\n\t *\n\t * @return An iterator containing the instance's values.\n\t */\n\tvalues(): IterableIterator;\n\n\t/** Returns an iterable of entries in the map. */\n\t[Symbol.iterator](): IterableIterator<[K, V]>;\n\n\treadonly [Symbol.toStringTag]: string;\n}\n\nexport interface MapConstructor {\n\t/**\n\t * Creates a new Map\n\t *\n\t * @constructor\n\t */\n\tnew (): Map;\n\n\t/**\n\t * Creates a new Map\n\t *\n\t * @constructor\n\t *\n\t * @param iterator\n\t * Array or iterator containing two-item tuples used to initially populate the map.\n\t * The first item in each tuple corresponds to the key of the map entry.\n\t * The second item corresponds to the value of the map entry.\n\t */\n\tnew (iterator?: [K, V][]): Map;\n\n\t/**\n\t * Creates a new Map\n\t *\n\t * @constructor\n\t *\n\t * @param iterator\n\t * Array or iterator containing two-item tuples used to initially populate the map.\n\t * The first item in each tuple corresponds to the key of the map entry.\n\t * The second item corresponds to the value of the map entry.\n\t */\n\tnew (iterator: Iterable<[K, V]>): Map;\n\n\treadonly prototype: Map;\n\n\treadonly [Symbol.species]: MapConstructor;\n}\n\nexport let Map: MapConstructor = global.Map;\n\nif (!has('es6-map')) {\n\tMap = class Map {\n\t\tprotected readonly _keys: K[] = [];\n\t\tprotected readonly _values: V[] = [];\n\n\t\t/**\n\t\t * An alternative to Array.prototype.indexOf using Object.is\n\t\t * to check for equality. See http://mzl.la/1zuKO2V\n\t\t */\n\t\tprotected _indexOfKey(keys: K[], key: K): number {\n\t\t\tfor (let i = 0, length = keys.length; i < length; i++) {\n\t\t\t\tif (objectIs(keys[i], key)) {\n\t\t\t\t\treturn i;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn -1;\n\t\t}\n\n\t\tstatic [Symbol.species] = Map;\n\n\t\tconstructor(iterable?: ArrayLike<[K, V]> | Iterable<[K, V]>) {\n\t\t\tif (iterable) {\n\t\t\t\tif (isArrayLike(iterable)) {\n\t\t\t\t\tfor (let i = 0; i < iterable.length; i++) {\n\t\t\t\t\t\tconst value = iterable[i];\n\t\t\t\t\t\tthis.set(value[0], value[1]);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tfor (const value of iterable) {\n\t\t\t\t\t\tthis.set(value[0], value[1]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tget size(): number {\n\t\t\treturn this._keys.length;\n\t\t}\n\n\t\tclear(): void {\n\t\t\tthis._keys.length = this._values.length = 0;\n\t\t}\n\n\t\tdelete(key: K): boolean {\n\t\t\tconst index = this._indexOfKey(this._keys, key);\n\t\t\tif (index < 0) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tthis._keys.splice(index, 1);\n\t\t\tthis._values.splice(index, 1);\n\t\t\treturn true;\n\t\t}\n\n\t\tentries(): IterableIterator<[K, V]> {\n\t\t\tconst values = this._keys.map((key: K, i: number): [K, V] => {\n\t\t\t\treturn [key, this._values[i]];\n\t\t\t});\n\n\t\t\treturn new ShimIterator(values);\n\t\t}\n\n\t\tforEach(callback: (value: V, key: K, mapInstance: Map) => any, context?: {}) {\n\t\t\tconst keys = this._keys;\n\t\t\tconst values = this._values;\n\t\t\tfor (let i = 0, length = keys.length; i < length; i++) {\n\t\t\t\tcallback.call(context, values[i], keys[i], this);\n\t\t\t}\n\t\t}\n\n\t\tget(key: K): V | undefined {\n\t\t\tconst index = this._indexOfKey(this._keys, key);\n\t\t\treturn index < 0 ? undefined : this._values[index];\n\t\t}\n\n\t\thas(key: K): boolean {\n\t\t\treturn this._indexOfKey(this._keys, key) > -1;\n\t\t}\n\n\t\tkeys(): IterableIterator {\n\t\t\treturn new ShimIterator(this._keys);\n\t\t}\n\n\t\tset(key: K, value: V): Map {\n\t\t\tlet index = this._indexOfKey(this._keys, key);\n\t\t\tindex = index < 0 ? this._keys.length : index;\n\t\t\tthis._keys[index] = key;\n\t\t\tthis._values[index] = value;\n\t\t\treturn this;\n\t\t}\n\n\t\tvalues(): IterableIterator {\n\t\t\treturn new ShimIterator(this._values);\n\t\t}\n\n\t\t[Symbol.iterator](): IterableIterator<[K, V]> {\n\t\t\treturn this.entries();\n\t\t}\n\n\t\t[Symbol.toStringTag]: 'Map' = 'Map';\n\t};\n}\n\nexport default Map;\n"]} \ No newline at end of file diff --git a/deps/framework/shim/Observable.d.ts b/deps/framework/shim/Observable.d.ts deleted file mode 100644 index 8e8747a0e0..0000000000 --- a/deps/framework/shim/Observable.d.ts +++ /dev/null @@ -1,155 +0,0 @@ -import { Iterable } from './iterator'; -import './Symbol'; -export interface Observable extends ObservableObject { - /** - * Registers handlers for handling emitted values, error and completions from the observable, and - * executes the observable's subscriber function, which will take action to set up the underlying data stream. - * - * @param observer The observer object that will handle events - * - * @return A Subscription object that can be used to manage the subscription. - */ - subscribe(observer: Observer): Subscription; - /** - * Registers handlers for handling emitted values, error and completions from the observable, and - * executes the observable's subscriber function, which will take action to set up the underlying data stream. - * - * @param onNext A function to handle an emitted value. Value is passed in as the first parameter to the function. - * @param onError A function to handle errors that occur during onNext, or during subscription. - * @param onComplete A function that gets called when the subscription is complete, and will not send any more values. This function will also get called if an error occurs and onError is not defined. - * - * @return {Subscription} A Subscription object that can be used to manage the subscription. - */ - subscribe(onNext: (value: T) => any, onError?: (error: any) => any, onComplete?: (completeValue?: any) => void): Subscription; - [Symbol.observable](): this; -} -export interface ObservableConstructor { - /** - * Create a new observerable with a subscriber function. The subscriber function will get called with a - * SubscriptionObserver parameter for controlling the subscription. I a function is returned, it will be - * run when the subscription is complete. - * - * @param subscriber The subscription function to be called when observers are subscribed - * - * @example - * ```ts - * const source = new Observer((observer) => { - * observer.next(1); - * observer.next(2); - * observer.next(3); - * }); - * ```ts - */ - new (subscriber: Subscriber): Observable; - /** - * Create an Observable from another object. If the object is in itself Observable, the object will be returned. - * Otherwise, the value will be wrapped in an Observable. If the object is iterable, an Observable will be created - * that emits each item of the iterable. - * - * @param item The item to be turned into an Observable - * @return An observable for the item you passed in - */ - from(item: Iterable | ArrayLike | ObservableObject): Observable; - /** - * Create an Observable from a list of values. - * - * @param items The values to be emitted - * @return An Observable that will emit the specified values - * - * @example - * ```ts - * let source = Observable.of(1, 2, 3); - * // will emit three separate values, 1, 2, and 3. - * ``` - */ - of(...items: T[]): Observable; -} -/** - * An object that implements a Symbol.observerable method. - */ -export interface ObservableObject { - [Symbol.observable]: () => any; -} -/** - * Handles events emitted from the subscription - */ -export interface Observer { - /** - * Called to handle a single emitted event. - * - * @param value The value that was emitted. - */ - next?(value: T): any; - /** - * An optional method to be called when the subscription starts (before any events are emitted). - * @param observer - */ - start?(observer: Subscription): void; - /** - * An optional method to be called if an error occurs during subscription or handling. - * - * @param errorValue The error - */ - error?(errorValue: any): any; - /** - * An optional method to be called when the subscription is completed (unless an error occurred and the error method was specified) - * - * @param completeValue The value passed to the completion method. - */ - complete?(completeValue?: any): void; -} -/** - * Describes an object that can be subscribed to - */ -export interface Subscribable { - subscribe(observer: Observer): Subscription; - subscribe(onNext: (value: T) => any, onError?: (error: any) => any, onComplete?: (completeValue?: any) => void): Subscription; -} -export interface Subscriber { - (observer: SubscriptionObserver): (() => void) | void | { - unsubscribe: () => void; - }; -} -/** - * Handles an individual subscription to an Observable. - */ -export interface Subscription { - /** - * Whether or not the subscription is closed. Closed subscriptions will not emit values. - */ - closed: boolean; - /** - * A function to call to close the subscription. Calling this will call any associated tear down methods. - */ - unsubscribe: (() => void); -} -/** - * An object used to control a single subscription and an observer. - */ -export interface SubscriptionObserver { - /** - * Whether or not the subscription is closed. - */ - readonly closed: boolean; - /** - * Emit an event to the observer. - * - * @param value The value to be emitted. - */ - next(value: T): any; - /** - * Report an error. The subscription will be closed after an error has occurred. - * - * @param errorValue The error to be reported. - */ - error(errorValue: any): any; - /** - * Report completion of the subscription. The subscription will be closed, and no new values will be emitted, - * after completion. - * - * @param completeValue A value to pass to the completion handler. - */ - complete(completeValue?: any): void; -} -export declare let Observable: ObservableConstructor; -export default Observable; diff --git a/deps/framework/shim/Observable.js b/deps/framework/shim/Observable.js deleted file mode 100644 index 64566dbda8..0000000000 --- a/deps/framework/shim/Observable.js +++ /dev/null @@ -1,348 +0,0 @@ -(function (factory) { - if (typeof module === "object" && typeof module.exports === "object") { - var v = factory(require, exports); - if (v !== undefined) module.exports = v; - } - else if (typeof define === "function" && define.amd) { - define(["require", "exports", "tslib", "./global", "./iterator", "./support/has", "./Symbol"], factory); - } -})(function (require, exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - var tslib_1 = require("tslib"); - var global_1 = require("./global"); - var iterator_1 = require("./iterator"); - var has_1 = require("./support/has"); - require("./Symbol"); - exports.Observable = global_1.default.Observable; - if (!has_1.default('es-observable')) { - /* - * Create a subscription observer for a given observer, and return the subscription. The "logic" for Observerables - * is in here! - */ - var startSubscription_1 = function startSubscription(executor, observer) { - var closed = false; - var cleanUp; - function unsubscribe() { - if (!closed) { - closed = true; - if (cleanUp) { - cleanUp(); - } - } - } - function start(subscriptionObserver) { - if (observer.start) { - observer.start(subscription); - } - if (closed) { - return; - } - try { - var result = executor(subscriptionObserver); - if (typeof result === 'function') { - cleanUp = result; - } - else if (result && 'unsubscribe' in result) { - cleanUp = result.unsubscribe; - } - else if (result !== undefined && result !== null) { - throw new TypeError('Subscriber must return a callable or subscription'); - } - if (closed) { - if (cleanUp) { - cleanUp(); - } - } - } - catch (e) { - error(e); - } - } - function next(value) { - if (closed) { - return; - } - var next = observer.next; - try { - if (typeof next === 'function') { - return next(value); - } - else if (next !== undefined && next !== null) { - throw new TypeError('Observer.next is not a function'); - } - } - catch (e) { - error(e); - } - } - function error(errorValue) { - if (!closed) { - var cleanUpError = undefined; - try { - unsubscribe(); - } - catch (e) { - cleanUpError = e; - } - var observerError = observer.error; - if (observerError !== undefined && observerError !== null) { - if (typeof observerError === 'function') { - var errorResult = observerError(errorValue); - if (cleanUpError !== undefined) { - throw cleanUpError; - } - return errorResult; - } - else { - throw new TypeError('Observer.error is not a function'); - } - } - else if (observer.complete) { - return observer.complete(errorValue); - } - else { - throw errorValue; - } - } - else { - throw errorValue; - } - } - function complete(completeValue) { - if (!closed) { - var cleanUpError = undefined; - try { - unsubscribe(); - } - catch (e) { - cleanUpError = e; - } - var observerComplete = observer.complete; - if (observerComplete !== undefined && observerComplete !== null) { - if (typeof observerComplete === 'function') { - var completeResult = observerComplete(completeValue); - if (cleanUpError !== undefined) { - throw cleanUpError; - } - return completeResult; - } - else { - throw new TypeError('Observer.complete is not a function'); - } - } - else if (cleanUpError) { - throw cleanUpError; - } - } - } - var subscription = Object.create(Object.create({}, { - closed: { - enumerable: false, - configurable: true, - get: function () { - return closed; - } - }, - unsubscribe: { - enumerable: false, - configurable: true, - writable: true, - value: unsubscribe - } - })); - var prototype = Object.create({}, { - next: { - enumerable: false, - writable: true, - value: next, - configurable: true - }, - error: { - enumerable: false, - writable: true, - value: error, - configurable: true - }, - complete: { - enumerable: false, - writable: true, - value: complete, - configurable: true - }, - closed: { - enumerable: false, - configurable: true, - get: function () { - return closed; - } - } - }); - // create the SubscriptionObserver and kick things off - start(Object.create(prototype)); - // the ONLY way to control the SubscriptionObserver is with the subscription or from a subscriber - return subscription; - }; - exports.Observable = (function () { - function nonEnumerable(target, key, descriptor) { - descriptor.enumerable = false; - } - var Observable = /** @class */ (function () { - function Observable(subscriber) { - if (typeof subscriber !== 'function') { - throw new TypeError('subscriber is not a function'); - } - this._executor = subscriber; - } - Observable.prototype[_a = Symbol.observable] = function () { - return this; - }; - Observable.prototype.subscribe = function (observerOrNext) { - var listeners = []; - for (var _i = 1; _i < arguments.length; _i++) { - listeners[_i - 1] = arguments[_i]; - } - var _a = tslib_1.__read(tslib_1.__spread(listeners), 2), onError = _a[0], onComplete = _a[1]; - if (!observerOrNext || - typeof observerOrNext === 'number' || - typeof observerOrNext === 'string' || - typeof observerOrNext === 'boolean') { - throw new TypeError('parameter must be a function or an observer'); - } - var observer; - if (typeof observerOrNext === 'function') { - observer = { - next: observerOrNext - }; - if (typeof onError === 'function') { - observer.error = onError; - } - if (typeof onComplete === 'function') { - observer.complete = onComplete; - } - } - else { - observer = observerOrNext; - } - return startSubscription_1(this._executor, observer); - }; - Observable.of = function () { - var items = []; - for (var _i = 0; _i < arguments.length; _i++) { - items[_i] = arguments[_i]; - } - var constructor; - if (typeof this !== 'function') { - constructor = Observable; - } - else { - constructor = this; - } - return new constructor(function (observer) { - try { - for (var items_1 = tslib_1.__values(items), items_1_1 = items_1.next(); !items_1_1.done; items_1_1 = items_1.next()) { - var o = items_1_1.value; - observer.next(o); - } - } - catch (e_1_1) { e_1 = { error: e_1_1 }; } - finally { - try { - if (items_1_1 && !items_1_1.done && (_a = items_1.return)) _a.call(items_1); - } - finally { if (e_1) throw e_1.error; } - } - observer.complete(); - var e_1, _a; - }); - }; - Observable.from = function (item) { - if (item === null || item === undefined) { - throw new TypeError('item cannot be null or undefined'); - } - var constructor; - if (typeof this !== 'function') { - constructor = Observable; - } - else { - constructor = this; - } - var observableSymbol = item[Symbol.observable]; - if (observableSymbol !== undefined) { - if (typeof observableSymbol !== 'function') { - throw new TypeError('Symbol.observable must be a function'); - } - var result = observableSymbol.call(item); - if (result === undefined || - result === null || - typeof result === 'number' || - typeof result === 'boolean' || - typeof result === 'string') { - throw new TypeError('Return value of Symbol.observable must be object'); - } - if ((result.constructor && result.constructor === this) || result instanceof Observable) { - return result; - } - else if (result.subscribe) { - return new constructor(result.subscribe); - } - else { - if (constructor.of) { - return constructor.of(result); - } - else { - return Observable.of(result); - } - } - } - else if (iterator_1.isIterable(item) || iterator_1.isArrayLike(item)) { - return new constructor(function (observer) { - if (iterator_1.isArrayLike(item)) { - for (var i = 0; i < item.length; i++) { - observer.next(item[i]); - } - } - else { - try { - for (var item_1 = tslib_1.__values(item), item_1_1 = item_1.next(); !item_1_1.done; item_1_1 = item_1.next()) { - var o = item_1_1.value; - observer.next(o); - } - } - catch (e_2_1) { e_2 = { error: e_2_1 }; } - finally { - try { - if (item_1_1 && !item_1_1.done && (_a = item_1.return)) _a.call(item_1); - } - finally { if (e_2) throw e_2.error; } - } - } - observer.complete(); - var e_2, _a; - }); - } - else { - throw new TypeError('Parameter is neither Observable nor Iterable'); - } - }; - tslib_1.__decorate([ - nonEnumerable - ], Observable.prototype, _a, null); - tslib_1.__decorate([ - nonEnumerable - ], Observable.prototype, "subscribe", null); - tslib_1.__decorate([ - nonEnumerable - ], Observable, "of", null); - tslib_1.__decorate([ - nonEnumerable - ], Observable, "from", null); - return Observable; - var _a; - }()); - return Observable; - })(); - } - exports.default = exports.Observable; -}); -//# sourceMappingURL=Observable.js.map \ No newline at end of file diff --git a/deps/framework/shim/Observable.js.map b/deps/framework/shim/Observable.js.map deleted file mode 100644 index 655bfc7fde..0000000000 --- a/deps/framework/shim/Observable.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"Observable.js","sourceRoot":"","sources":["Observable.ts"],"names":[],"mappings":";;;;;;;;;;;;IAAA,mCAA8B;IAC9B,uCAA+D;IAC/D,qCAAgC;IAChC,oBAAkB;IAkLP,QAAA,UAAU,GAA0B,gBAAM,CAAC,UAAU,CAAC;IAEjE,EAAE,CAAC,CAAC,CAAC,aAAG,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC;QAC3B;;;WAGG;QACH,IAAM,mBAAiB,GAAG,2BACzB,QAAuB,EACvB,QAAqB;YAErB,IAAI,MAAM,GAAG,KAAK,CAAC;YACnB,IAAI,OAA+B,CAAC;YAEpC;gBACC,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC;oBACb,MAAM,GAAG,IAAI,CAAC;oBAEd,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC;wBACb,OAAO,EAAE,CAAC;oBACX,CAAC;gBACF,CAAC;YACF,CAAC;YAED,eAAe,oBAA6C;gBAC3D,EAAE,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC;oBACpB,QAAQ,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC;gBAC9B,CAAC;gBAED,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC;oBACZ,MAAM,CAAC;gBACR,CAAC;gBAED,IAAI,CAAC;oBACJ,IAAM,MAAM,GAAQ,QAAQ,CA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BACJ,CAAC;oBAAC,IAAI,CAAC,CAAC;wBACP,MAAM,IAAI,SAAS,CAAC,8CAA8C,CAAC,CAAC;oBACrE,CAAC;gBACF,CAAC;gBA5HD;oBADC,aAAa;kDAGb;gBAWD;oBADC,aAAa;2DAgCb;gBAGD;oBADC,aAAa;0CAgBb;gBAGD;oBADC,aAAa;4CA4Db;gBACF,iBAAC;;aAAA,AAjID,IAiIC;YACD,MAAM,CAAC,UAAU,CAAC;QACnB,CAAC,CAAC,EAAE,CAAC;IACN,CAAC;IAED,kBAAe,kBAAU,CAAC","sourcesContent":["import global from './global';\nimport { isArrayLike, isIterable, Iterable } from './iterator';\nimport has from './support/has';\nimport './Symbol';\n\nexport interface Observable extends ObservableObject {\n\t/**\n\t * Registers handlers for handling emitted values, error and completions from the observable, and\n\t * executes the observable's subscriber function, which will take action to set up the underlying data stream.\n\t *\n\t * @param observer The observer object that will handle events\n\t *\n\t * @return A Subscription object that can be used to manage the subscription.\n\t */\n\tsubscribe(observer: Observer): Subscription;\n\n\t/**\n\t * Registers handlers for handling emitted values, error and completions from the observable, and\n\t * executes the observable's subscriber function, which will take action to set up the underlying data stream.\n\t *\n\t * @param onNext A function to handle an emitted value. Value is passed in as the first parameter to the function.\n\t * @param onError A function to handle errors that occur during onNext, or during subscription.\n\t * @param onComplete A function that gets called when the subscription is complete, and will not send any more values. This function will also get called if an error occurs and onError is not defined.\n\t *\n\t * @return {Subscription} A Subscription object that can be used to manage the subscription.\n\t */\n\tsubscribe(\n\t\tonNext: (value: T) => any,\n\t\tonError?: (error: any) => any,\n\t\tonComplete?: (completeValue?: any) => void\n\t): Subscription;\n\n\t[Symbol.observable](): this;\n}\n\nexport interface ObservableConstructor {\n\t/**\n\t * Create a new observerable with a subscriber function. The subscriber function will get called with a\n\t * SubscriptionObserver parameter for controlling the subscription. I a function is returned, it will be\n\t * run when the subscription is complete.\n\t *\n\t * @param subscriber The subscription function to be called when observers are subscribed\n\t *\n\t * @example\n\t * ```ts\n\t * const source = new Observer((observer) => {\n\t * observer.next(1);\n\t * observer.next(2);\n\t * observer.next(3);\n\t * });\n\t * ```ts\n\t */\n\tnew (subscriber: Subscriber): Observable;\n\n\t/**\n\t * Create an Observable from another object. If the object is in itself Observable, the object will be returned.\n\t * Otherwise, the value will be wrapped in an Observable. If the object is iterable, an Observable will be created\n\t * that emits each item of the iterable.\n\t *\n\t * @param item The item to be turned into an Observable\n\t * @return An observable for the item you passed in\n\t */\n\tfrom(item: Iterable | ArrayLike | ObservableObject): Observable;\n\n\t/**\n\t * Create an Observable from a list of values.\n\t *\n\t * @param items The values to be emitted\n\t * @return An Observable that will emit the specified values\n\t *\n\t * @example\n\t * ```ts\n\t * let source = Observable.of(1, 2, 3);\n\t * // will emit three separate values, 1, 2, and 3.\n\t * ```\n\t */\n\tof(...items: T[]): Observable;\n}\n\n/**\n * An object that implements a Symbol.observerable method.\n */\nexport interface ObservableObject {\n\t[Symbol.observable]: () => any;\n}\n\n/**\n * Handles events emitted from the subscription\n */\nexport interface Observer {\n\t/**\n\t * Called to handle a single emitted event.\n\t *\n\t * @param value The value that was emitted.\n\t */\n\tnext?(value: T): any;\n\n\t/**\n\t * An optional method to be called when the subscription starts (before any events are emitted).\n\t * @param observer\n\t */\n\tstart?(observer: Subscription): void;\n\n\t/**\n\t * An optional method to be called if an error occurs during subscription or handling.\n\t *\n\t * @param errorValue The error\n\t */\n\terror?(errorValue: any): any;\n\n\t/**\n\t * An optional method to be called when the subscription is completed (unless an error occurred and the error method was specified)\n\t *\n\t * @param completeValue The value passed to the completion method.\n\t */\n\tcomplete?(completeValue?: any): void;\n}\n\n/**\n * Describes an object that can be subscribed to\n */\nexport interface Subscribable {\n\tsubscribe(observer: Observer): Subscription;\n\tsubscribe(\n\t\tonNext: (value: T) => any,\n\t\tonError?: (error: any) => any,\n\t\tonComplete?: (completeValue?: any) => void\n\t): Subscription;\n}\n\nexport interface Subscriber {\n\t(observer: SubscriptionObserver): (() => void) | void | { unsubscribe: () => void };\n}\n\n/**\n * Handles an individual subscription to an Observable.\n */\nexport interface Subscription {\n\t/**\n\t * Whether or not the subscription is closed. Closed subscriptions will not emit values.\n\t */\n\tclosed: boolean;\n\n\t/**\n\t * A function to call to close the subscription. Calling this will call any associated tear down methods.\n\t */\n\tunsubscribe: (() => void);\n}\n\n/**\n * An object used to control a single subscription and an observer.\n */\nexport interface SubscriptionObserver {\n\t/**\n\t * Whether or not the subscription is closed.\n\t */\n\treadonly closed: boolean;\n\n\t/**\n\t * Emit an event to the observer.\n\t *\n\t * @param value The value to be emitted.\n\t */\n\tnext(value: T): any;\n\n\t/**\n\t * Report an error. The subscription will be closed after an error has occurred.\n\t *\n\t * @param errorValue The error to be reported.\n\t */\n\terror(errorValue: any): any;\n\n\t/**\n\t * Report completion of the subscription. The subscription will be closed, and no new values will be emitted,\n\t * after completion.\n\t *\n\t * @param completeValue A value to pass to the completion handler.\n\t */\n\tcomplete(completeValue?: any): void;\n}\n\nexport let Observable: ObservableConstructor = global.Observable;\n\nif (!has('es-observable')) {\n\t/*\n\t * Create a subscription observer for a given observer, and return the subscription. The \"logic\" for Observerables\n\t * is in here!\n\t */\n\tconst startSubscription = function startSubscription(\n\t\texecutor: Subscriber,\n\t\tobserver: Observer\n\t): Subscription {\n\t\tlet closed = false;\n\t\tlet cleanUp: () => void | undefined;\n\n\t\tfunction unsubscribe() {\n\t\t\tif (!closed) {\n\t\t\t\tclosed = true;\n\n\t\t\t\tif (cleanUp) {\n\t\t\t\t\tcleanUp();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tfunction start(subscriptionObserver: SubscriptionObserver) {\n\t\t\tif (observer.start) {\n\t\t\t\tobserver.start(subscription);\n\t\t\t}\n\n\t\t\tif (closed) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\ttry {\n\t\t\t\tconst result: any = executor(subscriptionObserver);\n\n\t\t\t\tif (typeof result === 'function') {\n\t\t\t\t\tcleanUp = result;\n\t\t\t\t} else if (result && 'unsubscribe' in result) {\n\t\t\t\t\tcleanUp = result.unsubscribe;\n\t\t\t\t} else if (result !== undefined && result !== null) {\n\t\t\t\t\tthrow new TypeError('Subscriber must return a callable or subscription');\n\t\t\t\t}\n\n\t\t\t\tif (closed) {\n\t\t\t\t\tif (cleanUp) {\n\t\t\t\t\t\tcleanUp();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} catch (e) {\n\t\t\t\terror(e);\n\t\t\t}\n\t\t}\n\n\t\tfunction next(value: T): any {\n\t\t\tif (closed) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst next = observer.next;\n\n\t\t\ttry {\n\t\t\t\tif (typeof next === 'function') {\n\t\t\t\t\treturn next(value);\n\t\t\t\t} else if (next !== undefined && next !== null) {\n\t\t\t\t\tthrow new TypeError('Observer.next is not a function');\n\t\t\t\t}\n\t\t\t} catch (e) {\n\t\t\t\terror(e);\n\t\t\t}\n\t\t}\n\n\t\tfunction error(errorValue?: any): any {\n\t\t\tif (!closed) {\n\t\t\t\tlet cleanUpError: Error | undefined = undefined;\n\n\t\t\t\ttry {\n\t\t\t\t\tunsubscribe();\n\t\t\t\t} catch (e) {\n\t\t\t\t\tcleanUpError = e;\n\t\t\t\t}\n\n\t\t\t\tconst observerError = observer.error;\n\n\t\t\t\tif (observerError !== undefined && observerError !== null) {\n\t\t\t\t\tif (typeof observerError === 'function') {\n\t\t\t\t\t\tconst errorResult = observerError(errorValue);\n\n\t\t\t\t\t\tif (cleanUpError !== undefined) {\n\t\t\t\t\t\t\tthrow cleanUpError;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\treturn errorResult;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthrow new TypeError('Observer.error is not a function');\n\t\t\t\t\t}\n\t\t\t\t} else if (observer.complete) {\n\t\t\t\t\treturn observer.complete(errorValue);\n\t\t\t\t} else {\n\t\t\t\t\tthrow errorValue;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tthrow errorValue;\n\t\t\t}\n\t\t}\n\n\t\tfunction complete(completeValue?: any): any {\n\t\t\tif (!closed) {\n\t\t\t\tlet cleanUpError: Error | undefined = undefined;\n\n\t\t\t\ttry {\n\t\t\t\t\tunsubscribe();\n\t\t\t\t} catch (e) {\n\t\t\t\t\tcleanUpError = e;\n\t\t\t\t}\n\n\t\t\t\tconst observerComplete = observer.complete;\n\n\t\t\t\tif (observerComplete !== undefined && observerComplete !== null) {\n\t\t\t\t\tif (typeof observerComplete === 'function') {\n\t\t\t\t\t\tconst completeResult = observerComplete(completeValue);\n\n\t\t\t\t\t\tif (cleanUpError !== undefined) {\n\t\t\t\t\t\t\tthrow cleanUpError;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\treturn completeResult;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthrow new TypeError('Observer.complete is not a function');\n\t\t\t\t\t}\n\t\t\t\t} else if (cleanUpError) {\n\t\t\t\t\tthrow cleanUpError;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tconst subscription = Object.create(\n\t\t\tObject.create(\n\t\t\t\t{},\n\t\t\t\t{\n\t\t\t\t\tclosed: {\n\t\t\t\t\t\tenumerable: false,\n\t\t\t\t\t\tconfigurable: true,\n\t\t\t\t\t\tget() {\n\t\t\t\t\t\t\treturn closed;\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\tunsubscribe: {\n\t\t\t\t\t\tenumerable: false,\n\t\t\t\t\t\tconfigurable: true,\n\t\t\t\t\t\twritable: true,\n\t\t\t\t\t\tvalue: unsubscribe\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t)\n\t\t);\n\n\t\tconst prototype = Object.create(\n\t\t\t{},\n\t\t\t{\n\t\t\t\tnext: {\n\t\t\t\t\tenumerable: false,\n\t\t\t\t\twritable: true,\n\t\t\t\t\tvalue: next,\n\t\t\t\t\tconfigurable: true\n\t\t\t\t},\n\t\t\t\terror: {\n\t\t\t\t\tenumerable: false,\n\t\t\t\t\twritable: true,\n\t\t\t\t\tvalue: error,\n\t\t\t\t\tconfigurable: true\n\t\t\t\t},\n\t\t\t\tcomplete: {\n\t\t\t\t\tenumerable: false,\n\t\t\t\t\twritable: true,\n\t\t\t\t\tvalue: complete,\n\t\t\t\t\tconfigurable: true\n\t\t\t\t},\n\t\t\t\tclosed: {\n\t\t\t\t\tenumerable: false,\n\t\t\t\t\tconfigurable: true,\n\t\t\t\t\tget() {\n\t\t\t\t\t\treturn closed;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t);\n\n\t\t// create the SubscriptionObserver and kick things off\n\t\tstart(Object.create(prototype));\n\n\t\t// the ONLY way to control the SubscriptionObserver is with the subscription or from a subscriber\n\t\treturn subscription;\n\t};\n\n\tObservable = (function() {\n\t\tfunction nonEnumerable(target: any, key: string | symbol, descriptor: PropertyDescriptor) {\n\t\t\tdescriptor.enumerable = false;\n\t\t}\n\n\t\tclass Observable {\n\t\t\tprivate _executor: Subscriber;\n\n\t\t\t@nonEnumerable\n\t\t\t[Symbol.observable](): this {\n\t\t\t\treturn this;\n\t\t\t}\n\n\t\t\tconstructor(subscriber: Subscriber) {\n\t\t\t\tif (typeof subscriber !== 'function') {\n\t\t\t\t\tthrow new TypeError('subscriber is not a function');\n\t\t\t\t}\n\n\t\t\t\tthis._executor = subscriber;\n\t\t\t}\n\n\t\t\t@nonEnumerable\n\t\t\tsubscribe(observerOrNext: any, ...listeners: any[]) {\n\t\t\t\tconst [onError, onComplete] = [...listeners];\n\n\t\t\t\tif (\n\t\t\t\t\t!observerOrNext ||\n\t\t\t\t\ttypeof observerOrNext === 'number' ||\n\t\t\t\t\ttypeof observerOrNext === 'string' ||\n\t\t\t\t\ttypeof observerOrNext === 'boolean'\n\t\t\t\t) {\n\t\t\t\t\tthrow new TypeError('parameter must be a function or an observer');\n\t\t\t\t}\n\n\t\t\t\tlet observer: Observer;\n\n\t\t\t\tif (typeof observerOrNext === 'function') {\n\t\t\t\t\tobserver = {\n\t\t\t\t\t\tnext: observerOrNext\n\t\t\t\t\t};\n\n\t\t\t\t\tif (typeof onError === 'function') {\n\t\t\t\t\t\tobserver.error = onError;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (typeof onComplete === 'function') {\n\t\t\t\t\t\tobserver.complete = onComplete;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tobserver = observerOrNext;\n\t\t\t\t}\n\n\t\t\t\treturn startSubscription(this._executor, observer);\n\t\t\t}\n\n\t\t\t@nonEnumerable\n\t\t\tstatic of(...items: U[]): Observable {\n\t\t\t\tlet constructor: typeof Observable;\n\n\t\t\t\tif (typeof this !== 'function') {\n\t\t\t\t\tconstructor = Observable;\n\t\t\t\t} else {\n\t\t\t\t\tconstructor = this;\n\t\t\t\t}\n\n\t\t\t\treturn new constructor((observer: SubscriptionObserver) => {\n\t\t\t\t\tfor (const o of items) {\n\t\t\t\t\t\tobserver.next(o);\n\t\t\t\t\t}\n\t\t\t\t\tobserver.complete();\n\t\t\t\t});\n\t\t\t}\n\n\t\t\t@nonEnumerable\n\t\t\tstatic from(item: Iterable | ArrayLike | Observable): Observable {\n\t\t\t\tif (item === null || item === undefined) {\n\t\t\t\t\tthrow new TypeError('item cannot be null or undefined');\n\t\t\t\t}\n\n\t\t\t\tlet constructor: typeof Observable;\n\n\t\t\t\tif (typeof this !== 'function') {\n\t\t\t\t\tconstructor = Observable;\n\t\t\t\t} else {\n\t\t\t\t\tconstructor = this;\n\t\t\t\t}\n\n\t\t\t\tconst observableSymbol = (item as Observable)[Symbol.observable];\n\n\t\t\t\tif (observableSymbol !== undefined) {\n\t\t\t\t\tif (typeof observableSymbol !== 'function') {\n\t\t\t\t\t\tthrow new TypeError('Symbol.observable must be a function');\n\t\t\t\t\t}\n\n\t\t\t\t\tconst result: any = observableSymbol.call(item);\n\n\t\t\t\t\tif (\n\t\t\t\t\t\tresult === undefined ||\n\t\t\t\t\t\tresult === null ||\n\t\t\t\t\t\ttypeof result === 'number' ||\n\t\t\t\t\t\ttypeof result === 'boolean' ||\n\t\t\t\t\t\ttypeof result === 'string'\n\t\t\t\t\t) {\n\t\t\t\t\t\tthrow new TypeError('Return value of Symbol.observable must be object');\n\t\t\t\t\t}\n\n\t\t\t\t\tif ((result.constructor && result.constructor === this) || result instanceof Observable) {\n\t\t\t\t\t\treturn result;\n\t\t\t\t\t} else if (result.subscribe) {\n\t\t\t\t\t\treturn new constructor(result.subscribe);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (constructor.of) {\n\t\t\t\t\t\t\treturn constructor.of(result);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\treturn Observable.of(result);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} else if (isIterable(item) || isArrayLike(item)) {\n\t\t\t\t\treturn new constructor((observer: SubscriptionObserver) => {\n\t\t\t\t\t\tif (isArrayLike(item)) {\n\t\t\t\t\t\t\tfor (let i = 0; i < item.length; i++) {\n\t\t\t\t\t\t\t\tobserver.next(item[i]);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tfor (const o of item) {\n\t\t\t\t\t\t\t\tobserver.next(o);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tobserver.complete();\n\t\t\t\t\t});\n\t\t\t\t} else {\n\t\t\t\t\tthrow new TypeError('Parameter is neither Observable nor Iterable');\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn Observable;\n\t})();\n}\n\nexport default Observable;\n"]} \ No newline at end of file diff --git a/deps/framework/shim/Observable.mjs b/deps/framework/shim/Observable.mjs deleted file mode 100644 index e3443858a3..0000000000 --- a/deps/framework/shim/Observable.mjs +++ /dev/null @@ -1,305 +0,0 @@ -import * as tslib_1 from "tslib"; -import global from './global'; -import { isArrayLike, isIterable } from './iterator'; -import has from './support/has'; -import './Symbol'; -export let Observable = global.Observable; -if (!has('es-observable')) { - /* - * Create a subscription observer for a given observer, and return the subscription. The "logic" for Observerables - * is in here! - */ - const startSubscription = function startSubscription(executor, observer) { - let closed = false; - let cleanUp; - function unsubscribe() { - if (!closed) { - closed = true; - if (cleanUp) { - cleanUp(); - } - } - } - function start(subscriptionObserver) { - if (observer.start) { - observer.start(subscription); - } - if (closed) { - return; - } - try { - const result = executor(subscriptionObserver); - if (typeof result === 'function') { - cleanUp = result; - } - else if (result && 'unsubscribe' in result) { - cleanUp = result.unsubscribe; - } - else if (result !== undefined && result !== null) { - throw new TypeError('Subscriber must return a callable or subscription'); - } - if (closed) { - if (cleanUp) { - cleanUp(); - } - } - } - catch (e) { - error(e); - } - } - function next(value) { - if (closed) { - return; - } - const next = observer.next; - try { - if (typeof next === 'function') { - return next(value); - } - else if (next !== undefined && next !== null) { - throw new TypeError('Observer.next is not a function'); - } - } - catch (e) { - error(e); - } - } - function error(errorValue) { - if (!closed) { - let cleanUpError = undefined; - try { - unsubscribe(); - } - catch (e) { - cleanUpError = e; - } - const observerError = observer.error; - if (observerError !== undefined && observerError !== null) { - if (typeof observerError === 'function') { - const errorResult = observerError(errorValue); - if (cleanUpError !== undefined) { - throw cleanUpError; - } - return errorResult; - } - else { - throw new TypeError('Observer.error is not a function'); - } - } - else if (observer.complete) { - return observer.complete(errorValue); - } - else { - throw errorValue; - } - } - else { - throw errorValue; - } - } - function complete(completeValue) { - if (!closed) { - let cleanUpError = undefined; - try { - unsubscribe(); - } - catch (e) { - cleanUpError = e; - } - const observerComplete = observer.complete; - if (observerComplete !== undefined && observerComplete !== null) { - if (typeof observerComplete === 'function') { - const completeResult = observerComplete(completeValue); - if (cleanUpError !== undefined) { - throw cleanUpError; - } - return completeResult; - } - else { - throw new TypeError('Observer.complete is not a function'); - } - } - else if (cleanUpError) { - throw cleanUpError; - } - } - } - const subscription = Object.create(Object.create({}, { - closed: { - enumerable: false, - configurable: true, - get() { - return closed; - } - }, - unsubscribe: { - enumerable: false, - configurable: true, - writable: true, - value: unsubscribe - } - })); - const prototype = Object.create({}, { - next: { - enumerable: false, - writable: true, - value: next, - configurable: true - }, - error: { - enumerable: false, - writable: true, - value: error, - configurable: true - }, - complete: { - enumerable: false, - writable: true, - value: complete, - configurable: true - }, - closed: { - enumerable: false, - configurable: true, - get() { - return closed; - } - } - }); - // create the SubscriptionObserver and kick things off - start(Object.create(prototype)); - // the ONLY way to control the SubscriptionObserver is with the subscription or from a subscriber - return subscription; - }; - Observable = (function () { - function nonEnumerable(target, key, descriptor) { - descriptor.enumerable = false; - } - class Observable { - constructor(subscriber) { - if (typeof subscriber !== 'function') { - throw new TypeError('subscriber is not a function'); - } - this._executor = subscriber; - } - [_a = Symbol.observable]() { - return this; - } - subscribe(observerOrNext, ...listeners) { - const [onError, onComplete] = [...listeners]; - if (!observerOrNext || - typeof observerOrNext === 'number' || - typeof observerOrNext === 'string' || - typeof observerOrNext === 'boolean') { - throw new TypeError('parameter must be a function or an observer'); - } - let observer; - if (typeof observerOrNext === 'function') { - observer = { - next: observerOrNext - }; - if (typeof onError === 'function') { - observer.error = onError; - } - if (typeof onComplete === 'function') { - observer.complete = onComplete; - } - } - else { - observer = observerOrNext; - } - return startSubscription(this._executor, observer); - } - static of(...items) { - let constructor; - if (typeof this !== 'function') { - constructor = Observable; - } - else { - constructor = this; - } - return new constructor((observer) => { - for (const o of items) { - observer.next(o); - } - observer.complete(); - }); - } - static from(item) { - if (item === null || item === undefined) { - throw new TypeError('item cannot be null or undefined'); - } - let constructor; - if (typeof this !== 'function') { - constructor = Observable; - } - else { - constructor = this; - } - const observableSymbol = item[Symbol.observable]; - if (observableSymbol !== undefined) { - if (typeof observableSymbol !== 'function') { - throw new TypeError('Symbol.observable must be a function'); - } - const result = observableSymbol.call(item); - if (result === undefined || - result === null || - typeof result === 'number' || - typeof result === 'boolean' || - typeof result === 'string') { - throw new TypeError('Return value of Symbol.observable must be object'); - } - if ((result.constructor && result.constructor === this) || result instanceof Observable) { - return result; - } - else if (result.subscribe) { - return new constructor(result.subscribe); - } - else { - if (constructor.of) { - return constructor.of(result); - } - else { - return Observable.of(result); - } - } - } - else if (isIterable(item) || isArrayLike(item)) { - return new constructor((observer) => { - if (isArrayLike(item)) { - for (let i = 0; i < item.length; i++) { - observer.next(item[i]); - } - } - else { - for (const o of item) { - observer.next(o); - } - } - observer.complete(); - }); - } - else { - throw new TypeError('Parameter is neither Observable nor Iterable'); - } - } - } - tslib_1.__decorate([ - nonEnumerable - ], Observable.prototype, _a, null); - tslib_1.__decorate([ - nonEnumerable - ], Observable.prototype, "subscribe", null); - tslib_1.__decorate([ - nonEnumerable - ], Observable, "of", null); - tslib_1.__decorate([ - nonEnumerable - ], Observable, "from", null); - return Observable; - var _a; - })(); -} -export default Observable; -//# sourceMappingURL=Observable.mjs.map \ No newline at end of file diff --git a/deps/framework/shim/Observable.mjs.map b/deps/framework/shim/Observable.mjs.map deleted file mode 100644 index 3fa480af30..0000000000 --- a/deps/framework/shim/Observable.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"Observable.mjs","sourceRoot":"","sources":["Observable.ts"],"names":[],"mappings":";AAAA,OAAO,MAAM,MAAM,UAAU,CAAC;AAC9B,OAAO,EAAE,WAAW,EAAE,UAAU,EAAY,MAAM,YAAY,CAAC;AAC/D,OAAO,GAAG,MAAM,eAAe,CAAC;AAChC,OAAO,UAAU,CAAC;AAkLlB,MAAM,CAAC,IAAI,UAAU,GAA0B,MAAM,CAAC,UAAU,CAAC;AAEjE,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC;IAC3B;;;OAGG;IACH,MAAM,iBAAiB,GAAG,2BACzB,QAAuB,EACvB,QAAqB;QAErB,IAAI,MAAM,GAAG,KAAK,CAAC;QACnB,IAAI,OAA+B,CAAC;QAEpC;YACC,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC;gBACb,MAAM,GAAG,IAAI,CAAC;gBAEd,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC;oBACb,OAAO,EAAE,CAAC;gBACX,CAAC;YACF,CAAC;QAC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CAAC,CAAC,CAAC,CAAC;4BAClB,CAAC;wBACF,CAAC;wBACD,QAAQ,CAAC,QAAQ,EAAE,CAAC;oBACrB,CAAC,CAAC,CAAC;gBACJ,CAAC;gBAAC,IAAI,CAAC,CAAC;oBACP,MAAM,IAAI,SAAS,CAAC,8CAA8C,CAAC,CAAC;gBACrE,CAAC;YACF,CAAC;SACD;QA7HA;YADC,aAAa;0CAGb;QAWD;YADC,aAAa;mDAgCb;QAGD;YADC,aAAa;kCAgBb;QAGD;YADC,aAAa;oCA4Db;QAEF,MAAM,CAAC,UAAU,CAAC;;IACnB,CAAC,CAAC,EAAE,CAAC;AACN,CAAC;AAED,eAAe,UAAU,CAAC","sourcesContent":["import global from './global';\nimport { isArrayLike, isIterable, Iterable } from './iterator';\nimport has from './support/has';\nimport './Symbol';\n\nexport interface Observable extends ObservableObject {\n\t/**\n\t * Registers handlers for handling emitted values, error and completions from the observable, and\n\t * executes the observable's subscriber function, which will take action to set up the underlying data stream.\n\t *\n\t * @param observer The observer object that will handle events\n\t *\n\t * @return A Subscription object that can be used to manage the subscription.\n\t */\n\tsubscribe(observer: Observer): Subscription;\n\n\t/**\n\t * Registers handlers for handling emitted values, error and completions from the observable, and\n\t * executes the observable's subscriber function, which will take action to set up the underlying data stream.\n\t *\n\t * @param onNext A function to handle an emitted value. Value is passed in as the first parameter to the function.\n\t * @param onError A function to handle errors that occur during onNext, or during subscription.\n\t * @param onComplete A function that gets called when the subscription is complete, and will not send any more values. This function will also get called if an error occurs and onError is not defined.\n\t *\n\t * @return {Subscription} A Subscription object that can be used to manage the subscription.\n\t */\n\tsubscribe(\n\t\tonNext: (value: T) => any,\n\t\tonError?: (error: any) => any,\n\t\tonComplete?: (completeValue?: any) => void\n\t): Subscription;\n\n\t[Symbol.observable](): this;\n}\n\nexport interface ObservableConstructor {\n\t/**\n\t * Create a new observerable with a subscriber function. The subscriber function will get called with a\n\t * SubscriptionObserver parameter for controlling the subscription. I a function is returned, it will be\n\t * run when the subscription is complete.\n\t *\n\t * @param subscriber The subscription function to be called when observers are subscribed\n\t *\n\t * @example\n\t * ```ts\n\t * const source = new Observer((observer) => {\n\t * observer.next(1);\n\t * observer.next(2);\n\t * observer.next(3);\n\t * });\n\t * ```ts\n\t */\n\tnew (subscriber: Subscriber): Observable;\n\n\t/**\n\t * Create an Observable from another object. If the object is in itself Observable, the object will be returned.\n\t * Otherwise, the value will be wrapped in an Observable. If the object is iterable, an Observable will be created\n\t * that emits each item of the iterable.\n\t *\n\t * @param item The item to be turned into an Observable\n\t * @return An observable for the item you passed in\n\t */\n\tfrom(item: Iterable | ArrayLike | ObservableObject): Observable;\n\n\t/**\n\t * Create an Observable from a list of values.\n\t *\n\t * @param items The values to be emitted\n\t * @return An Observable that will emit the specified values\n\t *\n\t * @example\n\t * ```ts\n\t * let source = Observable.of(1, 2, 3);\n\t * // will emit three separate values, 1, 2, and 3.\n\t * ```\n\t */\n\tof(...items: T[]): Observable;\n}\n\n/**\n * An object that implements a Symbol.observerable method.\n */\nexport interface ObservableObject {\n\t[Symbol.observable]: () => any;\n}\n\n/**\n * Handles events emitted from the subscription\n */\nexport interface Observer {\n\t/**\n\t * Called to handle a single emitted event.\n\t *\n\t * @param value The value that was emitted.\n\t */\n\tnext?(value: T): any;\n\n\t/**\n\t * An optional method to be called when the subscription starts (before any events are emitted).\n\t * @param observer\n\t */\n\tstart?(observer: Subscription): void;\n\n\t/**\n\t * An optional method to be called if an error occurs during subscription or handling.\n\t *\n\t * @param errorValue The error\n\t */\n\terror?(errorValue: any): any;\n\n\t/**\n\t * An optional method to be called when the subscription is completed (unless an error occurred and the error method was specified)\n\t *\n\t * @param completeValue The value passed to the completion method.\n\t */\n\tcomplete?(completeValue?: any): void;\n}\n\n/**\n * Describes an object that can be subscribed to\n */\nexport interface Subscribable {\n\tsubscribe(observer: Observer): Subscription;\n\tsubscribe(\n\t\tonNext: (value: T) => any,\n\t\tonError?: (error: any) => any,\n\t\tonComplete?: (completeValue?: any) => void\n\t): Subscription;\n}\n\nexport interface Subscriber {\n\t(observer: SubscriptionObserver): (() => void) | void | { unsubscribe: () => void };\n}\n\n/**\n * Handles an individual subscription to an Observable.\n */\nexport interface Subscription {\n\t/**\n\t * Whether or not the subscription is closed. Closed subscriptions will not emit values.\n\t */\n\tclosed: boolean;\n\n\t/**\n\t * A function to call to close the subscription. Calling this will call any associated tear down methods.\n\t */\n\tunsubscribe: (() => void);\n}\n\n/**\n * An object used to control a single subscription and an observer.\n */\nexport interface SubscriptionObserver {\n\t/**\n\t * Whether or not the subscription is closed.\n\t */\n\treadonly closed: boolean;\n\n\t/**\n\t * Emit an event to the observer.\n\t *\n\t * @param value The value to be emitted.\n\t */\n\tnext(value: T): any;\n\n\t/**\n\t * Report an error. The subscription will be closed after an error has occurred.\n\t *\n\t * @param errorValue The error to be reported.\n\t */\n\terror(errorValue: any): any;\n\n\t/**\n\t * Report completion of the subscription. The subscription will be closed, and no new values will be emitted,\n\t * after completion.\n\t *\n\t * @param completeValue A value to pass to the completion handler.\n\t */\n\tcomplete(completeValue?: any): void;\n}\n\nexport let Observable: ObservableConstructor = global.Observable;\n\nif (!has('es-observable')) {\n\t/*\n\t * Create a subscription observer for a given observer, and return the subscription. The \"logic\" for Observerables\n\t * is in here!\n\t */\n\tconst startSubscription = function startSubscription(\n\t\texecutor: Subscriber,\n\t\tobserver: Observer\n\t): Subscription {\n\t\tlet closed = false;\n\t\tlet cleanUp: () => void | undefined;\n\n\t\tfunction unsubscribe() {\n\t\t\tif (!closed) {\n\t\t\t\tclosed = true;\n\n\t\t\t\tif (cleanUp) {\n\t\t\t\t\tcleanUp();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tfunction start(subscriptionObserver: SubscriptionObserver) {\n\t\t\tif (observer.start) {\n\t\t\t\tobserver.start(subscription);\n\t\t\t}\n\n\t\t\tif (closed) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\ttry {\n\t\t\t\tconst result: any = executor(subscriptionObserver);\n\n\t\t\t\tif (typeof result === 'function') {\n\t\t\t\t\tcleanUp = result;\n\t\t\t\t} else if (result && 'unsubscribe' in result) {\n\t\t\t\t\tcleanUp = result.unsubscribe;\n\t\t\t\t} else if (result !== undefined && result !== null) {\n\t\t\t\t\tthrow new TypeError('Subscriber must return a callable or subscription');\n\t\t\t\t}\n\n\t\t\t\tif (closed) {\n\t\t\t\t\tif (cleanUp) {\n\t\t\t\t\t\tcleanUp();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} catch (e) {\n\t\t\t\terror(e);\n\t\t\t}\n\t\t}\n\n\t\tfunction next(value: T): any {\n\t\t\tif (closed) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst next = observer.next;\n\n\t\t\ttry {\n\t\t\t\tif (typeof next === 'function') {\n\t\t\t\t\treturn next(value);\n\t\t\t\t} else if (next !== undefined && next !== null) {\n\t\t\t\t\tthrow new TypeError('Observer.next is not a function');\n\t\t\t\t}\n\t\t\t} catch (e) {\n\t\t\t\terror(e);\n\t\t\t}\n\t\t}\n\n\t\tfunction error(errorValue?: any): any {\n\t\t\tif (!closed) {\n\t\t\t\tlet cleanUpError: Error | undefined = undefined;\n\n\t\t\t\ttry {\n\t\t\t\t\tunsubscribe();\n\t\t\t\t} catch (e) {\n\t\t\t\t\tcleanUpError = e;\n\t\t\t\t}\n\n\t\t\t\tconst observerError = observer.error;\n\n\t\t\t\tif (observerError !== undefined && observerError !== null) {\n\t\t\t\t\tif (typeof observerError === 'function') {\n\t\t\t\t\t\tconst errorResult = observerError(errorValue);\n\n\t\t\t\t\t\tif (cleanUpError !== undefined) {\n\t\t\t\t\t\t\tthrow cleanUpError;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\treturn errorResult;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthrow new TypeError('Observer.error is not a function');\n\t\t\t\t\t}\n\t\t\t\t} else if (observer.complete) {\n\t\t\t\t\treturn observer.complete(errorValue);\n\t\t\t\t} else {\n\t\t\t\t\tthrow errorValue;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tthrow errorValue;\n\t\t\t}\n\t\t}\n\n\t\tfunction complete(completeValue?: any): any {\n\t\t\tif (!closed) {\n\t\t\t\tlet cleanUpError: Error | undefined = undefined;\n\n\t\t\t\ttry {\n\t\t\t\t\tunsubscribe();\n\t\t\t\t} catch (e) {\n\t\t\t\t\tcleanUpError = e;\n\t\t\t\t}\n\n\t\t\t\tconst observerComplete = observer.complete;\n\n\t\t\t\tif (observerComplete !== undefined && observerComplete !== null) {\n\t\t\t\t\tif (typeof observerComplete === 'function') {\n\t\t\t\t\t\tconst completeResult = observerComplete(completeValue);\n\n\t\t\t\t\t\tif (cleanUpError !== undefined) {\n\t\t\t\t\t\t\tthrow cleanUpError;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\treturn completeResult;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthrow new TypeError('Observer.complete is not a function');\n\t\t\t\t\t}\n\t\t\t\t} else if (cleanUpError) {\n\t\t\t\t\tthrow cleanUpError;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tconst subscription = Object.create(\n\t\t\tObject.create(\n\t\t\t\t{},\n\t\t\t\t{\n\t\t\t\t\tclosed: {\n\t\t\t\t\t\tenumerable: false,\n\t\t\t\t\t\tconfigurable: true,\n\t\t\t\t\t\tget() {\n\t\t\t\t\t\t\treturn closed;\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\tunsubscribe: {\n\t\t\t\t\t\tenumerable: false,\n\t\t\t\t\t\tconfigurable: true,\n\t\t\t\t\t\twritable: true,\n\t\t\t\t\t\tvalue: unsubscribe\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t)\n\t\t);\n\n\t\tconst prototype = Object.create(\n\t\t\t{},\n\t\t\t{\n\t\t\t\tnext: {\n\t\t\t\t\tenumerable: false,\n\t\t\t\t\twritable: true,\n\t\t\t\t\tvalue: next,\n\t\t\t\t\tconfigurable: true\n\t\t\t\t},\n\t\t\t\terror: {\n\t\t\t\t\tenumerable: false,\n\t\t\t\t\twritable: true,\n\t\t\t\t\tvalue: error,\n\t\t\t\t\tconfigurable: true\n\t\t\t\t},\n\t\t\t\tcomplete: {\n\t\t\t\t\tenumerable: false,\n\t\t\t\t\twritable: true,\n\t\t\t\t\tvalue: complete,\n\t\t\t\t\tconfigurable: true\n\t\t\t\t},\n\t\t\t\tclosed: {\n\t\t\t\t\tenumerable: false,\n\t\t\t\t\tconfigurable: true,\n\t\t\t\t\tget() {\n\t\t\t\t\t\treturn closed;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t);\n\n\t\t// create the SubscriptionObserver and kick things off\n\t\tstart(Object.create(prototype));\n\n\t\t// the ONLY way to control the SubscriptionObserver is with the subscription or from a subscriber\n\t\treturn subscription;\n\t};\n\n\tObservable = (function() {\n\t\tfunction nonEnumerable(target: any, key: string | symbol, descriptor: PropertyDescriptor) {\n\t\t\tdescriptor.enumerable = false;\n\t\t}\n\n\t\tclass Observable {\n\t\t\tprivate _executor: Subscriber;\n\n\t\t\t@nonEnumerable\n\t\t\t[Symbol.observable](): this {\n\t\t\t\treturn this;\n\t\t\t}\n\n\t\t\tconstructor(subscriber: Subscriber) {\n\t\t\t\tif (typeof subscriber !== 'function') {\n\t\t\t\t\tthrow new TypeError('subscriber is not a function');\n\t\t\t\t}\n\n\t\t\t\tthis._executor = subscriber;\n\t\t\t}\n\n\t\t\t@nonEnumerable\n\t\t\tsubscribe(observerOrNext: any, ...listeners: any[]) {\n\t\t\t\tconst [onError, onComplete] = [...listeners];\n\n\t\t\t\tif (\n\t\t\t\t\t!observerOrNext ||\n\t\t\t\t\ttypeof observerOrNext === 'number' ||\n\t\t\t\t\ttypeof observerOrNext === 'string' ||\n\t\t\t\t\ttypeof observerOrNext === 'boolean'\n\t\t\t\t) {\n\t\t\t\t\tthrow new TypeError('parameter must be a function or an observer');\n\t\t\t\t}\n\n\t\t\t\tlet observer: Observer;\n\n\t\t\t\tif (typeof observerOrNext === 'function') {\n\t\t\t\t\tobserver = {\n\t\t\t\t\t\tnext: observerOrNext\n\t\t\t\t\t};\n\n\t\t\t\t\tif (typeof onError === 'function') {\n\t\t\t\t\t\tobserver.error = onError;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (typeof onComplete === 'function') {\n\t\t\t\t\t\tobserver.complete = onComplete;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tobserver = observerOrNext;\n\t\t\t\t}\n\n\t\t\t\treturn startSubscription(this._executor, observer);\n\t\t\t}\n\n\t\t\t@nonEnumerable\n\t\t\tstatic of(...items: U[]): Observable {\n\t\t\t\tlet constructor: typeof Observable;\n\n\t\t\t\tif (typeof this !== 'function') {\n\t\t\t\t\tconstructor = Observable;\n\t\t\t\t} else {\n\t\t\t\t\tconstructor = this;\n\t\t\t\t}\n\n\t\t\t\treturn new constructor((observer: SubscriptionObserver) => {\n\t\t\t\t\tfor (const o of items) {\n\t\t\t\t\t\tobserver.next(o);\n\t\t\t\t\t}\n\t\t\t\t\tobserver.complete();\n\t\t\t\t});\n\t\t\t}\n\n\t\t\t@nonEnumerable\n\t\t\tstatic from(item: Iterable | ArrayLike | Observable): Observable {\n\t\t\t\tif (item === null || item === undefined) {\n\t\t\t\t\tthrow new TypeError('item cannot be null or undefined');\n\t\t\t\t}\n\n\t\t\t\tlet constructor: typeof Observable;\n\n\t\t\t\tif (typeof this !== 'function') {\n\t\t\t\t\tconstructor = Observable;\n\t\t\t\t} else {\n\t\t\t\t\tconstructor = this;\n\t\t\t\t}\n\n\t\t\t\tconst observableSymbol = (item as Observable)[Symbol.observable];\n\n\t\t\t\tif (observableSymbol !== undefined) {\n\t\t\t\t\tif (typeof observableSymbol !== 'function') {\n\t\t\t\t\t\tthrow new TypeError('Symbol.observable must be a function');\n\t\t\t\t\t}\n\n\t\t\t\t\tconst result: any = observableSymbol.call(item);\n\n\t\t\t\t\tif (\n\t\t\t\t\t\tresult === undefined ||\n\t\t\t\t\t\tresult === null ||\n\t\t\t\t\t\ttypeof result === 'number' ||\n\t\t\t\t\t\ttypeof result === 'boolean' ||\n\t\t\t\t\t\ttypeof result === 'string'\n\t\t\t\t\t) {\n\t\t\t\t\t\tthrow new TypeError('Return value of Symbol.observable must be object');\n\t\t\t\t\t}\n\n\t\t\t\t\tif ((result.constructor && result.constructor === this) || result instanceof Observable) {\n\t\t\t\t\t\treturn result;\n\t\t\t\t\t} else if (result.subscribe) {\n\t\t\t\t\t\treturn new constructor(result.subscribe);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (constructor.of) {\n\t\t\t\t\t\t\treturn constructor.of(result);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\treturn Observable.of(result);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} else if (isIterable(item) || isArrayLike(item)) {\n\t\t\t\t\treturn new constructor((observer: SubscriptionObserver) => {\n\t\t\t\t\t\tif (isArrayLike(item)) {\n\t\t\t\t\t\t\tfor (let i = 0; i < item.length; i++) {\n\t\t\t\t\t\t\t\tobserver.next(item[i]);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tfor (const o of item) {\n\t\t\t\t\t\t\t\tobserver.next(o);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tobserver.complete();\n\t\t\t\t\t});\n\t\t\t\t} else {\n\t\t\t\t\tthrow new TypeError('Parameter is neither Observable nor Iterable');\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn Observable;\n\t})();\n}\n\nexport default Observable;\n"]} \ No newline at end of file diff --git a/deps/framework/shim/Promise.d.ts b/deps/framework/shim/Promise.d.ts deleted file mode 100644 index 65c63de61c..0000000000 --- a/deps/framework/shim/Promise.d.ts +++ /dev/null @@ -1,16 +0,0 @@ -import './Symbol'; -/** - * Executor is the interface for functions used to initialize a Promise. - */ -export interface Executor { - /** - * The executor for the promise - * - * @param resolve The resolver callback of the promise - * @param reject The rejector callback of the promise - */ - (resolve: (value?: T | PromiseLike) => void, reject: (reason?: any) => void): void; -} -export declare let ShimPromise: typeof Promise; -export declare const isThenable: (value: any) => value is PromiseLike; -export default ShimPromise; diff --git a/deps/framework/shim/Promise.js b/deps/framework/shim/Promise.js deleted file mode 100644 index b76ea6725e..0000000000 --- a/deps/framework/shim/Promise.js +++ /dev/null @@ -1,236 +0,0 @@ -(function (factory) { - if (typeof module === "object" && typeof module.exports === "object") { - var v = factory(require, exports); - if (v !== undefined) module.exports = v; - } - else if (typeof define === "function" && define.amd) { - define(["require", "exports", "tslib", "./global", "./support/queue", "./Symbol", "./support/has"], factory); - } -})(function (require, exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - var tslib_1 = require("tslib"); - var global_1 = require("./global"); - var queue_1 = require("./support/queue"); - require("./Symbol"); - var has_1 = require("./support/has"); - exports.ShimPromise = global_1.default.Promise; - exports.isThenable = function isThenable(value) { - return value && typeof value.then === 'function'; - }; - if (!has_1.default('es6-promise')) { - global_1.default.Promise = exports.ShimPromise = (_a = /** @class */ (function () { - /** - * Creates a new Promise. - * - * @constructor - * - * @param executor - * The executor function is called immediately when the Promise is instantiated. It is responsible for - * starting the asynchronous operation when it is invoked. - * - * The executor must call either the passed `resolve` function when the asynchronous operation has completed - * successfully, or the `reject` function when the operation fails. - */ - function Promise(executor) { - var _this = this; - /** - * The current state of this promise. - */ - this.state = 1 /* Pending */; - this[Symbol.toStringTag] = 'Promise'; - /** - * If true, the resolution of this promise is chained ("locked in") to another promise. - */ - var isChained = false; - /** - * Whether or not this promise is in a resolved state. - */ - var isResolved = function () { - return _this.state !== 1 /* Pending */ || isChained; - }; - /** - * Callbacks that should be invoked once the asynchronous operation has completed. - */ - var callbacks = []; - /** - * Initially pushes callbacks onto a queue for execution once this promise settles. After the promise settles, - * enqueues callbacks for execution on the next event loop turn. - */ - var whenFinished = function (callback) { - if (callbacks) { - callbacks.push(callback); - } - }; - /** - * Settles this promise. - * - * @param newState The resolved state for this promise. - * @param {T|any} value The resolved value for this promise. - */ - var settle = function (newState, value) { - // A promise can only be settled once. - if (_this.state !== 1 /* Pending */) { - return; - } - _this.state = newState; - _this.resolvedValue = value; - whenFinished = queue_1.queueMicroTask; - // Only enqueue a callback runner if there are callbacks so that initially fulfilled Promises don't have to - // wait an extra turn. - if (callbacks && callbacks.length > 0) { - queue_1.queueMicroTask(function () { - if (callbacks) { - var count = callbacks.length; - for (var i = 0; i < count; ++i) { - callbacks[i].call(null); - } - callbacks = null; - } - }); - } - }; - /** - * Resolves this promise. - * - * @param newState The resolved state for this promise. - * @param {T|any} value The resolved value for this promise. - */ - var resolve = function (newState, value) { - if (isResolved()) { - return; - } - if (exports.isThenable(value)) { - value.then(settle.bind(null, 0 /* Fulfilled */), settle.bind(null, 2 /* Rejected */)); - isChained = true; - } - else { - settle(newState, value); - } - }; - this.then = function (onFulfilled, onRejected) { - return new Promise(function (resolve, reject) { - // whenFinished initially queues up callbacks for execution after the promise has settled. Once the - // promise has settled, whenFinished will schedule callbacks for execution on the next turn through the - // event loop. - whenFinished(function () { - var callback = _this.state === 2 /* Rejected */ ? onRejected : onFulfilled; - if (typeof callback === 'function') { - try { - resolve(callback(_this.resolvedValue)); - } - catch (error) { - reject(error); - } - } - else if (_this.state === 2 /* Rejected */) { - reject(_this.resolvedValue); - } - else { - resolve(_this.resolvedValue); - } - }); - }); - }; - try { - executor(resolve.bind(null, 0 /* Fulfilled */), resolve.bind(null, 2 /* Rejected */)); - } - catch (error) { - settle(2 /* Rejected */, error); - } - } - Promise.all = function (iterable) { - return new this(function (resolve, reject) { - var values = []; - var complete = 0; - var total = 0; - var populating = true; - function fulfill(index, value) { - values[index] = value; - ++complete; - finish(); - } - function finish() { - if (populating || complete < total) { - return; - } - resolve(values); - } - function processItem(index, item) { - ++total; - if (exports.isThenable(item)) { - // If an item Promise rejects, this Promise is immediately rejected with the item - // Promise's rejection error. - item.then(fulfill.bind(null, index), reject); - } - else { - Promise.resolve(item).then(fulfill.bind(null, index)); - } - } - var i = 0; - try { - for (var iterable_1 = tslib_1.__values(iterable), iterable_1_1 = iterable_1.next(); !iterable_1_1.done; iterable_1_1 = iterable_1.next()) { - var value = iterable_1_1.value; - processItem(i, value); - i++; - } - } - catch (e_1_1) { e_1 = { error: e_1_1 }; } - finally { - try { - if (iterable_1_1 && !iterable_1_1.done && (_a = iterable_1.return)) _a.call(iterable_1); - } - finally { if (e_1) throw e_1.error; } - } - populating = false; - finish(); - var e_1, _a; - }); - }; - Promise.race = function (iterable) { - return new this(function (resolve, reject) { - try { - for (var iterable_2 = tslib_1.__values(iterable), iterable_2_1 = iterable_2.next(); !iterable_2_1.done; iterable_2_1 = iterable_2.next()) { - var item = iterable_2_1.value; - if (item instanceof Promise) { - // If a Promise item rejects, this Promise is immediately rejected with the item - // Promise's rejection error. - item.then(resolve, reject); - } - else { - Promise.resolve(item).then(resolve); - } - } - } - catch (e_2_1) { e_2 = { error: e_2_1 }; } - finally { - try { - if (iterable_2_1 && !iterable_2_1.done && (_a = iterable_2.return)) _a.call(iterable_2); - } - finally { if (e_2) throw e_2.error; } - } - var e_2, _a; - }); - }; - Promise.reject = function (reason) { - return new this(function (resolve, reject) { - reject(reason); - }); - }; - Promise.resolve = function (value) { - return new this(function (resolve) { - resolve(value); - }); - }; - Promise.prototype.catch = function (onRejected) { - return this.then(undefined, onRejected); - }; - return Promise; - }()), - _a[Symbol.species] = exports.ShimPromise, - _a); - } - exports.default = exports.ShimPromise; - var _a; -}); -//# sourceMappingURL=Promise.js.map \ No newline at end of file diff --git a/deps/framework/shim/Promise.js.map b/deps/framework/shim/Promise.js.map deleted file mode 100644 index 7ca7726a01..0000000000 --- a/deps/framework/shim/Promise.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"Promise.js","sourceRoot":"","sources":["Promise.ts"],"names":[],"mappings":";;;;;;;;;;;;IACA,mCAA8B;IAC9B,yCAAiD;IAEjD,oBAAkB;IAClB,qCAAgC;IAerB,QAA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IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;gCAC5B,CAAC;gCAAC,IAAI,CAAC,CAAC;oCACP,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;gCACrC,CAAC;6BACD;;;;;;;;;;oBACF,CAAC,CAAC,CAAC;gBACJ,CAAC;gBAEM,cAAM,GAAb,UAAc,MAAY;oBACzB,MAAM,CAAC,IAAI,IAAI,CAAC,UAAS,OAAO,EAAE,MAAM;wBACvC,MAAM,CAAC,MAAM,CAAC,CAAC;oBAChB,CAAC,CAAC,CAAC;gBACJ,CAAC;gBAIM,eAAO,GAAd,UAAkB,KAAW;oBAC5B,MAAM,CAAC,IAAI,IAAI,CAAC,UAAS,OAAO;wBAC/B,OAAO,CAAI,KAAK,CAAC,CAAC;oBACnB,CAAC,CAAC,CAAC;gBACJ,CAAC;gBAgID,uBAAK,GAAL,UACC,UAAiF;oBAEjF,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,UAAU,CAAC,CAAC;gBACzC,CAAC;gBAoBF,cAAC;YAAD,CAAC,AA7N8B;YAuEvB,GAAC,MAAM,CAAC,OAAO,CAAC,GAAuB,mBAAkC;eAsJhF,CAAC;IACH,CAAC;IAED,kBAAe,mBAAW,CAAC","sourcesContent":["import { Thenable } from './interfaces';\nimport global from './global';\nimport { queueMicroTask } from './support/queue';\nimport { Iterable } from './iterator';\nimport './Symbol';\nimport has from './support/has';\n\n/**\n * Executor is the interface for functions used to initialize a Promise.\n */\nexport interface Executor {\n\t/**\n\t * The executor for the promise\n\t *\n\t * @param resolve The resolver callback of the promise\n\t * @param reject The rejector callback of the promise\n\t */\n\t(resolve: (value?: T | PromiseLike) => void, reject: (reason?: any) => void): void;\n}\n\nexport let ShimPromise: typeof Promise = global.Promise;\n\nexport const isThenable = function isThenable(value: any): value is PromiseLike {\n\treturn value && typeof value.then === 'function';\n};\n\nif (!has('es6-promise')) {\n\tconst enum State {\n\t\tFulfilled,\n\t\tPending,\n\t\tRejected\n\t}\n\n\tglobal.Promise = ShimPromise = class Promise implements Thenable {\n\t\tstatic all(iterable: Iterable> | (any | PromiseLike)[]): Promise {\n\t\t\treturn new this(function(resolve, reject) {\n\t\t\t\tconst values: any[] = [];\n\t\t\t\tlet complete = 0;\n\t\t\t\tlet total = 0;\n\t\t\t\tlet populating = true;\n\n\t\t\t\tfunction fulfill(index: number, value: any): void {\n\t\t\t\t\tvalues[index] = value;\n\t\t\t\t\t++complete;\n\t\t\t\t\tfinish();\n\t\t\t\t}\n\n\t\t\t\tfunction finish(): void {\n\t\t\t\t\tif (populating || complete < total) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tresolve(values);\n\t\t\t\t}\n\n\t\t\t\tfunction processItem(index: number, item: any): void {\n\t\t\t\t\t++total;\n\t\t\t\t\tif (isThenable(item)) {\n\t\t\t\t\t\t// If an item Promise rejects, this Promise is immediately rejected with the item\n\t\t\t\t\t\t// Promise's rejection error.\n\t\t\t\t\t\titem.then(fulfill.bind(null, index), reject);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tPromise.resolve(item).then(fulfill.bind(null, index));\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tlet i = 0;\n\t\t\t\tfor (const value of iterable) {\n\t\t\t\t\tprocessItem(i, value);\n\t\t\t\t\ti++;\n\t\t\t\t}\n\t\t\t\tpopulating = false;\n\n\t\t\t\tfinish();\n\t\t\t});\n\t\t}\n\n\t\tstatic race(iterable: Iterable> | (T | PromiseLike)[]): Promise {\n\t\t\treturn new this(function(resolve: (value?: any) => void, reject) {\n\t\t\t\tfor (const item of iterable) {\n\t\t\t\t\tif (item instanceof Promise) {\n\t\t\t\t\t\t// If a Promise item rejects, this Promise is immediately rejected with the item\n\t\t\t\t\t\t// Promise's rejection error.\n\t\t\t\t\t\titem.then(resolve, reject);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tPromise.resolve(item).then(resolve);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\n\t\tstatic reject(reason?: any): Promise {\n\t\t\treturn new this(function(resolve, reject) {\n\t\t\t\treject(reason);\n\t\t\t});\n\t\t}\n\n\t\tstatic resolve(): Promise;\n\t\tstatic resolve(value: T | PromiseLike): Promise;\n\t\tstatic resolve(value?: any): Promise {\n\t\t\treturn new this(function(resolve) {\n\t\t\t\tresolve(value);\n\t\t\t});\n\t\t}\n\n\t\tstatic [Symbol.species]: PromiseConstructor = ShimPromise as PromiseConstructor;\n\n\t\t/**\n\t\t * Creates a new Promise.\n\t\t *\n\t\t * @constructor\n\t\t *\n\t\t * @param executor\n\t\t * The executor function is called immediately when the Promise is instantiated. It is responsible for\n\t\t * starting the asynchronous operation when it is invoked.\n\t\t *\n\t\t * The executor must call either the passed `resolve` function when the asynchronous operation has completed\n\t\t * successfully, or the `reject` function when the operation fails.\n\t\t */\n\t\tconstructor(executor: Executor) {\n\t\t\t/**\n\t\t\t * If true, the resolution of this promise is chained (\"locked in\") to another promise.\n\t\t\t */\n\t\t\tlet isChained = false;\n\n\t\t\t/**\n\t\t\t * Whether or not this promise is in a resolved state.\n\t\t\t */\n\t\t\tconst isResolved = (): boolean => {\n\t\t\t\treturn this.state !== State.Pending || isChained;\n\t\t\t};\n\n\t\t\t/**\n\t\t\t * Callbacks that should be invoked once the asynchronous operation has completed.\n\t\t\t */\n\t\t\tlet callbacks: null | (Array<() => void>) = [];\n\n\t\t\t/**\n\t\t\t * Initially pushes callbacks onto a queue for execution once this promise settles. After the promise settles,\n\t\t\t * enqueues callbacks for execution on the next event loop turn.\n\t\t\t */\n\t\t\tlet whenFinished = function(callback: () => void): void {\n\t\t\t\tif (callbacks) {\n\t\t\t\t\tcallbacks.push(callback);\n\t\t\t\t}\n\t\t\t};\n\n\t\t\t/**\n\t\t\t * Settles this promise.\n\t\t\t *\n\t\t\t * @param newState The resolved state for this promise.\n\t\t\t * @param {T|any} value The resolved value for this promise.\n\t\t\t */\n\t\t\tconst settle = (newState: State, value: any): void => {\n\t\t\t\t// A promise can only be settled once.\n\t\t\t\tif (this.state !== State.Pending) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tthis.state = newState;\n\t\t\t\tthis.resolvedValue = value;\n\t\t\t\twhenFinished = queueMicroTask;\n\n\t\t\t\t// Only enqueue a callback runner if there are callbacks so that initially fulfilled Promises don't have to\n\t\t\t\t// wait an extra turn.\n\t\t\t\tif (callbacks && callbacks.length > 0) {\n\t\t\t\t\tqueueMicroTask(function(): void {\n\t\t\t\t\t\tif (callbacks) {\n\t\t\t\t\t\t\tlet count = callbacks.length;\n\t\t\t\t\t\t\tfor (let i = 0; i < count; ++i) {\n\t\t\t\t\t\t\t\tcallbacks[i].call(null);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tcallbacks = null;\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t};\n\n\t\t\t/**\n\t\t\t * Resolves this promise.\n\t\t\t *\n\t\t\t * @param newState The resolved state for this promise.\n\t\t\t * @param {T|any} value The resolved value for this promise.\n\t\t\t */\n\t\t\tconst resolve = (newState: State, value: any): void => {\n\t\t\t\tif (isResolved()) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif (isThenable(value)) {\n\t\t\t\t\tvalue.then(settle.bind(null, State.Fulfilled), settle.bind(null, State.Rejected));\n\t\t\t\t\tisChained = true;\n\t\t\t\t} else {\n\t\t\t\t\tsettle(newState, value);\n\t\t\t\t}\n\t\t\t};\n\n\t\t\tthis.then = (\n\t\t\t\tonFulfilled?: ((value: T) => TResult1 | PromiseLike) | undefined | null,\n\t\t\t\tonRejected?: ((reason: any) => TResult2 | PromiseLike) | undefined | null\n\t\t\t): Promise => {\n\t\t\t\treturn new Promise((resolve, reject) => {\n\t\t\t\t\t// whenFinished initially queues up callbacks for execution after the promise has settled. Once the\n\t\t\t\t\t// promise has settled, whenFinished will schedule callbacks for execution on the next turn through the\n\t\t\t\t\t// event loop.\n\t\t\t\t\twhenFinished(() => {\n\t\t\t\t\t\tconst callback: ((value?: any) => any) | undefined | null =\n\t\t\t\t\t\t\tthis.state === State.Rejected ? onRejected : onFulfilled;\n\n\t\t\t\t\t\tif (typeof callback === 'function') {\n\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\tresolve(callback(this.resolvedValue));\n\t\t\t\t\t\t\t} catch (error) {\n\t\t\t\t\t\t\t\treject(error);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else if (this.state === State.Rejected) {\n\t\t\t\t\t\t\treject(this.resolvedValue);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tresolve(this.resolvedValue);\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t});\n\t\t\t};\n\n\t\t\ttry {\n\t\t\t\texecutor(resolve.bind(null, State.Fulfilled), resolve.bind(null, State.Rejected));\n\t\t\t} catch (error) {\n\t\t\t\tsettle(State.Rejected, error);\n\t\t\t}\n\t\t}\n\n\t\tcatch(\n\t\t\tonRejected?: ((reason: any) => TResult | PromiseLike) | undefined | null\n\t\t): Promise {\n\t\t\treturn this.then(undefined, onRejected);\n\t\t}\n\n\t\t/**\n\t\t * The current state of this promise.\n\t\t */\n\t\tprivate state = State.Pending;\n\n\t\t/**\n\t\t * The resolved value for this promise.\n\t\t *\n\t\t * @type {T|any}\n\t\t */\n\t\tprivate resolvedValue: any;\n\n\t\tthen: (\n\t\t\tonfulfilled?: ((value: T) => TResult1 | PromiseLike) | undefined | null,\n\t\t\tonrejected?: ((reason: any) => TResult2 | PromiseLike) | undefined | null\n\t\t) => Promise;\n\n\t\t[Symbol.toStringTag]: 'Promise' = 'Promise';\n\t};\n}\n\nexport default ShimPromise;\n"]} \ No newline at end of file diff --git a/deps/framework/shim/Promise.mjs b/deps/framework/shim/Promise.mjs deleted file mode 100644 index 015e6aabf7..0000000000 --- a/deps/framework/shim/Promise.mjs +++ /dev/null @@ -1,199 +0,0 @@ -import global from './global'; -import { queueMicroTask } from './support/queue'; -import './Symbol'; -import has from './support/has'; -export let ShimPromise = global.Promise; -export const isThenable = function isThenable(value) { - return value && typeof value.then === 'function'; -}; -if (!has('es6-promise')) { - global.Promise = ShimPromise = (_a = class Promise { - /** - * Creates a new Promise. - * - * @constructor - * - * @param executor - * The executor function is called immediately when the Promise is instantiated. It is responsible for - * starting the asynchronous operation when it is invoked. - * - * The executor must call either the passed `resolve` function when the asynchronous operation has completed - * successfully, or the `reject` function when the operation fails. - */ - constructor(executor) { - /** - * The current state of this promise. - */ - this.state = 1 /* Pending */; - this[Symbol.toStringTag] = 'Promise'; - /** - * If true, the resolution of this promise is chained ("locked in") to another promise. - */ - let isChained = false; - /** - * Whether or not this promise is in a resolved state. - */ - const isResolved = () => { - return this.state !== 1 /* Pending */ || isChained; - }; - /** - * Callbacks that should be invoked once the asynchronous operation has completed. - */ - let callbacks = []; - /** - * Initially pushes callbacks onto a queue for execution once this promise settles. After the promise settles, - * enqueues callbacks for execution on the next event loop turn. - */ - let whenFinished = function (callback) { - if (callbacks) { - callbacks.push(callback); - } - }; - /** - * Settles this promise. - * - * @param newState The resolved state for this promise. - * @param {T|any} value The resolved value for this promise. - */ - const settle = (newState, value) => { - // A promise can only be settled once. - if (this.state !== 1 /* Pending */) { - return; - } - this.state = newState; - this.resolvedValue = value; - whenFinished = queueMicroTask; - // Only enqueue a callback runner if there are callbacks so that initially fulfilled Promises don't have to - // wait an extra turn. - if (callbacks && callbacks.length > 0) { - queueMicroTask(function () { - if (callbacks) { - let count = callbacks.length; - for (let i = 0; i < count; ++i) { - callbacks[i].call(null); - } - callbacks = null; - } - }); - } - }; - /** - * Resolves this promise. - * - * @param newState The resolved state for this promise. - * @param {T|any} value The resolved value for this promise. - */ - const resolve = (newState, value) => { - if (isResolved()) { - return; - } - if (isThenable(value)) { - value.then(settle.bind(null, 0 /* Fulfilled */), settle.bind(null, 2 /* Rejected */)); - isChained = true; - } - else { - settle(newState, value); - } - }; - this.then = (onFulfilled, onRejected) => { - return new Promise((resolve, reject) => { - // whenFinished initially queues up callbacks for execution after the promise has settled. Once the - // promise has settled, whenFinished will schedule callbacks for execution on the next turn through the - // event loop. - whenFinished(() => { - const callback = this.state === 2 /* Rejected */ ? onRejected : onFulfilled; - if (typeof callback === 'function') { - try { - resolve(callback(this.resolvedValue)); - } - catch (error) { - reject(error); - } - } - else if (this.state === 2 /* Rejected */) { - reject(this.resolvedValue); - } - else { - resolve(this.resolvedValue); - } - }); - }); - }; - try { - executor(resolve.bind(null, 0 /* Fulfilled */), resolve.bind(null, 2 /* Rejected */)); - } - catch (error) { - settle(2 /* Rejected */, error); - } - } - static all(iterable) { - return new this(function (resolve, reject) { - const values = []; - let complete = 0; - let total = 0; - let populating = true; - function fulfill(index, value) { - values[index] = value; - ++complete; - finish(); - } - function finish() { - if (populating || complete < total) { - return; - } - resolve(values); - } - function processItem(index, item) { - ++total; - if (isThenable(item)) { - // If an item Promise rejects, this Promise is immediately rejected with the item - // Promise's rejection error. - item.then(fulfill.bind(null, index), reject); - } - else { - Promise.resolve(item).then(fulfill.bind(null, index)); - } - } - let i = 0; - for (const value of iterable) { - processItem(i, value); - i++; - } - populating = false; - finish(); - }); - } - static race(iterable) { - return new this(function (resolve, reject) { - for (const item of iterable) { - if (item instanceof Promise) { - // If a Promise item rejects, this Promise is immediately rejected with the item - // Promise's rejection error. - item.then(resolve, reject); - } - else { - Promise.resolve(item).then(resolve); - } - } - }); - } - static reject(reason) { - return new this(function (resolve, reject) { - reject(reason); - }); - } - static resolve(value) { - return new this(function (resolve) { - resolve(value); - }); - } - catch(onRejected) { - return this.then(undefined, onRejected); - } - }, - _a[Symbol.species] = ShimPromise, - _a); -} -export default ShimPromise; -var _a; -//# sourceMappingURL=Promise.mjs.map \ No newline at end of file diff --git a/deps/framework/shim/Promise.mjs.map b/deps/framework/shim/Promise.mjs.map deleted file mode 100644 index 5f424f0389..0000000000 --- a/deps/framework/shim/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,CAAC;YAED,MAAM,CAAC,IAAI,CAAI,QAA+D;gBAC7E,MAAM,CAAC,IAAI,IAAI,CAAC,UAAS,OAA8B,EAAE,MAAM;oBAC9D,GAAG,CAAC,CAAC,MAAM,IAAI,IAAI,QAAQ,CAAC,CAAC,CAAC;wBAC7B,EAAE,CAAC,CAAC,IAAI,YAAY,OAAO,CAAC,CAAC,CAAC;4BAC7B,gFAAgF;4BAChF,6BAA6B;4BAC7B,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;wBAC5B,CAAC;wBAAC,IAAI,CAAC,CAAC;4BACP,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;wBACrC,CAAC;oBACF,CAAC;gBACF,CAAC,CAAC,CAAC;YACJ,CAAC;YAED,MAAM,CAAC,MAAM,CAAC,MAAY;gBACzB,MAAM,CAAC,IAAI,IAAI,CAAC,UAAS,OAAO,EAAE,MAAM;oBACvC,MAAM,CAAC,MAAM,CAAC,CAAC;gBAChB,CAAC,CAAC,CAAC;YACJ,CAAC;YAID,MAAM,CAAC,OAAO,CAAI,KAAW;gBAC5B,MAAM,CAAC,IAAI,IAAI,CAAC,UAAS,OAAO;oBAC/B,OAAO,CAAI,KAAK,CAAC,CAAC;gBACnB,CAAC,CAAC,CAAC;YACJ,CAAC;YAgID,KAAK,CACJ,UAAiF;gBAEjF,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,UAAU,CAAC,CAAC;YACzC,CAAC;SAoBD;QAtJO,GAAC,MAAM,CAAC,OAAO,CAAC,GAAuB,WAAkC;WAsJhF,CAAC;AACH,CAAC;AAED,eAAe,WAAW,CAAC","sourcesContent":["import { Thenable } from './interfaces';\nimport global from './global';\nimport { queueMicroTask } from './support/queue';\nimport { Iterable } from './iterator';\nimport './Symbol';\nimport has from './support/has';\n\n/**\n * Executor is the interface for functions used to initialize a Promise.\n */\nexport interface Executor {\n\t/**\n\t * The executor for the promise\n\t *\n\t * @param resolve The resolver callback of the promise\n\t * @param reject The rejector callback of the promise\n\t */\n\t(resolve: (value?: T | PromiseLike) => void, reject: (reason?: any) => void): void;\n}\n\nexport let ShimPromise: typeof Promise = global.Promise;\n\nexport const isThenable = function isThenable(value: any): value is PromiseLike {\n\treturn value && typeof value.then === 'function';\n};\n\nif (!has('es6-promise')) {\n\tconst enum State {\n\t\tFulfilled,\n\t\tPending,\n\t\tRejected\n\t}\n\n\tglobal.Promise = ShimPromise = class Promise implements Thenable {\n\t\tstatic all(iterable: Iterable> | (any | PromiseLike)[]): Promise {\n\t\t\treturn new this(function(resolve, reject) {\n\t\t\t\tconst values: any[] = [];\n\t\t\t\tlet complete = 0;\n\t\t\t\tlet total = 0;\n\t\t\t\tlet populating = true;\n\n\t\t\t\tfunction fulfill(index: number, value: any): void {\n\t\t\t\t\tvalues[index] = value;\n\t\t\t\t\t++complete;\n\t\t\t\t\tfinish();\n\t\t\t\t}\n\n\t\t\t\tfunction finish(): void {\n\t\t\t\t\tif (populating || complete < total) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tresolve(values);\n\t\t\t\t}\n\n\t\t\t\tfunction processItem(index: number, item: any): void {\n\t\t\t\t\t++total;\n\t\t\t\t\tif (isThenable(item)) {\n\t\t\t\t\t\t// If an item Promise rejects, this Promise is immediately rejected with the item\n\t\t\t\t\t\t// Promise's rejection error.\n\t\t\t\t\t\titem.then(fulfill.bind(null, index), reject);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tPromise.resolve(item).then(fulfill.bind(null, index));\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tlet i = 0;\n\t\t\t\tfor (const value of iterable) {\n\t\t\t\t\tprocessItem(i, value);\n\t\t\t\t\ti++;\n\t\t\t\t}\n\t\t\t\tpopulating = false;\n\n\t\t\t\tfinish();\n\t\t\t});\n\t\t}\n\n\t\tstatic race(iterable: Iterable> | (T | PromiseLike)[]): Promise {\n\t\t\treturn new this(function(resolve: (value?: any) => void, reject) {\n\t\t\t\tfor (const item of iterable) {\n\t\t\t\t\tif (item instanceof Promise) {\n\t\t\t\t\t\t// If a Promise item rejects, this Promise is immediately rejected with the item\n\t\t\t\t\t\t// Promise's rejection error.\n\t\t\t\t\t\titem.then(resolve, reject);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tPromise.resolve(item).then(resolve);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\n\t\tstatic reject(reason?: any): Promise {\n\t\t\treturn new this(function(resolve, reject) {\n\t\t\t\treject(reason);\n\t\t\t});\n\t\t}\n\n\t\tstatic resolve(): Promise;\n\t\tstatic resolve(value: T | PromiseLike): Promise;\n\t\tstatic resolve(value?: any): Promise {\n\t\t\treturn new this(function(resolve) {\n\t\t\t\tresolve(value);\n\t\t\t});\n\t\t}\n\n\t\tstatic [Symbol.species]: PromiseConstructor = ShimPromise as PromiseConstructor;\n\n\t\t/**\n\t\t * Creates a new Promise.\n\t\t *\n\t\t * @constructor\n\t\t *\n\t\t * @param executor\n\t\t * The executor function is called immediately when the Promise is instantiated. It is responsible for\n\t\t * starting the asynchronous operation when it is invoked.\n\t\t *\n\t\t * The executor must call either the passed `resolve` function when the asynchronous operation has completed\n\t\t * successfully, or the `reject` function when the operation fails.\n\t\t */\n\t\tconstructor(executor: Executor) {\n\t\t\t/**\n\t\t\t * If true, the resolution of this promise is chained (\"locked in\") to another promise.\n\t\t\t */\n\t\t\tlet isChained = false;\n\n\t\t\t/**\n\t\t\t * Whether or not this promise is in a resolved state.\n\t\t\t */\n\t\t\tconst isResolved = (): boolean => {\n\t\t\t\treturn this.state !== State.Pending || isChained;\n\t\t\t};\n\n\t\t\t/**\n\t\t\t * Callbacks that should be invoked once the asynchronous operation has completed.\n\t\t\t */\n\t\t\tlet callbacks: null | (Array<() => void>) = [];\n\n\t\t\t/**\n\t\t\t * Initially pushes callbacks onto a queue for execution once this promise settles. After the promise settles,\n\t\t\t * enqueues callbacks for execution on the next event loop turn.\n\t\t\t */\n\t\t\tlet whenFinished = function(callback: () => void): void {\n\t\t\t\tif (callbacks) {\n\t\t\t\t\tcallbacks.push(callback);\n\t\t\t\t}\n\t\t\t};\n\n\t\t\t/**\n\t\t\t * Settles this promise.\n\t\t\t *\n\t\t\t * @param newState The resolved state for this promise.\n\t\t\t * @param {T|any} value The resolved value for this promise.\n\t\t\t */\n\t\t\tconst settle = (newState: State, value: any): void => {\n\t\t\t\t// A promise can only be settled once.\n\t\t\t\tif (this.state !== State.Pending) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tthis.state = newState;\n\t\t\t\tthis.resolvedValue = value;\n\t\t\t\twhenFinished = queueMicroTask;\n\n\t\t\t\t// Only enqueue a callback runner if there are callbacks so that initially fulfilled Promises don't have to\n\t\t\t\t// wait an extra turn.\n\t\t\t\tif (callbacks && callbacks.length > 0) {\n\t\t\t\t\tqueueMicroTask(function(): void {\n\t\t\t\t\t\tif (callbacks) {\n\t\t\t\t\t\t\tlet count = callbacks.length;\n\t\t\t\t\t\t\tfor (let i = 0; i < count; ++i) {\n\t\t\t\t\t\t\t\tcallbacks[i].call(null);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tcallbacks = null;\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t};\n\n\t\t\t/**\n\t\t\t * Resolves this promise.\n\t\t\t *\n\t\t\t * @param newState The resolved state for this promise.\n\t\t\t * @param {T|any} value The resolved value for this promise.\n\t\t\t */\n\t\t\tconst resolve = (newState: State, value: any): void => {\n\t\t\t\tif (isResolved()) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif (isThenable(value)) {\n\t\t\t\t\tvalue.then(settle.bind(null, State.Fulfilled), settle.bind(null, State.Rejected));\n\t\t\t\t\tisChained = true;\n\t\t\t\t} else {\n\t\t\t\t\tsettle(newState, value);\n\t\t\t\t}\n\t\t\t};\n\n\t\t\tthis.then = (\n\t\t\t\tonFulfilled?: ((value: T) => TResult1 | PromiseLike) | undefined | null,\n\t\t\t\tonRejected?: ((reason: any) => TResult2 | PromiseLike) | undefined | null\n\t\t\t): Promise => {\n\t\t\t\treturn new Promise((resolve, reject) => {\n\t\t\t\t\t// whenFinished initially queues up callbacks for execution after the promise has settled. Once the\n\t\t\t\t\t// promise has settled, whenFinished will schedule callbacks for execution on the next turn through the\n\t\t\t\t\t// event loop.\n\t\t\t\t\twhenFinished(() => {\n\t\t\t\t\t\tconst callback: ((value?: any) => any) | undefined | null =\n\t\t\t\t\t\t\tthis.state === State.Rejected ? onRejected : onFulfilled;\n\n\t\t\t\t\t\tif (typeof callback === 'function') {\n\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\tresolve(callback(this.resolvedValue));\n\t\t\t\t\t\t\t} catch (error) {\n\t\t\t\t\t\t\t\treject(error);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else if (this.state === State.Rejected) {\n\t\t\t\t\t\t\treject(this.resolvedValue);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tresolve(this.resolvedValue);\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t});\n\t\t\t};\n\n\t\t\ttry {\n\t\t\t\texecutor(resolve.bind(null, State.Fulfilled), resolve.bind(null, State.Rejected));\n\t\t\t} catch (error) {\n\t\t\t\tsettle(State.Rejected, error);\n\t\t\t}\n\t\t}\n\n\t\tcatch(\n\t\t\tonRejected?: ((reason: any) => TResult | PromiseLike) | undefined | null\n\t\t): Promise {\n\t\t\treturn this.then(undefined, onRejected);\n\t\t}\n\n\t\t/**\n\t\t * The current state of this promise.\n\t\t */\n\t\tprivate state = State.Pending;\n\n\t\t/**\n\t\t * The resolved value for this promise.\n\t\t *\n\t\t * @type {T|any}\n\t\t */\n\t\tprivate resolvedValue: any;\n\n\t\tthen: (\n\t\t\tonfulfilled?: ((value: T) => TResult1 | PromiseLike) | undefined | null,\n\t\t\tonrejected?: ((reason: any) => TResult2 | PromiseLike) | undefined | null\n\t\t) => Promise;\n\n\t\t[Symbol.toStringTag]: 'Promise' = 'Promise';\n\t};\n}\n\nexport default ShimPromise;\n"]} \ No newline at end of file diff --git a/deps/framework/shim/Set.d.ts b/deps/framework/shim/Set.d.ts deleted file mode 100644 index 463f0d010e..0000000000 --- a/deps/framework/shim/Set.d.ts +++ /dev/null @@ -1,86 +0,0 @@ -import { Iterable, IterableIterator } from './iterator'; -import './Symbol'; -export interface Set { - /** - * Adds a `value` to the `Set` - * - * @param value The value to add to the set - * @returns The instance of the `Set` - */ - add(value: T): this; - /** - * Removes all the values from the `Set`. - */ - clear(): void; - /** - * Removes a `value` from the set - * - * @param value The value to be removed - * @returns `true` if the value was removed - */ - delete(value: T): boolean; - /** - * Returns an iterator that yields each entry. - * - * @return An iterator for each key/value pair in the instance. - */ - entries(): IterableIterator<[T, T]>; - /** - * Executes a given function for each set entry. The function - * is invoked with three arguments: the element value, the - * element key, and the associated `Set` instance. - * - * @param callbackfn The function to execute for each map entry, - * @param thisArg The value to use for `this` for each execution of the calback - */ - forEach(callbackfn: (value: T, value2: T, set: Set) => void, thisArg?: any): void; - /** - * Identifies if a value is part of the set. - * - * @param value The value to check - * @returns `true` if the value is part of the set otherwise `false` - */ - has(value: T): boolean; - /** - * Despite its name, returns an iterable of the values in the set, - */ - keys(): IterableIterator; - /** - * Returns the number of values in the `Set`. - */ - readonly size: number; - /** - * Returns an iterable of values in the set. - */ - values(): IterableIterator; - /** Iterates over values in the set. */ - [Symbol.iterator](): IterableIterator; - readonly [Symbol.toStringTag]: 'Set'; -} -export interface SetConstructor { - /** - * Creates a new Set - * - * @constructor - */ - new (): Set; - /** - * Creates a new Set - * - * @constructor - * - * @param iterator The iterable structure to initialize the set with - */ - new (iterator?: T[]): Set; - /** - * Creates a new Set - * - * @constructor - * - * @param iterator The iterable structure to initialize the set with - */ - new (iterator: Iterable): Set; - readonly prototype: Set; -} -export declare let Set: SetConstructor; -export default Set; diff --git a/deps/framework/shim/Set.js b/deps/framework/shim/Set.js deleted file mode 100644 index cdf85a062d..0000000000 --- a/deps/framework/shim/Set.js +++ /dev/null @@ -1,103 +0,0 @@ -(function (factory) { - if (typeof module === "object" && typeof module.exports === "object") { - var v = factory(require, exports); - if (v !== undefined) module.exports = v; - } - else if (typeof define === "function" && define.amd) { - define(["require", "exports", "tslib", "./global", "./iterator", "./support/has", "./Symbol"], factory); - } -})(function (require, exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - var tslib_1 = require("tslib"); - var global_1 = require("./global"); - var iterator_1 = require("./iterator"); - var has_1 = require("./support/has"); - require("./Symbol"); - exports.Set = global_1.default.Set; - if (!has_1.default('es6-set')) { - exports.Set = (_a = /** @class */ (function () { - function Set(iterable) { - this._setData = []; - this[Symbol.toStringTag] = 'Set'; - if (iterable) { - if (iterator_1.isArrayLike(iterable)) { - for (var i = 0; i < iterable.length; i++) { - this.add(iterable[i]); - } - } - else { - try { - for (var iterable_1 = tslib_1.__values(iterable), iterable_1_1 = iterable_1.next(); !iterable_1_1.done; iterable_1_1 = iterable_1.next()) { - var value = iterable_1_1.value; - this.add(value); - } - } - catch (e_1_1) { e_1 = { error: e_1_1 }; } - finally { - try { - if (iterable_1_1 && !iterable_1_1.done && (_a = iterable_1.return)) _a.call(iterable_1); - } - finally { if (e_1) throw e_1.error; } - } - } - } - var e_1, _a; - } - Set.prototype.add = function (value) { - if (this.has(value)) { - return this; - } - this._setData.push(value); - return this; - }; - Set.prototype.clear = function () { - this._setData.length = 0; - }; - Set.prototype.delete = function (value) { - var idx = this._setData.indexOf(value); - if (idx === -1) { - return false; - } - this._setData.splice(idx, 1); - return true; - }; - Set.prototype.entries = function () { - return new iterator_1.ShimIterator(this._setData.map(function (value) { return [value, value]; })); - }; - Set.prototype.forEach = function (callbackfn, thisArg) { - var iterator = this.values(); - var result = iterator.next(); - while (!result.done) { - callbackfn.call(thisArg, result.value, result.value, this); - result = iterator.next(); - } - }; - Set.prototype.has = function (value) { - return this._setData.indexOf(value) > -1; - }; - Set.prototype.keys = function () { - return new iterator_1.ShimIterator(this._setData); - }; - Object.defineProperty(Set.prototype, "size", { - get: function () { - return this._setData.length; - }, - enumerable: true, - configurable: true - }); - Set.prototype.values = function () { - return new iterator_1.ShimIterator(this._setData); - }; - Set.prototype[Symbol.iterator] = function () { - return new iterator_1.ShimIterator(this._setData); - }; - return Set; - }()), - _a[Symbol.species] = _a, - _a); - } - exports.default = exports.Set; - var _a; -}); -//# sourceMappingURL=Set.js.map \ No newline at end of file diff --git a/deps/framework/shim/Set.js.map b/deps/framework/shim/Set.js.map deleted file mode 100644 index b212ac2a51..0000000000 --- a/deps/framework/shim/Set.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"Set.js","sourceRoot":"","sources":["Set.ts"],"names":[],"mappings":";;;;;;;;;;;;IAAA,mCAA8B;IAC9B,uCAAmF;IACnF,qCAAgC;IAChC,oBAAkB;IAmGP,QAAA,GAAG,GAAmB,gBAAM,CAAC,GAAG,CAAC;IAE5C,EAAE,CAAC,CAAC,CAAC,aAAG,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;QACrB,WAAG;gBAKF,aAAY,QAAqC;oBAJhC,aAAQ,GAAQ,EAAE,CAAC;oBAwEpC,KAAC,MAAM,CAAC,WAAW,CAAC,GAAU,KAAK,CAAC;oBAnEnC,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC;wBACd,EAAE,CAAC,CAAC,sBAAW,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;4BAC3B,GAAG,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,QAAQ,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;gCAC1C,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC;4BACvB,CAAC;wBACF,CAAC;wBAAC,IAAI,CAAC,CAAC;;gCACP,GAAG,CAAC,CAAgB,IA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AAM,CAAC,IAAI,EAAE,CAAC;wBACrB,UAAU,CAAC,IAAI,CAAC,OAAO,EAAE,MAAM,CAAC,KAAK,EAAE,MAAM,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;wBAC3D,MAAM,GAAG,QAAQ,CAAC,IAAI,EAAE,CAAC;oBAC1B,CAAC;gBACF,CAAC;gBAED,iBAAG,GAAH,UAAI,KAAQ;oBACX,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC;gBAC1C,CAAC;gBAED,kBAAI,GAAJ;oBACC,MAAM,CAAC,IAAI,uBAAY,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;gBACxC,CAAC;gBAED,sBAAI,qBAAI;yBAAR;wBACC,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC;oBAC7B,CAAC;;;mBAAA;gBAED,oBAAM,GAAN;oBACC,MAAM,CAAC,IAAI,uBAAY,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;gBACxC,CAAC;gBAED,cAAC,MAAM,CAAC,QAAQ,CAAC,GAAjB;oBACC,MAAM,CAAC,IAAI,uBAAY,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;gBACxC,CAAC;gBAGF,UAAC;YAAD,CAAC,AA1EK;YAGE,GAAC,MAAM,CAAC,OAAO,CAAC,GAAG,EAAI;eAuE9B,CAAC;IACH,CAAC;IAED,kBAAe,WAAG,CAAC","sourcesContent":["import global from './global';\nimport { isArrayLike, Iterable, IterableIterator, ShimIterator } from './iterator';\nimport has from './support/has';\nimport './Symbol';\n\nexport interface Set {\n\t/**\n\t * Adds a `value` to the `Set`\n\t *\n\t * @param value The value to add to the set\n\t * @returns The instance of the `Set`\n\t */\n\tadd(value: T): this;\n\n\t/**\n\t * Removes all the values from the `Set`.\n\t */\n\tclear(): void;\n\n\t/**\n\t * Removes a `value` from the set\n\t *\n\t * @param value The value to be removed\n\t * @returns `true` if the value was removed\n\t */\n\tdelete(value: T): boolean;\n\n\t/**\n\t * Returns an iterator that yields each entry.\n\t *\n\t * @return An iterator for each key/value pair in the instance.\n\t */\n\tentries(): IterableIterator<[T, T]>;\n\n\t/**\n\t * Executes a given function for each set entry. The function\n\t * is invoked with three arguments: the element value, the\n\t * element key, and the associated `Set` instance.\n\t *\n\t * @param callbackfn The function to execute for each map entry,\n\t * @param thisArg The value to use for `this` for each execution of the calback\n\t */\n\tforEach(callbackfn: (value: T, value2: T, set: Set) => void, thisArg?: any): void;\n\n\t/**\n\t * Identifies if a value is part of the set.\n\t *\n\t * @param value The value to check\n\t * @returns `true` if the value is part of the set otherwise `false`\n\t */\n\thas(value: T): boolean;\n\n\t/**\n\t * Despite its name, returns an iterable of the values in the set,\n\t */\n\tkeys(): IterableIterator;\n\n\t/**\n\t * Returns the number of values in the `Set`.\n\t */\n\treadonly size: number;\n\n\t/**\n\t * Returns an iterable of values in the set.\n\t */\n\tvalues(): IterableIterator;\n\n\t/** Iterates over values in the set. */\n\t[Symbol.iterator](): IterableIterator;\n\n\treadonly [Symbol.toStringTag]: 'Set';\n}\n\nexport interface SetConstructor {\n\t/**\n\t * Creates a new Set\n\t *\n\t * @constructor\n\t */\n\tnew (): Set;\n\n\t/**\n\t * Creates a new Set\n\t *\n\t * @constructor\n\t *\n\t * @param iterator The iterable structure to initialize the set with\n\t */\n\tnew (iterator?: T[]): Set;\n\n\t/**\n\t * Creates a new Set\n\t *\n\t * @constructor\n\t *\n\t * @param iterator The iterable structure to initialize the set with\n\t */\n\tnew (iterator: Iterable): Set;\n\n\treadonly prototype: Set;\n}\n\nexport let Set: SetConstructor = global.Set;\n\nif (!has('es6-set')) {\n\tSet = class Set {\n\t\tprivate readonly _setData: T[] = [];\n\n\t\tstatic [Symbol.species] = Set;\n\n\t\tconstructor(iterable?: ArrayLike | Iterable) {\n\t\t\tif (iterable) {\n\t\t\t\tif (isArrayLike(iterable)) {\n\t\t\t\t\tfor (let i = 0; i < iterable.length; i++) {\n\t\t\t\t\t\tthis.add(iterable[i]);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tfor (const value of iterable) {\n\t\t\t\t\t\tthis.add(value);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tadd(value: T): this {\n\t\t\tif (this.has(value)) {\n\t\t\t\treturn this;\n\t\t\t}\n\t\t\tthis._setData.push(value);\n\t\t\treturn this;\n\t\t}\n\n\t\tclear(): void {\n\t\t\tthis._setData.length = 0;\n\t\t}\n\n\t\tdelete(value: T): boolean {\n\t\t\tconst idx = this._setData.indexOf(value);\n\t\t\tif (idx === -1) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tthis._setData.splice(idx, 1);\n\t\t\treturn true;\n\t\t}\n\n\t\tentries(): IterableIterator<[T, T]> {\n\t\t\treturn new ShimIterator<[any, any]>(this._setData.map<[any, any]>((value) => [value, value]));\n\t\t}\n\n\t\tforEach(callbackfn: (value: T, index: T, set: Set) => void, thisArg?: any): void {\n\t\t\tconst iterator = this.values();\n\t\t\tlet result = iterator.next();\n\t\t\twhile (!result.done) {\n\t\t\t\tcallbackfn.call(thisArg, result.value, result.value, this);\n\t\t\t\tresult = iterator.next();\n\t\t\t}\n\t\t}\n\n\t\thas(value: T): boolean {\n\t\t\treturn this._setData.indexOf(value) > -1;\n\t\t}\n\n\t\tkeys(): IterableIterator {\n\t\t\treturn new ShimIterator(this._setData);\n\t\t}\n\n\t\tget size(): number {\n\t\t\treturn this._setData.length;\n\t\t}\n\n\t\tvalues(): IterableIterator {\n\t\t\treturn new ShimIterator(this._setData);\n\t\t}\n\n\t\t[Symbol.iterator](): IterableIterator {\n\t\t\treturn new ShimIterator(this._setData);\n\t\t}\n\n\t\t[Symbol.toStringTag]: 'Set' = 'Set';\n\t};\n}\n\nexport default Set;\n"]} \ No newline at end of file diff --git a/deps/framework/shim/Set.mjs b/deps/framework/shim/Set.mjs deleted file mode 100644 index 9c74335004..0000000000 --- a/deps/framework/shim/Set.mjs +++ /dev/null @@ -1,74 +0,0 @@ -import global from './global'; -import { isArrayLike, ShimIterator } from './iterator'; -import has from './support/has'; -import './Symbol'; -export let Set = global.Set; -if (!has('es6-set')) { - Set = (_a = class Set { - constructor(iterable) { - this._setData = []; - this[Symbol.toStringTag] = 'Set'; - if (iterable) { - if (isArrayLike(iterable)) { - for (let i = 0; i < iterable.length; i++) { - this.add(iterable[i]); - } - } - else { - for (const value of iterable) { - this.add(value); - } - } - } - } - add(value) { - if (this.has(value)) { - return this; - } - this._setData.push(value); - return this; - } - clear() { - this._setData.length = 0; - } - delete(value) { - const idx = this._setData.indexOf(value); - if (idx === -1) { - return false; - } - this._setData.splice(idx, 1); - return true; - } - entries() { - return new ShimIterator(this._setData.map((value) => [value, value])); - } - forEach(callbackfn, thisArg) { - const iterator = this.values(); - let result = iterator.next(); - while (!result.done) { - callbackfn.call(thisArg, result.value, result.value, this); - result = iterator.next(); - } - } - has(value) { - return this._setData.indexOf(value) > -1; - } - keys() { - return new ShimIterator(this._setData); - } - get size() { - return this._setData.length; - } - values() { - return new ShimIterator(this._setData); - } - [Symbol.iterator]() { - return new ShimIterator(this._setData); - } - }, - _a[Symbol.species] = _a, - _a); -} -export default Set; -var _a; -//# sourceMappingURL=Set.mjs.map \ No newline at end of file diff --git a/deps/framework/shim/Set.mjs.map b/deps/framework/shim/Set.mjs.map deleted file mode 100644 index 535a6c289c..0000000000 --- a/deps/framework/shim/Set.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"Set.mjs","sourceRoot":"","sources":["Set.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,UAAU,CAAC;AAC9B,OAAO,EAAE,WAAW,EAA8B,YAAY,EAAE,MAAM,YAAY,CAAC;AACnF,OAAO,GAAG,MAAM,eAAe,CAAC;AAChC,OAAO,UAAU,CAAC;AAmGlB,MAAM,CAAC,IAAI,GAAG,GAAmB,MAAM,CAAC,GAAG,CAAC;AAE5C,EAA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EO,GAAC,MAAM,CAAC,OAAO,CAAC,GAAG,EAAI;WAuE9B,CAAC;AACH,CAAC;AAED,eAAe,GAAG,CAAC","sourcesContent":["import global from './global';\nimport { isArrayLike, Iterable, IterableIterator, ShimIterator } from './iterator';\nimport has from './support/has';\nimport './Symbol';\n\nexport interface Set {\n\t/**\n\t * Adds a `value` to the `Set`\n\t *\n\t * @param value The value to add to the set\n\t * @returns The instance of the `Set`\n\t */\n\tadd(value: T): this;\n\n\t/**\n\t * Removes all the values from the `Set`.\n\t */\n\tclear(): void;\n\n\t/**\n\t * Removes a `value` from the set\n\t *\n\t * @param value The value to be removed\n\t * @returns `true` if the value was removed\n\t */\n\tdelete(value: T): boolean;\n\n\t/**\n\t * Returns an iterator that yields each entry.\n\t *\n\t * @return An iterator for each key/value pair in the instance.\n\t */\n\tentries(): IterableIterator<[T, T]>;\n\n\t/**\n\t * Executes a given function for each set entry. The function\n\t * is invoked with three arguments: the element value, the\n\t * element key, and the associated `Set` instance.\n\t *\n\t * @param callbackfn The function to execute for each map entry,\n\t * @param thisArg The value to use for `this` for each execution of the calback\n\t */\n\tforEach(callbackfn: (value: T, value2: T, set: Set) => void, thisArg?: any): void;\n\n\t/**\n\t * Identifies if a value is part of the set.\n\t *\n\t * @param value The value to check\n\t * @returns `true` if the value is part of the set otherwise `false`\n\t */\n\thas(value: T): boolean;\n\n\t/**\n\t * Despite its name, returns an iterable of the values in the set,\n\t */\n\tkeys(): IterableIterator;\n\n\t/**\n\t * Returns the number of values in the `Set`.\n\t */\n\treadonly size: number;\n\n\t/**\n\t * Returns an iterable of values in the set.\n\t */\n\tvalues(): IterableIterator;\n\n\t/** Iterates over values in the set. */\n\t[Symbol.iterator](): IterableIterator;\n\n\treadonly [Symbol.toStringTag]: 'Set';\n}\n\nexport interface SetConstructor {\n\t/**\n\t * Creates a new Set\n\t *\n\t * @constructor\n\t */\n\tnew (): Set;\n\n\t/**\n\t * Creates a new Set\n\t *\n\t * @constructor\n\t *\n\t * @param iterator The iterable structure to initialize the set with\n\t */\n\tnew (iterator?: T[]): Set;\n\n\t/**\n\t * Creates a new Set\n\t *\n\t * @constructor\n\t *\n\t * @param iterator The iterable structure to initialize the set with\n\t */\n\tnew (iterator: Iterable): Set;\n\n\treadonly prototype: Set;\n}\n\nexport let Set: SetConstructor = global.Set;\n\nif (!has('es6-set')) {\n\tSet = class Set {\n\t\tprivate readonly _setData: T[] = [];\n\n\t\tstatic [Symbol.species] = Set;\n\n\t\tconstructor(iterable?: ArrayLike | Iterable) {\n\t\t\tif (iterable) {\n\t\t\t\tif (isArrayLike(iterable)) {\n\t\t\t\t\tfor (let i = 0; i < iterable.length; i++) {\n\t\t\t\t\t\tthis.add(iterable[i]);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tfor (const value of iterable) {\n\t\t\t\t\t\tthis.add(value);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tadd(value: T): this {\n\t\t\tif (this.has(value)) {\n\t\t\t\treturn this;\n\t\t\t}\n\t\t\tthis._setData.push(value);\n\t\t\treturn this;\n\t\t}\n\n\t\tclear(): void {\n\t\t\tthis._setData.length = 0;\n\t\t}\n\n\t\tdelete(value: T): boolean {\n\t\t\tconst idx = this._setData.indexOf(value);\n\t\t\tif (idx === -1) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tthis._setData.splice(idx, 1);\n\t\t\treturn true;\n\t\t}\n\n\t\tentries(): IterableIterator<[T, T]> {\n\t\t\treturn new ShimIterator<[any, any]>(this._setData.map<[any, any]>((value) => [value, value]));\n\t\t}\n\n\t\tforEach(callbackfn: (value: T, index: T, set: Set) => void, thisArg?: any): void {\n\t\t\tconst iterator = this.values();\n\t\t\tlet result = iterator.next();\n\t\t\twhile (!result.done) {\n\t\t\t\tcallbackfn.call(thisArg, result.value, result.value, this);\n\t\t\t\tresult = iterator.next();\n\t\t\t}\n\t\t}\n\n\t\thas(value: T): boolean {\n\t\t\treturn this._setData.indexOf(value) > -1;\n\t\t}\n\n\t\tkeys(): IterableIterator {\n\t\t\treturn new ShimIterator(this._setData);\n\t\t}\n\n\t\tget size(): number {\n\t\t\treturn this._setData.length;\n\t\t}\n\n\t\tvalues(): IterableIterator {\n\t\t\treturn new ShimIterator(this._setData);\n\t\t}\n\n\t\t[Symbol.iterator](): IterableIterator {\n\t\t\treturn new ShimIterator(this._setData);\n\t\t}\n\n\t\t[Symbol.toStringTag]: 'Set' = 'Set';\n\t};\n}\n\nexport default Set;\n"]} \ No newline at end of file diff --git a/deps/framework/shim/Symbol.d.ts b/deps/framework/shim/Symbol.d.ts deleted file mode 100644 index 525abcc051..0000000000 --- a/deps/framework/shim/Symbol.d.ts +++ /dev/null @@ -1,14 +0,0 @@ -declare global { - interface SymbolConstructor { - observable: symbol; - } -} -export declare let Symbol: SymbolConstructor; -/** - * A custom guard function that determines if an object is a symbol or not - * @param {any} value The value to check to see if it is a symbol or not - * @return {is symbol} Returns true if a symbol or not (and narrows the type guard) - */ -export declare function isSymbol(value: any): value is symbol; -export default Symbol; -export {}; diff --git a/deps/framework/shim/Symbol.js b/deps/framework/shim/Symbol.js deleted file mode 100644 index 56c3cc672f..0000000000 --- a/deps/framework/shim/Symbol.js +++ /dev/null @@ -1,158 +0,0 @@ -(function (factory) { - if (typeof module === "object" && typeof module.exports === "object") { - var v = factory(require, exports); - if (v !== undefined) module.exports = v; - } - else if (typeof define === "function" && define.amd) { - define(["require", "exports", "./support/has", "./global", "./support/util"], factory); - } -})(function (require, exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - var has_1 = require("./support/has"); - var global_1 = require("./global"); - var util_1 = require("./support/util"); - exports.Symbol = global_1.default.Symbol; - if (!has_1.default('es6-symbol')) { - /** - * Throws if the value is not a symbol, used internally within the Shim - * @param {any} value The value to check - * @return {symbol} Returns the symbol or throws - */ - var validateSymbol_1 = function validateSymbol(value) { - if (!isSymbol(value)) { - throw new TypeError(value + ' is not a symbol'); - } - return value; - }; - var defineProperties_1 = Object.defineProperties; - var defineProperty_1 = Object.defineProperty; - var create_1 = Object.create; - var objPrototype_1 = Object.prototype; - var globalSymbols_1 = {}; - var getSymbolName_1 = (function () { - var created = create_1(null); - return function (desc) { - var postfix = 0; - var name; - while (created[String(desc) + (postfix || '')]) { - ++postfix; - } - desc += String(postfix || ''); - created[desc] = true; - name = '@@' + desc; - // FIXME: Temporary guard until the duplicate execution when testing can be - // pinned down. - if (!Object.getOwnPropertyDescriptor(objPrototype_1, name)) { - defineProperty_1(objPrototype_1, name, { - set: function (value) { - defineProperty_1(this, name, util_1.getValueDescriptor(value)); - } - }); - } - return name; - }; - })(); - var InternalSymbol_1 = function Symbol(description) { - if (this instanceof InternalSymbol_1) { - throw new TypeError('TypeError: Symbol is not a constructor'); - } - return Symbol(description); - }; - exports.Symbol = global_1.default.Symbol = function Symbol(description) { - if (this instanceof Symbol) { - throw new TypeError('TypeError: Symbol is not a constructor'); - } - var sym = Object.create(InternalSymbol_1.prototype); - description = description === undefined ? '' : String(description); - return defineProperties_1(sym, { - __description__: util_1.getValueDescriptor(description), - __name__: util_1.getValueDescriptor(getSymbolName_1(description)) - }); - }; - /* Decorate the Symbol function with the appropriate properties */ - defineProperty_1(exports.Symbol, 'for', util_1.getValueDescriptor(function (key) { - if (globalSymbols_1[key]) { - return globalSymbols_1[key]; - } - return (globalSymbols_1[key] = exports.Symbol(String(key))); - })); - defineProperties_1(exports.Symbol, { - keyFor: util_1.getValueDescriptor(function (sym) { - var key; - validateSymbol_1(sym); - for (key in globalSymbols_1) { - if (globalSymbols_1[key] === sym) { - return key; - } - } - }), - hasInstance: util_1.getValueDescriptor(exports.Symbol.for('hasInstance'), false, false), - isConcatSpreadable: util_1.getValueDescriptor(exports.Symbol.for('isConcatSpreadable'), false, false), - iterator: util_1.getValueDescriptor(exports.Symbol.for('iterator'), false, false), - match: util_1.getValueDescriptor(exports.Symbol.for('match'), false, false), - observable: util_1.getValueDescriptor(exports.Symbol.for('observable'), false, false), - replace: util_1.getValueDescriptor(exports.Symbol.for('replace'), false, false), - search: util_1.getValueDescriptor(exports.Symbol.for('search'), false, false), - species: util_1.getValueDescriptor(exports.Symbol.for('species'), false, false), - split: util_1.getValueDescriptor(exports.Symbol.for('split'), false, false), - toPrimitive: util_1.getValueDescriptor(exports.Symbol.for('toPrimitive'), false, false), - toStringTag: util_1.getValueDescriptor(exports.Symbol.for('toStringTag'), false, false), - unscopables: util_1.getValueDescriptor(exports.Symbol.for('unscopables'), false, false) - }); - /* Decorate the InternalSymbol object */ - defineProperties_1(InternalSymbol_1.prototype, { - constructor: util_1.getValueDescriptor(exports.Symbol), - toString: util_1.getValueDescriptor(function () { - return this.__name__; - }, false, false) - }); - /* Decorate the Symbol.prototype */ - defineProperties_1(exports.Symbol.prototype, { - toString: util_1.getValueDescriptor(function () { - return 'Symbol (' + validateSymbol_1(this).__description__ + ')'; - }), - valueOf: util_1.getValueDescriptor(function () { - return validateSymbol_1(this); - }) - }); - defineProperty_1(exports.Symbol.prototype, exports.Symbol.toPrimitive, util_1.getValueDescriptor(function () { - return validateSymbol_1(this); - })); - defineProperty_1(exports.Symbol.prototype, exports.Symbol.toStringTag, util_1.getValueDescriptor('Symbol', false, false, true)); - defineProperty_1(InternalSymbol_1.prototype, exports.Symbol.toPrimitive, util_1.getValueDescriptor(exports.Symbol.prototype[exports.Symbol.toPrimitive], false, false, true)); - defineProperty_1(InternalSymbol_1.prototype, exports.Symbol.toStringTag, util_1.getValueDescriptor(exports.Symbol.prototype[exports.Symbol.toStringTag], false, false, true)); - } - /** - * A custom guard function that determines if an object is a symbol or not - * @param {any} value The value to check to see if it is a symbol or not - * @return {is symbol} Returns true if a symbol or not (and narrows the type guard) - */ - function isSymbol(value) { - return (value && (typeof value === 'symbol' || value['@@toStringTag'] === 'Symbol')) || false; - } - exports.isSymbol = isSymbol; - /** - * Fill any missing well known symbols if the native Symbol is missing them - */ - [ - 'hasInstance', - 'isConcatSpreadable', - 'iterator', - 'species', - 'replace', - 'search', - 'split', - 'match', - 'toPrimitive', - 'toStringTag', - 'unscopables', - 'observable' - ].forEach(function (wellKnown) { - if (!exports.Symbol[wellKnown]) { - Object.defineProperty(exports.Symbol, wellKnown, util_1.getValueDescriptor(exports.Symbol.for(wellKnown), false, false)); - } - }); - exports.default = exports.Symbol; -}); -//# sourceMappingURL=Symbol.js.map \ No newline at end of file diff --git a/deps/framework/shim/Symbol.js.map b/deps/framework/shim/Symbol.js.map deleted file mode 100644 index aae60b1e3d..0000000000 --- a/deps/framework/shim/Symbol.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"Symbol.js","sourceRoot":"","sources":["Symbol.ts"],"names":[],"mappings":";;;;;;;;;;;IAAA,qCAAgC;IAChC,mCAA8B;IAC9B,uCAAoD;IAQzC,QAAA,MAAM,GAAsB,gBAAM,CAAC,MAAM,CAAC;IAErD,EAAE,CAAC,CAAC,CAAC,aAAG,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;QACxB;;;;WAIG;QACH,IAAM,gBAAc,GAAG,wBAAwB,KAAU;YACxD,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;gBACtB,MAAM,IAAI,SAAS,CAAC,KAAK,GAAG,kBAAkB,CAAC,CAAC;YACjD,CAAC;YACD,MAAM,CAAC,KAAK,CAAC;QACd,CAAC,CAAC;QAEF,IAAM,kBAAgB,GAAG,MAAM,CAAC,gBAAgB,CAAC;QACjD,IAAM,gBAAc,GAIT,MAAM,CAAC,cAAqB,CAAC;QACxC,IAAM,QAAM,GAAG,MAAM,CAAC,MAAM,CAAC;QAE7B,IAAM,cAAY,GAAG,MAAM,CAAC,SAAS,CAAC;QAEtC,IAAM,eAAa,GAA8B,EAAE,CAAC;QAEpD,IAAM,eAAa,GAAG,CAAC;YACtB,IAAM,OAAO,GAAG,QAAM,CAAC,IAAI,CAAC,CAAC;YAC7B,MAAM,CAAC,UAAS,IAAqB;gBACpC,IAAI,OAAO,GAAG,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,oBAAoB;QACpB,UAAU;QACV,SAAS;QACT,SAAS;QACT,QAAQ;QACR,OAAO;QACP,OAAO;QACP,aAAa;QACb,aAAa;QACb,aAAa;QACb,YAAY;KACZ,CAAC,OAAO,CAAC,UAAC,SAAS;QACnB,EAAE,CAAC,CAAC,CAAE,cAAc,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;YACjC,MAAM,CAAC,cAAc,CAAC,cAAM,EAAE,SAAS,EAAE,yBAAkB,CAAC,cAAM,CAAC,GAAG,CAAC,SAAS,CAAC,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC;QACnG,CAAC;IACF,CAAC,CAAC,CAAC;IAEH,kBAAe,cAAM,CAAC","sourcesContent":["import has from './support/has';\nimport global from './global';\nimport { getValueDescriptor } from './support/util';\n\ndeclare global {\n\tinterface SymbolConstructor {\n\t\tobservable: symbol;\n\t}\n}\n\nexport let Symbol: SymbolConstructor = global.Symbol;\n\nif (!has('es6-symbol')) {\n\t/**\n\t * Throws if the value is not a symbol, used internally within the Shim\n\t * @param {any} value The value to check\n\t * @return {symbol} Returns the symbol or throws\n\t */\n\tconst validateSymbol = function validateSymbol(value: any): symbol {\n\t\tif (!isSymbol(value)) {\n\t\t\tthrow new TypeError(value + ' is not a symbol');\n\t\t}\n\t\treturn value;\n\t};\n\n\tconst defineProperties = Object.defineProperties;\n\tconst defineProperty: (\n\t\to: any,\n\t\tp: string | symbol,\n\t\tattributes: PropertyDescriptor & ThisType\n\t) => any = Object.defineProperty as any;\n\tconst create = Object.create;\n\n\tconst objPrototype = Object.prototype;\n\n\tconst globalSymbols: { [key: string]: symbol } = {};\n\n\tconst getSymbolName = (function() {\n\t\tconst created = create(null);\n\t\treturn function(desc: string | number): string {\n\t\t\tlet postfix = 0;\n\t\t\tlet name: string;\n\t\t\twhile (created[String(desc) + (postfix || '')]) {\n\t\t\t\t++postfix;\n\t\t\t}\n\t\t\tdesc += String(postfix || '');\n\t\t\tcreated[desc] = true;\n\t\t\tname = '@@' + desc;\n\n\t\t\t// FIXME: Temporary guard until the duplicate execution when testing can be\n\t\t\t// pinned down.\n\t\t\tif (!Object.getOwnPropertyDescriptor(objPrototype, name)) {\n\t\t\t\tdefineProperty(objPrototype, name, {\n\t\t\t\t\tset: function(this: Symbol, value: any) {\n\t\t\t\t\t\tdefineProperty(this, name, getValueDescriptor(value));\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\n\t\t\treturn name;\n\t\t};\n\t})();\n\n\tconst InternalSymbol = function Symbol(this: any, description?: string | number): symbol {\n\t\tif (this instanceof InternalSymbol) {\n\t\t\tthrow new TypeError('TypeError: Symbol is not a constructor');\n\t\t}\n\t\treturn Symbol(description);\n\t};\n\n\tSymbol = global.Symbol = function Symbol(this: Symbol, description?: string | number): symbol {\n\t\tif (this instanceof Symbol) {\n\t\t\tthrow new TypeError('TypeError: Symbol is not a constructor');\n\t\t}\n\t\tconst sym = Object.create(InternalSymbol.prototype);\n\t\tdescription = description === undefined ? '' : String(description);\n\t\treturn defineProperties(sym, {\n\t\t\t__description__: getValueDescriptor(description),\n\t\t\t__name__: getValueDescriptor(getSymbolName(description))\n\t\t});\n\t} as SymbolConstructor;\n\n\t/* Decorate the Symbol function with the appropriate properties */\n\tdefineProperty(\n\t\tSymbol,\n\t\t'for',\n\t\tgetValueDescriptor(function(key: string): symbol {\n\t\t\tif (globalSymbols[key]) {\n\t\t\t\treturn globalSymbols[key];\n\t\t\t}\n\t\t\treturn (globalSymbols[key] = Symbol(String(key)));\n\t\t})\n\t);\n\tdefineProperties(Symbol, {\n\t\tkeyFor: getValueDescriptor(function(sym: symbol): string | undefined {\n\t\t\tlet key: string;\n\t\t\tvalidateSymbol(sym);\n\t\t\tfor (key in globalSymbols) {\n\t\t\t\tif (globalSymbols[key] === sym) {\n\t\t\t\t\treturn key;\n\t\t\t\t}\n\t\t\t}\n\t\t}),\n\t\thasInstance: getValueDescriptor(Symbol.for('hasInstance'), false, false),\n\t\tisConcatSpreadable: getValueDescriptor(Symbol.for('isConcatSpreadable'), false, false),\n\t\titerator: getValueDescriptor(Symbol.for('iterator'), false, false),\n\t\tmatch: getValueDescriptor(Symbol.for('match'), false, false),\n\t\tobservable: getValueDescriptor(Symbol.for('observable'), false, false),\n\t\treplace: getValueDescriptor(Symbol.for('replace'), false, false),\n\t\tsearch: getValueDescriptor(Symbol.for('search'), false, false),\n\t\tspecies: getValueDescriptor(Symbol.for('species'), false, false),\n\t\tsplit: getValueDescriptor(Symbol.for('split'), false, false),\n\t\ttoPrimitive: getValueDescriptor(Symbol.for('toPrimitive'), false, false),\n\t\ttoStringTag: getValueDescriptor(Symbol.for('toStringTag'), false, false),\n\t\tunscopables: getValueDescriptor(Symbol.for('unscopables'), false, false)\n\t});\n\n\t/* Decorate the InternalSymbol object */\n\tdefineProperties(InternalSymbol.prototype, {\n\t\tconstructor: getValueDescriptor(Symbol),\n\t\ttoString: getValueDescriptor(\n\t\t\tfunction(this: { __name__: string }) {\n\t\t\t\treturn this.__name__;\n\t\t\t},\n\t\t\tfalse,\n\t\t\tfalse\n\t\t)\n\t});\n\n\t/* Decorate the Symbol.prototype */\n\tdefineProperties(Symbol.prototype, {\n\t\ttoString: getValueDescriptor(function(this: Symbol) {\n\t\t\treturn 'Symbol (' + (validateSymbol(this)).__description__ + ')';\n\t\t}),\n\t\tvalueOf: getValueDescriptor(function(this: Symbol) {\n\t\t\treturn validateSymbol(this);\n\t\t})\n\t});\n\n\tdefineProperty(\n\t\tSymbol.prototype,\n\t\tSymbol.toPrimitive,\n\t\tgetValueDescriptor(function(this: Symbol) {\n\t\t\treturn validateSymbol(this);\n\t\t})\n\t);\n\tdefineProperty(Symbol.prototype, Symbol.toStringTag, getValueDescriptor('Symbol', false, false, true));\n\n\tdefineProperty(\n\t\tInternalSymbol.prototype,\n\t\tSymbol.toPrimitive,\n\t\tgetValueDescriptor((Symbol).prototype[Symbol.toPrimitive], false, false, true)\n\t);\n\tdefineProperty(\n\t\tInternalSymbol.prototype,\n\t\tSymbol.toStringTag,\n\t\tgetValueDescriptor((Symbol).prototype[Symbol.toStringTag], false, false, true)\n\t);\n}\n\n/**\n * A custom guard function that determines if an object is a symbol or not\n * @param {any} value The value to check to see if it is a symbol or not\n * @return {is symbol} Returns true if a symbol or not (and narrows the type guard)\n */\nexport function isSymbol(value: any): value is symbol {\n\treturn (value && (typeof value === 'symbol' || value['@@toStringTag'] === 'Symbol')) || false;\n}\n\n/**\n * Fill any missing well known symbols if the native Symbol is missing them\n */\n[\n\t'hasInstance',\n\t'isConcatSpreadable',\n\t'iterator',\n\t'species',\n\t'replace',\n\t'search',\n\t'split',\n\t'match',\n\t'toPrimitive',\n\t'toStringTag',\n\t'unscopables',\n\t'observable'\n].forEach((wellKnown) => {\n\tif (!(Symbol as any)[wellKnown]) {\n\t\tObject.defineProperty(Symbol, wellKnown, getValueDescriptor(Symbol.for(wellKnown), false, false));\n\t}\n});\n\nexport default Symbol;\n"]} \ No newline at end of file diff --git a/deps/framework/shim/Symbol.mjs b/deps/framework/shim/Symbol.mjs deleted file mode 100644 index c7ff9b0aea..0000000000 --- a/deps/framework/shim/Symbol.mjs +++ /dev/null @@ -1,145 +0,0 @@ -import has from './support/has'; -import global from './global'; -import { getValueDescriptor } from './support/util'; -export let Symbol = global.Symbol; -if (!has('es6-symbol')) { - /** - * Throws if the value is not a symbol, used internally within the Shim - * @param {any} value The value to check - * @return {symbol} Returns the symbol or throws - */ - const validateSymbol = function validateSymbol(value) { - if (!isSymbol(value)) { - throw new TypeError(value + ' is not a symbol'); - } - return value; - }; - const defineProperties = Object.defineProperties; - const defineProperty = Object.defineProperty; - const create = Object.create; - const objPrototype = Object.prototype; - const globalSymbols = {}; - const getSymbolName = (function () { - const created = create(null); - return function (desc) { - let postfix = 0; - let name; - while (created[String(desc) + (postfix || '')]) { - ++postfix; - } - desc += String(postfix || ''); - created[desc] = true; - name = '@@' + desc; - // FIXME: Temporary guard until the duplicate execution when testing can be - // pinned down. - if (!Object.getOwnPropertyDescriptor(objPrototype, name)) { - defineProperty(objPrototype, name, { - set: function (value) { - defineProperty(this, name, getValueDescriptor(value)); - } - }); - } - return name; - }; - })(); - const InternalSymbol = function Symbol(description) { - if (this instanceof InternalSymbol) { - throw new TypeError('TypeError: Symbol is not a constructor'); - } - return Symbol(description); - }; - Symbol = global.Symbol = function Symbol(description) { - if (this instanceof Symbol) { - throw new TypeError('TypeError: Symbol is not a constructor'); - } - const sym = Object.create(InternalSymbol.prototype); - description = description === undefined ? '' : String(description); - return defineProperties(sym, { - __description__: getValueDescriptor(description), - __name__: getValueDescriptor(getSymbolName(description)) - }); - }; - /* Decorate the Symbol function with the appropriate properties */ - defineProperty(Symbol, 'for', getValueDescriptor(function (key) { - if (globalSymbols[key]) { - return globalSymbols[key]; - } - return (globalSymbols[key] = Symbol(String(key))); - })); - defineProperties(Symbol, { - keyFor: getValueDescriptor(function (sym) { - let key; - validateSymbol(sym); - for (key in globalSymbols) { - if (globalSymbols[key] === sym) { - return key; - } - } - }), - hasInstance: getValueDescriptor(Symbol.for('hasInstance'), false, false), - isConcatSpreadable: getValueDescriptor(Symbol.for('isConcatSpreadable'), false, false), - iterator: getValueDescriptor(Symbol.for('iterator'), false, false), - match: getValueDescriptor(Symbol.for('match'), false, false), - observable: getValueDescriptor(Symbol.for('observable'), false, false), - replace: getValueDescriptor(Symbol.for('replace'), false, false), - search: getValueDescriptor(Symbol.for('search'), false, false), - species: getValueDescriptor(Symbol.for('species'), false, false), - split: getValueDescriptor(Symbol.for('split'), false, false), - toPrimitive: getValueDescriptor(Symbol.for('toPrimitive'), false, false), - toStringTag: getValueDescriptor(Symbol.for('toStringTag'), false, false), - unscopables: getValueDescriptor(Symbol.for('unscopables'), false, false) - }); - /* Decorate the InternalSymbol object */ - defineProperties(InternalSymbol.prototype, { - constructor: getValueDescriptor(Symbol), - toString: getValueDescriptor(function () { - return this.__name__; - }, false, false) - }); - /* Decorate the Symbol.prototype */ - defineProperties(Symbol.prototype, { - toString: getValueDescriptor(function () { - return 'Symbol (' + validateSymbol(this).__description__ + ')'; - }), - valueOf: getValueDescriptor(function () { - return validateSymbol(this); - }) - }); - defineProperty(Symbol.prototype, Symbol.toPrimitive, getValueDescriptor(function () { - return validateSymbol(this); - })); - defineProperty(Symbol.prototype, Symbol.toStringTag, getValueDescriptor('Symbol', false, false, true)); - defineProperty(InternalSymbol.prototype, Symbol.toPrimitive, getValueDescriptor(Symbol.prototype[Symbol.toPrimitive], false, false, true)); - defineProperty(InternalSymbol.prototype, Symbol.toStringTag, getValueDescriptor(Symbol.prototype[Symbol.toStringTag], false, false, true)); -} -/** - * A custom guard function that determines if an object is a symbol or not - * @param {any} value The value to check to see if it is a symbol or not - * @return {is symbol} Returns true if a symbol or not (and narrows the type guard) - */ -export function isSymbol(value) { - return (value && (typeof value === 'symbol' || value['@@toStringTag'] === 'Symbol')) || false; -} -/** - * Fill any missing well known symbols if the native Symbol is missing them - */ -[ - 'hasInstance', - 'isConcatSpreadable', - 'iterator', - 'species', - 'replace', - 'search', - 'split', - 'match', - 'toPrimitive', - 'toStringTag', - 'unscopables', - 'observable' -].forEach((wellKnown) => { - if (!Symbol[wellKnown]) { - Object.defineProperty(Symbol, wellKnown, getValueDescriptor(Symbol.for(wellKnown), false, false)); - } -}); -export default Symbol; -//# sourceMappingURL=Symbol.mjs.map \ No newline at end of file diff --git a/deps/framework/shim/Symbol.mjs.map b/deps/framework/shim/Symbol.mjs.map deleted file mode 100644 index b1dd1be98a..0000000000 --- a/deps/framework/shim/Symbol.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"Symbol.mjs","sourceRoot":"","sources":["Symbol.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,eAAe,CAAC;AAChC,OAAO,MAAM,MAAM,UAAU,CAAC;AAC9B,OAAO,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AAQpD,MAAM,CAAC,IAAI,MAAM,GAAsB,MAAM,CAAC,MAAM,CAAC;AAErD,EAAE,CAAC,C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IAAI,CAAC,CAAC,CAAC;IAEvG,cAAc,CACb,cAAc,CAAC,SAAS,EACxB,MAAM,CAAC,WAAW,EAClB,kBAAkB,CAAO,MAAO,CAAC,SAAS,CAAC,MAAM,CAAC,WAAW,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,CAAC,CACnF,CAAC;IACF,cAAc,CACb,cAAc,CAAC,SAAS,EACxB,MAAM,CAAC,WAAW,EAClB,kBAAkB,CAAO,MAAO,CAAC,SAAS,CAAC,MAAM,CAAC,WAAW,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,CAAC,CACnF,CAAC;AACH,CAAC;AAED;;;;GAIG;AACH,MAAM,mBAAmB,KAAU;IAClC,MAAM,CAAC,CAAC,KAAK,IAAI,CAAC,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,eAAe,CAAC,KAAK,QAAQ,CAAC,CAAC,IAAI,KAAK,CAAC;AAC/F,CAAC;AAED;;GAEG;AACH;IACC,aAAa;IACb,oBAAoB;IACpB,UAAU;IACV,SAAS;IACT,SAAS;IACT,QAAQ;IACR,OAAO;IACP,OAAO;IACP,aAAa;IACb,aAAa;IACb,aAAa;IACb,YAAY;CACZ,CAAC,OAAO,CAAC,CAAC,SAAS,EAAE,EAAE;IACvB,EAAE,CAAC,CAAC,CAAE,MAAc,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;QACjC,MAAM,CAAC,cAAc,CAAC,MAAM,EAAE,SAAS,EAAE,kBAAkB,CAAC,MAAM,CAAC,GAAG,CAAC,SAAS,CAAC,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC;IACnG,CAAC;AACF,CAAC,CAAC,CAAC;AAEH,eAAe,MAAM,CAAC","sourcesContent":["import has from './support/has';\nimport global from './global';\nimport { getValueDescriptor } from './support/util';\n\ndeclare global {\n\tinterface SymbolConstructor {\n\t\tobservable: symbol;\n\t}\n}\n\nexport let Symbol: SymbolConstructor = global.Symbol;\n\nif (!has('es6-symbol')) {\n\t/**\n\t * Throws if the value is not a symbol, used internally within the Shim\n\t * @param {any} value The value to check\n\t * @return {symbol} Returns the symbol or throws\n\t */\n\tconst validateSymbol = function validateSymbol(value: any): symbol {\n\t\tif (!isSymbol(value)) {\n\t\t\tthrow new TypeError(value + ' is not a symbol');\n\t\t}\n\t\treturn value;\n\t};\n\n\tconst defineProperties = Object.defineProperties;\n\tconst defineProperty: (\n\t\to: any,\n\t\tp: string | symbol,\n\t\tattributes: PropertyDescriptor & ThisType\n\t) => any = Object.defineProperty as any;\n\tconst create = Object.create;\n\n\tconst objPrototype = Object.prototype;\n\n\tconst globalSymbols: { [key: string]: symbol } = {};\n\n\tconst getSymbolName = (function() {\n\t\tconst created = create(null);\n\t\treturn function(desc: string | number): string {\n\t\t\tlet postfix = 0;\n\t\t\tlet name: string;\n\t\t\twhile (created[String(desc) + (postfix || '')]) {\n\t\t\t\t++postfix;\n\t\t\t}\n\t\t\tdesc += String(postfix || '');\n\t\t\tcreated[desc] = true;\n\t\t\tname = '@@' + desc;\n\n\t\t\t// FIXME: Temporary guard until the duplicate execution when testing can be\n\t\t\t// pinned down.\n\t\t\tif (!Object.getOwnPropertyDescriptor(objPrototype, name)) {\n\t\t\t\tdefineProperty(objPrototype, name, {\n\t\t\t\t\tset: function(this: Symbol, value: any) {\n\t\t\t\t\t\tdefineProperty(this, name, getValueDescriptor(value));\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\n\t\t\treturn name;\n\t\t};\n\t})();\n\n\tconst InternalSymbol = function Symbol(this: any, description?: string | number): symbol {\n\t\tif (this instanceof InternalSymbol) {\n\t\t\tthrow new TypeError('TypeError: Symbol is not a constructor');\n\t\t}\n\t\treturn Symbol(description);\n\t};\n\n\tSymbol = global.Symbol = function Symbol(this: Symbol, description?: string | number): symbol {\n\t\tif (this instanceof Symbol) {\n\t\t\tthrow new TypeError('TypeError: Symbol is not a constructor');\n\t\t}\n\t\tconst sym = Object.create(InternalSymbol.prototype);\n\t\tdescription = description === undefined ? '' : String(description);\n\t\treturn defineProperties(sym, {\n\t\t\t__description__: getValueDescriptor(description),\n\t\t\t__name__: getValueDescriptor(getSymbolName(description))\n\t\t});\n\t} as SymbolConstructor;\n\n\t/* Decorate the Symbol function with the appropriate properties */\n\tdefineProperty(\n\t\tSymbol,\n\t\t'for',\n\t\tgetValueDescriptor(function(key: string): symbol {\n\t\t\tif (globalSymbols[key]) {\n\t\t\t\treturn globalSymbols[key];\n\t\t\t}\n\t\t\treturn (globalSymbols[key] = Symbol(String(key)));\n\t\t})\n\t);\n\tdefineProperties(Symbol, {\n\t\tkeyFor: getValueDescriptor(function(sym: symbol): string | undefined {\n\t\t\tlet key: string;\n\t\t\tvalidateSymbol(sym);\n\t\t\tfor (key in globalSymbols) {\n\t\t\t\tif (globalSymbols[key] === sym) {\n\t\t\t\t\treturn key;\n\t\t\t\t}\n\t\t\t}\n\t\t}),\n\t\thasInstance: getValueDescriptor(Symbol.for('hasInstance'), false, false),\n\t\tisConcatSpreadable: getValueDescriptor(Symbol.for('isConcatSpreadable'), false, false),\n\t\titerator: getValueDescriptor(Symbol.for('iterator'), false, false),\n\t\tmatch: getValueDescriptor(Symbol.for('match'), false, false),\n\t\tobservable: getValueDescriptor(Symbol.for('observable'), false, false),\n\t\treplace: getValueDescriptor(Symbol.for('replace'), false, false),\n\t\tsearch: getValueDescriptor(Symbol.for('search'), false, false),\n\t\tspecies: getValueDescriptor(Symbol.for('species'), false, false),\n\t\tsplit: getValueDescriptor(Symbol.for('split'), false, false),\n\t\ttoPrimitive: getValueDescriptor(Symbol.for('toPrimitive'), false, false),\n\t\ttoStringTag: getValueDescriptor(Symbol.for('toStringTag'), false, false),\n\t\tunscopables: getValueDescriptor(Symbol.for('unscopables'), false, false)\n\t});\n\n\t/* Decorate the InternalSymbol object */\n\tdefineProperties(InternalSymbol.prototype, {\n\t\tconstructor: getValueDescriptor(Symbol),\n\t\ttoString: getValueDescriptor(\n\t\t\tfunction(this: { __name__: string }) {\n\t\t\t\treturn this.__name__;\n\t\t\t},\n\t\t\tfalse,\n\t\t\tfalse\n\t\t)\n\t});\n\n\t/* Decorate the Symbol.prototype */\n\tdefineProperties(Symbol.prototype, {\n\t\ttoString: getValueDescriptor(function(this: Symbol) {\n\t\t\treturn 'Symbol (' + (validateSymbol(this)).__description__ + ')';\n\t\t}),\n\t\tvalueOf: getValueDescriptor(function(this: Symbol) {\n\t\t\treturn validateSymbol(this);\n\t\t})\n\t});\n\n\tdefineProperty(\n\t\tSymbol.prototype,\n\t\tSymbol.toPrimitive,\n\t\tgetValueDescriptor(function(this: Symbol) {\n\t\t\treturn validateSymbol(this);\n\t\t})\n\t);\n\tdefineProperty(Symbol.prototype, Symbol.toStringTag, getValueDescriptor('Symbol', false, false, true));\n\n\tdefineProperty(\n\t\tInternalSymbol.prototype,\n\t\tSymbol.toPrimitive,\n\t\tgetValueDescriptor((Symbol).prototype[Symbol.toPrimitive], false, false, true)\n\t);\n\tdefineProperty(\n\t\tInternalSymbol.prototype,\n\t\tSymbol.toStringTag,\n\t\tgetValueDescriptor((Symbol).prototype[Symbol.toStringTag], false, false, true)\n\t);\n}\n\n/**\n * A custom guard function that determines if an object is a symbol or not\n * @param {any} value The value to check to see if it is a symbol or not\n * @return {is symbol} Returns true if a symbol or not (and narrows the type guard)\n */\nexport function isSymbol(value: any): value is symbol {\n\treturn (value && (typeof value === 'symbol' || value['@@toStringTag'] === 'Symbol')) || false;\n}\n\n/**\n * Fill any missing well known symbols if the native Symbol is missing them\n */\n[\n\t'hasInstance',\n\t'isConcatSpreadable',\n\t'iterator',\n\t'species',\n\t'replace',\n\t'search',\n\t'split',\n\t'match',\n\t'toPrimitive',\n\t'toStringTag',\n\t'unscopables',\n\t'observable'\n].forEach((wellKnown) => {\n\tif (!(Symbol as any)[wellKnown]) {\n\t\tObject.defineProperty(Symbol, wellKnown, getValueDescriptor(Symbol.for(wellKnown), false, false));\n\t}\n});\n\nexport default Symbol;\n"]} \ No newline at end of file diff --git a/deps/framework/shim/WeakMap.d.ts b/deps/framework/shim/WeakMap.d.ts deleted file mode 100644 index 51829dd20f..0000000000 --- a/deps/framework/shim/WeakMap.d.ts +++ /dev/null @@ -1,61 +0,0 @@ -import { Iterable } from './iterator'; -import './Symbol'; -export interface WeakMap { - /** - * Remove a `key` from the map - * - * @param key The key to remove - * @return `true` if the value was removed, otherwise `false` - */ - delete(key: K): boolean; - /** - * Retrieve the value, based on the supplied `key` - * - * @param key The key to retrieve the `value` for - * @return the `value` based on the `key` if found, otherwise `false` - */ - get(key: K): V | undefined; - /** - * Determines if a `key` is present in the map - * - * @param key The `key` to check - * @return `true` if the key is part of the map, otherwise `false`. - */ - has(key: K): boolean; - /** - * Set a `value` for a particular `key`. - * - * @param key The `key` to set the `value` for - * @param value The `value` to set - * @return the instances - */ - set(key: K, value: V): this; - readonly [Symbol.toStringTag]: 'WeakMap'; -} -export interface WeakMapConstructor { - /** - * Create a new instance of a `WeakMap` - * - * @constructor - */ - new (): WeakMap; - /** - * Create a new instance of a `WeakMap` - * - * @constructor - * - * @param iterable An iterable that contains yields up key/value pair entries - */ - new (iterable?: [K, V][]): WeakMap; - /** - * Create a new instance of a `WeakMap` - * - * @constructor - * - * @param iterable An iterable that contains yields up key/value pair entries - */ - new (iterable: Iterable<[K, V]>): WeakMap; - readonly prototype: WeakMap; -} -export declare let WeakMap: WeakMapConstructor; -export default WeakMap; diff --git a/deps/framework/shim/WeakMap.js b/deps/framework/shim/WeakMap.js deleted file mode 100644 index 175ac36d76..0000000000 --- a/deps/framework/shim/WeakMap.js +++ /dev/null @@ -1,136 +0,0 @@ -(function (factory) { - if (typeof module === "object" && typeof module.exports === "object") { - var v = factory(require, exports); - if (v !== undefined) module.exports = v; - } - else if (typeof define === "function" && define.amd) { - define(["require", "exports", "tslib", "./global", "./iterator", "./support/has", "./Symbol"], factory); - } -})(function (require, exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - var tslib_1 = require("tslib"); - var global_1 = require("./global"); - var iterator_1 = require("./iterator"); - var has_1 = require("./support/has"); - require("./Symbol"); - exports.WeakMap = global_1.default.WeakMap; - if (!has_1.default('es6-weakmap')) { - var DELETED_1 = {}; - var getUID_1 = function getUID() { - return Math.floor(Math.random() * 100000000); - }; - var generateName_1 = (function () { - var startId = Math.floor(Date.now() % 100000000); - return function generateName() { - return '__wm' + getUID_1() + (startId++ + '__'); - }; - })(); - exports.WeakMap = /** @class */ (function () { - function WeakMap(iterable) { - this[Symbol.toStringTag] = 'WeakMap'; - this._name = generateName_1(); - this._frozenEntries = []; - if (iterable) { - if (iterator_1.isArrayLike(iterable)) { - for (var i = 0; i < iterable.length; i++) { - var item = iterable[i]; - this.set(item[0], item[1]); - } - } - else { - try { - for (var iterable_1 = tslib_1.__values(iterable), iterable_1_1 = iterable_1.next(); !iterable_1_1.done; iterable_1_1 = iterable_1.next()) { - var _a = tslib_1.__read(iterable_1_1.value, 2), key = _a[0], value = _a[1]; - this.set(key, value); - } - } - catch (e_1_1) { e_1 = { error: e_1_1 }; } - finally { - try { - if (iterable_1_1 && !iterable_1_1.done && (_b = iterable_1.return)) _b.call(iterable_1); - } - finally { if (e_1) throw e_1.error; } - } - } - } - var e_1, _b; - } - WeakMap.prototype._getFrozenEntryIndex = function (key) { - for (var i = 0; i < this._frozenEntries.length; i++) { - if (this._frozenEntries[i].key === key) { - return i; - } - } - return -1; - }; - WeakMap.prototype.delete = function (key) { - if (key === undefined || key === null) { - return false; - } - var entry = key[this._name]; - if (entry && entry.key === key && entry.value !== DELETED_1) { - entry.value = DELETED_1; - return true; - } - var frozenIndex = this._getFrozenEntryIndex(key); - if (frozenIndex >= 0) { - this._frozenEntries.splice(frozenIndex, 1); - return true; - } - return false; - }; - WeakMap.prototype.get = function (key) { - if (key === undefined || key === null) { - return undefined; - } - var entry = key[this._name]; - if (entry && entry.key === key && entry.value !== DELETED_1) { - return entry.value; - } - var frozenIndex = this._getFrozenEntryIndex(key); - if (frozenIndex >= 0) { - return this._frozenEntries[frozenIndex].value; - } - }; - WeakMap.prototype.has = function (key) { - if (key === undefined || key === null) { - return false; - } - var entry = key[this._name]; - if (Boolean(entry && entry.key === key && entry.value !== DELETED_1)) { - return true; - } - var frozenIndex = this._getFrozenEntryIndex(key); - if (frozenIndex >= 0) { - return true; - } - return false; - }; - WeakMap.prototype.set = function (key, value) { - if (!key || (typeof key !== 'object' && typeof key !== 'function')) { - throw new TypeError('Invalid value used as weak map key'); - } - var entry = key[this._name]; - if (!entry || entry.key !== key) { - entry = Object.create(null, { - key: { value: key } - }); - if (Object.isFrozen(key)) { - this._frozenEntries.push(entry); - } - else { - Object.defineProperty(key, this._name, { - value: entry - }); - } - } - entry.value = value; - return this; - }; - return WeakMap; - }()); - } - exports.default = exports.WeakMap; -}); -//# sourceMappingURL=WeakMap.js.map \ No newline at end of file diff --git a/deps/framework/shim/WeakMap.js.map b/deps/framework/shim/WeakMap.js.map deleted file mode 100644 index 54e1145001..0000000000 --- a/deps/framework/shim/WeakMap.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"WeakMap.js","sourceRoot":"","sources":["WeakMap.ts"],"names":[],"mappings":";;;;;;;;;;;;IAAA,mCAA8B;IAC9B,uCAAmD;IACnD,qCAAgC;IAChC,oBAAkB;IAoEP,QAAA,OAAO,GAAuB,gBAAM,CAAC,OAAO,CAAC;IAOxD,EAAE,CAAC,CAAC,CAAC,aAAG,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC;QACzB,IAAM,SAAO,GAAQ,EAAE,CAAC;QAExB,IAAM,QAAM,GAAG;YACd,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,SAAS,CAAC,CAAC;QAC9C,CAAC,CAAC;QAEF,IAAM,cAAY,GAAG,CAAC;YACrB,IAAI,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,SAAS,CAAC,CAAC;YAEjD,MAAM,CAAC;gBACN,MAAM,CA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C,GAAG,KAAK,GAAG,CAAC,CAAC,CAAC;oBACjC,KAAK,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE;wBAC3B,GAAG,EAAE,EAAE,KAAK,EAAE,GAAG,EAAE;qBACnB,CAAC,CAAC;oBAEH,EAAE,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;wBAC1B,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;oBACjC,CAAC;oBAAC,IAAI,CAAC,CAAC;wBACP,MAAM,CAAC,cAAc,CAAC,GAAG,EAAE,IAAI,CAAC,KAAK,EAAE;4BACtC,KAAK,EAAE,KAAK;yBACZ,CAAC,CAAC;oBACJ,CAAC;gBACF,CAAC;gBACD,KAAK,CAAC,KAAK,GAAG,KAAK,CAAC;gBACpB,MAAM,CAAC,IAAI,CAAC;YACb,CAAC;YAGF,cAAC;QAAD,CAAC,AA9GS,GA8GT,CAAC;IACH,CAAC;IAED,kBAAe,eAAO,CAAC","sourcesContent":["import global from './global';\nimport { isArrayLike, Iterable } from './iterator';\nimport has from './support/has';\nimport './Symbol';\n\nexport interface WeakMap {\n\t/**\n\t * Remove a `key` from the map\n\t *\n\t * @param key The key to remove\n\t * @return `true` if the value was removed, otherwise `false`\n\t */\n\tdelete(key: K): boolean;\n\n\t/**\n\t * Retrieve the value, based on the supplied `key`\n\t *\n\t * @param key The key to retrieve the `value` for\n\t * @return the `value` based on the `key` if found, otherwise `false`\n\t */\n\tget(key: K): V | undefined;\n\n\t/**\n\t * Determines if a `key` is present in the map\n\t *\n\t * @param key The `key` to check\n\t * @return `true` if the key is part of the map, otherwise `false`.\n\t */\n\thas(key: K): boolean;\n\n\t/**\n\t * Set a `value` for a particular `key`.\n\t *\n\t * @param key The `key` to set the `value` for\n\t * @param value The `value` to set\n\t * @return the instances\n\t */\n\tset(key: K, value: V): this;\n\n\treadonly [Symbol.toStringTag]: 'WeakMap';\n}\n\nexport interface WeakMapConstructor {\n\t/**\n\t * Create a new instance of a `WeakMap`\n\t *\n\t * @constructor\n\t */\n\tnew (): WeakMap;\n\n\t/**\n\t * Create a new instance of a `WeakMap`\n\t *\n\t * @constructor\n\t *\n\t * @param iterable An iterable that contains yields up key/value pair entries\n\t */\n\tnew (iterable?: [K, V][]): WeakMap;\n\n\t/**\n\t * Create a new instance of a `WeakMap`\n\t *\n\t * @constructor\n\t *\n\t * @param iterable An iterable that contains yields up key/value pair entries\n\t */\n\tnew (iterable: Iterable<[K, V]>): WeakMap;\n\n\treadonly prototype: WeakMap;\n}\n\nexport let WeakMap: WeakMapConstructor = global.WeakMap;\n\ninterface Entry {\n\tkey: K;\n\tvalue: V;\n}\n\nif (!has('es6-weakmap')) {\n\tconst DELETED: any = {};\n\n\tconst getUID = function getUID(): number {\n\t\treturn Math.floor(Math.random() * 100000000);\n\t};\n\n\tconst generateName = (function() {\n\t\tlet startId = Math.floor(Date.now() % 100000000);\n\n\t\treturn function generateName(): string {\n\t\t\treturn '__wm' + getUID() + (startId++ + '__');\n\t\t};\n\t})();\n\n\tWeakMap = class WeakMap {\n\t\tprivate readonly _name: string;\n\t\tprivate readonly _frozenEntries: Entry[];\n\n\t\tconstructor(iterable?: ArrayLike<[K, V]> | Iterable<[K, V]>) {\n\t\t\tthis._name = generateName();\n\n\t\t\tthis._frozenEntries = [];\n\n\t\t\tif (iterable) {\n\t\t\t\tif (isArrayLike(iterable)) {\n\t\t\t\t\tfor (let i = 0; i < iterable.length; i++) {\n\t\t\t\t\t\tconst item = iterable[i];\n\t\t\t\t\t\tthis.set(item[0], item[1]);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tfor (const [key, value] of iterable) {\n\t\t\t\t\t\tthis.set(key, value);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tprivate _getFrozenEntryIndex(key: any): number {\n\t\t\tfor (let i = 0; i < this._frozenEntries.length; i++) {\n\t\t\t\tif (this._frozenEntries[i].key === key) {\n\t\t\t\t\treturn i;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn -1;\n\t\t}\n\n\t\tdelete(key: any): boolean {\n\t\t\tif (key === undefined || key === null) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tconst entry: Entry = key[this._name];\n\t\t\tif (entry && entry.key === key && entry.value !== DELETED) {\n\t\t\t\tentry.value = DELETED;\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\tconst frozenIndex = this._getFrozenEntryIndex(key);\n\t\t\tif (frozenIndex >= 0) {\n\t\t\t\tthis._frozenEntries.splice(frozenIndex, 1);\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\treturn false;\n\t\t}\n\n\t\tget(key: any): V | undefined {\n\t\t\tif (key === undefined || key === null) {\n\t\t\t\treturn undefined;\n\t\t\t}\n\n\t\t\tconst entry: Entry = key[this._name];\n\t\t\tif (entry && entry.key === key && entry.value !== DELETED) {\n\t\t\t\treturn entry.value;\n\t\t\t}\n\n\t\t\tconst frozenIndex = this._getFrozenEntryIndex(key);\n\t\t\tif (frozenIndex >= 0) {\n\t\t\t\treturn this._frozenEntries[frozenIndex].value;\n\t\t\t}\n\t\t}\n\n\t\thas(key: any): boolean {\n\t\t\tif (key === undefined || key === null) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tconst entry: Entry = key[this._name];\n\t\t\tif (Boolean(entry && entry.key === key && entry.value !== DELETED)) {\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\tconst frozenIndex = this._getFrozenEntryIndex(key);\n\t\t\tif (frozenIndex >= 0) {\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\treturn false;\n\t\t}\n\n\t\tset(key: any, value?: any): this {\n\t\t\tif (!key || (typeof key !== 'object' && typeof key !== 'function')) {\n\t\t\t\tthrow new TypeError('Invalid value used as weak map key');\n\t\t\t}\n\t\t\tlet entry: Entry = key[this._name];\n\t\t\tif (!entry || entry.key !== key) {\n\t\t\t\tentry = Object.create(null, {\n\t\t\t\t\tkey: { value: key }\n\t\t\t\t});\n\n\t\t\t\tif (Object.isFrozen(key)) {\n\t\t\t\t\tthis._frozenEntries.push(entry);\n\t\t\t\t} else {\n\t\t\t\t\tObject.defineProperty(key, this._name, {\n\t\t\t\t\t\tvalue: entry\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\t\t\tentry.value = value;\n\t\t\treturn this;\n\t\t}\n\n\t\t[Symbol.toStringTag]: 'WeakMap' = 'WeakMap';\n\t};\n}\n\nexport default WeakMap;\n"]} \ No newline at end of file diff --git a/deps/framework/shim/WeakMap.mjs b/deps/framework/shim/WeakMap.mjs deleted file mode 100644 index cd79ff949e..0000000000 --- a/deps/framework/shim/WeakMap.mjs +++ /dev/null @@ -1,111 +0,0 @@ -import global from './global'; -import { isArrayLike } from './iterator'; -import has from './support/has'; -import './Symbol'; -export let WeakMap = global.WeakMap; -if (!has('es6-weakmap')) { - const DELETED = {}; - const getUID = function getUID() { - return Math.floor(Math.random() * 100000000); - }; - const generateName = (function () { - let startId = Math.floor(Date.now() % 100000000); - return function generateName() { - return '__wm' + getUID() + (startId++ + '__'); - }; - })(); - WeakMap = class WeakMap { - constructor(iterable) { - this[Symbol.toStringTag] = 'WeakMap'; - this._name = generateName(); - this._frozenEntries = []; - if (iterable) { - if (isArrayLike(iterable)) { - for (let i = 0; i < iterable.length; i++) { - const item = iterable[i]; - this.set(item[0], item[1]); - } - } - else { - for (const [key, value] of iterable) { - this.set(key, value); - } - } - } - } - _getFrozenEntryIndex(key) { - for (let i = 0; i < this._frozenEntries.length; i++) { - if (this._frozenEntries[i].key === key) { - return i; - } - } - return -1; - } - delete(key) { - if (key === undefined || key === null) { - return false; - } - const entry = key[this._name]; - if (entry && entry.key === key && entry.value !== DELETED) { - entry.value = DELETED; - return true; - } - const frozenIndex = this._getFrozenEntryIndex(key); - if (frozenIndex >= 0) { - this._frozenEntries.splice(frozenIndex, 1); - return true; - } - return false; - } - get(key) { - if (key === undefined || key === null) { - return undefined; - } - const entry = key[this._name]; - if (entry && entry.key === key && entry.value !== DELETED) { - return entry.value; - } - const frozenIndex = this._getFrozenEntryIndex(key); - if (frozenIndex >= 0) { - return this._frozenEntries[frozenIndex].value; - } - } - has(key) { - if (key === undefined || key === null) { - return false; - } - const entry = key[this._name]; - if (Boolean(entry && entry.key === key && entry.value !== DELETED)) { - return true; - } - const frozenIndex = this._getFrozenEntryIndex(key); - if (frozenIndex >= 0) { - return true; - } - return false; - } - set(key, value) { - if (!key || (typeof key !== 'object' && typeof key !== 'function')) { - throw new TypeError('Invalid value used as weak map key'); - } - let entry = key[this._name]; - if (!entry || entry.key !== key) { - entry = Object.create(null, { - key: { value: key } - }); - if (Object.isFrozen(key)) { - this._frozenEntries.push(entry); - } - else { - Object.defineProperty(key, this._name, { - value: entry - }); - } - } - entry.value = value; - return this; - } - }; -} -export default WeakMap; -//# sourceMappingURL=WeakMap.mjs.map \ No newline at end of file diff --git a/deps/framework/shim/WeakMap.mjs.map b/deps/framework/shim/WeakMap.mjs.map deleted file mode 100644 index fd049b5287..0000000000 --- a/deps/framework/shim/WeakMap.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"WeakMap.mjs","sourceRoot":"","sources":["WeakMap.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,UAAU,CAAC;AAC9B,OAAO,EAAE,WAAW,EAAY,MAAM,YAAY,CAAC;AACnD,OAAO,GAAG,MAAM,eAAe,CAAC;AAChC,OAAO,UAAU,CAAC;AAoElB,MAAM,CAAC,IAAI,OAAO,GAAuB,MAAM,CAAC,OAAO,CAAC;AAOxD,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC;IACzB,MAAM,OAAO,GAAQ,EAAE,CAAC;IAExB,MAAM,MAAM,GAAG;QACd,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,SAAS,CAAC,CAAC;IA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,KAAK,CAAC,CAAC;YACzC,EAAE,CAAC,CAAC,CAAC,KAAK,IAAI,KAAK,CAAC,GAAG,KAAK,GAAG,CAAC,CAAC,CAAC;gBACjC,KAAK,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE;oBAC3B,GAAG,EAAE,EAAE,KAAK,EAAE,GAAG,EAAE;iBACnB,CAAC,CAAC;gBAEH,EAAE,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;oBAC1B,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;gBACjC,CAAC;gBAAC,IAAI,CAAC,CAAC;oBACP,MAAM,CAAC,cAAc,CAAC,GAAG,EAAE,IAAI,CAAC,KAAK,EAAE;wBACtC,KAAK,EAAE,KAAK;qBACZ,CAAC,CAAC;gBACJ,CAAC;YACF,CAAC;YACD,KAAK,CAAC,KAAK,GAAG,KAAK,CAAC;YACpB,MAAM,CAAC,IAAI,CAAC;QACb,CAAC;KAGD,CAAC;AACH,CAAC;AAED,eAAe,OAAO,CAAC","sourcesContent":["import global from './global';\nimport { isArrayLike, Iterable } from './iterator';\nimport has from './support/has';\nimport './Symbol';\n\nexport interface WeakMap {\n\t/**\n\t * Remove a `key` from the map\n\t *\n\t * @param key The key to remove\n\t * @return `true` if the value was removed, otherwise `false`\n\t */\n\tdelete(key: K): boolean;\n\n\t/**\n\t * Retrieve the value, based on the supplied `key`\n\t *\n\t * @param key The key to retrieve the `value` for\n\t * @return the `value` based on the `key` if found, otherwise `false`\n\t */\n\tget(key: K): V | undefined;\n\n\t/**\n\t * Determines if a `key` is present in the map\n\t *\n\t * @param key The `key` to check\n\t * @return `true` if the key is part of the map, otherwise `false`.\n\t */\n\thas(key: K): boolean;\n\n\t/**\n\t * Set a `value` for a particular `key`.\n\t *\n\t * @param key The `key` to set the `value` for\n\t * @param value The `value` to set\n\t * @return the instances\n\t */\n\tset(key: K, value: V): this;\n\n\treadonly [Symbol.toStringTag]: 'WeakMap';\n}\n\nexport interface WeakMapConstructor {\n\t/**\n\t * Create a new instance of a `WeakMap`\n\t *\n\t * @constructor\n\t */\n\tnew (): WeakMap;\n\n\t/**\n\t * Create a new instance of a `WeakMap`\n\t *\n\t * @constructor\n\t *\n\t * @param iterable An iterable that contains yields up key/value pair entries\n\t */\n\tnew (iterable?: [K, V][]): WeakMap;\n\n\t/**\n\t * Create a new instance of a `WeakMap`\n\t *\n\t * @constructor\n\t *\n\t * @param iterable An iterable that contains yields up key/value pair entries\n\t */\n\tnew (iterable: Iterable<[K, V]>): WeakMap;\n\n\treadonly prototype: WeakMap;\n}\n\nexport let WeakMap: WeakMapConstructor = global.WeakMap;\n\ninterface Entry {\n\tkey: K;\n\tvalue: V;\n}\n\nif (!has('es6-weakmap')) {\n\tconst DELETED: any = {};\n\n\tconst getUID = function getUID(): number {\n\t\treturn Math.floor(Math.random() * 100000000);\n\t};\n\n\tconst generateName = (function() {\n\t\tlet startId = Math.floor(Date.now() % 100000000);\n\n\t\treturn function generateName(): string {\n\t\t\treturn '__wm' + getUID() + (startId++ + '__');\n\t\t};\n\t})();\n\n\tWeakMap = class WeakMap {\n\t\tprivate readonly _name: string;\n\t\tprivate readonly _frozenEntries: Entry[];\n\n\t\tconstructor(iterable?: ArrayLike<[K, V]> | Iterable<[K, V]>) {\n\t\t\tthis._name = generateName();\n\n\t\t\tthis._frozenEntries = [];\n\n\t\t\tif (iterable) {\n\t\t\t\tif (isArrayLike(iterable)) {\n\t\t\t\t\tfor (let i = 0; i < iterable.length; i++) {\n\t\t\t\t\t\tconst item = iterable[i];\n\t\t\t\t\t\tthis.set(item[0], item[1]);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tfor (const [key, value] of iterable) {\n\t\t\t\t\t\tthis.set(key, value);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tprivate _getFrozenEntryIndex(key: any): number {\n\t\t\tfor (let i = 0; i < this._frozenEntries.length; i++) {\n\t\t\t\tif (this._frozenEntries[i].key === key) {\n\t\t\t\t\treturn i;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn -1;\n\t\t}\n\n\t\tdelete(key: any): boolean {\n\t\t\tif (key === undefined || key === null) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tconst entry: Entry = key[this._name];\n\t\t\tif (entry && entry.key === key && entry.value !== DELETED) {\n\t\t\t\tentry.value = DELETED;\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\tconst frozenIndex = this._getFrozenEntryIndex(key);\n\t\t\tif (frozenIndex >= 0) {\n\t\t\t\tthis._frozenEntries.splice(frozenIndex, 1);\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\treturn false;\n\t\t}\n\n\t\tget(key: any): V | undefined {\n\t\t\tif (key === undefined || key === null) {\n\t\t\t\treturn undefined;\n\t\t\t}\n\n\t\t\tconst entry: Entry = key[this._name];\n\t\t\tif (entry && entry.key === key && entry.value !== DELETED) {\n\t\t\t\treturn entry.value;\n\t\t\t}\n\n\t\t\tconst frozenIndex = this._getFrozenEntryIndex(key);\n\t\t\tif (frozenIndex >= 0) {\n\t\t\t\treturn this._frozenEntries[frozenIndex].value;\n\t\t\t}\n\t\t}\n\n\t\thas(key: any): boolean {\n\t\t\tif (key === undefined || key === null) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tconst entry: Entry = key[this._name];\n\t\t\tif (Boolean(entry && entry.key === key && entry.value !== DELETED)) {\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\tconst frozenIndex = this._getFrozenEntryIndex(key);\n\t\t\tif (frozenIndex >= 0) {\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\treturn false;\n\t\t}\n\n\t\tset(key: any, value?: any): this {\n\t\t\tif (!key || (typeof key !== 'object' && typeof key !== 'function')) {\n\t\t\t\tthrow new TypeError('Invalid value used as weak map key');\n\t\t\t}\n\t\t\tlet entry: Entry = key[this._name];\n\t\t\tif (!entry || entry.key !== key) {\n\t\t\t\tentry = Object.create(null, {\n\t\t\t\t\tkey: { value: key }\n\t\t\t\t});\n\n\t\t\t\tif (Object.isFrozen(key)) {\n\t\t\t\t\tthis._frozenEntries.push(entry);\n\t\t\t\t} else {\n\t\t\t\t\tObject.defineProperty(key, this._name, {\n\t\t\t\t\t\tvalue: entry\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\t\t\tentry.value = value;\n\t\t\treturn this;\n\t\t}\n\n\t\t[Symbol.toStringTag]: 'WeakMap' = 'WeakMap';\n\t};\n}\n\nexport default WeakMap;\n"]} \ No newline at end of file diff --git a/deps/framework/shim/array.d.ts b/deps/framework/shim/array.d.ts deleted file mode 100644 index ae644cbd7f..0000000000 --- a/deps/framework/shim/array.d.ts +++ /dev/null @@ -1,94 +0,0 @@ -import { Iterable } from './iterator'; -export interface MapCallback { - /** - * A callback function when mapping - * - * @param element The element that is currently being mapped - * @param index The current index of the element - */ - (element: T, index: number): U; -} -export interface FindCallback { - /** - * A callback function when using find - * - * @param element The element that is currenty being analysed - * @param index The current index of the element that is being analysed - * @param array The source array - */ - (element: T, index: number, array: ArrayLike): boolean; -} -export interface From { - /** - * The Array.from() method creates a new Array instance from an array-like or iterable object. - * - * @param source An array-like or iterable object to convert to an array - * @param mapFunction A map function to call on each element in the array - * @param thisArg The execution context for the map function - * @return The new Array - */ - (source: ArrayLike | Iterable, mapFunction: MapCallback, thisArg?: any): Array; - /** - * The Array.from() method creates a new Array instance from an array-like or iterable object. - * - * @param source An array-like or iterable object to convert to an array - * @return The new Array - */ - (source: ArrayLike | Iterable): Array; -} -export declare let from: From; -/** - * Creates a new array from the function parameters. - * - * @param arguments Any number of arguments for the array - * @return An array from the given arguments - */ -export declare let of: (...items: T[]) => Array; -/** - * Copies data internally within an array or array-like object. - * - * @param target The target array-like object - * @param offset The index to start copying values to; if negative, it counts backwards from length - * @param start The first (inclusive) index to copy; if negative, it counts backwards from length - * @param end The last (exclusive) index to copy; if negative, it counts backwards from length - * @return The target - */ -export declare let copyWithin: (target: ArrayLike, offset: number, start: number, end?: number) => ArrayLike; -/** - * Fills elements of an array-like object with the specified value. - * - * @param target The target to fill - * @param value The value to fill each element of the target with - * @param start The first index to fill - * @param end The (exclusive) index at which to stop filling - * @return The filled target - */ -export declare let fill: (target: ArrayLike, value: T, start?: number, end?: number) => ArrayLike; -/** - * Finds and returns the first instance matching the callback or undefined if one is not found. - * - * @param target An array-like object - * @param callback A function returning if the current value matches a criteria - * @param thisArg The execution context for the find function - * @return The first element matching the callback, or undefined if one does not exist - */ -export declare let find: (target: ArrayLike, callback: FindCallback, thisArg?: {}) => T | undefined; -/** - * Performs a linear search and returns the first index whose value satisfies the passed callback, - * or -1 if no values satisfy it. - * - * @param target An array-like object - * @param callback A function returning true if the current value satisfies its criteria - * @param thisArg The execution context for the find function - * @return The first index whose value satisfies the passed callback, or -1 if no values satisfy it - */ -export declare let findIndex: (target: ArrayLike, callback: FindCallback, thisArg?: {}) => number; -/** - * Determines whether an array includes a given value - * - * @param target the target array-like object - * @param searchElement the item to search for - * @param fromIndex the starting index to search from - * @return `true` if the array includes the element, otherwise `false` - */ -export declare let includes: (target: ArrayLike, searchElement: T, fromIndex?: number) => boolean; diff --git a/deps/framework/shim/array.js b/deps/framework/shim/array.js deleted file mode 100644 index edf114cdbf..0000000000 --- a/deps/framework/shim/array.js +++ /dev/null @@ -1,219 +0,0 @@ -(function (factory) { - if (typeof module === "object" && typeof module.exports === "object") { - var v = factory(require, exports); - if (v !== undefined) module.exports = v; - } - else if (typeof define === "function" && define.amd) { - define(["require", "exports", "tslib", "./global", "./iterator", "./number", "./support/has", "./support/util"], factory); - } -})(function (require, exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - var tslib_1 = require("tslib"); - var global_1 = require("./global"); - var iterator_1 = require("./iterator"); - var number_1 = require("./number"); - var has_1 = require("./support/has"); - var util_1 = require("./support/util"); - if (has_1.default('es6-array') && has_1.default('es6-array-fill')) { - exports.from = global_1.default.Array.from; - exports.of = global_1.default.Array.of; - exports.copyWithin = util_1.wrapNative(global_1.default.Array.prototype.copyWithin); - exports.fill = util_1.wrapNative(global_1.default.Array.prototype.fill); - exports.find = util_1.wrapNative(global_1.default.Array.prototype.find); - exports.findIndex = util_1.wrapNative(global_1.default.Array.prototype.findIndex); - } - else { - // It is only older versions of Safari/iOS that have a bad fill implementation and so aren't in the wild - // To make things easier, if there is a bad fill implementation, the whole set of functions will be filled - /** - * Ensures a non-negative, non-infinite, safe integer. - * - * @param length The number to validate - * @return A proper length - */ - var toLength_1 = function toLength(length) { - if (isNaN(length)) { - return 0; - } - length = Number(length); - if (isFinite(length)) { - length = Math.floor(length); - } - // Ensure a non-negative, real, safe integer - return Math.min(Math.max(length, 0), number_1.MAX_SAFE_INTEGER); - }; - /** - * From ES6 7.1.4 ToInteger() - * - * @param value A value to convert - * @return An integer - */ - var toInteger_1 = function toInteger(value) { - value = Number(value); - if (isNaN(value)) { - return 0; - } - if (value === 0 || !isFinite(value)) { - return value; - } - return (value > 0 ? 1 : -1) * Math.floor(Math.abs(value)); - }; - /** - * Normalizes an offset against a given length, wrapping it if negative. - * - * @param value The original offset - * @param length The total length to normalize against - * @return If negative, provide a distance from the end (length); otherwise provide a distance from 0 - */ - var normalizeOffset_1 = function normalizeOffset(value, length) { - return value < 0 ? Math.max(length + value, 0) : Math.min(value, length); - }; - exports.from = function from(arrayLike, mapFunction, thisArg) { - if (arrayLike == null) { - throw new TypeError('from: requires an array-like object'); - } - if (mapFunction && thisArg) { - mapFunction = mapFunction.bind(thisArg); - } - /* tslint:disable-next-line:variable-name */ - var Constructor = this; - var length = toLength_1(arrayLike.length); - // Support extension - var array = typeof Constructor === 'function' ? Object(new Constructor(length)) : new Array(length); - if (!iterator_1.isArrayLike(arrayLike) && !iterator_1.isIterable(arrayLike)) { - return array; - } - // if this is an array and the normalized length is 0, just return an empty array. this prevents a problem - // with the iteration on IE when using a NaN array length. - if (iterator_1.isArrayLike(arrayLike)) { - if (length === 0) { - return []; - } - for (var i = 0; i < arrayLike.length; i++) { - array[i] = mapFunction ? mapFunction(arrayLike[i], i) : arrayLike[i]; - } - } - else { - var i = 0; - try { - for (var arrayLike_1 = tslib_1.__values(arrayLike), arrayLike_1_1 = arrayLike_1.next(); !arrayLike_1_1.done; arrayLike_1_1 = arrayLike_1.next()) { - var value = arrayLike_1_1.value; - array[i] = mapFunction ? mapFunction(value, i) : value; - i++; - } - } - catch (e_1_1) { e_1 = { error: e_1_1 }; } - finally { - try { - if (arrayLike_1_1 && !arrayLike_1_1.done && (_a = arrayLike_1.return)) _a.call(arrayLike_1); - } - finally { if (e_1) throw e_1.error; } - } - } - if (arrayLike.length !== undefined) { - array.length = length; - } - return array; - var e_1, _a; - }; - exports.of = function of() { - var items = []; - for (var _i = 0; _i < arguments.length; _i++) { - items[_i] = arguments[_i]; - } - return Array.prototype.slice.call(items); - }; - exports.copyWithin = function copyWithin(target, offset, start, end) { - if (target == null) { - throw new TypeError('copyWithin: target must be an array-like object'); - } - var length = toLength_1(target.length); - offset = normalizeOffset_1(toInteger_1(offset), length); - start = normalizeOffset_1(toInteger_1(start), length); - end = normalizeOffset_1(end === undefined ? length : toInteger_1(end), length); - var count = Math.min(end - start, length - offset); - var direction = 1; - if (offset > start && offset < start + count) { - direction = -1; - start += count - 1; - offset += count - 1; - } - while (count > 0) { - if (start in target) { - target[offset] = target[start]; - } - else { - delete target[offset]; - } - offset += direction; - start += direction; - count--; - } - return target; - }; - exports.fill = function fill(target, value, start, end) { - var length = toLength_1(target.length); - var i = normalizeOffset_1(toInteger_1(start), length); - end = normalizeOffset_1(end === undefined ? length : toInteger_1(end), length); - while (i < end) { - target[i++] = value; - } - return target; - }; - exports.find = function find(target, callback, thisArg) { - var index = exports.findIndex(target, callback, thisArg); - return index !== -1 ? target[index] : undefined; - }; - exports.findIndex = function findIndex(target, callback, thisArg) { - var length = toLength_1(target.length); - if (!callback) { - throw new TypeError('find: second argument must be a function'); - } - if (thisArg) { - callback = callback.bind(thisArg); - } - for (var i = 0; i < length; i++) { - if (callback(target[i], i, target)) { - return i; - } - } - return -1; - }; - } - if (has_1.default('es7-array')) { - exports.includes = util_1.wrapNative(global_1.default.Array.prototype.includes); - } - else { - /** - * Ensures a non-negative, non-infinite, safe integer. - * - * @param length The number to validate - * @return A proper length - */ - var toLength_2 = function toLength(length) { - length = Number(length); - if (isNaN(length)) { - return 0; - } - if (isFinite(length)) { - length = Math.floor(length); - } - // Ensure a non-negative, real, safe integer - return Math.min(Math.max(length, 0), number_1.MAX_SAFE_INTEGER); - }; - exports.includes = function includes(target, searchElement, fromIndex) { - if (fromIndex === void 0) { fromIndex = 0; } - var len = toLength_2(target.length); - for (var i = fromIndex; i < len; ++i) { - var currentElement = target[i]; - if (searchElement === currentElement || - (searchElement !== searchElement && currentElement !== currentElement)) { - return true; - } - } - return false; - }; - } -}); -//# sourceMappingURL=array.js.map \ No newline at end of file diff --git a/deps/framework/shim/array.js.map b/deps/framework/shim/array.js.map deleted file mode 100644 index 3126b4b194..0000000000 --- a/deps/framework/shim/array.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"array.js","sourceRoot":"","sources":["array.ts"],"names":[],"mappings":";;;;;;;;;;;;IAAA,mCAA8B;IAC9B,uCAA+D;IAC/D,mCAA4C;IAC5C,qCAAgC;IAChC,uCAA4C;IAqH5C,EAAE,CAAC,CAAC,aAAG,CAAC,WAAW,CAAC,IAAI,aAAG,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC;QAC/C,YAAI,GAAG,gBAAM,CAAC,KAAK,CAAC,IAAI,CAAC;QACzB,UAAE,GAAG,gBAAM,CAAC,KAAK,CAAC,EAAE,CAAC;QACrB,kBAAU,GAAG,iBAAU,CAAC,gBAAM,CAAC,KAAK,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC;QAC3D,YAAI,GAAG,iBAAU,CAAC,gBAAM,CAAC,KAAK,CAAC,SAAS,CAAC,IAAI,CAAC,CAA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CAAC,CACF,aAAa,KAAK,cAAc;oBAChC,CAAC,aAAa,KAAK,aAAa,IAAI,cAAc,KAAK,cAAc,CACtE,CAAC,CAAC,CAAC;oBACF,MAAM,CAAC,IAAI,CAAC;gBACb,CAAC;YACF,CAAC;YAED,MAAM,CAAC,KAAK,CAAC;QACd,CAAC,CAAC;IACH,CAAC","sourcesContent":["import global from './global';\nimport { isArrayLike, isIterable, Iterable } from './iterator';\nimport { MAX_SAFE_INTEGER } from './number';\nimport has from './support/has';\nimport { wrapNative } from './support/util';\n\nexport interface MapCallback {\n\t/**\n\t * A callback function when mapping\n\t *\n\t * @param element The element that is currently being mapped\n\t * @param index The current index of the element\n\t */\n\t(element: T, index: number): U;\n}\n\nexport interface FindCallback {\n\t/**\n\t * A callback function when using find\n\t *\n\t * @param element The element that is currenty being analysed\n\t * @param index The current index of the element that is being analysed\n\t * @param array The source array\n\t */\n\t(element: T, index: number, array: ArrayLike): boolean;\n}\n\ninterface WritableArrayLike {\n\treadonly length: number;\n\t[n: number]: T;\n}\n\n/* ES6 Array static methods */\n\nexport interface From {\n\t/**\n\t * The Array.from() method creates a new Array instance from an array-like or iterable object.\n\t *\n\t * @param source An array-like or iterable object to convert to an array\n\t * @param mapFunction A map function to call on each element in the array\n\t * @param thisArg The execution context for the map function\n\t * @return The new Array\n\t */\n\t(source: ArrayLike | Iterable, mapFunction: MapCallback, thisArg?: any): Array;\n\n\t/**\n\t * The Array.from() method creates a new Array instance from an array-like or iterable object.\n\t *\n\t * @param source An array-like or iterable object to convert to an array\n\t * @return The new Array\n\t */\n\t(source: ArrayLike | Iterable): Array;\n}\n\nexport let from: From;\n\n/**\n * Creates a new array from the function parameters.\n *\n * @param arguments Any number of arguments for the array\n * @return An array from the given arguments\n */\nexport let of: (...items: T[]) => Array;\n\n/* ES6 Array instance methods */\n\n/**\n * Copies data internally within an array or array-like object.\n *\n * @param target The target array-like object\n * @param offset The index to start copying values to; if negative, it counts backwards from length\n * @param start The first (inclusive) index to copy; if negative, it counts backwards from length\n * @param end The last (exclusive) index to copy; if negative, it counts backwards from length\n * @return The target\n */\nexport let copyWithin: (target: ArrayLike, offset: number, start: number, end?: number) => ArrayLike;\n\n/**\n * Fills elements of an array-like object with the specified value.\n *\n * @param target The target to fill\n * @param value The value to fill each element of the target with\n * @param start The first index to fill\n * @param end The (exclusive) index at which to stop filling\n * @return The filled target\n */\nexport let fill: (target: ArrayLike, value: T, start?: number, end?: number) => ArrayLike;\n\n/**\n * Finds and returns the first instance matching the callback or undefined if one is not found.\n *\n * @param target An array-like object\n * @param callback A function returning if the current value matches a criteria\n * @param thisArg The execution context for the find function\n * @return The first element matching the callback, or undefined if one does not exist\n */\nexport let find: (target: ArrayLike, callback: FindCallback, thisArg?: {}) => T | undefined;\n\n/**\n * Performs a linear search and returns the first index whose value satisfies the passed callback,\n * or -1 if no values satisfy it.\n *\n * @param target An array-like object\n * @param callback A function returning true if the current value satisfies its criteria\n * @param thisArg The execution context for the find function\n * @return The first index whose value satisfies the passed callback, or -1 if no values satisfy it\n */\nexport let findIndex: (target: ArrayLike, callback: FindCallback, thisArg?: {}) => number;\n\n/* ES7 Array instance methods */\n\n/**\n * Determines whether an array includes a given value\n *\n * @param target the target array-like object\n * @param searchElement the item to search for\n * @param fromIndex the starting index to search from\n * @return `true` if the array includes the element, otherwise `false`\n */\nexport let includes: (target: ArrayLike, searchElement: T, fromIndex?: number) => boolean;\n\nif (has('es6-array') && has('es6-array-fill')) {\n\tfrom = global.Array.from;\n\tof = global.Array.of;\n\tcopyWithin = wrapNative(global.Array.prototype.copyWithin);\n\tfill = wrapNative(global.Array.prototype.fill);\n\tfind = wrapNative(global.Array.prototype.find);\n\tfindIndex = wrapNative(global.Array.prototype.findIndex);\n} else {\n\t// It is only older versions of Safari/iOS that have a bad fill implementation and so aren't in the wild\n\t// To make things easier, if there is a bad fill implementation, the whole set of functions will be filled\n\n\t/**\n\t * Ensures a non-negative, non-infinite, safe integer.\n\t *\n\t * @param length The number to validate\n\t * @return A proper length\n\t */\n\tconst toLength = function toLength(length: number): number {\n\t\tif (isNaN(length)) {\n\t\t\treturn 0;\n\t\t}\n\n\t\tlength = Number(length);\n\t\tif (isFinite(length)) {\n\t\t\tlength = Math.floor(length);\n\t\t}\n\t\t// Ensure a non-negative, real, safe integer\n\t\treturn Math.min(Math.max(length, 0), MAX_SAFE_INTEGER);\n\t};\n\n\t/**\n\t * From ES6 7.1.4 ToInteger()\n\t *\n\t * @param value A value to convert\n\t * @return An integer\n\t */\n\tconst toInteger = function toInteger(value: any): number {\n\t\tvalue = Number(value);\n\t\tif (isNaN(value)) {\n\t\t\treturn 0;\n\t\t}\n\t\tif (value === 0 || !isFinite(value)) {\n\t\t\treturn value;\n\t\t}\n\n\t\treturn (value > 0 ? 1 : -1) * Math.floor(Math.abs(value));\n\t};\n\n\t/**\n\t * Normalizes an offset against a given length, wrapping it if negative.\n\t *\n\t * @param value The original offset\n\t * @param length The total length to normalize against\n\t * @return If negative, provide a distance from the end (length); otherwise provide a distance from 0\n\t */\n\tconst normalizeOffset = function normalizeOffset(value: number, length: number): number {\n\t\treturn value < 0 ? Math.max(length + value, 0) : Math.min(value, length);\n\t};\n\n\tfrom = function from(\n\t\tthis: ArrayConstructor,\n\t\tarrayLike: Iterable | ArrayLike,\n\t\tmapFunction?: MapCallback,\n\t\tthisArg?: any\n\t): Array {\n\t\tif (arrayLike == null) {\n\t\t\tthrow new TypeError('from: requires an array-like object');\n\t\t}\n\n\t\tif (mapFunction && thisArg) {\n\t\t\tmapFunction = mapFunction.bind(thisArg);\n\t\t}\n\n\t\t/* tslint:disable-next-line:variable-name */\n\t\tconst Constructor = this;\n\t\tconst length: number = toLength((arrayLike).length);\n\n\t\t// Support extension\n\t\tconst array: any[] =\n\t\t\ttypeof Constructor === 'function' ? Object(new Constructor(length)) : new Array(length);\n\n\t\tif (!isArrayLike(arrayLike) && !isIterable(arrayLike)) {\n\t\t\treturn array;\n\t\t}\n\n\t\t// if this is an array and the normalized length is 0, just return an empty array. this prevents a problem\n\t\t// with the iteration on IE when using a NaN array length.\n\t\tif (isArrayLike(arrayLike)) {\n\t\t\tif (length === 0) {\n\t\t\t\treturn [];\n\t\t\t}\n\n\t\t\tfor (let i = 0; i < arrayLike.length; i++) {\n\t\t\t\tarray[i] = mapFunction ? mapFunction(arrayLike[i], i) : arrayLike[i];\n\t\t\t}\n\t\t} else {\n\t\t\tlet i = 0;\n\t\t\tfor (const value of arrayLike) {\n\t\t\t\tarray[i] = mapFunction ? mapFunction(value, i) : value;\n\t\t\t\ti++;\n\t\t\t}\n\t\t}\n\n\t\tif ((arrayLike).length !== undefined) {\n\t\t\tarray.length = length;\n\t\t}\n\n\t\treturn array;\n\t};\n\n\tof = function of(...items: T[]): Array {\n\t\treturn Array.prototype.slice.call(items);\n\t};\n\n\tcopyWithin = function copyWithin(\n\t\ttarget: ArrayLike,\n\t\toffset: number,\n\t\tstart: number,\n\t\tend?: number\n\t): ArrayLike {\n\t\tif (target == null) {\n\t\t\tthrow new TypeError('copyWithin: target must be an array-like object');\n\t\t}\n\n\t\tconst length = toLength(target.length);\n\t\toffset = normalizeOffset(toInteger(offset), length);\n\t\tstart = normalizeOffset(toInteger(start), length);\n\t\tend = normalizeOffset(end === undefined ? length : toInteger(end), length);\n\t\tlet count = Math.min(end - start, length - offset);\n\n\t\tlet direction = 1;\n\t\tif (offset > start && offset < start + count) {\n\t\t\tdirection = -1;\n\t\t\tstart += count - 1;\n\t\t\toffset += count - 1;\n\t\t}\n\n\t\twhile (count > 0) {\n\t\t\tif (start in target) {\n\t\t\t\t(target as WritableArrayLike)[offset] = target[start];\n\t\t\t} else {\n\t\t\t\tdelete (target as WritableArrayLike)[offset];\n\t\t\t}\n\n\t\t\toffset += direction;\n\t\t\tstart += direction;\n\t\t\tcount--;\n\t\t}\n\n\t\treturn target;\n\t};\n\n\tfill = function fill(target: ArrayLike, value: any, start?: number, end?: number): ArrayLike {\n\t\tconst length = toLength(target.length);\n\t\tlet i = normalizeOffset(toInteger(start), length);\n\t\tend = normalizeOffset(end === undefined ? length : toInteger(end), length);\n\n\t\twhile (i < end) {\n\t\t\t(target as WritableArrayLike)[i++] = value;\n\t\t}\n\n\t\treturn target;\n\t};\n\n\tfind = function find(target: ArrayLike, callback: FindCallback, thisArg?: {}): T | undefined {\n\t\tconst index = findIndex(target, callback, thisArg);\n\t\treturn index !== -1 ? target[index] : undefined;\n\t};\n\n\tfindIndex = function findIndex(target: ArrayLike, callback: FindCallback, thisArg?: {}): number {\n\t\tconst length = toLength(target.length);\n\n\t\tif (!callback) {\n\t\t\tthrow new TypeError('find: second argument must be a function');\n\t\t}\n\n\t\tif (thisArg) {\n\t\t\tcallback = callback.bind(thisArg);\n\t\t}\n\n\t\tfor (let i = 0; i < length; i++) {\n\t\t\tif (callback(target[i], i, target)) {\n\t\t\t\treturn i;\n\t\t\t}\n\t\t}\n\n\t\treturn -1;\n\t};\n}\n\nif (has('es7-array')) {\n\tincludes = wrapNative(global.Array.prototype.includes);\n} else {\n\t/**\n\t * Ensures a non-negative, non-infinite, safe integer.\n\t *\n\t * @param length The number to validate\n\t * @return A proper length\n\t */\n\tconst toLength = function toLength(length: number): number {\n\t\tlength = Number(length);\n\t\tif (isNaN(length)) {\n\t\t\treturn 0;\n\t\t}\n\t\tif (isFinite(length)) {\n\t\t\tlength = Math.floor(length);\n\t\t}\n\t\t// Ensure a non-negative, real, safe integer\n\t\treturn Math.min(Math.max(length, 0), MAX_SAFE_INTEGER);\n\t};\n\n\tincludes = function includes(target: ArrayLike, searchElement: T, fromIndex: number = 0): boolean {\n\t\tlet len = toLength(target.length);\n\n\t\tfor (let i = fromIndex; i < len; ++i) {\n\t\t\tconst currentElement = target[i];\n\t\t\tif (\n\t\t\t\tsearchElement === currentElement ||\n\t\t\t\t(searchElement !== searchElement && currentElement !== currentElement)\n\t\t\t) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t};\n}\n"]} \ No newline at end of file diff --git a/deps/framework/shim/array.mjs b/deps/framework/shim/array.mjs deleted file mode 100644 index ed5fcbfc35..0000000000 --- a/deps/framework/shim/array.mjs +++ /dev/null @@ -1,248 +0,0 @@ -import global from './global'; -import { isArrayLike, isIterable } from './iterator'; -import { MAX_SAFE_INTEGER } from './number'; -import has from './support/has'; -import { wrapNative } from './support/util'; -export let from; -/** - * Creates a new array from the function parameters. - * - * @param arguments Any number of arguments for the array - * @return An array from the given arguments - */ -export let of; -/* ES6 Array instance methods */ -/** - * Copies data internally within an array or array-like object. - * - * @param target The target array-like object - * @param offset The index to start copying values to; if negative, it counts backwards from length - * @param start The first (inclusive) index to copy; if negative, it counts backwards from length - * @param end The last (exclusive) index to copy; if negative, it counts backwards from length - * @return The target - */ -export let copyWithin; -/** - * Fills elements of an array-like object with the specified value. - * - * @param target The target to fill - * @param value The value to fill each element of the target with - * @param start The first index to fill - * @param end The (exclusive) index at which to stop filling - * @return The filled target - */ -export let fill; -/** - * Finds and returns the first instance matching the callback or undefined if one is not found. - * - * @param target An array-like object - * @param callback A function returning if the current value matches a criteria - * @param thisArg The execution context for the find function - * @return The first element matching the callback, or undefined if one does not exist - */ -export let find; -/** - * Performs a linear search and returns the first index whose value satisfies the passed callback, - * or -1 if no values satisfy it. - * - * @param target An array-like object - * @param callback A function returning true if the current value satisfies its criteria - * @param thisArg The execution context for the find function - * @return The first index whose value satisfies the passed callback, or -1 if no values satisfy it - */ -export let findIndex; -/* ES7 Array instance methods */ -/** - * Determines whether an array includes a given value - * - * @param target the target array-like object - * @param searchElement the item to search for - * @param fromIndex the starting index to search from - * @return `true` if the array includes the element, otherwise `false` - */ -export let includes; -if (has('es6-array') && has('es6-array-fill')) { - from = global.Array.from; - of = global.Array.of; - copyWithin = wrapNative(global.Array.prototype.copyWithin); - fill = wrapNative(global.Array.prototype.fill); - find = wrapNative(global.Array.prototype.find); - findIndex = wrapNative(global.Array.prototype.findIndex); -} -else { - // It is only older versions of Safari/iOS that have a bad fill implementation and so aren't in the wild - // To make things easier, if there is a bad fill implementation, the whole set of functions will be filled - /** - * Ensures a non-negative, non-infinite, safe integer. - * - * @param length The number to validate - * @return A proper length - */ - const toLength = function toLength(length) { - if (isNaN(length)) { - return 0; - } - length = Number(length); - if (isFinite(length)) { - length = Math.floor(length); - } - // Ensure a non-negative, real, safe integer - return Math.min(Math.max(length, 0), MAX_SAFE_INTEGER); - }; - /** - * From ES6 7.1.4 ToInteger() - * - * @param value A value to convert - * @return An integer - */ - const toInteger = function toInteger(value) { - value = Number(value); - if (isNaN(value)) { - return 0; - } - if (value === 0 || !isFinite(value)) { - return value; - } - return (value > 0 ? 1 : -1) * Math.floor(Math.abs(value)); - }; - /** - * Normalizes an offset against a given length, wrapping it if negative. - * - * @param value The original offset - * @param length The total length to normalize against - * @return If negative, provide a distance from the end (length); otherwise provide a distance from 0 - */ - const normalizeOffset = function normalizeOffset(value, length) { - return value < 0 ? Math.max(length + value, 0) : Math.min(value, length); - }; - from = function from(arrayLike, mapFunction, thisArg) { - if (arrayLike == null) { - throw new TypeError('from: requires an array-like object'); - } - if (mapFunction && thisArg) { - mapFunction = mapFunction.bind(thisArg); - } - /* tslint:disable-next-line:variable-name */ - const Constructor = this; - const length = toLength(arrayLike.length); - // Support extension - const array = typeof Constructor === 'function' ? Object(new Constructor(length)) : new Array(length); - if (!isArrayLike(arrayLike) && !isIterable(arrayLike)) { - return array; - } - // if this is an array and the normalized length is 0, just return an empty array. this prevents a problem - // with the iteration on IE when using a NaN array length. - if (isArrayLike(arrayLike)) { - if (length === 0) { - return []; - } - for (let i = 0; i < arrayLike.length; i++) { - array[i] = mapFunction ? mapFunction(arrayLike[i], i) : arrayLike[i]; - } - } - else { - let i = 0; - for (const value of arrayLike) { - array[i] = mapFunction ? mapFunction(value, i) : value; - i++; - } - } - if (arrayLike.length !== undefined) { - array.length = length; - } - return array; - }; - of = function of(...items) { - return Array.prototype.slice.call(items); - }; - copyWithin = function copyWithin(target, offset, start, end) { - if (target == null) { - throw new TypeError('copyWithin: target must be an array-like object'); - } - const length = toLength(target.length); - offset = normalizeOffset(toInteger(offset), length); - start = normalizeOffset(toInteger(start), length); - end = normalizeOffset(end === undefined ? length : toInteger(end), length); - let count = Math.min(end - start, length - offset); - let direction = 1; - if (offset > start && offset < start + count) { - direction = -1; - start += count - 1; - offset += count - 1; - } - while (count > 0) { - if (start in target) { - target[offset] = target[start]; - } - else { - delete target[offset]; - } - offset += direction; - start += direction; - count--; - } - return target; - }; - fill = function fill(target, value, start, end) { - const length = toLength(target.length); - let i = normalizeOffset(toInteger(start), length); - end = normalizeOffset(end === undefined ? length : toInteger(end), length); - while (i < end) { - target[i++] = value; - } - return target; - }; - find = function find(target, callback, thisArg) { - const index = findIndex(target, callback, thisArg); - return index !== -1 ? target[index] : undefined; - }; - findIndex = function findIndex(target, callback, thisArg) { - const length = toLength(target.length); - if (!callback) { - throw new TypeError('find: second argument must be a function'); - } - if (thisArg) { - callback = callback.bind(thisArg); - } - for (let i = 0; i < length; i++) { - if (callback(target[i], i, target)) { - return i; - } - } - return -1; - }; -} -if (has('es7-array')) { - includes = wrapNative(global.Array.prototype.includes); -} -else { - /** - * Ensures a non-negative, non-infinite, safe integer. - * - * @param length The number to validate - * @return A proper length - */ - const toLength = function toLength(length) { - length = Number(length); - if (isNaN(length)) { - return 0; - } - if (isFinite(length)) { - length = Math.floor(length); - } - // Ensure a non-negative, real, safe integer - return Math.min(Math.max(length, 0), MAX_SAFE_INTEGER); - }; - includes = function includes(target, searchElement, fromIndex = 0) { - let len = toLength(target.length); - for (let i = fromIndex; i < len; ++i) { - const currentElement = target[i]; - if (searchElement === currentElement || - (searchElement !== searchElement && currentElement !== currentElement)) { - return true; - } - } - return false; - }; -} -//# sourceMappingURL=array.mjs.map \ No newline at end of file diff --git a/deps/framework/shim/array.mjs.map b/deps/framework/shim/array.mjs.map deleted file mode 100644 index 0f184e027f..0000000000 --- a/deps/framework/shim/array.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"array.mjs","sourceRoot":"","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KAAK,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC;AACxD,CAAC;AAAC,IAAI,CAAC,CAAC;IACP;;;;;OAKG;IACH,MAAM,QAAQ,GAAG,kBAAkB,MAAc;QAChD,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC;QACxB,EAAE,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;YACnB,MAAM,CAAC,CAAC,CAAC;QACV,CAAC;QACD,EAAE,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;YACtB,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;QAC7B,CAAC;QACD,4CAA4C;QAC5C,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,MAAM,EAAE,CAAC,CAAC,EAAE,gBAAgB,CAAC,CAAC;IACxD,CAAC,CAAC;IAEF,QAAQ,GAAG,kBAAqB,MAAoB,EAAE,aAAgB,EAAE,YAAoB,CAAC;QAC5F,IAAI,GAAG,GAAG,QAAQ,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;QAElC,GAAG,CAAC,CAAC,IAAI,CAAC,GAAG,SAAS,EAAE,CAAC,GAAG,GAAG,EAAE,EAAE,CAAC,EAAE,CAAC;YACtC,MAAM,cAAc,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;YACjC,EAAE,CAAC,CACF,aAAa,KAAK,cAAc;gBAChC,CAAC,aAAa,KAAK,aAAa,IAAI,cAAc,KAAK,cAAc,CACtE,CAAC,CAAC,CAAC;gBACF,MAAM,CAAC,IAAI,CAAC;YACb,CAAC;QACF,CAAC;QAED,MAAM,CAAC,KAAK,CAAC;IACd,CAAC,CAAC;AACH,CAAC","sourcesContent":["import global from './global';\nimport { isArrayLike, isIterable, Iterable } from './iterator';\nimport { MAX_SAFE_INTEGER } from './number';\nimport has from './support/has';\nimport { wrapNative } from './support/util';\n\nexport interface MapCallback {\n\t/**\n\t * A callback function when mapping\n\t *\n\t * @param element The element that is currently being mapped\n\t * @param index The current index of the element\n\t */\n\t(element: T, index: number): U;\n}\n\nexport interface FindCallback {\n\t/**\n\t * A callback function when using find\n\t *\n\t * @param element The element that is currenty being analysed\n\t * @param index The current index of the element that is being analysed\n\t * @param array The source array\n\t */\n\t(element: T, index: number, array: ArrayLike): boolean;\n}\n\ninterface WritableArrayLike {\n\treadonly length: number;\n\t[n: number]: T;\n}\n\n/* ES6 Array static methods */\n\nexport interface From {\n\t/**\n\t * The Array.from() method creates a new Array instance from an array-like or iterable object.\n\t *\n\t * @param source An array-like or iterable object to convert to an array\n\t * @param mapFunction A map function to call on each element in the array\n\t * @param thisArg The execution context for the map function\n\t * @return The new Array\n\t */\n\t(source: ArrayLike | Iterable, mapFunction: MapCallback, thisArg?: any): Array;\n\n\t/**\n\t * The Array.from() method creates a new Array instance from an array-like or iterable object.\n\t *\n\t * @param source An array-like or iterable object to convert to an array\n\t * @return The new Array\n\t */\n\t(source: ArrayLike | Iterable): Array;\n}\n\nexport let from: From;\n\n/**\n * Creates a new array from the function parameters.\n *\n * @param arguments Any number of arguments for the array\n * @return An array from the given arguments\n */\nexport let of: (...items: T[]) => Array;\n\n/* ES6 Array instance methods */\n\n/**\n * Copies data internally within an array or array-like object.\n *\n * @param target The target array-like object\n * @param offset The index to start copying values to; if negative, it counts backwards from length\n * @param start The first (inclusive) index to copy; if negative, it counts backwards from length\n * @param end The last (exclusive) index to copy; if negative, it counts backwards from length\n * @return The target\n */\nexport let copyWithin: (target: ArrayLike, offset: number, start: number, end?: number) => ArrayLike;\n\n/**\n * Fills elements of an array-like object with the specified value.\n *\n * @param target The target to fill\n * @param value The value to fill each element of the target with\n * @param start The first index to fill\n * @param end The (exclusive) index at which to stop filling\n * @return The filled target\n */\nexport let fill: (target: ArrayLike, value: T, start?: number, end?: number) => ArrayLike;\n\n/**\n * Finds and returns the first instance matching the callback or undefined if one is not found.\n *\n * @param target An array-like object\n * @param callback A function returning if the current value matches a criteria\n * @param thisArg The execution context for the find function\n * @return The first element matching the callback, or undefined if one does not exist\n */\nexport let find: (target: ArrayLike, callback: FindCallback, thisArg?: {}) => T | undefined;\n\n/**\n * Performs a linear search and returns the first index whose value satisfies the passed callback,\n * or -1 if no values satisfy it.\n *\n * @param target An array-like object\n * @param callback A function returning true if the current value satisfies its criteria\n * @param thisArg The execution context for the find function\n * @return The first index whose value satisfies the passed callback, or -1 if no values satisfy it\n */\nexport let findIndex: (target: ArrayLike, callback: FindCallback, thisArg?: {}) => number;\n\n/* ES7 Array instance methods */\n\n/**\n * Determines whether an array includes a given value\n *\n * @param target the target array-like object\n * @param searchElement the item to search for\n * @param fromIndex the starting index to search from\n * @return `true` if the array includes the element, otherwise `false`\n */\nexport let includes: (target: ArrayLike, searchElement: T, fromIndex?: number) => boolean;\n\nif (has('es6-array') && has('es6-array-fill')) {\n\tfrom = global.Array.from;\n\tof = global.Array.of;\n\tcopyWithin = wrapNative(global.Array.prototype.copyWithin);\n\tfill = wrapNative(global.Array.prototype.fill);\n\tfind = wrapNative(global.Array.prototype.find);\n\tfindIndex = wrapNative(global.Array.prototype.findIndex);\n} else {\n\t// It is only older versions of Safari/iOS that have a bad fill implementation and so aren't in the wild\n\t// To make things easier, if there is a bad fill implementation, the whole set of functions will be filled\n\n\t/**\n\t * Ensures a non-negative, non-infinite, safe integer.\n\t *\n\t * @param length The number to validate\n\t * @return A proper length\n\t */\n\tconst toLength = function toLength(length: number): number {\n\t\tif (isNaN(length)) {\n\t\t\treturn 0;\n\t\t}\n\n\t\tlength = Number(length);\n\t\tif (isFinite(length)) {\n\t\t\tlength = Math.floor(length);\n\t\t}\n\t\t// Ensure a non-negative, real, safe integer\n\t\treturn Math.min(Math.max(length, 0), MAX_SAFE_INTEGER);\n\t};\n\n\t/**\n\t * From ES6 7.1.4 ToInteger()\n\t *\n\t * @param value A value to convert\n\t * @return An integer\n\t */\n\tconst toInteger = function toInteger(value: any): number {\n\t\tvalue = Number(value);\n\t\tif (isNaN(value)) {\n\t\t\treturn 0;\n\t\t}\n\t\tif (value === 0 || !isFinite(value)) {\n\t\t\treturn value;\n\t\t}\n\n\t\treturn (value > 0 ? 1 : -1) * Math.floor(Math.abs(value));\n\t};\n\n\t/**\n\t * Normalizes an offset against a given length, wrapping it if negative.\n\t *\n\t * @param value The original offset\n\t * @param length The total length to normalize against\n\t * @return If negative, provide a distance from the end (length); otherwise provide a distance from 0\n\t */\n\tconst normalizeOffset = function normalizeOffset(value: number, length: number): number {\n\t\treturn value < 0 ? Math.max(length + value, 0) : Math.min(value, length);\n\t};\n\n\tfrom = function from(\n\t\tthis: ArrayConstructor,\n\t\tarrayLike: Iterable | ArrayLike,\n\t\tmapFunction?: MapCallback,\n\t\tthisArg?: any\n\t): Array {\n\t\tif (arrayLike == null) {\n\t\t\tthrow new TypeError('from: requires an array-like object');\n\t\t}\n\n\t\tif (mapFunction && thisArg) {\n\t\t\tmapFunction = mapFunction.bind(thisArg);\n\t\t}\n\n\t\t/* tslint:disable-next-line:variable-name */\n\t\tconst Constructor = this;\n\t\tconst length: number = toLength((arrayLike).length);\n\n\t\t// Support extension\n\t\tconst array: any[] =\n\t\t\ttypeof Constructor === 'function' ? Object(new Constructor(length)) : new Array(length);\n\n\t\tif (!isArrayLike(arrayLike) && !isIterable(arrayLike)) {\n\t\t\treturn array;\n\t\t}\n\n\t\t// if this is an array and the normalized length is 0, just return an empty array. this prevents a problem\n\t\t// with the iteration on IE when using a NaN array length.\n\t\tif (isArrayLike(arrayLike)) {\n\t\t\tif (length === 0) {\n\t\t\t\treturn [];\n\t\t\t}\n\n\t\t\tfor (let i = 0; i < arrayLike.length; i++) {\n\t\t\t\tarray[i] = mapFunction ? mapFunction(arrayLike[i], i) : arrayLike[i];\n\t\t\t}\n\t\t} else {\n\t\t\tlet i = 0;\n\t\t\tfor (const value of arrayLike) {\n\t\t\t\tarray[i] = mapFunction ? mapFunction(value, i) : value;\n\t\t\t\ti++;\n\t\t\t}\n\t\t}\n\n\t\tif ((arrayLike).length !== undefined) {\n\t\t\tarray.length = length;\n\t\t}\n\n\t\treturn array;\n\t};\n\n\tof = function of(...items: T[]): Array {\n\t\treturn Array.prototype.slice.call(items);\n\t};\n\n\tcopyWithin = function copyWithin(\n\t\ttarget: ArrayLike,\n\t\toffset: number,\n\t\tstart: number,\n\t\tend?: number\n\t): ArrayLike {\n\t\tif (target == null) {\n\t\t\tthrow new TypeError('copyWithin: target must be an array-like object');\n\t\t}\n\n\t\tconst length = toLength(target.length);\n\t\toffset = normalizeOffset(toInteger(offset), length);\n\t\tstart = normalizeOffset(toInteger(start), length);\n\t\tend = normalizeOffset(end === undefined ? length : toInteger(end), length);\n\t\tlet count = Math.min(end - start, length - offset);\n\n\t\tlet direction = 1;\n\t\tif (offset > start && offset < start + count) {\n\t\t\tdirection = -1;\n\t\t\tstart += count - 1;\n\t\t\toffset += count - 1;\n\t\t}\n\n\t\twhile (count > 0) {\n\t\t\tif (start in target) {\n\t\t\t\t(target as WritableArrayLike)[offset] = target[start];\n\t\t\t} else {\n\t\t\t\tdelete (target as WritableArrayLike)[offset];\n\t\t\t}\n\n\t\t\toffset += direction;\n\t\t\tstart += direction;\n\t\t\tcount--;\n\t\t}\n\n\t\treturn target;\n\t};\n\n\tfill = function fill(target: ArrayLike, value: any, start?: number, end?: number): ArrayLike {\n\t\tconst length = toLength(target.length);\n\t\tlet i = normalizeOffset(toInteger(start), length);\n\t\tend = normalizeOffset(end === undefined ? length : toInteger(end), length);\n\n\t\twhile (i < end) {\n\t\t\t(target as WritableArrayLike)[i++] = value;\n\t\t}\n\n\t\treturn target;\n\t};\n\n\tfind = function find(target: ArrayLike, callback: FindCallback, thisArg?: {}): T | undefined {\n\t\tconst index = findIndex(target, callback, thisArg);\n\t\treturn index !== -1 ? target[index] : undefined;\n\t};\n\n\tfindIndex = function findIndex(target: ArrayLike, callback: FindCallback, thisArg?: {}): number {\n\t\tconst length = toLength(target.length);\n\n\t\tif (!callback) {\n\t\t\tthrow new TypeError('find: second argument must be a function');\n\t\t}\n\n\t\tif (thisArg) {\n\t\t\tcallback = callback.bind(thisArg);\n\t\t}\n\n\t\tfor (let i = 0; i < length; i++) {\n\t\t\tif (callback(target[i], i, target)) {\n\t\t\t\treturn i;\n\t\t\t}\n\t\t}\n\n\t\treturn -1;\n\t};\n}\n\nif (has('es7-array')) {\n\tincludes = wrapNative(global.Array.prototype.includes);\n} else {\n\t/**\n\t * Ensures a non-negative, non-infinite, safe integer.\n\t *\n\t * @param length The number to validate\n\t * @return A proper length\n\t */\n\tconst toLength = function toLength(length: number): number {\n\t\tlength = Number(length);\n\t\tif (isNaN(length)) {\n\t\t\treturn 0;\n\t\t}\n\t\tif (isFinite(length)) {\n\t\t\tlength = Math.floor(length);\n\t\t}\n\t\t// Ensure a non-negative, real, safe integer\n\t\treturn Math.min(Math.max(length, 0), MAX_SAFE_INTEGER);\n\t};\n\n\tincludes = function includes(target: ArrayLike, searchElement: T, fromIndex: number = 0): boolean {\n\t\tlet len = toLength(target.length);\n\n\t\tfor (let i = fromIndex; i < len; ++i) {\n\t\t\tconst currentElement = target[i];\n\t\t\tif (\n\t\t\t\tsearchElement === currentElement ||\n\t\t\t\t(searchElement !== searchElement && currentElement !== currentElement)\n\t\t\t) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t};\n}\n"]} \ No newline at end of file diff --git a/deps/framework/shim/browser.d.ts b/deps/framework/shim/browser.d.ts deleted file mode 100644 index a2b440b693..0000000000 --- a/deps/framework/shim/browser.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import 'pepjs'; -import 'intersection-observer'; -import 'web-animations-js/web-animations-next-lite.min'; diff --git a/deps/framework/shim/browser.js b/deps/framework/shim/browser.js deleted file mode 100644 index e424aef0e8..0000000000 --- a/deps/framework/shim/browser.js +++ /dev/null @@ -1,19 +0,0 @@ -(function (factory) { - if (typeof module === "object" && typeof module.exports === "object") { - var v = factory(require, exports); - if (v !== undefined) module.exports = v; - } - else if (typeof define === "function" && define.amd) { - define(["require", "exports", "pepjs", "intersection-observer", "web-animations-js/web-animations-next-lite.min"], factory); - } -})(function (require, exports) { - "use strict"; - "!has('dom-pointer-events')"; - Object.defineProperty(exports, "__esModule", { value: true }); - require("pepjs"); - "!has('dom-intersection-observer')"; - require("intersection-observer"); - "!has('dom-webanimation')"; - require("web-animations-js/web-animations-next-lite.min"); -}); -//# sourceMappingURL=browser.js.map \ No newline at end of file diff --git a/deps/framework/shim/browser.js.map b/deps/framework/shim/browser.js.map deleted file mode 100644 index 21a80b1571..0000000000 --- a/deps/framework/shim/browser.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"browser.js","sourceRoot":"","sources":["browser.ts"],"names":[],"mappings":";;;;;;;;;;IAAA,4BAA4B,CAAC;;IAC7B,iBAAe;IAEf,mCAAmC,CAAC;IACpC,iCAA+B;IAE/B,0BAA0B,CAAC;IAC3B,0DAAwD","sourcesContent":["`!has('dom-pointer-events')`;\nimport 'pepjs';\n\n`!has('dom-intersection-observer')`;\nimport 'intersection-observer';\n\n`!has('dom-webanimation')`;\nimport 'web-animations-js/web-animations-next-lite.min';\n"]} \ No newline at end of file diff --git a/deps/framework/shim/browser.mjs b/deps/framework/shim/browser.mjs deleted file mode 100644 index d835fd497b..0000000000 --- a/deps/framework/shim/browser.mjs +++ /dev/null @@ -1,7 +0,0 @@ -`!has('dom-pointer-events')`; -import 'pepjs'; -`!has('dom-intersection-observer')`; -import 'intersection-observer'; -`!has('dom-webanimation')`; -import 'web-animations-js/web-animations-next-lite.min'; -//# sourceMappingURL=browser.mjs.map \ No newline at end of file diff --git a/deps/framework/shim/browser.mjs.map b/deps/framework/shim/browser.mjs.map deleted file mode 100644 index cf85ed479c..0000000000 --- a/deps/framework/shim/browser.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"browser.mjs","sourceRoot":"","sources":["browser.ts"],"names":[],"mappings":"AAAA,4BAA4B,CAAC;AAC7B,OAAO,OAAO,CAAC;AAEf,mCAAmC,CAAC;AACpC,OAAO,uBAAuB,CAAC;AAE/B,0BAA0B,CAAC;AAC3B,OAAO,gDAAgD,CAAC","sourcesContent":["`!has('dom-pointer-events')`;\nimport 'pepjs';\n\n`!has('dom-intersection-observer')`;\nimport 'intersection-observer';\n\n`!has('dom-webanimation')`;\nimport 'web-animations-js/web-animations-next-lite.min';\n"]} \ No newline at end of file diff --git a/deps/framework/shim/global.d.ts b/deps/framework/shim/global.d.ts deleted file mode 100644 index 7d31b589bb..0000000000 --- a/deps/framework/shim/global.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -declare const globalObject: any; -export default globalObject; diff --git a/deps/framework/shim/global.js b/deps/framework/shim/global.js deleted file mode 100644 index dd8eec357b..0000000000 --- a/deps/framework/shim/global.js +++ /dev/null @@ -1,30 +0,0 @@ -(function (factory) { - if (typeof module === "object" && typeof module.exports === "object") { - var v = factory(require, exports); - if (v !== undefined) module.exports = v; - } - else if (typeof define === "function" && define.amd) { - define(["require", "exports"], factory); - } -})(function (require, exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - var globalObject = (function () { - if (typeof global !== 'undefined') { - // global spec defines a reference to the global object called 'global' - // https://github.com/tc39/proposal-global - // `global` is also defined in NodeJS - return global; - } - else if (typeof window !== 'undefined') { - // window is defined in browsers - return window; - } - else if (typeof self !== 'undefined') { - // self is defined in WebWorkers - return self; - } - })(); - exports.default = globalObject; -}); -//# sourceMappingURL=global.js.map \ No newline at end of file diff --git a/deps/framework/shim/global.js.map b/deps/framework/shim/global.js.map deleted file mode 100644 index 772d56ab12..0000000000 --- a/deps/framework/shim/global.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"global.js","sourceRoot":"","sources":["global.ts"],"names":[],"mappings":";;;;;;;;;;;IAAA,IAAM,YAAY,GAAQ,CAAC;QAC1B,EAAE,CAAC,CAAC,OAAO,MAAM,KAAK,WAAW,CAAC,CAAC,CAAC;YACnC,uEAAuE;YACvE,0CAA0C;YAC1C,qCAAqC;YACrC,MAAM,CAAC,MAAM,CAAC;QACf,CAAC;QAAC,IAAI,CAAC,EAAE,CAAC,CAAC,OAAO,MAAM,KAAK,WAAW,CAAC,CAAC,CAAC;YAC1C,gCAAgC;YAChC,MAAM,CAAC,MAAM,CAAC;QACf,CAAC;QAAC,IAAI,CAAC,EAAE,CAAC,CAAC,OAAO,IAAI,KAAK,WAAW,CAAC,CAAC,CAAC;YACxC,gCAAgC;YAChC,MAAM,CAAC,IAAI,CAAC;QACb,CAAC;IACF,CAAC,CAAC,EAAE,CAAC;IAEL,kBAAe,YAAY,CAAC","sourcesContent":["const globalObject: any = (function(): any {\n\tif (typeof global !== 'undefined') {\n\t\t// global spec defines a reference to the global object called 'global'\n\t\t// https://github.com/tc39/proposal-global\n\t\t// `global` is also defined in NodeJS\n\t\treturn global;\n\t} else if (typeof window !== 'undefined') {\n\t\t// window is defined in browsers\n\t\treturn window;\n\t} else if (typeof self !== 'undefined') {\n\t\t// self is defined in WebWorkers\n\t\treturn self;\n\t}\n})();\n\nexport default globalObject;\n"]} \ No newline at end of file diff --git a/deps/framework/shim/global.mjs b/deps/framework/shim/global.mjs deleted file mode 100644 index 7d2600716f..0000000000 --- a/deps/framework/shim/global.mjs +++ /dev/null @@ -1,18 +0,0 @@ -const globalObject = (function () { - if (typeof global !== 'undefined') { - // global spec defines a reference to the global object called 'global' - // https://github.com/tc39/proposal-global - // `global` is also defined in NodeJS - return global; - } - else if (typeof window !== 'undefined') { - // window is defined in browsers - return window; - } - else if (typeof self !== 'undefined') { - // self is defined in WebWorkers - return self; - } -})(); -export default globalObject; -//# sourceMappingURL=global.mjs.map \ No newline at end of file diff --git a/deps/framework/shim/global.mjs.map b/deps/framework/shim/global.mjs.map deleted file mode 100644 index 618c8472c1..0000000000 --- a/deps/framework/shim/global.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"global.mjs","sourceRoot":"","sources":["global.ts"],"names":[],"mappings":"AAAA,MAAM,YAAY,GAAQ,CAAC;IAC1B,EAAE,CAAC,CAAC,OAAO,MAAM,KAAK,WAAW,CAAC,CAAC,CAAC;QACnC,uEAAuE;QACvE,0CAA0C;QAC1C,qCAAqC;QACrC,MAAM,CAAC,MAAM,CAAC;IACf,CAAC;IAAC,IAAI,CAAC,EAAE,CAAC,CAAC,OAAO,MAAM,KAAK,WAAW,CAAC,CAAC,CAAC;QAC1C,gCAAgC;QAChC,MAAM,CAAC,MAAM,CAAC;IACf,CAAC;IAAC,IAAI,CAAC,EAAE,CAAC,CAAC,OAAO,IAAI,KAAK,WAAW,CAAC,CAAC,CAAC;QACxC,gCAAgC;QAChC,MAAM,CAAC,IAAI,CAAC;IACb,CAAC;AACF,CAAC,CAAC,EAAE,CAAC;AAEL,eAAe,YAAY,CAAC","sourcesContent":["const globalObject: any = (function(): any {\n\tif (typeof global !== 'undefined') {\n\t\t// global spec defines a reference to the global object called 'global'\n\t\t// https://github.com/tc39/proposal-global\n\t\t// `global` is also defined in NodeJS\n\t\treturn global;\n\t} else if (typeof window !== 'undefined') {\n\t\t// window is defined in browsers\n\t\treturn window;\n\t} else if (typeof self !== 'undefined') {\n\t\t// self is defined in WebWorkers\n\t\treturn self;\n\t}\n})();\n\nexport default globalObject;\n"]} \ No newline at end of file diff --git a/deps/framework/shim/interfaces.d.ts b/deps/framework/shim/interfaces.d.ts deleted file mode 100644 index 5940b21a5f..0000000000 --- a/deps/framework/shim/interfaces.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -export interface Handle { - /** - * Perform the destruction/cleanup logic associated with this handle - */ - destroy(): void; -} - -/** - * Something that is _thenable_ - * @deprecated Use `PromiseLike` from TypeScript lib instead - */ -export type Thenable = PromiseLike; diff --git a/deps/framework/shim/iterator.d.ts b/deps/framework/shim/iterator.d.ts deleted file mode 100644 index c312c2e4f9..0000000000 --- a/deps/framework/shim/iterator.d.ts +++ /dev/null @@ -1,66 +0,0 @@ -import './Symbol'; -export interface IteratorResult { - readonly done: boolean; - readonly value: T; -} -export interface Iterator { - next(value?: any): IteratorResult; - return?(value?: any): IteratorResult; - throw?(e?: any): IteratorResult; -} -export interface Iterable { - [Symbol.iterator](): Iterator; -} -export interface IterableIterator extends Iterator { - [Symbol.iterator](): IterableIterator; -} -/** - * A class that _shims_ an iterator interface on array like objects. - */ -export declare class ShimIterator { - private _list; - private _nextIndex; - private _nativeIterator; - constructor(list: ArrayLike | Iterable); - /** - * Return the next iteration result for the Iterator - */ - next(): IteratorResult; - [Symbol.iterator](): IterableIterator; -} -/** - * A type guard for checking if something has an Iterable interface - * - * @param value The value to type guard against - */ -export declare function isIterable(value: any): value is Iterable; -/** - * A type guard for checking if something is ArrayLike - * - * @param value The value to type guard against - */ -export declare function isArrayLike(value: any): value is ArrayLike; -/** - * Returns the iterator for an object - * - * @param iterable The iterable object to return the iterator for - */ -export declare function get(iterable: Iterable | ArrayLike): Iterator | undefined; -export interface ForOfCallback { - /** - * A callback function for a forOf() iteration - * - * @param value The current value - * @param object The object being iterated over - * @param doBreak A function, if called, will stop the iteration - */ - (value: T, object: Iterable | ArrayLike | string, doBreak: () => void): void; -} -/** - * Shims the functionality of `for ... of` blocks - * - * @param iterable The object the provides an interator interface - * @param callback The callback which will be called for each item of the iterable - * @param thisArg Optional scope to pass the callback - */ -export declare function forOf(iterable: Iterable | ArrayLike | string, callback: ForOfCallback, thisArg?: any): void; diff --git a/deps/framework/shim/iterator.js b/deps/framework/shim/iterator.js deleted file mode 100644 index 64a9680cca..0000000000 --- a/deps/framework/shim/iterator.js +++ /dev/null @@ -1,129 +0,0 @@ -(function (factory) { - if (typeof module === "object" && typeof module.exports === "object") { - var v = factory(require, exports); - if (v !== undefined) module.exports = v; - } - else if (typeof define === "function" && define.amd) { - define(["require", "exports", "./Symbol", "./string"], factory); - } -})(function (require, exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - require("./Symbol"); - var string_1 = require("./string"); - var staticDone = { done: true, value: undefined }; - /** - * A class that _shims_ an iterator interface on array like objects. - */ - var ShimIterator = /** @class */ (function () { - function ShimIterator(list) { - this._nextIndex = -1; - if (isIterable(list)) { - this._nativeIterator = list[Symbol.iterator](); - } - else { - this._list = list; - } - } - /** - * Return the next iteration result for the Iterator - */ - ShimIterator.prototype.next = function () { - if (this._nativeIterator) { - return this._nativeIterator.next(); - } - if (!this._list) { - return staticDone; - } - if (++this._nextIndex < this._list.length) { - return { - done: false, - value: this._list[this._nextIndex] - }; - } - return staticDone; - }; - ShimIterator.prototype[Symbol.iterator] = function () { - return this; - }; - return ShimIterator; - }()); - exports.ShimIterator = ShimIterator; - /** - * A type guard for checking if something has an Iterable interface - * - * @param value The value to type guard against - */ - function isIterable(value) { - return value && typeof value[Symbol.iterator] === 'function'; - } - exports.isIterable = isIterable; - /** - * A type guard for checking if something is ArrayLike - * - * @param value The value to type guard against - */ - function isArrayLike(value) { - return value && typeof value.length === 'number'; - } - exports.isArrayLike = isArrayLike; - /** - * Returns the iterator for an object - * - * @param iterable The iterable object to return the iterator for - */ - function get(iterable) { - if (isIterable(iterable)) { - return iterable[Symbol.iterator](); - } - else if (isArrayLike(iterable)) { - return new ShimIterator(iterable); - } - } - exports.get = get; - /** - * Shims the functionality of `for ... of` blocks - * - * @param iterable The object the provides an interator interface - * @param callback The callback which will be called for each item of the iterable - * @param thisArg Optional scope to pass the callback - */ - function forOf(iterable, callback, thisArg) { - var broken = false; - function doBreak() { - broken = true; - } - /* We need to handle iteration of double byte strings properly */ - if (isArrayLike(iterable) && typeof iterable === 'string') { - var l = iterable.length; - for (var i = 0; i < l; ++i) { - var char = iterable[i]; - if (i + 1 < l) { - var code = char.charCodeAt(0); - if (code >= string_1.HIGH_SURROGATE_MIN && code <= string_1.HIGH_SURROGATE_MAX) { - char += iterable[++i]; - } - } - callback.call(thisArg, char, iterable, doBreak); - if (broken) { - return; - } - } - } - else { - var iterator = get(iterable); - if (iterator) { - var result = iterator.next(); - while (!result.done) { - callback.call(thisArg, result.value, iterable, doBreak); - if (broken) { - return; - } - result = iterator.next(); - } - } - } - } - exports.forOf = forOf; -}); -//# sourceMappingURL=iterator.js.map \ No newline at end of file diff --git a/deps/framework/shim/iterator.js.map b/deps/framework/shim/iterator.js.map deleted file mode 100644 index a7418853b2..0000000000 --- a/deps/framework/shim/iterator.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"iterator.js","sourceRoot":"","sources":["iterator.ts"],"names":[],"mappings":";;;;;;;;;;;IAAA,oBAAkB;IAClB,mCAAkE;IAuBlE,IAAM,UAAU,GAAwB,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC;IAEzE;;OAEG;IACH;QAKC,sBAAY,IAAgC;YAHpC,eAAU,GAAG,CAAC,CAAC,CAAC;YAIvB,EAAE,CAAC,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;gBACtB,IAAI,CAAC,eAAe,GAAG,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE,CAAC;YAChD,CAAC;YAAC,IAAI,CAAC,CAAC;gBACP,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;YACnB,CAAC;QACF,CAAC;QAED;;WAEG;QACH,2BAAI,GAAJ;YACC,EAAE,CAAC,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC,CAAC;gBAC1B,MAAM,CAAC,IAAI,CAAC,eAAe,CAAC,IAAI,EAAE,CAAC;YACpC,CAAC;YACD,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC;gBACjB,MAAM,CAAC,UAAU,CAAC;YACnB,CAAC;YACD,EAAE,CAAC,CAAC,EAAE,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC;gBAC3C,MAAM,CAAC;oBACN,IAAI,EAAE,KAAK;oBACX,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,UAAU,CAAC;iBAClC,CAAC;YACH,CAAC;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gBAC5B,IAAI,IAAI,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC;gBACvB,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;oBACf,IAAM,IAAI,GAAG,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;oBAChC,EAAE,CAAC,CAAC,IAAI,IAAI,2BAAkB,IAAI,IAAI,IAAI,2BAAkB,CAAC,CAAC,CAAC;wBAC9D,IAAI,IAAI,QAAQ,CAAC,EAAE,CAAC,CAAC,CAAC;oBACvB,CAAC;gBACF,CAAC;gBACD,QAAQ,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAC;gBAChD,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC;oBACZ,MAAM,CAAC;gBACR,CAAC;YACF,CAAC;QACF,CAAC;QAAC,IAAI,CAAC,CAAC;YACP,IAAM,QAAQ,GAAG,GAAG,CAAC,QAAQ,CAAC,CAAC;YAC/B,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC;gBACd,IAAI,MAAM,GAAG,QAAQ,CAAC,IAAI,EAAE,CAAC;gBAE7B,OAAO,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC;oBACrB,QAAQ,CAAC,IAAI,CAAC,OAAO,EAAE,MAAM,CAAC,KAAK,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAC;oBACxD,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC;wBACZ,MAAM,CAAC;oBACR,CAAC;oBACD,MAAM,GAAG,QAAQ,CAAC,IAAI,EAAE,CAAC;gBAC1B,CAAC;YACF,CAAC;QACF,CAAC;IACF,CAAC;IAzCD,sBAyCC","sourcesContent":["import './Symbol';\nimport { HIGH_SURROGATE_MAX, HIGH_SURROGATE_MIN } from './string';\n\nexport interface IteratorResult {\n\treadonly done: boolean;\n\treadonly value: T;\n}\n\nexport interface Iterator {\n\tnext(value?: any): IteratorResult;\n\n\treturn?(value?: any): IteratorResult;\n\n\tthrow?(e?: any): IteratorResult;\n}\n\nexport interface Iterable {\n\t[Symbol.iterator](): Iterator;\n}\n\nexport interface IterableIterator extends Iterator {\n\t[Symbol.iterator](): IterableIterator;\n}\n\nconst staticDone: IteratorResult = { done: true, value: undefined };\n\n/**\n * A class that _shims_ an iterator interface on array like objects.\n */\nexport class ShimIterator {\n\tprivate _list: ArrayLike | undefined;\n\tprivate _nextIndex = -1;\n\tprivate _nativeIterator: Iterator | undefined;\n\n\tconstructor(list: ArrayLike | Iterable) {\n\t\tif (isIterable(list)) {\n\t\t\tthis._nativeIterator = list[Symbol.iterator]();\n\t\t} else {\n\t\t\tthis._list = list;\n\t\t}\n\t}\n\n\t/**\n\t * Return the next iteration result for the Iterator\n\t */\n\tnext(): IteratorResult {\n\t\tif (this._nativeIterator) {\n\t\t\treturn this._nativeIterator.next();\n\t\t}\n\t\tif (!this._list) {\n\t\t\treturn staticDone;\n\t\t}\n\t\tif (++this._nextIndex < this._list.length) {\n\t\t\treturn {\n\t\t\t\tdone: false,\n\t\t\t\tvalue: this._list[this._nextIndex]\n\t\t\t};\n\t\t}\n\t\treturn staticDone;\n\t}\n\n\t[Symbol.iterator](): IterableIterator {\n\t\treturn this;\n\t}\n}\n\n/**\n * A type guard for checking if something has an Iterable interface\n *\n * @param value The value to type guard against\n */\nexport function isIterable(value: any): value is Iterable {\n\treturn value && typeof value[Symbol.iterator] === 'function';\n}\n\n/**\n * A type guard for checking if something is ArrayLike\n *\n * @param value The value to type guard against\n */\nexport function isArrayLike(value: any): value is ArrayLike {\n\treturn value && typeof value.length === 'number';\n}\n\n/**\n * Returns the iterator for an object\n *\n * @param iterable The iterable object to return the iterator for\n */\nexport function get(iterable: Iterable | ArrayLike): Iterator | undefined {\n\tif (isIterable(iterable)) {\n\t\treturn iterable[Symbol.iterator]();\n\t} else if (isArrayLike(iterable)) {\n\t\treturn new ShimIterator(iterable);\n\t}\n}\n\nexport interface ForOfCallback {\n\t/**\n\t * A callback function for a forOf() iteration\n\t *\n\t * @param value The current value\n\t * @param object The object being iterated over\n\t * @param doBreak A function, if called, will stop the iteration\n\t */\n\t(value: T, object: Iterable | ArrayLike | string, doBreak: () => void): void;\n}\n\n/**\n * Shims the functionality of `for ... of` blocks\n *\n * @param iterable The object the provides an interator interface\n * @param callback The callback which will be called for each item of the iterable\n * @param thisArg Optional scope to pass the callback\n */\nexport function forOf(\n\titerable: Iterable | ArrayLike | string,\n\tcallback: ForOfCallback,\n\tthisArg?: any\n): void {\n\tlet broken = false;\n\n\tfunction doBreak() {\n\t\tbroken = true;\n\t}\n\n\t/* We need to handle iteration of double byte strings properly */\n\tif (isArrayLike(iterable) && typeof iterable === 'string') {\n\t\tconst l = iterable.length;\n\t\tfor (let i = 0; i < l; ++i) {\n\t\t\tlet char = iterable[i];\n\t\t\tif (i + 1 < l) {\n\t\t\t\tconst code = char.charCodeAt(0);\n\t\t\t\tif (code >= HIGH_SURROGATE_MIN && code <= HIGH_SURROGATE_MAX) {\n\t\t\t\t\tchar += iterable[++i];\n\t\t\t\t}\n\t\t\t}\n\t\t\tcallback.call(thisArg, char, iterable, doBreak);\n\t\t\tif (broken) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t} else {\n\t\tconst iterator = get(iterable);\n\t\tif (iterator) {\n\t\t\tlet result = iterator.next();\n\n\t\t\twhile (!result.done) {\n\t\t\t\tcallback.call(thisArg, result.value, iterable, doBreak);\n\t\t\t\tif (broken) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tresult = iterator.next();\n\t\t\t}\n\t\t}\n\t}\n}\n"]} \ No newline at end of file diff --git a/deps/framework/shim/iterator.mjs b/deps/framework/shim/iterator.mjs deleted file mode 100644 index 4576fe566d..0000000000 --- a/deps/framework/shim/iterator.mjs +++ /dev/null @@ -1,111 +0,0 @@ -import './Symbol'; -import { HIGH_SURROGATE_MAX, HIGH_SURROGATE_MIN } from './string'; -const staticDone = { done: true, value: undefined }; -/** - * A class that _shims_ an iterator interface on array like objects. - */ -export class ShimIterator { - constructor(list) { - this._nextIndex = -1; - if (isIterable(list)) { - this._nativeIterator = list[Symbol.iterator](); - } - else { - this._list = list; - } - } - /** - * Return the next iteration result for the Iterator - */ - next() { - if (this._nativeIterator) { - return this._nativeIterator.next(); - } - if (!this._list) { - return staticDone; - } - if (++this._nextIndex < this._list.length) { - return { - done: false, - value: this._list[this._nextIndex] - }; - } - return staticDone; - } - [Symbol.iterator]() { - return this; - } -} -/** - * A type guard for checking if something has an Iterable interface - * - * @param value The value to type guard against - */ -export function isIterable(value) { - return value && typeof value[Symbol.iterator] === 'function'; -} -/** - * A type guard for checking if something is ArrayLike - * - * @param value The value to type guard against - */ -export function isArrayLike(value) { - return value && typeof value.length === 'number'; -} -/** - * Returns the iterator for an object - * - * @param iterable The iterable object to return the iterator for - */ -export function get(iterable) { - if (isIterable(iterable)) { - return iterable[Symbol.iterator](); - } - else if (isArrayLike(iterable)) { - return new ShimIterator(iterable); - } -} -/** - * Shims the functionality of `for ... of` blocks - * - * @param iterable The object the provides an interator interface - * @param callback The callback which will be called for each item of the iterable - * @param thisArg Optional scope to pass the callback - */ -export function forOf(iterable, callback, thisArg) { - let broken = false; - function doBreak() { - broken = true; - } - /* We need to handle iteration of double byte strings properly */ - if (isArrayLike(iterable) && typeof iterable === 'string') { - const l = iterable.length; - for (let i = 0; i < l; ++i) { - let char = iterable[i]; - if (i + 1 < l) { - const code = char.charCodeAt(0); - if (code >= HIGH_SURROGATE_MIN && code <= HIGH_SURROGATE_MAX) { - char += iterable[++i]; - } - } - callback.call(thisArg, char, iterable, doBreak); - if (broken) { - return; - } - } - } - else { - const iterator = get(iterable); - if (iterator) { - let result = iterator.next(); - while (!result.done) { - callback.call(thisArg, result.value, iterable, doBreak); - if (broken) { - return; - } - result = iterator.next(); - } - } - } -} -//# sourceMappingURL=iterator.mjs.map \ No newline at end of file diff --git a/deps/framework/shim/iterator.mjs.map b/deps/framework/shim/iterator.mjs.map deleted file mode 100644 index a4e997cb5a..0000000000 --- a/deps/framework/shim/iterator.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"iterator.mjs","sourceRoot":"","sources":["iterator.ts"],"names":[],"mappings":"AAAA,OAAO,UAAU,CAAC;AAClB,OAAO,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAuBlE,MAAM,UAAU,GAAwB,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC;AAEzE;;GAEG;AACH,MAAM;IAKL,YAAY,IAAgC;QAHpC,eAAU,GAAG,CAAC,CAAC,CAAC;QAIvB,EAAE,CAAC,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;YACtB,IAAI,CAAC,eAAe,GAAG,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE,CAAC;QAChD,CAAC;QAAC,IAAI,CAAC,CAAC;YACP,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;QACnB,CAAC;IACF,CAAC;IAED;;OAEG;IACH,IAAI;QACH,EAAE,CAAC,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC,CAAC;YAC1B,MAAM,CAAC,IAAI,CAAC,eAAe,CAAC,IAAI,EAAE,CAAC;QACpC,CAAC;QACD,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC;YACjB,MAAM,CAAC,UAAU,CAAC;QACnB,CAAC;QACD,EAAE,CAAC,CAAC,EAAE,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC;YAC3C,MAAM,CAAC;gBACN,IAAI,EAAE,KAAK;gBACX,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,UAAU,CAAC;aAClC,CAAC;QACH,CAAC;QACD,MAAM,CAAC,UAAU,CAAC;IACnB,CAAC;IAED,CAAC,MAAM,CAAC,QAAQ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AAI,GAAG,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;gBAChC,EAAE,CAAC,CAAC,IAAI,IAAI,kBAAkB,IAAI,IAAI,IAAI,kBAAkB,CAAC,CAAC,CAAC;oBAC9D,IAAI,IAAI,QAAQ,CAAC,EAAE,CAAC,CAAC,CAAC;gBACvB,CAAC;YACF,CAAC;YACD,QAAQ,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAC;YAChD,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC;gBACZ,MAAM,CAAC;YACR,CAAC;QACF,CAAC;IACF,CAAC;IAAC,IAAI,CAAC,CAAC;QACP,MAAM,QAAQ,GAAG,GAAG,CAAC,QAAQ,CAAC,CAAC;QAC/B,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC;YACd,IAAI,MAAM,GAAG,QAAQ,CAAC,IAAI,EAAE,CAAC;YAE7B,OAAO,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC;gBACrB,QAAQ,CAAC,IAAI,CAAC,OAAO,EAAE,MAAM,CAAC,KAAK,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAC;gBACxD,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC;oBACZ,MAAM,CAAC;gBACR,CAAC;gBACD,MAAM,GAAG,QAAQ,CAAC,IAAI,EAAE,CAAC;YAC1B,CAAC;QACF,CAAC;IACF,CAAC;AACF,CAAC","sourcesContent":["import './Symbol';\nimport { HIGH_SURROGATE_MAX, HIGH_SURROGATE_MIN } from './string';\n\nexport interface IteratorResult {\n\treadonly done: boolean;\n\treadonly value: T;\n}\n\nexport interface Iterator {\n\tnext(value?: any): IteratorResult;\n\n\treturn?(value?: any): IteratorResult;\n\n\tthrow?(e?: any): IteratorResult;\n}\n\nexport interface Iterable {\n\t[Symbol.iterator](): Iterator;\n}\n\nexport interface IterableIterator extends Iterator {\n\t[Symbol.iterator](): IterableIterator;\n}\n\nconst staticDone: IteratorResult = { done: true, value: undefined };\n\n/**\n * A class that _shims_ an iterator interface on array like objects.\n */\nexport class ShimIterator {\n\tprivate _list: ArrayLike | undefined;\n\tprivate _nextIndex = -1;\n\tprivate _nativeIterator: Iterator | undefined;\n\n\tconstructor(list: ArrayLike | Iterable) {\n\t\tif (isIterable(list)) {\n\t\t\tthis._nativeIterator = list[Symbol.iterator]();\n\t\t} else {\n\t\t\tthis._list = list;\n\t\t}\n\t}\n\n\t/**\n\t * Return the next iteration result for the Iterator\n\t */\n\tnext(): IteratorResult {\n\t\tif (this._nativeIterator) {\n\t\t\treturn this._nativeIterator.next();\n\t\t}\n\t\tif (!this._list) {\n\t\t\treturn staticDone;\n\t\t}\n\t\tif (++this._nextIndex < this._list.length) {\n\t\t\treturn {\n\t\t\t\tdone: false,\n\t\t\t\tvalue: this._list[this._nextIndex]\n\t\t\t};\n\t\t}\n\t\treturn staticDone;\n\t}\n\n\t[Symbol.iterator](): IterableIterator {\n\t\treturn this;\n\t}\n}\n\n/**\n * A type guard for checking if something has an Iterable interface\n *\n * @param value The value to type guard against\n */\nexport function isIterable(value: any): value is Iterable {\n\treturn value && typeof value[Symbol.iterator] === 'function';\n}\n\n/**\n * A type guard for checking if something is ArrayLike\n *\n * @param value The value to type guard against\n */\nexport function isArrayLike(value: any): value is ArrayLike {\n\treturn value && typeof value.length === 'number';\n}\n\n/**\n * Returns the iterator for an object\n *\n * @param iterable The iterable object to return the iterator for\n */\nexport function get(iterable: Iterable | ArrayLike): Iterator | undefined {\n\tif (isIterable(iterable)) {\n\t\treturn iterable[Symbol.iterator]();\n\t} else if (isArrayLike(iterable)) {\n\t\treturn new ShimIterator(iterable);\n\t}\n}\n\nexport interface ForOfCallback {\n\t/**\n\t * A callback function for a forOf() iteration\n\t *\n\t * @param value The current value\n\t * @param object The object being iterated over\n\t * @param doBreak A function, if called, will stop the iteration\n\t */\n\t(value: T, object: Iterable | ArrayLike | string, doBreak: () => void): void;\n}\n\n/**\n * Shims the functionality of `for ... of` blocks\n *\n * @param iterable The object the provides an interator interface\n * @param callback The callback which will be called for each item of the iterable\n * @param thisArg Optional scope to pass the callback\n */\nexport function forOf(\n\titerable: Iterable | ArrayLike | string,\n\tcallback: ForOfCallback,\n\tthisArg?: any\n): void {\n\tlet broken = false;\n\n\tfunction doBreak() {\n\t\tbroken = true;\n\t}\n\n\t/* We need to handle iteration of double byte strings properly */\n\tif (isArrayLike(iterable) && typeof iterable === 'string') {\n\t\tconst l = iterable.length;\n\t\tfor (let i = 0; i < l; ++i) {\n\t\t\tlet char = iterable[i];\n\t\t\tif (i + 1 < l) {\n\t\t\t\tconst code = char.charCodeAt(0);\n\t\t\t\tif (code >= HIGH_SURROGATE_MIN && code <= HIGH_SURROGATE_MAX) {\n\t\t\t\t\tchar += iterable[++i];\n\t\t\t\t}\n\t\t\t}\n\t\t\tcallback.call(thisArg, char, iterable, doBreak);\n\t\t\tif (broken) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t} else {\n\t\tconst iterator = get(iterable);\n\t\tif (iterator) {\n\t\t\tlet result = iterator.next();\n\n\t\t\twhile (!result.done) {\n\t\t\t\tcallback.call(thisArg, result.value, iterable, doBreak);\n\t\t\t\tif (broken) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tresult = iterator.next();\n\t\t\t}\n\t\t}\n\t}\n}\n"]} \ No newline at end of file diff --git a/deps/framework/shim/main.d.ts b/deps/framework/shim/main.d.ts deleted file mode 100644 index 840d93910b..0000000000 --- a/deps/framework/shim/main.d.ts +++ /dev/null @@ -1,14 +0,0 @@ -import './tslib'; -import * as array from './array'; -import * as iterator from './iterator'; -import Map from './Map'; -import * as math from './math'; -import * as number from './number'; -import * as object from './object'; -import Set from './Set'; -import * as string from './string'; -import Symbol from './Symbol'; -import WeakMap from './WeakMap'; -import './Promise'; -import './Symbol'; -export { array, iterator, Map, math, number, object, Set, string, Symbol, WeakMap }; diff --git a/deps/framework/shim/main.js b/deps/framework/shim/main.js deleted file mode 100644 index 466b910966..0000000000 --- a/deps/framework/shim/main.js +++ /dev/null @@ -1,38 +0,0 @@ -(function (factory) { - if (typeof module === "object" && typeof module.exports === "object") { - var v = factory(require, exports); - if (v !== undefined) module.exports = v; - } - else if (typeof define === "function" && define.amd) { - define(["require", "exports", "./tslib", "./array", "./iterator", "./Map", "./math", "./number", "./object", "./Set", "./string", "./Symbol", "./WeakMap", "./Promise", "./Symbol"], factory); - } -})(function (require, exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - require("./tslib"); - var array = require("./array"); - exports.array = array; - var iterator = require("./iterator"); - exports.iterator = iterator; - var Map_1 = require("./Map"); - exports.Map = Map_1.default; - var math = require("./math"); - exports.math = math; - var number = require("./number"); - exports.number = number; - var object = require("./object"); - exports.object = object; - var Set_1 = require("./Set"); - exports.Set = Set_1.default; - var string = require("./string"); - exports.string = string; - var Symbol_1 = require("./Symbol"); - exports.Symbol = Symbol_1.default; - var WeakMap_1 = require("./WeakMap"); - exports.WeakMap = WeakMap_1.default; - "!has('es6-promise')"; - require("./Promise"); - "!has('es6-symbol')"; - require("./Symbol"); -}); -//# sourceMappingURL=main.js.map \ No newline at end of file diff --git a/deps/framework/shim/main.js.map b/deps/framework/shim/main.js.map deleted file mode 100644 index 5215a4f5a2..0000000000 --- a/deps/framework/shim/main.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"main.js","sourceRoot":"","sources":["main.ts"],"names":[],"mappings":";;;;;;;;;;;IAAA,mBAAiB;IAEjB,+BAAiC;IAiBxB,sBAAK;IAhBd,qCAAuC;IAgBvB,4BAAQ;IAfxB,6BAAwB;IAeE,cAfnB,aAAG,CAemB;IAd7B,6BAA+B;IAcA,oBAAI;IAbnC,iCAAmC;IAaE,wBAAM;IAZ3C,iCAAmC;IAYU,wBAAM;IAXnD,6BAAwB;IAW6B,cAX9C,aAAG,CAW8C;IAVxD,iCAAmC;IAUuB,wBAAM;IAThE,mCAA8B;IASoC,iBAT3D,gBAAM,CAS2D;IARxE,qCAAgC;IAQ0C,kBARnE,iBAAO,CAQmE;IANjF,qBAAqB,CAAC;IACtB,qBAAmB;IAEnB,oBAAoB,CAAC;IACrB,oBAAkB","sourcesContent":["import './tslib';\n\nimport * as array from './array';\nimport * as iterator from './iterator';\nimport Map from './Map';\nimport * as math from './math';\nimport * as number from './number';\nimport * as object from './object';\nimport Set from './Set';\nimport * as string from './string';\nimport Symbol from './Symbol';\nimport WeakMap from './WeakMap';\n\n`!has('es6-promise')`;\nimport './Promise';\n\n`!has('es6-symbol')`;\nimport './Symbol';\n\nexport { array, iterator, Map, math, number, object, Set, string, Symbol, WeakMap };\n"]} \ No newline at end of file diff --git a/deps/framework/shim/main.mjs b/deps/framework/shim/main.mjs deleted file mode 100644 index 1a853ce5e5..0000000000 --- a/deps/framework/shim/main.mjs +++ /dev/null @@ -1,17 +0,0 @@ -import './tslib'; -import * as array from './array'; -import * as iterator from './iterator'; -import Map from './Map'; -import * as math from './math'; -import * as number from './number'; -import * as object from './object'; -import Set from './Set'; -import * as string from './string'; -import Symbol from './Symbol'; -import WeakMap from './WeakMap'; -`!has('es6-promise')`; -import './Promise'; -`!has('es6-symbol')`; -import './Symbol'; -export { array, iterator, Map, math, number, object, Set, string, Symbol, WeakMap }; -//# sourceMappingURL=main.mjs.map \ No newline at end of file diff --git a/deps/framework/shim/main.mjs.map b/deps/framework/shim/main.mjs.map deleted file mode 100644 index af0cc0219a..0000000000 --- a/deps/framework/shim/main.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"main.mjs","sourceRoot":"","sources":["main.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,CAAC;AAEjB,OAAO,KAAK,KAAK,MAAM,SAAS,CAAC;AACjC,OAAO,KAAK,QAAQ,MAAM,YAAY,CAAC;AACvC,OAAO,GAAG,MAAM,OAAO,CAAC;AACxB,OAAO,KAAK,IAAI,MAAM,QAAQ,CAAC;AAC/B,OAAO,KAAK,MAAM,MAAM,UAAU,CAAC;AACnC,OAAO,KAAK,MAAM,MAAM,UAAU,CAAC;AACnC,OAAO,GAAG,MAAM,OAAO,CAAC;AACxB,OAAO,KAAK,MAAM,MAAM,UAAU,CAAC;AACnC,OAAO,MAAM,MAAM,UAAU,CAAC;AAC9B,OAAO,OAAO,MAAM,WAAW,CAAC;AAEhC,qBAAqB,CAAC;AACtB,OAAO,WAAW,CAAC;AAEnB,oBAAoB,CAAC;AACrB,OAAO,UAAU,CAAC;AAElB,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC","sourcesContent":["import './tslib';\n\nimport * as array from './array';\nimport * as iterator from './iterator';\nimport Map from './Map';\nimport * as math from './math';\nimport * as number from './number';\nimport * as object from './object';\nimport Set from './Set';\nimport * as string from './string';\nimport Symbol from './Symbol';\nimport WeakMap from './WeakMap';\n\n`!has('es6-promise')`;\nimport './Promise';\n\n`!has('es6-symbol')`;\nimport './Symbol';\n\nexport { array, iterator, Map, math, number, object, Set, string, Symbol, WeakMap };\n"]} \ No newline at end of file diff --git a/deps/framework/shim/math.d.ts b/deps/framework/shim/math.d.ts deleted file mode 100644 index 5c01856bf5..0000000000 --- a/deps/framework/shim/math.d.ts +++ /dev/null @@ -1,123 +0,0 @@ -export declare const FRACTION_UNITS: number; -export declare const MAX_FLOAT32 = 3.4028234663852886e+38; -export declare const MIN_FLOAT32 = 1.401298464324817e-45; -/** - * Returns the hyperbolic arccosine of a number. - * - * @param n The number to use in calculation - * @return The result - */ -export declare let acosh: (n: number) => number; -/** - * Returns the hyperbolic arcsine of a number. - * - * @param n The number to use in calculation - * @return The result - */ -export declare let asinh: (n: number) => number; -/** - * Returns the hyperbolic arctangent of a number. - * - * @param n The number to use in calculation - * @return The result - */ -export declare let atanh: (n: number) => number; -/** - * Returns the cube root of a number. - * - * @param n The number to use in calculation - * @return The result - */ -export declare let cbrt: (n: number) => number; -/** - * Returns the number of leading zero bits in the 32-bit - * binary representation of a number. - * - * @param n The number to use in calculation - * @return The result - */ -export declare let clz32: (n: number) => number; -/** - * Returns the hyperbolic cosine of a number. - * - * @param n The number to use in calculation - * @return The result - */ -export declare let cosh: (n: number) => number; -/** - * Returns e raised to the specified power minus one. - * - * @param n The number to use in calculation - * @return The result - */ -export declare let expm1: (n: number) => number; -/** - * Returns the nearest single-precision float representation of a number. - * - * @param n The number to use in calculation - * @return The result - */ -export declare let fround: (n: number) => number; -/** - * Returns the square root of the sum of squares of its arguments. - * - * @return The result - */ -export declare let hypot: (...args: number[]) => number; -/** - * Returns the result of the 32-bit multiplication of the two parameters. - * - * @param n The number to use in calculation - * @param m The number to use in calculation - * @return The result - */ -export declare let imul: (n: number, m: number) => number; -/** - * Returns the base 2 logarithm of a number. - * - * @param n The number to use in calculation - * @return The result - */ -export declare let log2: (n: number) => number; -/** - * Returns the base 10 logarithm of a number. - * - * @param n The number to use in calculation - * @return The result - */ -export declare let log10: (n: number) => number; -/** - * Returns the natural logarithm of 1 + a number. - * - * @param n The number to use in calculation - * @return The result - */ -export declare let log1p: (n: number) => number; -/** - * Returns the sign of a number, indicating whether the number is positive. - * - * @param n The number to use in calculation - * @return 1 if the number is positive, -1 if the number is negative, or 0 if the number is 0 - */ -export declare let sign: (n: number) => number; -/** - * Returns the hyperbolic sine of a number. - * - * @param n The number to use in calculation - * @return The result - */ -export declare let sinh: (n: number) => number; -/** - * Returns the hyperbolic tangent of a number. - * - * @param n The number to use in calculation - * @return The result - */ -export declare let tanh: (n: number) => number; -/** - * Returns the integral part of a number by removing any fractional digits. - * - * @param n The number to use in calculation - * @return The result - */ -export declare let trunc: (n: number) => number; diff --git a/deps/framework/shim/math.js b/deps/framework/shim/math.js deleted file mode 100644 index 45d2a380da..0000000000 --- a/deps/framework/shim/math.js +++ /dev/null @@ -1,243 +0,0 @@ -(function (factory) { - if (typeof module === "object" && typeof module.exports === "object") { - var v = factory(require, exports); - if (v !== undefined) module.exports = v; - } - else if (typeof define === "function" && define.amd) { - define(["require", "exports", "tslib", "./support/has"], factory); - } -})(function (require, exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - var tslib_1 = require("tslib"); - var has_1 = require("./support/has"); - exports.FRACTION_UNITS = Math.pow(2, 23); - exports.MAX_FLOAT32 = 3.4028234663852886e38; - exports.MIN_FLOAT32 = 1.401298464324817e-45; - /** - * Returns the hyperbolic arccosine of a number. - * - * @param n The number to use in calculation - * @return The result - */ - exports.acosh = Math.acosh; - /** - * Returns the hyperbolic arcsine of a number. - * - * @param n The number to use in calculation - * @return The result - */ - exports.asinh = Math.asinh; - /** - * Returns the hyperbolic arctangent of a number. - * - * @param n The number to use in calculation - * @return The result - */ - exports.atanh = Math.atanh; - /** - * Returns the cube root of a number. - * - * @param n The number to use in calculation - * @return The result - */ - exports.cbrt = Math.cbrt; - /** - * Returns the number of leading zero bits in the 32-bit - * binary representation of a number. - * - * @param n The number to use in calculation - * @return The result - */ - exports.clz32 = Math.clz32; - /** - * Returns the hyperbolic cosine of a number. - * - * @param n The number to use in calculation - * @return The result - */ - exports.cosh = Math.cosh; - /** - * Returns e raised to the specified power minus one. - * - * @param n The number to use in calculation - * @return The result - */ - exports.expm1 = Math.expm1; - /** - * Returns the nearest single-precision float representation of a number. - * - * @param n The number to use in calculation - * @return The result - */ - exports.fround = Math.fround; - /** - * Returns the square root of the sum of squares of its arguments. - * - * @return The result - */ - exports.hypot = Math.hypot; - /** - * Returns the result of the 32-bit multiplication of the two parameters. - * - * @param n The number to use in calculation - * @param m The number to use in calculation - * @return The result - */ - exports.imul = Math.imul; - /** - * Returns the base 2 logarithm of a number. - * - * @param n The number to use in calculation - * @return The result - */ - exports.log2 = Math.log2; - /** - * Returns the base 10 logarithm of a number. - * - * @param n The number to use in calculation - * @return The result - */ - exports.log10 = Math.log10; - /** - * Returns the natural logarithm of 1 + a number. - * - * @param n The number to use in calculation - * @return The result - */ - exports.log1p = Math.log1p; - /** - * Returns the sign of a number, indicating whether the number is positive. - * - * @param n The number to use in calculation - * @return 1 if the number is positive, -1 if the number is negative, or 0 if the number is 0 - */ - exports.sign = Math.sign; - /** - * Returns the hyperbolic sine of a number. - * - * @param n The number to use in calculation - * @return The result - */ - exports.sinh = Math.sinh; - /** - * Returns the hyperbolic tangent of a number. - * - * @param n The number to use in calculation - * @return The result - */ - exports.tanh = Math.tanh; - /** - * Returns the integral part of a number by removing any fractional digits. - * - * @param n The number to use in calculation - * @return The result - */ - exports.trunc = Math.trunc; - if (!has_1.default('es6-math')) { - exports.acosh = function acosh(n) { - return Math.log(n + Math.sqrt(n * n - 1)); - }; - exports.asinh = function asinh(n) { - if (n === -Infinity) { - return n; - } - else { - return Math.log(n + Math.sqrt(n * n + 1)); - } - }; - exports.atanh = function atanh(n) { - return Math.log((1 + n) / (1 - n)) / 2; - }; - exports.cbrt = function cbrt(n) { - var y = Math.pow(Math.abs(n), 1 / 3); - return n < 0 ? -y : y; - }; - exports.clz32 = function clz32(n) { - n = Number(n) >>> 0; - return n ? 32 - n.toString(2).length : 32; - }; - exports.cosh = function cosh(n) { - var m = Math.exp(n); - return (m + 1 / m) / 2; - }; - exports.expm1 = function expm1(n) { - return Math.exp(n) - 1; - }; - exports.fround = function (n) { - return new Float32Array([n])[0]; - }; - exports.hypot = function hypot() { - var args = []; - for (var _i = 0; _i < arguments.length; _i++) { - args[_i] = arguments[_i]; - } - // See: http://mzl.la/1HDi6xP - var n = 0; - try { - for (var args_1 = tslib_1.__values(args), args_1_1 = args_1.next(); !args_1_1.done; args_1_1 = args_1.next()) { - var arg = args_1_1.value; - if (arg === Infinity || arg === -Infinity) { - return Infinity; - } - n += arg * arg; - } - } - catch (e_1_1) { e_1 = { error: e_1_1 }; } - finally { - try { - if (args_1_1 && !args_1_1.done && (_a = args_1.return)) _a.call(args_1); - } - finally { if (e_1) throw e_1.error; } - } - return Math.sqrt(n); - var e_1, _a; - }; - exports.log2 = function log2(n) { - return Math.log(n) / Math.LN2; - }; - exports.log10 = function log10(n) { - return Math.log(n) / Math.LN10; - }; - exports.log1p = function log1p(n) { - return Math.log(1 + n); - }; - exports.sign = function sign(n) { - n = Number(n); - if (n === 0 || n !== n) { - return n; - } - return n > 0 ? 1 : -1; - }; - exports.sinh = function sinh(n) { - var m = Math.exp(n); - return (m - 1 / m) / 2; - }; - exports.tanh = function tanh(n) { - if (n === Infinity) { - return 1; - } - else if (n === -Infinity) { - return -1; - } - else { - var y = Math.exp(2 * n); - return (y - 1) / (y + 1); - } - }; - exports.trunc = function trunc(n) { - return n < 0 ? Math.ceil(n) : Math.floor(n); - }; - } - if (!has_1.default('es6-math-imul')) { - exports.imul = function imul(n, m) { - // See: http://mzl.la/1K279FK - var ah = (n >>> 16) & 0xffff; - var al = n & 0xffff; - var bh = (m >>> 16) & 0xffff; - var bl = m & 0xffff; - return (al * bl + (((ah * bl + al * bh) << 16) >>> 0)) | 0; - }; - } -}); -//# sourceMappingURL=math.js.map \ No newline at end of file diff --git a/deps/framework/shim/math.js.map b/deps/framework/shim/math.js.map deleted file mode 100644 index e36a2bebce..0000000000 --- a/deps/framework/shim/math.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"math.js","sourceRoot":"","sources":["math.ts"],"names":[],"mappings":";;;;;;;;;;;;IAAA,qCAAgC;IAEnB,QAAA,cAAc,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;IACjC,QAAA,WAAW,GAAG,qBAAqB,CAAC;IACpC,QAAA,WAAW,GAAG,qBAAqB,CAAC;IAEjD;;;;;OAKG;IACQ,QAAA,KAAK,GAAgC,IAAK,CAAC,KAAK,CAAC;IAE5D;;;;;OAKG;IACQ,QAAA,KAAK,GAAgC,IAAK,CAAC,KAAK,CAAC;IAE5D;;;;;OAKG;IACQ,QAAA,KAAK,GAAgC,IAAK,CAAC,KAAK,CAAC;IAE5D;;;;;OAKG;IACQ,QAAA,IAAI,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M,CAAC;YAC/B,IAAM,EAAE,GAAG,CAAC,GAAG,MAAM,CAAC;YACtB,IAAM,EAAE,GAAG,CAAC,CAAC,KAAK,EAAE,CAAC,GAAG,MAAM,CAAC;YAC/B,IAAM,EAAE,GAAG,CAAC,GAAG,MAAM,CAAC;YACtB,MAAM,CAAC,CAAC,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;QAC5D,CAAC,CAAC;IACH,CAAC","sourcesContent":["import has from './support/has';\n\nexport const FRACTION_UNITS = Math.pow(2, 23);\nexport const MAX_FLOAT32 = 3.4028234663852886e38;\nexport const MIN_FLOAT32 = 1.401298464324817e-45;\n\n/**\n * Returns the hyperbolic arccosine of a number.\n *\n * @param n The number to use in calculation\n * @return The result\n */\nexport let acosh: (n: number) => number = (Math).acosh;\n\n/**\n * Returns the hyperbolic arcsine of a number.\n *\n * @param n The number to use in calculation\n * @return The result\n */\nexport let asinh: (n: number) => number = (Math).asinh;\n\n/**\n * Returns the hyperbolic arctangent of a number.\n *\n * @param n The number to use in calculation\n * @return The result\n */\nexport let atanh: (n: number) => number = (Math).atanh;\n\n/**\n * Returns the cube root of a number.\n *\n * @param n The number to use in calculation\n * @return The result\n */\nexport let cbrt: (n: number) => number = (Math).cbrt;\n\n/**\n * Returns the number of leading zero bits in the 32-bit\n * binary representation of a number.\n *\n * @param n The number to use in calculation\n * @return The result\n */\nexport let clz32: (n: number) => number = (Math).clz32;\n\n/**\n * Returns the hyperbolic cosine of a number.\n *\n * @param n The number to use in calculation\n * @return The result\n */\nexport let cosh: (n: number) => number = (Math).cosh;\n\n/**\n * Returns e raised to the specified power minus one.\n *\n * @param n The number to use in calculation\n * @return The result\n */\nexport let expm1: (n: number) => number = (Math).expm1;\n\n/**\n * Returns the nearest single-precision float representation of a number.\n *\n * @param n The number to use in calculation\n * @return The result\n */\nexport let fround: (n: number) => number = (Math).fround;\n\n/**\n * Returns the square root of the sum of squares of its arguments.\n *\n * @return The result\n */\nexport let hypot: (...args: number[]) => number = (Math).hypot;\n\n/**\n * Returns the result of the 32-bit multiplication of the two parameters.\n *\n * @param n The number to use in calculation\n * @param m The number to use in calculation\n * @return The result\n */\nexport let imul: (n: number, m: number) => number = (Math).imul;\n\n/**\n * Returns the base 2 logarithm of a number.\n *\n * @param n The number to use in calculation\n * @return The result\n */\nexport let log2: (n: number) => number = (Math).log2;\n\n/**\n * Returns the base 10 logarithm of a number.\n *\n * @param n The number to use in calculation\n * @return The result\n */\nexport let log10: (n: number) => number = (Math).log10;\n\n/**\n * Returns the natural logarithm of 1 + a number.\n *\n * @param n The number to use in calculation\n * @return The result\n */\nexport let log1p: (n: number) => number = (Math).log1p;\n\n/**\n * Returns the sign of a number, indicating whether the number is positive.\n *\n * @param n The number to use in calculation\n * @return 1 if the number is positive, -1 if the number is negative, or 0 if the number is 0\n */\nexport let sign: (n: number) => number = (Math).sign;\n\n/**\n * Returns the hyperbolic sine of a number.\n *\n * @param n The number to use in calculation\n * @return The result\n */\nexport let sinh: (n: number) => number = (Math).sinh;\n\n/**\n * Returns the hyperbolic tangent of a number.\n *\n * @param n The number to use in calculation\n * @return The result\n */\nexport let tanh: (n: number) => number = (Math).tanh;\n\n/**\n * Returns the integral part of a number by removing any fractional digits.\n *\n * @param n The number to use in calculation\n * @return The result\n */\nexport let trunc: (n: number) => number = (Math).trunc;\n\nif (!has('es6-math')) {\n\tacosh = function acosh(n: number): number {\n\t\treturn Math.log(n + Math.sqrt(n * n - 1));\n\t};\n\n\tasinh = function asinh(n: number): number {\n\t\tif (n === -Infinity) {\n\t\t\treturn n;\n\t\t} else {\n\t\t\treturn Math.log(n + Math.sqrt(n * n + 1));\n\t\t}\n\t};\n\n\tatanh = function atanh(n: number): number {\n\t\treturn Math.log((1 + n) / (1 - n)) / 2;\n\t};\n\n\tcbrt = function cbrt(n: number): number {\n\t\tconst y = Math.pow(Math.abs(n), 1 / 3);\n\t\treturn n < 0 ? -y : y;\n\t};\n\n\tclz32 = function clz32(n: number): number {\n\t\tn = Number(n) >>> 0;\n\t\treturn n ? 32 - n.toString(2).length : 32;\n\t};\n\n\tcosh = function cosh(n: number): number {\n\t\tconst m = Math.exp(n);\n\t\treturn (m + 1 / m) / 2;\n\t};\n\n\texpm1 = function expm1(n: number): number {\n\t\treturn Math.exp(n) - 1;\n\t};\n\n\tfround = function(n: number): number {\n\t\treturn new Float32Array([n])[0];\n\t};\n\n\thypot = function hypot(...args: number[]): number {\n\t\t// See: http://mzl.la/1HDi6xP\n\t\tlet n = 0;\n\n\t\tfor (let arg of args) {\n\t\t\tif (arg === Infinity || arg === -Infinity) {\n\t\t\t\treturn Infinity;\n\t\t\t}\n\t\t\tn += arg * arg;\n\t\t}\n\t\treturn Math.sqrt(n);\n\t};\n\n\tlog2 = function log2(n: number): number {\n\t\treturn Math.log(n) / Math.LN2;\n\t};\n\n\tlog10 = function log10(n: number): number {\n\t\treturn Math.log(n) / Math.LN10;\n\t};\n\n\tlog1p = function log1p(n: number): number {\n\t\treturn Math.log(1 + n);\n\t};\n\n\tsign = function sign(n: number): number {\n\t\tn = Number(n);\n\t\tif (n === 0 || n !== n) {\n\t\t\treturn n;\n\t\t}\n\t\treturn n > 0 ? 1 : -1;\n\t};\n\n\tsinh = function sinh(n: number): number {\n\t\tconst m = Math.exp(n);\n\t\treturn (m - 1 / m) / 2;\n\t};\n\n\ttanh = function tanh(n: number): number {\n\t\tif (n === Infinity) {\n\t\t\treturn 1;\n\t\t} else if (n === -Infinity) {\n\t\t\treturn -1;\n\t\t} else {\n\t\t\tconst y = Math.exp(2 * n);\n\t\t\treturn (y - 1) / (y + 1);\n\t\t}\n\t};\n\n\ttrunc = function trunc(n: number): number {\n\t\treturn n < 0 ? Math.ceil(n) : Math.floor(n);\n\t};\n}\n\nif (!has('es6-math-imul')) {\n\timul = function imul(n: number, m: number): number {\n\t\t// See: http://mzl.la/1K279FK\n\t\tconst ah = (n >>> 16) & 0xffff;\n\t\tconst al = n & 0xffff;\n\t\tconst bh = (m >>> 16) & 0xffff;\n\t\tconst bl = m & 0xffff;\n\t\treturn (al * bl + (((ah * bl + al * bh) << 16) >>> 0)) | 0;\n\t};\n}\n"]} \ No newline at end of file diff --git a/deps/framework/shim/math.mjs b/deps/framework/shim/math.mjs deleted file mode 100644 index b8461b6ca3..0000000000 --- a/deps/framework/shim/math.mjs +++ /dev/null @@ -1,215 +0,0 @@ -import has from './support/has'; -export const FRACTION_UNITS = Math.pow(2, 23); -export const MAX_FLOAT32 = 3.4028234663852886e38; -export const MIN_FLOAT32 = 1.401298464324817e-45; -/** - * Returns the hyperbolic arccosine of a number. - * - * @param n The number to use in calculation - * @return The result - */ -export let acosh = Math.acosh; -/** - * Returns the hyperbolic arcsine of a number. - * - * @param n The number to use in calculation - * @return The result - */ -export let asinh = Math.asinh; -/** - * Returns the hyperbolic arctangent of a number. - * - * @param n The number to use in calculation - * @return The result - */ -export let atanh = Math.atanh; -/** - * Returns the cube root of a number. - * - * @param n The number to use in calculation - * @return The result - */ -export let cbrt = Math.cbrt; -/** - * Returns the number of leading zero bits in the 32-bit - * binary representation of a number. - * - * @param n The number to use in calculation - * @return The result - */ -export let clz32 = Math.clz32; -/** - * Returns the hyperbolic cosine of a number. - * - * @param n The number to use in calculation - * @return The result - */ -export let cosh = Math.cosh; -/** - * Returns e raised to the specified power minus one. - * - * @param n The number to use in calculation - * @return The result - */ -export let expm1 = Math.expm1; -/** - * Returns the nearest single-precision float representation of a number. - * - * @param n The number to use in calculation - * @return The result - */ -export let fround = Math.fround; -/** - * Returns the square root of the sum of squares of its arguments. - * - * @return The result - */ -export let hypot = Math.hypot; -/** - * Returns the result of the 32-bit multiplication of the two parameters. - * - * @param n The number to use in calculation - * @param m The number to use in calculation - * @return The result - */ -export let imul = Math.imul; -/** - * Returns the base 2 logarithm of a number. - * - * @param n The number to use in calculation - * @return The result - */ -export let log2 = Math.log2; -/** - * Returns the base 10 logarithm of a number. - * - * @param n The number to use in calculation - * @return The result - */ -export let log10 = Math.log10; -/** - * Returns the natural logarithm of 1 + a number. - * - * @param n The number to use in calculation - * @return The result - */ -export let log1p = Math.log1p; -/** - * Returns the sign of a number, indicating whether the number is positive. - * - * @param n The number to use in calculation - * @return 1 if the number is positive, -1 if the number is negative, or 0 if the number is 0 - */ -export let sign = Math.sign; -/** - * Returns the hyperbolic sine of a number. - * - * @param n The number to use in calculation - * @return The result - */ -export let sinh = Math.sinh; -/** - * Returns the hyperbolic tangent of a number. - * - * @param n The number to use in calculation - * @return The result - */ -export let tanh = Math.tanh; -/** - * Returns the integral part of a number by removing any fractional digits. - * - * @param n The number to use in calculation - * @return The result - */ -export let trunc = Math.trunc; -if (!has('es6-math')) { - acosh = function acosh(n) { - return Math.log(n + Math.sqrt(n * n - 1)); - }; - asinh = function asinh(n) { - if (n === -Infinity) { - return n; - } - else { - return Math.log(n + Math.sqrt(n * n + 1)); - } - }; - atanh = function atanh(n) { - return Math.log((1 + n) / (1 - n)) / 2; - }; - cbrt = function cbrt(n) { - const y = Math.pow(Math.abs(n), 1 / 3); - return n < 0 ? -y : y; - }; - clz32 = function clz32(n) { - n = Number(n) >>> 0; - return n ? 32 - n.toString(2).length : 32; - }; - cosh = function cosh(n) { - const m = Math.exp(n); - return (m + 1 / m) / 2; - }; - expm1 = function expm1(n) { - return Math.exp(n) - 1; - }; - fround = function (n) { - return new Float32Array([n])[0]; - }; - hypot = function hypot(...args) { - // See: http://mzl.la/1HDi6xP - let n = 0; - for (let arg of args) { - if (arg === Infinity || arg === -Infinity) { - return Infinity; - } - n += arg * arg; - } - return Math.sqrt(n); - }; - log2 = function log2(n) { - return Math.log(n) / Math.LN2; - }; - log10 = function log10(n) { - return Math.log(n) / Math.LN10; - }; - log1p = function log1p(n) { - return Math.log(1 + n); - }; - sign = function sign(n) { - n = Number(n); - if (n === 0 || n !== n) { - return n; - } - return n > 0 ? 1 : -1; - }; - sinh = function sinh(n) { - const m = Math.exp(n); - return (m - 1 / m) / 2; - }; - tanh = function tanh(n) { - if (n === Infinity) { - return 1; - } - else if (n === -Infinity) { - return -1; - } - else { - const y = Math.exp(2 * n); - return (y - 1) / (y + 1); - } - }; - trunc = function trunc(n) { - return n < 0 ? Math.ceil(n) : Math.floor(n); - }; -} -if (!has('es6-math-imul')) { - imul = function imul(n, m) { - // See: http://mzl.la/1K279FK - const ah = (n >>> 16) & 0xffff; - const al = n & 0xffff; - const bh = (m >>> 16) & 0xffff; - const bl = m & 0xffff; - return (al * bl + (((ah * bl + al * bh) << 16) >>> 0)) | 0; - }; -} -//# sourceMappingURL=math.mjs.map \ No newline at end of file diff --git a/deps/framework/shim/math.mjs.map b/deps/framework/shim/math.mjs.map deleted file mode 100644 index e16a287729..0000000000 --- a/deps/framework/shim/math.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"math.mjs","sourceRoot":"","sources":["math.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,eAAe,CAAC;AAEhC,MAAM,CAAC,MAAM,cAAc,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;AAC9C,MAAM,CAAC,MAAM,WAAW,GAAG,qBAAqB,CAAC;AACjD,MAAM,CAAC,MAAM,WAAW,GAAG,qBAAqB,CAAC;AAEjD;;;;;GAKG;AACH,MAAM,CAAC,IAAI,KAAK,GAAgC,IAAK,CAAC,KAAK,CAAC;AAE5D;;;;;GAKG;AACH,MAAM,CAAC,IAAI,KAAK,GAAgC,IAAK,CAAC,KAAK,CAAC;AAE5D;;;;;GAKG;AACH,MAAM,CAAC,IAAI,KAAK,GAAgC,IAAK,CAAC,KAAK,CAAC;AAE5D;;;;;GAKG;AACH,MAAM,CAAC,IAAI,IAAI,GAAgC,IAAK,CAAC,IAAI,CAAC;AAE1D;;;;;;GAMG;AACH,MAAM,CAAC,IAAI,KAAK,GAAgC,IAAK,CAAC,KAAK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,MAAM,EAAE,GAAG,CAAC,CAAC,KAAK,EAAE,CAAC,GAAG,MAAM,CAAC;QAC/B,MAAM,EAAE,GAAG,CAAC,GAAG,MAAM,CAAC;QACtB,MAAM,CAAC,CAAC,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;IAC5D,CAAC,CAAC;AACH,CAAC","sourcesContent":["import has from './support/has';\n\nexport const FRACTION_UNITS = Math.pow(2, 23);\nexport const MAX_FLOAT32 = 3.4028234663852886e38;\nexport const MIN_FLOAT32 = 1.401298464324817e-45;\n\n/**\n * Returns the hyperbolic arccosine of a number.\n *\n * @param n The number to use in calculation\n * @return The result\n */\nexport let acosh: (n: number) => number = (Math).acosh;\n\n/**\n * Returns the hyperbolic arcsine of a number.\n *\n * @param n The number to use in calculation\n * @return The result\n */\nexport let asinh: (n: number) => number = (Math).asinh;\n\n/**\n * Returns the hyperbolic arctangent of a number.\n *\n * @param n The number to use in calculation\n * @return The result\n */\nexport let atanh: (n: number) => number = (Math).atanh;\n\n/**\n * Returns the cube root of a number.\n *\n * @param n The number to use in calculation\n * @return The result\n */\nexport let cbrt: (n: number) => number = (Math).cbrt;\n\n/**\n * Returns the number of leading zero bits in the 32-bit\n * binary representation of a number.\n *\n * @param n The number to use in calculation\n * @return The result\n */\nexport let clz32: (n: number) => number = (Math).clz32;\n\n/**\n * Returns the hyperbolic cosine of a number.\n *\n * @param n The number to use in calculation\n * @return The result\n */\nexport let cosh: (n: number) => number = (Math).cosh;\n\n/**\n * Returns e raised to the specified power minus one.\n *\n * @param n The number to use in calculation\n * @return The result\n */\nexport let expm1: (n: number) => number = (Math).expm1;\n\n/**\n * Returns the nearest single-precision float representation of a number.\n *\n * @param n The number to use in calculation\n * @return The result\n */\nexport let fround: (n: number) => number = (Math).fround;\n\n/**\n * Returns the square root of the sum of squares of its arguments.\n *\n * @return The result\n */\nexport let hypot: (...args: number[]) => number = (Math).hypot;\n\n/**\n * Returns the result of the 32-bit multiplication of the two parameters.\n *\n * @param n The number to use in calculation\n * @param m The number to use in calculation\n * @return The result\n */\nexport let imul: (n: number, m: number) => number = (Math).imul;\n\n/**\n * Returns the base 2 logarithm of a number.\n *\n * @param n The number to use in calculation\n * @return The result\n */\nexport let log2: (n: number) => number = (Math).log2;\n\n/**\n * Returns the base 10 logarithm of a number.\n *\n * @param n The number to use in calculation\n * @return The result\n */\nexport let log10: (n: number) => number = (Math).log10;\n\n/**\n * Returns the natural logarithm of 1 + a number.\n *\n * @param n The number to use in calculation\n * @return The result\n */\nexport let log1p: (n: number) => number = (Math).log1p;\n\n/**\n * Returns the sign of a number, indicating whether the number is positive.\n *\n * @param n The number to use in calculation\n * @return 1 if the number is positive, -1 if the number is negative, or 0 if the number is 0\n */\nexport let sign: (n: number) => number = (Math).sign;\n\n/**\n * Returns the hyperbolic sine of a number.\n *\n * @param n The number to use in calculation\n * @return The result\n */\nexport let sinh: (n: number) => number = (Math).sinh;\n\n/**\n * Returns the hyperbolic tangent of a number.\n *\n * @param n The number to use in calculation\n * @return The result\n */\nexport let tanh: (n: number) => number = (Math).tanh;\n\n/**\n * Returns the integral part of a number by removing any fractional digits.\n *\n * @param n The number to use in calculation\n * @return The result\n */\nexport let trunc: (n: number) => number = (Math).trunc;\n\nif (!has('es6-math')) {\n\tacosh = function acosh(n: number): number {\n\t\treturn Math.log(n + Math.sqrt(n * n - 1));\n\t};\n\n\tasinh = function asinh(n: number): number {\n\t\tif (n === -Infinity) {\n\t\t\treturn n;\n\t\t} else {\n\t\t\treturn Math.log(n + Math.sqrt(n * n + 1));\n\t\t}\n\t};\n\n\tatanh = function atanh(n: number): number {\n\t\treturn Math.log((1 + n) / (1 - n)) / 2;\n\t};\n\n\tcbrt = function cbrt(n: number): number {\n\t\tconst y = Math.pow(Math.abs(n), 1 / 3);\n\t\treturn n < 0 ? -y : y;\n\t};\n\n\tclz32 = function clz32(n: number): number {\n\t\tn = Number(n) >>> 0;\n\t\treturn n ? 32 - n.toString(2).length : 32;\n\t};\n\n\tcosh = function cosh(n: number): number {\n\t\tconst m = Math.exp(n);\n\t\treturn (m + 1 / m) / 2;\n\t};\n\n\texpm1 = function expm1(n: number): number {\n\t\treturn Math.exp(n) - 1;\n\t};\n\n\tfround = function(n: number): number {\n\t\treturn new Float32Array([n])[0];\n\t};\n\n\thypot = function hypot(...args: number[]): number {\n\t\t// See: http://mzl.la/1HDi6xP\n\t\tlet n = 0;\n\n\t\tfor (let arg of args) {\n\t\t\tif (arg === Infinity || arg === -Infinity) {\n\t\t\t\treturn Infinity;\n\t\t\t}\n\t\t\tn += arg * arg;\n\t\t}\n\t\treturn Math.sqrt(n);\n\t};\n\n\tlog2 = function log2(n: number): number {\n\t\treturn Math.log(n) / Math.LN2;\n\t};\n\n\tlog10 = function log10(n: number): number {\n\t\treturn Math.log(n) / Math.LN10;\n\t};\n\n\tlog1p = function log1p(n: number): number {\n\t\treturn Math.log(1 + n);\n\t};\n\n\tsign = function sign(n: number): number {\n\t\tn = Number(n);\n\t\tif (n === 0 || n !== n) {\n\t\t\treturn n;\n\t\t}\n\t\treturn n > 0 ? 1 : -1;\n\t};\n\n\tsinh = function sinh(n: number): number {\n\t\tconst m = Math.exp(n);\n\t\treturn (m - 1 / m) / 2;\n\t};\n\n\ttanh = function tanh(n: number): number {\n\t\tif (n === Infinity) {\n\t\t\treturn 1;\n\t\t} else if (n === -Infinity) {\n\t\t\treturn -1;\n\t\t} else {\n\t\t\tconst y = Math.exp(2 * n);\n\t\t\treturn (y - 1) / (y + 1);\n\t\t}\n\t};\n\n\ttrunc = function trunc(n: number): number {\n\t\treturn n < 0 ? Math.ceil(n) : Math.floor(n);\n\t};\n}\n\nif (!has('es6-math-imul')) {\n\timul = function imul(n: number, m: number): number {\n\t\t// See: http://mzl.la/1K279FK\n\t\tconst ah = (n >>> 16) & 0xffff;\n\t\tconst al = n & 0xffff;\n\t\tconst bh = (m >>> 16) & 0xffff;\n\t\tconst bl = m & 0xffff;\n\t\treturn (al * bl + (((ah * bl + al * bh) << 16) >>> 0)) | 0;\n\t};\n}\n"]} \ No newline at end of file diff --git a/deps/framework/shim/number.d.ts b/deps/framework/shim/number.d.ts deleted file mode 100644 index db48b6fd68..0000000000 --- a/deps/framework/shim/number.d.ts +++ /dev/null @@ -1,44 +0,0 @@ -/** - * The smallest interval between two representable numbers. - */ -export declare const EPSILON = 1; -/** - * The maximum safe integer in JavaScript - */ -export declare const MAX_SAFE_INTEGER: number; -/** - * The minimum safe integer in JavaScript - */ -export declare const MIN_SAFE_INTEGER: number; -/** - * Determines whether the passed value is NaN without coersion. - * - * @param value The value to test - * @return true if the value is NaN, false if it is not - */ -export declare function isNaN(value: any): boolean; -/** - * Determines whether the passed value is a finite number without coersion. - * - * @param value The value to test - * @return true if the value is finite, false if it is not - */ -export declare function isFinite(value: any): value is number; -/** - * Determines whether the passed value is an integer. - * - * @param value The value to test - * @return true if the value is an integer, false if it is not - */ -export declare function isInteger(value: any): value is number; -/** - * Determines whether the passed value is an integer that is 'safe,' meaning: - * 1. it can be expressed as an IEEE-754 double precision number - * 2. it has a one-to-one mapping to a mathematical integer, meaning its - * IEEE-754 representation cannot be the result of rounding any other - * integer to fit the IEEE-754 representation - * - * @param value The value to test - * @return true if the value is an integer, false if it is not - */ -export declare function isSafeInteger(value: any): value is number; diff --git a/deps/framework/shim/number.js b/deps/framework/shim/number.js deleted file mode 100644 index 059c58ee7e..0000000000 --- a/deps/framework/shim/number.js +++ /dev/null @@ -1,70 +0,0 @@ -(function (factory) { - if (typeof module === "object" && typeof module.exports === "object") { - var v = factory(require, exports); - if (v !== undefined) module.exports = v; - } - else if (typeof define === "function" && define.amd) { - define(["require", "exports", "./global"], factory); - } -})(function (require, exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - var global_1 = require("./global"); - /** - * The smallest interval between two representable numbers. - */ - exports.EPSILON = 1; - /** - * The maximum safe integer in JavaScript - */ - exports.MAX_SAFE_INTEGER = Math.pow(2, 53) - 1; - /** - * The minimum safe integer in JavaScript - */ - exports.MIN_SAFE_INTEGER = -exports.MAX_SAFE_INTEGER; - /** - * Determines whether the passed value is NaN without coersion. - * - * @param value The value to test - * @return true if the value is NaN, false if it is not - */ - function isNaN(value) { - return typeof value === 'number' && global_1.default.isNaN(value); - } - exports.isNaN = isNaN; - /** - * Determines whether the passed value is a finite number without coersion. - * - * @param value The value to test - * @return true if the value is finite, false if it is not - */ - function isFinite(value) { - return typeof value === 'number' && global_1.default.isFinite(value); - } - exports.isFinite = isFinite; - /** - * Determines whether the passed value is an integer. - * - * @param value The value to test - * @return true if the value is an integer, false if it is not - */ - function isInteger(value) { - return isFinite(value) && Math.floor(value) === value; - } - exports.isInteger = isInteger; - /** - * Determines whether the passed value is an integer that is 'safe,' meaning: - * 1. it can be expressed as an IEEE-754 double precision number - * 2. it has a one-to-one mapping to a mathematical integer, meaning its - * IEEE-754 representation cannot be the result of rounding any other - * integer to fit the IEEE-754 representation - * - * @param value The value to test - * @return true if the value is an integer, false if it is not - */ - function isSafeInteger(value) { - return isInteger(value) && Math.abs(value) <= exports.MAX_SAFE_INTEGER; - } - exports.isSafeInteger = isSafeInteger; -}); -//# sourceMappingURL=number.js.map \ No newline at end of file diff --git a/deps/framework/shim/number.js.map b/deps/framework/shim/number.js.map deleted file mode 100644 index 5a7ed63402..0000000000 --- a/deps/framework/shim/number.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"number.js","sourceRoot":"","sources":["number.ts"],"names":[],"mappings":";;;;;;;;;;;IAAA,mCAA8B;IAE9B;;OAEG;IACU,QAAA,OAAO,GAAG,CAAC,CAAC;IAEzB;;OAEG;IACU,QAAA,gBAAgB,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,CAAC,CAAC;IAEpD;;OAEG;IACU,QAAA,gBAAgB,GAAG,CAAC,wBAAgB,CAAC;IAElD;;;;;OAKG;IACH,eAAsB,KAAU;QAC/B,MAAM,CAAC,OAAO,KAAK,KAAK,QAAQ,IAAI,gBAAM,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IACzD,CAAC;IAFD,sBAEC;IAED;;;;;OAKG;IACH,kBAAyB,KAAU;QAClC,MAAM,CAAC,OAAO,KAAK,KAAK,QAAQ,IAAI,gBAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;IAC5D,CAAC;IAFD,4BAEC;IAED;;;;;OAKG;IACH,mBAA0B,KAAU;QACnC,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,KAAK,KAAK,CAAC;IACvD,CAAC;IAFD,8BAEC;IAED;;;;;;;;;OASG;IACH,uBAA8B,KAAU;QACvC,MAAM,CAAC,SAAS,CAAC,KAAK,CAAC,IAAI,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,wBAAgB,CAAC;IAChE,CAAC;IAFD,sCAEC","sourcesContent":["import global from './global';\n\n/**\n * The smallest interval between two representable numbers.\n */\nexport const EPSILON = 1;\n\n/**\n * The maximum safe integer in JavaScript\n */\nexport const MAX_SAFE_INTEGER = Math.pow(2, 53) - 1;\n\n/**\n * The minimum safe integer in JavaScript\n */\nexport const MIN_SAFE_INTEGER = -MAX_SAFE_INTEGER;\n\n/**\n * Determines whether the passed value is NaN without coersion.\n *\n * @param value The value to test\n * @return true if the value is NaN, false if it is not\n */\nexport function isNaN(value: any): boolean {\n\treturn typeof value === 'number' && global.isNaN(value);\n}\n\n/**\n * Determines whether the passed value is a finite number without coersion.\n *\n * @param value The value to test\n * @return true if the value is finite, false if it is not\n */\nexport function isFinite(value: any): value is number {\n\treturn typeof value === 'number' && global.isFinite(value);\n}\n\n/**\n * Determines whether the passed value is an integer.\n *\n * @param value The value to test\n * @return true if the value is an integer, false if it is not\n */\nexport function isInteger(value: any): value is number {\n\treturn isFinite(value) && Math.floor(value) === value;\n}\n\n/**\n * Determines whether the passed value is an integer that is 'safe,' meaning:\n * 1. it can be expressed as an IEEE-754 double precision number\n * 2. it has a one-to-one mapping to a mathematical integer, meaning its\n * IEEE-754 representation cannot be the result of rounding any other\n * integer to fit the IEEE-754 representation\n *\n * @param value The value to test\n * @return true if the value is an integer, false if it is not\n */\nexport function isSafeInteger(value: any): value is number {\n\treturn isInteger(value) && Math.abs(value) <= MAX_SAFE_INTEGER;\n}\n"]} \ No newline at end of file diff --git a/deps/framework/shim/number.mjs b/deps/framework/shim/number.mjs deleted file mode 100644 index 1d3430fb2a..0000000000 --- a/deps/framework/shim/number.mjs +++ /dev/null @@ -1,54 +0,0 @@ -import global from './global'; -/** - * The smallest interval between two representable numbers. - */ -export const EPSILON = 1; -/** - * The maximum safe integer in JavaScript - */ -export const MAX_SAFE_INTEGER = Math.pow(2, 53) - 1; -/** - * The minimum safe integer in JavaScript - */ -export const MIN_SAFE_INTEGER = -MAX_SAFE_INTEGER; -/** - * Determines whether the passed value is NaN without coersion. - * - * @param value The value to test - * @return true if the value is NaN, false if it is not - */ -export function isNaN(value) { - return typeof value === 'number' && global.isNaN(value); -} -/** - * Determines whether the passed value is a finite number without coersion. - * - * @param value The value to test - * @return true if the value is finite, false if it is not - */ -export function isFinite(value) { - return typeof value === 'number' && global.isFinite(value); -} -/** - * Determines whether the passed value is an integer. - * - * @param value The value to test - * @return true if the value is an integer, false if it is not - */ -export function isInteger(value) { - return isFinite(value) && Math.floor(value) === value; -} -/** - * Determines whether the passed value is an integer that is 'safe,' meaning: - * 1. it can be expressed as an IEEE-754 double precision number - * 2. it has a one-to-one mapping to a mathematical integer, meaning its - * IEEE-754 representation cannot be the result of rounding any other - * integer to fit the IEEE-754 representation - * - * @param value The value to test - * @return true if the value is an integer, false if it is not - */ -export function isSafeInteger(value) { - return isInteger(value) && Math.abs(value) <= MAX_SAFE_INTEGER; -} -//# sourceMappingURL=number.mjs.map \ No newline at end of file diff --git a/deps/framework/shim/number.mjs.map b/deps/framework/shim/number.mjs.map deleted file mode 100644 index 4d4d191991..0000000000 --- a/deps/framework/shim/number.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"number.mjs","sourceRoot":"","sources":["number.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,UAAU,CAAC;AAE9B;;GAEG;AACH,MAAM,CAAC,MAAM,OAAO,GAAG,CAAC,CAAC;AAEzB;;GAEG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,CAAC,CAAC;AAEpD;;GAEG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,gBAAgB,CAAC;AAElD;;;;;GAKG;AACH,MAAM,gBAAgB,KAAU;IAC/B,MAAM,CAAC,OAAO,KAAK,KAAK,QAAQ,IAAI,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;AACzD,CAAC;AAED;;;;;GAKG;AACH,MAAM,mBAAmB,KAAU;IAClC,MAAM,CAAC,OAAO,KAAK,KAAK,QAAQ,IAAI,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;AAC5D,CAAC;AAED;;;;;GAKG;AACH,MAAM,oBAAoB,KAAU;IACnC,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,KAAK,KAAK,CAAC;AACvD,CAAC;AAED;;;;;;;;;GASG;AACH,MAAM,wBAAwB,KAAU;IACvC,MAAM,CAAC,SAAS,CAAC,KAAK,CAAC,IAAI,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,gBAAgB,CAAC;AAChE,CAAC","sourcesContent":["import global from './global';\n\n/**\n * The smallest interval between two representable numbers.\n */\nexport const EPSILON = 1;\n\n/**\n * The maximum safe integer in JavaScript\n */\nexport const MAX_SAFE_INTEGER = Math.pow(2, 53) - 1;\n\n/**\n * The minimum safe integer in JavaScript\n */\nexport const MIN_SAFE_INTEGER = -MAX_SAFE_INTEGER;\n\n/**\n * Determines whether the passed value is NaN without coersion.\n *\n * @param value The value to test\n * @return true if the value is NaN, false if it is not\n */\nexport function isNaN(value: any): boolean {\n\treturn typeof value === 'number' && global.isNaN(value);\n}\n\n/**\n * Determines whether the passed value is a finite number without coersion.\n *\n * @param value The value to test\n * @return true if the value is finite, false if it is not\n */\nexport function isFinite(value: any): value is number {\n\treturn typeof value === 'number' && global.isFinite(value);\n}\n\n/**\n * Determines whether the passed value is an integer.\n *\n * @param value The value to test\n * @return true if the value is an integer, false if it is not\n */\nexport function isInteger(value: any): value is number {\n\treturn isFinite(value) && Math.floor(value) === value;\n}\n\n/**\n * Determines whether the passed value is an integer that is 'safe,' meaning:\n * 1. it can be expressed as an IEEE-754 double precision number\n * 2. it has a one-to-one mapping to a mathematical integer, meaning its\n * IEEE-754 representation cannot be the result of rounding any other\n * integer to fit the IEEE-754 representation\n *\n * @param value The value to test\n * @return true if the value is an integer, false if it is not\n */\nexport function isSafeInteger(value: any): value is number {\n\treturn isInteger(value) && Math.abs(value) <= MAX_SAFE_INTEGER;\n}\n"]} \ No newline at end of file diff --git a/deps/framework/shim/object.d.ts b/deps/framework/shim/object.d.ts deleted file mode 100644 index c89fc2179f..0000000000 --- a/deps/framework/shim/object.d.ts +++ /dev/null @@ -1,103 +0,0 @@ -export interface ObjectAssign { - /** - * Copy the values of all of the enumerable own properties from one or more source objects to a - * target object. Returns the target object. - * @param target The target object to copy to. - * @param source The source object from which to copy properties. - */ - (target: T, source: U): T & U; - /** - * Copy the values of all of the enumerable own properties from one or more source objects to a - * target object. Returns the target object. - * @param target The target object to copy to. - * @param source1 The first source object from which to copy properties. - * @param source2 The second source object from which to copy properties. - */ - (target: T, source1: U, source2: V): T & U & V; - /** - * Copy the values of all of the enumerable own properties from one or more source objects to a - * target object. Returns the target object. - * @param target The target object to copy to. - * @param source1 The first source object from which to copy properties. - * @param source2 The second source object from which to copy properties. - * @param source3 The third source object from which to copy properties. - */ - (target: T, source1: U, source2: V, source3: W): T & U & V & W; - /** - * Copy the values of all of the enumerable own properties from one or more source objects to a - * target object. Returns the target object. - * @param target The target object to copy to. - * @param sources One or more source objects from which to copy properties - */ - (target: object, ...sources: any[]): any; -} -export interface ObjectEnteries { - /** - * Returns an array of key/values of the enumerable properties of an object - * @param o Object that contains the properties and methods. This can be an object that you created or an existing Document Object Model (DOM) object. - */ - (o: T): [keyof T, T[K]][]; - /** - * Returns an array of key/values of the enumerable properties of an object - * @param o Object that contains the properties and methods. This can be an object that you created or an existing Document Object Model (DOM) object. - */ - (o: object): [string, any][]; -} -export interface ObjectGetOwnPropertyDescriptors { - (o: T): { - [K in keyof T]: PropertyDescriptor; - }; - (o: any): { - [key: string]: PropertyDescriptor; - }; -} -export interface ObjectValues { - /** - * Returns an array of values of the enumerable properties of an object - * @param o Object that contains the properties and methods. This can be an object that you created or an existing Document Object Model (DOM) object. - */ - (o: { - [s: string]: T; - }): T[]; - /** - * Returns an array of values of the enumerable properties of an object - * @param o Object that contains the properties and methods. This can be an object that you created or an existing Document Object Model (DOM) object. - */ - (o: object): any[]; -} -export declare let assign: ObjectAssign; -/** - * Gets the own property descriptor of the specified object. - * An own property descriptor is one that is defined directly on the object and is not - * inherited from the object's prototype. - * @param o Object that contains the property. - * @param p Name of the property. - */ -export declare let getOwnPropertyDescriptor: (o: T, propertyKey: K) => PropertyDescriptor | undefined; -/** - * Returns the names of the own properties of an object. The own properties of an object are those that are defined directly - * on that object, and are not inherited from the object's prototype. The properties of an object include both fields (objects) and functions. - * @param o Object that contains the own properties. - */ -export declare let getOwnPropertyNames: (o: any) => string[]; -/** - * Returns an array of all symbol properties found directly on object o. - * @param o Object to retrieve the symbols from. - */ -export declare let getOwnPropertySymbols: (o: any) => symbol[]; -/** - * Returns true if the values are the same value, false otherwise. - * @param value1 The first value. - * @param value2 The second value. - */ -export declare let is: (value1: any, value2: any) => boolean; -/** - * Returns the names of the enumerable properties and methods of an object. - * @param o Object that contains the properties and methods. This can be an object that you created or an existing Document Object Model (DOM) object. - */ -export declare let keys: (o: object) => string[]; -export declare let getOwnPropertyDescriptors: ObjectGetOwnPropertyDescriptors; -export declare let entries: ObjectEnteries; -export declare let values: ObjectValues; diff --git a/deps/framework/shim/object.js b/deps/framework/shim/object.js deleted file mode 100644 index 547a9f7b2c..0000000000 --- a/deps/framework/shim/object.js +++ /dev/null @@ -1,92 +0,0 @@ -(function (factory) { - if (typeof module === "object" && typeof module.exports === "object") { - var v = factory(require, exports); - if (v !== undefined) module.exports = v; - } - else if (typeof define === "function" && define.amd) { - define(["require", "exports", "./global", "./support/has", "./Symbol"], factory); - } -})(function (require, exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - var global_1 = require("./global"); - var has_1 = require("./support/has"); - var Symbol_1 = require("./Symbol"); - if (has_1.default('es6-object')) { - var globalObject = global_1.default.Object; - exports.assign = globalObject.assign; - exports.getOwnPropertyDescriptor = globalObject.getOwnPropertyDescriptor; - exports.getOwnPropertyNames = globalObject.getOwnPropertyNames; - exports.getOwnPropertySymbols = globalObject.getOwnPropertySymbols; - exports.is = globalObject.is; - exports.keys = globalObject.keys; - } - else { - exports.keys = function symbolAwareKeys(o) { - return Object.keys(o).filter(function (key) { return !Boolean(key.match(/^@@.+/)); }); - }; - exports.assign = function assign(target) { - var sources = []; - for (var _i = 1; _i < arguments.length; _i++) { - sources[_i - 1] = arguments[_i]; - } - if (target == null) { - // TypeError if undefined or null - throw new TypeError('Cannot convert undefined or null to object'); - } - var to = Object(target); - sources.forEach(function (nextSource) { - if (nextSource) { - // Skip over if undefined or null - exports.keys(nextSource).forEach(function (nextKey) { - to[nextKey] = nextSource[nextKey]; - }); - } - }); - return to; - }; - exports.getOwnPropertyDescriptor = function getOwnPropertyDescriptor(o, prop) { - if (Symbol_1.isSymbol(prop)) { - return Object.getOwnPropertyDescriptor(o, prop); - } - else { - return Object.getOwnPropertyDescriptor(o, prop); - } - }; - exports.getOwnPropertyNames = function getOwnPropertyNames(o) { - return Object.getOwnPropertyNames(o).filter(function (key) { return !Boolean(key.match(/^@@.+/)); }); - }; - exports.getOwnPropertySymbols = function getOwnPropertySymbols(o) { - return Object.getOwnPropertyNames(o) - .filter(function (key) { return Boolean(key.match(/^@@.+/)); }) - .map(function (key) { return Symbol.for(key.substring(2)); }); - }; - exports.is = function is(value1, value2) { - if (value1 === value2) { - return value1 !== 0 || 1 / value1 === 1 / value2; // -0 - } - return value1 !== value1 && value2 !== value2; // NaN - }; - } - if (has_1.default('es2017-object')) { - var globalObject = global_1.default.Object; - exports.getOwnPropertyDescriptors = globalObject.getOwnPropertyDescriptors; - exports.entries = globalObject.entries; - exports.values = globalObject.values; - } - else { - exports.getOwnPropertyDescriptors = function getOwnPropertyDescriptors(o) { - return exports.getOwnPropertyNames(o).reduce(function (previous, key) { - previous[key] = exports.getOwnPropertyDescriptor(o, key); - return previous; - }, {}); - }; - exports.entries = function entries(o) { - return exports.keys(o).map(function (key) { return [key, o[key]]; }); - }; - exports.values = function values(o) { - return exports.keys(o).map(function (key) { return o[key]; }); - }; - } -}); -//# sourceMappingURL=object.js.map \ No newline at end of file diff --git a/deps/framework/shim/object.js.map b/deps/framework/shim/object.js.map deleted file mode 100644 index 93f14f9668..0000000000 --- a/deps/framework/shim/object.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"object.js","sourceRoot":"","sources":["object.ts"],"names":[],"mappings":";;;;;;;;;;;IAAA,mCAA8B;IAC9B,qCAAgC;IAChC,mCAAoC;IAqHpC,EAAE,CAAC,CAAC,aAAG,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;QACvB,IAAM,YAAY,GAAG,gBAAM,CAAC,MAAM,CAAC;QACnC,cAAM,GAAG,YAAY,CAAC,MAAM,CAAC;QAC7B,gCAAwB,GAAG,YAAY,CAAC,wBAAwB,CAAC;QACjE,2BAAmB,GAAG,YAAY,CAAC,mBAAmB,CAAC;QACvD,6BAAqB,GAAG,YAA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AG,YAAY,CAAC,OAAO,CAAC;QAC/B,cAAM,GAAG,YAAY,CAAC,MAAM,CAAC;IAC9B,CAAC;IAAC,IAAI,CAAC,CAAC;QACP,iCAAyB,GAAG,mCAAmC,CAAM;YACpE,MAAM,CAAC,2BAAmB,CAAC,CAAC,CAAC,CAAC,MAAM,CACnC,UAAC,QAAQ,EAAE,GAAG;gBACb,QAAQ,CAAC,GAAG,CAAC,GAAG,gCAAwB,CAAC,CAAC,EAAE,GAAG,CAAE,CAAC;gBAClD,MAAM,CAAC,QAAQ,CAAC;YACjB,CAAC,EACD,EAA2C,CAC3C,CAAC;QACH,CAAC,CAAC;QAEF,eAAO,GAAG,iBAAiB,CAAM;YAChC,MAAM,CAAC,YAAI,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,UAAC,GAAG,IAAK,OAAA,CAAC,GAAG,EAAE,CAAC,CAAC,GAAG,CAAC,CAAkB,EAA9B,CAA8B,CAAC,CAAC;QAC7D,CAAC,CAAC;QAEF,cAAM,GAAG,gBAAgB,CAAM;YAC9B,MAAM,CAAC,YAAI,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,UAAC,GAAG,IAAK,OAAA,CAAC,CAAC,GAAG,CAAC,EAAN,CAAM,CAAC,CAAC;QACrC,CAAC,CAAC;IACH,CAAC","sourcesContent":["import global from './global';\nimport has from './support/has';\nimport { isSymbol } from './Symbol';\n\nexport interface ObjectAssign {\n\t/**\n\t * Copy the values of all of the enumerable own properties from one or more source objects to a\n\t * target object. Returns the target object.\n\t * @param target The target object to copy to.\n\t * @param source The source object from which to copy properties.\n\t */\n\t(target: T, source: U): T & U;\n\n\t/**\n\t * Copy the values of all of the enumerable own properties from one or more source objects to a\n\t * target object. Returns the target object.\n\t * @param target The target object to copy to.\n\t * @param source1 The first source object from which to copy properties.\n\t * @param source2 The second source object from which to copy properties.\n\t */\n\t(target: T, source1: U, source2: V): T & U & V;\n\n\t/**\n\t * Copy the values of all of the enumerable own properties from one or more source objects to a\n\t * target object. Returns the target object.\n\t * @param target The target object to copy to.\n\t * @param source1 The first source object from which to copy properties.\n\t * @param source2 The second source object from which to copy properties.\n\t * @param source3 The third source object from which to copy properties.\n\t */\n\t(target: T, source1: U, source2: V, source3: W): T & U & V & W;\n\n\t/**\n\t * Copy the values of all of the enumerable own properties from one or more source objects to a\n\t * target object. Returns the target object.\n\t * @param target The target object to copy to.\n\t * @param sources One or more source objects from which to copy properties\n\t */\n\t(target: object, ...sources: any[]): any;\n}\n\nexport interface ObjectEnteries {\n\t/**\n\t * Returns an array of key/values of the enumerable properties of an object\n\t * @param o Object that contains the properties and methods. This can be an object that you created or an existing Document Object Model (DOM) object.\n\t */\n\t(o: T): [keyof T, T[K]][];\n\n\t/**\n\t * Returns an array of key/values of the enumerable properties of an object\n\t * @param o Object that contains the properties and methods. This can be an object that you created or an existing Document Object Model (DOM) object.\n\t */\n\t(o: object): [string, any][];\n}\n\nexport interface ObjectGetOwnPropertyDescriptors {\n\t(o: T): { [K in keyof T]: PropertyDescriptor };\n\t(o: any): { [key: string]: PropertyDescriptor };\n}\n\nexport interface ObjectValues {\n\t/**\n\t * Returns an array of values of the enumerable properties of an object\n\t * @param o Object that contains the properties and methods. This can be an object that you created or an existing Document Object Model (DOM) object.\n\t */\n\t(o: { [s: string]: T }): T[];\n\n\t/**\n\t * Returns an array of values of the enumerable properties of an object\n\t * @param o Object that contains the properties and methods. This can be an object that you created or an existing Document Object Model (DOM) object.\n\t */\n\t(o: object): any[];\n}\n\nexport let assign: ObjectAssign;\n\n/**\n * Gets the own property descriptor of the specified object.\n * An own property descriptor is one that is defined directly on the object and is not\n * inherited from the object's prototype.\n * @param o Object that contains the property.\n * @param p Name of the property.\n */\nexport let getOwnPropertyDescriptor: (o: T, propertyKey: K) => PropertyDescriptor | undefined;\n\n/**\n * Returns the names of the own properties of an object. The own properties of an object are those that are defined directly\n * on that object, and are not inherited from the object's prototype. The properties of an object include both fields (objects) and functions.\n * @param o Object that contains the own properties.\n */\nexport let getOwnPropertyNames: (o: any) => string[];\n\n/**\n * Returns an array of all symbol properties found directly on object o.\n * @param o Object to retrieve the symbols from.\n */\nexport let getOwnPropertySymbols: (o: any) => symbol[];\n\n/**\n * Returns true if the values are the same value, false otherwise.\n * @param value1 The first value.\n * @param value2 The second value.\n */\nexport let is: (value1: any, value2: any) => boolean;\n\n/**\n * Returns the names of the enumerable properties and methods of an object.\n * @param o Object that contains the properties and methods. This can be an object that you created or an existing Document Object Model (DOM) object.\n */\nexport let keys: (o: object) => string[];\n\n/* ES7 Object static methods */\n\nexport let getOwnPropertyDescriptors: ObjectGetOwnPropertyDescriptors;\n\nexport let entries: ObjectEnteries;\n\nexport let values: ObjectValues;\n\nif (has('es6-object')) {\n\tconst globalObject = global.Object;\n\tassign = globalObject.assign;\n\tgetOwnPropertyDescriptor = globalObject.getOwnPropertyDescriptor;\n\tgetOwnPropertyNames = globalObject.getOwnPropertyNames;\n\tgetOwnPropertySymbols = globalObject.getOwnPropertySymbols;\n\tis = globalObject.is;\n\tkeys = globalObject.keys;\n} else {\n\tkeys = function symbolAwareKeys(o: object): string[] {\n\t\treturn Object.keys(o).filter((key) => !Boolean(key.match(/^@@.+/)));\n\t};\n\n\tassign = function assign(target: any, ...sources: any[]) {\n\t\tif (target == null) {\n\t\t\t// TypeError if undefined or null\n\t\t\tthrow new TypeError('Cannot convert undefined or null to object');\n\t\t}\n\n\t\tconst to = Object(target);\n\t\tsources.forEach((nextSource) => {\n\t\t\tif (nextSource) {\n\t\t\t\t// Skip over if undefined or null\n\t\t\t\tkeys(nextSource).forEach((nextKey) => {\n\t\t\t\t\tto[nextKey] = nextSource[nextKey];\n\t\t\t\t});\n\t\t\t}\n\t\t});\n\n\t\treturn to;\n\t};\n\n\tgetOwnPropertyDescriptor = function getOwnPropertyDescriptor(\n\t\to: any,\n\t\tprop: string | symbol\n\t): PropertyDescriptor | undefined {\n\t\tif (isSymbol(prop)) {\n\t\t\treturn (Object).getOwnPropertyDescriptor(o, prop);\n\t\t} else {\n\t\t\treturn Object.getOwnPropertyDescriptor(o, prop);\n\t\t}\n\t};\n\n\tgetOwnPropertyNames = function getOwnPropertyNames(o: any): string[] {\n\t\treturn Object.getOwnPropertyNames(o).filter((key) => !Boolean(key.match(/^@@.+/)));\n\t};\n\n\tgetOwnPropertySymbols = function getOwnPropertySymbols(o: any): symbol[] {\n\t\treturn Object.getOwnPropertyNames(o)\n\t\t\t.filter((key) => Boolean(key.match(/^@@.+/)))\n\t\t\t.map((key) => Symbol.for(key.substring(2)));\n\t};\n\n\tis = function is(value1: any, value2: any): boolean {\n\t\tif (value1 === value2) {\n\t\t\treturn value1 !== 0 || 1 / value1 === 1 / value2; // -0\n\t\t}\n\t\treturn value1 !== value1 && value2 !== value2; // NaN\n\t};\n}\n\nif (has('es2017-object')) {\n\tconst globalObject = global.Object;\n\tgetOwnPropertyDescriptors = globalObject.getOwnPropertyDescriptors;\n\tentries = globalObject.entries;\n\tvalues = globalObject.values;\n} else {\n\tgetOwnPropertyDescriptors = function getOwnPropertyDescriptors(o: any) {\n\t\treturn getOwnPropertyNames(o).reduce(\n\t\t\t(previous, key) => {\n\t\t\t\tprevious[key] = getOwnPropertyDescriptor(o, key)!;\n\t\t\t\treturn previous;\n\t\t\t},\n\t\t\t{} as { [key: string]: PropertyDescriptor }\n\t\t);\n\t};\n\n\tentries = function entries(o: any): [string, any][] {\n\t\treturn keys(o).map((key) => [key, o[key]] as [string, any]);\n\t};\n\n\tvalues = function values(o: any): any[] {\n\t\treturn keys(o).map((key) => o[key]);\n\t};\n}\n"]} \ No newline at end of file diff --git a/deps/framework/shim/object.mjs b/deps/framework/shim/object.mjs deleted file mode 100644 index edd8a0b5b5..0000000000 --- a/deps/framework/shim/object.mjs +++ /dev/null @@ -1,111 +0,0 @@ -import global from './global'; -import has from './support/has'; -import { isSymbol } from './Symbol'; -export let assign; -/** - * Gets the own property descriptor of the specified object. - * An own property descriptor is one that is defined directly on the object and is not - * inherited from the object's prototype. - * @param o Object that contains the property. - * @param p Name of the property. - */ -export let getOwnPropertyDescriptor; -/** - * Returns the names of the own properties of an object. The own properties of an object are those that are defined directly - * on that object, and are not inherited from the object's prototype. The properties of an object include both fields (objects) and functions. - * @param o Object that contains the own properties. - */ -export let getOwnPropertyNames; -/** - * Returns an array of all symbol properties found directly on object o. - * @param o Object to retrieve the symbols from. - */ -export let getOwnPropertySymbols; -/** - * Returns true if the values are the same value, false otherwise. - * @param value1 The first value. - * @param value2 The second value. - */ -export let is; -/** - * Returns the names of the enumerable properties and methods of an object. - * @param o Object that contains the properties and methods. This can be an object that you created or an existing Document Object Model (DOM) object. - */ -export let keys; -/* ES7 Object static methods */ -export let getOwnPropertyDescriptors; -export let entries; -export let values; -if (has('es6-object')) { - const globalObject = global.Object; - assign = globalObject.assign; - getOwnPropertyDescriptor = globalObject.getOwnPropertyDescriptor; - getOwnPropertyNames = globalObject.getOwnPropertyNames; - getOwnPropertySymbols = globalObject.getOwnPropertySymbols; - is = globalObject.is; - keys = globalObject.keys; -} -else { - keys = function symbolAwareKeys(o) { - return Object.keys(o).filter((key) => !Boolean(key.match(/^@@.+/))); - }; - assign = function assign(target, ...sources) { - if (target == null) { - // TypeError if undefined or null - throw new TypeError('Cannot convert undefined or null to object'); - } - const to = Object(target); - sources.forEach((nextSource) => { - if (nextSource) { - // Skip over if undefined or null - keys(nextSource).forEach((nextKey) => { - to[nextKey] = nextSource[nextKey]; - }); - } - }); - return to; - }; - getOwnPropertyDescriptor = function getOwnPropertyDescriptor(o, prop) { - if (isSymbol(prop)) { - return Object.getOwnPropertyDescriptor(o, prop); - } - else { - return Object.getOwnPropertyDescriptor(o, prop); - } - }; - getOwnPropertyNames = function getOwnPropertyNames(o) { - return Object.getOwnPropertyNames(o).filter((key) => !Boolean(key.match(/^@@.+/))); - }; - getOwnPropertySymbols = function getOwnPropertySymbols(o) { - return Object.getOwnPropertyNames(o) - .filter((key) => Boolean(key.match(/^@@.+/))) - .map((key) => Symbol.for(key.substring(2))); - }; - is = function is(value1, value2) { - if (value1 === value2) { - return value1 !== 0 || 1 / value1 === 1 / value2; // -0 - } - return value1 !== value1 && value2 !== value2; // NaN - }; -} -if (has('es2017-object')) { - const globalObject = global.Object; - getOwnPropertyDescriptors = globalObject.getOwnPropertyDescriptors; - entries = globalObject.entries; - values = globalObject.values; -} -else { - getOwnPropertyDescriptors = function getOwnPropertyDescriptors(o) { - return getOwnPropertyNames(o).reduce((previous, key) => { - previous[key] = getOwnPropertyDescriptor(o, key); - return previous; - }, {}); - }; - entries = function entries(o) { - return keys(o).map((key) => [key, o[key]]); - }; - values = function values(o) { - return keys(o).map((key) => o[key]); - }; -} -//# sourceMappingURL=object.mjs.map \ No newline at end of file diff --git a/deps/framework/shim/object.mjs.map b/deps/framework/shim/object.mjs.map deleted file mode 100644 index 963d1ddb10..0000000000 --- a/deps/framework/shim/object.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"object.mjs","sourceRoot":"","sources":["object.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,UAAU,CAAC;AAC9B,OAAO,GAAG,MAAM,eAAe,CAAC;AAChC,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAwEpC,MAAM,CAAC,IAAI,MAAoB,CAAC;AAEhC;;;;;;GAMG;AACH,MAAM,CAAC,IAAI,wBAAwG,CAAC;AAEpH;;;;GAIG;AACH,MAAM,CAAC,IAAI,mBAAyC,CAAC;AAErD;;;GAGG;AACH,MAAM,CAAC,IAAI,qBAA2C,CAAC;AAEvD;;;;GAIG;AACH,MAAM,CAAC,IAAI,EAAyC,CAAC;AAErD;;;GAGG;AACH,MAAM,CAAC,IAAI,IAA6B,CAAC;AAEzC,+BAA+B;AAE/B,MAAM,CAAC,IAAI,yBAA0D,CAAC;AAEtE,MAAM,CAAC,IAAI,OAAuB,CAAC;AAEnC,MAAM,CAAC,IAAI,MAAoB,CAAC;AAEhC,EAAE,CAAC,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC,CAAC,C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C,CAAC,CAAC,CAAC;IAC1B,MAAM,YAAY,GAAG,MAAM,CAAC,MAAM,CAAC;IACnC,yBAAyB,GAAG,YAAY,CAAC,yBAAyB,CAAC;IACnE,OAAO,GAAG,YAAY,CAAC,OAAO,CAAC;IAC/B,MAAM,GAAG,YAAY,CAAC,MAAM,CAAC;AAC9B,CAAC;AAAC,IAAI,CAAC,CAAC;IACP,yBAAyB,GAAG,mCAAmC,CAAM;QACpE,MAAM,CAAC,mBAAmB,CAAC,CAAC,CAAC,CAAC,MAAM,CACnC,CAAC,QAAQ,EAAE,GAAG,EAAE,EAAE;YACjB,QAAQ,CAAC,GAAG,CAAC,GAAG,wBAAwB,CAAC,CAAC,EAAE,GAAG,CAAE,CAAC;YAClD,MAAM,CAAC,QAAQ,CAAC;QACjB,CAAC,EACD,EAA2C,CAC3C,CAAC;IACH,CAAC,CAAC;IAEF,OAAO,GAAG,iBAAiB,CAAM;QAChC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC,GAAG,CAAC,CAAkB,CAAC,CAAC;IAC7D,CAAC,CAAC;IAEF,MAAM,GAAG,gBAAgB,CAAM;QAC9B,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;IACrC,CAAC,CAAC;AACH,CAAC","sourcesContent":["import global from './global';\nimport has from './support/has';\nimport { isSymbol } from './Symbol';\n\nexport interface ObjectAssign {\n\t/**\n\t * Copy the values of all of the enumerable own properties from one or more source objects to a\n\t * target object. Returns the target object.\n\t * @param target The target object to copy to.\n\t * @param source The source object from which to copy properties.\n\t */\n\t(target: T, source: U): T & U;\n\n\t/**\n\t * Copy the values of all of the enumerable own properties from one or more source objects to a\n\t * target object. Returns the target object.\n\t * @param target The target object to copy to.\n\t * @param source1 The first source object from which to copy properties.\n\t * @param source2 The second source object from which to copy properties.\n\t */\n\t(target: T, source1: U, source2: V): T & U & V;\n\n\t/**\n\t * Copy the values of all of the enumerable own properties from one or more source objects to a\n\t * target object. Returns the target object.\n\t * @param target The target object to copy to.\n\t * @param source1 The first source object from which to copy properties.\n\t * @param source2 The second source object from which to copy properties.\n\t * @param source3 The third source object from which to copy properties.\n\t */\n\t(target: T, source1: U, source2: V, source3: W): T & U & V & W;\n\n\t/**\n\t * Copy the values of all of the enumerable own properties from one or more source objects to a\n\t * target object. Returns the target object.\n\t * @param target The target object to copy to.\n\t * @param sources One or more source objects from which to copy properties\n\t */\n\t(target: object, ...sources: any[]): any;\n}\n\nexport interface ObjectEnteries {\n\t/**\n\t * Returns an array of key/values of the enumerable properties of an object\n\t * @param o Object that contains the properties and methods. This can be an object that you created or an existing Document Object Model (DOM) object.\n\t */\n\t(o: T): [keyof T, T[K]][];\n\n\t/**\n\t * Returns an array of key/values of the enumerable properties of an object\n\t * @param o Object that contains the properties and methods. This can be an object that you created or an existing Document Object Model (DOM) object.\n\t */\n\t(o: object): [string, any][];\n}\n\nexport interface ObjectGetOwnPropertyDescriptors {\n\t(o: T): { [K in keyof T]: PropertyDescriptor };\n\t(o: any): { [key: string]: PropertyDescriptor };\n}\n\nexport interface ObjectValues {\n\t/**\n\t * Returns an array of values of the enumerable properties of an object\n\t * @param o Object that contains the properties and methods. This can be an object that you created or an existing Document Object Model (DOM) object.\n\t */\n\t(o: { [s: string]: T }): T[];\n\n\t/**\n\t * Returns an array of values of the enumerable properties of an object\n\t * @param o Object that contains the properties and methods. This can be an object that you created or an existing Document Object Model (DOM) object.\n\t */\n\t(o: object): any[];\n}\n\nexport let assign: ObjectAssign;\n\n/**\n * Gets the own property descriptor of the specified object.\n * An own property descriptor is one that is defined directly on the object and is not\n * inherited from the object's prototype.\n * @param o Object that contains the property.\n * @param p Name of the property.\n */\nexport let getOwnPropertyDescriptor: (o: T, propertyKey: K) => PropertyDescriptor | undefined;\n\n/**\n * Returns the names of the own properties of an object. The own properties of an object are those that are defined directly\n * on that object, and are not inherited from the object's prototype. The properties of an object include both fields (objects) and functions.\n * @param o Object that contains the own properties.\n */\nexport let getOwnPropertyNames: (o: any) => string[];\n\n/**\n * Returns an array of all symbol properties found directly on object o.\n * @param o Object to retrieve the symbols from.\n */\nexport let getOwnPropertySymbols: (o: any) => symbol[];\n\n/**\n * Returns true if the values are the same value, false otherwise.\n * @param value1 The first value.\n * @param value2 The second value.\n */\nexport let is: (value1: any, value2: any) => boolean;\n\n/**\n * Returns the names of the enumerable properties and methods of an object.\n * @param o Object that contains the properties and methods. This can be an object that you created or an existing Document Object Model (DOM) object.\n */\nexport let keys: (o: object) => string[];\n\n/* ES7 Object static methods */\n\nexport let getOwnPropertyDescriptors: ObjectGetOwnPropertyDescriptors;\n\nexport let entries: ObjectEnteries;\n\nexport let values: ObjectValues;\n\nif (has('es6-object')) {\n\tconst globalObject = global.Object;\n\tassign = globalObject.assign;\n\tgetOwnPropertyDescriptor = globalObject.getOwnPropertyDescriptor;\n\tgetOwnPropertyNames = globalObject.getOwnPropertyNames;\n\tgetOwnPropertySymbols = globalObject.getOwnPropertySymbols;\n\tis = globalObject.is;\n\tkeys = globalObject.keys;\n} else {\n\tkeys = function symbolAwareKeys(o: object): string[] {\n\t\treturn Object.keys(o).filter((key) => !Boolean(key.match(/^@@.+/)));\n\t};\n\n\tassign = function assign(target: any, ...sources: any[]) {\n\t\tif (target == null) {\n\t\t\t// TypeError if undefined or null\n\t\t\tthrow new TypeError('Cannot convert undefined or null to object');\n\t\t}\n\n\t\tconst to = Object(target);\n\t\tsources.forEach((nextSource) => {\n\t\t\tif (nextSource) {\n\t\t\t\t// Skip over if undefined or null\n\t\t\t\tkeys(nextSource).forEach((nextKey) => {\n\t\t\t\t\tto[nextKey] = nextSource[nextKey];\n\t\t\t\t});\n\t\t\t}\n\t\t});\n\n\t\treturn to;\n\t};\n\n\tgetOwnPropertyDescriptor = function getOwnPropertyDescriptor(\n\t\to: any,\n\t\tprop: string | symbol\n\t): PropertyDescriptor | undefined {\n\t\tif (isSymbol(prop)) {\n\t\t\treturn (Object).getOwnPropertyDescriptor(o, prop);\n\t\t} else {\n\t\t\treturn Object.getOwnPropertyDescriptor(o, prop);\n\t\t}\n\t};\n\n\tgetOwnPropertyNames = function getOwnPropertyNames(o: any): string[] {\n\t\treturn Object.getOwnPropertyNames(o).filter((key) => !Boolean(key.match(/^@@.+/)));\n\t};\n\n\tgetOwnPropertySymbols = function getOwnPropertySymbols(o: any): symbol[] {\n\t\treturn Object.getOwnPropertyNames(o)\n\t\t\t.filter((key) => Boolean(key.match(/^@@.+/)))\n\t\t\t.map((key) => Symbol.for(key.substring(2)));\n\t};\n\n\tis = function is(value1: any, value2: any): boolean {\n\t\tif (value1 === value2) {\n\t\t\treturn value1 !== 0 || 1 / value1 === 1 / value2; // -0\n\t\t}\n\t\treturn value1 !== value1 && value2 !== value2; // NaN\n\t};\n}\n\nif (has('es2017-object')) {\n\tconst globalObject = global.Object;\n\tgetOwnPropertyDescriptors = globalObject.getOwnPropertyDescriptors;\n\tentries = globalObject.entries;\n\tvalues = globalObject.values;\n} else {\n\tgetOwnPropertyDescriptors = function getOwnPropertyDescriptors(o: any) {\n\t\treturn getOwnPropertyNames(o).reduce(\n\t\t\t(previous, key) => {\n\t\t\t\tprevious[key] = getOwnPropertyDescriptor(o, key)!;\n\t\t\t\treturn previous;\n\t\t\t},\n\t\t\t{} as { [key: string]: PropertyDescriptor }\n\t\t);\n\t};\n\n\tentries = function entries(o: any): [string, any][] {\n\t\treturn keys(o).map((key) => [key, o[key]] as [string, any]);\n\t};\n\n\tvalues = function values(o: any): any[] {\n\t\treturn keys(o).map((key) => o[key]);\n\t};\n}\n"]} \ No newline at end of file diff --git a/deps/framework/shim/string.d.ts b/deps/framework/shim/string.d.ts deleted file mode 100644 index 40fa0af66b..0000000000 --- a/deps/framework/shim/string.d.ts +++ /dev/null @@ -1,117 +0,0 @@ -export interface StringNormalize { - /** - * Returns the String value result of normalizing the string into the normalization form - * named by form as specified in Unicode Standard Annex #15, Unicode Normalization Forms. - * @param target The target string - * @param form Applicable values: "NFC", "NFD", "NFKC", or "NFKD", If not specified default - * is "NFC" - */ - (target: string, form: 'NFC' | 'NFD' | 'NFKC' | 'NFKD'): string; - /** - * Returns the String value result of normalizing the string into the normalization form - * named by form as specified in Unicode Standard Annex #15, Unicode Normalization Forms. - * @param target The target string - * @param form Applicable values: "NFC", "NFD", "NFKC", or "NFKD", If not specified default - * is "NFC" - */ - (target: string, form?: string): string; -} -/** - * The minimum location of high surrogates - */ -export declare const HIGH_SURROGATE_MIN = 55296; -/** - * The maximum location of high surrogates - */ -export declare const HIGH_SURROGATE_MAX = 56319; -/** - * The minimum location of low surrogates - */ -export declare const LOW_SURROGATE_MIN = 56320; -/** - * The maximum location of low surrogates - */ -export declare const LOW_SURROGATE_MAX = 57343; -/** - * Return the String value whose elements are, in order, the elements in the List elements. - * If length is 0, the empty string is returned. - * @param codePoints The code points to generate the string - */ -export declare let fromCodePoint: (...codePoints: number[]) => string; -/** - * `raw` is intended for use as a tag function of a Tagged Template String. When called - * as such the first argument will be a well formed template call site object and the rest - * parameter will contain the substitution values. - * @param template A well-formed template string call site representation. - * @param substitutions A set of substitution values. - */ -export declare let raw: (template: TemplateStringsArray, ...substitutions: any[]) => string; -/** - * Returns a nonnegative integer Number less than 1114112 (0x110000) that is the code point - * value of the UTF-16 encoded code point starting at the string element at position pos in - * the String resulting from converting this object to a String. - * If there is no element at that position, the result is undefined. - * If a valid UTF-16 surrogate pair does not begin at pos, the result is the code unit at pos. - */ -export declare let codePointAt: (target: string, pos?: number) => number | undefined; -/** - * Returns true if the sequence of elements of searchString converted to a String is the - * same as the corresponding elements of this object (converted to a String) starting at - * endPosition – length(this). Otherwise returns false. - */ -export declare let endsWith: (target: string, searchString: string, endPosition?: number) => boolean; -/** - * Returns true if searchString appears as a substring of the result of converting this - * object to a String, at one or more positions that are - * greater than or equal to position; otherwise, returns false. - * @param target The target string - * @param searchString search string - * @param position If position is undefined, 0 is assumed, so as to search all of the String. - */ -export declare let includes: (target: string, searchString: string, position?: number) => boolean; -/** - * Returns the String value result of normalizing the string into the normalization form - * named by form as specified in Unicode Standard Annex #15, Unicode Normalization Forms. - * @param target The target string - * @param form Applicable values: "NFC", "NFD", "NFKC", or "NFKD", If not specified default - * is "NFC" - */ -export declare let normalize: StringNormalize; -/** - * Returns a String value that is made from count copies appended together. If count is 0, - * T is the empty String is returned. - * @param count number of copies to append - */ -export declare let repeat: (target: string, count?: number) => string; -/** - * Returns true if the sequence of elements of searchString converted to a String is the - * same as the corresponding elements of this object (converted to a String) starting at - * position. Otherwise returns false. - */ -export declare let startsWith: (target: string, searchString: string, position?: number) => boolean; -/** - * Pads the current string with a given string (possibly repeated) so that the resulting string reaches a given length. - * The padding is applied from the end (right) of the current string. - * - * @param target The target string - * @param maxLength The length of the resulting string once the current string has been padded. - * If this parameter is smaller than the current string's length, the current string will be returned as it is. - * - * @param fillString The string to pad the current string with. - * If this string is too long, it will be truncated and the left-most part will be applied. - * The default value for this parameter is " " (U+0020). - */ -export declare let padEnd: (target: string, maxLength: number, fillString?: string) => string; -/** - * Pads the current string with a given string (possibly repeated) so that the resulting string reaches a given length. - * The padding is applied from the start (left) of the current string. - * - * @param target The target string - * @param maxLength The length of the resulting string once the current string has been padded. - * If this parameter is smaller than the current string's length, the current string will be returned as it is. - * - * @param fillString The string to pad the current string with. - * If this string is too long, it will be truncated and the left-most part will be applied. - * The default value for this parameter is " " (U+0020). - */ -export declare let padStart: (target: string, maxLength: number, fillString?: string) => string; diff --git a/deps/framework/shim/string.js b/deps/framework/shim/string.js deleted file mode 100644 index 9e8dc7e95f..0000000000 --- a/deps/framework/shim/string.js +++ /dev/null @@ -1,242 +0,0 @@ -(function (factory) { - if (typeof module === "object" && typeof module.exports === "object") { - var v = factory(require, exports); - if (v !== undefined) module.exports = v; - } - else if (typeof define === "function" && define.amd) { - define(["require", "exports", "tslib", "./global", "./support/has", "./support/util"], factory); - } -})(function (require, exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - var tslib_1 = require("tslib"); - var global_1 = require("./global"); - var has_1 = require("./support/has"); - var util_1 = require("./support/util"); - /** - * The minimum location of high surrogates - */ - exports.HIGH_SURROGATE_MIN = 0xd800; - /** - * The maximum location of high surrogates - */ - exports.HIGH_SURROGATE_MAX = 0xdbff; - /** - * The minimum location of low surrogates - */ - exports.LOW_SURROGATE_MIN = 0xdc00; - /** - * The maximum location of low surrogates - */ - exports.LOW_SURROGATE_MAX = 0xdfff; - if (has_1.default('es6-string') && has_1.default('es6-string-raw')) { - exports.fromCodePoint = global_1.default.String.fromCodePoint; - exports.raw = global_1.default.String.raw; - exports.codePointAt = util_1.wrapNative(global_1.default.String.prototype.codePointAt); - exports.endsWith = util_1.wrapNative(global_1.default.String.prototype.endsWith); - exports.includes = util_1.wrapNative(global_1.default.String.prototype.includes); - exports.normalize = util_1.wrapNative(global_1.default.String.prototype.normalize); - exports.repeat = util_1.wrapNative(global_1.default.String.prototype.repeat); - exports.startsWith = util_1.wrapNative(global_1.default.String.prototype.startsWith); - } - else { - /** - * Validates that text is defined, and normalizes position (based on the given default if the input is NaN). - * Used by startsWith, includes, and endsWith. - * - * @return Normalized position. - */ - var normalizeSubstringArgs_1 = function (name, text, search, position, isEnd) { - if (isEnd === void 0) { isEnd = false; } - if (text == null) { - throw new TypeError('string.' + name + ' requires a valid string to search against.'); - } - var length = text.length; - position = position !== position ? (isEnd ? length : 0) : position; - return [text, String(search), Math.min(Math.max(position, 0), length)]; - }; - exports.fromCodePoint = function fromCodePoint() { - var codePoints = []; - for (var _i = 0; _i < arguments.length; _i++) { - codePoints[_i] = arguments[_i]; - } - // Adapted from https://github.com/mathiasbynens/String.fromCodePoint - var length = arguments.length; - if (!length) { - return ''; - } - var fromCharCode = String.fromCharCode; - var MAX_SIZE = 0x4000; - var codeUnits = []; - var index = -1; - var result = ''; - while (++index < length) { - var codePoint = Number(arguments[index]); - // Code points must be finite integers within the valid range - var isValid = isFinite(codePoint) && Math.floor(codePoint) === codePoint && codePoint >= 0 && codePoint <= 0x10ffff; - if (!isValid) { - throw RangeError('string.fromCodePoint: Invalid code point ' + codePoint); - } - if (codePoint <= 0xffff) { - // BMP code point - codeUnits.push(codePoint); - } - else { - // Astral code point; split in surrogate halves - // https://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae - codePoint -= 0x10000; - var highSurrogate = (codePoint >> 10) + exports.HIGH_SURROGATE_MIN; - var lowSurrogate = codePoint % 0x400 + exports.LOW_SURROGATE_MIN; - codeUnits.push(highSurrogate, lowSurrogate); - } - if (index + 1 === length || codeUnits.length > MAX_SIZE) { - result += fromCharCode.apply(null, codeUnits); - codeUnits.length = 0; - } - } - return result; - }; - exports.raw = function raw(callSite) { - var substitutions = []; - for (var _i = 1; _i < arguments.length; _i++) { - substitutions[_i - 1] = arguments[_i]; - } - var rawStrings = callSite.raw; - var result = ''; - var numSubstitutions = substitutions.length; - if (callSite == null || callSite.raw == null) { - throw new TypeError('string.raw requires a valid callSite object with a raw value'); - } - for (var i = 0, length_1 = rawStrings.length; i < length_1; i++) { - result += rawStrings[i] + (i < numSubstitutions && i < length_1 - 1 ? substitutions[i] : ''); - } - return result; - }; - exports.codePointAt = function codePointAt(text, position) { - if (position === void 0) { position = 0; } - // Adapted from https://github.com/mathiasbynens/String.prototype.codePointAt - if (text == null) { - throw new TypeError('string.codePointAt requries a valid string.'); - } - var length = text.length; - if (position !== position) { - position = 0; - } - if (position < 0 || position >= length) { - return undefined; - } - // Get the first code unit - var first = text.charCodeAt(position); - if (first >= exports.HIGH_SURROGATE_MIN && first <= exports.HIGH_SURROGATE_MAX && length > position + 1) { - // Start of a surrogate pair (high surrogate and there is a next code unit); check for low surrogate - // https://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae - var second = text.charCodeAt(position + 1); - if (second >= exports.LOW_SURROGATE_MIN && second <= exports.LOW_SURROGATE_MAX) { - return (first - exports.HIGH_SURROGATE_MIN) * 0x400 + second - exports.LOW_SURROGATE_MIN + 0x10000; - } - } - return first; - }; - exports.endsWith = function endsWith(text, search, endPosition) { - if (endPosition == null) { - endPosition = text.length; - } - _a = tslib_1.__read(normalizeSubstringArgs_1('endsWith', text, search, endPosition, true), 3), text = _a[0], search = _a[1], endPosition = _a[2]; - var start = endPosition - search.length; - if (start < 0) { - return false; - } - return text.slice(start, endPosition) === search; - var _a; - }; - exports.includes = function includes(text, search, position) { - if (position === void 0) { position = 0; } - _a = tslib_1.__read(normalizeSubstringArgs_1('includes', text, search, position), 3), text = _a[0], search = _a[1], position = _a[2]; - return text.indexOf(search, position) !== -1; - var _a; - }; - exports.repeat = function repeat(text, count) { - if (count === void 0) { count = 0; } - // Adapted from https://github.com/mathiasbynens/String.prototype.repeat - if (text == null) { - throw new TypeError('string.repeat requires a valid string.'); - } - if (count !== count) { - count = 0; - } - if (count < 0 || count === Infinity) { - throw new RangeError('string.repeat requires a non-negative finite count.'); - } - var result = ''; - while (count) { - if (count % 2) { - result += text; - } - if (count > 1) { - text += text; - } - count >>= 1; - } - return result; - }; - exports.startsWith = function startsWith(text, search, position) { - if (position === void 0) { position = 0; } - search = String(search); - _a = tslib_1.__read(normalizeSubstringArgs_1('startsWith', text, search, position), 3), text = _a[0], search = _a[1], position = _a[2]; - var end = position + search.length; - if (end > text.length) { - return false; - } - return text.slice(position, end) === search; - var _a; - }; - } - if (has_1.default('es2017-string')) { - exports.padEnd = util_1.wrapNative(global_1.default.String.prototype.padEnd); - exports.padStart = util_1.wrapNative(global_1.default.String.prototype.padStart); - } - else { - exports.padEnd = function padEnd(text, maxLength, fillString) { - if (fillString === void 0) { fillString = ' '; } - if (text === null || text === undefined) { - throw new TypeError('string.repeat requires a valid string.'); - } - if (maxLength === Infinity) { - throw new RangeError('string.padEnd requires a non-negative finite count.'); - } - if (maxLength === null || maxLength === undefined || maxLength < 0) { - maxLength = 0; - } - var strText = String(text); - var padding = maxLength - strText.length; - if (padding > 0) { - strText += - exports.repeat(fillString, Math.floor(padding / fillString.length)) + - fillString.slice(0, padding % fillString.length); - } - return strText; - }; - exports.padStart = function padStart(text, maxLength, fillString) { - if (fillString === void 0) { fillString = ' '; } - if (text === null || text === undefined) { - throw new TypeError('string.repeat requires a valid string.'); - } - if (maxLength === Infinity) { - throw new RangeError('string.padStart requires a non-negative finite count.'); - } - if (maxLength === null || maxLength === undefined || maxLength < 0) { - maxLength = 0; - } - var strText = String(text); - var padding = maxLength - strText.length; - if (padding > 0) { - strText = - exports.repeat(fillString, Math.floor(padding / fillString.length)) + - fillString.slice(0, padding % fillString.length) + - strText; - } - return strText; - }; - } -}); -//# sourceMappingURL=string.js.map \ No newline at end of file diff --git a/deps/framework/shim/string.js.map b/deps/framework/shim/string.js.map deleted file mode 100644 index 29740ac3ae..0000000000 --- a/deps/framework/shim/string.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"string.js","sourceRoot":"","sources":["string.ts"],"names":[],"mappings":";;;;;;;;;;;;IAAA,mCAA8B;IAC9B,qCAAgC;IAChC,uCAA4C;IAsB5C;;OAEG;IACU,QAAA,kBAAkB,GAAG,MAAM,CAAC;IAEzC;;OAEG;IACU,QAAA,kBAAkB,GAAG,MAAM,CAAC;IAEzC;;OAEG;IACU,QAAA,iBAAiB,GAAG,MAAM,CAAC;IAExC;;OAEG;IACU,QAAA,iBAAiB,GAAG,MAAM,CAAC;IAqGxC,EAAE,CAAC,CAAC,aAAG,CAAC,YAAY,CAAC,IAAI,aAAG,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC;QAChD,qBAAa,GAAG,gBAAM,CAAC,MAAM,CAAC,aAAa,CAAC;QAC5C,WAAG,GAAG,gBAAM,CAAC,MAAM,CAAC,GAAG,CAAC;QAExB,mBAAW,GAAG,iBAAU,CAAC,gBAAM,CAAC,MAAM,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC;QAC9D,gBAAQ,GAAG,iBAAU,CAAC,gBAAM,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,CAAC,UAAU,EAAE,IAAI,CAAC,KAAK,CAAC,OAAO,GAAG,UAAU,CAAC,MAAM,CAAC,CAAC;wBAC3D,UAAU,CAAC,KAAK,CAAC,CAAC,EAAE,OAAO,GAAG,UAAU,CAAC,MAAM,CAAC;wBAChD,OAAO,CAAC;YACV,CAAC;YAED,MAAM,CAAC,OAAO,CAAC;QAChB,CAAC,CAAC;IACH,CAAC","sourcesContent":["import global from './global';\nimport has from './support/has';\nimport { wrapNative } from './support/util';\n\nexport interface StringNormalize {\n\t/**\n\t * Returns the String value result of normalizing the string into the normalization form\n\t * named by form as specified in Unicode Standard Annex #15, Unicode Normalization Forms.\n\t * @param target The target string\n\t * @param form Applicable values: \"NFC\", \"NFD\", \"NFKC\", or \"NFKD\", If not specified default\n\t * is \"NFC\"\n\t */\n\t(target: string, form: 'NFC' | 'NFD' | 'NFKC' | 'NFKD'): string;\n\n\t/**\n\t * Returns the String value result of normalizing the string into the normalization form\n\t * named by form as specified in Unicode Standard Annex #15, Unicode Normalization Forms.\n\t * @param target The target string\n\t * @param form Applicable values: \"NFC\", \"NFD\", \"NFKC\", or \"NFKD\", If not specified default\n\t * is \"NFC\"\n\t */\n\t(target: string, form?: string): string;\n}\n\n/**\n * The minimum location of high surrogates\n */\nexport const HIGH_SURROGATE_MIN = 0xd800;\n\n/**\n * The maximum location of high surrogates\n */\nexport const HIGH_SURROGATE_MAX = 0xdbff;\n\n/**\n * The minimum location of low surrogates\n */\nexport const LOW_SURROGATE_MIN = 0xdc00;\n\n/**\n * The maximum location of low surrogates\n */\nexport const LOW_SURROGATE_MAX = 0xdfff;\n\n/* ES6 static methods */\n\n/**\n * Return the String value whose elements are, in order, the elements in the List elements.\n * If length is 0, the empty string is returned.\n * @param codePoints The code points to generate the string\n */\nexport let fromCodePoint: (...codePoints: number[]) => string;\n\n/**\n * `raw` is intended for use as a tag function of a Tagged Template String. When called\n * as such the first argument will be a well formed template call site object and the rest\n * parameter will contain the substitution values.\n * @param template A well-formed template string call site representation.\n * @param substitutions A set of substitution values.\n */\nexport let raw: (template: TemplateStringsArray, ...substitutions: any[]) => string;\n\n/* ES6 instance methods */\n\n/**\n * Returns a nonnegative integer Number less than 1114112 (0x110000) that is the code point\n * value of the UTF-16 encoded code point starting at the string element at position pos in\n * the String resulting from converting this object to a String.\n * If there is no element at that position, the result is undefined.\n * If a valid UTF-16 surrogate pair does not begin at pos, the result is the code unit at pos.\n */\nexport let codePointAt: (target: string, pos?: number) => number | undefined;\n\n/**\n * Returns true if the sequence of elements of searchString converted to a String is the\n * same as the corresponding elements of this object (converted to a String) starting at\n * endPosition – length(this). Otherwise returns false.\n */\nexport let endsWith: (target: string, searchString: string, endPosition?: number) => boolean;\n\n/**\n * Returns true if searchString appears as a substring of the result of converting this\n * object to a String, at one or more positions that are\n * greater than or equal to position; otherwise, returns false.\n * @param target The target string\n * @param searchString search string\n * @param position If position is undefined, 0 is assumed, so as to search all of the String.\n */\nexport let includes: (target: string, searchString: string, position?: number) => boolean;\n\n/**\n * Returns the String value result of normalizing the string into the normalization form\n * named by form as specified in Unicode Standard Annex #15, Unicode Normalization Forms.\n * @param target The target string\n * @param form Applicable values: \"NFC\", \"NFD\", \"NFKC\", or \"NFKD\", If not specified default\n * is \"NFC\"\n */\nexport let normalize: StringNormalize;\n\n/**\n * Returns a String value that is made from count copies appended together. If count is 0,\n * T is the empty String is returned.\n * @param count number of copies to append\n */\nexport let repeat: (target: string, count?: number) => string;\n\n/**\n * Returns true if the sequence of elements of searchString converted to a String is the\n * same as the corresponding elements of this object (converted to a String) starting at\n * position. Otherwise returns false.\n */\nexport let startsWith: (target: string, searchString: string, position?: number) => boolean;\n\n/* ES7 instance methods */\n\n/**\n * Pads the current string with a given string (possibly repeated) so that the resulting string reaches a given length.\n * The padding is applied from the end (right) of the current string.\n *\n * @param target The target string\n * @param maxLength The length of the resulting string once the current string has been padded.\n * If this parameter is smaller than the current string's length, the current string will be returned as it is.\n *\n * @param fillString The string to pad the current string with.\n * If this string is too long, it will be truncated and the left-most part will be applied.\n * The default value for this parameter is \" \" (U+0020).\n */\nexport let padEnd: (target: string, maxLength: number, fillString?: string) => string;\n\n/**\n * Pads the current string with a given string (possibly repeated) so that the resulting string reaches a given length.\n * The padding is applied from the start (left) of the current string.\n *\n * @param target The target string\n * @param maxLength The length of the resulting string once the current string has been padded.\n * If this parameter is smaller than the current string's length, the current string will be returned as it is.\n *\n * @param fillString The string to pad the current string with.\n * If this string is too long, it will be truncated and the left-most part will be applied.\n * The default value for this parameter is \" \" (U+0020).\n */\nexport let padStart: (target: string, maxLength: number, fillString?: string) => string;\n\nif (has('es6-string') && has('es6-string-raw')) {\n\tfromCodePoint = global.String.fromCodePoint;\n\traw = global.String.raw;\n\n\tcodePointAt = wrapNative(global.String.prototype.codePointAt);\n\tendsWith = wrapNative(global.String.prototype.endsWith);\n\tincludes = wrapNative(global.String.prototype.includes);\n\tnormalize = wrapNative(global.String.prototype.normalize);\n\trepeat = wrapNative(global.String.prototype.repeat);\n\tstartsWith = wrapNative(global.String.prototype.startsWith);\n} else {\n\t/**\n\t * Validates that text is defined, and normalizes position (based on the given default if the input is NaN).\n\t * Used by startsWith, includes, and endsWith.\n\t *\n\t * @return Normalized position.\n\t */\n\tconst normalizeSubstringArgs = function(\n\t\tname: string,\n\t\ttext: string,\n\t\tsearch: string,\n\t\tposition: number,\n\t\tisEnd: boolean = false\n\t): [string, string, number] {\n\t\tif (text == null) {\n\t\t\tthrow new TypeError('string.' + name + ' requires a valid string to search against.');\n\t\t}\n\n\t\tconst length = text.length;\n\t\tposition = position !== position ? (isEnd ? length : 0) : position;\n\t\treturn [text, String(search), Math.min(Math.max(position, 0), length)];\n\t};\n\n\tfromCodePoint = function fromCodePoint(...codePoints: number[]): string {\n\t\t// Adapted from https://github.com/mathiasbynens/String.fromCodePoint\n\t\tconst length = arguments.length;\n\t\tif (!length) {\n\t\t\treturn '';\n\t\t}\n\n\t\tconst fromCharCode = String.fromCharCode;\n\t\tconst MAX_SIZE = 0x4000;\n\t\tlet codeUnits: number[] = [];\n\t\tlet index = -1;\n\t\tlet result = '';\n\n\t\twhile (++index < length) {\n\t\t\tlet codePoint = Number(arguments[index]);\n\n\t\t\t// Code points must be finite integers within the valid range\n\t\t\tlet isValid =\n\t\t\t\tisFinite(codePoint) && Math.floor(codePoint) === codePoint && codePoint >= 0 && codePoint <= 0x10ffff;\n\t\t\tif (!isValid) {\n\t\t\t\tthrow RangeError('string.fromCodePoint: Invalid code point ' + codePoint);\n\t\t\t}\n\n\t\t\tif (codePoint <= 0xffff) {\n\t\t\t\t// BMP code point\n\t\t\t\tcodeUnits.push(codePoint);\n\t\t\t} else {\n\t\t\t\t// Astral code point; split in surrogate halves\n\t\t\t\t// https://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae\n\t\t\t\tcodePoint -= 0x10000;\n\t\t\t\tlet highSurrogate = (codePoint >> 10) + HIGH_SURROGATE_MIN;\n\t\t\t\tlet lowSurrogate = codePoint % 0x400 + LOW_SURROGATE_MIN;\n\t\t\t\tcodeUnits.push(highSurrogate, lowSurrogate);\n\t\t\t}\n\n\t\t\tif (index + 1 === length || codeUnits.length > MAX_SIZE) {\n\t\t\t\tresult += fromCharCode.apply(null, codeUnits);\n\t\t\t\tcodeUnits.length = 0;\n\t\t\t}\n\t\t}\n\t\treturn result;\n\t};\n\n\traw = function raw(callSite: TemplateStringsArray, ...substitutions: any[]): string {\n\t\tlet rawStrings = callSite.raw;\n\t\tlet result = '';\n\t\tlet numSubstitutions = substitutions.length;\n\n\t\tif (callSite == null || callSite.raw == null) {\n\t\t\tthrow new TypeError('string.raw requires a valid callSite object with a raw value');\n\t\t}\n\n\t\tfor (let i = 0, length = rawStrings.length; i < length; i++) {\n\t\t\tresult += rawStrings[i] + (i < numSubstitutions && i < length - 1 ? substitutions[i] : '');\n\t\t}\n\n\t\treturn result;\n\t};\n\n\tcodePointAt = function codePointAt(text: string, position: number = 0): number | undefined {\n\t\t// Adapted from https://github.com/mathiasbynens/String.prototype.codePointAt\n\t\tif (text == null) {\n\t\t\tthrow new TypeError('string.codePointAt requries a valid string.');\n\t\t}\n\t\tconst length = text.length;\n\n\t\tif (position !== position) {\n\t\t\tposition = 0;\n\t\t}\n\t\tif (position < 0 || position >= length) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\t// Get the first code unit\n\t\tconst first = text.charCodeAt(position);\n\t\tif (first >= HIGH_SURROGATE_MIN && first <= HIGH_SURROGATE_MAX && length > position + 1) {\n\t\t\t// Start of a surrogate pair (high surrogate and there is a next code unit); check for low surrogate\n\t\t\t// https://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae\n\t\t\tconst second = text.charCodeAt(position + 1);\n\t\t\tif (second >= LOW_SURROGATE_MIN && second <= LOW_SURROGATE_MAX) {\n\t\t\t\treturn (first - HIGH_SURROGATE_MIN) * 0x400 + second - LOW_SURROGATE_MIN + 0x10000;\n\t\t\t}\n\t\t}\n\t\treturn first;\n\t};\n\n\tendsWith = function endsWith(text: string, search: string, endPosition?: number): boolean {\n\t\tif (endPosition == null) {\n\t\t\tendPosition = text.length;\n\t\t}\n\n\t\t[text, search, endPosition] = normalizeSubstringArgs('endsWith', text, search, endPosition, true);\n\n\t\tconst start = endPosition - search.length;\n\t\tif (start < 0) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn text.slice(start, endPosition) === search;\n\t};\n\n\tincludes = function includes(text: string, search: string, position: number = 0): boolean {\n\t\t[text, search, position] = normalizeSubstringArgs('includes', text, search, position);\n\t\treturn text.indexOf(search, position) !== -1;\n\t};\n\n\trepeat = function repeat(text: string, count: number = 0): string {\n\t\t// Adapted from https://github.com/mathiasbynens/String.prototype.repeat\n\t\tif (text == null) {\n\t\t\tthrow new TypeError('string.repeat requires a valid string.');\n\t\t}\n\t\tif (count !== count) {\n\t\t\tcount = 0;\n\t\t}\n\t\tif (count < 0 || count === Infinity) {\n\t\t\tthrow new RangeError('string.repeat requires a non-negative finite count.');\n\t\t}\n\n\t\tlet result = '';\n\t\twhile (count) {\n\t\t\tif (count % 2) {\n\t\t\t\tresult += text;\n\t\t\t}\n\t\t\tif (count > 1) {\n\t\t\t\ttext += text;\n\t\t\t}\n\t\t\tcount >>= 1;\n\t\t}\n\t\treturn result;\n\t};\n\n\tstartsWith = function startsWith(text: string, search: string, position: number = 0): boolean {\n\t\tsearch = String(search);\n\t\t[text, search, position] = normalizeSubstringArgs('startsWith', text, search, position);\n\n\t\tconst end = position + search.length;\n\t\tif (end > text.length) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn text.slice(position, end) === search;\n\t};\n}\n\nif (has('es2017-string')) {\n\tpadEnd = wrapNative(global.String.prototype.padEnd);\n\tpadStart = wrapNative(global.String.prototype.padStart);\n} else {\n\tpadEnd = function padEnd(text: string, maxLength: number, fillString: string = ' '): string {\n\t\tif (text === null || text === undefined) {\n\t\t\tthrow new TypeError('string.repeat requires a valid string.');\n\t\t}\n\n\t\tif (maxLength === Infinity) {\n\t\t\tthrow new RangeError('string.padEnd requires a non-negative finite count.');\n\t\t}\n\n\t\tif (maxLength === null || maxLength === undefined || maxLength < 0) {\n\t\t\tmaxLength = 0;\n\t\t}\n\n\t\tlet strText = String(text);\n\t\tconst padding = maxLength - strText.length;\n\n\t\tif (padding > 0) {\n\t\t\tstrText +=\n\t\t\t\trepeat(fillString, Math.floor(padding / fillString.length)) +\n\t\t\t\tfillString.slice(0, padding % fillString.length);\n\t\t}\n\n\t\treturn strText;\n\t};\n\n\tpadStart = function padStart(text: string, maxLength: number, fillString: string = ' '): string {\n\t\tif (text === null || text === undefined) {\n\t\t\tthrow new TypeError('string.repeat requires a valid string.');\n\t\t}\n\n\t\tif (maxLength === Infinity) {\n\t\t\tthrow new RangeError('string.padStart requires a non-negative finite count.');\n\t\t}\n\n\t\tif (maxLength === null || maxLength === undefined || maxLength < 0) {\n\t\t\tmaxLength = 0;\n\t\t}\n\n\t\tlet strText = String(text);\n\t\tconst padding = maxLength - strText.length;\n\n\t\tif (padding > 0) {\n\t\t\tstrText =\n\t\t\t\trepeat(fillString, Math.floor(padding / fillString.length)) +\n\t\t\t\tfillString.slice(0, padding % fillString.length) +\n\t\t\t\tstrText;\n\t\t}\n\n\t\treturn strText;\n\t};\n}\n"]} \ No newline at end of file diff --git a/deps/framework/shim/string.mjs b/deps/framework/shim/string.mjs deleted file mode 100644 index 040ac84f0c..0000000000 --- a/deps/framework/shim/string.mjs +++ /dev/null @@ -1,297 +0,0 @@ -import global from './global'; -import has from './support/has'; -import { wrapNative } from './support/util'; -/** - * The minimum location of high surrogates - */ -export const HIGH_SURROGATE_MIN = 0xd800; -/** - * The maximum location of high surrogates - */ -export const HIGH_SURROGATE_MAX = 0xdbff; -/** - * The minimum location of low surrogates - */ -export const LOW_SURROGATE_MIN = 0xdc00; -/** - * The maximum location of low surrogates - */ -export const LOW_SURROGATE_MAX = 0xdfff; -/* ES6 static methods */ -/** - * Return the String value whose elements are, in order, the elements in the List elements. - * If length is 0, the empty string is returned. - * @param codePoints The code points to generate the string - */ -export let fromCodePoint; -/** - * `raw` is intended for use as a tag function of a Tagged Template String. When called - * as such the first argument will be a well formed template call site object and the rest - * parameter will contain the substitution values. - * @param template A well-formed template string call site representation. - * @param substitutions A set of substitution values. - */ -export let raw; -/* ES6 instance methods */ -/** - * Returns a nonnegative integer Number less than 1114112 (0x110000) that is the code point - * value of the UTF-16 encoded code point starting at the string element at position pos in - * the String resulting from converting this object to a String. - * If there is no element at that position, the result is undefined. - * If a valid UTF-16 surrogate pair does not begin at pos, the result is the code unit at pos. - */ -export let codePointAt; -/** - * Returns true if the sequence of elements of searchString converted to a String is the - * same as the corresponding elements of this object (converted to a String) starting at - * endPosition – length(this). Otherwise returns false. - */ -export let endsWith; -/** - * Returns true if searchString appears as a substring of the result of converting this - * object to a String, at one or more positions that are - * greater than or equal to position; otherwise, returns false. - * @param target The target string - * @param searchString search string - * @param position If position is undefined, 0 is assumed, so as to search all of the String. - */ -export let includes; -/** - * Returns the String value result of normalizing the string into the normalization form - * named by form as specified in Unicode Standard Annex #15, Unicode Normalization Forms. - * @param target The target string - * @param form Applicable values: "NFC", "NFD", "NFKC", or "NFKD", If not specified default - * is "NFC" - */ -export let normalize; -/** - * Returns a String value that is made from count copies appended together. If count is 0, - * T is the empty String is returned. - * @param count number of copies to append - */ -export let repeat; -/** - * Returns true if the sequence of elements of searchString converted to a String is the - * same as the corresponding elements of this object (converted to a String) starting at - * position. Otherwise returns false. - */ -export let startsWith; -/* ES7 instance methods */ -/** - * Pads the current string with a given string (possibly repeated) so that the resulting string reaches a given length. - * The padding is applied from the end (right) of the current string. - * - * @param target The target string - * @param maxLength The length of the resulting string once the current string has been padded. - * If this parameter is smaller than the current string's length, the current string will be returned as it is. - * - * @param fillString The string to pad the current string with. - * If this string is too long, it will be truncated and the left-most part will be applied. - * The default value for this parameter is " " (U+0020). - */ -export let padEnd; -/** - * Pads the current string with a given string (possibly repeated) so that the resulting string reaches a given length. - * The padding is applied from the start (left) of the current string. - * - * @param target The target string - * @param maxLength The length of the resulting string once the current string has been padded. - * If this parameter is smaller than the current string's length, the current string will be returned as it is. - * - * @param fillString The string to pad the current string with. - * If this string is too long, it will be truncated and the left-most part will be applied. - * The default value for this parameter is " " (U+0020). - */ -export let padStart; -if (has('es6-string') && has('es6-string-raw')) { - fromCodePoint = global.String.fromCodePoint; - raw = global.String.raw; - codePointAt = wrapNative(global.String.prototype.codePointAt); - endsWith = wrapNative(global.String.prototype.endsWith); - includes = wrapNative(global.String.prototype.includes); - normalize = wrapNative(global.String.prototype.normalize); - repeat = wrapNative(global.String.prototype.repeat); - startsWith = wrapNative(global.String.prototype.startsWith); -} -else { - /** - * Validates that text is defined, and normalizes position (based on the given default if the input is NaN). - * Used by startsWith, includes, and endsWith. - * - * @return Normalized position. - */ - const normalizeSubstringArgs = function (name, text, search, position, isEnd = false) { - if (text == null) { - throw new TypeError('string.' + name + ' requires a valid string to search against.'); - } - const length = text.length; - position = position !== position ? (isEnd ? length : 0) : position; - return [text, String(search), Math.min(Math.max(position, 0), length)]; - }; - fromCodePoint = function fromCodePoint(...codePoints) { - // Adapted from https://github.com/mathiasbynens/String.fromCodePoint - const length = arguments.length; - if (!length) { - return ''; - } - const fromCharCode = String.fromCharCode; - const MAX_SIZE = 0x4000; - let codeUnits = []; - let index = -1; - let result = ''; - while (++index < length) { - let codePoint = Number(arguments[index]); - // Code points must be finite integers within the valid range - let isValid = isFinite(codePoint) && Math.floor(codePoint) === codePoint && codePoint >= 0 && codePoint <= 0x10ffff; - if (!isValid) { - throw RangeError('string.fromCodePoint: Invalid code point ' + codePoint); - } - if (codePoint <= 0xffff) { - // BMP code point - codeUnits.push(codePoint); - } - else { - // Astral code point; split in surrogate halves - // https://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae - codePoint -= 0x10000; - let highSurrogate = (codePoint >> 10) + HIGH_SURROGATE_MIN; - let lowSurrogate = codePoint % 0x400 + LOW_SURROGATE_MIN; - codeUnits.push(highSurrogate, lowSurrogate); - } - if (index + 1 === length || codeUnits.length > MAX_SIZE) { - result += fromCharCode.apply(null, codeUnits); - codeUnits.length = 0; - } - } - return result; - }; - raw = function raw(callSite, ...substitutions) { - let rawStrings = callSite.raw; - let result = ''; - let numSubstitutions = substitutions.length; - if (callSite == null || callSite.raw == null) { - throw new TypeError('string.raw requires a valid callSite object with a raw value'); - } - for (let i = 0, length = rawStrings.length; i < length; i++) { - result += rawStrings[i] + (i < numSubstitutions && i < length - 1 ? substitutions[i] : ''); - } - return result; - }; - codePointAt = function codePointAt(text, position = 0) { - // Adapted from https://github.com/mathiasbynens/String.prototype.codePointAt - if (text == null) { - throw new TypeError('string.codePointAt requries a valid string.'); - } - const length = text.length; - if (position !== position) { - position = 0; - } - if (position < 0 || position >= length) { - return undefined; - } - // Get the first code unit - const first = text.charCodeAt(position); - if (first >= HIGH_SURROGATE_MIN && first <= HIGH_SURROGATE_MAX && length > position + 1) { - // Start of a surrogate pair (high surrogate and there is a next code unit); check for low surrogate - // https://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae - const second = text.charCodeAt(position + 1); - if (second >= LOW_SURROGATE_MIN && second <= LOW_SURROGATE_MAX) { - return (first - HIGH_SURROGATE_MIN) * 0x400 + second - LOW_SURROGATE_MIN + 0x10000; - } - } - return first; - }; - endsWith = function endsWith(text, search, endPosition) { - if (endPosition == null) { - endPosition = text.length; - } - [text, search, endPosition] = normalizeSubstringArgs('endsWith', text, search, endPosition, true); - const start = endPosition - search.length; - if (start < 0) { - return false; - } - return text.slice(start, endPosition) === search; - }; - includes = function includes(text, search, position = 0) { - [text, search, position] = normalizeSubstringArgs('includes', text, search, position); - return text.indexOf(search, position) !== -1; - }; - repeat = function repeat(text, count = 0) { - // Adapted from https://github.com/mathiasbynens/String.prototype.repeat - if (text == null) { - throw new TypeError('string.repeat requires a valid string.'); - } - if (count !== count) { - count = 0; - } - if (count < 0 || count === Infinity) { - throw new RangeError('string.repeat requires a non-negative finite count.'); - } - let result = ''; - while (count) { - if (count % 2) { - result += text; - } - if (count > 1) { - text += text; - } - count >>= 1; - } - return result; - }; - startsWith = function startsWith(text, search, position = 0) { - search = String(search); - [text, search, position] = normalizeSubstringArgs('startsWith', text, search, position); - const end = position + search.length; - if (end > text.length) { - return false; - } - return text.slice(position, end) === search; - }; -} -if (has('es2017-string')) { - padEnd = wrapNative(global.String.prototype.padEnd); - padStart = wrapNative(global.String.prototype.padStart); -} -else { - padEnd = function padEnd(text, maxLength, fillString = ' ') { - if (text === null || text === undefined) { - throw new TypeError('string.repeat requires a valid string.'); - } - if (maxLength === Infinity) { - throw new RangeError('string.padEnd requires a non-negative finite count.'); - } - if (maxLength === null || maxLength === undefined || maxLength < 0) { - maxLength = 0; - } - let strText = String(text); - const padding = maxLength - strText.length; - if (padding > 0) { - strText += - repeat(fillString, Math.floor(padding / fillString.length)) + - fillString.slice(0, padding % fillString.length); - } - return strText; - }; - padStart = function padStart(text, maxLength, fillString = ' ') { - if (text === null || text === undefined) { - throw new TypeError('string.repeat requires a valid string.'); - } - if (maxLength === Infinity) { - throw new RangeError('string.padStart requires a non-negative finite count.'); - } - if (maxLength === null || maxLength === undefined || maxLength < 0) { - maxLength = 0; - } - let strText = String(text); - const padding = maxLength - strText.length; - if (padding > 0) { - strText = - repeat(fillString, Math.floor(padding / fillString.length)) + - fillString.slice(0, padding % fillString.length) + - strText; - } - return strText; - }; -} -//# sourceMappingURL=string.mjs.map \ No newline at end of file diff --git a/deps/framework/shim/string.mjs.map b/deps/framework/shim/string.mjs.map deleted file mode 100644 index ba7f4bba80..0000000000 --- a/deps/framework/shim/string.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"string.mjs","sourceRoot":"","sources":["string.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,UAAU,CAAC;AAC9B,OAAO,GAAG,MAAM,eAAe,CAAC;AAChC,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAsB5C;;GAEG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,MAAM,CAAC;AAEzC;;GAEG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,MAAM,CAAC;AAEzC;;GAEG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,MAAM,CAAC;AAExC;;GAEG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,MAAM,CAAC;AAExC,wBAAwB;AAExB;;;;GAIG;AACH,MAAM,CAAC,IAAI,aAAkD,CAAC;AAE9D;;;;;;GAMG;AACH,MAAM,CAAC,IAAI,GAAwE,CAAC;AAEpF,0BAA0B;AAE1B;;;;;;GAMG;AACH,MAAM,CAAC,IAAI,WAAiE,CAAC;AAE7E;;;;GAIG;AACH,MAAM,CAAC,IAAI,QAAiF,CAAC;AAE7F;;;;;;;GAOG;AACH,MAAM,CAAC,IAAI,QAA8E,CAAC;AAE1F;;;;;;GAMG;AACH,MAAM,CAAC,IAAI,SAA0B,CAAC;AAEtC;;;;GAIG;AACH,MAAM,CAAC,IAAI,MAAkD,CAAC;AAE9D;;;;GAIG;A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QAC/E,CAAC;QAED,EAAE,CAAC,CAAC,SAAS,KAAK,IAAI,IAAI,SAAS,KAAK,SAAS,IAAI,SAAS,GAAG,CAAC,CAAC,CAAC,CAAC;YACpE,SAAS,GAAG,CAAC,CAAC;QACf,CAAC;QAED,IAAI,OAAO,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC;QAC3B,MAAM,OAAO,GAAG,SAAS,GAAG,OAAO,CAAC,MAAM,CAAC;QAE3C,EAAE,CAAC,CAAC,OAAO,GAAG,CAAC,CAAC,CAAC,CAAC;YACjB,OAAO;gBACN,MAAM,CAAC,UAAU,EAAE,IAAI,CAAC,KAAK,CAAC,OAAO,GAAG,UAAU,CAAC,MAAM,CAAC,CAAC;oBAC3D,UAAU,CAAC,KAAK,CAAC,CAAC,EAAE,OAAO,GAAG,UAAU,CAAC,MAAM,CAAC;oBAChD,OAAO,CAAC;QACV,CAAC;QAED,MAAM,CAAC,OAAO,CAAC;IAChB,CAAC,CAAC;AACH,CAAC","sourcesContent":["import global from './global';\nimport has from './support/has';\nimport { wrapNative } from './support/util';\n\nexport interface StringNormalize {\n\t/**\n\t * Returns the String value result of normalizing the string into the normalization form\n\t * named by form as specified in Unicode Standard Annex #15, Unicode Normalization Forms.\n\t * @param target The target string\n\t * @param form Applicable values: \"NFC\", \"NFD\", \"NFKC\", or \"NFKD\", If not specified default\n\t * is \"NFC\"\n\t */\n\t(target: string, form: 'NFC' | 'NFD' | 'NFKC' | 'NFKD'): string;\n\n\t/**\n\t * Returns the String value result of normalizing the string into the normalization form\n\t * named by form as specified in Unicode Standard Annex #15, Unicode Normalization Forms.\n\t * @param target The target string\n\t * @param form Applicable values: \"NFC\", \"NFD\", \"NFKC\", or \"NFKD\", If not specified default\n\t * is \"NFC\"\n\t */\n\t(target: string, form?: string): string;\n}\n\n/**\n * The minimum location of high surrogates\n */\nexport const HIGH_SURROGATE_MIN = 0xd800;\n\n/**\n * The maximum location of high surrogates\n */\nexport const HIGH_SURROGATE_MAX = 0xdbff;\n\n/**\n * The minimum location of low surrogates\n */\nexport const LOW_SURROGATE_MIN = 0xdc00;\n\n/**\n * The maximum location of low surrogates\n */\nexport const LOW_SURROGATE_MAX = 0xdfff;\n\n/* ES6 static methods */\n\n/**\n * Return the String value whose elements are, in order, the elements in the List elements.\n * If length is 0, the empty string is returned.\n * @param codePoints The code points to generate the string\n */\nexport let fromCodePoint: (...codePoints: number[]) => string;\n\n/**\n * `raw` is intended for use as a tag function of a Tagged Template String. When called\n * as such the first argument will be a well formed template call site object and the rest\n * parameter will contain the substitution values.\n * @param template A well-formed template string call site representation.\n * @param substitutions A set of substitution values.\n */\nexport let raw: (template: TemplateStringsArray, ...substitutions: any[]) => string;\n\n/* ES6 instance methods */\n\n/**\n * Returns a nonnegative integer Number less than 1114112 (0x110000) that is the code point\n * value of the UTF-16 encoded code point starting at the string element at position pos in\n * the String resulting from converting this object to a String.\n * If there is no element at that position, the result is undefined.\n * If a valid UTF-16 surrogate pair does not begin at pos, the result is the code unit at pos.\n */\nexport let codePointAt: (target: string, pos?: number) => number | undefined;\n\n/**\n * Returns true if the sequence of elements of searchString converted to a String is the\n * same as the corresponding elements of this object (converted to a String) starting at\n * endPosition – length(this). Otherwise returns false.\n */\nexport let endsWith: (target: string, searchString: string, endPosition?: number) => boolean;\n\n/**\n * Returns true if searchString appears as a substring of the result of converting this\n * object to a String, at one or more positions that are\n * greater than or equal to position; otherwise, returns false.\n * @param target The target string\n * @param searchString search string\n * @param position If position is undefined, 0 is assumed, so as to search all of the String.\n */\nexport let includes: (target: string, searchString: string, position?: number) => boolean;\n\n/**\n * Returns the String value result of normalizing the string into the normalization form\n * named by form as specified in Unicode Standard Annex #15, Unicode Normalization Forms.\n * @param target The target string\n * @param form Applicable values: \"NFC\", \"NFD\", \"NFKC\", or \"NFKD\", If not specified default\n * is \"NFC\"\n */\nexport let normalize: StringNormalize;\n\n/**\n * Returns a String value that is made from count copies appended together. If count is 0,\n * T is the empty String is returned.\n * @param count number of copies to append\n */\nexport let repeat: (target: string, count?: number) => string;\n\n/**\n * Returns true if the sequence of elements of searchString converted to a String is the\n * same as the corresponding elements of this object (converted to a String) starting at\n * position. Otherwise returns false.\n */\nexport let startsWith: (target: string, searchString: string, position?: number) => boolean;\n\n/* ES7 instance methods */\n\n/**\n * Pads the current string with a given string (possibly repeated) so that the resulting string reaches a given length.\n * The padding is applied from the end (right) of the current string.\n *\n * @param target The target string\n * @param maxLength The length of the resulting string once the current string has been padded.\n * If this parameter is smaller than the current string's length, the current string will be returned as it is.\n *\n * @param fillString The string to pad the current string with.\n * If this string is too long, it will be truncated and the left-most part will be applied.\n * The default value for this parameter is \" \" (U+0020).\n */\nexport let padEnd: (target: string, maxLength: number, fillString?: string) => string;\n\n/**\n * Pads the current string with a given string (possibly repeated) so that the resulting string reaches a given length.\n * The padding is applied from the start (left) of the current string.\n *\n * @param target The target string\n * @param maxLength The length of the resulting string once the current string has been padded.\n * If this parameter is smaller than the current string's length, the current string will be returned as it is.\n *\n * @param fillString The string to pad the current string with.\n * If this string is too long, it will be truncated and the left-most part will be applied.\n * The default value for this parameter is \" \" (U+0020).\n */\nexport let padStart: (target: string, maxLength: number, fillString?: string) => string;\n\nif (has('es6-string') && has('es6-string-raw')) {\n\tfromCodePoint = global.String.fromCodePoint;\n\traw = global.String.raw;\n\n\tcodePointAt = wrapNative(global.String.prototype.codePointAt);\n\tendsWith = wrapNative(global.String.prototype.endsWith);\n\tincludes = wrapNative(global.String.prototype.includes);\n\tnormalize = wrapNative(global.String.prototype.normalize);\n\trepeat = wrapNative(global.String.prototype.repeat);\n\tstartsWith = wrapNative(global.String.prototype.startsWith);\n} else {\n\t/**\n\t * Validates that text is defined, and normalizes position (based on the given default if the input is NaN).\n\t * Used by startsWith, includes, and endsWith.\n\t *\n\t * @return Normalized position.\n\t */\n\tconst normalizeSubstringArgs = function(\n\t\tname: string,\n\t\ttext: string,\n\t\tsearch: string,\n\t\tposition: number,\n\t\tisEnd: boolean = false\n\t): [string, string, number] {\n\t\tif (text == null) {\n\t\t\tthrow new TypeError('string.' + name + ' requires a valid string to search against.');\n\t\t}\n\n\t\tconst length = text.length;\n\t\tposition = position !== position ? (isEnd ? length : 0) : position;\n\t\treturn [text, String(search), Math.min(Math.max(position, 0), length)];\n\t};\n\n\tfromCodePoint = function fromCodePoint(...codePoints: number[]): string {\n\t\t// Adapted from https://github.com/mathiasbynens/String.fromCodePoint\n\t\tconst length = arguments.length;\n\t\tif (!length) {\n\t\t\treturn '';\n\t\t}\n\n\t\tconst fromCharCode = String.fromCharCode;\n\t\tconst MAX_SIZE = 0x4000;\n\t\tlet codeUnits: number[] = [];\n\t\tlet index = -1;\n\t\tlet result = '';\n\n\t\twhile (++index < length) {\n\t\t\tlet codePoint = Number(arguments[index]);\n\n\t\t\t// Code points must be finite integers within the valid range\n\t\t\tlet isValid =\n\t\t\t\tisFinite(codePoint) && Math.floor(codePoint) === codePoint && codePoint >= 0 && codePoint <= 0x10ffff;\n\t\t\tif (!isValid) {\n\t\t\t\tthrow RangeError('string.fromCodePoint: Invalid code point ' + codePoint);\n\t\t\t}\n\n\t\t\tif (codePoint <= 0xffff) {\n\t\t\t\t// BMP code point\n\t\t\t\tcodeUnits.push(codePoint);\n\t\t\t} else {\n\t\t\t\t// Astral code point; split in surrogate halves\n\t\t\t\t// https://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae\n\t\t\t\tcodePoint -= 0x10000;\n\t\t\t\tlet highSurrogate = (codePoint >> 10) + HIGH_SURROGATE_MIN;\n\t\t\t\tlet lowSurrogate = codePoint % 0x400 + LOW_SURROGATE_MIN;\n\t\t\t\tcodeUnits.push(highSurrogate, lowSurrogate);\n\t\t\t}\n\n\t\t\tif (index + 1 === length || codeUnits.length > MAX_SIZE) {\n\t\t\t\tresult += fromCharCode.apply(null, codeUnits);\n\t\t\t\tcodeUnits.length = 0;\n\t\t\t}\n\t\t}\n\t\treturn result;\n\t};\n\n\traw = function raw(callSite: TemplateStringsArray, ...substitutions: any[]): string {\n\t\tlet rawStrings = callSite.raw;\n\t\tlet result = '';\n\t\tlet numSubstitutions = substitutions.length;\n\n\t\tif (callSite == null || callSite.raw == null) {\n\t\t\tthrow new TypeError('string.raw requires a valid callSite object with a raw value');\n\t\t}\n\n\t\tfor (let i = 0, length = rawStrings.length; i < length; i++) {\n\t\t\tresult += rawStrings[i] + (i < numSubstitutions && i < length - 1 ? substitutions[i] : '');\n\t\t}\n\n\t\treturn result;\n\t};\n\n\tcodePointAt = function codePointAt(text: string, position: number = 0): number | undefined {\n\t\t// Adapted from https://github.com/mathiasbynens/String.prototype.codePointAt\n\t\tif (text == null) {\n\t\t\tthrow new TypeError('string.codePointAt requries a valid string.');\n\t\t}\n\t\tconst length = text.length;\n\n\t\tif (position !== position) {\n\t\t\tposition = 0;\n\t\t}\n\t\tif (position < 0 || position >= length) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\t// Get the first code unit\n\t\tconst first = text.charCodeAt(position);\n\t\tif (first >= HIGH_SURROGATE_MIN && first <= HIGH_SURROGATE_MAX && length > position + 1) {\n\t\t\t// Start of a surrogate pair (high surrogate and there is a next code unit); check for low surrogate\n\t\t\t// https://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae\n\t\t\tconst second = text.charCodeAt(position + 1);\n\t\t\tif (second >= LOW_SURROGATE_MIN && second <= LOW_SURROGATE_MAX) {\n\t\t\t\treturn (first - HIGH_SURROGATE_MIN) * 0x400 + second - LOW_SURROGATE_MIN + 0x10000;\n\t\t\t}\n\t\t}\n\t\treturn first;\n\t};\n\n\tendsWith = function endsWith(text: string, search: string, endPosition?: number): boolean {\n\t\tif (endPosition == null) {\n\t\t\tendPosition = text.length;\n\t\t}\n\n\t\t[text, search, endPosition] = normalizeSubstringArgs('endsWith', text, search, endPosition, true);\n\n\t\tconst start = endPosition - search.length;\n\t\tif (start < 0) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn text.slice(start, endPosition) === search;\n\t};\n\n\tincludes = function includes(text: string, search: string, position: number = 0): boolean {\n\t\t[text, search, position] = normalizeSubstringArgs('includes', text, search, position);\n\t\treturn text.indexOf(search, position) !== -1;\n\t};\n\n\trepeat = function repeat(text: string, count: number = 0): string {\n\t\t// Adapted from https://github.com/mathiasbynens/String.prototype.repeat\n\t\tif (text == null) {\n\t\t\tthrow new TypeError('string.repeat requires a valid string.');\n\t\t}\n\t\tif (count !== count) {\n\t\t\tcount = 0;\n\t\t}\n\t\tif (count < 0 || count === Infinity) {\n\t\t\tthrow new RangeError('string.repeat requires a non-negative finite count.');\n\t\t}\n\n\t\tlet result = '';\n\t\twhile (count) {\n\t\t\tif (count % 2) {\n\t\t\t\tresult += text;\n\t\t\t}\n\t\t\tif (count > 1) {\n\t\t\t\ttext += text;\n\t\t\t}\n\t\t\tcount >>= 1;\n\t\t}\n\t\treturn result;\n\t};\n\n\tstartsWith = function startsWith(text: string, search: string, position: number = 0): boolean {\n\t\tsearch = String(search);\n\t\t[text, search, position] = normalizeSubstringArgs('startsWith', text, search, position);\n\n\t\tconst end = position + search.length;\n\t\tif (end > text.length) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn text.slice(position, end) === search;\n\t};\n}\n\nif (has('es2017-string')) {\n\tpadEnd = wrapNative(global.String.prototype.padEnd);\n\tpadStart = wrapNative(global.String.prototype.padStart);\n} else {\n\tpadEnd = function padEnd(text: string, maxLength: number, fillString: string = ' '): string {\n\t\tif (text === null || text === undefined) {\n\t\t\tthrow new TypeError('string.repeat requires a valid string.');\n\t\t}\n\n\t\tif (maxLength === Infinity) {\n\t\t\tthrow new RangeError('string.padEnd requires a non-negative finite count.');\n\t\t}\n\n\t\tif (maxLength === null || maxLength === undefined || maxLength < 0) {\n\t\t\tmaxLength = 0;\n\t\t}\n\n\t\tlet strText = String(text);\n\t\tconst padding = maxLength - strText.length;\n\n\t\tif (padding > 0) {\n\t\t\tstrText +=\n\t\t\t\trepeat(fillString, Math.floor(padding / fillString.length)) +\n\t\t\t\tfillString.slice(0, padding % fillString.length);\n\t\t}\n\n\t\treturn strText;\n\t};\n\n\tpadStart = function padStart(text: string, maxLength: number, fillString: string = ' '): string {\n\t\tif (text === null || text === undefined) {\n\t\t\tthrow new TypeError('string.repeat requires a valid string.');\n\t\t}\n\n\t\tif (maxLength === Infinity) {\n\t\t\tthrow new RangeError('string.padStart requires a non-negative finite count.');\n\t\t}\n\n\t\tif (maxLength === null || maxLength === undefined || maxLength < 0) {\n\t\t\tmaxLength = 0;\n\t\t}\n\n\t\tlet strText = String(text);\n\t\tconst padding = maxLength - strText.length;\n\n\t\tif (padding > 0) {\n\t\t\tstrText =\n\t\t\t\trepeat(fillString, Math.floor(padding / fillString.length)) +\n\t\t\t\tfillString.slice(0, padding % fillString.length) +\n\t\t\t\tstrText;\n\t\t}\n\n\t\treturn strText;\n\t};\n}\n"]} \ No newline at end of file diff --git a/deps/framework/shim/support/decorators.d.ts b/deps/framework/shim/support/decorators.d.ts deleted file mode 100644 index a6b4e59cab..0000000000 --- a/deps/framework/shim/support/decorators.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -/** - * A class decorator that provides either a native class or a shimmed class based on a feature - * test - * @param feature The has feature to check - * @param trueClass The class to use if feature test returns `true` - * @param falseClass The class to use if the feature test returns `false` or is not defined - */ -export declare function hasClass(feature: string, trueClass: Function, falseClass: Function): ClassDecorator; diff --git a/deps/framework/shim/support/decorators.js b/deps/framework/shim/support/decorators.js deleted file mode 100644 index ded4dd8ec5..0000000000 --- a/deps/framework/shim/support/decorators.js +++ /dev/null @@ -1,28 +0,0 @@ -(function (factory) { - if (typeof module === "object" && typeof module.exports === "object") { - var v = factory(require, exports); - if (v !== undefined) module.exports = v; - } - else if (typeof define === "function" && define.amd) { - define(["require", "exports", "./has"], factory); - } -})(function (require, exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - var has_1 = require("./has"); - /** - * A class decorator that provides either a native class or a shimmed class based on a feature - * test - * @param feature The has feature to check - * @param trueClass The class to use if feature test returns `true` - * @param falseClass The class to use if the feature test returns `false` or is not defined - */ - function hasClass(feature, trueClass, falseClass) { - return function (target) { - /* Return type generics aren't catching the fact that Function is assignable to the generic */ - return (has_1.default(feature) ? trueClass : falseClass); - }; - } - exports.hasClass = hasClass; -}); -//# sourceMappingURL=decorators.js.map \ No newline at end of file diff --git a/deps/framework/shim/support/decorators.js.map b/deps/framework/shim/support/decorators.js.map deleted file mode 100644 index 22a6aa20ae..0000000000 --- a/deps/framework/shim/support/decorators.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"decorators.js","sourceRoot":"","sources":["decorators.ts"],"names":[],"mappings":";;;;;;;;;;;IAAA,6BAAwB;IAExB;;;;;;OAMG;IACH,kBAAyB,OAAe,EAAE,SAAmB,EAAE,UAAoB;QAClF,MAAM,CAAC,UAAS,MAAgB;YAC/B,8FAA8F;YAC9F,MAAM,CAAC,CAAC,aAAG,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,UAAU,CAAQ,CAAC;QACvD,CAAC,CAAC;IACH,CAAC;IALD,4BAKC","sourcesContent":["import has from './has';\n\n/**\n * A class decorator that provides either a native class or a shimmed class based on a feature\n * test\n * @param feature The has feature to check\n * @param trueClass The class to use if feature test returns `true`\n * @param falseClass The class to use if the feature test returns `false` or is not defined\n */\nexport function hasClass(feature: string, trueClass: Function, falseClass: Function): ClassDecorator {\n\treturn function(target: Function) {\n\t\t/* Return type generics aren't catching the fact that Function is assignable to the generic */\n\t\treturn (has(feature) ? trueClass : falseClass) as any;\n\t};\n}\n"]} \ No newline at end of file diff --git a/deps/framework/shim/support/decorators.mjs b/deps/framework/shim/support/decorators.mjs deleted file mode 100644 index e756e4435d..0000000000 --- a/deps/framework/shim/support/decorators.mjs +++ /dev/null @@ -1,15 +0,0 @@ -import has from './has'; -/** - * A class decorator that provides either a native class or a shimmed class based on a feature - * test - * @param feature The has feature to check - * @param trueClass The class to use if feature test returns `true` - * @param falseClass The class to use if the feature test returns `false` or is not defined - */ -export function hasClass(feature, trueClass, falseClass) { - return function (target) { - /* Return type generics aren't catching the fact that Function is assignable to the generic */ - return (has(feature) ? trueClass : falseClass); - }; -} -//# sourceMappingURL=decorators.mjs.map \ No newline at end of file diff --git a/deps/framework/shim/support/decorators.mjs.map b/deps/framework/shim/support/decorators.mjs.map deleted file mode 100644 index ef3ed3433f..0000000000 --- a/deps/framework/shim/support/decorators.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"decorators.mjs","sourceRoot":"","sources":["decorators.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,OAAO,CAAC;AAExB;;;;;;GAMG;AACH,MAAM,mBAAmB,OAAe,EAAE,SAAmB,EAAE,UAAoB;IAClF,MAAM,CAAC,UAAS,MAAgB;QAC/B,8FAA8F;QAC9F,MAAM,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,UAAU,CAAQ,CAAC;IACvD,CAAC,CAAC;AACH,CAAC","sourcesContent":["import has from './has';\n\n/**\n * A class decorator that provides either a native class or a shimmed class based on a feature\n * test\n * @param feature The has feature to check\n * @param trueClass The class to use if feature test returns `true`\n * @param falseClass The class to use if the feature test returns `false` or is not defined\n */\nexport function hasClass(feature: string, trueClass: Function, falseClass: Function): ClassDecorator {\n\treturn function(target: Function) {\n\t\t/* Return type generics aren't catching the fact that Function is assignable to the generic */\n\t\treturn (has(feature) ? trueClass : falseClass) as any;\n\t};\n}\n"]} \ No newline at end of file diff --git a/deps/framework/shim/support/has.d.ts b/deps/framework/shim/support/has.d.ts deleted file mode 100644 index 613fba211c..0000000000 --- a/deps/framework/shim/support/has.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import has from '../../has/has'; -export default has; -export * from '../../has/has'; diff --git a/deps/framework/shim/support/has.js b/deps/framework/shim/support/has.js deleted file mode 100644 index 12657aa908..0000000000 --- a/deps/framework/shim/support/has.js +++ /dev/null @@ -1,184 +0,0 @@ -(function (factory) { - if (typeof module === "object" && typeof module.exports === "object") { - var v = factory(require, exports); - if (v !== undefined) module.exports = v; - } - else if (typeof define === "function" && define.amd) { - define(["require", "exports", "tslib", "../../has/has", "../global", "../../has/has"], factory); - } -})(function (require, exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - var tslib_1 = require("tslib"); - var has_1 = require("../../has/has"); - var global_1 = require("../global"); - exports.default = has_1.default; - tslib_1.__exportStar(require("../../has/has"), exports); - /* ECMAScript 6 and 7 Features */ - /* Array */ - has_1.add('es6-array', function () { - return (['from', 'of'].every(function (key) { return key in global_1.default.Array; }) && - ['findIndex', 'find', 'copyWithin'].every(function (key) { return key in global_1.default.Array.prototype; })); - }, true); - has_1.add('es6-array-fill', function () { - if ('fill' in global_1.default.Array.prototype) { - /* Some versions of Safari do not properly implement this */ - return [1].fill(9, Number.POSITIVE_INFINITY)[0] === 1; - } - return false; - }, true); - has_1.add('es7-array', function () { return 'includes' in global_1.default.Array.prototype; }, true); - /* Map */ - has_1.add('es6-map', function () { - if (typeof global_1.default.Map === 'function') { - /* - IE11 and older versions of Safari are missing critical ES6 Map functionality - We wrap this in a try/catch because sometimes the Map constructor exists, but does not - take arguments (iOS 8.4) - */ - try { - var map = new global_1.default.Map([[0, 1]]); - return (map.has(0) && - typeof map.keys === 'function' && - has_1.default('es6-symbol') && - typeof map.values === 'function' && - typeof map.entries === 'function'); - } - catch (e) { - /* istanbul ignore next: not testing on iOS at the moment */ - return false; - } - } - return false; - }, true); - /* Math */ - has_1.add('es6-math', function () { - return [ - 'clz32', - 'sign', - 'log10', - 'log2', - 'log1p', - 'expm1', - 'cosh', - 'sinh', - 'tanh', - 'acosh', - 'asinh', - 'atanh', - 'trunc', - 'fround', - 'cbrt', - 'hypot' - ].every(function (name) { return typeof global_1.default.Math[name] === 'function'; }); - }, true); - has_1.add('es6-math-imul', function () { - if ('imul' in global_1.default.Math) { - /* Some versions of Safari on ios do not properly implement this */ - return Math.imul(0xffffffff, 5) === -5; - } - return false; - }, true); - /* Object */ - has_1.add('es6-object', function () { - return (has_1.default('es6-symbol') && - ['assign', 'is', 'getOwnPropertySymbols', 'setPrototypeOf'].every(function (name) { return typeof global_1.default.Object[name] === 'function'; })); - }, true); - has_1.add('es2017-object', function () { - return ['values', 'entries', 'getOwnPropertyDescriptors'].every(function (name) { return typeof global_1.default.Object[name] === 'function'; }); - }, true); - /* Observable */ - has_1.add('es-observable', function () { return typeof global_1.default.Observable !== 'undefined'; }, true); - /* Promise */ - has_1.add('es6-promise', function () { return typeof global_1.default.Promise !== 'undefined' && has_1.default('es6-symbol'); }, true); - /* Set */ - has_1.add('es6-set', function () { - if (typeof global_1.default.Set === 'function') { - /* IE11 and older versions of Safari are missing critical ES6 Set functionality */ - var set = new global_1.default.Set([1]); - return set.has(1) && 'keys' in set && typeof set.keys === 'function' && has_1.default('es6-symbol'); - } - return false; - }, true); - /* String */ - has_1.add('es6-string', function () { - return ([ - /* static methods */ - 'fromCodePoint' - ].every(function (key) { return typeof global_1.default.String[key] === 'function'; }) && - [ - /* instance methods */ - 'codePointAt', - 'normalize', - 'repeat', - 'startsWith', - 'endsWith', - 'includes' - ].every(function (key) { return typeof global_1.default.String.prototype[key] === 'function'; })); - }, true); - has_1.add('es6-string-raw', function () { - function getCallSite(callSite) { - var substitutions = []; - for (var _i = 1; _i < arguments.length; _i++) { - substitutions[_i - 1] = arguments[_i]; - } - var result = tslib_1.__spread(callSite); - result.raw = callSite.raw; - return result; - } - if ('raw' in global_1.default.String) { - var b = 1; - var callSite = getCallSite(templateObject_1 || (templateObject_1 = tslib_1.__makeTemplateObject(["a\n", ""], ["a\\n", ""])), b); - callSite.raw = ['a\\n']; - var supportsTrunc = global_1.default.String.raw(callSite, 42) === 'a:\\n'; - return supportsTrunc; - } - return false; - }, true); - has_1.add('es2017-string', function () { - return ['padStart', 'padEnd'].every(function (key) { return typeof global_1.default.String.prototype[key] === 'function'; }); - }, true); - /* Symbol */ - has_1.add('es6-symbol', function () { return typeof global_1.default.Symbol !== 'undefined' && typeof Symbol() === 'symbol'; }, true); - /* WeakMap */ - has_1.add('es6-weakmap', function () { - if (typeof global_1.default.WeakMap !== 'undefined') { - /* IE11 and older versions of Safari are missing critical ES6 Map functionality */ - var key1 = {}; - var key2 = {}; - var map = new global_1.default.WeakMap([[key1, 1]]); - Object.freeze(key1); - return map.get(key1) === 1 && map.set(key2, 2) === map && has_1.default('es6-symbol'); - } - return false; - }, true); - /* Miscellaneous features */ - has_1.add('microtasks', function () { return has_1.default('es6-promise') || has_1.default('host-node') || has_1.default('dom-mutationobserver'); }, true); - has_1.add('postmessage', function () { - // If window is undefined, and we have postMessage, it probably means we're in a web worker. Web workers have - // post message but it doesn't work how we expect it to, so it's best just to pretend it doesn't exist. - return typeof global_1.default.window !== 'undefined' && typeof global_1.default.postMessage === 'function'; - }, true); - has_1.add('raf', function () { return typeof global_1.default.requestAnimationFrame === 'function'; }, true); - has_1.add('setimmediate', function () { return typeof global_1.default.setImmediate !== 'undefined'; }, true); - /* DOM Features */ - has_1.add('dom-mutationobserver', function () { - if (has_1.default('host-browser') && Boolean(global_1.default.MutationObserver || global_1.default.WebKitMutationObserver)) { - // IE11 has an unreliable MutationObserver implementation where setProperty() does not - // generate a mutation event, observers can crash, and the queue does not drain - // reliably. The following feature test was adapted from - // https://gist.github.com/t10ko/4aceb8c71681fdb275e33efe5e576b14 - var example = document.createElement('div'); - /* tslint:disable-next-line:variable-name */ - var HostMutationObserver = global_1.default.MutationObserver || global_1.default.WebKitMutationObserver; - var observer = new HostMutationObserver(function () { }); - observer.observe(example, { attributes: true }); - example.style.setProperty('display', 'block'); - return Boolean(observer.takeRecords().length); - } - return false; - }, true); - has_1.add('dom-webanimation', function () { return has_1.default('host-browser') && global_1.default.Animation !== undefined && global_1.default.KeyframeEffect !== undefined; }, true); - var templateObject_1; -}); -//# sourceMappingURL=has.js.map \ No newline at end of file diff --git a/deps/framework/shim/support/has.js.map b/deps/framework/shim/support/has.js.map deleted file mode 100644 index e0a5127f50..0000000000 --- a/deps/framework/shim/support/has.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"has.js","sourceRoot":"","sources":["has.ts"],"names":[],"mappings":";;;;;;;;;;;;IAAA,qCAAyC;IACzC,oCAA+B;IAE/B,kBAAe,aAAG,CAAC;IACnB,wDAA8B;IAE9B,iCAAiC;IAEjC,WAAW;IACX,SAAG,CACF,WAAW,EACX;QACC,MAAM,CAAC,CACN,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC,KAAK,CAAC,UAAC,GAAG,IAAK,OAAA,GAAG,IAAI,gBAAM,CAAC,KAAK,EAAnB,CAAmB,CAAC;YAClD,CAAC,WAAW,EAAE,MAAM,EAAE,YAAY,CAAC,CAAC,KAAK,CAAC,UAAC,GAAG,IAAK,OAAA,GAAG,IAAI,gBAAM,CAAC,KAAK,CAAC,SAAS,EAA7B,CAA6B,CAAC,CACjF,CAAC;IACH,CAAC,EACD,IAAI,CACJ,CAAC;IAEF,SAAG,CACF,gBAAgB,EAChB;QACC,EAAE,CAAC,CAAC,MAAM,IAAI,gBAAM,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC;YACtC,4DAA4D;YAC5D,MAAM,CAAO,CAAC,CAAC,CAAE,CAAC,IAAI,CAAC,CAAC,EAAE,MAAM,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;QAC9D,CAAC;QACD,MAAM,CAAC,KAAK,CAAC;IACd,CAAC,EACD,IAAI,CACJ,CAAC;IAEF,SAAG,CAAC,WAAW,EAAE,cAAM,OAAA,UAAU,IAAI,gBAAM,CAAC,KAAK,CAAC,SAAS,EAApC,CAAoC,EAAE,IAAI,CAAC,CAAC;IAEnE,SAAS;IACT,SAAG,CACF,SAAS,EACT;QACC,EAAE,CAAC,CAAC,OAAO,gBAAM,CAAC,GAAG,KAAK,UAAU,CAAC,CAAC,CAAC;YACtC;;;;WAIE;YACF,IAAI,CAAC;gBACJ,IAAM,GAAG,GAAG,IAAI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kB,EAClB,cAAM,OAAA,aAAG,CAAC,cAAc,CAAC,IAAI,gBAAM,CAAC,SAAS,KAAK,SAAS,IAAI,gBAAM,CAAC,cAAc,KAAK,SAAS,EAA5F,CAA4F,EAClG,IAAI,CACJ,CAAC","sourcesContent":["import has, { add } from '../../has/has';\nimport global from '../global';\n\nexport default has;\nexport * from '../../has/has';\n\n/* ECMAScript 6 and 7 Features */\n\n/* Array */\nadd(\n\t'es6-array',\n\t() => {\n\t\treturn (\n\t\t\t['from', 'of'].every((key) => key in global.Array) &&\n\t\t\t['findIndex', 'find', 'copyWithin'].every((key) => key in global.Array.prototype)\n\t\t);\n\t},\n\ttrue\n);\n\nadd(\n\t'es6-array-fill',\n\t() => {\n\t\tif ('fill' in global.Array.prototype) {\n\t\t\t/* Some versions of Safari do not properly implement this */\n\t\t\treturn ([1]).fill(9, Number.POSITIVE_INFINITY)[0] === 1;\n\t\t}\n\t\treturn false;\n\t},\n\ttrue\n);\n\nadd('es7-array', () => 'includes' in global.Array.prototype, true);\n\n/* Map */\nadd(\n\t'es6-map',\n\t() => {\n\t\tif (typeof global.Map === 'function') {\n\t\t\t/*\n\t\tIE11 and older versions of Safari are missing critical ES6 Map functionality\n\t\tWe wrap this in a try/catch because sometimes the Map constructor exists, but does not\n\t\ttake arguments (iOS 8.4)\n\t\t */\n\t\t\ttry {\n\t\t\t\tconst map = new global.Map([[0, 1]]);\n\n\t\t\t\treturn (\n\t\t\t\t\tmap.has(0) &&\n\t\t\t\t\ttypeof map.keys === 'function' &&\n\t\t\t\t\thas('es6-symbol') &&\n\t\t\t\t\ttypeof map.values === 'function' &&\n\t\t\t\t\ttypeof map.entries === 'function'\n\t\t\t\t);\n\t\t\t} catch (e) {\n\t\t\t\t/* istanbul ignore next: not testing on iOS at the moment */\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t},\n\ttrue\n);\n\n/* Math */\nadd(\n\t'es6-math',\n\t() => {\n\t\treturn [\n\t\t\t'clz32',\n\t\t\t'sign',\n\t\t\t'log10',\n\t\t\t'log2',\n\t\t\t'log1p',\n\t\t\t'expm1',\n\t\t\t'cosh',\n\t\t\t'sinh',\n\t\t\t'tanh',\n\t\t\t'acosh',\n\t\t\t'asinh',\n\t\t\t'atanh',\n\t\t\t'trunc',\n\t\t\t'fround',\n\t\t\t'cbrt',\n\t\t\t'hypot'\n\t\t].every((name) => typeof global.Math[name] === 'function');\n\t},\n\ttrue\n);\n\nadd(\n\t'es6-math-imul',\n\t() => {\n\t\tif ('imul' in global.Math) {\n\t\t\t/* Some versions of Safari on ios do not properly implement this */\n\t\t\treturn (Math).imul(0xffffffff, 5) === -5;\n\t\t}\n\t\treturn false;\n\t},\n\ttrue\n);\n\n/* Object */\nadd(\n\t'es6-object',\n\t() => {\n\t\treturn (\n\t\t\thas('es6-symbol') &&\n\t\t\t['assign', 'is', 'getOwnPropertySymbols', 'setPrototypeOf'].every(\n\t\t\t\t(name) => typeof global.Object[name] === 'function'\n\t\t\t)\n\t\t);\n\t},\n\ttrue\n);\n\nadd(\n\t'es2017-object',\n\t() => {\n\t\treturn ['values', 'entries', 'getOwnPropertyDescriptors'].every(\n\t\t\t(name) => typeof global.Object[name] === 'function'\n\t\t);\n\t},\n\ttrue\n);\n\n/* Observable */\nadd('es-observable', () => typeof global.Observable !== 'undefined', true);\n\n/* Promise */\nadd('es6-promise', () => typeof global.Promise !== 'undefined' && has('es6-symbol'), true);\n\n/* Set */\nadd(\n\t'es6-set',\n\t() => {\n\t\tif (typeof global.Set === 'function') {\n\t\t\t/* IE11 and older versions of Safari are missing critical ES6 Set functionality */\n\t\t\tconst set = new global.Set([1]);\n\t\t\treturn set.has(1) && 'keys' in set && typeof set.keys === 'function' && has('es6-symbol');\n\t\t}\n\t\treturn false;\n\t},\n\ttrue\n);\n\n/* String */\nadd(\n\t'es6-string',\n\t() => {\n\t\treturn (\n\t\t\t[\n\t\t\t\t/* static methods */\n\t\t\t\t'fromCodePoint'\n\t\t\t].every((key) => typeof global.String[key] === 'function') &&\n\t\t\t[\n\t\t\t\t/* instance methods */\n\t\t\t\t'codePointAt',\n\t\t\t\t'normalize',\n\t\t\t\t'repeat',\n\t\t\t\t'startsWith',\n\t\t\t\t'endsWith',\n\t\t\t\t'includes'\n\t\t\t].every((key) => typeof global.String.prototype[key] === 'function')\n\t\t);\n\t},\n\ttrue\n);\n\nadd(\n\t'es6-string-raw',\n\t() => {\n\t\tfunction getCallSite(callSite: TemplateStringsArray, ...substitutions: any[]) {\n\t\t\tconst result = [...callSite];\n\t\t\t(result as any).raw = callSite.raw;\n\t\t\treturn result;\n\t\t}\n\n\t\tif ('raw' in global.String) {\n\t\t\tlet b = 1;\n\t\t\tlet callSite = getCallSite`a\\n${b}`;\n\n\t\t\t(callSite as any).raw = ['a\\\\n'];\n\t\t\tconst supportsTrunc = global.String.raw(callSite, 42) === 'a:\\\\n';\n\n\t\t\treturn supportsTrunc;\n\t\t}\n\n\t\treturn false;\n\t},\n\ttrue\n);\n\nadd(\n\t'es2017-string',\n\t() => {\n\t\treturn ['padStart', 'padEnd'].every((key) => typeof global.String.prototype[key] === 'function');\n\t},\n\ttrue\n);\n\n/* Symbol */\nadd('es6-symbol', () => typeof global.Symbol !== 'undefined' && typeof Symbol() === 'symbol', true);\n\n/* WeakMap */\nadd(\n\t'es6-weakmap',\n\t() => {\n\t\tif (typeof global.WeakMap !== 'undefined') {\n\t\t\t/* IE11 and older versions of Safari are missing critical ES6 Map functionality */\n\t\t\tconst key1 = {};\n\t\t\tconst key2 = {};\n\t\t\tconst map = new global.WeakMap([[key1, 1]]);\n\t\t\tObject.freeze(key1);\n\t\t\treturn map.get(key1) === 1 && map.set(key2, 2) === map && has('es6-symbol');\n\t\t}\n\t\treturn false;\n\t},\n\ttrue\n);\n\n/* Miscellaneous features */\nadd('microtasks', () => has('es6-promise') || has('host-node') || has('dom-mutationobserver'), true);\nadd(\n\t'postmessage',\n\t() => {\n\t\t// If window is undefined, and we have postMessage, it probably means we're in a web worker. Web workers have\n\t\t// post message but it doesn't work how we expect it to, so it's best just to pretend it doesn't exist.\n\t\treturn typeof global.window !== 'undefined' && typeof global.postMessage === 'function';\n\t},\n\ttrue\n);\nadd('raf', () => typeof global.requestAnimationFrame === 'function', true);\nadd('setimmediate', () => typeof global.setImmediate !== 'undefined', true);\n\n/* DOM Features */\n\nadd(\n\t'dom-mutationobserver',\n\t() => {\n\t\tif (has('host-browser') && Boolean(global.MutationObserver || global.WebKitMutationObserver)) {\n\t\t\t// IE11 has an unreliable MutationObserver implementation where setProperty() does not\n\t\t\t// generate a mutation event, observers can crash, and the queue does not drain\n\t\t\t// reliably. The following feature test was adapted from\n\t\t\t// https://gist.github.com/t10ko/4aceb8c71681fdb275e33efe5e576b14\n\t\t\tconst example = document.createElement('div');\n\t\t\t/* tslint:disable-next-line:variable-name */\n\t\t\tconst HostMutationObserver = global.MutationObserver || global.WebKitMutationObserver;\n\t\t\tconst observer = new HostMutationObserver(function() {});\n\t\t\tobserver.observe(example, { attributes: true });\n\n\t\t\texample.style.setProperty('display', 'block');\n\n\t\t\treturn Boolean(observer.takeRecords().length);\n\t\t}\n\t\treturn false;\n\t},\n\ttrue\n);\n\nadd(\n\t'dom-webanimation',\n\t() => has('host-browser') && global.Animation !== undefined && global.KeyframeEffect !== undefined,\n\ttrue\n);\n"]} \ No newline at end of file diff --git a/deps/framework/shim/support/has.mjs b/deps/framework/shim/support/has.mjs deleted file mode 100644 index 941b87965b..0000000000 --- a/deps/framework/shim/support/has.mjs +++ /dev/null @@ -1,166 +0,0 @@ -import has, { add } from '../../has/has'; -import global from '../global'; -export default has; -export * from '../../has/has'; -/* ECMAScript 6 and 7 Features */ -/* Array */ -add('es6-array', () => { - return (['from', 'of'].every((key) => key in global.Array) && - ['findIndex', 'find', 'copyWithin'].every((key) => key in global.Array.prototype)); -}, true); -add('es6-array-fill', () => { - if ('fill' in global.Array.prototype) { - /* Some versions of Safari do not properly implement this */ - return [1].fill(9, Number.POSITIVE_INFINITY)[0] === 1; - } - return false; -}, true); -add('es7-array', () => 'includes' in global.Array.prototype, true); -/* Map */ -add('es6-map', () => { - if (typeof global.Map === 'function') { - /* - IE11 and older versions of Safari are missing critical ES6 Map functionality - We wrap this in a try/catch because sometimes the Map constructor exists, but does not - take arguments (iOS 8.4) - */ - try { - const map = new global.Map([[0, 1]]); - return (map.has(0) && - typeof map.keys === 'function' && - has('es6-symbol') && - typeof map.values === 'function' && - typeof map.entries === 'function'); - } - catch (e) { - /* istanbul ignore next: not testing on iOS at the moment */ - return false; - } - } - return false; -}, true); -/* Math */ -add('es6-math', () => { - return [ - 'clz32', - 'sign', - 'log10', - 'log2', - 'log1p', - 'expm1', - 'cosh', - 'sinh', - 'tanh', - 'acosh', - 'asinh', - 'atanh', - 'trunc', - 'fround', - 'cbrt', - 'hypot' - ].every((name) => typeof global.Math[name] === 'function'); -}, true); -add('es6-math-imul', () => { - if ('imul' in global.Math) { - /* Some versions of Safari on ios do not properly implement this */ - return Math.imul(0xffffffff, 5) === -5; - } - return false; -}, true); -/* Object */ -add('es6-object', () => { - return (has('es6-symbol') && - ['assign', 'is', 'getOwnPropertySymbols', 'setPrototypeOf'].every((name) => typeof global.Object[name] === 'function')); -}, true); -add('es2017-object', () => { - return ['values', 'entries', 'getOwnPropertyDescriptors'].every((name) => typeof global.Object[name] === 'function'); -}, true); -/* Observable */ -add('es-observable', () => typeof global.Observable !== 'undefined', true); -/* Promise */ -add('es6-promise', () => typeof global.Promise !== 'undefined' && has('es6-symbol'), true); -/* Set */ -add('es6-set', () => { - if (typeof global.Set === 'function') { - /* IE11 and older versions of Safari are missing critical ES6 Set functionality */ - const set = new global.Set([1]); - return set.has(1) && 'keys' in set && typeof set.keys === 'function' && has('es6-symbol'); - } - return false; -}, true); -/* String */ -add('es6-string', () => { - return ([ - /* static methods */ - 'fromCodePoint' - ].every((key) => typeof global.String[key] === 'function') && - [ - /* instance methods */ - 'codePointAt', - 'normalize', - 'repeat', - 'startsWith', - 'endsWith', - 'includes' - ].every((key) => typeof global.String.prototype[key] === 'function')); -}, true); -add('es6-string-raw', () => { - function getCallSite(callSite, ...substitutions) { - const result = [...callSite]; - result.raw = callSite.raw; - return result; - } - if ('raw' in global.String) { - let b = 1; - let callSite = getCallSite `a\n${b}`; - callSite.raw = ['a\\n']; - const supportsTrunc = global.String.raw(callSite, 42) === 'a:\\n'; - return supportsTrunc; - } - return false; -}, true); -add('es2017-string', () => { - return ['padStart', 'padEnd'].every((key) => typeof global.String.prototype[key] === 'function'); -}, true); -/* Symbol */ -add('es6-symbol', () => typeof global.Symbol !== 'undefined' && typeof Symbol() === 'symbol', true); -/* WeakMap */ -add('es6-weakmap', () => { - if (typeof global.WeakMap !== 'undefined') { - /* IE11 and older versions of Safari are missing critical ES6 Map functionality */ - const key1 = {}; - const key2 = {}; - const map = new global.WeakMap([[key1, 1]]); - Object.freeze(key1); - return map.get(key1) === 1 && map.set(key2, 2) === map && has('es6-symbol'); - } - return false; -}, true); -/* Miscellaneous features */ -add('microtasks', () => has('es6-promise') || has('host-node') || has('dom-mutationobserver'), true); -add('postmessage', () => { - // If window is undefined, and we have postMessage, it probably means we're in a web worker. Web workers have - // post message but it doesn't work how we expect it to, so it's best just to pretend it doesn't exist. - return typeof global.window !== 'undefined' && typeof global.postMessage === 'function'; -}, true); -add('raf', () => typeof global.requestAnimationFrame === 'function', true); -add('setimmediate', () => typeof global.setImmediate !== 'undefined', true); -/* DOM Features */ -add('dom-mutationobserver', () => { - if (has('host-browser') && Boolean(global.MutationObserver || global.WebKitMutationObserver)) { - // IE11 has an unreliable MutationObserver implementation where setProperty() does not - // generate a mutation event, observers can crash, and the queue does not drain - // reliably. The following feature test was adapted from - // https://gist.github.com/t10ko/4aceb8c71681fdb275e33efe5e576b14 - const example = document.createElement('div'); - /* tslint:disable-next-line:variable-name */ - const HostMutationObserver = global.MutationObserver || global.WebKitMutationObserver; - const observer = new HostMutationObserver(function () { }); - observer.observe(example, { attributes: true }); - example.style.setProperty('display', 'block'); - return Boolean(observer.takeRecords().length); - } - return false; -}, true); -add('dom-webanimation', () => has('host-browser') && global.Animation !== undefined && global.KeyframeEffect !== undefined, true); -//# sourceMappingURL=has.mjs.map \ No newline at end of file diff --git a/deps/framework/shim/support/has.mjs.map b/deps/framework/shim/support/has.mjs.map deleted file mode 100644 index 04bfd85fdf..0000000000 --- a/deps/framework/shim/support/has.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"has.mjs","sourceRoot":"","sources":["has.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,EAAE,EAAE,GAAG,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,MAAM,MAAM,WAAW,CAAC;AAE/B,eAAe,GAAG,CAAC;AACnB,cAAc,eAAe,CAAC;AAE9B,iCAAiC;AAEjC,WAAW;AACX,GAAG,CACF,WAAW,EACX,GAAG,EAAE;IACJ,MAAM,CAAC,CACN,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,IAAI,MAAM,CAAC,KAAK,CAAC;QAClD,CAAC,WAAW,EAAE,MAAM,EAAE,YAAY,CAAC,CAAC,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,IAAI,MAAM,CAAC,KAAK,CAAC,SAAS,CAAC,CACjF,CAAC;AACH,CAAC,EACD,IAAI,CACJ,CAAC;AAEF,GAAG,CACF,gBAAgB,EAChB,GAAG,EAAE;IACJ,EAAE,CAAC,CAAC,MAAM,IAAI,MAAM,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC;QACtC,4DAA4D;QAC5D,MAAM,CAAO,CAAC,CAAC,CAAE,CAAC,IAAI,CAAC,CAAC,EAAE,MAAM,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;IAC9D,CAAC;IACD,MAAM,CAAC,KAAK,CAAC;AACd,CAAC,EACD,IAAI,CACJ,CAAC;AAEF,GAAG,CAAC,WAAW,EAAE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CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;QAE9C,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC,WAAW,EAAE,CAAC,MAAM,CAAC,CAAC;IAC/C,CAAC;IACD,MAAM,CAAC,KAAK,CAAC;AACd,CAAC,EACD,IAAI,CACJ,CAAC;AAEF,GAAG,CACF,kBAAkB,EAClB,GAAG,EAAE,CAAC,GAAG,CAAC,cAAc,CAAC,IAAI,MAAM,CAAC,SAAS,KAAK,SAAS,IAAI,MAAM,CAAC,cAAc,KAAK,SAAS,EAClG,IAAI,CACJ,CAAC","sourcesContent":["import has, { add } from '../../has/has';\nimport global from '../global';\n\nexport default has;\nexport * from '../../has/has';\n\n/* ECMAScript 6 and 7 Features */\n\n/* Array */\nadd(\n\t'es6-array',\n\t() => {\n\t\treturn (\n\t\t\t['from', 'of'].every((key) => key in global.Array) &&\n\t\t\t['findIndex', 'find', 'copyWithin'].every((key) => key in global.Array.prototype)\n\t\t);\n\t},\n\ttrue\n);\n\nadd(\n\t'es6-array-fill',\n\t() => {\n\t\tif ('fill' in global.Array.prototype) {\n\t\t\t/* Some versions of Safari do not properly implement this */\n\t\t\treturn ([1]).fill(9, Number.POSITIVE_INFINITY)[0] === 1;\n\t\t}\n\t\treturn false;\n\t},\n\ttrue\n);\n\nadd('es7-array', () => 'includes' in global.Array.prototype, true);\n\n/* Map */\nadd(\n\t'es6-map',\n\t() => {\n\t\tif (typeof global.Map === 'function') {\n\t\t\t/*\n\t\tIE11 and older versions of Safari are missing critical ES6 Map functionality\n\t\tWe wrap this in a try/catch because sometimes the Map constructor exists, but does not\n\t\ttake arguments (iOS 8.4)\n\t\t */\n\t\t\ttry {\n\t\t\t\tconst map = new global.Map([[0, 1]]);\n\n\t\t\t\treturn (\n\t\t\t\t\tmap.has(0) &&\n\t\t\t\t\ttypeof map.keys === 'function' &&\n\t\t\t\t\thas('es6-symbol') &&\n\t\t\t\t\ttypeof map.values === 'function' &&\n\t\t\t\t\ttypeof map.entries === 'function'\n\t\t\t\t);\n\t\t\t} catch (e) {\n\t\t\t\t/* istanbul ignore next: not testing on iOS at the moment */\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t},\n\ttrue\n);\n\n/* Math */\nadd(\n\t'es6-math',\n\t() => {\n\t\treturn [\n\t\t\t'clz32',\n\t\t\t'sign',\n\t\t\t'log10',\n\t\t\t'log2',\n\t\t\t'log1p',\n\t\t\t'expm1',\n\t\t\t'cosh',\n\t\t\t'sinh',\n\t\t\t'tanh',\n\t\t\t'acosh',\n\t\t\t'asinh',\n\t\t\t'atanh',\n\t\t\t'trunc',\n\t\t\t'fround',\n\t\t\t'cbrt',\n\t\t\t'hypot'\n\t\t].every((name) => typeof global.Math[name] === 'function');\n\t},\n\ttrue\n);\n\nadd(\n\t'es6-math-imul',\n\t() => {\n\t\tif ('imul' in global.Math) {\n\t\t\t/* Some versions of Safari on ios do not properly implement this */\n\t\t\treturn (Math).imul(0xffffffff, 5) === -5;\n\t\t}\n\t\treturn false;\n\t},\n\ttrue\n);\n\n/* Object */\nadd(\n\t'es6-object',\n\t() => {\n\t\treturn (\n\t\t\thas('es6-symbol') &&\n\t\t\t['assign', 'is', 'getOwnPropertySymbols', 'setPrototypeOf'].every(\n\t\t\t\t(name) => typeof global.Object[name] === 'function'\n\t\t\t)\n\t\t);\n\t},\n\ttrue\n);\n\nadd(\n\t'es2017-object',\n\t() => {\n\t\treturn ['values', 'entries', 'getOwnPropertyDescriptors'].every(\n\t\t\t(name) => typeof global.Object[name] === 'function'\n\t\t);\n\t},\n\ttrue\n);\n\n/* Observable */\nadd('es-observable', () => typeof global.Observable !== 'undefined', true);\n\n/* Promise */\nadd('es6-promise', () => typeof global.Promise !== 'undefined' && has('es6-symbol'), true);\n\n/* Set */\nadd(\n\t'es6-set',\n\t() => {\n\t\tif (typeof global.Set === 'function') {\n\t\t\t/* IE11 and older versions of Safari are missing critical ES6 Set functionality */\n\t\t\tconst set = new global.Set([1]);\n\t\t\treturn set.has(1) && 'keys' in set && typeof set.keys === 'function' && has('es6-symbol');\n\t\t}\n\t\treturn false;\n\t},\n\ttrue\n);\n\n/* String */\nadd(\n\t'es6-string',\n\t() => {\n\t\treturn (\n\t\t\t[\n\t\t\t\t/* static methods */\n\t\t\t\t'fromCodePoint'\n\t\t\t].every((key) => typeof global.String[key] === 'function') &&\n\t\t\t[\n\t\t\t\t/* instance methods */\n\t\t\t\t'codePointAt',\n\t\t\t\t'normalize',\n\t\t\t\t'repeat',\n\t\t\t\t'startsWith',\n\t\t\t\t'endsWith',\n\t\t\t\t'includes'\n\t\t\t].every((key) => typeof global.String.prototype[key] === 'function')\n\t\t);\n\t},\n\ttrue\n);\n\nadd(\n\t'es6-string-raw',\n\t() => {\n\t\tfunction getCallSite(callSite: TemplateStringsArray, ...substitutions: any[]) {\n\t\t\tconst result = [...callSite];\n\t\t\t(result as any).raw = callSite.raw;\n\t\t\treturn result;\n\t\t}\n\n\t\tif ('raw' in global.String) {\n\t\t\tlet b = 1;\n\t\t\tlet callSite = getCallSite`a\\n${b}`;\n\n\t\t\t(callSite as any).raw = ['a\\\\n'];\n\t\t\tconst supportsTrunc = global.String.raw(callSite, 42) === 'a:\\\\n';\n\n\t\t\treturn supportsTrunc;\n\t\t}\n\n\t\treturn false;\n\t},\n\ttrue\n);\n\nadd(\n\t'es2017-string',\n\t() => {\n\t\treturn ['padStart', 'padEnd'].every((key) => typeof global.String.prototype[key] === 'function');\n\t},\n\ttrue\n);\n\n/* Symbol */\nadd('es6-symbol', () => typeof global.Symbol !== 'undefined' && typeof Symbol() === 'symbol', true);\n\n/* WeakMap */\nadd(\n\t'es6-weakmap',\n\t() => {\n\t\tif (typeof global.WeakMap !== 'undefined') {\n\t\t\t/* IE11 and older versions of Safari are missing critical ES6 Map functionality */\n\t\t\tconst key1 = {};\n\t\t\tconst key2 = {};\n\t\t\tconst map = new global.WeakMap([[key1, 1]]);\n\t\t\tObject.freeze(key1);\n\t\t\treturn map.get(key1) === 1 && map.set(key2, 2) === map && has('es6-symbol');\n\t\t}\n\t\treturn false;\n\t},\n\ttrue\n);\n\n/* Miscellaneous features */\nadd('microtasks', () => has('es6-promise') || has('host-node') || has('dom-mutationobserver'), true);\nadd(\n\t'postmessage',\n\t() => {\n\t\t// If window is undefined, and we have postMessage, it probably means we're in a web worker. Web workers have\n\t\t// post message but it doesn't work how we expect it to, so it's best just to pretend it doesn't exist.\n\t\treturn typeof global.window !== 'undefined' && typeof global.postMessage === 'function';\n\t},\n\ttrue\n);\nadd('raf', () => typeof global.requestAnimationFrame === 'function', true);\nadd('setimmediate', () => typeof global.setImmediate !== 'undefined', true);\n\n/* DOM Features */\n\nadd(\n\t'dom-mutationobserver',\n\t() => {\n\t\tif (has('host-browser') && Boolean(global.MutationObserver || global.WebKitMutationObserver)) {\n\t\t\t// IE11 has an unreliable MutationObserver implementation where setProperty() does not\n\t\t\t// generate a mutation event, observers can crash, and the queue does not drain\n\t\t\t// reliably. The following feature test was adapted from\n\t\t\t// https://gist.github.com/t10ko/4aceb8c71681fdb275e33efe5e576b14\n\t\t\tconst example = document.createElement('div');\n\t\t\t/* tslint:disable-next-line:variable-name */\n\t\t\tconst HostMutationObserver = global.MutationObserver || global.WebKitMutationObserver;\n\t\t\tconst observer = new HostMutationObserver(function() {});\n\t\t\tobserver.observe(example, { attributes: true });\n\n\t\t\texample.style.setProperty('display', 'block');\n\n\t\t\treturn Boolean(observer.takeRecords().length);\n\t\t}\n\t\treturn false;\n\t},\n\ttrue\n);\n\nadd(\n\t'dom-webanimation',\n\t() => has('host-browser') && global.Animation !== undefined && global.KeyframeEffect !== undefined,\n\ttrue\n);\n"]} \ No newline at end of file diff --git a/deps/framework/shim/support/queue.d.ts b/deps/framework/shim/support/queue.d.ts deleted file mode 100644 index d46ee6d4ce..0000000000 --- a/deps/framework/shim/support/queue.d.ts +++ /dev/null @@ -1,33 +0,0 @@ -import { Handle } from '../interfaces'; -export interface QueueItem { - isActive: boolean; - callback: null | ((...args: any[]) => any); -} -/** - * Schedules a callback to the macrotask queue. - * - * @param callback the function to be queued and later executed. - * @returns An object with a `destroy` method that, when called, prevents the registered callback from executing. - */ -export declare const queueTask: (callback: (...args: any[]) => any) => Handle; -/** - * Schedules an animation task with `window.requestAnimationFrame` if it exists, or with `queueTask` otherwise. - * - * Since requestAnimationFrame's behavior does not match that expected from `queueTask`, it is not used there. - * However, at times it makes more sense to delegate to requestAnimationFrame; hence the following method. - * - * @param callback the function to be queued and later executed. - * @returns An object with a `destroy` method that, when called, prevents the registered callback from executing. - */ -export declare const queueAnimationTask: (callback: (...args: any[]) => any) => Handle; -/** - * Schedules a callback to the microtask queue. - * - * Any callbacks registered with `queueMicroTask` will be executed before the next macrotask. If no native - * mechanism for scheduling macrotasks is exposed, then any callbacks will be fired before any macrotask - * registered with `queueTask` or `queueAnimationTask`. - * - * @param callback the function to be queued and later executed. - * @returns An object with a `destroy` method that, when called, prevents the registered callback from executing. - */ -export declare let queueMicroTask: (callback: (...args: any[]) => any) => Handle; diff --git a/deps/framework/shim/support/queue.js b/deps/framework/shim/support/queue.js deleted file mode 100644 index 9b3aa24e17..0000000000 --- a/deps/framework/shim/support/queue.js +++ /dev/null @@ -1,198 +0,0 @@ -(function (factory) { - if (typeof module === "object" && typeof module.exports === "object") { - var v = factory(require, exports); - if (v !== undefined) module.exports = v; - } - else if (typeof define === "function" && define.amd) { - define(["require", "exports", "../global", "./has"], factory); - } -})(function (require, exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - var global_1 = require("../global"); - var has_1 = require("./has"); - function executeTask(item) { - if (item && item.isActive && item.callback) { - item.callback(); - } - } - function getQueueHandle(item, destructor) { - return { - destroy: function () { - this.destroy = function () { }; - item.isActive = false; - item.callback = null; - if (destructor) { - destructor(); - } - } - }; - } - var checkMicroTaskQueue; - var microTasks; - /** - * Schedules a callback to the macrotask queue. - * - * @param callback the function to be queued and later executed. - * @returns An object with a `destroy` method that, when called, prevents the registered callback from executing. - */ - exports.queueTask = (function () { - var destructor; - var enqueue; - // Since the IE implementation of `setImmediate` is not flawless, we will test for `postMessage` first. - if (has_1.default('postmessage')) { - var queue_1 = []; - global_1.default.addEventListener('message', function (event) { - // Confirm that the event was triggered by the current window and by this particular implementation. - if (event.source === global_1.default && event.data === 'dojo-queue-message') { - event.stopPropagation(); - if (queue_1.length) { - executeTask(queue_1.shift()); - } - } - }); - enqueue = function (item) { - queue_1.push(item); - global_1.default.postMessage('dojo-queue-message', '*'); - }; - } - else if (has_1.default('setimmediate')) { - destructor = global_1.default.clearImmediate; - enqueue = function (item) { - return setImmediate(executeTask.bind(null, item)); - }; - } - else { - destructor = global_1.default.clearTimeout; - enqueue = function (item) { - return setTimeout(executeTask.bind(null, item), 0); - }; - } - function queueTask(callback) { - var item = { - isActive: true, - callback: callback - }; - var id = enqueue(item); - return getQueueHandle(item, destructor && - function () { - destructor(id); - }); - } - // TODO: Use aspect.before when it is available. - return has_1.default('microtasks') - ? queueTask - : function (callback) { - checkMicroTaskQueue(); - return queueTask(callback); - }; - })(); - // When no mechanism for registering microtasks is exposed by the environment, microtasks will - // be queued and then executed in a single macrotask before the other macrotasks are executed. - if (!has_1.default('microtasks')) { - var isMicroTaskQueued_1 = false; - microTasks = []; - checkMicroTaskQueue = function () { - if (!isMicroTaskQueued_1) { - isMicroTaskQueued_1 = true; - exports.queueTask(function () { - isMicroTaskQueued_1 = false; - if (microTasks.length) { - var item = void 0; - while ((item = microTasks.shift())) { - executeTask(item); - } - } - }); - } - }; - } - /** - * Schedules an animation task with `window.requestAnimationFrame` if it exists, or with `queueTask` otherwise. - * - * Since requestAnimationFrame's behavior does not match that expected from `queueTask`, it is not used there. - * However, at times it makes more sense to delegate to requestAnimationFrame; hence the following method. - * - * @param callback the function to be queued and later executed. - * @returns An object with a `destroy` method that, when called, prevents the registered callback from executing. - */ - exports.queueAnimationTask = (function () { - if (!has_1.default('raf')) { - return exports.queueTask; - } - function queueAnimationTask(callback) { - var item = { - isActive: true, - callback: callback - }; - var rafId = requestAnimationFrame(executeTask.bind(null, item)); - return getQueueHandle(item, function () { - cancelAnimationFrame(rafId); - }); - } - // TODO: Use aspect.before when it is available. - return has_1.default('microtasks') - ? queueAnimationTask - : function (callback) { - checkMicroTaskQueue(); - return queueAnimationTask(callback); - }; - })(); - /** - * Schedules a callback to the microtask queue. - * - * Any callbacks registered with `queueMicroTask` will be executed before the next macrotask. If no native - * mechanism for scheduling macrotasks is exposed, then any callbacks will be fired before any macrotask - * registered with `queueTask` or `queueAnimationTask`. - * - * @param callback the function to be queued and later executed. - * @returns An object with a `destroy` method that, when called, prevents the registered callback from executing. - */ - exports.queueMicroTask = (function () { - var enqueue; - if (has_1.default('host-node')) { - enqueue = function (item) { - global_1.default.process.nextTick(executeTask.bind(null, item)); - }; - } - else if (has_1.default('es6-promise')) { - enqueue = function (item) { - global_1.default.Promise.resolve(item).then(executeTask); - }; - } - else if (has_1.default('dom-mutationobserver')) { - /* tslint:disable-next-line:variable-name */ - var HostMutationObserver = global_1.default.MutationObserver || global_1.default.WebKitMutationObserver; - var node_1 = document.createElement('div'); - var queue_2 = []; - var observer = new HostMutationObserver(function () { - while (queue_2.length > 0) { - var item = queue_2.shift(); - if (item && item.isActive && item.callback) { - item.callback(); - } - } - }); - observer.observe(node_1, { attributes: true }); - enqueue = function (item) { - queue_2.push(item); - node_1.setAttribute('queueStatus', '1'); - }; - } - else { - enqueue = function (item) { - checkMicroTaskQueue(); - microTasks.push(item); - }; - } - return function (callback) { - var item = { - isActive: true, - callback: callback - }; - enqueue(item); - return getQueueHandle(item); - }; - })(); -}); -//# sourceMappingURL=queue.js.map \ No newline at end of file diff --git a/deps/framework/shim/support/queue.js.map b/deps/framework/shim/support/queue.js.map deleted file mode 100644 index 2633ae558a..0000000000 --- a/deps/framework/shim/support/queue.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"queue.js","sourceRoot":"","sources":["queue.ts"],"names":[],"mappings":";;;;;;;;;;;IAAA,oCAA+B;IAC/B,6BA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,CAAC,OAAO,CAAC,MAAI,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,CAAC,CAAC;YAE7C,OAAO,GAAG,UAAS,IAAe;gBACjC,OAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;gBACjB,MAAI,CAAC,YAAY,CAAC,aAAa,EAAE,GAAG,CAAC,CAAC;YACvC,CAAC,CAAC;QACH,CAAC;QAAC,IAAI,CAAC,CAAC;YACP,OAAO,GAAG,UAAS,IAAe;gBACjC,mBAAmB,EAAE,CAAC;gBACtB,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YACvB,CAAC,CAAC;QACH,CAAC;QAED,MAAM,CAAC,UAAS,QAAiC;YAChD,IAAM,IAAI,GAAc;gBACvB,QAAQ,EAAE,IAAI;gBACd,QAAQ,EAAE,QAAQ;aAClB,CAAC;YAEF,OAAO,CAAC,IAAI,CAAC,CAAC;YAEd,MAAM,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC;QAC7B,CAAC,CAAC;IACH,CAAC,CAAC,EAAE,CAAC","sourcesContent":["import global from '../global';\nimport has from './has';\nimport { Handle } from '../interfaces';\n\nfunction executeTask(item: QueueItem | undefined): void {\n\tif (item && item.isActive && item.callback) {\n\t\titem.callback();\n\t}\n}\n\nfunction getQueueHandle(item: QueueItem, destructor?: (...args: any[]) => any): Handle {\n\treturn {\n\t\tdestroy: function(this: Handle) {\n\t\t\tthis.destroy = function() {};\n\t\t\titem.isActive = false;\n\t\t\titem.callback = null;\n\n\t\t\tif (destructor) {\n\t\t\t\tdestructor();\n\t\t\t}\n\t\t}\n\t};\n}\n\ninterface PostMessageEvent extends Event {\n\tsource: any;\n\tdata: string;\n}\n\nexport interface QueueItem {\n\tisActive: boolean;\n\tcallback: null | ((...args: any[]) => any);\n}\n\nlet checkMicroTaskQueue: () => void;\nlet microTasks: QueueItem[];\n\n/**\n * Schedules a callback to the macrotask queue.\n *\n * @param callback the function to be queued and later executed.\n * @returns An object with a `destroy` method that, when called, prevents the registered callback from executing.\n */\nexport const queueTask = (function() {\n\tlet destructor: (...args: any[]) => any;\n\tlet enqueue: (item: QueueItem) => void;\n\n\t// Since the IE implementation of `setImmediate` is not flawless, we will test for `postMessage` first.\n\tif (has('postmessage')) {\n\t\tconst queue: QueueItem[] = [];\n\n\t\tglobal.addEventListener('message', function(event: PostMessageEvent): void {\n\t\t\t// Confirm that the event was triggered by the current window and by this particular implementation.\n\t\t\tif (event.source === global && event.data === 'dojo-queue-message') {\n\t\t\t\tevent.stopPropagation();\n\n\t\t\t\tif (queue.length) {\n\t\t\t\t\texecuteTask(queue.shift());\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\n\t\tenqueue = function(item: QueueItem): void {\n\t\t\tqueue.push(item);\n\t\t\tglobal.postMessage('dojo-queue-message', '*');\n\t\t};\n\t} else if (has('setimmediate')) {\n\t\tdestructor = global.clearImmediate;\n\t\tenqueue = function(item: QueueItem): any {\n\t\t\treturn setImmediate(executeTask.bind(null, item));\n\t\t};\n\t} else {\n\t\tdestructor = global.clearTimeout;\n\t\tenqueue = function(item: QueueItem): any {\n\t\t\treturn setTimeout(executeTask.bind(null, item), 0);\n\t\t};\n\t}\n\n\tfunction queueTask(callback: (...args: any[]) => any): Handle {\n\t\tconst item: QueueItem = {\n\t\t\tisActive: true,\n\t\t\tcallback: callback\n\t\t};\n\t\tconst id: any = enqueue(item);\n\n\t\treturn getQueueHandle(\n\t\t\titem,\n\t\t\tdestructor &&\n\t\t\t\tfunction() {\n\t\t\t\t\tdestructor(id);\n\t\t\t\t}\n\t\t);\n\t}\n\n\t// TODO: Use aspect.before when it is available.\n\treturn has('microtasks')\n\t\t? queueTask\n\t\t: function(callback: (...args: any[]) => any): Handle {\n\t\t\t\tcheckMicroTaskQueue();\n\t\t\t\treturn queueTask(callback);\n\t\t\t};\n})();\n\n// When no mechanism for registering microtasks is exposed by the environment, microtasks will\n// be queued and then executed in a single macrotask before the other macrotasks are executed.\nif (!has('microtasks')) {\n\tlet isMicroTaskQueued = false;\n\n\tmicroTasks = [];\n\tcheckMicroTaskQueue = function(): void {\n\t\tif (!isMicroTaskQueued) {\n\t\t\tisMicroTaskQueued = true;\n\t\t\tqueueTask(function() {\n\t\t\t\tisMicroTaskQueued = false;\n\n\t\t\t\tif (microTasks.length) {\n\t\t\t\t\tlet item: QueueItem | undefined;\n\t\t\t\t\twhile ((item = microTasks.shift())) {\n\t\t\t\t\t\texecuteTask(item);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t};\n}\n\n/**\n * Schedules an animation task with `window.requestAnimationFrame` if it exists, or with `queueTask` otherwise.\n *\n * Since requestAnimationFrame's behavior does not match that expected from `queueTask`, it is not used there.\n * However, at times it makes more sense to delegate to requestAnimationFrame; hence the following method.\n *\n * @param callback the function to be queued and later executed.\n * @returns An object with a `destroy` method that, when called, prevents the registered callback from executing.\n */\nexport const queueAnimationTask = (function() {\n\tif (!has('raf')) {\n\t\treturn queueTask;\n\t}\n\n\tfunction queueAnimationTask(callback: (...args: any[]) => any): Handle {\n\t\tconst item: QueueItem = {\n\t\t\tisActive: true,\n\t\t\tcallback: callback\n\t\t};\n\t\tconst rafId: number = requestAnimationFrame(executeTask.bind(null, item));\n\n\t\treturn getQueueHandle(item, function() {\n\t\t\tcancelAnimationFrame(rafId);\n\t\t});\n\t}\n\n\t// TODO: Use aspect.before when it is available.\n\treturn has('microtasks')\n\t\t? queueAnimationTask\n\t\t: function(callback: (...args: any[]) => any): Handle {\n\t\t\t\tcheckMicroTaskQueue();\n\t\t\t\treturn queueAnimationTask(callback);\n\t\t\t};\n})();\n\n/**\n * Schedules a callback to the microtask queue.\n *\n * Any callbacks registered with `queueMicroTask` will be executed before the next macrotask. If no native\n * mechanism for scheduling macrotasks is exposed, then any callbacks will be fired before any macrotask\n * registered with `queueTask` or `queueAnimationTask`.\n *\n * @param callback the function to be queued and later executed.\n * @returns An object with a `destroy` method that, when called, prevents the registered callback from executing.\n */\nexport let queueMicroTask = (function() {\n\tlet enqueue: (item: QueueItem) => void;\n\n\tif (has('host-node')) {\n\t\tenqueue = function(item: QueueItem): void {\n\t\t\tglobal.process.nextTick(executeTask.bind(null, item));\n\t\t};\n\t} else if (has('es6-promise')) {\n\t\tenqueue = function(item: QueueItem): void {\n\t\t\tglobal.Promise.resolve(item).then(executeTask);\n\t\t};\n\t} else if (has('dom-mutationobserver')) {\n\t\t/* tslint:disable-next-line:variable-name */\n\t\tconst HostMutationObserver = global.MutationObserver || global.WebKitMutationObserver;\n\t\tconst node = document.createElement('div');\n\t\tconst queue: QueueItem[] = [];\n\t\tconst observer = new HostMutationObserver(function(): void {\n\t\t\twhile (queue.length > 0) {\n\t\t\t\tconst item = queue.shift();\n\t\t\t\tif (item && item.isActive && item.callback) {\n\t\t\t\t\titem.callback();\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\n\t\tobserver.observe(node, { attributes: true });\n\n\t\tenqueue = function(item: QueueItem): void {\n\t\t\tqueue.push(item);\n\t\t\tnode.setAttribute('queueStatus', '1');\n\t\t};\n\t} else {\n\t\tenqueue = function(item: QueueItem): void {\n\t\t\tcheckMicroTaskQueue();\n\t\t\tmicroTasks.push(item);\n\t\t};\n\t}\n\n\treturn function(callback: (...args: any[]) => any): Handle {\n\t\tconst item: QueueItem = {\n\t\t\tisActive: true,\n\t\t\tcallback: callback\n\t\t};\n\n\t\tenqueue(item);\n\n\t\treturn getQueueHandle(item);\n\t};\n})();\n"]} \ No newline at end of file diff --git a/deps/framework/shim/support/queue.mjs b/deps/framework/shim/support/queue.mjs deleted file mode 100644 index 5bbbce77d3..0000000000 --- a/deps/framework/shim/support/queue.mjs +++ /dev/null @@ -1,186 +0,0 @@ -import global from '../global'; -import has from './has'; -function executeTask(item) { - if (item && item.isActive && item.callback) { - item.callback(); - } -} -function getQueueHandle(item, destructor) { - return { - destroy: function () { - this.destroy = function () { }; - item.isActive = false; - item.callback = null; - if (destructor) { - destructor(); - } - } - }; -} -let checkMicroTaskQueue; -let microTasks; -/** - * Schedules a callback to the macrotask queue. - * - * @param callback the function to be queued and later executed. - * @returns An object with a `destroy` method that, when called, prevents the registered callback from executing. - */ -export const queueTask = (function () { - let destructor; - let enqueue; - // Since the IE implementation of `setImmediate` is not flawless, we will test for `postMessage` first. - if (has('postmessage')) { - const queue = []; - global.addEventListener('message', function (event) { - // Confirm that the event was triggered by the current window and by this particular implementation. - if (event.source === global && event.data === 'dojo-queue-message') { - event.stopPropagation(); - if (queue.length) { - executeTask(queue.shift()); - } - } - }); - enqueue = function (item) { - queue.push(item); - global.postMessage('dojo-queue-message', '*'); - }; - } - else if (has('setimmediate')) { - destructor = global.clearImmediate; - enqueue = function (item) { - return setImmediate(executeTask.bind(null, item)); - }; - } - else { - destructor = global.clearTimeout; - enqueue = function (item) { - return setTimeout(executeTask.bind(null, item), 0); - }; - } - function queueTask(callback) { - const item = { - isActive: true, - callback: callback - }; - const id = enqueue(item); - return getQueueHandle(item, destructor && - function () { - destructor(id); - }); - } - // TODO: Use aspect.before when it is available. - return has('microtasks') - ? queueTask - : function (callback) { - checkMicroTaskQueue(); - return queueTask(callback); - }; -})(); -// When no mechanism for registering microtasks is exposed by the environment, microtasks will -// be queued and then executed in a single macrotask before the other macrotasks are executed. -if (!has('microtasks')) { - let isMicroTaskQueued = false; - microTasks = []; - checkMicroTaskQueue = function () { - if (!isMicroTaskQueued) { - isMicroTaskQueued = true; - queueTask(function () { - isMicroTaskQueued = false; - if (microTasks.length) { - let item; - while ((item = microTasks.shift())) { - executeTask(item); - } - } - }); - } - }; -} -/** - * Schedules an animation task with `window.requestAnimationFrame` if it exists, or with `queueTask` otherwise. - * - * Since requestAnimationFrame's behavior does not match that expected from `queueTask`, it is not used there. - * However, at times it makes more sense to delegate to requestAnimationFrame; hence the following method. - * - * @param callback the function to be queued and later executed. - * @returns An object with a `destroy` method that, when called, prevents the registered callback from executing. - */ -export const queueAnimationTask = (function () { - if (!has('raf')) { - return queueTask; - } - function queueAnimationTask(callback) { - const item = { - isActive: true, - callback: callback - }; - const rafId = requestAnimationFrame(executeTask.bind(null, item)); - return getQueueHandle(item, function () { - cancelAnimationFrame(rafId); - }); - } - // TODO: Use aspect.before when it is available. - return has('microtasks') - ? queueAnimationTask - : function (callback) { - checkMicroTaskQueue(); - return queueAnimationTask(callback); - }; -})(); -/** - * Schedules a callback to the microtask queue. - * - * Any callbacks registered with `queueMicroTask` will be executed before the next macrotask. If no native - * mechanism for scheduling macrotasks is exposed, then any callbacks will be fired before any macrotask - * registered with `queueTask` or `queueAnimationTask`. - * - * @param callback the function to be queued and later executed. - * @returns An object with a `destroy` method that, when called, prevents the registered callback from executing. - */ -export let queueMicroTask = (function () { - let enqueue; - if (has('host-node')) { - enqueue = function (item) { - global.process.nextTick(executeTask.bind(null, item)); - }; - } - else if (has('es6-promise')) { - enqueue = function (item) { - global.Promise.resolve(item).then(executeTask); - }; - } - else if (has('dom-mutationobserver')) { - /* tslint:disable-next-line:variable-name */ - const HostMutationObserver = global.MutationObserver || global.WebKitMutationObserver; - const node = document.createElement('div'); - const queue = []; - const observer = new HostMutationObserver(function () { - while (queue.length > 0) { - const item = queue.shift(); - if (item && item.isActive && item.callback) { - item.callback(); - } - } - }); - observer.observe(node, { attributes: true }); - enqueue = function (item) { - queue.push(item); - node.setAttribute('queueStatus', '1'); - }; - } - else { - enqueue = function (item) { - checkMicroTaskQueue(); - microTasks.push(item); - }; - } - return function (callback) { - const item = { - isActive: true, - callback: callback - }; - enqueue(item); - return getQueueHandle(item); - }; -})(); -//# sourceMappingURL=queue.mjs.map \ No newline at end of file diff --git a/deps/framework/shim/support/queue.mjs.map b/deps/framework/shim/support/queue.mjs.map deleted file mode 100644 index 1e942c524e..0000000000 --- a/deps/framework/shim/support/queue.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"queue.mjs","sourceRoot":"","sources":["queue.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,WAAW,CAAC;AAC/B,OAAO,GAAG,MAAM,OAAO,CAAC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I,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,CAAC,CAAC;QAE7C,OAAO,GAAG,UAAS,IAAe;YACjC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YACjB,IAAI,CAAC,YAAY,CAAC,aAAa,EAAE,GAAG,CAAC,CAAC;QACvC,CAAC,CAAC;IACH,CAAC;IAAC,IAAI,CAAC,CAAC;QACP,OAAO,GAAG,UAAS,IAAe;YACjC,mBAAmB,EAAE,CAAC;YACtB,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACvB,CAAC,CAAC;IACH,CAAC;IAED,MAAM,CAAC,UAAS,QAAiC;QAChD,MAAM,IAAI,GAAc;YACvB,QAAQ,EAAE,IAAI;YACd,QAAQ,EAAE,QAAQ;SAClB,CAAC;QAEF,OAAO,CAAC,IAAI,CAAC,CAAC;QAEd,MAAM,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC;IAC7B,CAAC,CAAC;AACH,CAAC,CAAC,EAAE,CAAC","sourcesContent":["import global from '../global';\nimport has from './has';\nimport { Handle } from '../interfaces';\n\nfunction executeTask(item: QueueItem | undefined): void {\n\tif (item && item.isActive && item.callback) {\n\t\titem.callback();\n\t}\n}\n\nfunction getQueueHandle(item: QueueItem, destructor?: (...args: any[]) => any): Handle {\n\treturn {\n\t\tdestroy: function(this: Handle) {\n\t\t\tthis.destroy = function() {};\n\t\t\titem.isActive = false;\n\t\t\titem.callback = null;\n\n\t\t\tif (destructor) {\n\t\t\t\tdestructor();\n\t\t\t}\n\t\t}\n\t};\n}\n\ninterface PostMessageEvent extends Event {\n\tsource: any;\n\tdata: string;\n}\n\nexport interface QueueItem {\n\tisActive: boolean;\n\tcallback: null | ((...args: any[]) => any);\n}\n\nlet checkMicroTaskQueue: () => void;\nlet microTasks: QueueItem[];\n\n/**\n * Schedules a callback to the macrotask queue.\n *\n * @param callback the function to be queued and later executed.\n * @returns An object with a `destroy` method that, when called, prevents the registered callback from executing.\n */\nexport const queueTask = (function() {\n\tlet destructor: (...args: any[]) => any;\n\tlet enqueue: (item: QueueItem) => void;\n\n\t// Since the IE implementation of `setImmediate` is not flawless, we will test for `postMessage` first.\n\tif (has('postmessage')) {\n\t\tconst queue: QueueItem[] = [];\n\n\t\tglobal.addEventListener('message', function(event: PostMessageEvent): void {\n\t\t\t// Confirm that the event was triggered by the current window and by this particular implementation.\n\t\t\tif (event.source === global && event.data === 'dojo-queue-message') {\n\t\t\t\tevent.stopPropagation();\n\n\t\t\t\tif (queue.length) {\n\t\t\t\t\texecuteTask(queue.shift());\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\n\t\tenqueue = function(item: QueueItem): void {\n\t\t\tqueue.push(item);\n\t\t\tglobal.postMessage('dojo-queue-message', '*');\n\t\t};\n\t} else if (has('setimmediate')) {\n\t\tdestructor = global.clearImmediate;\n\t\tenqueue = function(item: QueueItem): any {\n\t\t\treturn setImmediate(executeTask.bind(null, item));\n\t\t};\n\t} else {\n\t\tdestructor = global.clearTimeout;\n\t\tenqueue = function(item: QueueItem): any {\n\t\t\treturn setTimeout(executeTask.bind(null, item), 0);\n\t\t};\n\t}\n\n\tfunction queueTask(callback: (...args: any[]) => any): Handle {\n\t\tconst item: QueueItem = {\n\t\t\tisActive: true,\n\t\t\tcallback: callback\n\t\t};\n\t\tconst id: any = enqueue(item);\n\n\t\treturn getQueueHandle(\n\t\t\titem,\n\t\t\tdestructor &&\n\t\t\t\tfunction() {\n\t\t\t\t\tdestructor(id);\n\t\t\t\t}\n\t\t);\n\t}\n\n\t// TODO: Use aspect.before when it is available.\n\treturn has('microtasks')\n\t\t? queueTask\n\t\t: function(callback: (...args: any[]) => any): Handle {\n\t\t\t\tcheckMicroTaskQueue();\n\t\t\t\treturn queueTask(callback);\n\t\t\t};\n})();\n\n// When no mechanism for registering microtasks is exposed by the environment, microtasks will\n// be queued and then executed in a single macrotask before the other macrotasks are executed.\nif (!has('microtasks')) {\n\tlet isMicroTaskQueued = false;\n\n\tmicroTasks = [];\n\tcheckMicroTaskQueue = function(): void {\n\t\tif (!isMicroTaskQueued) {\n\t\t\tisMicroTaskQueued = true;\n\t\t\tqueueTask(function() {\n\t\t\t\tisMicroTaskQueued = false;\n\n\t\t\t\tif (microTasks.length) {\n\t\t\t\t\tlet item: QueueItem | undefined;\n\t\t\t\t\twhile ((item = microTasks.shift())) {\n\t\t\t\t\t\texecuteTask(item);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t};\n}\n\n/**\n * Schedules an animation task with `window.requestAnimationFrame` if it exists, or with `queueTask` otherwise.\n *\n * Since requestAnimationFrame's behavior does not match that expected from `queueTask`, it is not used there.\n * However, at times it makes more sense to delegate to requestAnimationFrame; hence the following method.\n *\n * @param callback the function to be queued and later executed.\n * @returns An object with a `destroy` method that, when called, prevents the registered callback from executing.\n */\nexport const queueAnimationTask = (function() {\n\tif (!has('raf')) {\n\t\treturn queueTask;\n\t}\n\n\tfunction queueAnimationTask(callback: (...args: any[]) => any): Handle {\n\t\tconst item: QueueItem = {\n\t\t\tisActive: true,\n\t\t\tcallback: callback\n\t\t};\n\t\tconst rafId: number = requestAnimationFrame(executeTask.bind(null, item));\n\n\t\treturn getQueueHandle(item, function() {\n\t\t\tcancelAnimationFrame(rafId);\n\t\t});\n\t}\n\n\t// TODO: Use aspect.before when it is available.\n\treturn has('microtasks')\n\t\t? queueAnimationTask\n\t\t: function(callback: (...args: any[]) => any): Handle {\n\t\t\t\tcheckMicroTaskQueue();\n\t\t\t\treturn queueAnimationTask(callback);\n\t\t\t};\n})();\n\n/**\n * Schedules a callback to the microtask queue.\n *\n * Any callbacks registered with `queueMicroTask` will be executed before the next macrotask. If no native\n * mechanism for scheduling macrotasks is exposed, then any callbacks will be fired before any macrotask\n * registered with `queueTask` or `queueAnimationTask`.\n *\n * @param callback the function to be queued and later executed.\n * @returns An object with a `destroy` method that, when called, prevents the registered callback from executing.\n */\nexport let queueMicroTask = (function() {\n\tlet enqueue: (item: QueueItem) => void;\n\n\tif (has('host-node')) {\n\t\tenqueue = function(item: QueueItem): void {\n\t\t\tglobal.process.nextTick(executeTask.bind(null, item));\n\t\t};\n\t} else if (has('es6-promise')) {\n\t\tenqueue = function(item: QueueItem): void {\n\t\t\tglobal.Promise.resolve(item).then(executeTask);\n\t\t};\n\t} else if (has('dom-mutationobserver')) {\n\t\t/* tslint:disable-next-line:variable-name */\n\t\tconst HostMutationObserver = global.MutationObserver || global.WebKitMutationObserver;\n\t\tconst node = document.createElement('div');\n\t\tconst queue: QueueItem[] = [];\n\t\tconst observer = new HostMutationObserver(function(): void {\n\t\t\twhile (queue.length > 0) {\n\t\t\t\tconst item = queue.shift();\n\t\t\t\tif (item && item.isActive && item.callback) {\n\t\t\t\t\titem.callback();\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\n\t\tobserver.observe(node, { attributes: true });\n\n\t\tenqueue = function(item: QueueItem): void {\n\t\t\tqueue.push(item);\n\t\t\tnode.setAttribute('queueStatus', '1');\n\t\t};\n\t} else {\n\t\tenqueue = function(item: QueueItem): void {\n\t\t\tcheckMicroTaskQueue();\n\t\t\tmicroTasks.push(item);\n\t\t};\n\t}\n\n\treturn function(callback: (...args: any[]) => any): Handle {\n\t\tconst item: QueueItem = {\n\t\t\tisActive: true,\n\t\t\tcallback: callback\n\t\t};\n\n\t\tenqueue(item);\n\n\t\treturn getQueueHandle(item);\n\t};\n})();\n"]} \ No newline at end of file diff --git a/deps/framework/shim/support/util.d.ts b/deps/framework/shim/support/util.d.ts deleted file mode 100644 index e0a87772d3..0000000000 --- a/deps/framework/shim/support/util.d.ts +++ /dev/null @@ -1,21 +0,0 @@ -/** - * Helper function to generate a value property descriptor - * - * @param value The value the property descriptor should be set to - * @param enumerable If the property should be enumberable, defaults to false - * @param writable If the property should be writable, defaults to true - * @param configurable If the property should be configurable, defaults to true - * @return The property descriptor object - */ -export declare function getValueDescriptor(value: T, enumerable?: boolean, writable?: boolean, configurable?: boolean): TypedPropertyDescriptor; -/** - * A helper function which wraps a function where the first argument becomes the scope - * of the call - * - * @param nativeFunction The source function to be wrapped - */ -export declare function wrapNative(nativeFunction: (arg1: U) => R): (target: T, arg1: U) => R; -export declare function wrapNative(nativeFunction: (arg1: U, arg2: V) => R): (target: T, arg1: U, arg2: V) => R; -export declare function wrapNative(nativeFunction: (arg1: U, arg2: V, arg3: W) => R): (target: T, arg1: U, arg2: V, arg3: W) => R; -export declare function wrapNative(nativeFunction: (arg1: U, arg2: V, arg3: W) => R): (target: T, arg1: U, arg2: V, arg3: W) => R; -export declare function wrapNative(nativeFunction: (arg1: U, arg2: V, arg3: W, arg4: Y) => R): (target: T, arg1: U, arg2: V, arg3: W, arg4: Y) => R; diff --git a/deps/framework/shim/support/util.js b/deps/framework/shim/support/util.js deleted file mode 100644 index 19bb40330d..0000000000 --- a/deps/framework/shim/support/util.js +++ /dev/null @@ -1,44 +0,0 @@ -(function (factory) { - if (typeof module === "object" && typeof module.exports === "object") { - var v = factory(require, exports); - if (v !== undefined) module.exports = v; - } - else if (typeof define === "function" && define.amd) { - define(["require", "exports"], factory); - } -})(function (require, exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - /** - * Helper function to generate a value property descriptor - * - * @param value The value the property descriptor should be set to - * @param enumerable If the property should be enumberable, defaults to false - * @param writable If the property should be writable, defaults to true - * @param configurable If the property should be configurable, defaults to true - * @return The property descriptor object - */ - function getValueDescriptor(value, enumerable, writable, configurable) { - if (enumerable === void 0) { enumerable = false; } - if (writable === void 0) { writable = true; } - if (configurable === void 0) { configurable = true; } - return { - value: value, - enumerable: enumerable, - writable: writable, - configurable: configurable - }; - } - exports.getValueDescriptor = getValueDescriptor; - function wrapNative(nativeFunction) { - return function (target) { - var args = []; - for (var _i = 1; _i < arguments.length; _i++) { - args[_i - 1] = arguments[_i]; - } - return nativeFunction.apply(target, args); - }; - } - exports.wrapNative = wrapNative; -}); -//# sourceMappingURL=util.js.map \ No newline at end of file diff --git a/deps/framework/shim/support/util.js.map b/deps/framework/shim/support/util.js.map deleted file mode 100644 index 0dd9c70318..0000000000 --- a/deps/framework/shim/support/util.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"util.js","sourceRoot":"","sources":["util.ts"],"names":[],"mappings":";;;;;;;;;;;IAAA;;;;;;;;OAQG;IACH,4BACC,KAAQ,EACR,UAA2B,EAC3B,QAAwB,EACxB,YAA4B;QAF5B,2BAAA,EAAA,kBAA2B;QAC3B,yBAAA,EAAA,eAAwB;QACxB,6BAAA,EAAA,mBAA4B;QAE5B,MAAM,CAAC;YACN,KAAK,EAAE,KAAK;YACZ,UAAU,EAAE,UAAU;YACtB,QAAQ,EAAE,QAAQ;YAClB,YAAY,EAAE,YAAY;SAC1B,CAAC;IACH,CAAC;IAZD,gDAYC;IAmBD,oBAA2B,cAAuC;QACjE,MAAM,CAAC,UAAS,MAAW;YAAE,cAAc;iBAAd,UAAc,EAAd,qBAAc,EAAd,IAAc;gBAAd,6BAAc;;YAC1C,MAAM,CAAC,cAAc,CAAC,KAAK,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;QAC3C,CAAC,CAAC;IACH,CAAC;IAJD,gCAIC","sourcesContent":["/**\n * Helper function to generate a value property descriptor\n *\n * @param value The value the property descriptor should be set to\n * @param enumerable If the property should be enumberable, defaults to false\n * @param writable If the property should be writable, defaults to true\n * @param configurable If the property should be configurable, defaults to true\n * @return The property descriptor object\n */\nexport function getValueDescriptor(\n\tvalue: T,\n\tenumerable: boolean = false,\n\twritable: boolean = true,\n\tconfigurable: boolean = true\n): TypedPropertyDescriptor {\n\treturn {\n\t\tvalue: value,\n\t\tenumerable: enumerable,\n\t\twritable: writable,\n\t\tconfigurable: configurable\n\t};\n}\n\n/**\n * A helper function which wraps a function where the first argument becomes the scope\n * of the call\n *\n * @param nativeFunction The source function to be wrapped\n */\nexport function wrapNative(nativeFunction: (arg1: U) => R): (target: T, arg1: U) => R;\nexport function wrapNative(nativeFunction: (arg1: U, arg2: V) => R): (target: T, arg1: U, arg2: V) => R;\nexport function wrapNative(\n\tnativeFunction: (arg1: U, arg2: V, arg3: W) => R\n): (target: T, arg1: U, arg2: V, arg3: W) => R;\nexport function wrapNative(\n\tnativeFunction: (arg1: U, arg2: V, arg3: W) => R\n): (target: T, arg1: U, arg2: V, arg3: W) => R;\nexport function wrapNative(\n\tnativeFunction: (arg1: U, arg2: V, arg3: W, arg4: Y) => R\n): (target: T, arg1: U, arg2: V, arg3: W, arg4: Y) => R;\nexport function wrapNative(nativeFunction: (...args: any[]) => any): (target: any, ...args: any[]) => any {\n\treturn function(target: any, ...args: any[]): any {\n\t\treturn nativeFunction.apply(target, args);\n\t};\n}\n"]} \ No newline at end of file diff --git a/deps/framework/shim/support/util.mjs b/deps/framework/shim/support/util.mjs deleted file mode 100644 index a40c4d4c5a..0000000000 --- a/deps/framework/shim/support/util.mjs +++ /dev/null @@ -1,23 +0,0 @@ -/** - * Helper function to generate a value property descriptor - * - * @param value The value the property descriptor should be set to - * @param enumerable If the property should be enumberable, defaults to false - * @param writable If the property should be writable, defaults to true - * @param configurable If the property should be configurable, defaults to true - * @return The property descriptor object - */ -export function getValueDescriptor(value, enumerable = false, writable = true, configurable = true) { - return { - value: value, - enumerable: enumerable, - writable: writable, - configurable: configurable - }; -} -export function wrapNative(nativeFunction) { - return function (target, ...args) { - return nativeFunction.apply(target, args); - }; -} -//# sourceMappingURL=util.mjs.map \ No newline at end of file diff --git a/deps/framework/shim/support/util.mjs.map b/deps/framework/shim/support/util.mjs.map deleted file mode 100644 index 8ec44baf88..0000000000 --- a/deps/framework/shim/support/util.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"util.mjs","sourceRoot":"","sources":["util.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,MAAM,6BACL,KAAQ,EACR,aAAsB,KAAK,EAC3B,WAAoB,IAAI,EACxB,eAAwB,IAAI;IAE5B,MAAM,CAAC;QACN,KAAK,EAAE,KAAK;QACZ,UAAU,EAAE,UAAU;QACtB,QAAQ,EAAE,QAAQ;QAClB,YAAY,EAAE,YAAY;KAC1B,CAAC;AACH,CAAC;AAmBD,MAAM,qBAAqB,cAAuC;IACjE,MAAM,CAAC,UAAS,MAAW,EAAE,GAAG,IAAW;QAC1C,MAAM,CAAC,cAAc,CAAC,KAAK,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;IAC3C,CAAC,CAAC;AACH,CAAC","sourcesContent":["/**\n * Helper function to generate a value property descriptor\n *\n * @param value The value the property descriptor should be set to\n * @param enumerable If the property should be enumberable, defaults to false\n * @param writable If the property should be writable, defaults to true\n * @param configurable If the property should be configurable, defaults to true\n * @return The property descriptor object\n */\nexport function getValueDescriptor(\n\tvalue: T,\n\tenumerable: boolean = false,\n\twritable: boolean = true,\n\tconfigurable: boolean = true\n): TypedPropertyDescriptor {\n\treturn {\n\t\tvalue: value,\n\t\tenumerable: enumerable,\n\t\twritable: writable,\n\t\tconfigurable: configurable\n\t};\n}\n\n/**\n * A helper function which wraps a function where the first argument becomes the scope\n * of the call\n *\n * @param nativeFunction The source function to be wrapped\n */\nexport function wrapNative(nativeFunction: (arg1: U) => R): (target: T, arg1: U) => R;\nexport function wrapNative(nativeFunction: (arg1: U, arg2: V) => R): (target: T, arg1: U, arg2: V) => R;\nexport function wrapNative(\n\tnativeFunction: (arg1: U, arg2: V, arg3: W) => R\n): (target: T, arg1: U, arg2: V, arg3: W) => R;\nexport function wrapNative(\n\tnativeFunction: (arg1: U, arg2: V, arg3: W) => R\n): (target: T, arg1: U, arg2: V, arg3: W) => R;\nexport function wrapNative(\n\tnativeFunction: (arg1: U, arg2: V, arg3: W, arg4: Y) => R\n): (target: T, arg1: U, arg2: V, arg3: W, arg4: Y) => R;\nexport function wrapNative(nativeFunction: (...args: any[]) => any): (target: any, ...args: any[]) => any {\n\treturn function(target: any, ...args: any[]): any {\n\t\treturn nativeFunction.apply(target, args);\n\t};\n}\n"]} \ No newline at end of file diff --git a/deps/framework/shim/tslib.d.ts b/deps/framework/shim/tslib.d.ts deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/deps/framework/shim/tslib.js b/deps/framework/shim/tslib.js deleted file mode 100644 index 1a6de4e84d..0000000000 --- a/deps/framework/shim/tslib.js +++ /dev/null @@ -1,50 +0,0 @@ -(function (factory) { - if (typeof module === "object" && typeof module.exports === "object") { - var v = factory(require, exports); - if (v !== undefined) module.exports = v; - } - else if (typeof define === "function" && define.amd) { - define(["require", "exports", "./global", "tslib"], factory); - } -})(function (require, exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - var global_1 = require("./global"); - var tslib = require("tslib"); - /** - * Provide any overrides and then load the TypeScript helpers. - */ - tslib.__values = global_1.default.__values = function (o) { - var m = typeof Symbol === 'function' && o[Symbol.iterator], i = 0; - if (m) { - return m.call(o); - } - if (typeof o === 'string') { - var l_1 = o.length; - return { - next: function () { - if (i >= l_1) { - return { done: true }; - } - var char = o[i++]; - if (i < l_1) { - var code = char.charCodeAt(0); - if (code >= 0xd800 && code <= 0xdbff) { - char += o[i++]; - } - } - return { value: char, done: false }; - } - }; - } - return { - next: function () { - if (o && i >= o.length) { - o = void 0; - } - return { value: o && o[i++], done: !o }; - } - }; - }; -}); -//# sourceMappingURL=tslib.js.map \ No newline at end of file diff --git a/deps/framework/shim/tslib.js.map b/deps/framework/shim/tslib.js.map deleted file mode 100644 index cdd7ca9b08..0000000000 --- a/deps/framework/shim/tslib.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"tslib.js","sourceRoot":"","sources":["tslib.ts"],"names":[],"mappings":";;;;;;;;;;;IAAA,mCAA8B;IAC9B,6BAA+B;IAE/B;;OAEG;IACG,KAAM,CAAC,QAAQ,GAAG,gBAAM,CAAC,QAAQ,GAAG,UAAS,CAAM;QACxD,IAAI,CAAC,GAAG,OAAO,MAAM,KAAK,UAAU,IAAI,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,EACzD,CAAC,GAAG,CAAC,CAAC;QACP,EAAE,CAAC,CAAC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load the TypeScript helpers.\n */\n(tslib).__values = global.__values = function(o: any) {\n\tlet m = typeof Symbol === 'function' && o[Symbol.iterator],\n\t\ti = 0;\n\tif (m) {\n\t\treturn m.call(o);\n\t}\n\n\tif (typeof o === 'string') {\n\t\tconst l = o.length;\n\n\t\treturn {\n\t\t\tnext: function() {\n\t\t\t\tif (i >= l) {\n\t\t\t\t\treturn { done: true };\n\t\t\t\t}\n\n\t\t\t\tlet char = o[i++];\n\t\t\t\tif (i < l) {\n\t\t\t\t\tlet code = char.charCodeAt(0);\n\t\t\t\t\tif (code >= 0xd800 && code <= 0xdbff) {\n\t\t\t\t\t\tchar += o[i++];\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\treturn { value: char, done: false };\n\t\t\t}\n\t\t};\n\t}\n\n\treturn {\n\t\tnext: function() {\n\t\t\tif (o && i >= o.length) {\n\t\t\t\to = void 0;\n\t\t\t}\n\t\t\treturn { value: o && o[i++], done: !o };\n\t\t}\n\t};\n};\n"]} \ No newline at end of file diff --git a/deps/framework/shim/tslib.mjs b/deps/framework/shim/tslib.mjs deleted file mode 100644 index 68ba9de25f..0000000000 --- a/deps/framework/shim/tslib.mjs +++ /dev/null @@ -1,38 +0,0 @@ -import global from './global'; -import * as tslib from 'tslib'; -/** - * Provide any overrides and then load the TypeScript helpers. - */ -tslib.__values = global.__values = function (o) { - let m = typeof Symbol === 'function' && o[Symbol.iterator], i = 0; - if (m) { - return m.call(o); - } - if (typeof o === 'string') { - const l = o.length; - return { - next: function () { - if (i >= l) { - return { done: true }; - } - let char = o[i++]; - if (i < l) { - let code = char.charCodeAt(0); - if (code >= 0xd800 && code <= 0xdbff) { - char += o[i++]; - } - } - return { value: char, done: false }; - } - }; - } - return { - next: function () { - if (o && i >= o.length) { - o = void 0; - } - return { value: o && o[i++], done: !o }; - } - }; -}; -//# sourceMappingURL=tslib.mjs.map \ No newline at end of file diff --git a/deps/framework/shim/tslib.mjs.map b/deps/framework/shim/tslib.mjs.map deleted file mode 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KAAK,EAAE,CAAC;YACrC,CAAC;SACD,CAAC;IACH,CAAC;IAED,MAAM,CAAC;QACN,IAAI,EAAE;YACL,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC;gBACxB,CAAC,GAAG,KAAK,CAAC,CAAC;YACZ,CAAC;YACD,MAAM,CAAC,EAAE,KAAK,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC;QACzC,CAAC;KACD,CAAC;AACH,CAAC,CAAC","sourcesContent":["import global from './global';\nimport * as tslib from 'tslib';\n\n/**\n * Provide any overrides and then load the TypeScript helpers.\n */\n(tslib).__values = global.__values = function(o: any) {\n\tlet m = typeof Symbol === 'function' && o[Symbol.iterator],\n\t\ti = 0;\n\tif (m) {\n\t\treturn m.call(o);\n\t}\n\n\tif (typeof o === 'string') {\n\t\tconst l = o.length;\n\n\t\treturn {\n\t\t\tnext: function() {\n\t\t\t\tif (i >= l) {\n\t\t\t\t\treturn { done: true };\n\t\t\t\t}\n\n\t\t\t\tlet char = o[i++];\n\t\t\t\tif (i < l) {\n\t\t\t\t\tlet code = char.charCodeAt(0);\n\t\t\t\t\tif (code >= 0xd800 && code <= 0xdbff) {\n\t\t\t\t\t\tchar += o[i++];\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\treturn { value: char, done: false };\n\t\t\t}\n\t\t};\n\t}\n\n\treturn {\n\t\tnext: function() {\n\t\t\tif (o && i >= o.length) {\n\t\t\t\to = void 0;\n\t\t\t}\n\t\t\treturn { value: o && o[i++], done: !o };\n\t\t}\n\t};\n};\n"]} \ No newline at end of file diff --git a/deps/framework/shim/util/amd.d.ts b/deps/framework/shim/util/amd.d.ts deleted file mode 100644 index 8f26e8e41e..0000000000 --- a/deps/framework/shim/util/amd.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -declare function addIfNotPresent(packages: any[], newPackage: any): void; -declare function shimAmdDependencies(config: any): any; diff --git a/deps/framework/shim/util/amd.js b/deps/framework/shim/util/amd.js deleted file mode 100644 index 030205a5e2..0000000000 --- a/deps/framework/shim/util/amd.js +++ /dev/null @@ -1,37 +0,0 @@ -"use strict"; -function addIfNotPresent(packages, newPackage) { - if (packages.some(function (pack) { return pack.name === newPackage.name; })) { - return; - } - packages.push(newPackage); -} -// tslint:disable-next-line -function shimAmdDependencies(config) { - var packages = config.packages || []; - addIfNotPresent(packages, { - name: 'tslib', - location: 'node_modules/tslib', - main: 'tslib' - }); - addIfNotPresent(packages, { - name: 'pepjs', - location: 'node_modules/pepjs/dist', - main: 'pep' - }); - addIfNotPresent(packages, { - name: 'intersection-observer', - location: 'node_modules/intersection-observer', - main: 'intersection-observer' - }); - addIfNotPresent(packages, { - name: 'web-animations-js', - location: 'node_modules/web-animations-js' - }); - addIfNotPresent(packages, { - name: '@dojo', - location: 'node_modules/@dojo' - }); - config.packages = packages; - return config; -} -//# sourceMappingURL=amd.js.map \ No newline at end of file diff --git a/deps/framework/shim/util/amd.js.map b/deps/framework/shim/util/amd.js.map deleted file mode 100644 index 4bc262c062..0000000000 --- a/deps/framework/shim/util/amd.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"amd.js","sourceRoot":"","sources":["amd.ts"],"names":[],"mappings":";AAAA,yBAAyB,QAAe,EAAE,UAAe;IACxD,EAAE,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,UAAC,IAAI,IAAK,OAAA,IAAI,CAAC,IAAI,KAAK,UAAU,CAAC,IAAI,EAA7B,CAA6B,CAAC,CAAC,CAAC,CAAC;QAC5D,MAAM,CAAC;IACR,CAAC;IAED,QAAQ,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;AAC3B,CAAC;AAED,2BAA2B;AAC3B,6BAA6B,MAAW;IACvC,IAAI,QAAQ,GAAG,MAAM,CAAC,QAAQ,IAAI,EAAE,CAAC;IAErC,eAAe,CAAC,QAAQ,EAAE;QACzB,IAAI,EAAE,OAAO;QACb,QAAQ,EAAE,oBAAoB;QAC9B,IAAI,EAAE,OAAO;KACb,CAAC,CAAC;IAEH,eAAe,CAAC,QAAQ,EAAE;QACzB,IAAI,EAAE,OAAO;QACb,QAAQ,EAAE,yBAAyB;QACnC,IAAI,EAAE,KAAK;KACX,CAAC,CAAC;IAEH,eAAe,CAAC,QAAQ,EAAE;QACzB,IAAI,EAAE,uBAAuB;QAC7B,QAAQ,EAAE,oCAAoC;QAC9C,IAAI,EAAE,uBAAuB;KAC7B,CAAC,CAAC;IAEH,eAAe,CAAC,QAAQ,EAAE;QACzB,IAAI,EAAE,mBAAmB;QACzB,QAAQ,EAAE,gCAAgC;KAC1C,CAAC,CAAC;IAEH,eAAe,CAAC,QAAQ,EAAE;QACzB,IAAI,EAAE,OAAO;QACb,QAAQ,EAAE,oBAAoB;KAC9B,CAAC,CAAC;IAEH,MAAM,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAE3B,MAAM,CAAC,MAAM,CAAC;AACf,CAAC","sourcesContent":["function addIfNotPresent(packages: any[], newPackage: any) {\n\tif (packages.some((pack) => pack.name === newPackage.name)) {\n\t\treturn;\n\t}\n\n\tpackages.push(newPackage);\n}\n\n// tslint:disable-next-line\nfunction shimAmdDependencies(config: any) {\n\tlet packages = config.packages || [];\n\n\taddIfNotPresent(packages, {\n\t\tname: 'tslib',\n\t\tlocation: 'node_modules/tslib',\n\t\tmain: 'tslib'\n\t});\n\n\taddIfNotPresent(packages, {\n\t\tname: 'pepjs',\n\t\tlocation: 'node_modules/pepjs/dist',\n\t\tmain: 'pep'\n\t});\n\n\taddIfNotPresent(packages, {\n\t\tname: 'intersection-observer',\n\t\tlocation: 'node_modules/intersection-observer',\n\t\tmain: 'intersection-observer'\n\t});\n\n\taddIfNotPresent(packages, {\n\t\tname: 'web-animations-js',\n\t\tlocation: 'node_modules/web-animations-js'\n\t});\n\n\taddIfNotPresent(packages, {\n\t\tname: '@dojo',\n\t\tlocation: 'node_modules/@dojo'\n\t});\n\n\tconfig.packages = packages;\n\n\treturn config;\n}\n"]} \ No newline at end of file diff --git a/deps/framework/shim/util/amd.mjs b/deps/framework/shim/util/amd.mjs deleted file mode 100644 index 438bb16192..0000000000 --- a/deps/framework/shim/util/amd.mjs +++ /dev/null @@ -1,37 +0,0 @@ -"use strict"; -function addIfNotPresent(packages, newPackage) { - if (packages.some((pack) => pack.name === newPackage.name)) { - return; - } - packages.push(newPackage); -} -// tslint:disable-next-line -function shimAmdDependencies(config) { - let packages = config.packages || []; - addIfNotPresent(packages, { - name: 'tslib', - location: 'node_modules/tslib', - main: 'tslib' - }); - addIfNotPresent(packages, { - name: 'pepjs', - location: 'node_modules/pepjs/dist', - main: 'pep' - }); - addIfNotPresent(packages, { - name: 'intersection-observer', - location: 'node_modules/intersection-observer', - main: 'intersection-observer' - }); - addIfNotPresent(packages, { - name: 'web-animations-js', - location: 'node_modules/web-animations-js' - }); - addIfNotPresent(packages, { - name: '@dojo', - location: 'node_modules/@dojo' - }); - config.packages = packages; - return config; -} -//# sourceMappingURL=amd.mjs.map \ No newline at end of file diff --git a/deps/framework/shim/util/amd.mjs.map b/deps/framework/shim/util/amd.mjs.map deleted file mode 100644 index a250d6b553..0000000000 --- a/deps/framework/shim/util/amd.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"amd.mjs","sourceRoot":"","sources":["amd.ts"],"names":[],"mappings":";AAAA,yBAAyB,QAAe,EAAE,UAAe;IACxD,EAAE,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,KAAK,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAC5D,MAAM,CAAC;IACR,CAAC;IAED,QAAQ,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;AAC3B,CAAC;AAED,2BAA2B;AAC3B,6BAA6B,MAAW;IACvC,IAAI,QAAQ,GAAG,MAAM,CAAC,QAAQ,IAAI,EAAE,CAAC;IAErC,eAAe,CAAC,QAAQ,EAAE;QACzB,IAAI,EAAE,OAAO;QACb,QAAQ,EAAE,oBAAoB;QAC9B,IAAI,EAAE,OAAO;KACb,CAAC,CAAC;IAEH,eAAe,CAAC,QAAQ,EAAE;QACzB,IAAI,EAAE,OAAO;QACb,QAAQ,EAAE,yBAAyB;QACnC,IAAI,EAAE,KAAK;KACX,CAAC,CAAC;IAEH,eAAe,CAAC,QAAQ,EAAE;QACzB,IAAI,EAAE,uBAAuB;QAC7B,QAAQ,EAAE,oCAAoC;QAC9C,IAAI,EAAE,uBAAuB;KAC7B,CAAC,CAAC;IAEH,eAAe,CAAC,QAAQ,EAAE;QACzB,IAAI,EAAE,mBAAmB;QACzB,QAAQ,EAAE,gCAAgC;KAC1C,CAAC,CAAC;IAEH,eAAe,CAAC,QAAQ,EAAE;QACzB,IAAI,EAAE,OAAO;QACb,QAAQ,EAAE,oBAAoB;KAC9B,CAAC,CAAC;IAEH,MAAM,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAE3B,MAAM,CAAC,MAAM,CAAC;AACf,CAAC","sourcesContent":["function addIfNotPresent(packages: any[], newPackage: any) {\n\tif (packages.some((pack) => pack.name === newPackage.name)) {\n\t\treturn;\n\t}\n\n\tpackages.push(newPackage);\n}\n\n// tslint:disable-next-line\nfunction shimAmdDependencies(config: any) {\n\tlet packages = config.packages || [];\n\n\taddIfNotPresent(packages, {\n\t\tname: 'tslib',\n\t\tlocation: 'node_modules/tslib',\n\t\tmain: 'tslib'\n\t});\n\n\taddIfNotPresent(packages, {\n\t\tname: 'pepjs',\n\t\tlocation: 'node_modules/pepjs/dist',\n\t\tmain: 'pep'\n\t});\n\n\taddIfNotPresent(packages, {\n\t\tname: 'intersection-observer',\n\t\tlocation: 'node_modules/intersection-observer',\n\t\tmain: 'intersection-observer'\n\t});\n\n\taddIfNotPresent(packages, {\n\t\tname: 'web-animations-js',\n\t\tlocation: 'node_modules/web-animations-js'\n\t});\n\n\taddIfNotPresent(packages, {\n\t\tname: '@dojo',\n\t\tlocation: 'node_modules/@dojo'\n\t});\n\n\tconfig.packages = packages;\n\n\treturn config;\n}\n"]} \ No newline at end of file diff --git a/deps/framework/stores/Store.d.ts b/deps/framework/stores/Store.d.ts deleted file mode 100644 index c2b2ed91be..0000000000 --- a/deps/framework/stores/Store.d.ts +++ /dev/null @@ -1,62 +0,0 @@ -import { Evented } from '../core/Evented'; -import { PatchOperation } from './state/Patch'; -/** - * The "path" to a value of type T on and object of type M. The path string is a JSON Pointer to the location of - * `value` within `state`. - * - */ -export interface Path { - path: string; - state: M; - value: T; -} -/** - * An interface that enables typed traversal of an arbitrary type M. `path` and `at` can be used to generate - * `Path`s that allow access to properties within M via the `get` method. The returned `Path`s can also be passed to the - * utility methods `add`, `replace`, and `delete` in order to generate typed operations for modifying the state of a store. - */ -export interface State { - get(path: Path): S; - path(path: Path, a: P0): Path; - path(path: Path, a: P0, b: P1): Path; - path(path: Path, a: P0, b: P1, c: P2): Path; - path(path: Path, a: P0, b: P1, c: P2, d: P3): Path; - path(path: Path, a: P0, b: P1, c: P2, d: P3, e: P4): Path; - path(a: P0): Path; - path(a: P0, b: P1): Path; - path(a: P0, b: P1, c: P2): Path; - path(a: P0, b: P1, c: P2, d: P3): Path; - path(a: P0, b: P1, c: P2, d: P3, e: P4): Path; - at>>(path: S, index: number): Path; -} -/** - * Application state store - */ -export declare class Store extends Evented implements State { - /** - * The private state object - */ - private _state; - private _changePaths; - private _callbackId; - /** - * Returns the state at a specific pointer path location. - */ - get: (path: Path) => U; - /** - * Applies store operations to state and returns the undo operations - */ - apply: (operations: PatchOperation[], invalidate?: boolean) => PatchOperation[]; - at: (path: Path, index: number) => Path; - onChange: (paths: Path | Path[], callback: () => void) => { - remove: () => void; - }; - private _addOnChange; - private _runOnChanges(); - /** - * Emits an invalidation event - */ - invalidate(): any; - path: State['path']; -} -export default Store; diff --git a/deps/framework/stores/Store.js b/deps/framework/stores/Store.js deleted file mode 100644 index 2e8023191f..0000000000 --- a/deps/framework/stores/Store.js +++ /dev/null @@ -1,141 +0,0 @@ -(function (factory) { - if (typeof module === "object" && typeof module.exports === "object") { - var v = factory(require, exports); - if (v !== undefined) module.exports = v; - } - else if (typeof define === "function" && define.amd) { - define(["require", "exports", "tslib", "../core/Evented", "./state/Patch", "./state/Pointer", "../shim/Map"], factory); - } -})(function (require, exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - var tslib_1 = require("tslib"); - var Evented_1 = require("../core/Evented"); - var Patch_1 = require("./state/Patch"); - var Pointer_1 = require("./state/Pointer"); - var Map_1 = require("../shim/Map"); - function isString(segment) { - return typeof segment === 'string'; - } - /** - * Application state store - */ - var Store = /** @class */ (function (_super) { - tslib_1.__extends(Store, _super); - function Store() { - var _this = _super !== null && _super.apply(this, arguments) || this; - /** - * The private state object - */ - _this._state = {}; - _this._changePaths = new Map_1.default(); - _this._callbackId = 0; - /** - * Returns the state at a specific pointer path location. - */ - _this.get = function (path) { - return path.value; - }; - /** - * Applies store operations to state and returns the undo operations - */ - _this.apply = function (operations, invalidate) { - if (invalidate === void 0) { invalidate = false; } - var patch = new Patch_1.Patch(operations); - var patchResult = patch.apply(_this._state); - _this._state = patchResult.object; - if (invalidate) { - _this.invalidate(); - } - return patchResult.undoOperations; - }; - _this.at = function (path, index) { - var array = _this.get(path); - var value = array && array[index]; - return { - path: path.path + "/" + index, - state: path.state, - value: value - }; - }; - _this.onChange = function (paths, callback) { - var callbackId = _this._callbackId; - if (!Array.isArray(paths)) { - paths = [paths]; - } - paths.forEach(function (path) { return _this._addOnChange(path, callback, callbackId); }); - _this._callbackId += 1; - return { - remove: function () { - paths.forEach(function (path) { - var onChange = _this._changePaths.get(path.path); - if (onChange) { - onChange.callbacks = onChange.callbacks.filter(function (callback) { - return callback.callbackId !== callbackId; - }); - } - }); - } - }; - }; - _this._addOnChange = function (path, callback, callbackId) { - var changePaths = _this._changePaths.get(path.path); - if (!changePaths) { - changePaths = { callbacks: [], previousValue: _this.get(path) }; - } - changePaths.callbacks.push({ callbackId: callbackId, callback: callback }); - _this._changePaths.set(path.path, changePaths); - }; - _this.path = function (path) { - var segments = []; - for (var _i = 1; _i < arguments.length; _i++) { - segments[_i - 1] = arguments[_i]; - } - if (typeof path === 'string') { - segments = tslib_1.__spread([path], segments); - } - else { - segments = tslib_1.__spread(new Pointer_1.Pointer(path.path).segments, segments); - } - var stringSegments = segments.filter(isString); - var hasMultipleSegments = stringSegments.length > 1; - var pointer = new Pointer_1.Pointer(hasMultipleSegments ? stringSegments : stringSegments[0] || ''); - return { - path: pointer.path, - state: _this._state, - value: pointer.get(_this._state) - }; - }; - return _this; - } - Store.prototype._runOnChanges = function () { - var _this = this; - var callbackIdsCalled = []; - this._changePaths.forEach(function (value, path) { - var previousValue = value.previousValue, callbacks = value.callbacks; - var newValue = new Pointer_1.Pointer(path).get(_this._state); - if (previousValue !== newValue) { - _this._changePaths.set(path, { callbacks: callbacks, previousValue: newValue }); - callbacks.forEach(function (callbackItem) { - var callback = callbackItem.callback, callbackId = callbackItem.callbackId; - if (callbackIdsCalled.indexOf(callbackId) === -1) { - callbackIdsCalled.push(callbackId); - callback(); - } - }); - } - }); - }; - /** - * Emits an invalidation event - */ - Store.prototype.invalidate = function () { - this._runOnChanges(); - this.emit({ type: 'invalidate' }); - }; - return Store; - }(Evented_1.Evented)); - exports.Store = Store; - exports.default = Store; -}); -//# sourceMappingURL=Store.js.map \ No newline at end of file diff --git a/deps/framework/stores/Store.js.map b/deps/framework/stores/Store.js.map deleted file mode 100644 index 35d27d9e23..0000000000 --- a/deps/framework/stores/Store.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"Store.js","sourceRoot":"","sources":["Store.ts"],"names":[],"mappings":";;;;;;;;;;;;IAAA,2CAA0C;IAC1C,uCAAsD;IACtD,2CAA0C;IAC1C,mCAA8B;IAyF9B,kBAAkB,OAAgB;QACjC,MAAM,CAAC,OAAO,OAAO,KAAK,QAAQ,CAAC;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Q,CAAC,CAAC,CAAC;oBAChC,KAAI,CAAC,YAAY,CAAC,GAAG,CAAC,IAAI,EAAE,EAAE,SAAS,WAAA,EAAE,aAAa,EAAE,QAAQ,EAAE,CAAC,CAAC;oBACpE,SAAS,CAAC,OAAO,CAAC,UAAC,YAAY;wBACtB,IAAA,gCAAQ,EAAE,oCAAU,CAAkB;wBAC9C,EAAE,CAAC,CAAC,iBAAiB,CAAC,OAAO,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;4BAClD,iBAAiB,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;4BACnC,QAAQ,EAAE,CAAC;wBACZ,CAAC;oBACF,CAAC,CAAC,CAAC;gBACJ,CAAC;YACF,CAAC,CAAC,CAAC;QACJ,CAAC;QAED;;WAEG;QACI,0BAAU,GAAjB;YACC,IAAI,CAAC,aAAa,EAAE,CAAC;YACrB,IAAI,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,YAAY,EAAE,CAAC,CAAC;QACnC,CAAC;QAmBF,YAAC;IAAD,CAAC,AAlHD,CAAoC,iBAAO,GAkH1C;IAlHY,sBAAK;IAoHlB,kBAAe,KAAK,CAAC","sourcesContent":["import { Evented } from '../core/Evented';\nimport { Patch, PatchOperation } from './state/Patch';\nimport { Pointer } from './state/Pointer';\nimport Map from '../shim/Map';\n\n/**\n * The \"path\" to a value of type T on and object of type M. The path string is a JSON Pointer to the location of\n * `value` within `state`.\n *\n */\nexport interface Path {\n\tpath: string;\n\tstate: M;\n\tvalue: T;\n}\n\n/**\n * An interface that enables typed traversal of an arbitrary type M. `path` and `at` can be used to generate\n * `Path`s that allow access to properties within M via the `get` method. The returned `Path`s can also be passed to the\n * utility methods `add`, `replace`, and `delete` in order to generate typed operations for modifying the state of a store.\n */\nexport interface State {\n\tget(path: Path): S;\n\tpath(path: Path, a: P0): Path;\n\tpath(path: Path, a: P0, b: P1): Path;\n\tpath(\n\t\tpath: Path,\n\t\ta: P0,\n\t\tb: P1,\n\t\tc: P2\n\t): Path;\n\tpath(\n\t\tpath: Path,\n\t\ta: P0,\n\t\tb: P1,\n\t\tc: P2,\n\t\td: P3\n\t): Path;\n\tpath<\n\t\tT,\n\t\tP0 extends keyof T,\n\t\tP1 extends keyof T[P0],\n\t\tP2 extends keyof T[P0][P1],\n\t\tP3 extends keyof T[P0][P1][P2],\n\t\tP4 extends keyof T[P0][P1][P2][P3]\n\t>(\n\t\tpath: Path,\n\t\ta: P0,\n\t\tb: P1,\n\t\tc: P2,\n\t\td: P3,\n\t\te: P4\n\t): Path;\n\tpath(a: P0): Path;\n\tpath(a: P0, b: P1): Path;\n\tpath(\n\t\ta: P0,\n\t\tb: P1,\n\t\tc: P2\n\t): Path;\n\tpath(\n\t\ta: P0,\n\t\tb: P1,\n\t\tc: P2,\n\t\td: P3\n\t): Path;\n\tpath<\n\t\tP0 extends keyof M,\n\t\tP1 extends keyof M[P0],\n\t\tP2 extends keyof M[P0][P1],\n\t\tP3 extends keyof M[P0][P1][P2],\n\t\tP4 extends keyof M[P0][P1][P2][P3]\n\t>(\n\t\ta: P0,\n\t\tb: P1,\n\t\tc: P2,\n\t\td: P3,\n\t\te: P4\n\t): Path;\n\tat>>(path: S, index: number): Path;\n}\n\ninterface OnChangeCallback {\n\tcallbackId: number;\n\tcallback: () => void;\n}\n\ninterface OnChangeValue {\n\tcallbacks: OnChangeCallback[];\n\tpreviousValue: any;\n}\n\nfunction isString(segment?: string): segment is string {\n\treturn typeof segment === 'string';\n}\n\n/**\n * Application state store\n */\nexport class Store extends Evented implements State {\n\t/**\n\t * The private state object\n\t */\n\tprivate _state = {} as T;\n\n\tprivate _changePaths = new Map();\n\n\tprivate _callbackId = 0;\n\n\t/**\n\t * Returns the state at a specific pointer path location.\n\t */\n\tpublic get = (path: Path): U => {\n\t\treturn path.value;\n\t};\n\n\t/**\n\t * Applies store operations to state and returns the undo operations\n\t */\n\tpublic apply = (operations: PatchOperation[], invalidate: boolean = false): PatchOperation[] => {\n\t\tconst patch = new Patch(operations);\n\t\tconst patchResult = patch.apply(this._state);\n\t\tthis._state = patchResult.object;\n\t\tif (invalidate) {\n\t\t\tthis.invalidate();\n\t\t}\n\t\treturn patchResult.undoOperations;\n\t};\n\n\tpublic at = (path: Path>, index: number): Path => {\n\t\tconst array = this.get(path);\n\t\tconst value = array && array[index];\n\n\t\treturn {\n\t\t\tpath: `${path.path}/${index}`,\n\t\t\tstate: path.state,\n\t\t\tvalue\n\t\t};\n\t};\n\n\tpublic onChange = (paths: Path | Path[], callback: () => void) => {\n\t\tconst callbackId = this._callbackId;\n\t\tif (!Array.isArray(paths)) {\n\t\t\tpaths = [paths];\n\t\t}\n\t\tpaths.forEach((path) => this._addOnChange(path, callback, callbackId));\n\t\tthis._callbackId += 1;\n\t\treturn {\n\t\t\tremove: () => {\n\t\t\t\t(paths as Path[]).forEach((path) => {\n\t\t\t\t\tconst onChange = this._changePaths.get(path.path);\n\t\t\t\t\tif (onChange) {\n\t\t\t\t\t\tonChange.callbacks = onChange.callbacks.filter((callback) => {\n\t\t\t\t\t\t\treturn callback.callbackId !== callbackId;\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\t\t};\n\t};\n\n\tprivate _addOnChange = (path: Path, callback: () => void, callbackId: number): void => {\n\t\tlet changePaths = this._changePaths.get(path.path);\n\t\tif (!changePaths) {\n\t\t\tchangePaths = { callbacks: [], previousValue: this.get(path) };\n\t\t}\n\t\tchangePaths.callbacks.push({ callbackId, callback });\n\t\tthis._changePaths.set(path.path, changePaths);\n\t};\n\n\tprivate _runOnChanges() {\n\t\tconst callbackIdsCalled: number[] = [];\n\t\tthis._changePaths.forEach((value: OnChangeValue, path: string) => {\n\t\t\tconst { previousValue, callbacks } = value;\n\t\t\tconst newValue = new Pointer(path).get(this._state);\n\t\t\tif (previousValue !== newValue) {\n\t\t\t\tthis._changePaths.set(path, { callbacks, previousValue: newValue });\n\t\t\t\tcallbacks.forEach((callbackItem) => {\n\t\t\t\t\tconst { callback, callbackId } = callbackItem;\n\t\t\t\t\tif (callbackIdsCalled.indexOf(callbackId) === -1) {\n\t\t\t\t\t\tcallbackIdsCalled.push(callbackId);\n\t\t\t\t\t\tcallback();\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\t\t});\n\t}\n\n\t/**\n\t * Emits an invalidation event\n\t */\n\tpublic invalidate(): any {\n\t\tthis._runOnChanges();\n\t\tthis.emit({ type: 'invalidate' });\n\t}\n\n\tpublic path: State['path'] = (path: string | Path, ...segments: (string | undefined)[]) => {\n\t\tif (typeof path === 'string') {\n\t\t\tsegments = [path, ...segments];\n\t\t} else {\n\t\t\tsegments = [...new Pointer(path.path).segments, ...segments];\n\t\t}\n\n\t\tconst stringSegments = segments.filter(isString);\n\t\tconst hasMultipleSegments = stringSegments.length > 1;\n\t\tconst pointer = new Pointer(hasMultipleSegments ? stringSegments : stringSegments[0] || '');\n\n\t\treturn {\n\t\t\tpath: pointer.path,\n\t\t\tstate: this._state,\n\t\t\tvalue: pointer.get(this._state)\n\t\t};\n\t};\n}\n\nexport default Store;\n"]} \ No newline at end of file diff --git a/deps/framework/stores/Store.mjs b/deps/framework/stores/Store.mjs deleted file mode 100644 index 47968af12a..0000000000 --- a/deps/framework/stores/Store.mjs +++ /dev/null @@ -1,118 +0,0 @@ -import { Evented } from '../core/Evented'; -import { Patch } from './state/Patch'; -import { Pointer } from './state/Pointer'; -import Map from '../shim/Map'; -function isString(segment) { - return typeof segment === 'string'; -} -/** - * Application state store - */ -export class Store extends Evented { - constructor() { - super(...arguments); - /** - * The private state object - */ - this._state = {}; - this._changePaths = new Map(); - this._callbackId = 0; - /** - * Returns the state at a specific pointer path location. - */ - this.get = (path) => { - return path.value; - }; - /** - * Applies store operations to state and returns the undo operations - */ - this.apply = (operations, invalidate = false) => { - const patch = new Patch(operations); - const patchResult = patch.apply(this._state); - this._state = patchResult.object; - if (invalidate) { - this.invalidate(); - } - return patchResult.undoOperations; - }; - this.at = (path, index) => { - const array = this.get(path); - const value = array && array[index]; - return { - path: `${path.path}/${index}`, - state: path.state, - value - }; - }; - this.onChange = (paths, callback) => { - const callbackId = this._callbackId; - if (!Array.isArray(paths)) { - paths = [paths]; - } - paths.forEach((path) => this._addOnChange(path, callback, callbackId)); - this._callbackId += 1; - return { - remove: () => { - paths.forEach((path) => { - const onChange = this._changePaths.get(path.path); - if (onChange) { - onChange.callbacks = onChange.callbacks.filter((callback) => { - return callback.callbackId !== callbackId; - }); - } - }); - } - }; - }; - this._addOnChange = (path, callback, callbackId) => { - let changePaths = this._changePaths.get(path.path); - if (!changePaths) { - changePaths = { callbacks: [], previousValue: this.get(path) }; - } - changePaths.callbacks.push({ callbackId, callback }); - this._changePaths.set(path.path, changePaths); - }; - this.path = (path, ...segments) => { - if (typeof path === 'string') { - segments = [path, ...segments]; - } - else { - segments = [...new Pointer(path.path).segments, ...segments]; - } - const stringSegments = segments.filter(isString); - const hasMultipleSegments = stringSegments.length > 1; - const pointer = new Pointer(hasMultipleSegments ? stringSegments : stringSegments[0] || ''); - return { - path: pointer.path, - state: this._state, - value: pointer.get(this._state) - }; - }; - } - _runOnChanges() { - const callbackIdsCalled = []; - this._changePaths.forEach((value, path) => { - const { previousValue, callbacks } = value; - const newValue = new Pointer(path).get(this._state); - if (previousValue !== newValue) { - this._changePaths.set(path, { callbacks, previousValue: newValue }); - callbacks.forEach((callbackItem) => { - const { callback, callbackId } = callbackItem; - if (callbackIdsCalled.indexOf(callbackId) === -1) { - callbackIdsCalled.push(callbackId); - callback(); - } - }); - } - }); - } - /** - * Emits an invalidation event - */ - invalidate() { - this._runOnChanges(); - this.emit({ type: 'invalidate' }); - } -} -export default Store; -//# sourceMappingURL=Store.mjs.map \ No newline at end of file diff --git a/deps/framework/stores/Store.mjs.map b/deps/framework/stores/Store.mjs.map deleted file mode 100644 index b380814d42..0000000000 --- a/deps/framework/stores/Store.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"Store.mjs","sourceRo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AAE,CAAC;QACvC,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC,KAAoB,EAAE,IAAY,EAAE,EAAE;YAChE,MAAM,EAAE,aAAa,EAAE,SAAS,EAAE,GAAG,KAAK,CAAC;YAC3C,MAAM,QAAQ,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;YACpD,EAAE,CAAC,CAAC,aAAa,KAAK,QAAQ,CAAC,CAAC,CAAC;gBAChC,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,IAAI,EAAE,EAAE,SAAS,EAAE,aAAa,EAAE,QAAQ,EAAE,CAAC,CAAC;gBACpE,SAAS,CAAC,OAAO,CAAC,CAAC,YAAY,EAAE,EAAE;oBAClC,MAAM,EAAE,QAAQ,EAAE,UAAU,EAAE,GAAG,YAAY,CAAC;oBAC9C,EAAE,CAAC,CAAC,iBAAiB,CAAC,OAAO,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;wBAClD,iBAAiB,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;wBACnC,QAAQ,EAAE,CAAC;oBACZ,CAAC;gBACF,CAAC,CAAC,CAAC;YACJ,CAAC;QACF,CAAC,CAAC,CAAC;IACJ,CAAC;IAED;;OAEG;IACI,UAAU;QAChB,IAAI,CAAC,aAAa,EAAE,CAAC;QACrB,IAAI,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,YAAY,EAAE,CAAC,CAAC;IACnC,CAAC;CAmBD;AAED,eAAe,KAAK,CAAC","sourcesContent":["import { Evented } from '../core/Evented';\nimport { Patch, PatchOperation } from './state/Patch';\nimport { Pointer } from './state/Pointer';\nimport Map from '../shim/Map';\n\n/**\n * The \"path\" to a value of type T on and object of type M. The path string is a JSON Pointer to the location of\n * `value` within `state`.\n *\n */\nexport interface Path {\n\tpath: string;\n\tstate: M;\n\tvalue: T;\n}\n\n/**\n * An interface that enables typed traversal of an arbitrary type M. `path` and `at` can be used to generate\n * `Path`s that allow access to properties within M via the `get` method. The returned `Path`s can also be passed to the\n * utility methods `add`, `replace`, and `delete` in order to generate typed operations for modifying the state of a store.\n */\nexport interface State {\n\tget(path: Path): S;\n\tpath(path: Path, a: P0): Path;\n\tpath(path: Path, a: P0, b: P1): Path;\n\tpath(\n\t\tpath: Path,\n\t\ta: P0,\n\t\tb: P1,\n\t\tc: P2\n\t): Path;\n\tpath(\n\t\tpath: Path,\n\t\ta: P0,\n\t\tb: P1,\n\t\tc: P2,\n\t\td: P3\n\t): Path;\n\tpath<\n\t\tT,\n\t\tP0 extends keyof T,\n\t\tP1 extends keyof T[P0],\n\t\tP2 extends keyof T[P0][P1],\n\t\tP3 extends keyof T[P0][P1][P2],\n\t\tP4 extends keyof T[P0][P1][P2][P3]\n\t>(\n\t\tpath: Path,\n\t\ta: P0,\n\t\tb: P1,\n\t\tc: P2,\n\t\td: P3,\n\t\te: P4\n\t): Path;\n\tpath(a: P0): Path;\n\tpath(a: P0, b: P1): Path;\n\tpath(\n\t\ta: P0,\n\t\tb: P1,\n\t\tc: P2\n\t): Path;\n\tpath(\n\t\ta: P0,\n\t\tb: P1,\n\t\tc: P2,\n\t\td: P3\n\t): Path;\n\tpath<\n\t\tP0 extends keyof M,\n\t\tP1 extends keyof M[P0],\n\t\tP2 extends keyof M[P0][P1],\n\t\tP3 extends keyof M[P0][P1][P2],\n\t\tP4 extends keyof M[P0][P1][P2][P3]\n\t>(\n\t\ta: P0,\n\t\tb: P1,\n\t\tc: P2,\n\t\td: P3,\n\t\te: P4\n\t): Path;\n\tat>>(path: S, index: number): Path;\n}\n\ninterface OnChangeCallback {\n\tcallbackId: number;\n\tcallback: () => void;\n}\n\ninterface OnChangeValue {\n\tcallbacks: OnChangeCallback[];\n\tpreviousValue: any;\n}\n\nfunction isString(segment?: string): segment is string {\n\treturn typeof segment === 'string';\n}\n\n/**\n * Application state store\n */\nexport class Store extends Evented implements State {\n\t/**\n\t * The private state object\n\t */\n\tprivate _state = {} as T;\n\n\tprivate _changePaths = new Map();\n\n\tprivate _callbackId = 0;\n\n\t/**\n\t * Returns the state at a specific pointer path location.\n\t */\n\tpublic get = (path: Path): U => {\n\t\treturn path.value;\n\t};\n\n\t/**\n\t * Applies store operations to state and returns the undo operations\n\t */\n\tpublic apply = (operations: PatchOperation[], invalidate: boolean = false): PatchOperation[] => {\n\t\tconst patch = new Patch(operations);\n\t\tconst patchResult = patch.apply(this._state);\n\t\tthis._state = patchResult.object;\n\t\tif (invalidate) {\n\t\t\tthis.invalidate();\n\t\t}\n\t\treturn patchResult.undoOperations;\n\t};\n\n\tpublic at = (path: Path>, index: number): Path => {\n\t\tconst array = this.get(path);\n\t\tconst value = array && array[index];\n\n\t\treturn {\n\t\t\tpath: `${path.path}/${index}`,\n\t\t\tstate: path.state,\n\t\t\tvalue\n\t\t};\n\t};\n\n\tpublic onChange = (paths: Path | Path[], callback: () => void) => {\n\t\tconst callbackId = this._callbackId;\n\t\tif (!Array.isArray(paths)) {\n\t\t\tpaths = [paths];\n\t\t}\n\t\tpaths.forEach((path) => this._addOnChange(path, callback, callbackId));\n\t\tthis._callbackId += 1;\n\t\treturn {\n\t\t\tremove: () => {\n\t\t\t\t(paths as Path[]).forEach((path) => {\n\t\t\t\t\tconst onChange = this._changePaths.get(path.path);\n\t\t\t\t\tif (onChange) {\n\t\t\t\t\t\tonChange.callbacks = onChange.callbacks.filter((callback) => {\n\t\t\t\t\t\t\treturn callback.callbackId !== callbackId;\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\t\t};\n\t};\n\n\tprivate _addOnChange = (path: Path, callback: () => void, callbackId: number): void => {\n\t\tlet changePaths = this._changePaths.get(path.path);\n\t\tif (!changePaths) {\n\t\t\tchangePaths = { callbacks: [], previousValue: this.get(path) };\n\t\t}\n\t\tchangePaths.callbacks.push({ callbackId, callback });\n\t\tthis._changePaths.set(path.path, changePaths);\n\t};\n\n\tprivate _runOnChanges() {\n\t\tconst callbackIdsCalled: number[] = [];\n\t\tthis._changePaths.forEach((value: OnChangeValue, path: string) => {\n\t\t\tconst { previousValue, callbacks } = value;\n\t\t\tconst newValue = new Pointer(path).get(this._state);\n\t\t\tif (previousValue !== newValue) {\n\t\t\t\tthis._changePaths.set(path, { callbacks, previousValue: newValue });\n\t\t\t\tcallbacks.forEach((callbackItem) => {\n\t\t\t\t\tconst { callback, callbackId } = callbackItem;\n\t\t\t\t\tif (callbackIdsCalled.indexOf(callbackId) === -1) {\n\t\t\t\t\t\tcallbackIdsCalled.push(callbackId);\n\t\t\t\t\t\tcallback();\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\t\t});\n\t}\n\n\t/**\n\t * Emits an invalidation event\n\t */\n\tpublic invalidate(): any {\n\t\tthis._runOnChanges();\n\t\tthis.emit({ type: 'invalidate' });\n\t}\n\n\tpublic path: State['path'] = (path: string | Path, ...segments: (string | undefined)[]) => {\n\t\tif (typeof path === 'string') {\n\t\t\tsegments = [path, ...segments];\n\t\t} else {\n\t\t\tsegments = [...new Pointer(path.path).segments, ...segments];\n\t\t}\n\n\t\tconst stringSegments = segments.filter(isString);\n\t\tconst hasMultipleSegments = stringSegments.length > 1;\n\t\tconst pointer = new Pointer(hasMultipleSegments ? stringSegments : stringSegments[0] || '');\n\n\t\treturn {\n\t\t\tpath: pointer.path,\n\t\t\tstate: this._state,\n\t\t\tvalue: pointer.get(this._state)\n\t\t};\n\t};\n}\n\nexport default Store;\n"]} \ No newline at end of file diff --git a/deps/framework/stores/StoreContainer.d.ts b/deps/framework/stores/StoreContainer.d.ts deleted file mode 100644 index f51b4986b6..0000000000 --- a/deps/framework/stores/StoreContainer.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { StoreContainer } from './StoreInjector'; -export { StoreContainer, createStoreContainer } from './StoreInjector'; -export default StoreContainer; diff --git a/deps/framework/stores/StoreContainer.js b/deps/framework/stores/StoreContainer.js deleted file mode 100644 index e3c486d01d..0000000000 --- a/deps/framework/stores/StoreContainer.js +++ /dev/null @@ -1,18 +0,0 @@ -(function (factory) { - if (typeof module === "object" && typeof module.exports === "object") { - var v = factory(require, exports); - if (v !== undefined) module.exports = v; - } - else if (typeof define === "function" && define.amd) { - define(["require", "exports", "./StoreInjector", "./StoreInjector"], factory); - } -})(function (require, exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - var StoreInjector_1 = require("./StoreInjector"); - var StoreInjector_2 = require("./StoreInjector"); - exports.StoreContainer = StoreInjector_2.StoreContainer; - exports.createStoreContainer = StoreInjector_2.createStoreContainer; - exports.default = StoreInjector_1.StoreContainer; -}); -//# sourceMappingURL=StoreContainer.js.map \ No newline at end of file diff --git a/deps/framework/stores/StoreContainer.js.map b/deps/framework/stores/StoreContainer.js.map deleted file mode 100644 index dab4f3a817..0000000000 --- a/deps/framework/stores/StoreContainer.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"StoreContainer.js","sourceRoot":"","sources":["StoreContainer.ts"],"names":[],"mappings":";;;;;;;;;;;IAAA,iDAAiD;IACjD,iDAAuE;IAA9D,yCAAA,cAAc,CAAA;IAAE,+CAAA,oBAAoB,CAAA;IAE7C,kBAAe,8BAAc,CAAC","sourcesContent":["import { StoreContainer } from './StoreInjector';\nexport { StoreContainer, createStoreContainer } from './StoreInjector';\n\nexport default StoreContainer;\n"]} \ No newline at end of file diff --git a/deps/framework/stores/StoreContainer.mjs b/deps/framework/stores/StoreContainer.mjs deleted file mode 100644 index 3cc8235f53..0000000000 --- a/deps/framework/stores/StoreContainer.mjs +++ /dev/null @@ -1,4 +0,0 @@ -import { StoreContainer } from './StoreInjector'; -export { StoreContainer, createStoreContainer } from './StoreInjector'; -export default StoreContainer; -//# sourceMappingURL=StoreContainer.mjs.map \ No newline at end of file diff --git a/deps/framework/stores/StoreContainer.mjs.map b/deps/framework/stores/StoreContainer.mjs.map deleted file mode 100644 index 91ef8d53c8..0000000000 --- a/deps/framework/stores/StoreContainer.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"StoreContainer.mjs","sourceRoot":"","sources":["StoreContainer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,EAAE,cAAc,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AAEvE,eAAe,cAAc,CAAC","sourcesContent":["import { StoreContainer } from './StoreInjector';\nexport { StoreContainer, createStoreContainer } from './StoreInjector';\n\nexport default StoreContainer;\n"]} \ No newline at end of file diff --git a/deps/framework/stores/StoreInjector.d.ts b/deps/framework/stores/StoreInjector.d.ts deleted file mode 100644 index c9876cd03e..0000000000 --- a/deps/framework/stores/StoreInjector.d.ts +++ /dev/null @@ -1,36 +0,0 @@ -import { WidgetBase } from '../widget-core/WidgetBase'; -import { RegistryLabel, Constructor } from '../widget-core/interfaces'; -import { Store } from './Store'; -import { Registry } from '../../src/widget-core/Registry'; -export interface GetProperties = WidgetBase> { - (payload: S, properties: W['properties']): W['properties']; -} -export declare type StoreContainerPath = [P0] | [P0, P1] | [P0, P1, P2] | [P0, P1, P2, P3] | [P0, P1, P2, P3, P4]; -export interface StoreInjectConfig { - name: RegistryLabel; - getProperties: GetProperties, any>; - paths?: StoreContainerPath[]; -} -export declare type StoreContainer> = Constructor, T['children'][0]>>; -/** - * Decorator that registers a store injector with a container based on paths when provided - * - * @param config Configuration of the store injector - */ -export declare function storeInject(config: StoreInjectConfig): (target: any, propertyKey?: string | undefined, descriptor?: PropertyDescriptor | undefined) => void; -export declare function StoreContainer = WidgetBase>(component: Constructor | RegistryLabel, name: RegistryLabel, {paths, getProperties}: { - paths?: StoreContainerPath[]; - getProperties: GetProperties, W>; -}): StoreContainer; -/** - * Creates a typed `StoreContainer` for State generic. - */ -export declare function createStoreContainer(): >(component: string | symbol | Constructor, name: string | symbol, {paths, getProperties}: { - paths?: StoreContainerPath[] | undefined; - getProperties: GetProperties, W>; -}) => Constructor, W["children"][0]>>; -export interface StoreInjectorOptions { - key?: RegistryLabel; - registry?: Registry; -} -export declare function registerStoreInjector(store: Store, options?: StoreInjectorOptions): Registry; diff --git a/deps/framework/stores/StoreInjector.js b/deps/framework/stores/StoreInjector.js deleted file mode 100644 index c535ea9e87..0000000000 --- a/deps/framework/stores/StoreInjector.js +++ /dev/null @@ -1,105 +0,0 @@ -(function (factory) { - if (typeof module === "object" && typeof module.exports === "object") { - var v = factory(require, exports); - if (v !== undefined) module.exports = v; - } - else if (typeof define === "function" && define.amd) { - define(["require", "exports", "tslib", "../shim/WeakMap", "../widget-core/WidgetBase", "../widget-core/d", "../widget-core/decorators/handleDecorator", "../widget-core/decorators/beforeProperties", "../widget-core/decorators/alwaysRender", "../../src/widget-core/Registry"], factory); - } -})(function (require, exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - var tslib_1 = require("tslib"); - var WeakMap_1 = require("../shim/WeakMap"); - var WidgetBase_1 = require("../widget-core/WidgetBase"); - var d_1 = require("../widget-core/d"); - var handleDecorator_1 = require("../widget-core/decorators/handleDecorator"); - var beforeProperties_1 = require("../widget-core/decorators/beforeProperties"); - var alwaysRender_1 = require("../widget-core/decorators/alwaysRender"); - var Registry_1 = require("../../src/widget-core/Registry"); - var registeredInjectorsMap = new WeakMap_1.default(); - /** - * Decorator that registers a store injector with a container based on paths when provided - * - * @param config Configuration of the store injector - */ - function storeInject(config) { - var name = config.name, paths = config.paths, getProperties = config.getProperties; - return handleDecorator_1.handleDecorator(function (target, propertyKey) { - beforeProperties_1.beforeProperties(function (properties) { - var _this = this; - var injectorItem = this.registry.getInjector(name); - if (injectorItem) { - var injector = injectorItem.injector; - var store_1 = injector(); - var registeredInjectors = registeredInjectorsMap.get(this) || []; - if (registeredInjectors.length === 0) { - registeredInjectorsMap.set(this, registeredInjectors); - } - if (registeredInjectors.indexOf(injectorItem) === -1) { - if (paths) { - var handle_1 = store_1.onChange(paths.map(function (path) { return store_1.path(path.join('/')); }), function () { - return _this.invalidate(); - }); - this.own({ - destroy: function () { - handle_1.remove(); - } - }); - } - else { - this.own(store_1.on('invalidate', function () { - _this.invalidate(); - })); - } - registeredInjectors.push(injectorItem); - } - return getProperties(store_1, properties); - } - })(target); - }); - } - exports.storeInject = storeInject; - function StoreContainer(component, name, _a) { - var paths = _a.paths, getProperties = _a.getProperties; - var WidgetContainer = /** @class */ (function (_super) { - tslib_1.__extends(WidgetContainer, _super); - function WidgetContainer() { - return _super !== null && _super.apply(this, arguments) || this; - } - WidgetContainer.prototype.render = function () { - return d_1.w(component, this.properties, this.children); - }; - WidgetContainer = tslib_1.__decorate([ - alwaysRender_1.alwaysRender(), - storeInject({ name: name, paths: paths, getProperties: getProperties }) - ], WidgetContainer); - return WidgetContainer; - }(WidgetBase_1.WidgetBase)); - return WidgetContainer; - } - exports.StoreContainer = StoreContainer; - /** - * Creates a typed `StoreContainer` for State generic. - */ - function createStoreContainer() { - return function (component, name, _a) { - var paths = _a.paths, getProperties = _a.getProperties; - return StoreContainer(component, name, { paths: paths, getProperties: getProperties }); - }; - } - exports.createStoreContainer = createStoreContainer; - function registerStoreInjector(store, options) { - if (options === void 0) { options = {}; } - var _a = options.key, key = _a === void 0 ? 'state' : _a, _b = options.registry, registry = _b === void 0 ? new Registry_1.Registry() : _b; - if (registry.hasInjector(key)) { - throw new Error("Store has already been defined for key " + key.toString()); - } - registry.defineInjector(key, function () { - return function () { return store; }; - }); - return registry; - } - exports.registerStoreInjector = registerStoreInjector; -}); -//# sourceMappingURL=StoreInjector.js.map \ No newline at end of file diff --git a/deps/framework/stores/StoreInjector.js.map b/deps/framework/stores/StoreInjector.js.map deleted file mode 100644 index 76f68a5da6..0000000000 --- a/deps/framework/stores/StoreInjector.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"StoreInjector.js","sourceRoot":"","sources":["StoreInjector.ts"],"names":[],"mappings":";;;;;;;;;;;;IAAA,2CAAsC;IACtC,wDAAuD;IACvD,sCAAqC;IACrC,6EAA4E;IAC5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QACnF,IAAA,gBAAa,EAAb,kCAAa,EAAE,qBAAyB,EAAzB,yDAAyB,CAAa;QAE7D,EAAE,CAAC,CAAC,QAAQ,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;YAC/B,MAAM,IAAI,KAAK,CAAC,4CAA0C,GAAG,CAAC,QAAQ,EAAI,CAAC,CAAC;QAC7E,CAAC;QACD,QAAQ,CAAC,cAAc,CAAC,GAAG,EAAE;YAC5B,MAAM,CAAC,cAAM,OAAA,KAAK,EAAL,CAAK,CAAC;QACpB,CAAC,CAAC,CAAC;QACH,MAAM,CAAC,QAAQ,CAAC;IACjB,CAAC;IAVD,sDAUC","sourcesContent":["import WeakMap from '../shim/WeakMap';\nimport { WidgetBase } from '../widget-core/WidgetBase';\nimport { w } from '../widget-core/d';\nimport { handleDecorator } from '../widget-core/decorators/handleDecorator';\nimport { beforeProperties } from '../widget-core/decorators/beforeProperties';\nimport { alwaysRender } from '../widget-core/decorators/alwaysRender';\nimport { InjectorItem, RegistryLabel, Constructor, DNode } from '../widget-core/interfaces';\nimport { Store } from './Store';\nimport { Registry } from '../../src/widget-core/Registry';\n\nconst registeredInjectorsMap: WeakMap[]> = new WeakMap();\n\nexport interface GetProperties = WidgetBase> {\n\t(payload: S, properties: W['properties']): W['properties'];\n}\n\nexport type StoreContainerPath<\n\tS,\n\tP0 extends keyof S = keyof S,\n\tP1 extends keyof S[P0] = keyof S[P0],\n\tP2 extends keyof S[P0][P1] = keyof S[P0][P1],\n\tP3 extends keyof S[P0][P1][P2] = keyof S[P0][P1][P2],\n\tP4 extends keyof S[P0][P1][P2][P3] = keyof S[P0][P1][P2][P3]\n> = [P0] | [P0, P1] | [P0, P1, P2] | [P0, P1, P2, P3] | [P0, P1, P2, P3, P4];\n\nexport interface StoreInjectConfig {\n\tname: RegistryLabel;\n\tgetProperties: GetProperties, any>;\n\tpaths?: StoreContainerPath[];\n}\n\nexport type StoreContainer> = Constructor<\n\tWidgetBase, T['children'][0]>\n>;\n\n/**\n * Decorator that registers a store injector with a container based on paths when provided\n *\n * @param config Configuration of the store injector\n */\nexport function storeInject(config: StoreInjectConfig) {\n\tconst { name, paths, getProperties } = config;\n\n\treturn handleDecorator((target, propertyKey) => {\n\t\tbeforeProperties(function(this: WidgetBase & { own: Function }, properties: any) {\n\t\t\tconst injectorItem = this.registry.getInjector>(name);\n\t\t\tif (injectorItem) {\n\t\t\t\tconst { injector } = injectorItem;\n\t\t\t\tconst store = injector();\n\t\t\t\tconst registeredInjectors = registeredInjectorsMap.get(this) || [];\n\t\t\t\tif (registeredInjectors.length === 0) {\n\t\t\t\t\tregisteredInjectorsMap.set(this, registeredInjectors);\n\t\t\t\t}\n\t\t\t\tif (registeredInjectors.indexOf(injectorItem) === -1) {\n\t\t\t\t\tif (paths) {\n\t\t\t\t\t\tconst handle = store.onChange(paths.map((path: any) => store.path(path.join('/'))), () =>\n\t\t\t\t\t\t\tthis.invalidate()\n\t\t\t\t\t\t);\n\t\t\t\t\t\tthis.own({\n\t\t\t\t\t\t\tdestroy: () => {\n\t\t\t\t\t\t\t\thandle.remove();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthis.own(\n\t\t\t\t\t\t\tstore.on('invalidate', () => {\n\t\t\t\t\t\t\t\tthis.invalidate();\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t\tregisteredInjectors.push(injectorItem);\n\t\t\t\t}\n\t\t\t\treturn getProperties(store, properties);\n\t\t\t}\n\t\t})(target);\n\t});\n}\n\nexport function StoreContainer = WidgetBase>(\n\tcomponent: Constructor | RegistryLabel,\n\tname: RegistryLabel,\n\t{ paths, getProperties }: { paths?: StoreContainerPath[]; getProperties: GetProperties, W> }\n): StoreContainer {\n\t@alwaysRender()\n\t@storeInject({ name, paths, getProperties })\n\tclass WidgetContainer extends WidgetBase, W['children'][0]> {\n\t\tprotected render(): DNode {\n\t\t\treturn w(component, this.properties, this.children);\n\t\t}\n\t}\n\treturn WidgetContainer;\n}\n\n/**\n * Creates a typed `StoreContainer` for State generic.\n */\nexport function createStoreContainer() {\n\treturn >(\n\t\tcomponent: Constructor | RegistryLabel,\n\t\tname: RegistryLabel,\n\t\t{ paths, getProperties }: { paths?: StoreContainerPath[]; getProperties: GetProperties, W> }\n\t) => {\n\t\treturn StoreContainer(component, name, { paths, getProperties });\n\t};\n}\n\nexport interface StoreInjectorOptions {\n\tkey?: RegistryLabel;\n\tregistry?: Registry;\n}\n\nexport function registerStoreInjector(store: Store, options: StoreInjectorOptions = {}) {\n\tconst { key = 'state', registry = new Registry() } = options;\n\n\tif (registry.hasInjector(key)) {\n\t\tthrow new Error(`Store has already been defined for key ${key.toString()}`);\n\t}\n\tregistry.defineInjector(key, () => {\n\t\treturn () => store;\n\t});\n\treturn registry;\n}\n"]} \ No newline at end of file diff --git a/deps/framework/stores/StoreInjector.mjs b/deps/framework/stores/StoreInjector.mjs deleted file mode 100644 index 539062ef2b..0000000000 --- a/deps/framework/stores/StoreInjector.mjs +++ /dev/null @@ -1,78 +0,0 @@ -import * as tslib_1 from "tslib"; -import WeakMap from '../shim/WeakMap'; -import { WidgetBase } from '../widget-core/WidgetBase'; -import { w } from '../widget-core/d'; -import { handleDecorator } from '../widget-core/decorators/handleDecorator'; -import { beforeProperties } from '../widget-core/decorators/beforeProperties'; -import { alwaysRender } from '../widget-core/decorators/alwaysRender'; -import { Registry } from '../../src/widget-core/Registry'; -const registeredInjectorsMap = new WeakMap(); -/** - * Decorator that registers a store injector with a container based on paths when provided - * - * @param config Configuration of the store injector - */ -export function storeInject(config) { - const { name, paths, getProperties } = config; - return handleDecorator((target, propertyKey) => { - beforeProperties(function (properties) { - const injectorItem = this.registry.getInjector(name); - if (injectorItem) { - const { injector } = injectorItem; - const store = injector(); - const registeredInjectors = registeredInjectorsMap.get(this) || []; - if (registeredInjectors.length === 0) { - registeredInjectorsMap.set(this, registeredInjectors); - } - if (registeredInjectors.indexOf(injectorItem) === -1) { - if (paths) { - const handle = store.onChange(paths.map((path) => store.path(path.join('/'))), () => this.invalidate()); - this.own({ - destroy: () => { - handle.remove(); - } - }); - } - else { - this.own(store.on('invalidate', () => { - this.invalidate(); - })); - } - registeredInjectors.push(injectorItem); - } - return getProperties(store, properties); - } - })(target); - }); -} -export function StoreContainer(component, name, { paths, getProperties }) { - let WidgetContainer = class WidgetContainer extends WidgetBase { - render() { - return w(component, this.properties, this.children); - } - }; - WidgetContainer = tslib_1.__decorate([ - alwaysRender(), - storeInject({ name, paths, getProperties }) - ], WidgetContainer); - return WidgetContainer; -} -/** - * Creates a typed `StoreContainer` for State generic. - */ -export function createStoreContainer() { - return (component, name, { paths, getProperties }) => { - return StoreContainer(component, name, { paths, getProperties }); - }; -} -export function registerStoreInjector(store, options = {}) { - const { key = 'state', registry = new Registry() } = options; - if (registry.hasInjector(key)) { - throw new Error(`Store has already been defined for key ${key.toString()}`); - } - registry.defineInjector(key, () => { - return () => store; - }); - return registry; -} -//# sourceMappingURL=StoreInjector.mjs.map \ No newline at end of file diff --git a/deps/framework/stores/StoreInjector.mjs.map b/deps/framework/stores/StoreInjector.mjs.map deleted file mode 100644 index 567564c65e..0000000000 --- a/deps/framework/stores/StoreInjector.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"StoreInjector.mjs","sourceRoot":"","sources":["StoreInjector.ts"],"names":[],"mappings":";AAAA,OAAO,OAAO,MAAM,iBAAiB,CAAC;AACtC,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AACvD,OAAO,EAAE,CAAC,EAAE,MAAM,kBAAkB,CAAC;AACrC,OAAO,EAAE,eAAe,EAAE,MAAM,2CAA2C,CAAC;AAC5E,OAAO,EAAE,gBAAgB,EAAE,MAAM,4CAA4C,CAAC;AAC9E,OAAO,EAAE,YAAY,EAAE,MAAM,wCAAwC,CAAC;AAGtE,OAAO,EAAE,QAAQ,EAAE,MAAM,gCAAgC,CAAC;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,CAAC,CAAC,QAAQ,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;QAC/B,MAAM,IAAI,KAAK,CAAC,0CAA0C,GAAG,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC;IAC7E,CAAC;IACD,QAAQ,CAAC,cAAc,CAAC,GAAG,EAAE,GAAG,EAAE;QACjC,MAAM,CAAC,GAAG,EAAE,CAAC,KAAK,CAAC;IACpB,CAAC,CAAC,CAAC;IACH,MAAM,CAAC,QAAQ,CAAC;AACjB,CAAC","sourcesContent":["import WeakMap from '../shim/WeakMap';\nimport { WidgetBase } from '../widget-core/WidgetBase';\nimport { w } from '../widget-core/d';\nimport { handleDecorator } from '../widget-core/decorators/handleDecorator';\nimport { beforeProperties } from '../widget-core/decorators/beforeProperties';\nimport { alwaysRender } from '../widget-core/decorators/alwaysRender';\nimport { InjectorItem, RegistryLabel, Constructor, DNode } from '../widget-core/interfaces';\nimport { Store } from './Store';\nimport { Registry } from '../../src/widget-core/Registry';\n\nconst registeredInjectorsMap: WeakMap[]> = new WeakMap();\n\nexport interface GetProperties = WidgetBase> {\n\t(payload: S, properties: W['properties']): W['properties'];\n}\n\nexport type StoreContainerPath<\n\tS,\n\tP0 extends keyof S = keyof S,\n\tP1 extends keyof S[P0] = keyof S[P0],\n\tP2 extends keyof S[P0][P1] = keyof S[P0][P1],\n\tP3 extends keyof S[P0][P1][P2] = keyof S[P0][P1][P2],\n\tP4 extends keyof S[P0][P1][P2][P3] = keyof S[P0][P1][P2][P3]\n> = [P0] | [P0, P1] | [P0, P1, P2] | [P0, P1, P2, P3] | [P0, P1, P2, P3, P4];\n\nexport interface StoreInjectConfig {\n\tname: RegistryLabel;\n\tgetProperties: GetProperties, any>;\n\tpaths?: StoreContainerPath[];\n}\n\nexport type StoreContainer> = Constructor<\n\tWidgetBase, T['children'][0]>\n>;\n\n/**\n * Decorator that registers a store injector with a container based on paths when provided\n *\n * @param config Configuration of the store injector\n */\nexport function storeInject(config: StoreInjectConfig) {\n\tconst { name, paths, getProperties } = config;\n\n\treturn handleDecorator((target, propertyKey) => {\n\t\tbeforeProperties(function(this: WidgetBase & { own: Function }, properties: any) {\n\t\t\tconst injectorItem = this.registry.getInjector>(name);\n\t\t\tif (injectorItem) {\n\t\t\t\tconst { injector } = injectorItem;\n\t\t\t\tconst store = injector();\n\t\t\t\tconst registeredInjectors = registeredInjectorsMap.get(this) || [];\n\t\t\t\tif (registeredInjectors.length === 0) {\n\t\t\t\t\tregisteredInjectorsMap.set(this, registeredInjectors);\n\t\t\t\t}\n\t\t\t\tif (registeredInjectors.indexOf(injectorItem) === -1) {\n\t\t\t\t\tif (paths) {\n\t\t\t\t\t\tconst handle = store.onChange(paths.map((path: any) => store.path(path.join('/'))), () =>\n\t\t\t\t\t\t\tthis.invalidate()\n\t\t\t\t\t\t);\n\t\t\t\t\t\tthis.own({\n\t\t\t\t\t\t\tdestroy: () => {\n\t\t\t\t\t\t\t\thandle.remove();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthis.own(\n\t\t\t\t\t\t\tstore.on('invalidate', () => {\n\t\t\t\t\t\t\t\tthis.invalidate();\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t\tregisteredInjectors.push(injectorItem);\n\t\t\t\t}\n\t\t\t\treturn getProperties(store, properties);\n\t\t\t}\n\t\t})(target);\n\t});\n}\n\nexport function StoreContainer = WidgetBase>(\n\tcomponent: Constructor | RegistryLabel,\n\tname: RegistryLabel,\n\t{ paths, getProperties }: { paths?: StoreContainerPath[]; getProperties: GetProperties, W> }\n): StoreContainer {\n\t@alwaysRender()\n\t@storeInject({ name, paths, getProperties })\n\tclass WidgetContainer extends WidgetBase, W['children'][0]> {\n\t\tprotected render(): DNode {\n\t\t\treturn w(component, this.properties, this.children);\n\t\t}\n\t}\n\treturn WidgetContainer;\n}\n\n/**\n * Creates a typed `StoreContainer` for State generic.\n */\nexport function createStoreContainer() {\n\treturn >(\n\t\tcomponent: Constructor | RegistryLabel,\n\t\tname: RegistryLabel,\n\t\t{ paths, getProperties }: { paths?: StoreContainerPath[]; getProperties: GetProperties, W> }\n\t) => {\n\t\treturn StoreContainer(component, name, { paths, getProperties });\n\t};\n}\n\nexport interface StoreInjectorOptions {\n\tkey?: RegistryLabel;\n\tregistry?: Registry;\n}\n\nexport function registerStoreInjector(store: Store, options: StoreInjectorOptions = {}) {\n\tconst { key = 'state', registry = new Registry() } = options;\n\n\tif (registry.hasInjector(key)) {\n\t\tthrow new Error(`Store has already been defined for key ${key.toString()}`);\n\t}\n\tregistry.defineInjector(key, () => {\n\t\treturn () => store;\n\t});\n\treturn registry;\n}\n"]} \ No newline at end of file diff --git a/deps/framework/stores/middleware/HistoryManager.d.ts b/deps/framework/stores/middleware/HistoryManager.d.ts deleted file mode 100644 index 6b68bee569..0000000000 --- a/deps/framework/stores/middleware/HistoryManager.d.ts +++ /dev/null @@ -1,22 +0,0 @@ -import { ProcessCallback } from '../process'; -import { PatchOperation } from '../state/Patch'; -import Store from '../Store'; -export interface HistoryOperation { - id: string; - operations: PatchOperation[]; -} -export interface HistoryData { - history: HistoryOperation[]; - redo: HistoryOperation[]; -} -export declare class HistoryManager { - private _storeMap; - collector(callback?: ProcessCallback): ProcessCallback; - canUndo(store: Store): boolean; - canRedo(store: Store): boolean; - redo(store: Store): void; - undo(store: Store): void; - deserialize(store: Store, data: HistoryData): void; - serialize(store: Store): HistoryData; -} -export default HistoryManager; diff --git a/deps/framework/stores/middleware/HistoryManager.js b/deps/framework/stores/middleware/HistoryManager.js deleted file mode 100644 index 24e3cc6b2c..0000000000 --- a/deps/framework/stores/middleware/HistoryManager.js +++ /dev/null @@ -1,119 +0,0 @@ -(function (factory) { - if (typeof module === "object" && typeof module.exports === "object") { - var v = factory(require, exports); - if (v !== undefined) module.exports = v; - } - else if (typeof define === "function" && define.amd) { - define(["require", "exports", "../process", "../state/Pointer", "../../shim/WeakMap"], factory); - } -})(function (require, exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - var process_1 = require("../process"); - var Pointer_1 = require("../state/Pointer"); - var WeakMap_1 = require("../../shim/WeakMap"); - var HistoryManager = /** @class */ (function () { - function HistoryManager() { - this._storeMap = new WeakMap_1.default(); - } - HistoryManager.prototype.collector = function (callback) { - var _this = this; - return function (error, result) { - var operations = result.operations, undoOperations = result.undoOperations, id = result.id, store = result.store; - var _a = _this._storeMap.get(store) || { - history: [], - undo: [] - }, history = _a.history, undo = _a.undo; - history.push({ id: id, operations: operations }); - undo.push({ id: id, operations: undoOperations }); - _this._storeMap.set(store, { history: history, undo: undo, redo: [] }); - callback && callback(error, result); - }; - }; - HistoryManager.prototype.canUndo = function (store) { - var stacks = this._storeMap.get(store); - if (stacks) { - var history_1 = stacks.history, undo = stacks.undo; - if (undo.length && history_1.length) { - return true; - } - } - return false; - }; - HistoryManager.prototype.canRedo = function (store) { - var stacks = this._storeMap.get(store); - if (stacks) { - var redo = stacks.redo; - if (redo.length) { - return true; - } - } - return false; - }; - HistoryManager.prototype.redo = function (store) { - var stacks = this._storeMap.get(store); - if (stacks) { - var history_2 = stacks.history, redo = stacks.redo, undo = stacks.undo; - if (redo.length) { - var _a = redo.pop(), id = _a.id, operations = _a.operations; - var result = store.apply(operations); - history_2.push({ id: id, operations: operations }); - undo.push({ id: id, operations: result }); - this._storeMap.set(store, { history: history_2, undo: undo, redo: redo }); - } - } - }; - HistoryManager.prototype.undo = function (store) { - var stacks = this._storeMap.get(store); - if (stacks) { - var history_3 = stacks.history, undo = stacks.undo, redo = stacks.redo; - if (undo.length && history_3.length) { - var _a = undo.pop(), id = _a.id, operations = _a.operations; - history_3.pop(); - var result = store.apply(operations); - redo.push({ id: id, operations: result }); - this._storeMap.set(store, { history: history_3, undo: undo, redo: redo }); - } - } - }; - HistoryManager.prototype.deserialize = function (store, data) { - var history = data.history, redo = data.redo; - history.forEach(function (_a) { - var id = _a.id, operations = _a.operations; - operations = operations.map(function (operation) { - operation.path = new Pointer_1.Pointer(String(operation.path)); - return operation; - }); - var callback; - var process = process_1.getProcess(id); - if (process) { - callback = process[2]; - } - process_1.processExecutor(id, [function () { return operations; }], store, callback, undefined)({}); - }); - var stacks = this._storeMap.get(store); - redo.forEach(function (_a) { - var id = _a.id, operations = _a.operations; - operations = operations.map(function (operation) { - operation.path = new Pointer_1.Pointer(String(operation.path)); - return operation; - }); - }); - stacks.redo = redo; - }; - HistoryManager.prototype.serialize = function (store) { - var stacks = this._storeMap.get(store); - if (stacks) { - return { - history: stacks.history, - redo: stacks.redo - }; - } - return { history: [], redo: [] }; - }; - return HistoryManager; - }()); - exports.HistoryManager = HistoryManager; - exports.default = HistoryManager; -}); -//# sourceMappingURL=HistoryManager.js.map \ No newline at end of file diff --git a/deps/framework/stores/middleware/HistoryManager.js.map b/deps/framework/stores/middleware/HistoryManager.js.map deleted file mode 100644 index e83f7b6b4e..0000000000 --- a/deps/framework/stores/middleware/HistoryManager.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"HistoryManager.js","sourceRoot":"","sources":["HistoryManager.ts"],"names":[],"mappings":";;;;;;;;;;;IAAA,sCAAuG;IAEvG,4CAA2C;IAE3C,8CAAyC;IAYzC;QAAA;YACS,cAAS,GAAG,IAAI,iBAAO,EAAE,CAAC;QAoGnC,CAAC;QAlGO,kCAAS,GAAhB,UAAiB,QAA0B;YAA3C,iBAYC;YAXA,MAAM,CAAC,UAAC,KAA0B,EAAE,MAAqB;gBAChD,IAAA,8BAAU,EAAE,sCAAc,EAAE,cAAE,EAAE,oBAAK,CAAY;gBACnD,IAAA;;;iBAGL,EAHO,oBAAO,EAAE,cAAI,CAGnB;gBACF,OAAO,CAAC,IAAI,CAAC,EAAE,EAAE,IAAA,EAAE,UAAU,YAAA,EAAE,CAAC,CAAC;gBACjC,IAAI,CAAC,IAAI,CAAC,EAAE,EAAE,IAAA,EAAE,UAAU,EAAE,cAAc,EAAE,CAAC,CA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CAAC,CAAC,CAAC;gBACZ,MAAM,CAAC;oBACN,OAAO,EAAE,MAAM,CAAC,OAAO;oBACvB,IAAI,EAAE,MAAM,CAAC,IAAI;iBACjB,CAAC;YACH,CAAC;YACD,MAAM,CAAC,EAAE,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC;QAClC,CAAC;QACF,qBAAC;IAAD,CAAC,AArGD,IAqGC;IArGY,wCAAc;IAuG3B,kBAAe,cAAc,CAAC","sourcesContent":["import { processExecutor, getProcess, ProcessError, ProcessResult, ProcessCallback } from '../process';\nimport { PatchOperation } from '../state/Patch';\nimport { Pointer } from '../state/Pointer';\nimport Store from '../Store';\nimport WeakMap from '../../shim/WeakMap';\n\nexport interface HistoryOperation {\n\tid: string;\n\toperations: PatchOperation[];\n}\n\nexport interface HistoryData {\n\thistory: HistoryOperation[];\n\tredo: HistoryOperation[];\n}\n\nexport class HistoryManager {\n\tprivate _storeMap = new WeakMap();\n\n\tpublic collector(callback?: ProcessCallback): ProcessCallback {\n\t\treturn (error: ProcessError | null, result: ProcessResult): void => {\n\t\t\tconst { operations, undoOperations, id, store } = result;\n\t\t\tconst { history, undo } = this._storeMap.get(store) || {\n\t\t\t\thistory: [],\n\t\t\t\tundo: []\n\t\t\t};\n\t\t\thistory.push({ id, operations });\n\t\t\tundo.push({ id, operations: undoOperations });\n\t\t\tthis._storeMap.set(store, { history, undo, redo: [] });\n\t\t\tcallback && callback(error, result);\n\t\t};\n\t}\n\n\tpublic canUndo(store: Store): boolean {\n\t\tconst stacks = this._storeMap.get(store);\n\t\tif (stacks) {\n\t\t\tconst { history, undo } = stacks;\n\t\t\tif (undo.length && history.length) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}\n\n\tpublic canRedo(store: Store): boolean {\n\t\tconst stacks = this._storeMap.get(store);\n\t\tif (stacks) {\n\t\t\tconst { redo } = stacks;\n\t\t\tif (redo.length) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}\n\n\tpublic redo(store: Store) {\n\t\tconst stacks = this._storeMap.get(store);\n\t\tif (stacks) {\n\t\t\tconst { history, redo, undo } = stacks;\n\t\t\tif (redo.length) {\n\t\t\t\tconst { id, operations } = redo.pop();\n\t\t\t\tconst result = store.apply(operations);\n\t\t\t\thistory.push({ id, operations });\n\t\t\t\tundo.push({ id, operations: result });\n\t\t\t\tthis._storeMap.set(store, { history, undo, redo });\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic undo(store: Store) {\n\t\tconst stacks = this._storeMap.get(store);\n\t\tif (stacks) {\n\t\t\tconst { history, undo, redo } = stacks;\n\t\t\tif (undo.length && history.length) {\n\t\t\t\tconst { id, operations } = undo.pop();\n\t\t\t\thistory.pop();\n\t\t\t\tconst result = store.apply(operations);\n\t\t\t\tredo.push({ id, operations: result });\n\t\t\t\tthis._storeMap.set(store, { history, undo, redo });\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic deserialize(store: Store, data: HistoryData) {\n\t\tconst { history, redo } = data;\n\t\thistory.forEach(({ id, operations }: HistoryOperation) => {\n\t\t\toperations = operations.map((operation) => {\n\t\t\t\toperation.path = new Pointer(String(operation.path));\n\t\t\t\treturn operation;\n\t\t\t});\n\t\t\tlet callback;\n\t\t\tconst process = getProcess(id);\n\t\t\tif (process) {\n\t\t\t\tcallback = process[2];\n\t\t\t}\n\t\t\tprocessExecutor(id, [() => operations], store, callback, undefined)({});\n\t\t});\n\t\tconst stacks = this._storeMap.get(store);\n\t\tredo.forEach(({ id, operations }: HistoryOperation) => {\n\t\t\toperations = operations.map((operation) => {\n\t\t\t\toperation.path = new Pointer(String(operation.path));\n\t\t\t\treturn operation;\n\t\t\t});\n\t\t});\n\t\tstacks.redo = redo;\n\t}\n\n\tpublic serialize(store: Store): HistoryData {\n\t\tconst stacks = this._storeMap.get(store);\n\t\tif (stacks) {\n\t\t\treturn {\n\t\t\t\thistory: stacks.history,\n\t\t\t\tredo: stacks.redo\n\t\t\t};\n\t\t}\n\t\treturn { history: [], redo: [] };\n\t}\n}\n\nexport default HistoryManager;\n"]} \ No newline at end of file diff --git a/deps/framework/stores/middleware/HistoryManager.mjs b/deps/framework/stores/middleware/HistoryManager.mjs deleted file mode 100644 index 3dba6d1716..0000000000 --- a/deps/framework/stores/middleware/HistoryManager.mjs +++ /dev/null @@ -1,102 +0,0 @@ -import { processExecutor, getProcess } from '../process'; -import { Pointer } from '../state/Pointer'; -import WeakMap from '../../shim/WeakMap'; -export class HistoryManager { - constructor() { - this._storeMap = new WeakMap(); - } - collector(callback) { - return (error, result) => { - const { operations, undoOperations, id, store } = result; - const { history, undo } = this._storeMap.get(store) || { - history: [], - undo: [] - }; - history.push({ id, operations }); - undo.push({ id, operations: undoOperations }); - this._storeMap.set(store, { history, undo, redo: [] }); - callback && callback(error, result); - }; - } - canUndo(store) { - const stacks = this._storeMap.get(store); - if (stacks) { - const { history, undo } = stacks; - if (undo.length && history.length) { - return true; - } - } - return false; - } - canRedo(store) { - const stacks = this._storeMap.get(store); - if (stacks) { - const { redo } = stacks; - if (redo.length) { - return true; - } - } - return false; - } - redo(store) { - const stacks = this._storeMap.get(store); - if (stacks) { - const { history, redo, undo } = stacks; - if (redo.length) { - const { id, operations } = redo.pop(); - const result = store.apply(operations); - history.push({ id, operations }); - undo.push({ id, operations: result }); - this._storeMap.set(store, { history, undo, redo }); - } - } - } - undo(store) { - const stacks = this._storeMap.get(store); - if (stacks) { - const { history, undo, redo } = stacks; - if (undo.length && history.length) { - const { id, operations } = undo.pop(); - history.pop(); - const result = store.apply(operations); - redo.push({ id, operations: result }); - this._storeMap.set(store, { history, undo, redo }); - } - } - } - deserialize(store, data) { - const { history, redo } = data; - history.forEach(({ id, operations }) => { - operations = operations.map((operation) => { - operation.path = new Pointer(String(operation.path)); - return operation; - }); - let callback; - const process = getProcess(id); - if (process) { - callback = process[2]; - } - processExecutor(id, [() => operations], store, callback, undefined)({}); - }); - const stacks = this._storeMap.get(store); - redo.forEach(({ id, operations }) => { - operations = operations.map((operation) => { - operation.path = new Pointer(String(operation.path)); - return operation; - }); - }); - stacks.redo = redo; - } - serialize(store) { - const stacks = this._storeMap.get(store); - if (stacks) { - return { - history: stacks.history, - redo: stacks.redo - }; - } - return { history: [], redo: [] }; - } -} -export default HistoryManager; -//# sourceMappingURL=HistoryManager.mjs.map \ No newline at end of file diff --git a/deps/framework/stores/middleware/HistoryManager.mjs.map b/deps/framework/stores/middleware/HistoryManager.mjs.map deleted file mode 100644 index 5de7bf8bf4..0000000000 --- a/deps/framework/stores/middleware/HistoryManager.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"HistoryManager.mjs","sourceRoot":"","sources":["HistoryManager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,UAAU,EAAgD,MAAM,YAAY,CAAC;AAEvG,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAE3C,OAAO,OAAO,MAAM,oBAAoB,CAAC;AAYzC,MAAM;IAAN;QACS,cAAS,GAAG,IAAI,OAAO,EAAE,CAAC;IAoGnC,CAAC;IAlGO,SAAS,CAAC,QAA0B;QAC1C,MAAM,CAAC,CAAC,KAA0B,EAAE,MAAqB,EAAQ,EAAE;YAClE,MAAM,EAAE,UAAU,EAAE,cAAc,EAAE,EAAE,EAAE,KAAK,EAAE,GAAG,MAAM,CAAC;YACzD,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,GAAG,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI;gBACtD,OAAO,EAAE,EAAE;gBACX,IAAI,EAAE,EAAE;aACR,CAAC;YACF,OAAO,CAAC,IAAI,CAAC,EAAE,EAAE,EAAE,UAAU,EAAE,CAAC,CAAC;YACjC,IAAI,CAAC,IAAI,CAAC,EAAE,EAAE,EAAE,UAAU,EAAE,cAAc,EAAE,CAAC,CAAC;YAC9C,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,KAAK,EAA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YACZ,MAAM,CAAC;gBACN,OAAO,EAAE,MAAM,CAAC,OAAO;gBACvB,IAAI,EAAE,MAAM,CAAC,IAAI;aACjB,CAAC;QACH,CAAC;QACD,MAAM,CAAC,EAAE,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC;IAClC,CAAC;CACD;AAED,eAAe,cAAc,CAAC","sourcesContent":["import { processExecutor, getProcess, ProcessError, ProcessResult, ProcessCallback } from '../process';\nimport { PatchOperation } from '../state/Patch';\nimport { Pointer } from '../state/Pointer';\nimport Store from '../Store';\nimport WeakMap from '../../shim/WeakMap';\n\nexport interface HistoryOperation {\n\tid: string;\n\toperations: PatchOperation[];\n}\n\nexport interface HistoryData {\n\thistory: HistoryOperation[];\n\tredo: HistoryOperation[];\n}\n\nexport class HistoryManager {\n\tprivate _storeMap = new WeakMap();\n\n\tpublic collector(callback?: ProcessCallback): ProcessCallback {\n\t\treturn (error: ProcessError | null, result: ProcessResult): void => {\n\t\t\tconst { operations, undoOperations, id, store } = result;\n\t\t\tconst { history, undo } = this._storeMap.get(store) || {\n\t\t\t\thistory: [],\n\t\t\t\tundo: []\n\t\t\t};\n\t\t\thistory.push({ id, operations });\n\t\t\tundo.push({ id, operations: undoOperations });\n\t\t\tthis._storeMap.set(store, { history, undo, redo: [] });\n\t\t\tcallback && callback(error, result);\n\t\t};\n\t}\n\n\tpublic canUndo(store: Store): boolean {\n\t\tconst stacks = this._storeMap.get(store);\n\t\tif (stacks) {\n\t\t\tconst { history, undo } = stacks;\n\t\t\tif (undo.length && history.length) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}\n\n\tpublic canRedo(store: Store): boolean {\n\t\tconst stacks = this._storeMap.get(store);\n\t\tif (stacks) {\n\t\t\tconst { redo } = stacks;\n\t\t\tif (redo.length) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}\n\n\tpublic redo(store: Store) {\n\t\tconst stacks = this._storeMap.get(store);\n\t\tif (stacks) {\n\t\t\tconst { history, redo, undo } = stacks;\n\t\t\tif (redo.length) {\n\t\t\t\tconst { id, operations } = redo.pop();\n\t\t\t\tconst result = store.apply(operations);\n\t\t\t\thistory.push({ id, operations });\n\t\t\t\tundo.push({ id, operations: result });\n\t\t\t\tthis._storeMap.set(store, { history, undo, redo });\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic undo(store: Store) {\n\t\tconst stacks = this._storeMap.get(store);\n\t\tif (stacks) {\n\t\t\tconst { history, undo, redo } = stacks;\n\t\t\tif (undo.length && history.length) {\n\t\t\t\tconst { id, operations } = undo.pop();\n\t\t\t\thistory.pop();\n\t\t\t\tconst result = store.apply(operations);\n\t\t\t\tredo.push({ id, operations: result });\n\t\t\t\tthis._storeMap.set(store, { history, undo, redo });\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic deserialize(store: Store, data: HistoryData) {\n\t\tconst { history, redo } = data;\n\t\thistory.forEach(({ id, operations }: HistoryOperation) => {\n\t\t\toperations = operations.map((operation) => {\n\t\t\t\toperation.path = new Pointer(String(operation.path));\n\t\t\t\treturn operation;\n\t\t\t});\n\t\t\tlet callback;\n\t\t\tconst process = getProcess(id);\n\t\t\tif (process) {\n\t\t\t\tcallback = process[2];\n\t\t\t}\n\t\t\tprocessExecutor(id, [() => operations], store, callback, undefined)({});\n\t\t});\n\t\tconst stacks = this._storeMap.get(store);\n\t\tredo.forEach(({ id, operations }: HistoryOperation) => {\n\t\t\toperations = operations.map((operation) => {\n\t\t\t\toperation.path = new Pointer(String(operation.path));\n\t\t\t\treturn operation;\n\t\t\t});\n\t\t});\n\t\tstacks.redo = redo;\n\t}\n\n\tpublic serialize(store: Store): HistoryData {\n\t\tconst stacks = this._storeMap.get(store);\n\t\tif (stacks) {\n\t\t\treturn {\n\t\t\t\thistory: stacks.history,\n\t\t\t\tredo: stacks.redo\n\t\t\t};\n\t\t}\n\t\treturn { history: [], redo: [] };\n\t}\n}\n\nexport default HistoryManager;\n"]} \ No newline at end of file diff --git a/deps/framework/stores/process.d.ts b/deps/framework/stores/process.d.ts deleted file mode 100644 index d60a020f7d..0000000000 --- a/deps/framework/stores/process.d.ts +++ /dev/null @@ -1,121 +0,0 @@ -import { PatchOperation } from './state/Patch'; -import { State, Store } from './Store'; -/** - * Default Payload interface - */ -export interface DefaultPayload { - [index: string]: any; -} -/** - * The arguments passed to a `Command` - */ -export interface CommandRequest extends State { - payload: P; -} -/** - * A command factory interface. Returns the passed command. This provides a way to automatically infer and/or - * verify the type of multiple commands without explicitly specifying the generic for each command - */ -export interface CommandFactory { - (command: Command): Command; -} -/** - * Command that returns patch operations based on the command request - */ -export interface Command { - (request: CommandRequest): Promise[]> | PatchOperation[]; -} -/** - * Transformer function - */ -export interface Transformer

{ - (payload: R): P; -} -/** - * A process that returns an executor using a Store and Transformer - */ -export interface Process { - (store: Store, transformer: Transformer): ProcessExecutor; - (store: Store): ProcessExecutor; -} -/** - * Represents an error from a ProcessExecutor - */ -export interface ProcessError { - error: Error | null; - command?: Command[] | Command; -} -export interface ProcessResultExecutor { -

(process: Process, payload: R, transformer: Transformer): Promise | ProcessError>; -

(process: Process, payload: P): Promise | ProcessError>; -} -/** - * Represents a successful result from a ProcessExecutor - */ -export interface ProcessResult extends State { - executor: ProcessResultExecutor; - store: Store; - operations: PatchOperation[]; - undoOperations: PatchOperation[]; - apply: (operations: PatchOperation[], invalidate?: boolean) => PatchOperation[]; - payload: P; - id: string; - error?: ProcessError | null; -} -/** - * Runs a process for the given arguments. - */ -export interface ProcessExecutor { - (payload: R): Promise>; -} -/** - * Callback for a process, returns an error as the first argument - */ -export interface ProcessCallback { - (error: ProcessError | null, result: ProcessResult): void; -} -/** - * Function for undoing operations - */ -export interface Undo { - (): void; -} -/** - * ProcessCallbackDecorator callback - */ -export interface ProcessCallbackDecorator { - (callback?: ProcessCallback): ProcessCallback; -} -/** - * CreateProcess factory interface - */ -export interface CreateProcess { - (id: string, commands: (Command[] | Command)[], callback?: ProcessCallback): Process; -} -/** - * Creates a command factory with the specified type - */ -export declare function createCommandFactory(): CommandFactory; -/** - * Commands that can be passed to a process - */ -export declare type Commands = (Command[] | Command)[]; -export declare function getProcess(id: string): any; -export declare function processExecutor(id: string, commands: Commands, store: Store, callback: ProcessCallback | undefined, transformer: Transformer

| undefined): ProcessExecutor; -/** - * Factories a process using the provided commands and an optional callback. Returns an executor used to run the process. - * - * @param commands The commands for the process - * @param callback Callback called after the process is completed - */ -export declare function createProcess(id: string, commands: Commands, callback?: ProcessCallback): Process; -/** - * Creates a process factory that will create processes with the specified callback decorators applied. - * @param callbackDecorators array of process callback decorators to be used by the return factory. - */ -export declare function createProcessFactoryWith(callbackDecorators: ProcessCallbackDecorator[]): CreateProcess; -/** - * Creates a `ProcessCallbackDecorator` from a `ProcessCallback`. - * @param processCallback the process callback to convert to a decorator. - */ -export declare function createCallbackDecorator(processCallback: ProcessCallback): ProcessCallbackDecorator; diff --git a/deps/framework/stores/process.js b/deps/framework/stores/process.js deleted file mode 100644 index 9c17fa9b9d..0000000000 --- a/deps/framework/stores/process.js +++ /dev/null @@ -1,152 +0,0 @@ -(function (factory) { - if (typeof module === "object" && typeof module.exports === "object") { - var v = factory(require, exports); - if (v !== undefined) module.exports = v; - } - else if (typeof define === "function" && define.amd) { - define(["require", "exports", "tslib", "../shim/Promise", "../shim/Map"], factory); - } -})(function (require, exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - var tslib_1 = require("tslib"); - var Promise_1 = require("../shim/Promise"); - var Map_1 = require("../shim/Map"); - /** - * Creates a command factory with the specified type - */ - function createCommandFactory() { - return function (command) { return command; }; - } - exports.createCommandFactory = createCommandFactory; - var processMap = new Map_1.default(); - function getProcess(id) { - return processMap.get(id); - } - exports.getProcess = getProcess; - function processExecutor(id, commands, store, callback, transformer) { - var _this = this; - var apply = store.apply, get = store.get, path = store.path, at = store.at; - function executor(process, payload, transformer) { - return process(store)(payload); - } - return function (executorPayload) { return tslib_1.__awaiter(_this, void 0, void 0, function () { - var operations, commandsCopy, undoOperations, command, error, payload, results, result, i, e_1; - return tslib_1.__generator(this, function (_a) { - switch (_a.label) { - case 0: - operations = []; - commandsCopy = tslib_1.__spread(commands); - undoOperations = []; - command = commandsCopy.shift(); - error = null; - payload = transformer ? transformer(executorPayload) : executorPayload; - _a.label = 1; - case 1: - _a.trys.push([1, 9, , 10]); - _a.label = 2; - case 2: - if (!command) return [3 /*break*/, 8]; - results = []; - if (!Array.isArray(command)) return [3 /*break*/, 4]; - results = command.map(function (commandFunction) { return commandFunction({ at: at, get: get, path: path, payload: payload }); }); - return [4 /*yield*/, Promise.all(results)]; - case 3: - results = _a.sent(); - return [3 /*break*/, 7]; - case 4: - result = command({ at: at, get: get, path: path, payload: payload }); - if (!Promise_1.isThenable(result)) return [3 /*break*/, 6]; - return [4 /*yield*/, result]; - case 5: - result = _a.sent(); - _a.label = 6; - case 6: - results = [result]; - _a.label = 7; - case 7: - for (i = 0; i < results.length; i++) { - operations.push.apply(operations, tslib_1.__spread(results[i])); - undoOperations = tslib_1.__spread(apply(results[i]), undoOperations); - } - store.invalidate(); - command = commandsCopy.shift(); - return [3 /*break*/, 2]; - case 8: return [3 /*break*/, 10]; - case 9: - e_1 = _a.sent(); - error = { error: e_1, command: command }; - return [3 /*break*/, 10]; - case 10: - callback && - callback(error, { - undoOperations: undoOperations, - store: store, - id: id, - operations: operations, - apply: apply, - at: at, - get: get, - path: path, - executor: executor, - payload: payload - }); - return [2 /*return*/, Promise.resolve({ - store: store, - undoOperations: undoOperations, - id: id, - error: error, - operations: operations, - apply: apply, - at: at, - get: get, - path: path, - executor: executor, - payload: payload - })]; - } - }); - }); }; - } - exports.processExecutor = processExecutor; - /** - * Factories a process using the provided commands and an optional callback. Returns an executor used to run the process. - * - * @param commands The commands for the process - * @param callback Callback called after the process is completed - */ - function createProcess(id, commands, callback) { - processMap.set(id, [id, commands, callback]); - return function (store, transformer) { - return processExecutor(id, commands, store, callback, transformer); - }; - } - exports.createProcess = createProcess; - /** - * Creates a process factory that will create processes with the specified callback decorators applied. - * @param callbackDecorators array of process callback decorators to be used by the return factory. - */ - function createProcessFactoryWith(callbackDecorators) { - return function (id, commands, callback) { - var decoratedCallback = callbackDecorators.reduce(function (callback, callbackDecorator) { - return callbackDecorator(callback); - }, callback); - return createProcess(id, commands, decoratedCallback); - }; - } - exports.createProcessFactoryWith = createProcessFactoryWith; - /** - * Creates a `ProcessCallbackDecorator` from a `ProcessCallback`. - * @param processCallback the process callback to convert to a decorator. - */ - function createCallbackDecorator(processCallback) { - return function (previousCallback) { - return function (error, result) { - processCallback(error, result); - previousCallback && previousCallback(error, result); - }; - }; - } - exports.createCallbackDecorator = createCallbackDecorator; -}); -//# sourceMappingURL=process.js.map \ No newline at end of file diff --git a/deps/framework/stores/process.js.map b/deps/framework/stores/process.js.map deleted file mode 100644 index 0096d5c27c..0000000000 --- a/deps/framework/stores/process.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"process.js","sourceRoot":"","sources":["process.ts"],"names":[],"mappings":";;;;;;;;;;;;IAAA,2CAA6C;IAG7C,mCAA8B;IAgH9B;;OAEG;IACH;QACC,MAAM,CAAC,UAAuB,OAAsB,IAAK,OAAA,OAAO,EAAP,CAAO,CAAC;IAClE,CAAC;IAFD,oDAEC;IAOD,IAAM,UAAU,GAAG,IAAI,aAAG,EAAE,CAAC;IAE7B,oBAA2B,EAAU;QACpC,MAAM,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IAC3B,CAAC;IAFD,gCAEC;IAED,yBACC,EAAU,EACV,QAAwB,EACxB,KAAe,EACf,QAAqC,EACrC,WAAuC;QALxC,iBA4EC;QArEQ,IAAA,mBAAK,EAAE,eAAG,EAAE,iBAAI,EAAE,aAAE,CAAW;QACvC,kBACC,OAAgB,EAChB,OAAY,EACZ,WAAyB;YAEzB,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,CAAC;QAChC,CAAC;QAED,M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AAC,UAAC,QAAQ,EAAE,iBAAiB;gBAC/E,MAAM,CAAC,iBAAiB,CAAC,QAAQ,CAAC,CAAC;YACpC,CAAC,EAAE,QAAQ,CAAC,CAAC;YACb,MAAM,CAAC,aAAa,CAAC,EAAE,EAAE,QAAQ,EAAE,iBAAiB,CAAC,CAAC;QACvD,CAAC,CAAC;IACH,CAAC;IAPD,4DAOC;IAED;;;OAGG;IACH,iCAAwC,eAAgC;QACvE,MAAM,CAAC,UAAC,gBAAkC;YACzC,MAAM,CAAC,UAAC,KAA0B,EAAE,MAAqB;gBACxD,eAAe,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;gBAC/B,gBAAgB,IAAI,gBAAgB,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;YACrD,CAAC,CAAC;QACH,CAAC,CAAC;IACH,CAAC;IAPD,0DAOC","sourcesContent":["import { isThenable } from '../shim/Promise';\nimport { PatchOperation } from './state/Patch';\nimport { State, Store } from './Store';\nimport Map from '../shim/Map';\n\n/**\n * Default Payload interface\n */\nexport interface DefaultPayload {\n\t[index: string]: any;\n}\n\n/**\n * The arguments passed to a `Command`\n */\nexport interface CommandRequest extends State {\n\tpayload: P;\n}\n\n/**\n * A command factory interface. Returns the passed command. This provides a way to automatically infer and/or\n * verify the type of multiple commands without explicitly specifying the generic for each command\n */\nexport interface CommandFactory {\n\t(command: Command): Command;\n}\n\n/**\n * Command that returns patch operations based on the command request\n */\nexport interface Command {\n\t(request: CommandRequest): Promise[]> | PatchOperation[];\n}\n\n/**\n * Transformer function\n */\nexport interface Transformer

{\n\t(payload: R): P;\n}\n\n/**\n * A process that returns an executor using a Store and Transformer\n */\nexport interface Process {\n\t(store: Store, transformer: Transformer): ProcessExecutor;\n\t(store: Store): ProcessExecutor;\n}\n\n/**\n * Represents an error from a ProcessExecutor\n */\nexport interface ProcessError {\n\terror: Error | null;\n\tcommand?: Command[] | Command;\n}\n\nexport interface ProcessResultExecutor {\n\t

(\n\t\tprocess: Process,\n\t\tpayload: R,\n\t\ttransformer: Transformer\n\t): Promise | ProcessError>;\n\t

(process: Process, payload: P): Promise | ProcessError>;\n}\n\n/**\n * Represents a successful result from a ProcessExecutor\n */\nexport interface ProcessResult extends State {\n\texecutor: ProcessResultExecutor;\n\tstore: Store;\n\toperations: PatchOperation[];\n\tundoOperations: PatchOperation[];\n\tapply: (operations: PatchOperation[], invalidate?: boolean) => PatchOperation[];\n\tpayload: P;\n\tid: string;\n\terror?: ProcessError | null;\n}\n\n/**\n * Runs a process for the given arguments.\n */\nexport interface ProcessExecutor {\n\t(payload: R): Promise>;\n}\n\n/**\n * Callback for a process, returns an error as the first argument\n */\nexport interface ProcessCallback {\n\t(error: ProcessError | null, result: ProcessResult): void;\n}\n\n/**\n * Function for undoing operations\n */\nexport interface Undo {\n\t(): void;\n}\n\n/**\n * ProcessCallbackDecorator callback\n */\nexport interface ProcessCallbackDecorator {\n\t(callback?: ProcessCallback): ProcessCallback;\n}\n\n/**\n * CreateProcess factory interface\n */\nexport interface CreateProcess {\n\t(id: string, commands: (Command[] | Command)[], callback?: ProcessCallback): Process;\n}\n\n/**\n * Creates a command factory with the specified type\n */\nexport function createCommandFactory(): CommandFactory {\n\treturn (command: Command) => command;\n}\n\n/**\n * Commands that can be passed to a process\n */\nexport type Commands = (Command[] | Command)[];\n\nconst processMap = new Map();\n\nexport function getProcess(id: string) {\n\treturn processMap.get(id);\n}\n\nexport function processExecutor(\n\tid: string,\n\tcommands: Commands,\n\tstore: Store,\n\tcallback: ProcessCallback | undefined,\n\ttransformer: Transformer

| undefined\n): ProcessExecutor {\n\tconst { apply, get, path, at } = store;\n\tfunction executor(\n\t\tprocess: Process,\n\t\tpayload: any,\n\t\ttransformer?: Transformer\n\t): Promise {\n\t\treturn process(store)(payload);\n\t}\n\n\treturn async (executorPayload: P): Promise> => {\n\t\tconst operations: PatchOperation[] = [];\n\t\tconst commandsCopy = [...commands];\n\t\tlet undoOperations: PatchOperation[] = [];\n\t\tlet command = commandsCopy.shift();\n\t\tlet error: ProcessError | null = null;\n\t\tconst payload = transformer ? transformer(executorPayload) : executorPayload;\n\t\ttry {\n\t\t\twhile (command) {\n\t\t\t\tlet results = [];\n\t\t\t\tif (Array.isArray(command)) {\n\t\t\t\t\tresults = command.map((commandFunction) => commandFunction({ at, get, path, payload }));\n\t\t\t\t\tresults = await Promise.all(results);\n\t\t\t\t} else {\n\t\t\t\t\tlet result = command({ at, get, path, payload });\n\t\t\t\t\tif (isThenable(result)) {\n\t\t\t\t\t\tresult = await result;\n\t\t\t\t\t}\n\t\t\t\t\tresults = [result];\n\t\t\t\t}\n\n\t\t\t\tfor (let i = 0; i < results.length; i++) {\n\t\t\t\t\toperations.push(...results[i]);\n\t\t\t\t\tundoOperations = [...apply(results[i]), ...undoOperations];\n\t\t\t\t}\n\n\t\t\t\tstore.invalidate();\n\t\t\t\tcommand = commandsCopy.shift();\n\t\t\t}\n\t\t} catch (e) {\n\t\t\terror = { error: e, command };\n\t\t}\n\n\t\tcallback &&\n\t\t\tcallback(error, {\n\t\t\t\tundoOperations,\n\t\t\t\tstore,\n\t\t\t\tid,\n\t\t\t\toperations,\n\t\t\t\tapply,\n\t\t\t\tat,\n\t\t\t\tget,\n\t\t\t\tpath,\n\t\t\t\texecutor,\n\t\t\t\tpayload\n\t\t\t});\n\t\treturn Promise.resolve({\n\t\t\tstore,\n\t\t\tundoOperations,\n\t\t\tid,\n\t\t\terror,\n\t\t\toperations,\n\t\t\tapply,\n\t\t\tat,\n\t\t\tget,\n\t\t\tpath,\n\t\t\texecutor,\n\t\t\tpayload\n\t\t});\n\t};\n}\n/**\n * Factories a process using the provided commands and an optional callback. Returns an executor used to run the process.\n *\n * @param commands The commands for the process\n * @param callback Callback called after the process is completed\n */\nexport function createProcess(\n\tid: string,\n\tcommands: Commands,\n\tcallback?: ProcessCallback\n): Process {\n\tprocessMap.set(id, [id, commands, callback]);\n\treturn (store: Store, transformer?: Transformer

) =>\n\t\tprocessExecutor(id, commands, store, callback, transformer);\n}\n\n/**\n * Creates a process factory that will create processes with the specified callback decorators applied.\n * @param callbackDecorators array of process callback decorators to be used by the return factory.\n */\nexport function createProcessFactoryWith(callbackDecorators: ProcessCallbackDecorator[]): CreateProcess {\n\treturn (id: string, commands: (Command[] | Command)[], callback?: ProcessCallback): Process => {\n\t\tconst decoratedCallback = callbackDecorators.reduce((callback, callbackDecorator) => {\n\t\t\treturn callbackDecorator(callback);\n\t\t}, callback);\n\t\treturn createProcess(id, commands, decoratedCallback);\n\t};\n}\n\n/**\n * Creates a `ProcessCallbackDecorator` from a `ProcessCallback`.\n * @param processCallback the process callback to convert to a decorator.\n */\nexport function createCallbackDecorator(processCallback: ProcessCallback): ProcessCallbackDecorator {\n\treturn (previousCallback?: ProcessCallback): ProcessCallback => {\n\t\treturn (error: ProcessError | null, result: ProcessResult): void => {\n\t\t\tprocessCallback(error, result);\n\t\t\tpreviousCallback && previousCallback(error, result);\n\t\t};\n\t};\n}\n"]} \ No newline at end of file diff --git a/deps/framework/stores/process.mjs b/deps/framework/stores/process.mjs deleted file mode 100644 index 2d55673ac4..0000000000 --- a/deps/framework/stores/process.mjs +++ /dev/null @@ -1,113 +0,0 @@ -import * as tslib_1 from "tslib"; -import { isThenable } from '../shim/Promise'; -import Map from '../shim/Map'; -/** - * Creates a command factory with the specified type - */ -export function createCommandFactory() { - return (command) => command; -} -const processMap = new Map(); -export function getProcess(id) { - return processMap.get(id); -} -export function processExecutor(id, commands, store, callback, transformer) { - const { apply, get, path, at } = store; - function executor(process, payload, transformer) { - return process(store)(payload); - } - return (executorPayload) => tslib_1.__awaiter(this, void 0, void 0, function* () { - const operations = []; - const commandsCopy = [...commands]; - let undoOperations = []; - let command = commandsCopy.shift(); - let error = null; - const payload = transformer ? transformer(executorPayload) : executorPayload; - try { - while (command) { - let results = []; - if (Array.isArray(command)) { - results = command.map((commandFunction) => commandFunction({ at, get, path, payload })); - results = yield Promise.all(results); - } - else { - let result = command({ at, get, path, payload }); - if (isThenable(result)) { - result = yield result; - } - results = [result]; - } - for (let i = 0; i < results.length; i++) { - operations.push(...results[i]); - undoOperations = [...apply(results[i]), ...undoOperations]; - } - store.invalidate(); - command = commandsCopy.shift(); - } - } - catch (e) { - error = { error: e, command }; - } - callback && - callback(error, { - undoOperations, - store, - id, - operations, - apply, - at, - get, - path, - executor, - payload - }); - return Promise.resolve({ - store, - undoOperations, - id, - error, - operations, - apply, - at, - get, - path, - executor, - payload - }); - }); -} -/** - * Factories a process using the provided commands and an optional callback. Returns an executor used to run the process. - * - * @param commands The commands for the process - * @param callback Callback called after the process is completed - */ -export function createProcess(id, commands, callback) { - processMap.set(id, [id, commands, callback]); - return (store, transformer) => processExecutor(id, commands, store, callback, transformer); -} -/** - * Creates a process factory that will create processes with the specified callback decorators applied. - * @param callbackDecorators array of process callback decorators to be used by the return factory. - */ -export function createProcessFactoryWith(callbackDecorators) { - return (id, commands, callback) => { - const decoratedCallback = callbackDecorators.reduce((callback, callbackDecorator) => { - return callbackDecorator(callback); - }, callback); - return createProcess(id, commands, decoratedCallback); - }; -} -/** - * Creates a `ProcessCallbackDecorator` from a `ProcessCallback`. - * @param processCallback the process callback to convert to a decorator. - */ -export function createCallbackDecorator(processCallback) { - return (previousCallback) => { - return (error, result) => { - processCallback(error, result); - previousCallback && previousCallback(error, result); - }; - }; -} -//# sourceMappingURL=process.mjs.map \ No newline at end of file diff --git a/deps/framework/stores/process.mjs.map b/deps/framework/stores/process.mjs.map deleted file mode 100644 index 3f920512ea..0000000000 --- a/deps/framework/stores/process.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"process.mjs","sourceRoot":"","sources":["process.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAG7C,OAAO,GAAG,MAAM,aAAa,CAAC;AAgH9B;;GAEG;AACH,MAAM;IACL,MAAM,CAAC,CAAuB,OAAsB,EAAE,EAAE,CAAC,OAAO,CAAC;AAClE,CAAC;AAOD,MAAM,UAAU,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U,EACV,QAAwB,EACxB,QAA0B;IAE1B,UAAU,CAAC,GAAG,CAAC,EAAE,EAAE,CAAC,EAAE,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAAC,CAAC;IAC7C,MAAM,CAAC,CAAC,KAAe,EAAE,WAA4B,EAAE,EAAE,CACxD,eAAe,CAAC,EAAE,EAAE,QAAQ,EAAE,KAAK,EAAE,QAAQ,EAAE,WAAW,CAAC,CAAC;AAC9D,CAAC;AAED;;;GAGG;AACH,MAAM,mCAAmC,kBAA8C;IACtF,MAAM,CAAC,CAAC,EAAU,EAAE,QAAiC,EAAE,QAA0B,EAAW,EAAE;QAC7F,MAAM,iBAAiB,GAAG,kBAAkB,CAAC,MAAM,CAAC,CAAC,QAAQ,EAAE,iBAAiB,EAAE,EAAE;YACnF,MAAM,CAAC,iBAAiB,CAAC,QAAQ,CAAC,CAAC;QACpC,CAAC,EAAE,QAAQ,CAAC,CAAC;QACb,MAAM,CAAC,aAAa,CAAC,EAAE,EAAE,QAAQ,EAAE,iBAAiB,CAAC,CAAC;IACvD,CAAC,CAAC;AACH,CAAC;AAED;;;GAGG;AACH,MAAM,kCAAkC,eAAgC;IACvE,MAAM,CAAC,CAAC,gBAAkC,EAAmB,EAAE;QAC9D,MAAM,CAAC,CAAC,KAA0B,EAAE,MAAqB,EAAQ,EAAE;YAClE,eAAe,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;YAC/B,gBAAgB,IAAI,gBAAgB,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;QACrD,CAAC,CAAC;IACH,CAAC,CAAC;AACH,CAAC","sourcesContent":["import { isThenable } from '../shim/Promise';\nimport { PatchOperation } from './state/Patch';\nimport { State, Store } from './Store';\nimport Map from '../shim/Map';\n\n/**\n * Default Payload interface\n */\nexport interface DefaultPayload {\n\t[index: string]: any;\n}\n\n/**\n * The arguments passed to a `Command`\n */\nexport interface CommandRequest extends State {\n\tpayload: P;\n}\n\n/**\n * A command factory interface. Returns the passed command. This provides a way to automatically infer and/or\n * verify the type of multiple commands without explicitly specifying the generic for each command\n */\nexport interface CommandFactory {\n\t(command: Command): Command;\n}\n\n/**\n * Command that returns patch operations based on the command request\n */\nexport interface Command {\n\t(request: CommandRequest): Promise[]> | PatchOperation[];\n}\n\n/**\n * Transformer function\n */\nexport interface Transformer

{\n\t(payload: R): P;\n}\n\n/**\n * A process that returns an executor using a Store and Transformer\n */\nexport interface Process {\n\t(store: Store, transformer: Transformer): ProcessExecutor;\n\t(store: Store): ProcessExecutor;\n}\n\n/**\n * Represents an error from a ProcessExecutor\n */\nexport interface ProcessError {\n\terror: Error | null;\n\tcommand?: Command[] | Command;\n}\n\nexport interface ProcessResultExecutor {\n\t

(\n\t\tprocess: Process,\n\t\tpayload: R,\n\t\ttransformer: Transformer\n\t): Promise | ProcessError>;\n\t

(process: Process, payload: P): Promise | ProcessError>;\n}\n\n/**\n * Represents a successful result from a ProcessExecutor\n */\nexport interface ProcessResult extends State {\n\texecutor: ProcessResultExecutor;\n\tstore: Store;\n\toperations: PatchOperation[];\n\tundoOperations: PatchOperation[];\n\tapply: (operations: PatchOperation[], invalidate?: boolean) => PatchOperation[];\n\tpayload: P;\n\tid: string;\n\terror?: ProcessError | null;\n}\n\n/**\n * Runs a process for the given arguments.\n */\nexport interface ProcessExecutor {\n\t(payload: R): Promise>;\n}\n\n/**\n * Callback for a process, returns an error as the first argument\n */\nexport interface ProcessCallback {\n\t(error: ProcessError | null, result: ProcessResult): void;\n}\n\n/**\n * Function for undoing operations\n */\nexport interface Undo {\n\t(): void;\n}\n\n/**\n * ProcessCallbackDecorator callback\n */\nexport interface ProcessCallbackDecorator {\n\t(callback?: ProcessCallback): ProcessCallback;\n}\n\n/**\n * CreateProcess factory interface\n */\nexport interface CreateProcess {\n\t(id: string, commands: (Command[] | Command)[], callback?: ProcessCallback): Process;\n}\n\n/**\n * Creates a command factory with the specified type\n */\nexport function createCommandFactory(): CommandFactory {\n\treturn (command: Command) => command;\n}\n\n/**\n * Commands that can be passed to a process\n */\nexport type Commands = (Command[] | Command)[];\n\nconst processMap = new Map();\n\nexport function getProcess(id: string) {\n\treturn processMap.get(id);\n}\n\nexport function processExecutor(\n\tid: string,\n\tcommands: Commands,\n\tstore: Store,\n\tcallback: ProcessCallback | undefined,\n\ttransformer: Transformer

| undefined\n): ProcessExecutor {\n\tconst { apply, get, path, at } = store;\n\tfunction executor(\n\t\tprocess: Process,\n\t\tpayload: any,\n\t\ttransformer?: Transformer\n\t): Promise {\n\t\treturn process(store)(payload);\n\t}\n\n\treturn async (executorPayload: P): Promise> => {\n\t\tconst operations: PatchOperation[] = [];\n\t\tconst commandsCopy = [...commands];\n\t\tlet undoOperations: PatchOperation[] = [];\n\t\tlet command = commandsCopy.shift();\n\t\tlet error: ProcessError | null = null;\n\t\tconst payload = transformer ? transformer(executorPayload) : executorPayload;\n\t\ttry {\n\t\t\twhile (command) {\n\t\t\t\tlet results = [];\n\t\t\t\tif (Array.isArray(command)) {\n\t\t\t\t\tresults = command.map((commandFunction) => commandFunction({ at, get, path, payload }));\n\t\t\t\t\tresults = await Promise.all(results);\n\t\t\t\t} else {\n\t\t\t\t\tlet result = command({ at, get, path, payload });\n\t\t\t\t\tif (isThenable(result)) {\n\t\t\t\t\t\tresult = await result;\n\t\t\t\t\t}\n\t\t\t\t\tresults = [result];\n\t\t\t\t}\n\n\t\t\t\tfor (let i = 0; i < results.length; i++) {\n\t\t\t\t\toperations.push(...results[i]);\n\t\t\t\t\tundoOperations = [...apply(results[i]), ...undoOperations];\n\t\t\t\t}\n\n\t\t\t\tstore.invalidate();\n\t\t\t\tcommand = commandsCopy.shift();\n\t\t\t}\n\t\t} catch (e) {\n\t\t\terror = { error: e, command };\n\t\t}\n\n\t\tcallback &&\n\t\t\tcallback(error, {\n\t\t\t\tundoOperations,\n\t\t\t\tstore,\n\t\t\t\tid,\n\t\t\t\toperations,\n\t\t\t\tapply,\n\t\t\t\tat,\n\t\t\t\tget,\n\t\t\t\tpath,\n\t\t\t\texecutor,\n\t\t\t\tpayload\n\t\t\t});\n\t\treturn Promise.resolve({\n\t\t\tstore,\n\t\t\tundoOperations,\n\t\t\tid,\n\t\t\terror,\n\t\t\toperations,\n\t\t\tapply,\n\t\t\tat,\n\t\t\tget,\n\t\t\tpath,\n\t\t\texecutor,\n\t\t\tpayload\n\t\t});\n\t};\n}\n/**\n * Factories a process using the provided commands and an optional callback. Returns an executor used to run the process.\n *\n * @param commands The commands for the process\n * @param callback Callback called after the process is completed\n */\nexport function createProcess(\n\tid: string,\n\tcommands: Commands,\n\tcallback?: ProcessCallback\n): Process {\n\tprocessMap.set(id, [id, commands, callback]);\n\treturn (store: Store, transformer?: Transformer

) =>\n\t\tprocessExecutor(id, commands, store, callback, transformer);\n}\n\n/**\n * Creates a process factory that will create processes with the specified callback decorators applied.\n * @param callbackDecorators array of process callback decorators to be used by the return factory.\n */\nexport function createProcessFactoryWith(callbackDecorators: ProcessCallbackDecorator[]): CreateProcess {\n\treturn (id: string, commands: (Command[] | Command)[], callback?: ProcessCallback): Process => {\n\t\tconst decoratedCallback = callbackDecorators.reduce((callback, callbackDecorator) => {\n\t\t\treturn callbackDecorator(callback);\n\t\t}, callback);\n\t\treturn createProcess(id, commands, decoratedCallback);\n\t};\n}\n\n/**\n * Creates a `ProcessCallbackDecorator` from a `ProcessCallback`.\n * @param processCallback the process callback to convert to a decorator.\n */\nexport function createCallbackDecorator(processCallback: ProcessCallback): ProcessCallbackDecorator {\n\treturn (previousCallback?: ProcessCallback): ProcessCallback => {\n\t\treturn (error: ProcessError | null, result: ProcessResult): void => {\n\t\t\tprocessCallback(error, result);\n\t\t\tpreviousCallback && previousCallback(error, result);\n\t\t};\n\t};\n}\n"]} \ No newline at end of file diff --git a/deps/framework/stores/state/Patch.d.ts b/deps/framework/stores/state/Patch.d.ts deleted file mode 100644 index 64e3e2c86b..0000000000 --- a/deps/framework/stores/state/Patch.d.ts +++ /dev/null @@ -1,38 +0,0 @@ -import { Pointer } from './Pointer'; -export declare enum OperationType { - ADD = "add", - REMOVE = "remove", - REPLACE = "replace", - TEST = "test", -} -export interface BaseOperation { - op: OperationType; - path: Pointer; -} -export interface AddPatchOperation extends BaseOperation { - op: OperationType.ADD; - value: U; -} -export interface RemovePatchOperation extends BaseOperation { - op: OperationType.REMOVE; -} -export interface ReplacePatchOperation extends BaseOperation { - op: OperationType.REPLACE; - value: U; -} -export interface TestPatchOperation extends BaseOperation { - op: OperationType.TEST; - value: U; -} -export declare type PatchOperation = AddPatchOperation | RemovePatchOperation | ReplacePatchOperation | TestPatchOperation; -export interface PatchResult { - object: T; - undoOperations: PatchOperation[]; -} -export declare function isObject(value: any): value is Object; -export declare function isEqual(a: any, b: any): boolean; -export declare class Patch { - private _operations; - constructor(operations: PatchOperation | PatchOperation[]); - apply(object: any): PatchResult; -} diff --git a/deps/framework/stores/state/Patch.js b/deps/framework/stores/state/Patch.js deleted file mode 100644 index 9f6b312d0a..0000000000 --- a/deps/framework/stores/state/Patch.js +++ /dev/null @@ -1,152 +0,0 @@ -(function (factory) { - if (typeof module === "object" && typeof module.exports === "object") { - var v = factory(require, exports); - if (v !== undefined) module.exports = v; - } - else if (typeof define === "function" && define.amd) { - define(["require", "exports", "tslib", "./Pointer"], factory); - } -})(function (require, exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - var tslib_1 = require("tslib"); - var Pointer_1 = require("./Pointer"); - var OperationType; - (function (OperationType) { - OperationType["ADD"] = "add"; - OperationType["REMOVE"] = "remove"; - OperationType["REPLACE"] = "replace"; - OperationType["TEST"] = "test"; - })(OperationType = exports.OperationType || (exports.OperationType = {})); - function add(pointerTarget, value) { - if (Array.isArray(pointerTarget.target)) { - pointerTarget.target.splice(parseInt(pointerTarget.segment, 10), 0, value); - } - else { - pointerTarget.target[pointerTarget.segment] = value; - } - return pointerTarget.object; - } - function replace(pointerTarget, value) { - if (Array.isArray(pointerTarget.target)) { - pointerTarget.target.splice(parseInt(pointerTarget.segment, 10), 1, value); - } - else { - pointerTarget.target[pointerTarget.segment] = value; - } - return pointerTarget.object; - } - function remove(pointerTarget) { - if (Array.isArray(pointerTarget.target)) { - pointerTarget.target.splice(parseInt(pointerTarget.segment, 10), 1); - } - else { - delete pointerTarget.target[pointerTarget.segment]; - } - return pointerTarget.object; - } - function test(pointerTarget, value) { - return isEqual(pointerTarget.target[pointerTarget.segment], value); - } - function isObject(value) { - return Object.prototype.toString.call(value) === '[object Object]'; - } - exports.isObject = isObject; - function isEqual(a, b) { - if (Array.isArray(a) && Array.isArray(b)) { - return a.length === b.length && a.every(function (element, i) { return isEqual(element, b[i]); }); - } - else if (isObject(a) && isObject(b)) { - var keysForA = Object.keys(a).sort(); - var keysForB = Object.keys(b).sort(); - return isEqual(keysForA, keysForB) && keysForA.every(function (key) { return isEqual(a[key], b[key]); }); - } - else { - return a === b; - } - } - exports.isEqual = isEqual; - function inverse(operation, state) { - if (operation.op === OperationType.ADD) { - var op = { - op: OperationType.REMOVE, - path: operation.path - }; - var test_1 = { - op: OperationType.TEST, - path: operation.path, - value: operation.value - }; - return [test_1, op]; - } - else if (operation.op === OperationType.REPLACE) { - var value = operation.path.get(state); - var op = void 0; - if (value === undefined) { - op = { - op: OperationType.REMOVE, - path: operation.path - }; - } - else { - op = { - op: OperationType.REPLACE, - path: operation.path, - value: operation.path.get(state) - }; - } - var test_2 = { - op: OperationType.TEST, - path: operation.path, - value: operation.value - }; - return [test_2, op]; - } - else { - return [ - { - op: OperationType.ADD, - path: operation.path, - value: operation.path.get(state) - } - ]; - } - } - var Patch = /** @class */ (function () { - function Patch(operations) { - this._operations = Array.isArray(operations) ? operations : [operations]; - } - Patch.prototype.apply = function (object) { - var undoOperations = []; - var patchedObject = this._operations.reduce(function (patchedObject, next) { - var object; - var pointerTarget = Pointer_1.walk(next.path.segments, patchedObject); - switch (next.op) { - case OperationType.ADD: - object = add(pointerTarget, next.value); - break; - case OperationType.REPLACE: - object = replace(pointerTarget, next.value); - break; - case OperationType.REMOVE: - object = remove(pointerTarget); - break; - case OperationType.TEST: - var result = test(pointerTarget, next.value); - if (!result) { - throw new Error('Test operation failure. Unable to apply any operations.'); - } - return patchedObject; - default: - throw new Error('Unknown operation'); - } - undoOperations = tslib_1.__spread(inverse(next, patchedObject), undoOperations); - return object; - }, object); - return { object: patchedObject, undoOperations: undoOperations }; - }; - return Patch; - }()); - exports.Patch = Patch; -}); -//# sourceMappingURL=Patch.js.map \ No newline at end of file diff --git a/deps/framework/stores/state/Patch.js.map b/deps/framework/stores/state/Patch.js.map deleted file mode 100644 index f6a4068cff..0000000000 --- a/deps/framework/stores/state/Patch.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"Patch.js","sourceRoot":"","sources":["Patch.ts"],"names":[],"mappings":";;;;;;;;;;;;IAAA,qCAAyD;IAEzD,IAAY,aAKX;IALD,WAAY,aAAa;QACxB,4BAAW,CAAA;QACX,kCAAiB,CAAA;QACjB,oCAAmB,CAAA;QACnB,8BAAa,CAAA;IACd,CAAC,EALW,aAAa,GAAb,qBAAa,KAAb,qBAAa,QAKxB;IAqCD,aAAa,aAA4B,EAAE,KAAU;QACpD,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;YACzC,aAAa,CAAC,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,aAAa,CAAC,OAAO,EAAE,EAAE,CAAC,EAAE,CAAC,EAAE,KAAK,CAAC,CAAC;QAC5E,CAAC;QAAC,IAAI,CAAC,CAAC;YACP,aAAa,CAAC,MAAM,CAAC,aAAa,CAAC,OAAO,CAAC,GAAG,KAAK,CAAC;QACrD,CAAC;QACD,MAAM,CAAC,aAAa,CAAC,MAAM,CAAC;IAC7B,CAAC;IAED,iBAAiB,aAA4B,EAAE,KAAU;QACxD,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;YACzC,aAAa,CAAC,MAAM,CAAC,MAAM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= 'add',\n\tREMOVE = 'remove',\n\tREPLACE = 'replace',\n\tTEST = 'test'\n}\n\nexport interface BaseOperation {\n\top: OperationType;\n\tpath: Pointer;\n}\n\nexport interface AddPatchOperation extends BaseOperation {\n\top: OperationType.ADD;\n\tvalue: U;\n}\n\nexport interface RemovePatchOperation extends BaseOperation {\n\top: OperationType.REMOVE;\n}\n\nexport interface ReplacePatchOperation extends BaseOperation {\n\top: OperationType.REPLACE;\n\tvalue: U;\n}\n\nexport interface TestPatchOperation extends BaseOperation {\n\top: OperationType.TEST;\n\tvalue: U;\n}\n\nexport type PatchOperation =\n\t| AddPatchOperation\n\t| RemovePatchOperation\n\t| ReplacePatchOperation\n\t| TestPatchOperation;\n\nexport interface PatchResult {\n\tobject: T;\n\tundoOperations: PatchOperation[];\n}\n\nfunction add(pointerTarget: PointerTarget, value: any): any {\n\tif (Array.isArray(pointerTarget.target)) {\n\t\tpointerTarget.target.splice(parseInt(pointerTarget.segment, 10), 0, value);\n\t} else {\n\t\tpointerTarget.target[pointerTarget.segment] = value;\n\t}\n\treturn pointerTarget.object;\n}\n\nfunction replace(pointerTarget: PointerTarget, value: any): any {\n\tif (Array.isArray(pointerTarget.target)) {\n\t\tpointerTarget.target.splice(parseInt(pointerTarget.segment, 10), 1, value);\n\t} else {\n\t\tpointerTarget.target[pointerTarget.segment] = value;\n\t}\n\treturn pointerTarget.object;\n}\n\nfunction remove(pointerTarget: PointerTarget): any {\n\tif (Array.isArray(pointerTarget.target)) {\n\t\tpointerTarget.target.splice(parseInt(pointerTarget.segment, 10), 1);\n\t} else {\n\t\tdelete pointerTarget.target[pointerTarget.segment];\n\t}\n\treturn pointerTarget.object;\n}\n\nfunction test(pointerTarget: PointerTarget, value: any) {\n\treturn isEqual(pointerTarget.target[pointerTarget.segment], value);\n}\n\nexport function isObject(value: any): value is Object {\n\treturn Object.prototype.toString.call(value) === '[object Object]';\n}\n\nexport function isEqual(a: any, b: any): boolean {\n\tif (Array.isArray(a) && Array.isArray(b)) {\n\t\treturn a.length === b.length && a.every((element: any, i: number) => isEqual(element, b[i]));\n\t} else if (isObject(a) && isObject(b)) {\n\t\tconst keysForA = Object.keys(a).sort();\n\t\tconst keysForB = Object.keys(b).sort();\n\t\treturn isEqual(keysForA, keysForB) && keysForA.every((key) => isEqual(a[key], b[key]));\n\t} else {\n\t\treturn a === b;\n\t}\n}\n\nfunction inverse(operation: PatchOperation, state: any): PatchOperation[] {\n\tif (operation.op === OperationType.ADD) {\n\t\tconst op: RemovePatchOperation = {\n\t\t\top: OperationType.REMOVE,\n\t\t\tpath: operation.path\n\t\t};\n\t\tconst test: TestPatchOperation = {\n\t\t\top: OperationType.TEST,\n\t\t\tpath: operation.path,\n\t\t\tvalue: operation.value\n\t\t};\n\t\treturn [test, op];\n\t} else if (operation.op === OperationType.REPLACE) {\n\t\tconst value = operation.path.get(state);\n\t\tlet op: RemovePatchOperation | ReplacePatchOperation;\n\t\tif (value === undefined) {\n\t\t\top = {\n\t\t\t\top: OperationType.REMOVE,\n\t\t\t\tpath: operation.path\n\t\t\t};\n\t\t} else {\n\t\t\top = {\n\t\t\t\top: OperationType.REPLACE,\n\t\t\t\tpath: operation.path,\n\t\t\t\tvalue: operation.path.get(state)\n\t\t\t};\n\t\t}\n\t\tconst test: TestPatchOperation = {\n\t\t\top: OperationType.TEST,\n\t\t\tpath: operation.path,\n\t\t\tvalue: operation.value\n\t\t};\n\t\treturn [test, op];\n\t} else {\n\t\treturn [\n\t\t\t{\n\t\t\t\top: OperationType.ADD,\n\t\t\t\tpath: operation.path,\n\t\t\t\tvalue: operation.path.get(state)\n\t\t\t}\n\t\t];\n\t}\n}\n\nexport class Patch {\n\tprivate _operations: PatchOperation[];\n\n\tconstructor(operations: PatchOperation | PatchOperation[]) {\n\t\tthis._operations = Array.isArray(operations) ? operations : [operations];\n\t}\n\n\tpublic apply(object: any): PatchResult {\n\t\tlet undoOperations: PatchOperation[] = [];\n\t\tconst patchedObject = this._operations.reduce((patchedObject, next) => {\n\t\t\tlet object;\n\t\t\tconst pointerTarget = walk(next.path.segments, patchedObject);\n\t\t\tswitch (next.op) {\n\t\t\t\tcase OperationType.ADD:\n\t\t\t\t\tobject = add(pointerTarget, next.value);\n\t\t\t\t\tbreak;\n\t\t\t\tcase OperationType.REPLACE:\n\t\t\t\t\tobject = replace(pointerTarget, next.value);\n\t\t\t\t\tbreak;\n\t\t\t\tcase OperationType.REMOVE:\n\t\t\t\t\tobject = remove(pointerTarget);\n\t\t\t\t\tbreak;\n\t\t\t\tcase OperationType.TEST:\n\t\t\t\t\tconst result = test(pointerTarget, next.value);\n\t\t\t\t\tif (!result) {\n\t\t\t\t\t\tthrow new Error('Test operation failure. Unable to apply any operations.');\n\t\t\t\t\t}\n\t\t\t\t\treturn patchedObject;\n\t\t\t\tdefault:\n\t\t\t\t\tthrow new Error('Unknown operation');\n\t\t\t}\n\t\t\tundoOperations = [...inverse(next, patchedObject), ...undoOperations];\n\t\t\treturn object;\n\t\t}, object);\n\t\treturn { object: patchedObject, undoOperations };\n\t}\n}\n"]} \ No newline at end of file diff --git a/deps/framework/stores/state/Patch.mjs b/deps/framework/stores/state/Patch.mjs deleted file mode 100644 index ca05dc5119..0000000000 --- a/deps/framework/stores/state/Patch.mjs +++ /dev/null @@ -1,135 +0,0 @@ -import { walk } from './Pointer'; -export var OperationType; -(function (OperationType) { - OperationType["ADD"] = "add"; - OperationType["REMOVE"] = "remove"; - OperationType["REPLACE"] = "replace"; - OperationType["TEST"] = "test"; -})(OperationType || (OperationType = {})); -function add(pointerTarget, value) { - if (Array.isArray(pointerTarget.target)) { - pointerTarget.target.splice(parseInt(pointerTarget.segment, 10), 0, value); - } - else { - pointerTarget.target[pointerTarget.segment] = value; - } - return pointerTarget.object; -} -function replace(pointerTarget, value) { - if (Array.isArray(pointerTarget.target)) { - pointerTarget.target.splice(parseInt(pointerTarget.segment, 10), 1, value); - } - else { - pointerTarget.target[pointerTarget.segment] = value; - } - return pointerTarget.object; -} -function remove(pointerTarget) { - if (Array.isArray(pointerTarget.target)) { - pointerTarget.target.splice(parseInt(pointerTarget.segment, 10), 1); - } - else { - delete pointerTarget.target[pointerTarget.segment]; - } - return pointerTarget.object; -} -function test(pointerTarget, value) { - return isEqual(pointerTarget.target[pointerTarget.segment], value); -} -export function isObject(value) { - return Object.prototype.toString.call(value) === '[object Object]'; -} -export function isEqual(a, b) { - if (Array.isArray(a) && Array.isArray(b)) { - return a.length === b.length && a.every((element, i) => isEqual(element, b[i])); - } - else if (isObject(a) && isObject(b)) { - const keysForA = Object.keys(a).sort(); - const keysForB = Object.keys(b).sort(); - return isEqual(keysForA, keysForB) && keysForA.every((key) => isEqual(a[key], b[key])); - } - else { - return a === b; - } -} -function inverse(operation, state) { - if (operation.op === OperationType.ADD) { - const op = { - op: OperationType.REMOVE, - path: operation.path - }; - const test = { - op: OperationType.TEST, - path: operation.path, - value: operation.value - }; - return [test, op]; - } - else if (operation.op === OperationType.REPLACE) { - const value = operation.path.get(state); - let op; - if (value === undefined) { - op = { - op: OperationType.REMOVE, - path: operation.path - }; - } - else { - op = { - op: OperationType.REPLACE, - path: operation.path, - value: operation.path.get(state) - }; - } - const test = { - op: OperationType.TEST, - path: operation.path, - value: operation.value - }; - return [test, op]; - } - else { - return [ - { - op: OperationType.ADD, - path: operation.path, - value: operation.path.get(state) - } - ]; - } -} -export class Patch { - constructor(operations) { - this._operations = Array.isArray(operations) ? operations : [operations]; - } - apply(object) { - let undoOperations = []; - const patchedObject = this._operations.reduce((patchedObject, next) => { - let object; - const pointerTarget = walk(next.path.segments, patchedObject); - switch (next.op) { - case OperationType.ADD: - object = add(pointerTarget, next.value); - break; - case OperationType.REPLACE: - object = replace(pointerTarget, next.value); - break; - case OperationType.REMOVE: - object = remove(pointerTarget); - break; - case OperationType.TEST: - const result = test(pointerTarget, next.value); - if (!result) { - throw new Error('Test operation failure. Unable to apply any operations.'); - } - return patchedObject; - default: - throw new Error('Unknown operation'); - } - undoOperations = [...inverse(next, patchedObject), ...undoOperations]; - return object; - }, object); - return { object: patchedObject, undoOperations }; - } -} -//# sourceMappingURL=Patch.mjs.map \ No newline at end of file diff --git a/deps/framework/stores/state/Patch.mjs.map b/deps/framework/stores/state/Patch.mjs.map deleted file mode 100644 index e515c753c4..0000000000 --- a/deps/framework/stores/state/Patch.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"Patch.mjs","sourceRoot":"","sources":["Patch.ts"],"names":[],"mappings":"AAAA,OAAO,EAAW,IAAI,EAAiB,MAAM,WAAW,CAAC;AAEzD,MAAM,CAAN,IAAY,aAKX;AALD,WAAY,aAAa;IACxB,4BAAW,CAAA;IACX,kCAAiB,CAAA;IACjB,oCAAmB,CAAA;IACnB,8BAAa,CAAA;AACd,CAAC,EALW,aAAa,KAAb,aAAa,QAKxB;AAqCD,aAAa,aAA4B,EAAE,KAAU;IACpD,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;QACzC,aAAa,CAAC,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,aAAa,CAAC,OAAO,EAAE,EAAE,CAAC,EAAE,CAAC,EAAE,KAAK,CAAC,CAAC;IAC5E,CAAC;IAAC,IAAI,CAAC,CAAC;QACP,aAAa,CAAC,MAAM,CAAC,aAAa,CAAC,OAAO,CAAC,GAAG,KAAK,CAAC;IACrD,CAAC;IACD,MAAM,CAAC,aAAa,CAAC,MAAM,CAAC;AAC7B,CAAC;AAED,iBAAiB,aAA4B,EAAE,KAAU;IACxD,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;QACzC,aAAa,CAAC,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,aAAa,CAAC,OAAO,EAAE,EAAE,CAAC,EAAE,CAAC,EAAE,KAAK,CAAC,CAAC;IAC5E,CAAC;IAAC,IAAI,CAAC,CAAC;QACP,aAAa,CAAC,MAAM,CAAC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CAAC;gBACjB,KAAK,aAAa,CAAC,GAAG;oBACrB,MAAM,GAAG,GAAG,CAAC,aAAa,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC;oBACxC,KAAK,CAAC;gBACP,KAAK,aAAa,CAAC,OAAO;oBACzB,MAAM,GAAG,OAAO,CAAC,aAAa,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC;oBAC5C,KAAK,CAAC;gBACP,KAAK,aAAa,CAAC,MAAM;oBACxB,MAAM,GAAG,MAAM,CAAC,aAAa,CAAC,CAAC;oBAC/B,KAAK,CAAC;gBACP,KAAK,aAAa,CAAC,IAAI;oBACtB,MAAM,MAAM,GAAG,IAAI,CAAC,aAAa,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC;oBAC/C,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC;wBACb,MAAM,IAAI,KAAK,CAAC,yDAAyD,CAAC,CAAC;oBAC5E,CAAC;oBACD,MAAM,CAAC,aAAa,CAAC;gBACtB;oBACC,MAAM,IAAI,KAAK,CAAC,mBAAmB,CAAC,CAAC;YACvC,CAAC;YACD,cAAc,GAAG,CAAC,GAAG,OAAO,CAAC,IAAI,EAAE,aAAa,CAAC,EAAE,GAAG,cAAc,CAAC,CAAC;YACtE,MAAM,CAAC,MAAM,CAAC;QACf,CAAC,EAAE,MAAM,CAAC,CAAC;QACX,MAAM,CAAC,EAAE,MAAM,EAAE,aAAa,EAAE,cAAc,EAAE,CAAC;IAClD,CAAC;CACD","sourcesContent":["import { Pointer, walk, PointerTarget } from './Pointer';\n\nexport enum OperationType {\n\tADD = 'add',\n\tREMOVE = 'remove',\n\tREPLACE = 'replace',\n\tTEST = 'test'\n}\n\nexport interface BaseOperation {\n\top: OperationType;\n\tpath: Pointer;\n}\n\nexport interface AddPatchOperation extends BaseOperation {\n\top: OperationType.ADD;\n\tvalue: U;\n}\n\nexport interface RemovePatchOperation extends BaseOperation {\n\top: OperationType.REMOVE;\n}\n\nexport interface ReplacePatchOperation extends BaseOperation {\n\top: OperationType.REPLACE;\n\tvalue: U;\n}\n\nexport interface TestPatchOperation extends BaseOperation {\n\top: OperationType.TEST;\n\tvalue: U;\n}\n\nexport type PatchOperation =\n\t| AddPatchOperation\n\t| RemovePatchOperation\n\t| ReplacePatchOperation\n\t| TestPatchOperation;\n\nexport interface PatchResult {\n\tobject: T;\n\tundoOperations: PatchOperation[];\n}\n\nfunction add(pointerTarget: PointerTarget, value: any): any {\n\tif (Array.isArray(pointerTarget.target)) {\n\t\tpointerTarget.target.splice(parseInt(pointerTarget.segment, 10), 0, value);\n\t} else {\n\t\tpointerTarget.target[pointerTarget.segment] = value;\n\t}\n\treturn pointerTarget.object;\n}\n\nfunction replace(pointerTarget: PointerTarget, value: any): any {\n\tif (Array.isArray(pointerTarget.target)) {\n\t\tpointerTarget.target.splice(parseInt(pointerTarget.segment, 10), 1, value);\n\t} else {\n\t\tpointerTarget.target[pointerTarget.segment] = value;\n\t}\n\treturn pointerTarget.object;\n}\n\nfunction remove(pointerTarget: PointerTarget): any {\n\tif (Array.isArray(pointerTarget.target)) {\n\t\tpointerTarget.target.splice(parseInt(pointerTarget.segment, 10), 1);\n\t} else {\n\t\tdelete pointerTarget.target[pointerTarget.segment];\n\t}\n\treturn pointerTarget.object;\n}\n\nfunction test(pointerTarget: PointerTarget, value: any) {\n\treturn isEqual(pointerTarget.target[pointerTarget.segment], value);\n}\n\nexport function isObject(value: any): value is Object {\n\treturn Object.prototype.toString.call(value) === '[object Object]';\n}\n\nexport function isEqual(a: any, b: any): boolean {\n\tif (Array.isArray(a) && Array.isArray(b)) {\n\t\treturn a.length === b.length && a.every((element: any, i: number) => isEqual(element, b[i]));\n\t} else if (isObject(a) && isObject(b)) {\n\t\tconst keysForA = Object.keys(a).sort();\n\t\tconst keysForB = Object.keys(b).sort();\n\t\treturn isEqual(keysForA, keysForB) && keysForA.every((key) => isEqual(a[key], b[key]));\n\t} else {\n\t\treturn a === b;\n\t}\n}\n\nfunction inverse(operation: PatchOperation, state: any): PatchOperation[] {\n\tif (operation.op === OperationType.ADD) {\n\t\tconst op: RemovePatchOperation = {\n\t\t\top: OperationType.REMOVE,\n\t\t\tpath: operation.path\n\t\t};\n\t\tconst test: TestPatchOperation = {\n\t\t\top: OperationType.TEST,\n\t\t\tpath: operation.path,\n\t\t\tvalue: operation.value\n\t\t};\n\t\treturn [test, op];\n\t} else if (operation.op === OperationType.REPLACE) {\n\t\tconst value = operation.path.get(state);\n\t\tlet op: RemovePatchOperation | ReplacePatchOperation;\n\t\tif (value === undefined) {\n\t\t\top = {\n\t\t\t\top: OperationType.REMOVE,\n\t\t\t\tpath: operation.path\n\t\t\t};\n\t\t} else {\n\t\t\top = {\n\t\t\t\top: OperationType.REPLACE,\n\t\t\t\tpath: operation.path,\n\t\t\t\tvalue: operation.path.get(state)\n\t\t\t};\n\t\t}\n\t\tconst test: TestPatchOperation = {\n\t\t\top: OperationType.TEST,\n\t\t\tpath: operation.path,\n\t\t\tvalue: operation.value\n\t\t};\n\t\treturn [test, op];\n\t} else {\n\t\treturn [\n\t\t\t{\n\t\t\t\top: OperationType.ADD,\n\t\t\t\tpath: operation.path,\n\t\t\t\tvalue: operation.path.get(state)\n\t\t\t}\n\t\t];\n\t}\n}\n\nexport class Patch {\n\tprivate _operations: PatchOperation[];\n\n\tconstructor(operations: PatchOperation | PatchOperation[]) {\n\t\tthis._operations = Array.isArray(operations) ? operations : [operations];\n\t}\n\n\tpublic apply(object: any): PatchResult {\n\t\tlet undoOperations: PatchOperation[] = [];\n\t\tconst patchedObject = this._operations.reduce((patchedObject, next) => {\n\t\t\tlet object;\n\t\t\tconst pointerTarget = walk(next.path.segments, patchedObject);\n\t\t\tswitch (next.op) {\n\t\t\t\tcase OperationType.ADD:\n\t\t\t\t\tobject = add(pointerTarget, next.value);\n\t\t\t\t\tbreak;\n\t\t\t\tcase OperationType.REPLACE:\n\t\t\t\t\tobject = replace(pointerTarget, next.value);\n\t\t\t\t\tbreak;\n\t\t\t\tcase OperationType.REMOVE:\n\t\t\t\t\tobject = remove(pointerTarget);\n\t\t\t\t\tbreak;\n\t\t\t\tcase OperationType.TEST:\n\t\t\t\t\tconst result = test(pointerTarget, next.value);\n\t\t\t\t\tif (!result) {\n\t\t\t\t\t\tthrow new Error('Test operation failure. Unable to apply any operations.');\n\t\t\t\t\t}\n\t\t\t\t\treturn patchedObject;\n\t\t\t\tdefault:\n\t\t\t\t\tthrow new Error('Unknown operation');\n\t\t\t}\n\t\t\tundoOperations = [...inverse(next, patchedObject), ...undoOperations];\n\t\t\treturn object;\n\t\t}, object);\n\t\treturn { object: patchedObject, undoOperations };\n\t}\n}\n"]} \ No newline at end of file diff --git a/deps/framework/stores/state/Pointer.d.ts b/deps/framework/stores/state/Pointer.d.ts deleted file mode 100644 index bb05331603..0000000000 --- a/deps/framework/stores/state/Pointer.d.ts +++ /dev/null @@ -1,16 +0,0 @@ -export declare function decode(segment: string): string; -export interface PointerTarget { - object: any; - target: any; - segment: string; -} -export declare function walk(segments: string[], object: any, clone?: boolean, continueOnUndefined?: boolean): PointerTarget; -export declare class Pointer { - private readonly _segments; - constructor(segments: string | string[]); - readonly segments: string[]; - readonly path: string; - get(object: T): U; - toJSON(): string; - toString(): string; -} diff --git a/deps/framework/stores/state/Pointer.js b/deps/framework/stores/state/Pointer.js deleted file mode 100644 index a6cb011394..0000000000 --- a/deps/framework/stores/state/Pointer.js +++ /dev/null @@ -1,117 +0,0 @@ -(function (factory) { - if (typeof module === "object" && typeof module.exports === "object") { - var v = factory(require, exports); - if (v !== undefined) module.exports = v; - } - else if (typeof define === "function" && define.amd) { - define(["require", "exports", "tslib"], factory); - } -})(function (require, exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - var tslib_1 = require("tslib"); - function decode(segment) { - return segment.replace(/~1/g, '/').replace(/~0/g, '~'); - } - exports.decode = decode; - function encode(segment) { - return segment.replace(/~/g, '~0').replace(/\//g, '~1'); - } - function walk(segments, object, clone, continueOnUndefined) { - if (clone === void 0) { clone = true; } - if (continueOnUndefined === void 0) { continueOnUndefined = true; } - if (clone) { - object = tslib_1.__assign({}, object); - } - var pointerTarget = { - object: object, - target: object, - segment: '' - }; - return segments.reduce(function (pointerTarget, segment, index) { - if (pointerTarget.target === undefined) { - return pointerTarget; - } - if (Array.isArray(pointerTarget.target) && segment === '-') { - segment = String(pointerTarget.target.length - 1); - } - if (index + 1 < segments.length) { - var nextSegment = segments[index + 1]; - var target = pointerTarget.target[segment]; - if (target === undefined && !continueOnUndefined) { - pointerTarget.target = undefined; - return pointerTarget; - } - if (clone || target === undefined) { - if (Array.isArray(target)) { - target = tslib_1.__spread(target); - } - else if (typeof target === 'object') { - target = tslib_1.__assign({}, target); - } - else if (isNaN(parseInt(nextSegment, 0))) { - target = {}; - } - else { - target = []; - } - pointerTarget.target[segment] = target; - pointerTarget.target = target; - } - else { - pointerTarget.target = target; - } - } - else { - pointerTarget.segment = segment; - } - return pointerTarget; - }, pointerTarget); - } - exports.walk = walk; - var Pointer = /** @class */ (function () { - function Pointer(segments) { - if (Array.isArray(segments)) { - this._segments = segments; - } - else { - this._segments = (segments[0] === '/' ? segments : "/" + segments).split('/'); - this._segments.shift(); - } - if (segments.length === 0 || ((segments.length === 1 && segments[0] === '/') || segments[0] === '')) { - throw new Error('Access to the root is not supported.'); - } - this._segments = this._segments.map(decode); - } - Object.defineProperty(Pointer.prototype, "segments", { - get: function () { - return this._segments; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(Pointer.prototype, "path", { - get: function () { - return "/" + this._segments.map(encode).join('/'); - }, - enumerable: true, - configurable: true - }); - Pointer.prototype.get = function (object) { - var pointerTarget = walk(this.segments, object, false, false); - if (pointerTarget.target === undefined) { - return undefined; - } - return pointerTarget.target[pointerTarget.segment]; - }; - Pointer.prototype.toJSON = function () { - return this.toString(); - }; - Pointer.prototype.toString = function () { - return this.path; - }; - return Pointer; - }()); - exports.Pointer = Pointer; -}); -//# sourceMappingURL=Pointer.js.map \ No newline at end of file diff --git a/deps/framework/stores/state/Pointer.js.map b/deps/framework/stores/state/Pointer.js.map deleted file mode 100644 index 5d589daa07..0000000000 --- a/deps/framework/stores/state/Pointer.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"Pointer.js","sourceRoot":"","sources":["Pointer.ts"],"names":[],"mappings":";;;;;;;;;;;;IAAA,gBAAuB,OAAe;QACrC,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;IACxD,CAAC;IAFD,wBAEC;IAED,gBAAgB,OAAe;QAC9B,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;IACzD,CAAC;IAQD,cAAqB,QAAkB,EAAE,MAAW,EAAE,KAAY,EAAE,mBAA0B;QAAxC,sBAAA,EAAA,YAAY;QAAE,oCAAA,EAAA,0BAA0B;QAC7F,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC;YACX,MAAM,wBAAQ,MAAM,CAAE,CAAC;QACxB,CAAC;QACD,IAAM,aAAa,GAAkB;YACpC,MAAM,QAAA;YACN,MAAM,EAAE,MAAM;YACd,OAAO,EAAE,EAAE;SACX,CAAC;QAEF,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,UAAC,aAAa,EAAE,OAAO,EAAE,KAAK;YACpD,EAAE,CAAC,CAAC,aAAa,CAAC,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC;gBACxC,MAAM,CAAC,aAAa,CAAC;YACtB,CAAC;YACD,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,OAAO,KAAK,GAAG,CAAC,CAAC,CAAC;gBAC5D,OAAO,GAAG,MAAM,CAAC,aAAa,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;YACnD,CAA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AAQ,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC;YAC/E,EAAE,CAAC,CAAC,aAAa,CAAC,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC;gBACxC,MAAM,CAAC,SAAgB,CAAC;YACzB,CAAC;YACD,MAAM,CAAC,aAAa,CAAC,MAAM,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;QACpD,CAAC;QAED,wBAAM,GAAN;YACC,MAAM,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC;QACxB,CAAC;QAED,0BAAQ,GAAR;YACC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC;QAClB,CAAC;QACF,cAAC;IAAD,CAAC,AAvCD,IAuCC;IAvCY,0BAAO","sourcesContent":["export function decode(segment: string) {\n\treturn segment.replace(/~1/g, '/').replace(/~0/g, '~');\n}\n\nfunction encode(segment: string) {\n\treturn segment.replace(/~/g, '~0').replace(/\\//g, '~1');\n}\n\nexport interface PointerTarget {\n\tobject: any;\n\ttarget: any;\n\tsegment: string;\n}\n\nexport function walk(segments: string[], object: any, clone = true, continueOnUndefined = true): PointerTarget {\n\tif (clone) {\n\t\tobject = { ...object };\n\t}\n\tconst pointerTarget: PointerTarget = {\n\t\tobject,\n\t\ttarget: object,\n\t\tsegment: ''\n\t};\n\n\treturn segments.reduce((pointerTarget, segment, index) => {\n\t\tif (pointerTarget.target === undefined) {\n\t\t\treturn pointerTarget;\n\t\t}\n\t\tif (Array.isArray(pointerTarget.target) && segment === '-') {\n\t\t\tsegment = String(pointerTarget.target.length - 1);\n\t\t}\n\t\tif (index + 1 < segments.length) {\n\t\t\tconst nextSegment = segments[index + 1];\n\t\t\tlet target = pointerTarget.target[segment];\n\n\t\t\tif (target === undefined && !continueOnUndefined) {\n\t\t\t\tpointerTarget.target = undefined;\n\t\t\t\treturn pointerTarget;\n\t\t\t}\n\n\t\t\tif (clone || target === undefined) {\n\t\t\t\tif (Array.isArray(target)) {\n\t\t\t\t\ttarget = [...target];\n\t\t\t\t} else if (typeof target === 'object') {\n\t\t\t\t\ttarget = { ...target };\n\t\t\t\t} else if (isNaN(parseInt(nextSegment, 0))) {\n\t\t\t\t\ttarget = {};\n\t\t\t\t} else {\n\t\t\t\t\ttarget = [];\n\t\t\t\t}\n\t\t\t\tpointerTarget.target[segment] = target;\n\t\t\t\tpointerTarget.target = target;\n\t\t\t} else {\n\t\t\t\tpointerTarget.target = target;\n\t\t\t}\n\t\t} else {\n\t\t\tpointerTarget.segment = segment;\n\t\t}\n\t\treturn pointerTarget;\n\t}, pointerTarget);\n}\n\nexport class Pointer {\n\tprivate readonly _segments: string[];\n\n\tconstructor(segments: string | string[]) {\n\t\tif (Array.isArray(segments)) {\n\t\t\tthis._segments = segments;\n\t\t} else {\n\t\t\tthis._segments = (segments[0] === '/' ? segments : `/${segments}`).split('/');\n\t\t\tthis._segments.shift();\n\t\t}\n\t\tif (segments.length === 0 || ((segments.length === 1 && segments[0] === '/') || segments[0] === '')) {\n\t\t\tthrow new Error('Access to the root is not supported.');\n\t\t}\n\t\tthis._segments = this._segments.map(decode);\n\t}\n\n\tpublic get segments(): string[] {\n\t\treturn this._segments;\n\t}\n\n\tpublic get path(): string {\n\t\treturn `/${this._segments.map(encode).join('/')}`;\n\t}\n\n\tget(object: T): U {\n\t\tconst pointerTarget: PointerTarget = walk(this.segments, object, false, false);\n\t\tif (pointerTarget.target === undefined) {\n\t\t\treturn undefined as any;\n\t\t}\n\t\treturn pointerTarget.target[pointerTarget.segment];\n\t}\n\n\ttoJSON(): string {\n\t\treturn this.toString();\n\t}\n\n\ttoString(): string {\n\t\treturn this.path;\n\t}\n}\n"]} \ No newline at end of file diff --git a/deps/framework/stores/state/Pointer.mjs b/deps/framework/stores/state/Pointer.mjs deleted file mode 100644 index 1021e7b91e..0000000000 --- a/deps/framework/stores/state/Pointer.mjs +++ /dev/null @@ -1,90 +0,0 @@ -export function decode(segment) { - return segment.replace(/~1/g, '/').replace(/~0/g, '~'); -} -function encode(segment) { - return segment.replace(/~/g, '~0').replace(/\//g, '~1'); -} -export function walk(segments, object, clone = true, continueOnUndefined = true) { - if (clone) { - object = Object.assign({}, object); - } - const pointerTarget = { - object, - target: object, - segment: '' - }; - return segments.reduce((pointerTarget, segment, index) => { - if (pointerTarget.target === undefined) { - return pointerTarget; - } - if (Array.isArray(pointerTarget.target) && segment === '-') { - segment = String(pointerTarget.target.length - 1); - } - if (index + 1 < segments.length) { - const nextSegment = segments[index + 1]; - let target = pointerTarget.target[segment]; - if (target === undefined && !continueOnUndefined) { - pointerTarget.target = undefined; - return pointerTarget; - } - if (clone || target === undefined) { - if (Array.isArray(target)) { - target = [...target]; - } - else if (typeof target === 'object') { - target = Object.assign({}, target); - } - else if (isNaN(parseInt(nextSegment, 0))) { - target = {}; - } - else { - target = []; - } - pointerTarget.target[segment] = target; - pointerTarget.target = target; - } - else { - pointerTarget.target = target; - } - } - else { - pointerTarget.segment = segment; - } - return pointerTarget; - }, pointerTarget); -} -export class Pointer { - constructor(segments) { - if (Array.isArray(segments)) { - this._segments = segments; - } - else { - this._segments = (segments[0] === '/' ? segments : `/${segments}`).split('/'); - this._segments.shift(); - } - if (segments.length === 0 || ((segments.length === 1 && segments[0] === '/') || segments[0] === '')) { - throw new Error('Access to the root is not supported.'); - } - this._segments = this._segments.map(decode); - } - get segments() { - return this._segments; - } - get path() { - return `/${this._segments.map(encode).join('/')}`; - } - get(object) { - const pointerTarget = walk(this.segments, object, false, false); - if (pointerTarget.target === undefined) { - return undefined; - } - return pointerTarget.target[pointerTarget.segment]; - } - toJSON() { - return this.toString(); - } - toString() { - return this.path; - } -} -//# sourceMappingURL=Pointer.mjs.map \ No newline at end of file diff --git a/deps/framework/stores/state/Pointer.mjs.map b/deps/framework/stores/state/Pointer.mjs.map deleted file mode 100644 index fdc298dc8c..0000000000 --- a/deps/framework/stores/state/Pointer.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"Pointer.mjs","sourceRoot":"","sources":["Pointer.ts"],"names":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AC,IAAI,CAAC,QAAQ,EAAE,CAAC;IACxB,CAAC;IAED,QAAQ;QACP,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC;IAClB,CAAC;CACD","sourcesContent":["export function decode(segment: string) {\n\treturn segment.replace(/~1/g, '/').replace(/~0/g, '~');\n}\n\nfunction encode(segment: string) {\n\treturn segment.replace(/~/g, '~0').replace(/\\//g, '~1');\n}\n\nexport interface PointerTarget {\n\tobject: any;\n\ttarget: any;\n\tsegment: string;\n}\n\nexport function walk(segments: string[], object: any, clone = true, continueOnUndefined = true): PointerTarget {\n\tif (clone) {\n\t\tobject = { ...object };\n\t}\n\tconst pointerTarget: PointerTarget = {\n\t\tobject,\n\t\ttarget: object,\n\t\tsegment: ''\n\t};\n\n\treturn segments.reduce((pointerTarget, segment, index) => {\n\t\tif (pointerTarget.target === undefined) {\n\t\t\treturn pointerTarget;\n\t\t}\n\t\tif (Array.isArray(pointerTarget.target) && segment === '-') {\n\t\t\tsegment = String(pointerTarget.target.length - 1);\n\t\t}\n\t\tif (index + 1 < segments.length) {\n\t\t\tconst nextSegment = segments[index + 1];\n\t\t\tlet target = pointerTarget.target[segment];\n\n\t\t\tif (target === undefined && !continueOnUndefined) {\n\t\t\t\tpointerTarget.target = undefined;\n\t\t\t\treturn pointerTarget;\n\t\t\t}\n\n\t\t\tif (clone || target === undefined) {\n\t\t\t\tif (Array.isArray(target)) {\n\t\t\t\t\ttarget = [...target];\n\t\t\t\t} else if (typeof target === 'object') {\n\t\t\t\t\ttarget = { ...target };\n\t\t\t\t} else if (isNaN(parseInt(nextSegment, 0))) {\n\t\t\t\t\ttarget = {};\n\t\t\t\t} else {\n\t\t\t\t\ttarget = [];\n\t\t\t\t}\n\t\t\t\tpointerTarget.target[segment] = target;\n\t\t\t\tpointerTarget.target = target;\n\t\t\t} else {\n\t\t\t\tpointerTarget.target = target;\n\t\t\t}\n\t\t} else {\n\t\t\tpointerTarget.segment = segment;\n\t\t}\n\t\treturn pointerTarget;\n\t}, pointerTarget);\n}\n\nexport class Pointer {\n\tprivate readonly _segments: string[];\n\n\tconstructor(segments: string | string[]) {\n\t\tif (Array.isArray(segments)) {\n\t\t\tthis._segments = segments;\n\t\t} else {\n\t\t\tthis._segments = (segments[0] === '/' ? segments : `/${segments}`).split('/');\n\t\t\tthis._segments.shift();\n\t\t}\n\t\tif (segments.length === 0 || ((segments.length === 1 && segments[0] === '/') || segments[0] === '')) {\n\t\t\tthrow new Error('Access to the root is not supported.');\n\t\t}\n\t\tthis._segments = this._segments.map(decode);\n\t}\n\n\tpublic get segments(): string[] {\n\t\treturn this._segments;\n\t}\n\n\tpublic get path(): string {\n\t\treturn `/${this._segments.map(encode).join('/')}`;\n\t}\n\n\tget(object: T): U {\n\t\tconst pointerTarget: PointerTarget = walk(this.segments, object, false, false);\n\t\tif (pointerTarget.target === undefined) {\n\t\t\treturn undefined as any;\n\t\t}\n\t\treturn pointerTarget.target[pointerTarget.segment];\n\t}\n\n\ttoJSON(): string {\n\t\treturn this.toString();\n\t}\n\n\ttoString(): string {\n\t\treturn this.path;\n\t}\n}\n"]} \ No newline at end of file diff --git a/deps/framework/stores/state/operations.d.ts b/deps/framework/stores/state/operations.d.ts deleted file mode 100644 index 45d85a9573..0000000000 --- a/deps/framework/stores/state/operations.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { RemovePatchOperation, ReplacePatchOperation, AddPatchOperation, TestPatchOperation } from './Patch'; -import { Path } from '../Store'; -export declare function add(path: Path, value: U): AddPatchOperation; -export declare function replace(path: Path, value: U): ReplacePatchOperation; -export declare function remove(path: Path): RemovePatchOperation; -export declare function test(path: Path, value: U): TestPatchOperation; diff --git a/deps/framework/stores/state/operations.js b/deps/framework/stores/state/operations.js deleted file mode 100644 index 0af194d837..0000000000 --- a/deps/framework/stores/state/operations.js +++ /dev/null @@ -1,46 +0,0 @@ -(function (factory) { - if (typeof module === "object" && typeof module.exports === "object") { - var v = factory(require, exports); - if (v !== undefined) module.exports = v; - } - else if (typeof define === "function" && define.amd) { - define(["require", "exports", "./Patch", "./Pointer"], factory); - } -})(function (require, exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - var Patch_1 = require("./Patch"); - var Pointer_1 = require("./Pointer"); - function add(path, value) { - return { - op: Patch_1.OperationType.ADD, - path: new Pointer_1.Pointer(path.path), - value: value - }; - } - exports.add = add; - function replace(path, value) { - return { - op: Patch_1.OperationType.REPLACE, - path: new Pointer_1.Pointer(path.path), - value: value - }; - } - exports.replace = replace; - function remove(path) { - return { - op: Patch_1.OperationType.REMOVE, - path: new Pointer_1.Pointer(path.path) - }; - } - exports.remove = remove; - function test(path, value) { - return { - op: Patch_1.OperationType.TEST, - path: new Pointer_1.Pointer(path.path), - value: value - }; - } - exports.test = test; -}); -//# sourceMappingURL=operations.js.map \ No newline at end of file diff --git a/deps/framework/stores/state/operations.js.map b/deps/framework/stores/state/operations.js.map deleted file mode 100644 index 3032cb913e..0000000000 --- a/deps/framework/stores/state/operations.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"operations.js","sourceRoot":"","sources":["operations.ts"],"names":[],"mappings":";;;;;;;;;;;IAAA,iCAMiB;IACjB,qCAAoC;IAGpC,aAAsC,IAAgB,EAAE,KAAQ;QAC/D,MAAM,CAAC;YACN,EAAE,EAAE,qBAAa,CAAC,GAAG;YACrB,IAAI,EAAE,IAAI,iBAAO,CAAC,IAAI,CAAC,IAAI,CAAC;YAC5B,KAAK,OAAA;SACL,CAAC;IACH,CAAC;IAND,kBAMC;IAED,iBAA0C,IAAgB,EAAE,KAAQ;QACnE,MAAM,CAAC;YACN,EAAE,EAAE,qBAAa,CAAC,OAAO;YACzB,IAAI,EAAE,IAAI,iBAAO,CAAC,IAAI,CAAC,IAAI,CAAC;YAC5B,KAAK,OAAA;SACL,CAAC;IACH,CAAC;IAND,0BAMC;IAED,gBAAyC,IAAgB;QACxD,MAAM,CAAC;YACN,EAAE,EAAE,qBAAa,CAAC,MAAM;YACxB,IAAI,EAAE,IAAI,iBAAO,CAAC,IAAI,CAAC,IAAI,CAAC;SAC5B,CAAC;IACH,CAAC;IALD,wBAKC;IAED,cAAuC,IAAgB,EAAE,KAAQ;QAChE,MAAM,CAAC;YACN,EAAE,EAAE,qBAAa,CAAC,IAAI;YACtB,IAAI,EAAE,IAAI,iBAAO,CAAC,IAAI,CAAC,IAAI,CAAC;YAC5B,KAAK,OAAA;SACL,CAAC;IACH,CAAC;IAND,oBAMC","sourcesContent":["import {\n\tRemovePatchOperation,\n\tReplacePatchOperation,\n\tAddPatchOperation,\n\tTestPatchOperation,\n\tOperationType\n} from './Patch';\nimport { Pointer } from './Pointer';\nimport { Path } from '../Store';\n\nexport function add(path: Path, value: U): AddPatchOperation {\n\treturn {\n\t\top: OperationType.ADD,\n\t\tpath: new Pointer(path.path),\n\t\tvalue\n\t};\n}\n\nexport function replace(path: Path, value: U): ReplacePatchOperation {\n\treturn {\n\t\top: OperationType.REPLACE,\n\t\tpath: new Pointer(path.path),\n\t\tvalue\n\t};\n}\n\nexport function remove(path: Path): RemovePatchOperation {\n\treturn {\n\t\top: OperationType.REMOVE,\n\t\tpath: new Pointer(path.path)\n\t};\n}\n\nexport function test(path: Path, value: U): TestPatchOperation {\n\treturn {\n\t\top: OperationType.TEST,\n\t\tpath: new Pointer(path.path),\n\t\tvalue\n\t};\n}\n"]} \ No newline at end of file diff --git a/deps/framework/stores/state/operations.mjs b/deps/framework/stores/state/operations.mjs deleted file mode 100644 index b12aaf2d31..0000000000 --- a/deps/framework/stores/state/operations.mjs +++ /dev/null @@ -1,30 +0,0 @@ -import { OperationType } from './Patch'; -import { Pointer } from './Pointer'; -export function add(path, value) { - return { - op: OperationType.ADD, - path: new Pointer(path.path), - value - }; -} -export function replace(path, value) { - return { - op: OperationType.REPLACE, - path: new Pointer(path.path), - value - }; -} -export function remove(path) { - return { - op: OperationType.REMOVE, - path: new Pointer(path.path) - }; -} -export function test(path, value) { - return { - op: OperationType.TEST, - path: new Pointer(path.path), - value - }; -} -//# sourceMappingURL=operations.mjs.map \ No newline at end of file diff --git a/deps/framework/stores/state/operations.mjs.map b/deps/framework/stores/state/operations.mjs.map deleted file mode 100644 index 10657a1d9d..0000000000 --- a/deps/framework/stores/state/operations.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"operations.mjs","sourceRoot":"","sources":["operations.ts"],"names":[],"mappings":"AAAA,OAAO,EAKN,aAAa,EACb,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAGpC,MAAM,cAAgC,IAAgB,EAAE,KAAQ;IAC/D,MAAM,CAAC;QACN,EAAE,EAAE,aAAa,CAAC,GAAG;QACrB,IAAI,EAAE,IAAI,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC;QAC5B,KAAK;KACL,CAAC;AACH,CAAC;AAED,MAAM,kBAAoC,IAAgB,EAAE,KAAQ;IACnE,MAAM,CAAC;QACN,EAAE,EAAE,aAAa,CAAC,OAAO;QACzB,IAAI,EAAE,IAAI,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC;QAC5B,KAAK;KACL,CAAC;AACH,CAAC;AAED,MAAM,iBAAmC,IAAgB;IACxD,MAAM,CAAC;QACN,EAAE,EAAE,aAAa,CAAC,MAAM;QACxB,IAAI,EAAE,IAAI,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC;KAC5B,CAAC;AACH,CAAC;AAED,MAAM,eAAiC,IAAgB,EAAE,KAAQ;IAChE,MAAM,CAAC;QACN,EAAE,EAAE,aAAa,CAAC,IAAI;QACtB,IAAI,EAAE,IAAI,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC;QAC5B,KAAK;KACL,CAAC;AACH,CAAC","sourcesContent":["import {\n\tRemovePatchOperation,\n\tReplacePatchOperation,\n\tAddPatchOperation,\n\tTestPatchOperation,\n\tOperationType\n} from './Patch';\nimport { Pointer } from './Pointer';\nimport { Path } from '../Store';\n\nexport function add(path: Path, value: U): AddPatchOperation {\n\treturn {\n\t\top: OperationType.ADD,\n\t\tpath: new Pointer(path.path),\n\t\tvalue\n\t};\n}\n\nexport function replace(path: Path, value: U): ReplacePatchOperation {\n\treturn {\n\t\top: OperationType.REPLACE,\n\t\tpath: new Pointer(path.path),\n\t\tvalue\n\t};\n}\n\nexport function remove(path: Path): RemovePatchOperation {\n\treturn {\n\t\top: OperationType.REMOVE,\n\t\tpath: new Pointer(path.path)\n\t};\n}\n\nexport function test(path: Path, value: U): TestPatchOperation {\n\treturn {\n\t\top: OperationType.TEST,\n\t\tpath: new Pointer(path.path),\n\t\tvalue\n\t};\n}\n"]} \ No newline at end of file diff --git a/deps/framework/testing/harness.d.ts b/deps/framework/testing/harness.d.ts deleted file mode 100644 index 00f308e730..0000000000 --- a/deps/framework/testing/harness.d.ts +++ /dev/null @@ -1,39 +0,0 @@ -import { WNode, DNode, WidgetBaseInterface, VNode } from '../widget-core/interfaces'; -export interface CustomComparator { - selector: string; - property: string; - comparator: (value: any) => boolean; -} -export interface FunctionalSelector { - (node: VNode | WNode): undefined | Function; -} -export interface DecoratorResult { - hasDeferredProperties: boolean; - nodes: T; -} -export interface ExpectedRender { - (): DNode | DNode[]; -} -export interface Expect { - (expectedRenderFunc: ExpectedRender): void; - (expectedRenderFunc: ExpectedRender, actualRenderFunc?: ExpectedRender): void; -} -export interface ExpectPartial { - (selector: string, expectedRenderFunc: ExpectedRender): void; - (selector: string, expectedRenderFunc: ExpectedRender, actualRenderFunc?: ExpectedRender): void; -} -export interface Trigger { - (selector: string, functionSelector: FunctionalSelector, ...args: any[]): any; - (selector: string, functionSelector: string, ...args: any[]): any; -} -export interface GetRender { - (index?: number): DNode | DNode[]; -} -export interface HarnessAPI { - expect: Expect; - expectPartial: ExpectPartial; - trigger: Trigger; - getRender: GetRender; -} -export declare function harness(renderFunc: () => WNode, customComparator?: CustomComparator[]): HarnessAPI; -export default harness; diff --git a/deps/framework/testing/harness.js b/deps/framework/testing/harness.js deleted file mode 100644 index 2eac03bf73..0000000000 --- a/deps/framework/testing/harness.js +++ /dev/null @@ -1,149 +0,0 @@ -(function (factory) { - if (typeof module === "object" && typeof module.exports === "object") { - var v = factory(require, exports); - if (v !== undefined) module.exports = v; - } - else if (typeof define === "function" && define.amd) { - define(["require", "exports", "tslib", "./support/assertRender", "./support/selector", "../widget-core/d"], factory); - } -})(function (require, exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - var tslib_1 = require("tslib"); - var assertRender_1 = require("./support/assertRender"); - var selector_1 = require("./support/selector"); - var d_1 = require("../widget-core/d"); - function decorateNodes(dNode) { - var hasDeferredProperties = false; - function addParent(parent) { - (parent.children || []).forEach(function (child) { - if (d_1.isVNode(child) || d_1.isWNode(child)) { - child.parent = parent; - } - }); - if (d_1.isVNode(parent) && typeof parent.deferredPropertiesCallback === 'function') { - hasDeferredProperties = true; - parent.properties = tslib_1.__assign({}, parent.properties, parent.deferredPropertiesCallback(false)); - } - } - var nodes = d_1.decorate(dNode, addParent, function (node) { return d_1.isWNode(node) || d_1.isVNode(node); }); - return { hasDeferredProperties: hasDeferredProperties, nodes: nodes }; - } - function harness(renderFunc, customComparator) { - if (customComparator === void 0) { customComparator = []; } - var invalidated = true; - var wNode = renderFunc(); - var widget; - var renderStack = []; - var properties = wNode.properties, children = wNode.children; - var widgetConstructor = wNode.widgetConstructor; - if (typeof widgetConstructor === 'function') { - widget = new /** @class */ (function (_super) { - tslib_1.__extends(class_1, _super); - function class_1() { - return _super !== null && _super.apply(this, arguments) || this; - } - class_1.prototype.invalidate = function () { - invalidated = true; - _super.prototype.invalidate.call(this); - }; - return class_1; - }(widgetConstructor))(); - widget.__setProperties__(properties); - widget.__setChildren__(children); - _tryRender(); - } - else { - throw new Error('Harness does not support registry items'); - } - function _getRender(count) { - return count ? renderStack[count] : renderStack[renderStack.length - 1]; - } - function _runCompares(nodes, isExpected) { - if (isExpected === void 0) { isExpected = false; } - customComparator.forEach(function (_a) { - var selector = _a.selector, property = _a.property, comparator = _a.comparator; - var items = selector_1.select(selector, nodes); - items.forEach(function (item, index) { - var comparatorName = "comparator(selector=" + selector + ", " + property + ")"; - if (item && item.properties && item.properties[property] !== undefined) { - var comparatorResult = comparator(item.properties[property]) - ? comparatorName - : comparatorName + " FAILED"; - item.properties[property] = isExpected ? comparatorName : comparatorResult; - } - }); - }); - } - function _tryRender() { - var _a = renderFunc(), properties = _a.properties, children = _a.children; - widget.__setProperties__(properties); - widget.__setChildren__(children); - if (invalidated) { - var render = widget.__render__(); - var _b = decorateNodes(render), hasDeferredProperties = _b.hasDeferredProperties, nodes = _b.nodes; - _runCompares(nodes); - renderStack.push(nodes); - if (hasDeferredProperties) { - var afterDeferredPropertiesNodes = decorateNodes(render).nodes; - _runCompares(afterDeferredPropertiesNodes); - renderStack.push(afterDeferredPropertiesNodes); - } - invalidated = false; - } - } - function _expect(expectedRenderFunc, actualRenderFunc, selector) { - var renderResult; - if (actualRenderFunc === undefined) { - _tryRender(); - renderResult = _getRender(); - } - else { - renderResult = actualRenderFunc(); - } - var expectedRenderResult = decorateNodes(expectedRenderFunc()).nodes; - _runCompares(expectedRenderResult, true); - if (selector) { - var _a = tslib_1.__read(selector_1.select(selector, renderResult), 1), firstItem = _a[0]; - assertRender_1.default(firstItem, expectedRenderResult); - } - else { - assertRender_1.default(renderResult, expectedRenderResult); - } - } - return { - expect: function (expectedRenderFunc, actualRenderFunc) { - return _expect(expectedRenderFunc, actualRenderFunc); - }, - expectPartial: function (selector, expectedRenderFunc, actualRenderFunc) { - return _expect(expectedRenderFunc, actualRenderFunc, selector); - }, - trigger: function (selector, functionSelector) { - var args = []; - for (var _i = 2; _i < arguments.length; _i++) { - args[_i - 2] = arguments[_i]; - } - _tryRender(); - var _a = tslib_1.__read(selector_1.select(selector, _getRender()), 1), firstItem = _a[0]; - if (firstItem) { - var triggerFunction = void 0; - if (typeof functionSelector === 'string') { - triggerFunction = firstItem.properties[functionSelector]; - } - else { - triggerFunction = functionSelector(firstItem); - } - if (triggerFunction) { - return triggerFunction.apply(widget, args); - } - } - }, - getRender: function (index) { - return _getRender(index); - } - }; - } - exports.harness = harness; - exports.default = harness; -}); -//# sourceMappingURL=harness.js.map \ No newline at end of file diff --git a/deps/framework/testing/harness.js.map b/deps/framework/testing/harness.js.map deleted file mode 100644 index e646688dfd..0000000000 --- a/deps/framework/testing/harness.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"harness.js","sourceRoot":"","sources":["harness.ts"],"names":[],"mappings":";;;;;;;;;;;;IAAA,uDAAkD;IAClD,+CAA4C;IAG5C,sCAA8D;IAkD9D,uBAAuB,KAAU;QAChC,IAAI,qBAAqB,GAAG,KAAK,CAAC;QAClC,mBAAmB,MAAqB;YACvC,CAAC,MAAM,CAAC,QAAQ,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,UAAC,KAAK;gBACrC,EAAE,CAAC,CAAC,WAAO,CAAC,KAAK,CAAC,IAAI,WAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;oBACrC,KAAa,CAAC,MAAM,GAAG,MAAM,CAAC;gBAChC,CAAC;YACF,CAAC,CAAC,CAAC;YACH,EAAE,CAAC,CAAC,WAAO,CAAC,MAAM,CAAC,IAAI,OAAO,MAAM,CAAC,0BAA0B,KAAK,UAAU,CAAC,CAAC,CAAC;gBAChF,qBAAqB,GAAG,IAAI,CAAC;gBAC7B,MAAM,CAAC,UAAU,wBAAQ,MAAM,CAAC,UAAU,EAAK,MAAM,CAAC,0BAA0B,CAAC,KAAK,CAAC,CAAE,CAAC;YAC3F,CAAC;QACF,CAAC;QACD,IAAM,KAAK,GAAG,YAAQ,CAAC,KAAK,EAAE,SAAS,EAAE,UAAC,IAAW,IAA4B,OAAA,WAAO,CAAC,IAAI,CAAC,IAAI,WAAO,CAAC,IAAI,CAAC,EAA9B,CAA8B,CAAC,CAAC;QACjH,MAAM,CAAC,EAAE,qBAAqB,uBAAA,EAAE,KAAK,OAAA,EAAE,CAAC;IACzC,CAAC;IAED,iBACC,UAA4C,EAC5C,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C,CAAC;oBACnE,CAAC;oBAAC,IAAI,CAAC,CAAC;wBACP,eAAe,GAAG,gBAAgB,CAAC,SAAS,CAAC,CAAC;oBAC/C,CAAC;oBACD,EAAE,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC;wBACrB,MAAM,CAAC,eAAe,CAAC,KAAK,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;oBAC5C,CAAC;gBACF,CAAC;YACF,CAAC;YACD,SAAS,EAAT,UAAU,KAAc;gBACvB,MAAM,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;YAC1B,CAAC;SACD,CAAC;IACH,CAAC;IA1GD,0BA0GC;IAED,kBAAe,OAAO,CAAC","sourcesContent":["import assertRender from './support/assertRender';\nimport { select } from './support/selector';\nimport { WNode, DNode, WidgetBaseInterface, Constructor, VNode } from '../widget-core/interfaces';\nimport { WidgetBase } from '../widget-core/WidgetBase';\nimport { decorate, isVNode, isWNode } from '../widget-core/d';\n\nexport interface CustomComparator {\n\tselector: string;\n\tproperty: string;\n\tcomparator: (value: any) => boolean;\n}\n\nexport interface FunctionalSelector {\n\t(node: VNode | WNode): undefined | Function;\n}\n\nexport interface DecoratorResult {\n\thasDeferredProperties: boolean;\n\tnodes: T;\n}\n\nexport interface ExpectedRender {\n\t(): DNode | DNode[];\n}\n\nexport interface Expect {\n\t(expectedRenderFunc: ExpectedRender): void;\n\t(expectedRenderFunc: ExpectedRender, actualRenderFunc?: ExpectedRender): void;\n}\n\nexport interface ExpectPartial {\n\t(selector: string, expectedRenderFunc: ExpectedRender): void;\n\t(selector: string, expectedRenderFunc: ExpectedRender, actualRenderFunc?: ExpectedRender): void;\n}\n\nexport interface Trigger {\n\t(selector: string, functionSelector: FunctionalSelector, ...args: any[]): any;\n\t(selector: string, functionSelector: string, ...args: any[]): any;\n}\n\nexport interface GetRender {\n\t(index?: number): DNode | DNode[];\n}\n\nexport interface HarnessAPI {\n\texpect: Expect;\n\texpectPartial: ExpectPartial;\n\ttrigger: Trigger;\n\tgetRender: GetRender;\n}\n\nfunction decorateNodes(dNode: DNode[]): DecoratorResult;\nfunction decorateNodes(dNode: DNode): DecoratorResult;\nfunction decorateNodes(dNode: DNode | DNode[]): DecoratorResult;\nfunction decorateNodes(dNode: any): DecoratorResult {\n\tlet hasDeferredProperties = false;\n\tfunction addParent(parent: WNode | VNode): void {\n\t\t(parent.children || []).forEach((child) => {\n\t\t\tif (isVNode(child) || isWNode(child)) {\n\t\t\t\t(child as any).parent = parent;\n\t\t\t}\n\t\t});\n\t\tif (isVNode(parent) && typeof parent.deferredPropertiesCallback === 'function') {\n\t\t\thasDeferredProperties = true;\n\t\t\tparent.properties = { ...parent.properties, ...parent.deferredPropertiesCallback(false) };\n\t\t}\n\t}\n\tconst nodes = decorate(dNode, addParent, (node: DNode): node is WNode | VNode => isWNode(node) || isVNode(node));\n\treturn { hasDeferredProperties, nodes };\n}\n\nexport function harness(\n\trenderFunc: () => WNode,\n\tcustomComparator: CustomComparator[] = []\n): HarnessAPI {\n\tlet invalidated = true;\n\tlet wNode = renderFunc();\n\tlet widget: WidgetBase;\n\tconst renderStack: (DNode | DNode[])[] = [];\n\tconst { properties, children } = wNode;\n\tconst widgetConstructor = wNode.widgetConstructor as Constructor;\n\tif (typeof widgetConstructor === 'function') {\n\t\twidget = new class extends widgetConstructor {\n\t\t\tinvalidate() {\n\t\t\t\tinvalidated = true;\n\t\t\t\tsuper.invalidate();\n\t\t\t}\n\t\t}();\n\t\twidget.__setProperties__(properties);\n\t\twidget.__setChildren__(children);\n\t\t_tryRender();\n\t} else {\n\t\tthrow new Error('Harness does not support registry items');\n\t}\n\n\tfunction _getRender(count?: number): DNode | DNode[] {\n\t\treturn count ? renderStack[count] : renderStack[renderStack.length - 1];\n\t}\n\n\tfunction _runCompares(nodes: DNode | DNode[], isExpected: boolean = false) {\n\t\tcustomComparator.forEach(({ selector, property, comparator }) => {\n\t\t\tconst items = select(selector, nodes);\n\t\t\titems.forEach((item: any, index: number) => {\n\t\t\t\tconst comparatorName = `comparator(selector=${selector}, ${property})`;\n\t\t\t\tif (item && item.properties && item.properties[property] !== undefined) {\n\t\t\t\t\tconst comparatorResult = comparator(item.properties[property])\n\t\t\t\t\t\t? comparatorName\n\t\t\t\t\t\t: `${comparatorName} FAILED`;\n\t\t\t\t\titem.properties[property] = isExpected ? comparatorName : comparatorResult;\n\t\t\t\t}\n\t\t\t});\n\t\t});\n\t}\n\n\tfunction _tryRender() {\n\t\tconst { properties, children } = renderFunc();\n\t\twidget.__setProperties__(properties);\n\t\twidget.__setChildren__(children);\n\t\tif (invalidated) {\n\t\t\tconst render = widget.__render__();\n\t\t\tconst { hasDeferredProperties, nodes } = decorateNodes(render);\n\t\t\t_runCompares(nodes);\n\t\t\trenderStack.push(nodes);\n\t\t\tif (hasDeferredProperties) {\n\t\t\t\tconst { nodes: afterDeferredPropertiesNodes } = decorateNodes(render);\n\t\t\t\t_runCompares(afterDeferredPropertiesNodes);\n\t\t\t\trenderStack.push(afterDeferredPropertiesNodes);\n\t\t\t}\n\t\t\tinvalidated = false;\n\t\t}\n\t}\n\n\tfunction _expect(expectedRenderFunc: ExpectedRender, actualRenderFunc?: ExpectedRender, selector?: string) {\n\t\tlet renderResult: DNode | DNode[];\n\t\tif (actualRenderFunc === undefined) {\n\t\t\t_tryRender();\n\t\t\trenderResult = _getRender();\n\t\t} else {\n\t\t\trenderResult = actualRenderFunc();\n\t\t}\n\n\t\tconst { nodes: expectedRenderResult } = decorateNodes(expectedRenderFunc());\n\t\t_runCompares(expectedRenderResult, true);\n\t\tif (selector) {\n\t\t\tconst [firstItem] = select(selector, renderResult);\n\t\t\tassertRender(firstItem, expectedRenderResult);\n\t\t} else {\n\t\t\tassertRender(renderResult, expectedRenderResult);\n\t\t}\n\t}\n\n\treturn {\n\t\texpect(expectedRenderFunc: ExpectedRender, actualRenderFunc?: ExpectedRender) {\n\t\t\treturn _expect(expectedRenderFunc, actualRenderFunc);\n\t\t},\n\t\texpectPartial(selector: string, expectedRenderFunc: ExpectedRender, actualRenderFunc?: ExpectedRender) {\n\t\t\treturn _expect(expectedRenderFunc, actualRenderFunc, selector);\n\t\t},\n\t\ttrigger(selector: string, functionSelector: string | FunctionalSelector, ...args: any[]): any {\n\t\t\t_tryRender();\n\t\t\tconst [firstItem] = select(selector, _getRender());\n\t\t\tif (firstItem) {\n\t\t\t\tlet triggerFunction: Function | undefined;\n\t\t\t\tif (typeof functionSelector === 'string') {\n\t\t\t\t\ttriggerFunction = (firstItem.properties as any)[functionSelector];\n\t\t\t\t} else {\n\t\t\t\t\ttriggerFunction = functionSelector(firstItem);\n\t\t\t\t}\n\t\t\t\tif (triggerFunction) {\n\t\t\t\t\treturn triggerFunction.apply(widget, args);\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\tgetRender(index?: number): DNode | DNode[] {\n\t\t\treturn _getRender(index);\n\t\t}\n\t};\n}\n\nexport default harness;\n"]} \ No newline at end of file diff --git a/deps/framework/testing/harness.mjs b/deps/framework/testing/harness.mjs deleted file mode 100644 index 24706a34b1..0000000000 --- a/deps/framework/testing/harness.mjs +++ /dev/null @@ -1,123 +0,0 @@ -import assertRender from './support/assertRender'; -import { select } from './support/selector'; -import { decorate, isVNode, isWNode } from '../widget-core/d'; -function decorateNodes(dNode) { - let hasDeferredProperties = false; - function addParent(parent) { - (parent.children || []).forEach((child) => { - if (isVNode(child) || isWNode(child)) { - child.parent = parent; - } - }); - if (isVNode(parent) && typeof parent.deferredPropertiesCallback === 'function') { - hasDeferredProperties = true; - parent.properties = Object.assign({}, parent.properties, parent.deferredPropertiesCallback(false)); - } - } - const nodes = decorate(dNode, addParent, (node) => isWNode(node) || isVNode(node)); - return { hasDeferredProperties, nodes }; -} -export function harness(renderFunc, customComparator = []) { - let invalidated = true; - let wNode = renderFunc(); - let widget; - const renderStack = []; - const { properties, children } = wNode; - const widgetConstructor = wNode.widgetConstructor; - if (typeof widgetConstructor === 'function') { - widget = new class extends widgetConstructor { - invalidate() { - invalidated = true; - super.invalidate(); - } - }(); - widget.__setProperties__(properties); - widget.__setChildren__(children); - _tryRender(); - } - else { - throw new Error('Harness does not support registry items'); - } - function _getRender(count) { - return count ? renderStack[count] : renderStack[renderStack.length - 1]; - } - function _runCompares(nodes, isExpected = false) { - customComparator.forEach(({ selector, property, comparator }) => { - const items = select(selector, nodes); - items.forEach((item, index) => { - const comparatorName = `comparator(selector=${selector}, ${property})`; - if (item && item.properties && item.properties[property] !== undefined) { - const comparatorResult = comparator(item.properties[property]) - ? comparatorName - : `${comparatorName} FAILED`; - item.properties[property] = isExpected ? comparatorName : comparatorResult; - } - }); - }); - } - function _tryRender() { - const { properties, children } = renderFunc(); - widget.__setProperties__(properties); - widget.__setChildren__(children); - if (invalidated) { - const render = widget.__render__(); - const { hasDeferredProperties, nodes } = decorateNodes(render); - _runCompares(nodes); - renderStack.push(nodes); - if (hasDeferredProperties) { - const { nodes: afterDeferredPropertiesNodes } = decorateNodes(render); - _runCompares(afterDeferredPropertiesNodes); - renderStack.push(afterDeferredPropertiesNodes); - } - invalidated = false; - } - } - function _expect(expectedRenderFunc, actualRenderFunc, selector) { - let renderResult; - if (actualRenderFunc === undefined) { - _tryRender(); - renderResult = _getRender(); - } - else { - renderResult = actualRenderFunc(); - } - const { nodes: expectedRenderResult } = decorateNodes(expectedRenderFunc()); - _runCompares(expectedRenderResult, true); - if (selector) { - const [firstItem] = select(selector, renderResult); - assertRender(firstItem, expectedRenderResult); - } - else { - assertRender(renderResult, expectedRenderResult); - } - } - return { - expect(expectedRenderFunc, actualRenderFunc) { - return _expect(expectedRenderFunc, actualRenderFunc); - }, - expectPartial(selector, expectedRenderFunc, actualRenderFunc) { - return _expect(expectedRenderFunc, actualRenderFunc, selector); - }, - trigger(selector, functionSelector, ...args) { - _tryRender(); - const [firstItem] = select(selector, _getRender()); - if (firstItem) { - let triggerFunction; - if (typeof functionSelector === 'string') { - triggerFunction = firstItem.properties[functionSelector]; - } - else { - triggerFunction = functionSelector(firstItem); - } - if (triggerFunction) { - return triggerFunction.apply(widget, args); - } - } - }, - getRender(index) { - return _getRender(index); - } - }; -} -export default harness; -//# sourceMappingURL=harness.mjs.map \ No newline at end of file diff --git a/deps/framework/testing/harness.mjs.map b/deps/framework/testing/harness.mjs.map deleted file mode 100644 index 5328470c80..0000000000 --- a/deps/framework/testing/harness.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"harness.mjs","sourceRoot":"","sources":["harness.ts"],"names":[],"mappings":"AAAA,OAAO,YAAY,MAAM,wBAAwB,CAAC;AAClD,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAG5C,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAkD9D,uBAAuB,KAAU;IAChC,IAAI,qBAAqB,GAAG,KAAK,CAAC;IAClC,mBAAmB,MAAqB;QACvC,CAAC,MAAM,CAAC,QAAQ,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,EAAE;YACzC,EAAE,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;gBACrC,KAAa,CAAC,MAAM,GAAG,MAAM,CAAC;YAChC,CAAC;QACF,CAAC,CAAC,CAAC;QACH,EAAE,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,OAAO,MAAM,CAAC,0BAA0B,KAAK,UAAU,CAAC,CAAC,CAAC;YAChF,qBAAqB,GAAG,IAAI,CAAC;YAC7B,MAAM,CAAC,UAAU,qBAAQ,MAAM,CAAC,UAAU,EAAK,MAAM,CAAC,0BAA0B,CAAC,KAAK,CAAC,CAAE,CAAC;QAC3F,CAAC;IACF,CAAC;IACD,MAAM,KAAK,GAAG,QAAQ,CAAC,KAAK,EAAE,SAAS,EAAE,CAAC,IAAW,EAAyB,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC;IACj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C,SAAS,CAAC,CAAC,CAAC;gBACf,IAAI,eAAqC,CAAC;gBAC1C,EAAE,CAAC,CAAC,OAAO,gBAAgB,KAAK,QAAQ,CAAC,CAAC,CAAC;oBAC1C,eAAe,GAAI,SAAS,CAAC,UAAkB,CAAC,gBAAgB,CAAC,CAAC;gBACnE,CAAC;gBAAC,IAAI,CAAC,CAAC;oBACP,eAAe,GAAG,gBAAgB,CAAC,SAAS,CAAC,CAAC;gBAC/C,CAAC;gBACD,EAAE,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC;oBACrB,MAAM,CAAC,eAAe,CAAC,KAAK,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;gBAC5C,CAAC;YACF,CAAC;QACF,CAAC;QACD,SAAS,CAAC,KAAc;YACvB,MAAM,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;QAC1B,CAAC;KACD,CAAC;AACH,CAAC;AAED,eAAe,OAAO,CAAC","sourcesContent":["import assertRender from './support/assertRender';\nimport { select } from './support/selector';\nimport { WNode, DNode, WidgetBaseInterface, Constructor, VNode } from '../widget-core/interfaces';\nimport { WidgetBase } from '../widget-core/WidgetBase';\nimport { decorate, isVNode, isWNode } from '../widget-core/d';\n\nexport interface CustomComparator {\n\tselector: string;\n\tproperty: string;\n\tcomparator: (value: any) => boolean;\n}\n\nexport interface FunctionalSelector {\n\t(node: VNode | WNode): undefined | Function;\n}\n\nexport interface DecoratorResult {\n\thasDeferredProperties: boolean;\n\tnodes: T;\n}\n\nexport interface ExpectedRender {\n\t(): DNode | DNode[];\n}\n\nexport interface Expect {\n\t(expectedRenderFunc: ExpectedRender): void;\n\t(expectedRenderFunc: ExpectedRender, actualRenderFunc?: ExpectedRender): void;\n}\n\nexport interface ExpectPartial {\n\t(selector: string, expectedRenderFunc: ExpectedRender): void;\n\t(selector: string, expectedRenderFunc: ExpectedRender, actualRenderFunc?: ExpectedRender): void;\n}\n\nexport interface Trigger {\n\t(selector: string, functionSelector: FunctionalSelector, ...args: any[]): any;\n\t(selector: string, functionSelector: string, ...args: any[]): any;\n}\n\nexport interface GetRender {\n\t(index?: number): DNode | DNode[];\n}\n\nexport interface HarnessAPI {\n\texpect: Expect;\n\texpectPartial: ExpectPartial;\n\ttrigger: Trigger;\n\tgetRender: GetRender;\n}\n\nfunction decorateNodes(dNode: DNode[]): DecoratorResult;\nfunction decorateNodes(dNode: DNode): DecoratorResult;\nfunction decorateNodes(dNode: DNode | DNode[]): DecoratorResult;\nfunction decorateNodes(dNode: any): DecoratorResult {\n\tlet hasDeferredProperties = false;\n\tfunction addParent(parent: WNode | VNode): void {\n\t\t(parent.children || []).forEach((child) => {\n\t\t\tif (isVNode(child) || isWNode(child)) {\n\t\t\t\t(child as any).parent = parent;\n\t\t\t}\n\t\t});\n\t\tif (isVNode(parent) && typeof parent.deferredPropertiesCallback === 'function') {\n\t\t\thasDeferredProperties = true;\n\t\t\tparent.properties = { ...parent.properties, ...parent.deferredPropertiesCallback(false) };\n\t\t}\n\t}\n\tconst nodes = decorate(dNode, addParent, (node: DNode): node is WNode | VNode => isWNode(node) || isVNode(node));\n\treturn { hasDeferredProperties, nodes };\n}\n\nexport function harness(\n\trenderFunc: () => WNode,\n\tcustomComparator: CustomComparator[] = []\n): HarnessAPI {\n\tlet invalidated = true;\n\tlet wNode = renderFunc();\n\tlet widget: WidgetBase;\n\tconst renderStack: (DNode | DNode[])[] = [];\n\tconst { properties, children } = wNode;\n\tconst widgetConstructor = wNode.widgetConstructor as Constructor;\n\tif (typeof widgetConstructor === 'function') {\n\t\twidget = new class extends widgetConstructor {\n\t\t\tinvalidate() {\n\t\t\t\tinvalidated = true;\n\t\t\t\tsuper.invalidate();\n\t\t\t}\n\t\t}();\n\t\twidget.__setProperties__(properties);\n\t\twidget.__setChildren__(children);\n\t\t_tryRender();\n\t} else {\n\t\tthrow new Error('Harness does not support registry items');\n\t}\n\n\tfunction _getRender(count?: number): DNode | DNode[] {\n\t\treturn count ? renderStack[count] : renderStack[renderStack.length - 1];\n\t}\n\n\tfunction _runCompares(nodes: DNode | DNode[], isExpected: boolean = false) {\n\t\tcustomComparator.forEach(({ selector, property, comparator }) => {\n\t\t\tconst items = select(selector, nodes);\n\t\t\titems.forEach((item: any, index: number) => {\n\t\t\t\tconst comparatorName = `comparator(selector=${selector}, ${property})`;\n\t\t\t\tif (item && item.properties && item.properties[property] !== undefined) {\n\t\t\t\t\tconst comparatorResult = comparator(item.properties[property])\n\t\t\t\t\t\t? comparatorName\n\t\t\t\t\t\t: `${comparatorName} FAILED`;\n\t\t\t\t\titem.properties[property] = isExpected ? comparatorName : comparatorResult;\n\t\t\t\t}\n\t\t\t});\n\t\t});\n\t}\n\n\tfunction _tryRender() {\n\t\tconst { properties, children } = renderFunc();\n\t\twidget.__setProperties__(properties);\n\t\twidget.__setChildren__(children);\n\t\tif (invalidated) {\n\t\t\tconst render = widget.__render__();\n\t\t\tconst { hasDeferredProperties, nodes } = decorateNodes(render);\n\t\t\t_runCompares(nodes);\n\t\t\trenderStack.push(nodes);\n\t\t\tif (hasDeferredProperties) {\n\t\t\t\tconst { nodes: afterDeferredPropertiesNodes } = decorateNodes(render);\n\t\t\t\t_runCompares(afterDeferredPropertiesNodes);\n\t\t\t\trenderStack.push(afterDeferredPropertiesNodes);\n\t\t\t}\n\t\t\tinvalidated = false;\n\t\t}\n\t}\n\n\tfunction _expect(expectedRenderFunc: ExpectedRender, actualRenderFunc?: ExpectedRender, selector?: string) {\n\t\tlet renderResult: DNode | DNode[];\n\t\tif (actualRenderFunc === undefined) {\n\t\t\t_tryRender();\n\t\t\trenderResult = _getRender();\n\t\t} else {\n\t\t\trenderResult = actualRenderFunc();\n\t\t}\n\n\t\tconst { nodes: expectedRenderResult } = decorateNodes(expectedRenderFunc());\n\t\t_runCompares(expectedRenderResult, true);\n\t\tif (selector) {\n\t\t\tconst [firstItem] = select(selector, renderResult);\n\t\t\tassertRender(firstItem, expectedRenderResult);\n\t\t} else {\n\t\t\tassertRender(renderResult, expectedRenderResult);\n\t\t}\n\t}\n\n\treturn {\n\t\texpect(expectedRenderFunc: ExpectedRender, actualRenderFunc?: ExpectedRender) {\n\t\t\treturn _expect(expectedRenderFunc, actualRenderFunc);\n\t\t},\n\t\texpectPartial(selector: string, expectedRenderFunc: ExpectedRender, actualRenderFunc?: ExpectedRender) {\n\t\t\treturn _expect(expectedRenderFunc, actualRenderFunc, selector);\n\t\t},\n\t\ttrigger(selector: string, functionSelector: string | FunctionalSelector, ...args: any[]): any {\n\t\t\t_tryRender();\n\t\t\tconst [firstItem] = select(selector, _getRender());\n\t\t\tif (firstItem) {\n\t\t\t\tlet triggerFunction: Function | undefined;\n\t\t\t\tif (typeof functionSelector === 'string') {\n\t\t\t\t\ttriggerFunction = (firstItem.properties as any)[functionSelector];\n\t\t\t\t} else {\n\t\t\t\t\ttriggerFunction = functionSelector(firstItem);\n\t\t\t\t}\n\t\t\t\tif (triggerFunction) {\n\t\t\t\t\treturn triggerFunction.apply(widget, args);\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\tgetRender(index?: number): DNode | DNode[] {\n\t\t\treturn _getRender(index);\n\t\t}\n\t};\n}\n\nexport default harness;\n"]} \ No newline at end of file diff --git a/deps/framework/testing/support/assertRender.d.ts b/deps/framework/testing/support/assertRender.d.ts deleted file mode 100644 index 52d304aac1..0000000000 --- a/deps/framework/testing/support/assertRender.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import { DNode } from '../../widget-core/interfaces'; -export declare function formatDNodes(nodes: DNode | DNode[], depth?: number): string; -export declare function assertRender(actual: DNode | DNode[], expected: DNode | DNode[], message?: string): void; -export default assertRender; diff --git a/deps/framework/testing/support/assertRender.js b/deps/framework/testing/support/assertRender.js deleted file mode 100644 index 2a25103253..0000000000 --- a/deps/framework/testing/support/assertRender.js +++ /dev/null @@ -1,124 +0,0 @@ -(function (factory) { - if (typeof module === "object" && typeof module.exports === "object") { - var v = factory(require, exports); - if (v !== undefined) module.exports = v; - } - else if (typeof define === "function" && define.amd) { - define(["require", "exports", "../../widget-core/d", "diff", "../../shim/WeakMap", "../../shim/Set", "../../shim/Map", "../../shim/array"], factory); - } -})(function (require, exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - var d_1 = require("../../widget-core/d"); - var diff = require("diff"); - var WeakMap_1 = require("../../shim/WeakMap"); - var Set_1 = require("../../shim/Set"); - var Map_1 = require("../../shim/Map"); - var array_1 = require("../../shim/array"); - var widgetClassCounter = 0; - var widgetMap = new WeakMap_1.default(); - function replacer(key, value) { - if (typeof value === 'function') { - return 'function'; - } - else if (typeof value === 'undefined') { - return 'undefined'; - } - else if (value instanceof Set_1.default || value instanceof Map_1.default) { - return array_1.from(value); - } - return value; - } - function formatDNodes(nodes, depth) { - if (depth === void 0) { depth = 0; } - var isArrayFragment = Array.isArray(nodes) && depth === 0; - var initial = isArrayFragment ? '[\n' : ''; - var tabs = ''; - depth = isArrayFragment ? 1 : depth; - nodes = Array.isArray(nodes) ? nodes : [nodes]; - for (var i = 0; i < depth; i++) { - tabs = tabs + "\t"; - } - var formattedNode = nodes.reduce(function (result, node, index) { - if (node === null || node === undefined) { - return result; - } - if (index > 0) { - result = result + "\n"; - } - result = "" + result + tabs; - if (typeof node === 'string') { - return result + "\"" + node + "\""; - } - result = "" + result + formatNode(node, tabs); - if (node.children && node.children.length > 0) { - result = result + ", [\n" + formatDNodes(node.children, depth + 1) + "\n" + tabs + "]"; - } - return result + ")"; - }, initial); - return isArrayFragment ? (formattedNode = formattedNode + "\n]") : formattedNode; - } - exports.formatDNodes = formatDNodes; - function formatProperties(properties, tabs) { - properties = Object.keys(properties) - .sort() - .reduce(function (props, key) { - props[key] = properties[key]; - return props; - }, {}); - properties = JSON.stringify(properties, replacer, tabs + "\t").slice(0, -1); - return "" + properties + tabs + "}"; - } - function getWidgetName(widgetConstructor) { - var name; - if (typeof widgetConstructor === 'string' || typeof widgetConstructor === 'symbol') { - name = widgetConstructor.toString(); - } - else { - name = widgetConstructor.name; - if (name === undefined) { - var id = widgetMap.get(widgetConstructor); - if (id === undefined) { - id = ++widgetClassCounter; - widgetMap.set(widgetConstructor, id); - } - name = "Widget-" + id; - } - } - return name; - } - function formatNode(node, tabs) { - var propertyKeyCount = Object.keys(node.properties).length; - var properties = propertyKeyCount > 0 ? formatProperties(node.properties, tabs) : '{}'; - if (d_1.isWNode(node)) { - return "w(" + getWidgetName(node.widgetConstructor) + ", " + properties; - } - return "v(\"" + node.tag + "\", " + properties; - } - function assertRender(actual, expected, message) { - var parsedActual = formatDNodes(actual); - var parsedExpected = formatDNodes(expected); - var diffResult = diff.diffLines(parsedActual, parsedExpected); - var diffFound = false; - var parsedDiff = diffResult.reduce(function (result, part, index) { - if (part.added) { - diffFound = true; - result = result + "(E)" + part.value.replace(/\n\t/g, '\n(E)\t'); - } - else if (part.removed) { - diffFound = true; - result = result + "(A)" + part.value.replace(/\n\t/g, '\n(A)\t'); - } - else { - result = "" + result + part.value; - } - return result; - }, '\n'); - if (diffFound) { - throw new Error(parsedDiff); - } - } - exports.assertRender = assertRender; - exports.default = assertRender; -}); -//# sourceMappingURL=assertRender.js.map \ No newline at end of file diff --git a/deps/framework/testing/support/assertRender.js.map b/deps/framework/testing/support/assertRender.js.map deleted file mode 100644 index 7b5c7695b0..0000000000 --- a/deps/framework/testing/support/assertRender.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"assertRender.js","sourceRoot":"","sources":["assertRender.ts"],"names":[],"mappings":";;;;;;;;;;;IACA,yCAA8C;IAC9C,2BAA6B;IAC7B,8CAAyC;IACzC,sCAAiC;IACjC,sCAAiC;IACjC,0CAAqD;IAErD,IAAI,kBAAkB,GAAG,CAAC,CAAC;IAC3B,IAAM,SAAS,GAAG,IAAI,iBAAO,EAAmD,CAAC;IAEjF,kBAAkB,GAAW,EAAE,KAAU;QACxC,EAAE,CAAC,CAAC,OAAO,KAAK,KAAK,UAAU,CAAC,CAAC,CAAC;YACjC,MAAM,CAAC,UAAU,CAAC;QACnB,CAAC;QAAC,IAAI,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G,YAAY,CAAC,MAAM,CAAC,CAAC;QAC1C,IAAM,cAAc,GAAG,YAAY,CAAC,QAAQ,CAAC,CAAC;QAC9C,IAAM,UAAU,GAAG,IAAI,CAAC,SAAS,CAAC,YAAY,EAAE,cAAc,CAAC,CAAC;QAChE,IAAI,SAAS,GAAG,KAAK,CAAC;QACtB,IAAM,UAAU,GAAG,UAAU,CAAC,MAAM,CAAC,UAAC,MAAc,EAAE,IAAI,EAAE,KAAK;YAChE,EAAE,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC;gBAChB,SAAS,GAAG,IAAI,CAAC;gBACjB,MAAM,GAAM,MAAM,WAAM,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,OAAO,EAAE,SAAS,CAAG,CAAC;YAClE,CAAC;YAAC,IAAI,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC;gBACzB,SAAS,GAAG,IAAI,CAAC;gBACjB,MAAM,GAAM,MAAM,WAAM,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,OAAO,EAAE,SAAS,CAAG,CAAC;YAClE,CAAC;YAAC,IAAI,CAAC,CAAC;gBACP,MAAM,GAAG,KAAG,MAAM,GAAG,IAAI,CAAC,KAAO,CAAC;YACnC,CAAC;YACD,MAAM,CAAC,MAAM,CAAC;QACf,CAAC,EAAE,IAAI,CAAC,CAAC;QAET,EAAE,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC;YACf,MAAM,IAAI,KAAK,CAAC,UAAU,CAAC,CAAC;QAC7B,CAAC;IACF,CAAC;IArBD,oCAqBC;IAED,kBAAe,YAAY,CAAC","sourcesContent":["import { DNode, WNode, VNode, DefaultWidgetBaseInterface, Constructor } from '../../widget-core/interfaces';\nimport { isWNode } from '../../widget-core/d';\nimport * as diff from 'diff';\nimport WeakMap from '../../shim/WeakMap';\nimport Set from '../../shim/Set';\nimport Map from '../../shim/Map';\nimport { from as arrayFrom } from '../../shim/array';\n\nlet widgetClassCounter = 0;\nconst widgetMap = new WeakMap, number>();\n\nfunction replacer(key: string, value: any): any {\n\tif (typeof value === 'function') {\n\t\treturn 'function';\n\t} else if (typeof value === 'undefined') {\n\t\treturn 'undefined';\n\t} else if (value instanceof Set || value instanceof Map) {\n\t\treturn arrayFrom(value);\n\t}\n\treturn value;\n}\n\nexport function formatDNodes(nodes: DNode | DNode[], depth: number = 0): string {\n\tconst isArrayFragment = Array.isArray(nodes) && depth === 0;\n\tlet initial = isArrayFragment ? '[\\n' : '';\n\tlet tabs = '';\n\tdepth = isArrayFragment ? 1 : depth;\n\tnodes = Array.isArray(nodes) ? nodes : [nodes];\n\n\tfor (let i = 0; i < depth; i++) {\n\t\ttabs = `${tabs}\\t`;\n\t}\n\tlet formattedNode = nodes.reduce((result: string, node, index) => {\n\t\tif (node === null || node === undefined) {\n\t\t\treturn result;\n\t\t}\n\t\tif (index > 0) {\n\t\t\tresult = `${result}\\n`;\n\t\t}\n\t\tresult = `${result}${tabs}`;\n\n\t\tif (typeof node === 'string') {\n\t\t\treturn `${result}\"${node}\"`;\n\t\t}\n\n\t\tresult = `${result}${formatNode(node, tabs)}`;\n\t\tif (node.children && node.children.length > 0) {\n\t\t\tresult = `${result}, [\\n${formatDNodes(node.children, depth + 1)}\\n${tabs}]`;\n\t\t}\n\t\treturn `${result})`;\n\t}, initial);\n\n\treturn isArrayFragment ? (formattedNode = `${formattedNode}\\n]`) : formattedNode;\n}\n\nfunction formatProperties(properties: any, tabs: string): string {\n\tproperties = Object.keys(properties)\n\t\t.sort()\n\t\t.reduce((props: any, key) => {\n\t\t\tprops[key] = properties[key];\n\t\t\treturn props;\n\t\t}, {});\n\tproperties = JSON.stringify(properties, replacer, `${tabs}\\t`).slice(0, -1);\n\treturn `${properties}${tabs}}`;\n}\n\nfunction getWidgetName(widgetConstructor: any): string {\n\tlet name: string;\n\tif (typeof widgetConstructor === 'string' || typeof widgetConstructor === 'symbol') {\n\t\tname = widgetConstructor.toString();\n\t} else {\n\t\tname = widgetConstructor.name;\n\t\tif (name === undefined) {\n\t\t\tlet id = widgetMap.get(widgetConstructor);\n\t\t\tif (id === undefined) {\n\t\t\t\tid = ++widgetClassCounter;\n\t\t\t\twidgetMap.set(widgetConstructor, id);\n\t\t\t}\n\t\t\tname = `Widget-${id}`;\n\t\t}\n\t}\n\treturn name;\n}\n\nfunction formatNode(node: WNode | VNode, tabs: any): string {\n\tconst propertyKeyCount = Object.keys(node.properties).length;\n\tlet properties = propertyKeyCount > 0 ? formatProperties(node.properties, tabs) : '{}';\n\tif (isWNode(node)) {\n\t\treturn `w(${getWidgetName(node.widgetConstructor)}, ${properties}`;\n\t}\n\treturn `v(\"${node.tag}\", ${properties}`;\n}\n\nexport function assertRender(actual: DNode | DNode[], expected: DNode | DNode[], message?: string): void {\n\tconst parsedActual = formatDNodes(actual);\n\tconst parsedExpected = formatDNodes(expected);\n\tconst diffResult = diff.diffLines(parsedActual, parsedExpected);\n\tlet diffFound = false;\n\tconst parsedDiff = diffResult.reduce((result: string, part, index) => {\n\t\tif (part.added) {\n\t\t\tdiffFound = true;\n\t\t\tresult = `${result}(E)${part.value.replace(/\\n\\t/g, '\\n(E)\\t')}`;\n\t\t} else if (part.removed) {\n\t\t\tdiffFound = true;\n\t\t\tresult = `${result}(A)${part.value.replace(/\\n\\t/g, '\\n(A)\\t')}`;\n\t\t} else {\n\t\t\tresult = `${result}${part.value}`;\n\t\t}\n\t\treturn result;\n\t}, '\\n');\n\n\tif (diffFound) {\n\t\tthrow new Error(parsedDiff);\n\t}\n}\n\nexport default assertRender;\n"]} \ No newline at end of file diff --git a/deps/framework/testing/support/assertRender.mjs b/deps/framework/testing/support/assertRender.mjs deleted file mode 100644 index 41d5e390fa..0000000000 --- a/deps/framework/testing/support/assertRender.mjs +++ /dev/null @@ -1,109 +0,0 @@ -import { isWNode } from '../../widget-core/d'; -import * as diff from 'diff'; -import WeakMap from '../../shim/WeakMap'; -import Set from '../../shim/Set'; -import Map from '../../shim/Map'; -import { from as arrayFrom } from '../../shim/array'; -let widgetClassCounter = 0; -const widgetMap = new WeakMap(); -function replacer(key, value) { - if (typeof value === 'function') { - return 'function'; - } - else if (typeof value === 'undefined') { - return 'undefined'; - } - else if (value instanceof Set || value instanceof Map) { - return arrayFrom(value); - } - return value; -} -export function formatDNodes(nodes, depth = 0) { - const isArrayFragment = Array.isArray(nodes) && depth === 0; - let initial = isArrayFragment ? '[\n' : ''; - let tabs = ''; - depth = isArrayFragment ? 1 : depth; - nodes = Array.isArray(nodes) ? nodes : [nodes]; - for (let i = 0; i < depth; i++) { - tabs = `${tabs}\t`; - } - let formattedNode = nodes.reduce((result, node, index) => { - if (node === null || node === undefined) { - return result; - } - if (index > 0) { - result = `${result}\n`; - } - result = `${result}${tabs}`; - if (typeof node === 'string') { - return `${result}"${node}"`; - } - result = `${result}${formatNode(node, tabs)}`; - if (node.children && node.children.length > 0) { - result = `${result}, [\n${formatDNodes(node.children, depth + 1)}\n${tabs}]`; - } - return `${result})`; - }, initial); - return isArrayFragment ? (formattedNode = `${formattedNode}\n]`) : formattedNode; -} -function formatProperties(properties, tabs) { - properties = Object.keys(properties) - .sort() - .reduce((props, key) => { - props[key] = properties[key]; - return props; - }, {}); - properties = JSON.stringify(properties, replacer, `${tabs}\t`).slice(0, -1); - return `${properties}${tabs}}`; -} -function getWidgetName(widgetConstructor) { - let name; - if (typeof widgetConstructor === 'string' || typeof widgetConstructor === 'symbol') { - name = widgetConstructor.toString(); - } - else { - name = widgetConstructor.name; - if (name === undefined) { - let id = widgetMap.get(widgetConstructor); - if (id === undefined) { - id = ++widgetClassCounter; - widgetMap.set(widgetConstructor, id); - } - name = `Widget-${id}`; - } - } - return name; -} -function formatNode(node, tabs) { - const propertyKeyCount = Object.keys(node.properties).length; - let properties = propertyKeyCount > 0 ? formatProperties(node.properties, tabs) : '{}'; - if (isWNode(node)) { - return `w(${getWidgetName(node.widgetConstructor)}, ${properties}`; - } - return `v("${node.tag}", ${properties}`; -} -export function assertRender(actual, expected, message) { - const parsedActual = formatDNodes(actual); - const parsedExpected = formatDNodes(expected); - const diffResult = diff.diffLines(parsedActual, parsedExpected); - let diffFound = false; - const parsedDiff = diffResult.reduce((result, part, index) => { - if (part.added) { - diffFound = true; - result = `${result}(E)${part.value.replace(/\n\t/g, '\n(E)\t')}`; - } - else if (part.removed) { - diffFound = true; - result = `${result}(A)${part.value.replace(/\n\t/g, '\n(A)\t')}`; - } - else { - result = `${result}${part.value}`; - } - return result; - }, '\n'); - if (diffFound) { - throw new Error(parsedDiff); - } -} -export default assertRender; -//# sourceMappingURL=assertRender.mjs.map \ No newline at end of file diff --git a/deps/framework/testing/support/assertRender.mjs.map b/deps/framework/testing/support/assertRender.mjs.map deleted file mode 100644 index 05a0c54bae..0000000000 --- a/deps/framework/testing/support/assertRender.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"assertRender.mjs","sourceRoot":"","sources":["assertRender.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAC9C,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAC7B,OAAO,OAAO,MAAM,oBAAoB,CAAC;AACzC,OAAO,GAAG,MAAM,gBAAgB,CAAC;AACjC,OAAO,GAAG,MAAM,gBAAgB,CAAC;AACjC,OAAO,EAAE,IAAI,IAAI,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAErD,IAAI,kBAAkB,GAAG,CAAC,CAAC;AAC3B,MAAM,SAAS,GAAG,IAAI,OAAO,EAAmD,CAAC;AAEjF,kBAAkB,GAAW,EAAE,KAAU;IACxC,EAAE,CAAC,CAAC,OAAO,KAAK,KAAK,UAAU,CAAC,CAAC,CAAC;QACjC,MAAM,CAAC,UAAU,CAAC;IACnB,CAAC;IAAC,IAAI,CAAC,EAAE,CAAC,CAAC,OAAO,KAAK,KAAK,WAAW,CAAC,CAAC,CAAC;QACzC,MAAM,CAAC,WAAW,CAAC;IACpB,CAAC;IAAC,IAAI,CAAC,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AAC,QAAQ,CAAC,CAAC;IAC9C,MAAM,UAAU,GAAG,IAAI,CAAC,SAAS,CAAC,YAAY,EAAE,cAAc,CAAC,CAAC;IAChE,IAAI,SAAS,GAAG,KAAK,CAAC;IACtB,MAAM,UAAU,GAAG,UAAU,CAAC,MAAM,CAAC,CAAC,MAAc,EAAE,IAAI,EAAE,KAAK,EAAE,EAAE;QACpE,EAAE,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC;YAChB,SAAS,GAAG,IAAI,CAAC;YACjB,MAAM,GAAG,GAAG,MAAM,MAAM,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,OAAO,EAAE,SAAS,CAAC,EAAE,CAAC;QAClE,CAAC;QAAC,IAAI,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC;YACzB,SAAS,GAAG,IAAI,CAAC;YACjB,MAAM,GAAG,GAAG,MAAM,MAAM,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,OAAO,EAAE,SAAS,CAAC,EAAE,CAAC;QAClE,CAAC;QAAC,IAAI,CAAC,CAAC;YACP,MAAM,GAAG,GAAG,MAAM,GAAG,IAAI,CAAC,KAAK,EAAE,CAAC;QACnC,CAAC;QACD,MAAM,CAAC,MAAM,CAAC;IACf,CAAC,EAAE,IAAI,CAAC,CAAC;IAET,EAAE,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC;QACf,MAAM,IAAI,KAAK,CAAC,UAAU,CAAC,CAAC;IAC7B,CAAC;AACF,CAAC;AAED,eAAe,YAAY,CAAC","sourcesContent":["import { DNode, WNode, VNode, DefaultWidgetBaseInterface, Constructor } from '../../widget-core/interfaces';\nimport { isWNode } from '../../widget-core/d';\nimport * as diff from 'diff';\nimport WeakMap from '../../shim/WeakMap';\nimport Set from '../../shim/Set';\nimport Map from '../../shim/Map';\nimport { from as arrayFrom } from '../../shim/array';\n\nlet widgetClassCounter = 0;\nconst widgetMap = new WeakMap, number>();\n\nfunction replacer(key: string, value: any): any {\n\tif (typeof value === 'function') {\n\t\treturn 'function';\n\t} else if (typeof value === 'undefined') {\n\t\treturn 'undefined';\n\t} else if (value instanceof Set || value instanceof Map) {\n\t\treturn arrayFrom(value);\n\t}\n\treturn value;\n}\n\nexport function formatDNodes(nodes: DNode | DNode[], depth: number = 0): string {\n\tconst isArrayFragment = Array.isArray(nodes) && depth === 0;\n\tlet initial = isArrayFragment ? '[\\n' : '';\n\tlet tabs = '';\n\tdepth = isArrayFragment ? 1 : depth;\n\tnodes = Array.isArray(nodes) ? nodes : [nodes];\n\n\tfor (let i = 0; i < depth; i++) {\n\t\ttabs = `${tabs}\\t`;\n\t}\n\tlet formattedNode = nodes.reduce((result: string, node, index) => {\n\t\tif (node === null || node === undefined) {\n\t\t\treturn result;\n\t\t}\n\t\tif (index > 0) {\n\t\t\tresult = `${result}\\n`;\n\t\t}\n\t\tresult = `${result}${tabs}`;\n\n\t\tif (typeof node === 'string') {\n\t\t\treturn `${result}\"${node}\"`;\n\t\t}\n\n\t\tresult = `${result}${formatNode(node, tabs)}`;\n\t\tif (node.children && node.children.length > 0) {\n\t\t\tresult = `${result}, [\\n${formatDNodes(node.children, depth + 1)}\\n${tabs}]`;\n\t\t}\n\t\treturn `${result})`;\n\t}, initial);\n\n\treturn isArrayFragment ? (formattedNode = `${formattedNode}\\n]`) : formattedNode;\n}\n\nfunction formatProperties(properties: any, tabs: string): string {\n\tproperties = Object.keys(properties)\n\t\t.sort()\n\t\t.reduce((props: any, key) => {\n\t\t\tprops[key] = properties[key];\n\t\t\treturn props;\n\t\t}, {});\n\tproperties = JSON.stringify(properties, replacer, `${tabs}\\t`).slice(0, -1);\n\treturn `${properties}${tabs}}`;\n}\n\nfunction getWidgetName(widgetConstructor: any): string {\n\tlet name: string;\n\tif (typeof widgetConstructor === 'string' || typeof widgetConstructor === 'symbol') {\n\t\tname = widgetConstructor.toString();\n\t} else {\n\t\tname = widgetConstructor.name;\n\t\tif (name === undefined) {\n\t\t\tlet id = widgetMap.get(widgetConstructor);\n\t\t\tif (id === undefined) {\n\t\t\t\tid = ++widgetClassCounter;\n\t\t\t\twidgetMap.set(widgetConstructor, id);\n\t\t\t}\n\t\t\tname = `Widget-${id}`;\n\t\t}\n\t}\n\treturn name;\n}\n\nfunction formatNode(node: WNode | VNode, tabs: any): string {\n\tconst propertyKeyCount = Object.keys(node.properties).length;\n\tlet properties = propertyKeyCount > 0 ? formatProperties(node.properties, tabs) : '{}';\n\tif (isWNode(node)) {\n\t\treturn `w(${getWidgetName(node.widgetConstructor)}, ${properties}`;\n\t}\n\treturn `v(\"${node.tag}\", ${properties}`;\n}\n\nexport function assertRender(actual: DNode | DNode[], expected: DNode | DNode[], message?: string): void {\n\tconst parsedActual = formatDNodes(actual);\n\tconst parsedExpected = formatDNodes(expected);\n\tconst diffResult = diff.diffLines(parsedActual, parsedExpected);\n\tlet diffFound = false;\n\tconst parsedDiff = diffResult.reduce((result: string, part, index) => {\n\t\tif (part.added) {\n\t\t\tdiffFound = true;\n\t\t\tresult = `${result}(E)${part.value.replace(/\\n\\t/g, '\\n(E)\\t')}`;\n\t\t} else if (part.removed) {\n\t\t\tdiffFound = true;\n\t\t\tresult = `${result}(A)${part.value.replace(/\\n\\t/g, '\\n(A)\\t')}`;\n\t\t} else {\n\t\t\tresult = `${result}${part.value}`;\n\t\t}\n\t\treturn result;\n\t}, '\\n');\n\n\tif (diffFound) {\n\t\tthrow new Error(parsedDiff);\n\t}\n}\n\nexport default assertRender;\n"]} \ No newline at end of file diff --git a/deps/framework/testing/support/selector.d.ts b/deps/framework/testing/support/selector.d.ts deleted file mode 100644 index b3bb162dcd..0000000000 --- a/deps/framework/testing/support/selector.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { DNode, DefaultWidgetBaseInterface, WNode, VNode } from '../../widget-core/interfaces'; -export declare type TestFunction = (elem: DNode) => boolean; -export declare const parseSelector: (selector: string) => string; -export declare const adapter: any; -export declare function select(selector: string, nodes: DNode | DNode[]): (WNode | VNode)[]; -export default select; diff --git a/deps/framework/testing/support/selector.js b/deps/framework/testing/support/selector.js deleted file mode 100644 index 0348a2b1dc..0000000000 --- a/deps/framework/testing/support/selector.js +++ /dev/null @@ -1,120 +0,0 @@ -(function (factory) { - if (typeof module === "object" && typeof module.exports === "object") { - var v = factory(require, exports); - if (v !== undefined) module.exports = v; - } - else if (typeof define === "function" && define.amd) { - define(["require", "exports", "tslib", "../../widget-core/d", "css-select-umd"], factory); - } -})(function (require, exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - var tslib_1 = require("tslib"); - var d_1 = require("../../widget-core/d"); - var cssSelect = require("css-select-umd"); - exports.parseSelector = function (selector) { - var selectors = selector.split(' '); - return selectors - .map(function (selector) { - var keySigilIndex = selector.indexOf('@'); - if (keySigilIndex === 0) { - return "[key=\"" + selector.substr(1) + "\"]"; - } - else if (keySigilIndex > 0) { - var key = selector.substring(keySigilIndex + 1); - return selector.slice(0, keySigilIndex) + "[key=\"" + key + "\"]"; - } - return selector; - }) - .join(' '); - }; - exports.adapter = { - isTag: function (elem) { - return d_1.isVNode(elem); - }, - getText: function (elem) { - return ''; - }, - removeSubsets: function (elements) { - return elements; - }, - getChildren: function (elem) { - return d_1.isVNode(elem) || d_1.isWNode(elem) ? elem.children : []; - }, - getAttributeValue: function (elem, name) { - if (d_1.isVNode(elem) || d_1.isWNode(elem)) { - if (name === 'class') { - var classes = elem.properties.classes; - if (Array.isArray(classes)) { - return classes.join(' '); - } - return classes; - } - return elem.properties[name]; - } - }, - hasAttrib: function (elem, name) { - if (d_1.isVNode(elem) || d_1.isWNode(elem)) { - return name in elem.properties; - } - return false; - }, - existsOne: function (test, elements) { - return elements.some(function (elem) { return test(elem); }); - }, - getName: function (elem) { - if (d_1.isVNode(elem)) { - return elem.tag; - } - }, - getParent: function (elem) { - if (d_1.isVNode(elem) || d_1.isWNode(elem)) { - return elem.parent; - } - }, - getSiblings: function (elem) { - if (d_1.isVNode(elem) || d_1.isWNode(elem)) { - if (elem.parent) { - return elem.parent.children; - } - return [elem]; - } - }, - findOne: function (test, arr) { - var elem = null; - for (var i = 0, l = arr.length; i < l && !elem; i++) { - if (test(arr[i])) { - elem = arr[i]; - } - else { - var children = exports.adapter.getChildren(arr[i]); - if (children && children.length > 0) { - elem = exports.adapter.findOne(test, children); - } - } - } - return elem; - }, - findAll: function (test, elements) { - var result = []; - for (var i = 0, j = elements.length; i < j; i++) { - if (test(elements[i])) { - result.push(elements[i]); - } - var children = exports.adapter.getChildren(elements[i]); - if (children) { - result = tslib_1.__spread(result, exports.adapter.findAll(test, children)); - } - } - return result; - } - }; - function select(selector, nodes) { - nodes = Array.isArray(nodes) ? nodes : [nodes]; - selector = exports.parseSelector(selector); - return cssSelect(selector, nodes, { adapter: exports.adapter }); - } - exports.select = select; - exports.default = select; -}); -//# sourceMappingURL=selector.js.map \ No newline at end of file diff --git a/deps/framework/testing/support/selector.js.map b/deps/framework/testing/support/selector.js.map deleted file mode 100644 index 29f0eb6fd6..0000000000 --- a/deps/framework/testing/support/selector.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"selector.js","sourceRoot":"","sources":["selector.ts"],"names":[],"mappings":";;;;;;;;;;;;IACA,yCAAuD;IACvD,0CAA4C;IAI/B,QAAA,aAAa,GAAG,UAAC,QAAgB;QAC7C,IAAM,SAAS,GAAG,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QACtC,MAAM,CAAC,SAAS;aACd,GAAG,CAAC,UAAC,QAAQ;YACb,IAAM,aAAa,GAAG,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;YAC5C,EAAE,CAAC,CAAC,aAAa,KAAK,CAAC,CAAC,CAAC,CAAC;gBACzB,MAAM,CAAC,YAAS,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,QAAI,CAAC;YACxC,CAAC;YAAC,IAAI,CAAC,EAAE,CAAC,CAAC,aAAa,GAAG,CAAC,CAAC,CAAC,CAAC;gBAC9B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C,MAAM,CAAC;QACf,CAAC;KACD,CAAC;IAEF,gBAAuB,QAAgB,EAAE,KAAsB;QAC9D,KAAK,GAAG,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;QAC/C,QAAQ,GAAG,qBAAa,CAAC,QAAQ,CAAC,CAAC;QACnC,MAAM,CAAC,SAAS,CAAC,QAAQ,EAAE,KAAK,EAAE,EAAE,OAAO,iBAAA,EAAE,CAAsB,CAAC;IACrE,CAAC;IAJD,wBAIC;IAED,kBAAe,MAAM,CAAC","sourcesContent":["import { DNode, DefaultWidgetBaseInterface, WNode, VNode } from '../../widget-core/interfaces';\nimport { isVNode, isWNode } from '../../widget-core/d';\nimport * as cssSelect from 'css-select-umd';\n\nexport type TestFunction = (elem: DNode) => boolean;\n\nexport const parseSelector = (selector: string) => {\n\tconst selectors = selector.split(' ');\n\treturn selectors\n\t\t.map((selector) => {\n\t\t\tconst keySigilIndex = selector.indexOf('@');\n\t\t\tif (keySigilIndex === 0) {\n\t\t\t\treturn `[key=\"${selector.substr(1)}\"]`;\n\t\t\t} else if (keySigilIndex > 0) {\n\t\t\t\tconst key = selector.substring(keySigilIndex + 1);\n\t\t\t\treturn `${selector.slice(0, keySigilIndex)}[key=\"${key}\"]`;\n\t\t\t}\n\t\t\treturn selector;\n\t\t})\n\t\t.join(' ');\n};\n\nexport const adapter: any = {\n\tisTag(elem: DNode) {\n\t\treturn isVNode(elem);\n\t},\n\tgetText(elem: DNode[]) {\n\t\treturn '';\n\t},\n\tremoveSubsets(elements: DNode[]) {\n\t\treturn elements;\n\t},\n\tgetChildren(elem: DNode) {\n\t\treturn isVNode(elem) || isWNode(elem) ? elem.children : [];\n\t},\n\tgetAttributeValue(elem: DNode, name: string) {\n\t\tif (isVNode(elem) || isWNode(elem)) {\n\t\t\tif (name === 'class') {\n\t\t\t\tconst classes = (elem.properties as any).classes;\n\t\t\t\tif (Array.isArray(classes)) {\n\t\t\t\t\treturn classes.join(' ');\n\t\t\t\t}\n\t\t\t\treturn classes;\n\t\t\t}\n\t\t\treturn (elem.properties as any)[name];\n\t\t}\n\t},\n\thasAttrib(elem: DNode, name: string) {\n\t\tif (isVNode(elem) || isWNode(elem)) {\n\t\t\treturn name in elem.properties;\n\t\t}\n\t\treturn false;\n\t},\n\texistsOne(test: TestFunction, elements: DNode[]) {\n\t\treturn elements.some((elem: DNode) => test(elem));\n\t},\n\tgetName(elem: DNode) {\n\t\tif (isVNode(elem)) {\n\t\t\treturn elem.tag;\n\t\t}\n\t},\n\tgetParent(elem: DNode) {\n\t\tif (isVNode(elem) || isWNode(elem)) {\n\t\t\treturn (elem as any).parent;\n\t\t}\n\t},\n\tgetSiblings(elem: DNode) {\n\t\tif (isVNode(elem) || isWNode(elem)) {\n\t\t\tif ((elem as any).parent) {\n\t\t\t\treturn (elem as any).parent.children;\n\t\t\t}\n\t\t\treturn [elem];\n\t\t}\n\t},\n\tfindOne(test: TestFunction, arr: DNode[]): DNode {\n\t\tlet elem = null;\n\t\tfor (let i = 0, l = arr.length; i < l && !elem; i++) {\n\t\t\tif (test(arr[i])) {\n\t\t\t\telem = arr[i];\n\t\t\t} else {\n\t\t\t\tconst children = adapter.getChildren(arr[i]);\n\t\t\t\tif (children && children.length > 0) {\n\t\t\t\t\telem = adapter.findOne(test, children);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn elem;\n\t},\n\tfindAll(test: TestFunction, elements: DNode[]): DNode[] {\n\t\tlet result: DNode[] = [];\n\t\tfor (let i = 0, j = elements.length; i < j; i++) {\n\t\t\tif (test(elements[i])) {\n\t\t\t\tresult.push(elements[i]);\n\t\t\t}\n\t\t\tconst children = adapter.getChildren(elements[i]);\n\t\t\tif (children) {\n\t\t\t\tresult = [...result, ...adapter.findAll(test, children)];\n\t\t\t}\n\t\t}\n\t\treturn result;\n\t}\n};\n\nexport function select(selector: string, nodes: DNode | DNode[]): (WNode | VNode)[] {\n\tnodes = Array.isArray(nodes) ? nodes : [nodes];\n\tselector = parseSelector(selector);\n\treturn cssSelect(selector, nodes, { adapter }) as (WNode | VNode)[];\n}\n\nexport default select;\n"]} \ No newline at end of file diff --git a/deps/framework/testing/support/selector.mjs b/deps/framework/testing/support/selector.mjs deleted file mode 100644 index 9d796dc2f0..0000000000 --- a/deps/framework/testing/support/selector.mjs +++ /dev/null @@ -1,106 +0,0 @@ -import { isVNode, isWNode } from '../../widget-core/d'; -import * as cssSelect from 'css-select-umd'; -export const parseSelector = (selector) => { - const selectors = selector.split(' '); - return selectors - .map((selector) => { - const keySigilIndex = selector.indexOf('@'); - if (keySigilIndex === 0) { - return `[key="${selector.substr(1)}"]`; - } - else if (keySigilIndex > 0) { - const key = selector.substring(keySigilIndex + 1); - return `${selector.slice(0, keySigilIndex)}[key="${key}"]`; - } - return selector; - }) - .join(' '); -}; -export const adapter = { - isTag(elem) { - return isVNode(elem); - }, - getText(elem) { - return ''; - }, - removeSubsets(elements) { - return elements; - }, - getChildren(elem) { - return isVNode(elem) || isWNode(elem) ? elem.children : []; - }, - getAttributeValue(elem, name) { - if (isVNode(elem) || isWNode(elem)) { - if (name === 'class') { - const classes = elem.properties.classes; - if (Array.isArray(classes)) { - return classes.join(' '); - } - return classes; - } - return elem.properties[name]; - } - }, - hasAttrib(elem, name) { - if (isVNode(elem) || isWNode(elem)) { - return name in elem.properties; - } - return false; - }, - existsOne(test, elements) { - return elements.some((elem) => test(elem)); - }, - getName(elem) { - if (isVNode(elem)) { - return elem.tag; - } - }, - getParent(elem) { - if (isVNode(elem) || isWNode(elem)) { - return elem.parent; - } - }, - getSiblings(elem) { - if (isVNode(elem) || isWNode(elem)) { - if (elem.parent) { - return elem.parent.children; - } - return [elem]; - } - }, - findOne(test, arr) { - let elem = null; - for (let i = 0, l = arr.length; i < l && !elem; i++) { - if (test(arr[i])) { - elem = arr[i]; - } - else { - const children = adapter.getChildren(arr[i]); - if (children && children.length > 0) { - elem = adapter.findOne(test, children); - } - } - } - return elem; - }, - findAll(test, elements) { - let result = []; - for (let i = 0, j = elements.length; i < j; i++) { - if (test(elements[i])) { - result.push(elements[i]); - } - const children = adapter.getChildren(elements[i]); - if (children) { - result = [...result, ...adapter.findAll(test, children)]; - } - } - return result; - } -}; -export function select(selector, nodes) { - nodes = Array.isArray(nodes) ? nodes : [nodes]; - selector = parseSelector(selector); - return cssSelect(selector, nodes, { adapter }); -} -export default select; -//# sourceMappingURL=selector.mjs.map \ No newline at end of file diff --git a/deps/framework/testing/support/selector.mjs.map b/deps/framework/testing/support/selector.mjs.map deleted file mode 100644 index b31053dd3a..0000000000 --- a/deps/framework/testing/support/selector.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"selector.mjs","sourceRoot":"","sources":["selector.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,KAAK,SAAS,MAAM,gBAAgB,CAAC;AAI5C,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,QAAgB,EAAE,EAAE;IACjD,MAAM,SAAS,GAAG,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IACtC,MAAM,CAAC,SAAS;SACd,GAAG,CAAC,CAAC,QAAQ,EAAE,EAAE;QACjB,MAAM,aAAa,GAAG,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;QAC5C,EAAE,CAAC,CAAC,aAAa,KAAK,CAAC,CAAC,CAAC,CAAC;YACzB,MAAM,CAAC,SAAS,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC;QACxC,CAAC;QAAC,IAAI,CAAC,EAAE,CAAC,CAAC,aAAa,GAAG,CAAC,CAAC,CAAC,CAAC;YAC9B,MAAM,GAAG,GAAG,QAAQ,CAAC,SAAS,CAAC,aAAa,GAAG,CAAC,CAAC,CAAC;YAClD,MAAM,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC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,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;IAC/C,QAAQ,GAAG,aAAa,CAAC,QAAQ,CAAC,CAAC;IACnC,MAAM,CAAC,SAAS,CAAC,QAAQ,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,CAAsB,CAAC;AACrE,CAAC;AAED,eAAe,MAAM,CAAC","sourcesContent":["import { DNode, DefaultWidgetBaseInterface, WNode, VNode } from '../../widget-core/interfaces';\nimport { isVNode, isWNode } from '../../widget-core/d';\nimport * as cssSelect from 'css-select-umd';\n\nexport type TestFunction = (elem: DNode) => boolean;\n\nexport const parseSelector = (selector: string) => {\n\tconst selectors = selector.split(' ');\n\treturn selectors\n\t\t.map((selector) => {\n\t\t\tconst keySigilIndex = selector.indexOf('@');\n\t\t\tif (keySigilIndex === 0) {\n\t\t\t\treturn `[key=\"${selector.substr(1)}\"]`;\n\t\t\t} else if (keySigilIndex > 0) {\n\t\t\t\tconst key = selector.substring(keySigilIndex + 1);\n\t\t\t\treturn `${selector.slice(0, keySigilIndex)}[key=\"${key}\"]`;\n\t\t\t}\n\t\t\treturn selector;\n\t\t})\n\t\t.join(' ');\n};\n\nexport const adapter: any = {\n\tisTag(elem: DNode) {\n\t\treturn isVNode(elem);\n\t},\n\tgetText(elem: DNode[]) {\n\t\treturn '';\n\t},\n\tremoveSubsets(elements: DNode[]) {\n\t\treturn elements;\n\t},\n\tgetChildren(elem: DNode) {\n\t\treturn isVNode(elem) || isWNode(elem) ? elem.children : [];\n\t},\n\tgetAttributeValue(elem: DNode, name: string) {\n\t\tif (isVNode(elem) || isWNode(elem)) {\n\t\t\tif (name === 'class') {\n\t\t\t\tconst classes = (elem.properties as any).classes;\n\t\t\t\tif (Array.isArray(classes)) {\n\t\t\t\t\treturn classes.join(' ');\n\t\t\t\t}\n\t\t\t\treturn classes;\n\t\t\t}\n\t\t\treturn (elem.properties as any)[name];\n\t\t}\n\t},\n\thasAttrib(elem: DNode, name: string) {\n\t\tif (isVNode(elem) || isWNode(elem)) {\n\t\t\treturn name in elem.properties;\n\t\t}\n\t\treturn false;\n\t},\n\texistsOne(test: TestFunction, elements: DNode[]) {\n\t\treturn elements.some((elem: DNode) => test(elem));\n\t},\n\tgetName(elem: DNode) {\n\t\tif (isVNode(elem)) {\n\t\t\treturn elem.tag;\n\t\t}\n\t},\n\tgetParent(elem: DNode) {\n\t\tif (isVNode(elem) || isWNode(elem)) {\n\t\t\treturn (elem as any).parent;\n\t\t}\n\t},\n\tgetSiblings(elem: DNode) {\n\t\tif (isVNode(elem) || isWNode(elem)) {\n\t\t\tif ((elem as any).parent) {\n\t\t\t\treturn (elem as any).parent.children;\n\t\t\t}\n\t\t\treturn [elem];\n\t\t}\n\t},\n\tfindOne(test: TestFunction, arr: DNode[]): DNode {\n\t\tlet elem = null;\n\t\tfor (let i = 0, l = arr.length; i < l && !elem; i++) {\n\t\t\tif (test(arr[i])) {\n\t\t\t\telem = arr[i];\n\t\t\t} else {\n\t\t\t\tconst children = adapter.getChildren(arr[i]);\n\t\t\t\tif (children && children.length > 0) {\n\t\t\t\t\telem = adapter.findOne(test, children);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn elem;\n\t},\n\tfindAll(test: TestFunction, elements: DNode[]): DNode[] {\n\t\tlet result: DNode[] = [];\n\t\tfor (let i = 0, j = elements.length; i < j; i++) {\n\t\t\tif (test(elements[i])) {\n\t\t\t\tresult.push(elements[i]);\n\t\t\t}\n\t\t\tconst children = adapter.getChildren(elements[i]);\n\t\t\tif (children) {\n\t\t\t\tresult = [...result, ...adapter.findAll(test, children)];\n\t\t\t}\n\t\t}\n\t\treturn result;\n\t}\n};\n\nexport function select(selector: string, nodes: DNode | DNode[]): (WNode | VNode)[] {\n\tnodes = Array.isArray(nodes) ? nodes : [nodes];\n\tselector = parseSelector(selector);\n\treturn cssSelect(selector, nodes, { adapter }) as (WNode | VNode)[];\n}\n\nexport default select;\n"]} \ No newline at end of file diff --git a/deps/framework/typings.d.ts b/deps/framework/typings.d.ts deleted file mode 100644 index d335617da7..0000000000 --- a/deps/framework/typings.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -declare module 'globalize/dist/*' { - import * as Globalize from 'globalize'; - - export = Globalize; -} diff --git a/deps/framework/widget-core/Container.d.ts b/deps/framework/widget-core/Container.d.ts deleted file mode 100644 index a795e136ac..0000000000 --- a/deps/framework/widget-core/Container.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { WidgetBase } from './WidgetBase'; -import { GetProperties } from './decorators/inject'; -import { Constructor, RegistryLabel } from './interfaces'; -export declare type Container = Constructor>>; -export declare function Container(component: Constructor | RegistryLabel, name: RegistryLabel, {getProperties}: { - getProperties: GetProperties; -}): Container; -export default Container; diff --git a/deps/framework/widget-core/Container.js b/deps/framework/widget-core/Container.js deleted file mode 100644 index e333852e37..0000000000 --- a/deps/framework/widget-core/Container.js +++ /dev/null @@ -1,38 +0,0 @@ -(function (factory) { - if (typeof module === "object" && typeof module.exports === "object") { - var v = factory(require, exports); - if (v !== undefined) module.exports = v; - } - else if (typeof define === "function" && define.amd) { - define(["require", "exports", "tslib", "./WidgetBase", "./decorators/inject", "./d", "./decorators/alwaysRender"], factory); - } -})(function (require, exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - var tslib_1 = require("tslib"); - var WidgetBase_1 = require("./WidgetBase"); - var inject_1 = require("./decorators/inject"); - var d_1 = require("./d"); - var alwaysRender_1 = require("./decorators/alwaysRender"); - function Container(component, name, _a) { - var getProperties = _a.getProperties; - var WidgetContainer = /** @class */ (function (_super) { - tslib_1.__extends(WidgetContainer, _super); - function WidgetContainer() { - return _super !== null && _super.apply(this, arguments) || this; - } - WidgetContainer.prototype.render = function () { - return d_1.w(component, this.properties, this.children); - }; - WidgetContainer = tslib_1.__decorate([ - alwaysRender_1.alwaysRender(), - inject_1.inject({ name: name, getProperties: getProperties }) - ], WidgetContainer); - return WidgetContainer; - }(WidgetBase_1.WidgetBase)); - return WidgetContainer; - } - exports.Container = Container; - exports.default = Container; -}); -//# sourceMappingURL=Container.js.map \ No newline at end of file diff --git a/deps/framework/widget-core/Container.js.map b/deps/framework/widget-core/Container.js.map deleted file mode 100644 index c82121a946..0000000000 --- a/deps/framework/widget-core/Container.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"Container.js","sourceRoot":"","sources":["Container.ts"],"names":[],"mappings":";;;;;;;;;;;;IAAA,2CAA0C;IAC1C,8CAA4D;IAE5D,yBAAwB;IACxB,0DAAyD;IAIzD,mBACC,SAAyC,EACzC,IAAmB,EACnB,EAAmD;YAAjD,gCAAa;QAIf;YAA8B,2CAAoC;YAAlE;;YAIA,CAAC;YAHU,gCAAM,GAAhB;gBACC,MAAM,CAAC,KAAC,CAAC,SAAS,EAAE,IAAI,CAAC,UAAU,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC;YACrD,CAAC;YAHI,eAAe;gBAFpB,2BAAY,EAAE;gBACd,eAAM,CAAC,EAAE,IAAI,MAAA,EAAE,aAAa,eAAA,EAAE,CAAC;eAC1B,eAAe,CAIpB;YAAD,sBAAC;SAAA,AAJD,CAA8B,uBAAU,GAIvC;QACD,MAAM,CAAC,eAAe,CAAC;IACxB,CAAC;IAbD,8BAaC;IAED,kBAAe,SAAS,CAAC","sourcesContent":["import { WidgetBase } from './WidgetBase';\nimport { inject, GetProperties } from './decorators/inject';\nimport { Constructor, DNode, RegistryLabel } from './interfaces';\nimport { w } from './d';\nimport { alwaysRender } from './decorators/alwaysRender';\n\nexport type Container = Constructor>>;\n\nexport function Container(\n\tcomponent: Constructor | RegistryLabel,\n\tname: RegistryLabel,\n\t{ getProperties }: { getProperties: GetProperties }\n): Container {\n\t@alwaysRender()\n\t@inject({ name, getProperties })\n\tclass WidgetContainer extends WidgetBase> {\n\t\tprotected render(): DNode {\n\t\t\treturn w(component, this.properties, this.children);\n\t\t}\n\t}\n\treturn WidgetContainer;\n}\n\nexport default Container;\n"]} \ No newline at end of file diff --git a/deps/framework/widget-core/Container.mjs b/deps/framework/widget-core/Container.mjs deleted file mode 100644 index a75489d7b8..0000000000 --- a/deps/framework/widget-core/Container.mjs +++ /dev/null @@ -1,19 +0,0 @@ -import * as tslib_1 from "tslib"; -import { WidgetBase } from './WidgetBase'; -import { inject } from './decorators/inject'; -import { w } from './d'; -import { alwaysRender } from './decorators/alwaysRender'; -export function Container(component, name, { getProperties }) { - let WidgetContainer = class WidgetContainer extends WidgetBase { - render() { - return w(component, this.properties, this.children); - } - }; - WidgetContainer = tslib_1.__decorate([ - alwaysRender(), - inject({ name, getProperties }) - ], WidgetContainer); - return WidgetContainer; -} -export default Container; -//# sourceMappingURL=Container.mjs.map \ No newline at end of file diff --git a/deps/framework/widget-core/Container.mjs.map b/deps/framework/widget-core/Container.mjs.map deleted file mode 100644 index 1f8a2f403d..0000000000 --- a/deps/framework/widget-core/Container.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"Container.mjs","sourceRoot":"","sources":["Container.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,MAAM,EAAiB,MAAM,qBAAqB,CAAC;AAE5D,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAIzD,MAAM,oBACL,SAAyC,EACzC,IAAmB,EACnB,EAAE,aAAa,EAAoC;IAInD,IAAM,eAAe,GAArB,qBAAsB,SAAQ,UAAoC;QACvD,MAAM;YACf,MAAM,CAAC,CAAC,CAAC,SAAS,EAAE,IAAI,CAAC,UAAU,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC;QACrD,CAAC;KACD,CAAA;IAJK,eAAe;QAFpB,YAAY,EAAE;QACd,MAAM,CAAC,EAAE,IAAI,EAAE,aAAa,EAAE,CAAC;OAC1B,eAAe,CAIpB;IACD,MAAM,CAAC,eAAe,CAAC;AACxB,CAAC;AAED,eAAe,SAAS,CAAC","sourcesContent":["import { WidgetBase } from './WidgetBase';\nimport { inject, GetProperties } from './decorators/inject';\nimport { Constructor, DNode, RegistryLabel } from './interfaces';\nimport { w } from './d';\nimport { alwaysRender } from './decorators/alwaysRender';\n\nexport type Container = Constructor>>;\n\nexport function Container(\n\tcomponent: Constructor | RegistryLabel,\n\tname: RegistryLabel,\n\t{ getProperties }: { getProperties: GetProperties }\n): Container {\n\t@alwaysRender()\n\t@inject({ name, getProperties })\n\tclass WidgetContainer extends WidgetBase> {\n\t\tprotected render(): DNode {\n\t\t\treturn w(component, this.properties, this.children);\n\t\t}\n\t}\n\treturn WidgetContainer;\n}\n\nexport default Container;\n"]} \ No newline at end of file diff --git a/deps/framework/widget-core/Injector.d.ts b/deps/framework/widget-core/Injector.d.ts deleted file mode 100644 index 26f7155b3f..0000000000 --- a/deps/framework/widget-core/Injector.d.ts +++ /dev/null @@ -1,14 +0,0 @@ -import { Evented } from '../core/Evented'; -import { EventObject } from '../core/interfaces'; -export declare type InjectorEventMap = { - invalidate: EventObject<'invalidate'>; -}; -export declare class Injector extends Evented { - private _payload; - private _invalidator; - constructor(payload: T); - setInvalidator(invalidator: () => void): void; - get(): T; - set(payload: T): void; -} -export default Injector; diff --git a/deps/framework/widget-core/Injector.js b/deps/framework/widget-core/Injector.js deleted file mode 100644 index 49ce40f1e6..0000000000 --- a/deps/framework/widget-core/Injector.js +++ /dev/null @@ -1,38 +0,0 @@ -(function (factory) { - if (typeof module === "object" && typeof module.exports === "object") { - var v = factory(require, exports); - if (v !== undefined) module.exports = v; - } - else if (typeof define === "function" && define.amd) { - define(["require", "exports", "tslib", "../core/Evented"], factory); - } -})(function (require, exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - var tslib_1 = require("tslib"); - var Evented_1 = require("../core/Evented"); - var Injector = /** @class */ (function (_super) { - tslib_1.__extends(Injector, _super); - function Injector(payload) { - var _this = _super.call(this) || this; - _this._payload = payload; - return _this; - } - Injector.prototype.setInvalidator = function (invalidator) { - this._invalidator = invalidator; - }; - Injector.prototype.get = function () { - return this._payload; - }; - Injector.prototype.set = function (payload) { - this._payload = payload; - if (this._invalidator) { - this._invalidator(); - } - }; - return Injector; - }(Evented_1.Evented)); - exports.Injector = Injector; - exports.default = Injector; -}); -//# sourceMappingURL=Injector.js.map \ No newline at end of file diff --git a/deps/framework/widget-core/Injector.js.map b/deps/framework/widget-core/Injector.js.map deleted file mode 100644 index a582c86c55..0000000000 --- a/deps/framework/widget-core/Injector.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"Injector.js","sourceRoot":"","sources":["Injector.ts"],"names":[],"mappings":";;;;;;;;;;;;IAAA,2CAA0C;IAO1C;QAAuC,oCAAyB;QAI/D,kBAAY,OAAU;YAAtB,YACC,iBAAO,SAEP;YADA,KAAI,CAAC,QAAQ,GAAG,OAAO,CAAC;;QACzB,CAAC;QAEM,iCAAc,GAArB,UAAsB,WAAuB;YAC5C,IAAI,CAAC,YAAY,GAAG,WAAW,CAAC;QACjC,CAAC;QAEM,sBAAG,GAAV;YACC,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC;QACtB,CAAC;QAEM,sBAAG,GAAV,UAAW,OAAU;YACpB,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC;YACxB,EAAE,CAAC,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC;gBACvB,IAAI,CAAC,YAAY,EAAE,CAAC;YACrB,CAAC;QACF,CAAC;QACF,eAAC;IAAD,CAAC,AAvBD,CAAuC,iBAAO,GAuB7C;IAvBY,4BAAQ;IAyBrB,kBAAe,QAAQ,CAAC","sourcesContent":["import { Evented } from '../core/Evented';\nimport { EventObject } from '../core/interfaces';\n\nexport type InjectorEventMap = {\n\tinvalidate: EventObject<'invalidate'>;\n};\n\nexport class Injector extends Evented {\n\tprivate _payload: T;\n\tprivate _invalidator: undefined | (() => void);\n\n\tconstructor(payload: T) {\n\t\tsuper();\n\t\tthis._payload = payload;\n\t}\n\n\tpublic setInvalidator(invalidator: () => void) {\n\t\tthis._invalidator = invalidator;\n\t}\n\n\tpublic get(): T {\n\t\treturn this._payload;\n\t}\n\n\tpublic set(payload: T): void {\n\t\tthis._payload = payload;\n\t\tif (this._invalidator) {\n\t\t\tthis._invalidator();\n\t\t}\n\t}\n}\n\nexport default Injector;\n"]} \ No newline at end of file diff --git a/deps/framework/widget-core/Injector.mjs b/deps/framework/widget-core/Injector.mjs deleted file mode 100644 index 00d21a3fa2..0000000000 --- a/deps/framework/widget-core/Injector.mjs +++ /dev/null @@ -1,21 +0,0 @@ -import { Evented } from '../core/Evented'; -export class Injector extends Evented { - constructor(payload) { - super(); - this._payload = payload; - } - setInvalidator(invalidator) { - this._invalidator = invalidator; - } - get() { - return this._payload; - } - set(payload) { - this._payload = payload; - if (this._invalidator) { - this._invalidator(); - } - } -} -export default Injector; -//# sourceMappingURL=Injector.mjs.map \ No newline at end of file diff --git a/deps/framework/widget-core/Injector.mjs.map b/deps/framework/widget-core/Injector.mjs.map deleted file mode 100644 index 2ba9052438..0000000000 --- a/deps/framework/widget-core/Injector.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"Injector.mjs","sourceRoot":"","sources":["Injector.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAO1C,MAAM,eAAyB,SAAQ,OAAyB;IAI/D,YAAY,OAAU;QACrB,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC;IACzB,CAAC;IAEM,cAAc,CAAC,WAAuB;QAC5C,IAAI,CAAC,YAAY,GAAG,WAAW,CAAC;IACjC,CAAC;IAEM,GAAG;QACT,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC;IACtB,CAAC;IAEM,GAAG,CAAC,OAAU;QACpB,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC;QACxB,EAAE,CAAC,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC;YACvB,IAAI,CAAC,YAAY,EAAE,CAAC;QACrB,CAAC;IACF,CAAC;CACD;AAED,eAAe,QAAQ,CAAC","sourcesContent":["import { Evented } from '../core/Evented';\nimport { EventObject } from '../core/interfaces';\n\nexport type InjectorEventMap = {\n\tinvalidate: EventObject<'invalidate'>;\n};\n\nexport class Injector extends Evented {\n\tprivate _payload: T;\n\tprivate _invalidator: undefined | (() => void);\n\n\tconstructor(payload: T) {\n\t\tsuper();\n\t\tthis._payload = payload;\n\t}\n\n\tpublic setInvalidator(invalidator: () => void) {\n\t\tthis._invalidator = invalidator;\n\t}\n\n\tpublic get(): T {\n\t\treturn this._payload;\n\t}\n\n\tpublic set(payload: T): void {\n\t\tthis._payload = payload;\n\t\tif (this._invalidator) {\n\t\t\tthis._invalidator();\n\t\t}\n\t}\n}\n\nexport default Injector;\n"]} \ No newline at end of file diff --git a/deps/framework/widget-core/NodeHandler.d.ts b/deps/framework/widget-core/NodeHandler.d.ts deleted file mode 100644 index cc090c1d8d..0000000000 --- a/deps/framework/widget-core/NodeHandler.d.ts +++ /dev/null @@ -1,26 +0,0 @@ -import { Evented } from '../core/Evented'; -import { EventObject } from '../core/interfaces'; -import { NodeHandlerInterface } from './interfaces'; -/** - * Enum to identify the type of event. - * Listening to 'Projector' will notify when projector is created or updated - * Listening to 'Widget' will notify when widget root is created or updated - */ -export declare enum NodeEventType { - Projector = "Projector", - Widget = "Widget", -} -export declare type NodeHandlerEventMap = { - Projector: EventObject; - Widget: EventObject; -}; -export declare class NodeHandler extends Evented implements NodeHandlerInterface { - private _nodeMap; - get(key: string): Element | undefined; - has(key: string): boolean; - add(element: Element, key: string): void; - addRoot(): void; - addProjector(): void; - clear(): void; -} -export default NodeHandler; diff --git a/deps/framework/widget-core/NodeHandler.js b/deps/framework/widget-core/NodeHandler.js deleted file mode 100644 index 12ad5a2780..0000000000 --- a/deps/framework/widget-core/NodeHandler.js +++ /dev/null @@ -1,56 +0,0 @@ -(function (factory) { - if (typeof module === "object" && typeof module.exports === "object") { - var v = factory(require, exports); - if (v !== undefined) module.exports = v; - } - else if (typeof define === "function" && define.amd) { - define(["require", "exports", "tslib", "../core/Evented", "../shim/Map"], factory); - } -})(function (require, exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - var tslib_1 = require("tslib"); - var Evented_1 = require("../core/Evented"); - var Map_1 = require("../shim/Map"); - /** - * Enum to identify the type of event. - * Listening to 'Projector' will notify when projector is created or updated - * Listening to 'Widget' will notify when widget root is created or updated - */ - var NodeEventType; - (function (NodeEventType) { - NodeEventType["Projector"] = "Projector"; - NodeEventType["Widget"] = "Widget"; - })(NodeEventType = exports.NodeEventType || (exports.NodeEventType = {})); - var NodeHandler = /** @class */ (function (_super) { - tslib_1.__extends(NodeHandler, _super); - function NodeHandler() { - var _this = _super !== null && _super.apply(this, arguments) || this; - _this._nodeMap = new Map_1.default(); - return _this; - } - NodeHandler.prototype.get = function (key) { - return this._nodeMap.get(key); - }; - NodeHandler.prototype.has = function (key) { - return this._nodeMap.has(key); - }; - NodeHandler.prototype.add = function (element, key) { - this._nodeMap.set(key, element); - this.emit({ type: key }); - }; - NodeHandler.prototype.addRoot = function () { - this.emit({ type: NodeEventType.Widget }); - }; - NodeHandler.prototype.addProjector = function () { - this.emit({ type: NodeEventType.Projector }); - }; - NodeHandler.prototype.clear = function () { - this._nodeMap.clear(); - }; - return NodeHandler; - }(Evented_1.Evented)); - exports.NodeHandler = NodeHandler; - exports.default = NodeHandler; -}); -//# sourceMappingURL=NodeHandler.js.map \ No newline at end of file diff --git a/deps/framework/widget-core/NodeHandler.js.map b/deps/framework/widget-core/NodeHandler.js.map deleted file mode 100644 index a13ce54e99..0000000000 --- a/deps/framework/widget-core/NodeHandler.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"NodeHandler.js","sourceRoot":"","sources":["NodeHandler.ts"],"names":[],"mappings":";;;;;;;;;;;;IAAA,2CAA0C;IAE1C,mCAA8B;IAG9B;;;;OAIG;IACH,IAAY,aAGX;IAHD,WAAY,aAAa;QACxB,wCAAuB,CAAA;QACvB,kCAAiB,CAAA;IAClB,CAAC,EAHW,aAAa,GAAb,qBAAa,KAAb,qBAAa,QAGxB;IAOD;QAAiC,uCAA4B;QAA7D;YAAA,qEA2BC;YA1BQ,cAAQ,GAAG,IAAI,aAAG,EAAmB,CAAC;;QA0B/C,CAAC;QAxBO,yBAAG,GAAV,UAAW,GAAW;YACrB,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QAC/B,CAAC;QAEM,yBAAG,GAAV,UAAW,GAAW;YACrB,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QAC/B,CAAC;QAEM,yBAAG,GAAV,UAAW,OAAgB,EAAE,GAAW;YACvC,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;YAChC,IAAI,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,CAAC;QAC1B,CAAC;QAEM,6BAAO,GAAd;YACC,IAAI,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,aAAa,CAAC,MAAM,EAAE,CAAC,CAAC;QAC3C,CAAC;QAEM,kCAAY,GAAnB;YACC,IAAI,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,aAAa,CAAC,SAAS,EAAE,CAAC,CAAC;QAC9C,CAAC;QAEM,2BAAK,GAAZ;YACC,IAAI,CAAC,QAAQ,CAAC,KAAK,EAAE,CAAC;QACvB,CAAC;QACF,kBAAC;IAAD,CAAC,AA3BD,CAAiC,iBAAO,GA2BvC;IA3BY,kCAAW;IA6BxB,kBAAe,WAAW,CAAC","sourcesContent":["import { Evented } from '../core/Evented';\nimport { EventObject } from '../core/interfaces';\nimport Map from '../shim/Map';\nimport { NodeHandlerInterface } from './interfaces';\n\n/**\n * Enum to identify the type of event.\n * Listening to 'Projector' will notify when projector is created or updated\n * Listening to 'Widget' will notify when widget root is created or updated\n */\nexport enum NodeEventType {\n\tProjector = 'Projector',\n\tWidget = 'Widget'\n}\n\nexport type NodeHandlerEventMap = {\n\tProjector: EventObject;\n\tWidget: EventObject;\n};\n\nexport class NodeHandler extends Evented implements NodeHandlerInterface {\n\tprivate _nodeMap = new Map();\n\n\tpublic get(key: string): Element | undefined {\n\t\treturn this._nodeMap.get(key);\n\t}\n\n\tpublic has(key: string): boolean {\n\t\treturn this._nodeMap.has(key);\n\t}\n\n\tpublic add(element: Element, key: string): void {\n\t\tthis._nodeMap.set(key, element);\n\t\tthis.emit({ type: key });\n\t}\n\n\tpublic addRoot(): void {\n\t\tthis.emit({ type: NodeEventType.Widget });\n\t}\n\n\tpublic addProjector(): void {\n\t\tthis.emit({ type: NodeEventType.Projector });\n\t}\n\n\tpublic clear(): void {\n\t\tthis._nodeMap.clear();\n\t}\n}\n\nexport default NodeHandler;\n"]} \ No newline at end of file diff --git a/deps/framework/widget-core/NodeHandler.mjs b/deps/framework/widget-core/NodeHandler.mjs deleted file mode 100644 index a1a54a542d..0000000000 --- a/deps/framework/widget-core/NodeHandler.mjs +++ /dev/null @@ -1,39 +0,0 @@ -import { Evented } from '../core/Evented'; -import Map from '../shim/Map'; -/** - * Enum to identify the type of event. - * Listening to 'Projector' will notify when projector is created or updated - * Listening to 'Widget' will notify when widget root is created or updated - */ -export var NodeEventType; -(function (NodeEventType) { - NodeEventType["Projector"] = "Projector"; - NodeEventType["Widget"] = "Widget"; -})(NodeEventType || (NodeEventType = {})); -export class NodeHandler extends Evented { - constructor() { - super(...arguments); - this._nodeMap = new Map(); - } - get(key) { - return this._nodeMap.get(key); - } - has(key) { - return this._nodeMap.has(key); - } - add(element, key) { - this._nodeMap.set(key, element); - this.emit({ type: key }); - } - addRoot() { - this.emit({ type: NodeEventType.Widget }); - } - addProjector() { - this.emit({ type: NodeEventType.Projector }); - } - clear() { - this._nodeMap.clear(); - } -} -export default NodeHandler; -//# sourceMappingURL=NodeHandler.mjs.map \ No newline at end of file diff --git a/deps/framework/widget-core/NodeHandler.mjs.map b/deps/framework/widget-core/NodeHandler.mjs.map deleted file mode 100644 index 8f196b8465..0000000000 --- a/deps/framework/widget-core/NodeHandler.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"NodeHandler.mjs","sourceRoot":"","sources":["NodeHandler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAE1C,OAAO,GAAG,MAAM,aAAa,CAAC;AAG9B;;;;GAIG;AACH,MAAM,CAAN,IAAY,aAGX;AAHD,WAAY,aAAa;IACxB,wCAAuB,CAAA;IACvB,kCAAiB,CAAA;AAClB,CAAC,EAHW,aAAa,KAAb,aAAa,QAGxB;AAOD,MAAM,kBAAmB,SAAQ,OAA4B;IAA7D;;QACS,aAAQ,GAAG,IAAI,GAAG,EAAmB,CAAC;IA0B/C,CAAC;IAxBO,GAAG,CAAC,GAAW;QACrB,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IAC/B,CAAC;IAEM,GAAG,CAAC,GAAW;QACrB,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IAC/B,CAAC;IAEM,GAAG,CAAC,OAAgB,EAAE,GAAW;QACvC,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;QAChC,IAAI,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,CAAC;IAC1B,CAAC;IAEM,OAAO;QACb,IAAI,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,aAAa,CAAC,MAAM,EAAE,CAAC,CAAC;IAC3C,CAAC;IAEM,YAAY;QAClB,IAAI,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,aAAa,CAAC,SAAS,EAAE,CAAC,CAAC;IAC9C,CAAC;IAEM,KAAK;QACX,IAAI,CAAC,QAAQ,CAAC,KAAK,EAAE,CAAC;IACvB,CAAC;CACD;AAED,eAAe,WAAW,CAAC","sourcesContent":["import { Evented } from '../core/Evented';\nimport { EventObject } from '../core/interfaces';\nimport Map from '../shim/Map';\nimport { NodeHandlerInterface } from './interfaces';\n\n/**\n * Enum to identify the type of event.\n * Listening to 'Projector' will notify when projector is created or updated\n * Listening to 'Widget' will notify when widget root is created or updated\n */\nexport enum NodeEventType {\n\tProjector = 'Projector',\n\tWidget = 'Widget'\n}\n\nexport type NodeHandlerEventMap = {\n\tProjector: EventObject;\n\tWidget: EventObject;\n};\n\nexport class NodeHandler extends Evented implements NodeHandlerInterface {\n\tprivate _nodeMap = new Map();\n\n\tpublic get(key: string): Element | undefined {\n\t\treturn this._nodeMap.get(key);\n\t}\n\n\tpublic has(key: string): boolean {\n\t\treturn this._nodeMap.has(key);\n\t}\n\n\tpublic add(element: Element, key: string): void {\n\t\tthis._nodeMap.set(key, element);\n\t\tthis.emit({ type: key });\n\t}\n\n\tpublic addRoot(): void {\n\t\tthis.emit({ type: NodeEventType.Widget });\n\t}\n\n\tpublic addProjector(): void {\n\t\tthis.emit({ type: NodeEventType.Projector });\n\t}\n\n\tpublic clear(): void {\n\t\tthis._nodeMap.clear();\n\t}\n}\n\nexport default NodeHandler;\n"]} \ No newline at end of file diff --git a/deps/framework/widget-core/Registry.d.ts b/deps/framework/widget-core/Registry.d.ts deleted file mode 100644 index 9eb81e53fe..0000000000 --- a/deps/framework/widget-core/Registry.d.ts +++ /dev/null @@ -1,94 +0,0 @@ -import { EventObject } from '../core/interfaces'; -import { Evented } from '../core/Evented'; -import { Constructor, InjectorFactory, InjectorItem, RegistryLabel, WidgetBaseConstructor, WidgetBaseInterface } from './interfaces'; -export declare type WidgetBaseConstructorFunction = () => Promise; -export declare type ESMDefaultWidgetBaseFunction = () => Promise>; -export declare type RegistryItem = WidgetBaseConstructor | Promise | WidgetBaseConstructorFunction | ESMDefaultWidgetBaseFunction; -/** - * Widget base symbol type - */ -export declare const WIDGET_BASE_TYPE: symbol; -export interface RegistryEventObject extends EventObject { - action: string; - item: WidgetBaseConstructor | InjectorFactory; -} -/** - * Widget Registry Interface - */ -export interface RegistryInterface { - /** - * Define a WidgetRegistryItem against a label - * - * @param label The label of the widget to register - * @param registryItem The registry item to define - */ - define(label: RegistryLabel, registryItem: RegistryItem): void; - /** - * Return a RegistryItem for the given label, null if an entry doesn't exist - * - * @param widgetLabel The label of the widget to return - * @returns The RegistryItem for the widgetLabel, `null` if no entry exists - */ - get(label: RegistryLabel): Constructor | null; - /** - * Returns a boolean if an entry for the label exists - * - * @param widgetLabel The label to search for - * @returns boolean indicating if a widget registry item exists - */ - has(label: RegistryLabel): boolean; - /** - * Define an Injector against a label - * - * @param label The label of the injector to register - * @param registryItem The injector factory - */ - defineInjector(label: RegistryLabel, injectorFactory: InjectorFactory): void; - /** - * Return an Injector registry item for the given label, null if an entry doesn't exist - * - * @param label The label of the injector to return - * @returns The RegistryItem for the widgetLabel, `null` if no entry exists - */ - getInjector(label: RegistryLabel): InjectorItem | null; - /** - * Returns a boolean if an injector for the label exists - * - * @param widgetLabel The label to search for - * @returns boolean indicating if a injector registry item exists - */ - hasInjector(label: RegistryLabel): boolean; -} -/** - * Checks is the item is a subclass of WidgetBase (or a WidgetBase) - * - * @param item the item to check - * @returns true/false indicating if the item is a WidgetBaseConstructor - */ -export declare function isWidgetBaseConstructor(item: any): item is Constructor; -export interface ESMDefaultWidgetBase { - default: Constructor; - __esModule?: boolean; -} -export declare function isWidgetConstructorDefaultExport(item: any): item is ESMDefaultWidgetBase; -/** - * The Registry implementation - */ -export declare class Registry extends Evented<{}, RegistryLabel, RegistryEventObject> implements RegistryInterface { - /** - * internal map of labels and RegistryItem - */ - private _widgetRegistry; - private _injectorRegistry; - /** - * Emit loaded event for registry label - */ - private emitLoadedEvent(widgetLabel, item); - define(label: RegistryLabel, item: RegistryItem): void; - defineInjector(label: RegistryLabel, injectorFactory: InjectorFactory): void; - get(label: RegistryLabel): Constructor | null; - getInjector(label: RegistryLabel): InjectorItem | null; - has(label: RegistryLabel): boolean; - hasInjector(label: RegistryLabel): boolean; -} -export default Registry; diff --git a/deps/framework/widget-core/Registry.js b/deps/framework/widget-core/Registry.js deleted file mode 100644 index cbee1360f9..0000000000 --- a/deps/framework/widget-core/Registry.js +++ /dev/null @@ -1,136 +0,0 @@ -(function (factory) { - if (typeof module === "object" && typeof module.exports === "object") { - var v = factory(require, exports); - if (v !== undefined) module.exports = v; - } - else if (typeof define === "function" && define.amd) { - define(["require", "exports", "tslib", "../shim/Promise", "../shim/Map", "../shim/Symbol", "../core/Evented"], factory); - } -})(function (require, exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - var tslib_1 = require("tslib"); - var Promise_1 = require("../shim/Promise"); - var Map_1 = require("../shim/Map"); - var Symbol_1 = require("../shim/Symbol"); - var Evented_1 = require("../core/Evented"); - /** - * Widget base symbol type - */ - exports.WIDGET_BASE_TYPE = Symbol_1.default('Widget Base'); - /** - * Checks is the item is a subclass of WidgetBase (or a WidgetBase) - * - * @param item the item to check - * @returns true/false indicating if the item is a WidgetBaseConstructor - */ - function isWidgetBaseConstructor(item) { - return Boolean(item && item._type === exports.WIDGET_BASE_TYPE); - } - exports.isWidgetBaseConstructor = isWidgetBaseConstructor; - function isWidgetConstructorDefaultExport(item) { - return Boolean(item && - item.hasOwnProperty('__esModule') && - item.hasOwnProperty('default') && - isWidgetBaseConstructor(item.default)); - } - exports.isWidgetConstructorDefaultExport = isWidgetConstructorDefaultExport; - /** - * The Registry implementation - */ - var Registry = /** @class */ (function (_super) { - tslib_1.__extends(Registry, _super); - function Registry() { - return _super !== null && _super.apply(this, arguments) || this; - } - /** - * Emit loaded event for registry label - */ - Registry.prototype.emitLoadedEvent = function (widgetLabel, item) { - this.emit({ - type: widgetLabel, - action: 'loaded', - item: item - }); - }; - Registry.prototype.define = function (label, item) { - var _this = this; - if (this._widgetRegistry === undefined) { - this._widgetRegistry = new Map_1.default(); - } - if (this._widgetRegistry.has(label)) { - throw new Error("widget has already been registered for '" + label.toString() + "'"); - } - this._widgetRegistry.set(label, item); - if (item instanceof Promise_1.default) { - item.then(function (widgetCtor) { - _this._widgetRegistry.set(label, widgetCtor); - _this.emitLoadedEvent(label, widgetCtor); - return widgetCtor; - }, function (error) { - throw error; - }); - } - else if (isWidgetBaseConstructor(item)) { - this.emitLoadedEvent(label, item); - } - }; - Registry.prototype.defineInjector = function (label, injectorFactory) { - if (this._injectorRegistry === undefined) { - this._injectorRegistry = new Map_1.default(); - } - if (this._injectorRegistry.has(label)) { - throw new Error("injector has already been registered for '" + label.toString() + "'"); - } - var invalidator = new Evented_1.Evented(); - var injectorItem = { - injector: injectorFactory(function () { return invalidator.emit({ type: 'invalidate' }); }), - invalidator: invalidator - }; - this._injectorRegistry.set(label, injectorItem); - this.emitLoadedEvent(label, injectorItem); - }; - Registry.prototype.get = function (label) { - var _this = this; - if (!this._widgetRegistry || !this.has(label)) { - return null; - } - var item = this._widgetRegistry.get(label); - if (isWidgetBaseConstructor(item)) { - return item; - } - if (item instanceof Promise_1.default) { - return null; - } - var promise = item(); - this._widgetRegistry.set(label, promise); - promise.then(function (widgetCtor) { - if (isWidgetConstructorDefaultExport(widgetCtor)) { - widgetCtor = widgetCtor.default; - } - _this._widgetRegistry.set(label, widgetCtor); - _this.emitLoadedEvent(label, widgetCtor); - return widgetCtor; - }, function (error) { - throw error; - }); - return null; - }; - Registry.prototype.getInjector = function (label) { - if (!this._injectorRegistry || !this.hasInjector(label)) { - return null; - } - return this._injectorRegistry.get(label); - }; - Registry.prototype.has = function (label) { - return Boolean(this._widgetRegistry && this._widgetRegistry.has(label)); - }; - Registry.prototype.hasInjector = function (label) { - return Boolean(this._injectorRegistry && this._injectorRegistry.has(label)); - }; - return Registry; - }(Evented_1.Evented)); - exports.Registry = Registry; - exports.default = Registry; -}); -//# sourceMappingURL=Registry.js.map \ No newline at end of file diff --git a/deps/framework/widget-core/Registry.js.map b/deps/framework/widget-core/Registry.js.map deleted file mode 100644 index eaa1a9815d..0000000000 --- a/deps/framework/widget-core/Registry.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"Registry.js","sourceRoot":"","sources":["Registry.ts"],"names":[],"mappings":";;;;;;;;;;;;IAAA,2CAAsC;IACtC,mCAA8B;IAC9B,yCAAoC;IAEpC,2CAA0C;IAoB1C;;OAEG;IACU,QAAA,gBAAgB,GAAG,gBAAM,CAAC,aAAa,CAAC,CAAC;IA2DtD;;;;;OAKG;IACH,iCAAuE,IAAS;QAC/E,MAAM,CAAC,OAAO,CAAC,IAAI,IAAI,IAAI,CAAC,KAAK,KAAK,wBAAgB,CAAC,CAAC;IACzD,CAAC;IAFD,0DAEC;IAOD,0CAAoD,IAAS;QAC5D,MAAM,CAAC,OAAO,CACb,IAAI;YACH,IAAI,CAAC,cAAc,CAAC,YAAY,CAAC;YACjC,IAAI,CAAC,cAAc,CAAC,SAAS,CAAC;YAC9B,uBAAuB,CAAC,IAAI,CAAC,OAAO,CAAC,CACtC,CAAC;IACH,CAAC;IAPD,4EAOC;IAED;;OAEG;IACH;QAA8B,oCAA+C;QAA7E;;QAqHA,CAAC;QA7GA;;WAEG;QACK,kCAAe,GAAvB,UAAwB,WAA0B,EAAE,IAA0C;YAC7F,IAAI,CAAC,IAAI,CAAC;gBACT,IAAI,EAAE,WAAW;gBACjB,MAAM,EAAE,QAAQ;gBAChB,IAAI,MAAA;aACJ,CAAC,CAAC;QACJ,CAAC;QAEM,yBAAM,GAAb,UAAc,KAAoB,EAAE,IAAkB;YAAtD,iBAyBC;YAxBA,EAAE,CAAC,CAAC,IAAI,CAAC,eAAe,KAAK,SAAS,CAAC,CAAC,CAAC;gBACxC,IAAI,CAAC,eAAe,GAAG,IAAI,aAAG,EAAE,CAAC;YAClC,CAAC;YAED,EAAE,CAAC,CAAC,IAAI,CAAC,eAAe,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC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ACD,CAAC;YAEF,MAAM,CAAC,IAAI,CAAC;QACb,CAAC;QAEM,8BAAW,GAAlB,UAAsB,KAAoB;YACzC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,iBAAiB,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;gBACzD,MAAM,CAAC,IAAI,CAAC;YACb,CAAC;YAED,MAAM,CAAC,IAAI,CAAC,iBAAiB,CAAC,GAAG,CAAC,KAAK,CAAE,CAAC;QAC3C,CAAC;QAEM,sBAAG,GAAV,UAAW,KAAoB;YAC9B,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,eAAe,IAAI,IAAI,CAAC,eAAe,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC;QACzE,CAAC;QAEM,8BAAW,GAAlB,UAAmB,KAAoB;YACtC,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,iBAAiB,IAAI,IAAI,CAAC,iBAAiB,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC;QAC7E,CAAC;QACF,eAAC;IAAD,CAAC,AArHD,CAA8B,iBAAO,GAqHpC;IArHY,4BAAQ;IAuHrB,kBAAe,QAAQ,CAAC","sourcesContent":["import Promise from '../shim/Promise';\nimport Map from '../shim/Map';\nimport Symbol from '../shim/Symbol';\nimport { EventObject } from '../core/interfaces';\nimport { Evented } from '../core/Evented';\nimport {\n\tConstructor,\n\tInjectorFactory,\n\tInjectorItem,\n\tRegistryLabel,\n\tWidgetBaseConstructor,\n\tWidgetBaseInterface\n} from './interfaces';\n\nexport type WidgetBaseConstructorFunction = () => Promise;\n\nexport type ESMDefaultWidgetBaseFunction = () => Promise>;\n\nexport type RegistryItem =\n\t| WidgetBaseConstructor\n\t| Promise\n\t| WidgetBaseConstructorFunction\n\t| ESMDefaultWidgetBaseFunction;\n\n/**\n * Widget base symbol type\n */\nexport const WIDGET_BASE_TYPE = Symbol('Widget Base');\n\nexport interface RegistryEventObject extends EventObject {\n\taction: string;\n\titem: WidgetBaseConstructor | InjectorFactory;\n}\n/**\n * Widget Registry Interface\n */\nexport interface RegistryInterface {\n\t/**\n\t * Define a WidgetRegistryItem against a label\n\t *\n\t * @param label The label of the widget to register\n\t * @param registryItem The registry item to define\n\t */\n\tdefine(label: RegistryLabel, registryItem: RegistryItem): void;\n\n\t/**\n\t * Return a RegistryItem for the given label, null if an entry doesn't exist\n\t *\n\t * @param widgetLabel The label of the widget to return\n\t * @returns The RegistryItem for the widgetLabel, `null` if no entry exists\n\t */\n\tget(label: RegistryLabel): Constructor | null;\n\n\t/**\n\t * Returns a boolean if an entry for the label exists\n\t *\n\t * @param widgetLabel The label to search for\n\t * @returns boolean indicating if a widget registry item exists\n\t */\n\thas(label: RegistryLabel): boolean;\n\n\t/**\n\t * Define an Injector against a label\n\t *\n\t * @param label The label of the injector to register\n\t * @param registryItem The injector factory\n\t */\n\tdefineInjector(label: RegistryLabel, injectorFactory: InjectorFactory): void;\n\n\t/**\n\t * Return an Injector registry item for the given label, null if an entry doesn't exist\n\t *\n\t * @param label The label of the injector to return\n\t * @returns The RegistryItem for the widgetLabel, `null` if no entry exists\n\t */\n\tgetInjector(label: RegistryLabel): InjectorItem | null;\n\n\t/**\n\t * Returns a boolean if an injector for the label exists\n\t *\n\t * @param widgetLabel The label to search for\n\t * @returns boolean indicating if a injector registry item exists\n\t */\n\thasInjector(label: RegistryLabel): boolean;\n}\n\n/**\n * Checks is the item is a subclass of WidgetBase (or a WidgetBase)\n *\n * @param item the item to check\n * @returns true/false indicating if the item is a WidgetBaseConstructor\n */\nexport function isWidgetBaseConstructor(item: any): item is Constructor {\n\treturn Boolean(item && item._type === WIDGET_BASE_TYPE);\n}\n\nexport interface ESMDefaultWidgetBase {\n\tdefault: Constructor;\n\t__esModule?: boolean;\n}\n\nexport function isWidgetConstructorDefaultExport(item: any): item is ESMDefaultWidgetBase {\n\treturn Boolean(\n\t\titem &&\n\t\t\titem.hasOwnProperty('__esModule') &&\n\t\t\titem.hasOwnProperty('default') &&\n\t\t\tisWidgetBaseConstructor(item.default)\n\t);\n}\n\n/**\n * The Registry implementation\n */\nexport class Registry extends Evented<{}, RegistryLabel, RegistryEventObject> implements RegistryInterface {\n\t/**\n\t * internal map of labels and RegistryItem\n\t */\n\tprivate _widgetRegistry: Map | undefined;\n\n\tprivate _injectorRegistry: Map | undefined;\n\n\t/**\n\t * Emit loaded event for registry label\n\t */\n\tprivate emitLoadedEvent(widgetLabel: RegistryLabel, item: WidgetBaseConstructor | InjectorItem): void {\n\t\tthis.emit({\n\t\t\ttype: widgetLabel,\n\t\t\taction: 'loaded',\n\t\t\titem\n\t\t});\n\t}\n\n\tpublic define(label: RegistryLabel, item: RegistryItem): void {\n\t\tif (this._widgetRegistry === undefined) {\n\t\t\tthis._widgetRegistry = new Map();\n\t\t}\n\n\t\tif (this._widgetRegistry.has(label)) {\n\t\t\tthrow new Error(`widget has already been registered for '${label.toString()}'`);\n\t\t}\n\n\t\tthis._widgetRegistry.set(label, item);\n\n\t\tif (item instanceof Promise) {\n\t\t\titem.then(\n\t\t\t\t(widgetCtor) => {\n\t\t\t\t\tthis._widgetRegistry!.set(label, widgetCtor);\n\t\t\t\t\tthis.emitLoadedEvent(label, widgetCtor);\n\t\t\t\t\treturn widgetCtor;\n\t\t\t\t},\n\t\t\t\t(error) => {\n\t\t\t\t\tthrow error;\n\t\t\t\t}\n\t\t\t);\n\t\t} else if (isWidgetBaseConstructor(item)) {\n\t\t\tthis.emitLoadedEvent(label, item);\n\t\t}\n\t}\n\n\tpublic defineInjector(label: RegistryLabel, injectorFactory: InjectorFactory): void {\n\t\tif (this._injectorRegistry === undefined) {\n\t\t\tthis._injectorRegistry = new Map();\n\t\t}\n\n\t\tif (this._injectorRegistry.has(label)) {\n\t\t\tthrow new Error(`injector has already been registered for '${label.toString()}'`);\n\t\t}\n\n\t\tconst invalidator = new Evented();\n\n\t\tconst injectorItem: InjectorItem = {\n\t\t\tinjector: injectorFactory(() => invalidator.emit({ type: 'invalidate' })),\n\t\t\tinvalidator\n\t\t};\n\n\t\tthis._injectorRegistry.set(label, injectorItem);\n\t\tthis.emitLoadedEvent(label, injectorItem);\n\t}\n\n\tpublic get(label: RegistryLabel): Constructor | null {\n\t\tif (!this._widgetRegistry || !this.has(label)) {\n\t\t\treturn null;\n\t\t}\n\n\t\tconst item = this._widgetRegistry.get(label);\n\n\t\tif (isWidgetBaseConstructor(item)) {\n\t\t\treturn item;\n\t\t}\n\n\t\tif (item instanceof Promise) {\n\t\t\treturn null;\n\t\t}\n\n\t\tconst promise = (item)();\n\t\tthis._widgetRegistry.set(label, promise);\n\n\t\tpromise.then(\n\t\t\t(widgetCtor) => {\n\t\t\t\tif (isWidgetConstructorDefaultExport(widgetCtor)) {\n\t\t\t\t\twidgetCtor = widgetCtor.default;\n\t\t\t\t}\n\n\t\t\t\tthis._widgetRegistry!.set(label, widgetCtor);\n\t\t\t\tthis.emitLoadedEvent(label, widgetCtor);\n\t\t\t\treturn widgetCtor;\n\t\t\t},\n\t\t\t(error) => {\n\t\t\t\tthrow error;\n\t\t\t}\n\t\t);\n\n\t\treturn null;\n\t}\n\n\tpublic getInjector(label: RegistryLabel): InjectorItem | null {\n\t\tif (!this._injectorRegistry || !this.hasInjector(label)) {\n\t\t\treturn null;\n\t\t}\n\n\t\treturn this._injectorRegistry.get(label)!;\n\t}\n\n\tpublic has(label: RegistryLabel): boolean {\n\t\treturn Boolean(this._widgetRegistry && this._widgetRegistry.has(label));\n\t}\n\n\tpublic hasInjector(label: RegistryLabel): boolean {\n\t\treturn Boolean(this._injectorRegistry && this._injectorRegistry.has(label));\n\t}\n}\n\nexport default Registry;\n"]} \ No newline at end of file diff --git a/deps/framework/widget-core/Registry.mjs b/deps/framework/widget-core/Registry.mjs deleted file mode 100644 index f9bb87bc20..0000000000 --- a/deps/framework/widget-core/Registry.mjs +++ /dev/null @@ -1,113 +0,0 @@ -import Promise from '../shim/Promise'; -import Map from '../shim/Map'; -import Symbol from '../shim/Symbol'; -import { Evented } from '../core/Evented'; -/** - * Widget base symbol type - */ -export const WIDGET_BASE_TYPE = Symbol('Widget Base'); -/** - * Checks is the item is a subclass of WidgetBase (or a WidgetBase) - * - * @param item the item to check - * @returns true/false indicating if the item is a WidgetBaseConstructor - */ -export function isWidgetBaseConstructor(item) { - return Boolean(item && item._type === WIDGET_BASE_TYPE); -} -export function isWidgetConstructorDefaultExport(item) { - return Boolean(item && - item.hasOwnProperty('__esModule') && - item.hasOwnProperty('default') && - isWidgetBaseConstructor(item.default)); -} -/** - * The Registry implementation - */ -export class Registry extends Evented { - /** - * Emit loaded event for registry label - */ - emitLoadedEvent(widgetLabel, item) { - this.emit({ - type: widgetLabel, - action: 'loaded', - item - }); - } - define(label, item) { - if (this._widgetRegistry === undefined) { - this._widgetRegistry = new Map(); - } - if (this._widgetRegistry.has(label)) { - throw new Error(`widget has already been registered for '${label.toString()}'`); - } - this._widgetRegistry.set(label, item); - if (item instanceof Promise) { - item.then((widgetCtor) => { - this._widgetRegistry.set(label, widgetCtor); - this.emitLoadedEvent(label, widgetCtor); - return widgetCtor; - }, (error) => { - throw error; - }); - } - else if (isWidgetBaseConstructor(item)) { - this.emitLoadedEvent(label, item); - } - } - defineInjector(label, injectorFactory) { - if (this._injectorRegistry === undefined) { - this._injectorRegistry = new Map(); - } - if (this._injectorRegistry.has(label)) { - throw new Error(`injector has already been registered for '${label.toString()}'`); - } - const invalidator = new Evented(); - const injectorItem = { - injector: injectorFactory(() => invalidator.emit({ type: 'invalidate' })), - invalidator - }; - this._injectorRegistry.set(label, injectorItem); - this.emitLoadedEvent(label, injectorItem); - } - get(label) { - if (!this._widgetRegistry || !this.has(label)) { - return null; - } - const item = this._widgetRegistry.get(label); - if (isWidgetBaseConstructor(item)) { - return item; - } - if (item instanceof Promise) { - return null; - } - const promise = item(); - this._widgetRegistry.set(label, promise); - promise.then((widgetCtor) => { - if (isWidgetConstructorDefaultExport(widgetCtor)) { - widgetCtor = widgetCtor.default; - } - this._widgetRegistry.set(label, widgetCtor); - this.emitLoadedEvent(label, widgetCtor); - return widgetCtor; - }, (error) => { - throw error; - }); - return null; - } - getInjector(label) { - if (!this._injectorRegistry || !this.hasInjector(label)) { - return null; - } - return this._injectorRegistry.get(label); - } - has(label) { - return Boolean(this._widgetRegistry && this._widgetRegistry.has(label)); - } - hasInjector(label) { - return Boolean(this._injectorRegistry && this._injectorRegistry.has(label)); - } -} -export default Registry; -//# sourceMappingURL=Registry.mjs.map \ No newline at end of file diff --git a/deps/framework/widget-core/Registry.mjs.map b/deps/framework/widget-core/Registry.mjs.map deleted file mode 100644 index ba821b0bb6..0000000000 --- a/deps/framework/widget-core/Registry.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"Registry.mjs","sourceRoot":"","sources":["Registry.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,iBAAiB,CAAC;AACtC,OAAO,GAAG,MAAM,aAAa,CAAC;AAC9B,OAAO,MAAM,MAAM,gBAAgB,CAAC;AAEpC,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAoB1C;;GAEG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,MAAM,CAAC,aAAa,CAAC,CAAC;AA2DtD;;;;;GAKG;AACH,MAAM,kCAAiE,IAAS;IAC/E,MAAM,CAAC,OAAO,CAAC,IAAI,IAAI,IAAI,CAAC,KAAK,KAAK,gBAAgB,CAAC,CAAC;AACzD,CAAC;AAOD,MAAM,2CAA8C,IAAS;IAC5D,MAAM,CAAC,OAAO,CACb,IAAI;QACH,IAAI,CAAC,cAAc,CAAC,YAAY,CAAC;QACjC,IAAI,CAAC,cAAc,CAAC,SAAS,CAAC;QAC9B,uBAAuB,CAAC,IAAI,CAAC,OAAO,CAAC,CACtC,CAAC;AACH,CAAC;AAED;;GAEG;AACH,MAAM,eAAgB,SAAQ,OAA+C;IAQ5E;;OAEG;IACK,eAAe,CAAC,WAA0B,EAAE,IAA0C;QAC7F,IAAI,CAAC,IA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C,gCAAgC,CAAI,UAAU,CAAC,CAAC,CAAC,CAAC;gBACrD,UAAU,GAAG,UAAU,CAAC,OAAO,CAAC;YACjC,CAAC;YAED,IAAI,CAAC,eAAgB,CAAC,GAAG,CAAC,KAAK,EAAE,UAAU,CAAC,CAAC;YAC7C,IAAI,CAAC,eAAe,CAAC,KAAK,EAAE,UAAU,CAAC,CAAC;YACxC,MAAM,CAAC,UAAU,CAAC;QACnB,CAAC,EACD,CAAC,KAAK,EAAE,EAAE;YACT,MAAM,KAAK,CAAC;QACb,CAAC,CACD,CAAC;QAEF,MAAM,CAAC,IAAI,CAAC;IACb,CAAC;IAEM,WAAW,CAAI,KAAoB;QACzC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,iBAAiB,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;YACzD,MAAM,CAAC,IAAI,CAAC;QACb,CAAC;QAED,MAAM,CAAC,IAAI,CAAC,iBAAiB,CAAC,GAAG,CAAC,KAAK,CAAE,CAAC;IAC3C,CAAC;IAEM,GAAG,CAAC,KAAoB;QAC9B,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,eAAe,IAAI,IAAI,CAAC,eAAe,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC;IACzE,CAAC;IAEM,WAAW,CAAC,KAAoB;QACtC,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,iBAAiB,IAAI,IAAI,CAAC,iBAAiB,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC;IAC7E,CAAC;CACD;AAED,eAAe,QAAQ,CAAC","sourcesContent":["import Promise from '../shim/Promise';\nimport Map from '../shim/Map';\nimport Symbol from '../shim/Symbol';\nimport { EventObject } from '../core/interfaces';\nimport { Evented } from '../core/Evented';\nimport {\n\tConstructor,\n\tInjectorFactory,\n\tInjectorItem,\n\tRegistryLabel,\n\tWidgetBaseConstructor,\n\tWidgetBaseInterface\n} from './interfaces';\n\nexport type WidgetBaseConstructorFunction = () => Promise;\n\nexport type ESMDefaultWidgetBaseFunction = () => Promise>;\n\nexport type RegistryItem =\n\t| WidgetBaseConstructor\n\t| Promise\n\t| WidgetBaseConstructorFunction\n\t| ESMDefaultWidgetBaseFunction;\n\n/**\n * Widget base symbol type\n */\nexport const WIDGET_BASE_TYPE = Symbol('Widget Base');\n\nexport interface RegistryEventObject extends EventObject {\n\taction: string;\n\titem: WidgetBaseConstructor | InjectorFactory;\n}\n/**\n * Widget Registry Interface\n */\nexport interface RegistryInterface {\n\t/**\n\t * Define a WidgetRegistryItem against a label\n\t *\n\t * @param label The label of the widget to register\n\t * @param registryItem The registry item to define\n\t */\n\tdefine(label: RegistryLabel, registryItem: RegistryItem): void;\n\n\t/**\n\t * Return a RegistryItem for the given label, null if an entry doesn't exist\n\t *\n\t * @param widgetLabel The label of the widget to return\n\t * @returns The RegistryItem for the widgetLabel, `null` if no entry exists\n\t */\n\tget(label: RegistryLabel): Constructor | null;\n\n\t/**\n\t * Returns a boolean if an entry for the label exists\n\t *\n\t * @param widgetLabel The label to search for\n\t * @returns boolean indicating if a widget registry item exists\n\t */\n\thas(label: RegistryLabel): boolean;\n\n\t/**\n\t * Define an Injector against a label\n\t *\n\t * @param label The label of the injector to register\n\t * @param registryItem The injector factory\n\t */\n\tdefineInjector(label: RegistryLabel, injectorFactory: InjectorFactory): void;\n\n\t/**\n\t * Return an Injector registry item for the given label, null if an entry doesn't exist\n\t *\n\t * @param label The label of the injector to return\n\t * @returns The RegistryItem for the widgetLabel, `null` if no entry exists\n\t */\n\tgetInjector(label: RegistryLabel): InjectorItem | null;\n\n\t/**\n\t * Returns a boolean if an injector for the label exists\n\t *\n\t * @param widgetLabel The label to search for\n\t * @returns boolean indicating if a injector registry item exists\n\t */\n\thasInjector(label: RegistryLabel): boolean;\n}\n\n/**\n * Checks is the item is a subclass of WidgetBase (or a WidgetBase)\n *\n * @param item the item to check\n * @returns true/false indicating if the item is a WidgetBaseConstructor\n */\nexport function isWidgetBaseConstructor(item: any): item is Constructor {\n\treturn Boolean(item && item._type === WIDGET_BASE_TYPE);\n}\n\nexport interface ESMDefaultWidgetBase {\n\tdefault: Constructor;\n\t__esModule?: boolean;\n}\n\nexport function isWidgetConstructorDefaultExport(item: any): item is ESMDefaultWidgetBase {\n\treturn Boolean(\n\t\titem &&\n\t\t\titem.hasOwnProperty('__esModule') &&\n\t\t\titem.hasOwnProperty('default') &&\n\t\t\tisWidgetBaseConstructor(item.default)\n\t);\n}\n\n/**\n * The Registry implementation\n */\nexport class Registry extends Evented<{}, RegistryLabel, RegistryEventObject> implements RegistryInterface {\n\t/**\n\t * internal map of labels and RegistryItem\n\t */\n\tprivate _widgetRegistry: Map | undefined;\n\n\tprivate _injectorRegistry: Map | undefined;\n\n\t/**\n\t * Emit loaded event for registry label\n\t */\n\tprivate emitLoadedEvent(widgetLabel: RegistryLabel, item: WidgetBaseConstructor | InjectorItem): void {\n\t\tthis.emit({\n\t\t\ttype: widgetLabel,\n\t\t\taction: 'loaded',\n\t\t\titem\n\t\t});\n\t}\n\n\tpublic define(label: RegistryLabel, item: RegistryItem): void {\n\t\tif (this._widgetRegistry === undefined) {\n\t\t\tthis._widgetRegistry = new Map();\n\t\t}\n\n\t\tif (this._widgetRegistry.has(label)) {\n\t\t\tthrow new Error(`widget has already been registered for '${label.toString()}'`);\n\t\t}\n\n\t\tthis._widgetRegistry.set(label, item);\n\n\t\tif (item instanceof Promise) {\n\t\t\titem.then(\n\t\t\t\t(widgetCtor) => {\n\t\t\t\t\tthis._widgetRegistry!.set(label, widgetCtor);\n\t\t\t\t\tthis.emitLoadedEvent(label, widgetCtor);\n\t\t\t\t\treturn widgetCtor;\n\t\t\t\t},\n\t\t\t\t(error) => {\n\t\t\t\t\tthrow error;\n\t\t\t\t}\n\t\t\t);\n\t\t} else if (isWidgetBaseConstructor(item)) {\n\t\t\tthis.emitLoadedEvent(label, item);\n\t\t}\n\t}\n\n\tpublic defineInjector(label: RegistryLabel, injectorFactory: InjectorFactory): void {\n\t\tif (this._injectorRegistry === undefined) {\n\t\t\tthis._injectorRegistry = new Map();\n\t\t}\n\n\t\tif (this._injectorRegistry.has(label)) {\n\t\t\tthrow new Error(`injector has already been registered for '${label.toString()}'`);\n\t\t}\n\n\t\tconst invalidator = new Evented();\n\n\t\tconst injectorItem: InjectorItem = {\n\t\t\tinjector: injectorFactory(() => invalidator.emit({ type: 'invalidate' })),\n\t\t\tinvalidator\n\t\t};\n\n\t\tthis._injectorRegistry.set(label, injectorItem);\n\t\tthis.emitLoadedEvent(label, injectorItem);\n\t}\n\n\tpublic get(label: RegistryLabel): Constructor | null {\n\t\tif (!this._widgetRegistry || !this.has(label)) {\n\t\t\treturn null;\n\t\t}\n\n\t\tconst item = this._widgetRegistry.get(label);\n\n\t\tif (isWidgetBaseConstructor(item)) {\n\t\t\treturn item;\n\t\t}\n\n\t\tif (item instanceof Promise) {\n\t\t\treturn null;\n\t\t}\n\n\t\tconst promise = (item)();\n\t\tthis._widgetRegistry.set(label, promise);\n\n\t\tpromise.then(\n\t\t\t(widgetCtor) => {\n\t\t\t\tif (isWidgetConstructorDefaultExport(widgetCtor)) {\n\t\t\t\t\twidgetCtor = widgetCtor.default;\n\t\t\t\t}\n\n\t\t\t\tthis._widgetRegistry!.set(label, widgetCtor);\n\t\t\t\tthis.emitLoadedEvent(label, widgetCtor);\n\t\t\t\treturn widgetCtor;\n\t\t\t},\n\t\t\t(error) => {\n\t\t\t\tthrow error;\n\t\t\t}\n\t\t);\n\n\t\treturn null;\n\t}\n\n\tpublic getInjector(label: RegistryLabel): InjectorItem | null {\n\t\tif (!this._injectorRegistry || !this.hasInjector(label)) {\n\t\t\treturn null;\n\t\t}\n\n\t\treturn this._injectorRegistry.get(label)!;\n\t}\n\n\tpublic has(label: RegistryLabel): boolean {\n\t\treturn Boolean(this._widgetRegistry && this._widgetRegistry.has(label));\n\t}\n\n\tpublic hasInjector(label: RegistryLabel): boolean {\n\t\treturn Boolean(this._injectorRegistry && this._injectorRegistry.has(label));\n\t}\n}\n\nexport default Registry;\n"]} \ No newline at end of file diff --git a/deps/framework/widget-core/RegistryHandler.d.ts b/deps/framework/widget-core/RegistryHandler.d.ts deleted file mode 100644 index b8feca0f40..0000000000 --- a/deps/framework/widget-core/RegistryHandler.d.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { Evented } from '../core/Evented'; -import { EventObject } from '../core/interfaces'; -import { Constructor, InjectorFactory, InjectorItem, RegistryLabel, WidgetBaseInterface } from './interfaces'; -import { Registry, RegistryItem } from './Registry'; -export declare type RegistryHandlerEventMap = { - invalidate: EventObject<'invalidate'>; -}; -export declare class RegistryHandler extends Evented { - private _registry; - private _registryWidgetLabelMap; - private _registryInjectorLabelMap; - protected baseRegistry?: Registry; - constructor(); - base: Registry; - define(label: RegistryLabel, widget: RegistryItem): void; - defineInjector(label: RegistryLabel, injector: InjectorFactory): void; - has(label: RegistryLabel): boolean; - hasInjector(label: RegistryLabel): boolean; - get(label: RegistryLabel, globalPrecedence?: boolean): Constructor | null; - getInjector(label: RegistryLabel, globalPrecedence?: boolean): InjectorItem | null; - private _get(label, globalPrecedence, getFunctionName, labelMap); -} -export default RegistryHandler; diff --git a/deps/framework/widget-core/RegistryHandler.js b/deps/framework/widget-core/RegistryHandler.js deleted file mode 100644 index b1e6ce41a0..0000000000 --- a/deps/framework/widget-core/RegistryHandler.js +++ /dev/null @@ -1,96 +0,0 @@ -(function (factory) { - if (typeof module === "object" && typeof module.exports === "object") { - var v = factory(require, exports); - if (v !== undefined) module.exports = v; - } - else if (typeof define === "function" && define.amd) { - define(["require", "exports", "tslib", "../shim/Map", "../core/Evented", "./Registry"], factory); - } -})(function (require, exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - var tslib_1 = require("tslib"); - var Map_1 = require("../shim/Map"); - var Evented_1 = require("../core/Evented"); - var Registry_1 = require("./Registry"); - var RegistryHandler = /** @class */ (function (_super) { - tslib_1.__extends(RegistryHandler, _super); - function RegistryHandler() { - var _this = _super.call(this) || this; - _this._registry = new Registry_1.Registry(); - _this._registryWidgetLabelMap = new Map_1.Map(); - _this._registryInjectorLabelMap = new Map_1.Map(); - _this.own(_this._registry); - var destroy = function () { - if (_this.baseRegistry) { - _this._registryWidgetLabelMap.delete(_this.baseRegistry); - _this._registryInjectorLabelMap.delete(_this.baseRegistry); - _this.baseRegistry = undefined; - } - }; - _this.own({ destroy: destroy }); - return _this; - } - Object.defineProperty(RegistryHandler.prototype, "base", { - set: function (baseRegistry) { - if (this.baseRegistry) { - this._registryWidgetLabelMap.delete(this.baseRegistry); - this._registryInjectorLabelMap.delete(this.baseRegistry); - } - this.baseRegistry = baseRegistry; - }, - enumerable: true, - configurable: true - }); - RegistryHandler.prototype.define = function (label, widget) { - this._registry.define(label, widget); - }; - RegistryHandler.prototype.defineInjector = function (label, injector) { - this._registry.defineInjector(label, injector); - }; - RegistryHandler.prototype.has = function (label) { - return this._registry.has(label) || Boolean(this.baseRegistry && this.baseRegistry.has(label)); - }; - RegistryHandler.prototype.hasInjector = function (label) { - return this._registry.hasInjector(label) || Boolean(this.baseRegistry && this.baseRegistry.hasInjector(label)); - }; - RegistryHandler.prototype.get = function (label, globalPrecedence) { - if (globalPrecedence === void 0) { globalPrecedence = false; } - return this._get(label, globalPrecedence, 'get', this._registryWidgetLabelMap); - }; - RegistryHandler.prototype.getInjector = function (label, globalPrecedence) { - if (globalPrecedence === void 0) { globalPrecedence = false; } - return this._get(label, globalPrecedence, 'getInjector', this._registryInjectorLabelMap); - }; - RegistryHandler.prototype._get = function (label, globalPrecedence, getFunctionName, labelMap) { - var _this = this; - var registries = globalPrecedence ? [this.baseRegistry, this._registry] : [this._registry, this.baseRegistry]; - for (var i = 0; i < registries.length; i++) { - var registry = registries[i]; - if (!registry) { - continue; - } - var item = registry[getFunctionName](label); - var registeredLabels = labelMap.get(registry) || []; - if (item) { - return item; - } - else if (registeredLabels.indexOf(label) === -1) { - var handle = registry.on(label, function (event) { - if (event.action === 'loaded' && - _this[getFunctionName](label, globalPrecedence) === event.item) { - _this.emit({ type: 'invalidate' }); - } - }); - this.own(handle); - labelMap.set(registry, tslib_1.__spread(registeredLabels, [label])); - } - } - return null; - }; - return RegistryHandler; - }(Evented_1.Evented)); - exports.RegistryHandler = RegistryHandler; - exports.default = RegistryHandler; -}); -//# sourceMappingURL=RegistryHandler.js.map \ No newline at end of file diff --git a/deps/framework/widget-core/RegistryHandler.js.map b/deps/framework/widget-core/RegistryHandler.js.map deleted file mode 100644 index ef6e2d35f6..0000000000 --- a/deps/framework/widget-core/RegistryHandler.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"RegistryHandler.js","sourceRoot":"","sources":["RegistryHandler.ts"],"names":[],"mappings":";;;;;;;;;;;;IAAA,mCAAkC;IAClC,2CAA0C;IAG1C,uCAAyE;IAMzE;QAAqC,2CAAgC;QAMpE;YAAA,YACC,iBAAO,SAUP;YAhBO,eAAS,GAAG,IAAI,mBAAQ,EAAE,CAAC;YAC3B,6BAAuB,GAAmC,IAAI,SAAG,EAAE,CAAC;YACpE,+BAAyB,GAAmC,IAAI,SAAG,EAAE,CAAC;YAK7E,KAAI,CAAC,GAAG,CAAC,KAAI,CAAC,SAAS,CAAC,CAAC;YACzB,IAAM,OAAO,GAAG;gBACf,EAAE,CAAC,CAAC,KAAI,CAAC,YAAY,CAAC,CAAC,CAAC;oBACvB,KAAI,CAAC,uBAAuB,CAAC,MAAM,CAAC,KAAI,CAAC,YAAY,CAAC,CAAC;oBACvD,KAAI,CAAC,yBAAyB,CAAC,MAAM,CAAC,KAAI,CAAC,YAAY,CAAC,CAAC;oBACzD,KAAI,CAAC,YAAY,GAAG,SAAS,CAAC;gBAC/B,CAAC;YACF,CAAC,CAAC;YACF,KAAI,CAAC,GAAG,CAAC,EAAE,OAAO,SAAA,EAAE,CAAC,CAAC;;QACvB,CAAC;QAED,sBAAW,iCAAI;iBAAf,UAAgB,YAAsB;gBACrC,EAAE,CAAC,CAAC,IAAI,CAAC,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nE,CAAC,CAAC,CAAC;4BACF,KAAI,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,YAAY,EAAE,CAAC,CAAC;wBACnC,CAAC;oBACF,CAAC,CAAC,CAAC;oBACH,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;oBACjB,QAAQ,CAAC,GAAG,CAAC,QAAQ,mBAAM,gBAAgB,GAAE,KAAK,GAAE,CAAC;gBACtD,CAAC;YACF,CAAC;YACD,MAAM,CAAC,IAAI,CAAC;QACb,CAAC;QACF,sBAAC;IAAD,CAAC,AArFD,CAAqC,iBAAO,GAqF3C;IArFY,0CAAe;IAuF5B,kBAAe,eAAe,CAAC","sourcesContent":["import { Map } from '../shim/Map';\nimport { Evented } from '../core/Evented';\nimport { EventObject } from '../core/interfaces';\nimport { Constructor, InjectorFactory, InjectorItem, RegistryLabel, WidgetBaseInterface } from './interfaces';\nimport { Registry, RegistryEventObject, RegistryItem } from './Registry';\n\nexport type RegistryHandlerEventMap = {\n\tinvalidate: EventObject<'invalidate'>;\n};\n\nexport class RegistryHandler extends Evented {\n\tprivate _registry = new Registry();\n\tprivate _registryWidgetLabelMap: Map = new Map();\n\tprivate _registryInjectorLabelMap: Map = new Map();\n\tprotected baseRegistry?: Registry;\n\n\tconstructor() {\n\t\tsuper();\n\t\tthis.own(this._registry);\n\t\tconst destroy = () => {\n\t\t\tif (this.baseRegistry) {\n\t\t\t\tthis._registryWidgetLabelMap.delete(this.baseRegistry);\n\t\t\t\tthis._registryInjectorLabelMap.delete(this.baseRegistry);\n\t\t\t\tthis.baseRegistry = undefined;\n\t\t\t}\n\t\t};\n\t\tthis.own({ destroy });\n\t}\n\n\tpublic set base(baseRegistry: Registry) {\n\t\tif (this.baseRegistry) {\n\t\t\tthis._registryWidgetLabelMap.delete(this.baseRegistry);\n\t\t\tthis._registryInjectorLabelMap.delete(this.baseRegistry);\n\t\t}\n\t\tthis.baseRegistry = baseRegistry;\n\t}\n\n\tpublic define(label: RegistryLabel, widget: RegistryItem): void {\n\t\tthis._registry.define(label, widget);\n\t}\n\n\tpublic defineInjector(label: RegistryLabel, injector: InjectorFactory): void {\n\t\tthis._registry.defineInjector(label, injector);\n\t}\n\n\tpublic has(label: RegistryLabel): boolean {\n\t\treturn this._registry.has(label) || Boolean(this.baseRegistry && this.baseRegistry.has(label));\n\t}\n\n\tpublic hasInjector(label: RegistryLabel): boolean {\n\t\treturn this._registry.hasInjector(label) || Boolean(this.baseRegistry && this.baseRegistry.hasInjector(label));\n\t}\n\n\tpublic get(\n\t\tlabel: RegistryLabel,\n\t\tglobalPrecedence: boolean = false\n\t): Constructor | null {\n\t\treturn this._get(label, globalPrecedence, 'get', this._registryWidgetLabelMap);\n\t}\n\n\tpublic getInjector(label: RegistryLabel, globalPrecedence: boolean = false): InjectorItem | null {\n\t\treturn this._get(label, globalPrecedence, 'getInjector', this._registryInjectorLabelMap);\n\t}\n\n\tprivate _get(\n\t\tlabel: RegistryLabel,\n\t\tglobalPrecedence: boolean,\n\t\tgetFunctionName: 'getInjector' | 'get',\n\t\tlabelMap: Map\n\t): any {\n\t\tconst registries = globalPrecedence ? [this.baseRegistry, this._registry] : [this._registry, this.baseRegistry];\n\t\tfor (let i = 0; i < registries.length; i++) {\n\t\t\tconst registry: any = registries[i];\n\t\t\tif (!registry) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst item = registry[getFunctionName](label);\n\t\t\tconst registeredLabels = labelMap.get(registry) || [];\n\t\t\tif (item) {\n\t\t\t\treturn item;\n\t\t\t} else if (registeredLabels.indexOf(label) === -1) {\n\t\t\t\tconst handle = registry.on(label, (event: RegistryEventObject) => {\n\t\t\t\t\tif (\n\t\t\t\t\t\tevent.action === 'loaded' &&\n\t\t\t\t\t\t(this as any)[getFunctionName](label, globalPrecedence) === event.item\n\t\t\t\t\t) {\n\t\t\t\t\t\tthis.emit({ type: 'invalidate' });\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\tthis.own(handle);\n\t\t\t\tlabelMap.set(registry, [...registeredLabels, label]);\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}\n}\n\nexport default RegistryHandler;\n"]} \ No newline at end of file diff --git a/deps/framework/widget-core/RegistryHandler.mjs b/deps/framework/widget-core/RegistryHandler.mjs deleted file mode 100644 index 0ca6e56449..0000000000 --- a/deps/framework/widget-core/RegistryHandler.mjs +++ /dev/null @@ -1,72 +0,0 @@ -import { Map } from '../shim/Map'; -import { Evented } from '../core/Evented'; -import { Registry } from './Registry'; -export class RegistryHandler extends Evented { - constructor() { - super(); - this._registry = new Registry(); - this._registryWidgetLabelMap = new Map(); - this._registryInjectorLabelMap = new Map(); - this.own(this._registry); - const destroy = () => { - if (this.baseRegistry) { - this._registryWidgetLabelMap.delete(this.baseRegistry); - this._registryInjectorLabelMap.delete(this.baseRegistry); - this.baseRegistry = undefined; - } - }; - this.own({ destroy }); - } - set base(baseRegistry) { - if (this.baseRegistry) { - this._registryWidgetLabelMap.delete(this.baseRegistry); - this._registryInjectorLabelMap.delete(this.baseRegistry); - } - this.baseRegistry = baseRegistry; - } - define(label, widget) { - this._registry.define(label, widget); - } - defineInjector(label, injector) { - this._registry.defineInjector(label, injector); - } - has(label) { - return this._registry.has(label) || Boolean(this.baseRegistry && this.baseRegistry.has(label)); - } - hasInjector(label) { - return this._registry.hasInjector(label) || Boolean(this.baseRegistry && this.baseRegistry.hasInjector(label)); - } - get(label, globalPrecedence = false) { - return this._get(label, globalPrecedence, 'get', this._registryWidgetLabelMap); - } - getInjector(label, globalPrecedence = false) { - return this._get(label, globalPrecedence, 'getInjector', this._registryInjectorLabelMap); - } - _get(label, globalPrecedence, getFunctionName, labelMap) { - const registries = globalPrecedence ? [this.baseRegistry, this._registry] : [this._registry, this.baseRegistry]; - for (let i = 0; i < registries.length; i++) { - const registry = registries[i]; - if (!registry) { - continue; - } - const item = registry[getFunctionName](label); - const registeredLabels = labelMap.get(registry) || []; - if (item) { - return item; - } - else if (registeredLabels.indexOf(label) === -1) { - const handle = registry.on(label, (event) => { - if (event.action === 'loaded' && - this[getFunctionName](label, globalPrecedence) === event.item) { - this.emit({ type: 'invalidate' }); - } - }); - this.own(handle); - labelMap.set(registry, [...registeredLabels, label]); - } - } - return null; - } -} -export default RegistryHandler; -//# sourceMappingURL=RegistryHandler.mjs.map \ No newline at end of file diff --git a/deps/framework/widget-core/RegistryHandler.mjs.map b/deps/framework/widget-core/RegistryHandler.mjs.map deleted file mode 100644 index 664833d0ff..0000000000 --- a/deps/framework/widget-core/RegistryHandler.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"RegistryHandler.mjs","sourceRoot":"","sources":["RegistryHandler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,aAAa,CAAC;AAClC,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAG1C,OAAO,EAAE,QAAQ,EAAqC,MAAM,YAAY,CAAC;AAMzE,MAAM,sBAAuB,SAAQ,OAAgC;IAMpE;QACC,KAAK,EAAE,CAAC;QAND,cAAS,GAAG,IAAI,QAAQ,EAAE,CAAC;QAC3B,4BAAuB,GAAmC,IAAI,GAAG,EAAE,CAAC;QACpE,8BAAyB,GAAmC,IAAI,GAAG,EAAE,CAAC;QAK7E,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QACzB,MAAM,OAAO,GAAG,GAAG,EAAE;YACpB,EAAE,CAAC,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC;gBACvB,IAAI,CAAC,uBAAuB,CAAC,MAAM,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;gBACvD,IAAI,CAAC,yBAAyB,CAAC,MAAM,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;gBACzD,IAAI,CAAC,YAAY,GAAG,SAAS,CAAC;YAC/B,CAAC;QACF,CAAC,CAAC;QACF,IAAI,CAAC,GAAG,CAAC,EAAE,OAAO,EAAE,CAAC,CAAC;IACvB,CAAC;IAED,I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AY,EAAE,CAAC,CAAC;oBACnC,CAAC;gBACF,CAAC,CAAC,CAAC;gBACH,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;gBACjB,QAAQ,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC,GAAG,gBAAgB,EAAE,KAAK,CAAC,CAAC,CAAC;YACtD,CAAC;QACF,CAAC;QACD,MAAM,CAAC,IAAI,CAAC;IACb,CAAC;CACD;AAED,eAAe,eAAe,CAAC","sourcesContent":["import { Map } from '../shim/Map';\nimport { Evented } from '../core/Evented';\nimport { EventObject } from '../core/interfaces';\nimport { Constructor, InjectorFactory, InjectorItem, RegistryLabel, WidgetBaseInterface } from './interfaces';\nimport { Registry, RegistryEventObject, RegistryItem } from './Registry';\n\nexport type RegistryHandlerEventMap = {\n\tinvalidate: EventObject<'invalidate'>;\n};\n\nexport class RegistryHandler extends Evented {\n\tprivate _registry = new Registry();\n\tprivate _registryWidgetLabelMap: Map = new Map();\n\tprivate _registryInjectorLabelMap: Map = new Map();\n\tprotected baseRegistry?: Registry;\n\n\tconstructor() {\n\t\tsuper();\n\t\tthis.own(this._registry);\n\t\tconst destroy = () => {\n\t\t\tif (this.baseRegistry) {\n\t\t\t\tthis._registryWidgetLabelMap.delete(this.baseRegistry);\n\t\t\t\tthis._registryInjectorLabelMap.delete(this.baseRegistry);\n\t\t\t\tthis.baseRegistry = undefined;\n\t\t\t}\n\t\t};\n\t\tthis.own({ destroy });\n\t}\n\n\tpublic set base(baseRegistry: Registry) {\n\t\tif (this.baseRegistry) {\n\t\t\tthis._registryWidgetLabelMap.delete(this.baseRegistry);\n\t\t\tthis._registryInjectorLabelMap.delete(this.baseRegistry);\n\t\t}\n\t\tthis.baseRegistry = baseRegistry;\n\t}\n\n\tpublic define(label: RegistryLabel, widget: RegistryItem): void {\n\t\tthis._registry.define(label, widget);\n\t}\n\n\tpublic defineInjector(label: RegistryLabel, injector: InjectorFactory): void {\n\t\tthis._registry.defineInjector(label, injector);\n\t}\n\n\tpublic has(label: RegistryLabel): boolean {\n\t\treturn this._registry.has(label) || Boolean(this.baseRegistry && this.baseRegistry.has(label));\n\t}\n\n\tpublic hasInjector(label: RegistryLabel): boolean {\n\t\treturn this._registry.hasInjector(label) || Boolean(this.baseRegistry && this.baseRegistry.hasInjector(label));\n\t}\n\n\tpublic get(\n\t\tlabel: RegistryLabel,\n\t\tglobalPrecedence: boolean = false\n\t): Constructor | null {\n\t\treturn this._get(label, globalPrecedence, 'get', this._registryWidgetLabelMap);\n\t}\n\n\tpublic getInjector(label: RegistryLabel, globalPrecedence: boolean = false): InjectorItem | null {\n\t\treturn this._get(label, globalPrecedence, 'getInjector', this._registryInjectorLabelMap);\n\t}\n\n\tprivate _get(\n\t\tlabel: RegistryLabel,\n\t\tglobalPrecedence: boolean,\n\t\tgetFunctionName: 'getInjector' | 'get',\n\t\tlabelMap: Map\n\t): any {\n\t\tconst registries = globalPrecedence ? [this.baseRegistry, this._registry] : [this._registry, this.baseRegistry];\n\t\tfor (let i = 0; i < registries.length; i++) {\n\t\t\tconst registry: any = registries[i];\n\t\t\tif (!registry) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst item = registry[getFunctionName](label);\n\t\t\tconst registeredLabels = labelMap.get(registry) || [];\n\t\t\tif (item) {\n\t\t\t\treturn item;\n\t\t\t} else if (registeredLabels.indexOf(label) === -1) {\n\t\t\t\tconst handle = registry.on(label, (event: RegistryEventObject) => {\n\t\t\t\t\tif (\n\t\t\t\t\t\tevent.action === 'loaded' &&\n\t\t\t\t\t\t(this as any)[getFunctionName](label, globalPrecedence) === event.item\n\t\t\t\t\t) {\n\t\t\t\t\t\tthis.emit({ type: 'invalidate' });\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\tthis.own(handle);\n\t\t\t\tlabelMap.set(registry, [...registeredLabels, label]);\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}\n}\n\nexport default RegistryHandler;\n"]} \ No newline at end of file diff --git a/deps/framework/widget-core/WidgetBase.d.ts b/deps/framework/widget-core/WidgetBase.d.ts deleted file mode 100644 index 3d7da24344..0000000000 --- a/deps/framework/widget-core/WidgetBase.d.ts +++ /dev/null @@ -1,107 +0,0 @@ -import { Handle } from '../core/interfaces'; -import { CoreProperties, DNode, WidgetMetaBase, WidgetMetaConstructor, WidgetBaseInterface, WidgetProperties } from './interfaces'; -import RegistryHandler from './RegistryHandler'; -export declare type BoundFunctionData = { - boundFunc: (...args: any[]) => any; - scope: any; -}; -export declare const noBind: symbol; -/** - * Main widget base for all widgets to extend - */ -export declare class WidgetBase

implements WidgetBaseInterface { - /** - * static identifier - */ - static _type: symbol; - /** - * children array - */ - private _children; - /** - * Indicates if it is the initial set properties cycle - */ - private _initialProperties; - /** - * internal widget properties - */ - private _properties; - /** - * Array of property keys considered changed from the previous set properties - */ - private _changedPropertyKeys; - /** - * map of decorators that are applied to this widget - */ - private _decoratorCache; - private _registry; - /** - * Map of functions properties for the bound function - */ - private _bindFunctionPropertyMap; - private _metaMap; - private _boundRenderFunc; - private _boundInvalidate; - private _nodeHandler; - private _handles; - /** - * @constructor - */ - constructor(); - protected meta(MetaType: WidgetMetaConstructor): T; - protected onAttach(): void; - protected onDetach(): void; - readonly properties: Readonly

& Readonly; - readonly changedPropertyKeys: string[]; - __setCoreProperties__(coreProperties: CoreProperties): void; - __setProperties__(originalProperties: this['properties']): void; - readonly children: (C | null)[]; - __setChildren__(children: (C | null)[]): void; - __render__(): DNode | DNode[]; - invalidate(): void; - protected render(): DNode | DNode[]; - /** - * Function to add decorators to WidgetBase - * - * @param decoratorKey The key of the decorator - * @param value The value of the decorator - */ - protected addDecorator(decoratorKey: string, value: any): void; - /** - * Function to build the list of decorators from the global decorator map. - * - * @param decoratorKey The key of the decorator - * @return An array of decorator values - * @private - */ - private _buildDecoratorList(decoratorKey); - /** - * Function to retrieve decorator values - * - * @param decoratorKey The key of the decorator - * @returns An array of decorator values - */ - protected getDecorator(decoratorKey: string): any[]; - /** - * Binds unbound property functions to the specified `bind` property - * - * @param properties properties to check for functions - */ - private _bindFunctionProperty(property, bind); - readonly registry: RegistryHandler; - private _runBeforeProperties(properties); - /** - * Run all registered before renders and return the updated render method - */ - private _runBeforeRenders(); - /** - * Run all registered after renders and return the decorated DNodes - * - * @param dNode The DNodes to run through the after renders - */ - protected runAfterRenders(dNode: DNode | DNode[]): DNode | DNode[]; - private _runAfterConstructors(); - protected own(handle: Handle): void; - protected destroy(): void; -} -export default WidgetBase; diff --git a/deps/framework/widget-core/WidgetBase.js b/deps/framework/widget-core/WidgetBase.js deleted file mode 100644 index 96c2cae8da..0000000000 --- a/deps/framework/widget-core/WidgetBase.js +++ /dev/null @@ -1,397 +0,0 @@ -(function (factory) { - if (typeof module === "object" && typeof module.exports === "object") { - var v = factory(require, exports); - if (v !== undefined) module.exports = v; - } - else if (typeof define === "function" && define.amd) { - define(["require", "exports", "tslib", "../shim/Map", "../shim/WeakMap", "../shim/Symbol", "./d", "./diff", "./RegistryHandler", "./NodeHandler", "./vdom", "./Registry"], factory); - } -})(function (require, exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - var tslib_1 = require("tslib"); - var Map_1 = require("../shim/Map"); - var WeakMap_1 = require("../shim/WeakMap"); - var Symbol_1 = require("../shim/Symbol"); - var d_1 = require("./d"); - var diff_1 = require("./diff"); - var RegistryHandler_1 = require("./RegistryHandler"); - var NodeHandler_1 = require("./NodeHandler"); - var vdom_1 = require("./vdom"); - var Registry_1 = require("./Registry"); - var decoratorMap = new Map_1.default(); - var boundAuto = diff_1.auto.bind(null); - exports.noBind = Symbol_1.default.for('dojoNoBind'); - /** - * Main widget base for all widgets to extend - */ - var WidgetBase = /** @class */ (function () { - /** - * @constructor - */ - function WidgetBase() { - var _this = this; - /** - * Indicates if it is the initial set properties cycle - */ - this._initialProperties = true; - /** - * Array of property keys considered changed from the previous set properties - */ - this._changedPropertyKeys = []; - this._nodeHandler = new NodeHandler_1.default(); - this._handles = []; - this._children = []; - this._decoratorCache = new Map_1.default(); - this._properties = {}; - this._boundRenderFunc = this.render.bind(this); - this._boundInvalidate = this.invalidate.bind(this); - vdom_1.widgetInstanceMap.set(this, { - dirty: true, - onAttach: function () { - _this.onAttach(); - }, - onDetach: function () { - _this.onDetach(); - _this.destroy(); - }, - nodeHandler: this._nodeHandler, - registry: function () { - return _this.registry; - }, - coreProperties: {}, - rendering: false, - inputProperties: {} - }); - this._runAfterConstructors(); - } - WidgetBase.prototype.meta = function (MetaType) { - if (this._metaMap === undefined) { - this._metaMap = new Map_1.default(); - } - var cached = this._metaMap.get(MetaType); - if (!cached) { - cached = new MetaType({ - invalidate: this._boundInvalidate, - nodeHandler: this._nodeHandler, - bind: this - }); - this.own(cached); - this._metaMap.set(MetaType, cached); - } - return cached; - }; - WidgetBase.prototype.onAttach = function () { - // Do nothing by default. - }; - WidgetBase.prototype.onDetach = function () { - // Do nothing by default. - }; - Object.defineProperty(WidgetBase.prototype, "properties", { - get: function () { - return this._properties; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(WidgetBase.prototype, "changedPropertyKeys", { - get: function () { - return tslib_1.__spread(this._changedPropertyKeys); - }, - enumerable: true, - configurable: true - }); - WidgetBase.prototype.__setCoreProperties__ = function (coreProperties) { - var baseRegistry = coreProperties.baseRegistry; - var instanceData = vdom_1.widgetInstanceMap.get(this); - if (instanceData.coreProperties.baseRegistry !== baseRegistry) { - if (this._registry === undefined) { - this._registry = new RegistryHandler_1.default(); - this.own(this._registry); - this.own(this._registry.on('invalidate', this._boundInvalidate)); - } - this._registry.base = baseRegistry; - this.invalidate(); - } - instanceData.coreProperties = coreProperties; - }; - WidgetBase.prototype.__setProperties__ = function (originalProperties) { - var _this = this; - var instanceData = vdom_1.widgetInstanceMap.get(this); - instanceData.inputProperties = originalProperties; - var properties = this._runBeforeProperties(originalProperties); - var registeredDiffPropertyNames = this.getDecorator('registeredDiffProperty'); - var changedPropertyKeys = []; - var propertyNames = Object.keys(properties); - if (this._initialProperties === false || registeredDiffPropertyNames.length !== 0) { - var allProperties = tslib_1.__spread(propertyNames, Object.keys(this._properties)); - var checkedProperties = []; - var diffPropertyResults_1 = {}; - var runReactions = false; - for (var i = 0; i < allProperties.length; i++) { - var propertyName = allProperties[i]; - if (checkedProperties.indexOf(propertyName) !== -1) { - continue; - } - checkedProperties.push(propertyName); - var previousProperty = this._properties[propertyName]; - var newProperty = this._bindFunctionProperty(properties[propertyName], instanceData.coreProperties.bind); - if (registeredDiffPropertyNames.indexOf(propertyName) !== -1) { - runReactions = true; - var diffFunctions = this.getDecorator("diffProperty:" + propertyName); - for (var i_1 = 0; i_1 < diffFunctions.length; i_1++) { - var result = diffFunctions[i_1](previousProperty, newProperty); - if (result.changed && changedPropertyKeys.indexOf(propertyName) === -1) { - changedPropertyKeys.push(propertyName); - } - if (propertyName in properties) { - diffPropertyResults_1[propertyName] = result.value; - } - } - } - else { - var result = boundAuto(previousProperty, newProperty); - if (result.changed && changedPropertyKeys.indexOf(propertyName) === -1) { - changedPropertyKeys.push(propertyName); - } - if (propertyName in properties) { - diffPropertyResults_1[propertyName] = result.value; - } - } - } - if (runReactions) { - var reactionFunctions = this.getDecorator('diffReaction'); - var executedReactions_1 = []; - reactionFunctions.forEach(function (_a) { - var reaction = _a.reaction, propertyName = _a.propertyName; - var propertyChanged = changedPropertyKeys.indexOf(propertyName) !== -1; - var reactionRun = executedReactions_1.indexOf(reaction) !== -1; - if (propertyChanged && !reactionRun) { - reaction.call(_this, _this._properties, diffPropertyResults_1); - executedReactions_1.push(reaction); - } - }); - } - this._properties = diffPropertyResults_1; - this._changedPropertyKeys = changedPropertyKeys; - } - else { - this._initialProperties = false; - for (var i = 0; i < propertyNames.length; i++) { - var propertyName = propertyNames[i]; - if (typeof properties[propertyName] === 'function') { - properties[propertyName] = this._bindFunctionProperty(properties[propertyName], instanceData.coreProperties.bind); - } - else { - changedPropertyKeys.push(propertyName); - } - } - this._changedPropertyKeys = changedPropertyKeys; - this._properties = tslib_1.__assign({}, properties); - } - if (this._changedPropertyKeys.length > 0) { - this.invalidate(); - } - }; - Object.defineProperty(WidgetBase.prototype, "children", { - get: function () { - return this._children; - }, - enumerable: true, - configurable: true - }); - WidgetBase.prototype.__setChildren__ = function (children) { - if (this._children.length > 0 || children.length > 0) { - this._children = children; - this.invalidate(); - } - }; - WidgetBase.prototype.__render__ = function () { - var instanceData = vdom_1.widgetInstanceMap.get(this); - instanceData.dirty = false; - var render = this._runBeforeRenders(); - var dNode = render(); - dNode = this.runAfterRenders(dNode); - this._nodeHandler.clear(); - return dNode; - }; - WidgetBase.prototype.invalidate = function () { - var instanceData = vdom_1.widgetInstanceMap.get(this); - if (instanceData.invalidate) { - instanceData.invalidate(); - } - }; - WidgetBase.prototype.render = function () { - return d_1.v('div', {}, this.children); - }; - /** - * Function to add decorators to WidgetBase - * - * @param decoratorKey The key of the decorator - * @param value The value of the decorator - */ - WidgetBase.prototype.addDecorator = function (decoratorKey, value) { - value = Array.isArray(value) ? value : [value]; - if (this.hasOwnProperty('constructor')) { - var decoratorList = decoratorMap.get(this.constructor); - if (!decoratorList) { - decoratorList = new Map_1.default(); - decoratorMap.set(this.constructor, decoratorList); - } - var specificDecoratorList = decoratorList.get(decoratorKey); - if (!specificDecoratorList) { - specificDecoratorList = []; - decoratorList.set(decoratorKey, specificDecoratorList); - } - specificDecoratorList.push.apply(specificDecoratorList, tslib_1.__spread(value)); - } - else { - var decorators = this.getDecorator(decoratorKey); - this._decoratorCache.set(decoratorKey, tslib_1.__spread(decorators, value)); - } - }; - /** - * Function to build the list of decorators from the global decorator map. - * - * @param decoratorKey The key of the decorator - * @return An array of decorator values - * @private - */ - WidgetBase.prototype._buildDecoratorList = function (decoratorKey) { - var allDecorators = []; - var constructor = this.constructor; - while (constructor) { - var instanceMap = decoratorMap.get(constructor); - if (instanceMap) { - var decorators = instanceMap.get(decoratorKey); - if (decorators) { - allDecorators.unshift.apply(allDecorators, tslib_1.__spread(decorators)); - } - } - constructor = Object.getPrototypeOf(constructor); - } - return allDecorators; - }; - /** - * Function to retrieve decorator values - * - * @param decoratorKey The key of the decorator - * @returns An array of decorator values - */ - WidgetBase.prototype.getDecorator = function (decoratorKey) { - var allDecorators = this._decoratorCache.get(decoratorKey); - if (allDecorators !== undefined) { - return allDecorators; - } - allDecorators = this._buildDecoratorList(decoratorKey); - this._decoratorCache.set(decoratorKey, allDecorators); - return allDecorators; - }; - /** - * Binds unbound property functions to the specified `bind` property - * - * @param properties properties to check for functions - */ - WidgetBase.prototype._bindFunctionProperty = function (property, bind) { - if (typeof property === 'function' && !property[exports.noBind] && Registry_1.isWidgetBaseConstructor(property) === false) { - if (this._bindFunctionPropertyMap === undefined) { - this._bindFunctionPropertyMap = new WeakMap_1.default(); - } - var bindInfo = this._bindFunctionPropertyMap.get(property) || {}; - var boundFunc = bindInfo.boundFunc, scope = bindInfo.scope; - if (boundFunc === undefined || scope !== bind) { - boundFunc = property.bind(bind); - this._bindFunctionPropertyMap.set(property, { boundFunc: boundFunc, scope: bind }); - } - return boundFunc; - } - return property; - }; - Object.defineProperty(WidgetBase.prototype, "registry", { - get: function () { - if (this._registry === undefined) { - this._registry = new RegistryHandler_1.default(); - this.own(this._registry); - this.own(this._registry.on('invalidate', this._boundInvalidate)); - } - return this._registry; - }, - enumerable: true, - configurable: true - }); - WidgetBase.prototype._runBeforeProperties = function (properties) { - var _this = this; - var beforeProperties = this.getDecorator('beforeProperties'); - if (beforeProperties.length > 0) { - return beforeProperties.reduce(function (properties, beforePropertiesFunction) { - return tslib_1.__assign({}, properties, beforePropertiesFunction.call(_this, properties)); - }, tslib_1.__assign({}, properties)); - } - return properties; - }; - /** - * Run all registered before renders and return the updated render method - */ - WidgetBase.prototype._runBeforeRenders = function () { - var _this = this; - var beforeRenders = this.getDecorator('beforeRender'); - if (beforeRenders.length > 0) { - return beforeRenders.reduce(function (render, beforeRenderFunction) { - var updatedRender = beforeRenderFunction.call(_this, render, _this._properties, _this._children); - if (!updatedRender) { - console.warn('Render function not returned from beforeRender, using previous render'); - return render; - } - return updatedRender; - }, this._boundRenderFunc); - } - return this._boundRenderFunc; - }; - /** - * Run all registered after renders and return the decorated DNodes - * - * @param dNode The DNodes to run through the after renders - */ - WidgetBase.prototype.runAfterRenders = function (dNode) { - var _this = this; - var afterRenders = this.getDecorator('afterRender'); - if (afterRenders.length > 0) { - dNode = afterRenders.reduce(function (dNode, afterRenderFunction) { - return afterRenderFunction.call(_this, dNode); - }, dNode); - } - if (this._metaMap !== undefined) { - this._metaMap.forEach(function (meta) { - meta.afterRender(); - }); - } - return dNode; - }; - WidgetBase.prototype._runAfterConstructors = function () { - var _this = this; - var afterConstructors = this.getDecorator('afterConstructor'); - if (afterConstructors.length > 0) { - afterConstructors.forEach(function (afterConstructor) { return afterConstructor.call(_this); }); - } - }; - WidgetBase.prototype.own = function (handle) { - this._handles.push(handle); - }; - WidgetBase.prototype.destroy = function () { - while (this._handles.length > 0) { - var handle = this._handles.pop(); - if (handle) { - handle.destroy(); - } - } - }; - /** - * static identifier - */ - WidgetBase._type = Registry_1.WIDGET_BASE_TYPE; - return WidgetBase; - }()); - exports.WidgetBase = WidgetBase; - exports.default = WidgetBase; -}); -//# sourceMappingURL=WidgetBase.js.map \ No newline at end of file diff --git a/deps/framework/widget-core/WidgetBase.js.map b/deps/framework/widget-core/WidgetBase.js.map deleted file mode 100644 index 856442efbe..0000000000 --- a/deps/framework/widget-core/WidgetBase.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"WidgetBase.js","sourceRoot":"","sources":["WidgetBase.ts"],"names":[],"mappings":";;;;;;;;;;;;IAAA,mCAA8B;IAC9B,2CAAsC;IACtC,yCAAoC;IAEpC,yBAAwB;IACxB,+BAA8B;IAc9B,qDAAgD;IAChD,6CAAwC;IACxC,+BAA2C;IAC3C,uCAAuE;IASvE,IAAM,YAAY,GAAG,IAAI,aAAG,EAAgC,CAAC;IAC7D,IAAM,SAAS,GAAG,WAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAErB,QAAA,M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G,IAAI,CAAC,QAAQ,CAAC,GAAG,EAAE,CAAC;gBACnC,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC;oBACZ,MAAM,CAAC,OAAO,EAAE,CAAC;gBAClB,CAAC;YACF,CAAC;QACF,CAAC;QA1aD;;WAEG;QACI,gBAAK,GAAW,2BAAgB,CAAC;QAwazC,iBAAC;KAAA,AA5aD,IA4aC;IA5aY,gCAAU;IA8avB,kBAAe,UAAU,CAAC","sourcesContent":["import Map from '../shim/Map';\nimport WeakMap from '../shim/WeakMap';\nimport Symbol from '../shim/Symbol';\nimport { Handle } from '../core/interfaces';\nimport { v } from './d';\nimport { auto } from './diff';\nimport {\n\tAfterRender,\n\tBeforeProperties,\n\tBeforeRender,\n\tCoreProperties,\n\tDiffPropertyReaction,\n\tDNode,\n\tRender,\n\tWidgetMetaBase,\n\tWidgetMetaConstructor,\n\tWidgetBaseInterface,\n\tWidgetProperties\n} from './interfaces';\nimport RegistryHandler from './RegistryHandler';\nimport NodeHandler from './NodeHandler';\nimport { widgetInstanceMap } from './vdom';\nimport { isWidgetBaseConstructor, WIDGET_BASE_TYPE } from './Registry';\n\ninterface ReactionFunctionConfig {\n\tpropertyName: string;\n\treaction: DiffPropertyReaction;\n}\n\nexport type BoundFunctionData = { boundFunc: (...args: any[]) => any; scope: any };\n\nconst decoratorMap = new Map>();\nconst boundAuto = auto.bind(null);\n\nexport const noBind = Symbol.for('dojoNoBind');\n\n/**\n * Main widget base for all widgets to extend\n */\nexport class WidgetBase

implements WidgetBaseInterface {\n\t/**\n\t * static identifier\n\t */\n\tstatic _type: symbol = WIDGET_BASE_TYPE;\n\n\t/**\n\t * children array\n\t */\n\tprivate _children: (C | null)[];\n\n\t/**\n\t * Indicates if it is the initial set properties cycle\n\t */\n\tprivate _initialProperties = true;\n\n\t/**\n\t * internal widget properties\n\t */\n\tprivate _properties: P & WidgetProperties & { [index: string]: any };\n\n\t/**\n\t * Array of property keys considered changed from the previous set properties\n\t */\n\tprivate _changedPropertyKeys: string[] = [];\n\n\t/**\n\t * map of decorators that are applied to this widget\n\t */\n\tprivate _decoratorCache: Map;\n\n\tprivate _registry: RegistryHandler | undefined;\n\n\t/**\n\t * Map of functions properties for the bound function\n\t */\n\tprivate _bindFunctionPropertyMap: WeakMap<(...args: any[]) => any, BoundFunctionData> | undefined;\n\n\tprivate _metaMap: Map, WidgetMetaBase> | undefined;\n\n\tprivate _boundRenderFunc: Render;\n\n\tprivate _boundInvalidate: () => void;\n\n\tprivate _nodeHandler: NodeHandler = new NodeHandler();\n\n\tprivate _handles: Handle[] = [];\n\n\t/**\n\t * @constructor\n\t */\n\tconstructor() {\n\t\tthis._children = [];\n\t\tthis._decoratorCache = new Map();\n\t\tthis._properties =

{};\n\t\tthis._boundRenderFunc = this.render.bind(this);\n\t\tthis._boundInvalidate = this.invalidate.bind(this);\n\n\t\twidgetInstanceMap.set(this, {\n\t\t\tdirty: true,\n\t\t\tonAttach: (): void => {\n\t\t\t\tthis.onAttach();\n\t\t\t},\n\t\t\tonDetach: (): void => {\n\t\t\t\tthis.onDetach();\n\t\t\t\tthis.destroy();\n\t\t\t},\n\t\t\tnodeHandler: this._nodeHandler,\n\t\t\tregistry: () => {\n\t\t\t\treturn this.registry;\n\t\t\t},\n\t\t\tcoreProperties: {} as CoreProperties,\n\t\t\trendering: false,\n\t\t\tinputProperties: {}\n\t\t});\n\n\t\tthis._runAfterConstructors();\n\t}\n\n\tprotected meta(MetaType: WidgetMetaConstructor): T {\n\t\tif (this._metaMap === undefined) {\n\t\t\tthis._metaMap = new Map, WidgetMetaBase>();\n\t\t}\n\t\tlet cached = this._metaMap.get(MetaType);\n\t\tif (!cached) {\n\t\t\tcached = new MetaType({\n\t\t\t\tinvalidate: this._boundInvalidate,\n\t\t\t\tnodeHandler: this._nodeHandler,\n\t\t\t\tbind: this\n\t\t\t});\n\t\t\tthis.own(cached);\n\t\t\tthis._metaMap.set(MetaType, cached);\n\t\t}\n\n\t\treturn cached as T;\n\t}\n\n\tprotected onAttach(): void {\n\t\t// Do nothing by default.\n\t}\n\n\tprotected onDetach(): void {\n\t\t// Do nothing by default.\n\t}\n\n\tpublic get properties(): Readonly

& Readonly {\n\t\treturn this._properties;\n\t}\n\n\tpublic get changedPropertyKeys(): string[] {\n\t\treturn [...this._changedPropertyKeys];\n\t}\n\n\tpublic __setCoreProperties__(coreProperties: CoreProperties): void {\n\t\tconst { baseRegistry } = coreProperties;\n\t\tconst instanceData = widgetInstanceMap.get(this)!;\n\n\t\tif (instanceData.coreProperties.baseRegistry !== baseRegistry) {\n\t\t\tif (this._registry === undefined) {\n\t\t\t\tthis._registry = new RegistryHandler();\n\t\t\t\tthis.own(this._registry);\n\t\t\t\tthis.own(this._registry.on('invalidate', this._boundInvalidate));\n\t\t\t}\n\t\t\tthis._registry.base = baseRegistry;\n\t\t\tthis.invalidate();\n\t\t}\n\t\tinstanceData.coreProperties = coreProperties;\n\t}\n\n\tpublic __setProperties__(originalProperties: this['properties']): void {\n\t\tconst instanceData = widgetInstanceMap.get(this)!;\n\t\tinstanceData.inputProperties = originalProperties;\n\t\tconst properties = this._runBeforeProperties(originalProperties);\n\t\tconst registeredDiffPropertyNames = this.getDecorator('registeredDiffProperty');\n\t\tconst changedPropertyKeys: string[] = [];\n\t\tconst propertyNames = Object.keys(properties);\n\n\t\tif (this._initialProperties === false || registeredDiffPropertyNames.length !== 0) {\n\t\t\tconst allProperties = [...propertyNames, ...Object.keys(this._properties)];\n\t\t\tconst checkedProperties: (string | number)[] = [];\n\t\t\tconst diffPropertyResults: any = {};\n\t\t\tlet runReactions = false;\n\n\t\t\tfor (let i = 0; i < allProperties.length; i++) {\n\t\t\t\tconst propertyName = allProperties[i];\n\t\t\t\tif (checkedProperties.indexOf(propertyName) !== -1) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tcheckedProperties.push(propertyName);\n\t\t\t\tconst previousProperty = this._properties[propertyName];\n\t\t\t\tconst newProperty = this._bindFunctionProperty(\n\t\t\t\t\tproperties[propertyName],\n\t\t\t\t\tinstanceData.coreProperties.bind\n\t\t\t\t);\n\t\t\t\tif (registeredDiffPropertyNames.indexOf(propertyName) !== -1) {\n\t\t\t\t\trunReactions = true;\n\t\t\t\t\tconst diffFunctions = this.getDecorator(`diffProperty:${propertyName}`);\n\t\t\t\t\tfor (let i = 0; i < diffFunctions.length; i++) {\n\t\t\t\t\t\tconst result = diffFunctions[i](previousProperty, newProperty);\n\t\t\t\t\t\tif (result.changed && changedPropertyKeys.indexOf(propertyName) === -1) {\n\t\t\t\t\t\t\tchangedPropertyKeys.push(propertyName);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (propertyName in properties) {\n\t\t\t\t\t\t\tdiffPropertyResults[propertyName] = result.value;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tconst result = boundAuto(previousProperty, newProperty);\n\t\t\t\t\tif (result.changed && changedPropertyKeys.indexOf(propertyName) === -1) {\n\t\t\t\t\t\tchangedPropertyKeys.push(propertyName);\n\t\t\t\t\t}\n\t\t\t\t\tif (propertyName in properties) {\n\t\t\t\t\t\tdiffPropertyResults[propertyName] = result.value;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (runReactions) {\n\t\t\t\tconst reactionFunctions: ReactionFunctionConfig[] = this.getDecorator('diffReaction');\n\t\t\t\tconst executedReactions: Function[] = [];\n\t\t\t\treactionFunctions.forEach(({ reaction, propertyName }) => {\n\t\t\t\t\tconst propertyChanged = changedPropertyKeys.indexOf(propertyName) !== -1;\n\t\t\t\t\tconst reactionRun = executedReactions.indexOf(reaction) !== -1;\n\t\t\t\t\tif (propertyChanged && !reactionRun) {\n\t\t\t\t\t\treaction.call(this, this._properties, diffPropertyResults);\n\t\t\t\t\t\texecutedReactions.push(reaction);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\t\t\tthis._properties = diffPropertyResults;\n\t\t\tthis._changedPropertyKeys = changedPropertyKeys;\n\t\t} else {\n\t\t\tthis._initialProperties = false;\n\t\t\tfor (let i = 0; i < propertyNames.length; i++) {\n\t\t\t\tconst propertyName = propertyNames[i];\n\t\t\t\tif (typeof properties[propertyName] === 'function') {\n\t\t\t\t\tproperties[propertyName] = this._bindFunctionProperty(\n\t\t\t\t\t\tproperties[propertyName],\n\t\t\t\t\t\tinstanceData.coreProperties.bind\n\t\t\t\t\t);\n\t\t\t\t} else {\n\t\t\t\t\tchangedPropertyKeys.push(propertyName);\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis._changedPropertyKeys = changedPropertyKeys;\n\t\t\tthis._properties = { ...properties };\n\t\t}\n\n\t\tif (this._changedPropertyKeys.length > 0) {\n\t\t\tthis.invalidate();\n\t\t}\n\t}\n\n\tpublic get children(): (C | null)[] {\n\t\treturn this._children;\n\t}\n\n\tpublic __setChildren__(children: (C | null)[]): void {\n\t\tif (this._children.length > 0 || children.length > 0) {\n\t\t\tthis._children = children;\n\t\t\tthis.invalidate();\n\t\t}\n\t}\n\n\tpublic __render__(): DNode | DNode[] {\n\t\tconst instanceData = widgetInstanceMap.get(this)!;\n\t\tinstanceData.dirty = false;\n\t\tconst render = this._runBeforeRenders();\n\t\tlet dNode = render();\n\t\tdNode = this.runAfterRenders(dNode);\n\t\tthis._nodeHandler.clear();\n\t\treturn dNode;\n\t}\n\n\tpublic invalidate(): void {\n\t\tconst instanceData = widgetInstanceMap.get(this)!;\n\t\tif (instanceData.invalidate) {\n\t\t\tinstanceData.invalidate();\n\t\t}\n\t}\n\n\tprotected render(): DNode | DNode[] {\n\t\treturn v('div', {}, this.children);\n\t}\n\n\t/**\n\t * Function to add decorators to WidgetBase\n\t *\n\t * @param decoratorKey The key of the decorator\n\t * @param value The value of the decorator\n\t */\n\tprotected addDecorator(decoratorKey: string, value: any): void {\n\t\tvalue = Array.isArray(value) ? value : [value];\n\t\tif (this.hasOwnProperty('constructor')) {\n\t\t\tlet decoratorList = decoratorMap.get(this.constructor);\n\t\t\tif (!decoratorList) {\n\t\t\t\tdecoratorList = new Map();\n\t\t\t\tdecoratorMap.set(this.constructor, decoratorList);\n\t\t\t}\n\n\t\t\tlet specificDecoratorList = decoratorList.get(decoratorKey);\n\t\t\tif (!specificDecoratorList) {\n\t\t\t\tspecificDecoratorList = [];\n\t\t\t\tdecoratorList.set(decoratorKey, specificDecoratorList);\n\t\t\t}\n\t\t\tspecificDecoratorList.push(...value);\n\t\t} else {\n\t\t\tconst decorators = this.getDecorator(decoratorKey);\n\t\t\tthis._decoratorCache.set(decoratorKey, [...decorators, ...value]);\n\t\t}\n\t}\n\n\t/**\n\t * Function to build the list of decorators from the global decorator map.\n\t *\n\t * @param decoratorKey The key of the decorator\n\t * @return An array of decorator values\n\t * @private\n\t */\n\tprivate _buildDecoratorList(decoratorKey: string): any[] {\n\t\tconst allDecorators = [];\n\n\t\tlet constructor = this.constructor;\n\n\t\twhile (constructor) {\n\t\t\tconst instanceMap = decoratorMap.get(constructor);\n\t\t\tif (instanceMap) {\n\t\t\t\tconst decorators = instanceMap.get(decoratorKey);\n\n\t\t\t\tif (decorators) {\n\t\t\t\t\tallDecorators.unshift(...decorators);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tconstructor = Object.getPrototypeOf(constructor);\n\t\t}\n\n\t\treturn allDecorators;\n\t}\n\n\t/**\n\t * Function to retrieve decorator values\n\t *\n\t * @param decoratorKey The key of the decorator\n\t * @returns An array of decorator values\n\t */\n\tprotected getDecorator(decoratorKey: string): any[] {\n\t\tlet allDecorators = this._decoratorCache.get(decoratorKey);\n\n\t\tif (allDecorators !== undefined) {\n\t\t\treturn allDecorators;\n\t\t}\n\n\t\tallDecorators = this._buildDecoratorList(decoratorKey);\n\n\t\tthis._decoratorCache.set(decoratorKey, allDecorators);\n\t\treturn allDecorators;\n\t}\n\n\t/**\n\t * Binds unbound property functions to the specified `bind` property\n\t *\n\t * @param properties properties to check for functions\n\t */\n\tprivate _bindFunctionProperty(property: any, bind: any): any {\n\t\tif (typeof property === 'function' && !property[noBind] && isWidgetBaseConstructor(property) === false) {\n\t\t\tif (this._bindFunctionPropertyMap === undefined) {\n\t\t\t\tthis._bindFunctionPropertyMap = new WeakMap<\n\t\t\t\t\t(...args: any[]) => any,\n\t\t\t\t\t{ boundFunc: (...args: any[]) => any; scope: any }\n\t\t\t\t>();\n\t\t\t}\n\t\t\tconst bindInfo: Partial = this._bindFunctionPropertyMap.get(property) || {};\n\t\t\tlet { boundFunc, scope } = bindInfo;\n\n\t\t\tif (boundFunc === undefined || scope !== bind) {\n\t\t\t\tboundFunc = property.bind(bind) as (...args: any[]) => any;\n\t\t\t\tthis._bindFunctionPropertyMap.set(property, { boundFunc, scope: bind });\n\t\t\t}\n\t\t\treturn boundFunc;\n\t\t}\n\t\treturn property;\n\t}\n\n\tpublic get registry(): RegistryHandler {\n\t\tif (this._registry === undefined) {\n\t\t\tthis._registry = new RegistryHandler();\n\t\t\tthis.own(this._registry);\n\t\t\tthis.own(this._registry.on('invalidate', this._boundInvalidate));\n\t\t}\n\t\treturn this._registry;\n\t}\n\n\tprivate _runBeforeProperties(properties: any) {\n\t\tconst beforeProperties: BeforeProperties[] = this.getDecorator('beforeProperties');\n\t\tif (beforeProperties.length > 0) {\n\t\t\treturn beforeProperties.reduce(\n\t\t\t\t(properties, beforePropertiesFunction) => {\n\t\t\t\t\treturn { ...properties, ...beforePropertiesFunction.call(this, properties) };\n\t\t\t\t},\n\t\t\t\t{ ...properties }\n\t\t\t);\n\t\t}\n\t\treturn properties;\n\t}\n\n\t/**\n\t * Run all registered before renders and return the updated render method\n\t */\n\tprivate _runBeforeRenders(): Render {\n\t\tconst beforeRenders = this.getDecorator('beforeRender');\n\n\t\tif (beforeRenders.length > 0) {\n\t\t\treturn beforeRenders.reduce((render: Render, beforeRenderFunction: BeforeRender) => {\n\t\t\t\tconst updatedRender = beforeRenderFunction.call(this, render, this._properties, this._children);\n\t\t\t\tif (!updatedRender) {\n\t\t\t\t\tconsole.warn('Render function not returned from beforeRender, using previous render');\n\t\t\t\t\treturn render;\n\t\t\t\t}\n\t\t\t\treturn updatedRender;\n\t\t\t}, this._boundRenderFunc);\n\t\t}\n\t\treturn this._boundRenderFunc;\n\t}\n\n\t/**\n\t * Run all registered after renders and return the decorated DNodes\n\t *\n\t * @param dNode The DNodes to run through the after renders\n\t */\n\tprotected runAfterRenders(dNode: DNode | DNode[]): DNode | DNode[] {\n\t\tconst afterRenders = this.getDecorator('afterRender');\n\n\t\tif (afterRenders.length > 0) {\n\t\t\tdNode = afterRenders.reduce((dNode: DNode | DNode[], afterRenderFunction: AfterRender) => {\n\t\t\t\treturn afterRenderFunction.call(this, dNode);\n\t\t\t}, dNode);\n\t\t}\n\n\t\tif (this._metaMap !== undefined) {\n\t\t\tthis._metaMap.forEach((meta) => {\n\t\t\t\tmeta.afterRender();\n\t\t\t});\n\t\t}\n\n\t\treturn dNode;\n\t}\n\n\tprivate _runAfterConstructors(): void {\n\t\tconst afterConstructors = this.getDecorator('afterConstructor');\n\n\t\tif (afterConstructors.length > 0) {\n\t\t\tafterConstructors.forEach((afterConstructor) => afterConstructor.call(this));\n\t\t}\n\t}\n\n\tprotected own(handle: Handle): void {\n\t\tthis._handles.push(handle);\n\t}\n\n\tprotected destroy() {\n\t\twhile (this._handles.length > 0) {\n\t\t\tconst handle = this._handles.pop();\n\t\t\tif (handle) {\n\t\t\t\thandle.destroy();\n\t\t\t}\n\t\t}\n\t}\n}\n\nexport default WidgetBase;\n"]} \ No newline at end of file diff --git a/deps/framework/widget-core/WidgetBase.mjs b/deps/framework/widget-core/WidgetBase.mjs deleted file mode 100644 index d8b9a59a23..0000000000 --- a/deps/framework/widget-core/WidgetBase.mjs +++ /dev/null @@ -1,359 +0,0 @@ -import Map from '../shim/Map'; -import WeakMap from '../shim/WeakMap'; -import Symbol from '../shim/Symbol'; -import { v } from './d'; -import { auto } from './diff'; -import RegistryHandler from './RegistryHandler'; -import NodeHandler from './NodeHandler'; -import { widgetInstanceMap } from './vdom'; -import { isWidgetBaseConstructor, WIDGET_BASE_TYPE } from './Registry'; -const decoratorMap = new Map(); -const boundAuto = auto.bind(null); -export const noBind = Symbol.for('dojoNoBind'); -/** - * Main widget base for all widgets to extend - */ -export class WidgetBase { - /** - * @constructor - */ - constructor() { - /** - * Indicates if it is the initial set properties cycle - */ - this._initialProperties = true; - /** - * Array of property keys considered changed from the previous set properties - */ - this._changedPropertyKeys = []; - this._nodeHandler = new NodeHandler(); - this._handles = []; - this._children = []; - this._decoratorCache = new Map(); - this._properties = {}; - this._boundRenderFunc = this.render.bind(this); - this._boundInvalidate = this.invalidate.bind(this); - widgetInstanceMap.set(this, { - dirty: true, - onAttach: () => { - this.onAttach(); - }, - onDetach: () => { - this.onDetach(); - this.destroy(); - }, - nodeHandler: this._nodeHandler, - registry: () => { - return this.registry; - }, - coreProperties: {}, - rendering: false, - inputProperties: {} - }); - this._runAfterConstructors(); - } - meta(MetaType) { - if (this._metaMap === undefined) { - this._metaMap = new Map(); - } - let cached = this._metaMap.get(MetaType); - if (!cached) { - cached = new MetaType({ - invalidate: this._boundInvalidate, - nodeHandler: this._nodeHandler, - bind: this - }); - this.own(cached); - this._metaMap.set(MetaType, cached); - } - return cached; - } - onAttach() { - // Do nothing by default. - } - onDetach() { - // Do nothing by default. - } - get properties() { - return this._properties; - } - get changedPropertyKeys() { - return [...this._changedPropertyKeys]; - } - __setCoreProperties__(coreProperties) { - const { baseRegistry } = coreProperties; - const instanceData = widgetInstanceMap.get(this); - if (instanceData.coreProperties.baseRegistry !== baseRegistry) { - if (this._registry === undefined) { - this._registry = new RegistryHandler(); - this.own(this._registry); - this.own(this._registry.on('invalidate', this._boundInvalidate)); - } - this._registry.base = baseRegistry; - this.invalidate(); - } - instanceData.coreProperties = coreProperties; - } - __setProperties__(originalProperties) { - const instanceData = widgetInstanceMap.get(this); - instanceData.inputProperties = originalProperties; - const properties = this._runBeforeProperties(originalProperties); - const registeredDiffPropertyNames = this.getDecorator('registeredDiffProperty'); - const changedPropertyKeys = []; - const propertyNames = Object.keys(properties); - if (this._initialProperties === false || registeredDiffPropertyNames.length !== 0) { - const allProperties = [...propertyNames, ...Object.keys(this._properties)]; - const checkedProperties = []; - const diffPropertyResults = {}; - let runReactions = false; - for (let i = 0; i < allProperties.length; i++) { - const propertyName = allProperties[i]; - if (checkedProperties.indexOf(propertyName) !== -1) { - continue; - } - checkedProperties.push(propertyName); - const previousProperty = this._properties[propertyName]; - const newProperty = this._bindFunctionProperty(properties[propertyName], instanceData.coreProperties.bind); - if (registeredDiffPropertyNames.indexOf(propertyName) !== -1) { - runReactions = true; - const diffFunctions = this.getDecorator(`diffProperty:${propertyName}`); - for (let i = 0; i < diffFunctions.length; i++) { - const result = diffFunctions[i](previousProperty, newProperty); - if (result.changed && changedPropertyKeys.indexOf(propertyName) === -1) { - changedPropertyKeys.push(propertyName); - } - if (propertyName in properties) { - diffPropertyResults[propertyName] = result.value; - } - } - } - else { - const result = boundAuto(previousProperty, newProperty); - if (result.changed && changedPropertyKeys.indexOf(propertyName) === -1) { - changedPropertyKeys.push(propertyName); - } - if (propertyName in properties) { - diffPropertyResults[propertyName] = result.value; - } - } - } - if (runReactions) { - const reactionFunctions = this.getDecorator('diffReaction'); - const executedReactions = []; - reactionFunctions.forEach(({ reaction, propertyName }) => { - const propertyChanged = changedPropertyKeys.indexOf(propertyName) !== -1; - const reactionRun = executedReactions.indexOf(reaction) !== -1; - if (propertyChanged && !reactionRun) { - reaction.call(this, this._properties, diffPropertyResults); - executedReactions.push(reaction); - } - }); - } - this._properties = diffPropertyResults; - this._changedPropertyKeys = changedPropertyKeys; - } - else { - this._initialProperties = false; - for (let i = 0; i < propertyNames.length; i++) { - const propertyName = propertyNames[i]; - if (typeof properties[propertyName] === 'function') { - properties[propertyName] = this._bindFunctionProperty(properties[propertyName], instanceData.coreProperties.bind); - } - else { - changedPropertyKeys.push(propertyName); - } - } - this._changedPropertyKeys = changedPropertyKeys; - this._properties = Object.assign({}, properties); - } - if (this._changedPropertyKeys.length > 0) { - this.invalidate(); - } - } - get children() { - return this._children; - } - __setChildren__(children) { - if (this._children.length > 0 || children.length > 0) { - this._children = children; - this.invalidate(); - } - } - __render__() { - const instanceData = widgetInstanceMap.get(this); - instanceData.dirty = false; - const render = this._runBeforeRenders(); - let dNode = render(); - dNode = this.runAfterRenders(dNode); - this._nodeHandler.clear(); - return dNode; - } - invalidate() { - const instanceData = widgetInstanceMap.get(this); - if (instanceData.invalidate) { - instanceData.invalidate(); - } - } - render() { - return v('div', {}, this.children); - } - /** - * Function to add decorators to WidgetBase - * - * @param decoratorKey The key of the decorator - * @param value The value of the decorator - */ - addDecorator(decoratorKey, value) { - value = Array.isArray(value) ? value : [value]; - if (this.hasOwnProperty('constructor')) { - let decoratorList = decoratorMap.get(this.constructor); - if (!decoratorList) { - decoratorList = new Map(); - decoratorMap.set(this.constructor, decoratorList); - } - let specificDecoratorList = decoratorList.get(decoratorKey); - if (!specificDecoratorList) { - specificDecoratorList = []; - decoratorList.set(decoratorKey, specificDecoratorList); - } - specificDecoratorList.push(...value); - } - else { - const decorators = this.getDecorator(decoratorKey); - this._decoratorCache.set(decoratorKey, [...decorators, ...value]); - } - } - /** - * Function to build the list of decorators from the global decorator map. - * - * @param decoratorKey The key of the decorator - * @return An array of decorator values - * @private - */ - _buildDecoratorList(decoratorKey) { - const allDecorators = []; - let constructor = this.constructor; - while (constructor) { - const instanceMap = decoratorMap.get(constructor); - if (instanceMap) { - const decorators = instanceMap.get(decoratorKey); - if (decorators) { - allDecorators.unshift(...decorators); - } - } - constructor = Object.getPrototypeOf(constructor); - } - return allDecorators; - } - /** - * Function to retrieve decorator values - * - * @param decoratorKey The key of the decorator - * @returns An array of decorator values - */ - getDecorator(decoratorKey) { - let allDecorators = this._decoratorCache.get(decoratorKey); - if (allDecorators !== undefined) { - return allDecorators; - } - allDecorators = this._buildDecoratorList(decoratorKey); - this._decoratorCache.set(decoratorKey, allDecorators); - return allDecorators; - } - /** - * Binds unbound property functions to the specified `bind` property - * - * @param properties properties to check for functions - */ - _bindFunctionProperty(property, bind) { - if (typeof property === 'function' && !property[noBind] && isWidgetBaseConstructor(property) === false) { - if (this._bindFunctionPropertyMap === undefined) { - this._bindFunctionPropertyMap = new WeakMap(); - } - const bindInfo = this._bindFunctionPropertyMap.get(property) || {}; - let { boundFunc, scope } = bindInfo; - if (boundFunc === undefined || scope !== bind) { - boundFunc = property.bind(bind); - this._bindFunctionPropertyMap.set(property, { boundFunc, scope: bind }); - } - return boundFunc; - } - return property; - } - get registry() { - if (this._registry === undefined) { - this._registry = new RegistryHandler(); - this.own(this._registry); - this.own(this._registry.on('invalidate', this._boundInvalidate)); - } - return this._registry; - } - _runBeforeProperties(properties) { - const beforeProperties = this.getDecorator('beforeProperties'); - if (beforeProperties.length > 0) { - return beforeProperties.reduce((properties, beforePropertiesFunction) => { - return Object.assign({}, properties, beforePropertiesFunction.call(this, properties)); - }, Object.assign({}, properties)); - } - return properties; - } - /** - * Run all registered before renders and return the updated render method - */ - _runBeforeRenders() { - const beforeRenders = this.getDecorator('beforeRender'); - if (beforeRenders.length > 0) { - return beforeRenders.reduce((render, beforeRenderFunction) => { - const updatedRender = beforeRenderFunction.call(this, render, this._properties, this._children); - if (!updatedRender) { - console.warn('Render function not returned from beforeRender, using previous render'); - return render; - } - return updatedRender; - }, this._boundRenderFunc); - } - return this._boundRenderFunc; - } - /** - * Run all registered after renders and return the decorated DNodes - * - * @param dNode The DNodes to run through the after renders - */ - runAfterRenders(dNode) { - const afterRenders = this.getDecorator('afterRender'); - if (afterRenders.length > 0) { - dNode = afterRenders.reduce((dNode, afterRenderFunction) => { - return afterRenderFunction.call(this, dNode); - }, dNode); - } - if (this._metaMap !== undefined) { - this._metaMap.forEach((meta) => { - meta.afterRender(); - }); - } - return dNode; - } - _runAfterConstructors() { - const afterConstructors = this.getDecorator('afterConstructor'); - if (afterConstructors.length > 0) { - afterConstructors.forEach((afterConstructor) => afterConstructor.call(this)); - } - } - own(handle) { - this._handles.push(handle); - } - destroy() { - while (this._handles.length > 0) { - const handle = this._handles.pop(); - if (handle) { - handle.destroy(); - } - } - } -} -/** - * static identifier - */ -WidgetBase._type = WIDGET_BASE_TYPE; -export default WidgetBase; -//# sourceMappingURL=WidgetBase.mjs.map \ No newline at end of file diff --git a/deps/framework/widget-core/WidgetBase.mjs.map b/deps/framework/widget-core/WidgetBase.mjs.map deleted file mode 100644 index 006656aab1..0000000000 --- a/deps/framework/widget-core/WidgetBase.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"WidgetBase.mjs","sourceRoot":"","sources":["WidgetBase.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,aAAa,CAAC;AAC9B,OAAO,OAAO,MAAM,iBAAiB,CAAC;AACtC,OAAO,MAAM,MAAM,gBAAgB,CAAC;AAEpC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAc9B,OAAO,eAAe,MAAM,mBAAmB,CAAC;AAChD,OAAO,WAAW,MAAM,eAAe,CAAC;AACxC,OAAO,EAAE,iBAAiB,EAAE,MAAM,QAAQ,CAAC;AAC3C,OAAO,EAAE,uBAAuB,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AASvE,MAAM,YAAY,GAAG,IAAI,GAAG,EAAgC,CAAC;AAC7D,MAAM,SAAS,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAElC,MAAM,CAAC,MAAM,MAAM,GAAG,MAAM,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC;AAE/C;;GAEG;AACH,MAAM;IAgDL;;OAEG;IACH;QAxCA;;WAEG;QACK,uBAAkB,GAAG,IAAI,CAAC;QAOlC;;WAEG;QACK,yBAAoB,GAAa,EAAE,CAAC;QAoBpC,iBAAY,GAAgB,IAAI,WAAW,EAAE,CAAC;QAE9C,aAAQ,GAAa,EAAE,CAAC;QAM/B,IAAI,CAAC,SAAS,GAAG,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,KAAK,SAAS,CAAC,CAAC,CAAC;YACjC,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE;gBAC9B,IAAI,CAAC,WAAW,EAAE,CAAC;YACpB,CAAC,CAAC,CAAC;QACJ,CAAC;QAED,MAAM,CAAC,KAAK,CAAC;IACd,CAAC;IAEO,qBAAqB;QAC5B,MAAM,iBAAiB,GAAG,IAAI,CAAC,YAAY,CAAC,kBAAkB,CAAC,CAAC;QAEhE,EAAE,CAAC,CAAC,iBAAiB,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC;YAClC,iBAAiB,CAAC,OAAO,CAAC,CAAC,gBAAgB,EAAE,EAAE,CAAC,gBAAgB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;QAC9E,CAAC;IACF,CAAC;IAES,GAAG,CAAC,MAAc;QAC3B,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IAC5B,CAAC;IAES,OAAO;QAChB,OAAO,IAAI,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACjC,MAAM,MAAM,GAAG,IAAI,CAAC,QAAQ,CAAC,GAAG,EAAE,CAAC;YACnC,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC;gBACZ,MAAM,CAAC,OAAO,EAAE,CAAC;YAClB,CAAC;QACF,CAAC;IACF,CAAC;;AA1aD;;GAEG;AACI,gBAAK,GAAW,gBAAgB,CAAC;AA0azC,eAAe,UAAU,CAAC","sourcesContent":["import Map from '../shim/Map';\nimport WeakMap from '../shim/WeakMap';\nimport Symbol from '../shim/Symbol';\nimport { Handle } from '../core/interfaces';\nimport { v } from './d';\nimport { auto } from './diff';\nimport {\n\tAfterRender,\n\tBeforeProperties,\n\tBeforeRender,\n\tCoreProperties,\n\tDiffPropertyReaction,\n\tDNode,\n\tRender,\n\tWidgetMetaBase,\n\tWidgetMetaConstructor,\n\tWidgetBaseInterface,\n\tWidgetProperties\n} from './interfaces';\nimport RegistryHandler from './RegistryHandler';\nimport NodeHandler from './NodeHandler';\nimport { widgetInstanceMap } from './vdom';\nimport { isWidgetBaseConstructor, WIDGET_BASE_TYPE } from './Registry';\n\ninterface ReactionFunctionConfig {\n\tpropertyName: string;\n\treaction: DiffPropertyReaction;\n}\n\nexport type BoundFunctionData = { boundFunc: (...args: any[]) => any; scope: any };\n\nconst decoratorMap = new Map>();\nconst boundAuto = auto.bind(null);\n\nexport const noBind = Symbol.for('dojoNoBind');\n\n/**\n * Main widget base for all widgets to extend\n */\nexport class WidgetBase

implements WidgetBaseInterface {\n\t/**\n\t * static identifier\n\t */\n\tstatic _type: symbol = WIDGET_BASE_TYPE;\n\n\t/**\n\t * children array\n\t */\n\tprivate _children: (C | null)[];\n\n\t/**\n\t * Indicates if it is the initial set properties cycle\n\t */\n\tprivate _initialProperties = true;\n\n\t/**\n\t * internal widget properties\n\t */\n\tprivate _properties: P & WidgetProperties & { [index: string]: any };\n\n\t/**\n\t * Array of property keys considered changed from the previous set properties\n\t */\n\tprivate _changedPropertyKeys: string[] = [];\n\n\t/**\n\t * map of decorators that are applied to this widget\n\t */\n\tprivate _decoratorCache: Map;\n\n\tprivate _registry: RegistryHandler | undefined;\n\n\t/**\n\t * Map of functions properties for the bound function\n\t */\n\tprivate _bindFunctionPropertyMap: WeakMap<(...args: any[]) => any, BoundFunctionData> | undefined;\n\n\tprivate _metaMap: Map, WidgetMetaBase> | undefined;\n\n\tprivate _boundRenderFunc: Render;\n\n\tprivate _boundInvalidate: () => void;\n\n\tprivate _nodeHandler: NodeHandler = new NodeHandler();\n\n\tprivate _handles: Handle[] = [];\n\n\t/**\n\t * @constructor\n\t */\n\tconstructor() {\n\t\tthis._children = [];\n\t\tthis._decoratorCache = new Map();\n\t\tthis._properties =

{};\n\t\tthis._boundRenderFunc = this.render.bind(this);\n\t\tthis._boundInvalidate = this.invalidate.bind(this);\n\n\t\twidgetInstanceMap.set(this, {\n\t\t\tdirty: true,\n\t\t\tonAttach: (): void => {\n\t\t\t\tthis.onAttach();\n\t\t\t},\n\t\t\tonDetach: (): void => {\n\t\t\t\tthis.onDetach();\n\t\t\t\tthis.destroy();\n\t\t\t},\n\t\t\tnodeHandler: this._nodeHandler,\n\t\t\tregistry: () => {\n\t\t\t\treturn this.registry;\n\t\t\t},\n\t\t\tcoreProperties: {} as CoreProperties,\n\t\t\trendering: false,\n\t\t\tinputProperties: {}\n\t\t});\n\n\t\tthis._runAfterConstructors();\n\t}\n\n\tprotected meta(MetaType: WidgetMetaConstructor): T {\n\t\tif (this._metaMap === undefined) {\n\t\t\tthis._metaMap = new Map, WidgetMetaBase>();\n\t\t}\n\t\tlet cached = this._metaMap.get(MetaType);\n\t\tif (!cached) {\n\t\t\tcached = new MetaType({\n\t\t\t\tinvalidate: this._boundInvalidate,\n\t\t\t\tnodeHandler: this._nodeHandler,\n\t\t\t\tbind: this\n\t\t\t});\n\t\t\tthis.own(cached);\n\t\t\tthis._metaMap.set(MetaType, cached);\n\t\t}\n\n\t\treturn cached as T;\n\t}\n\n\tprotected onAttach(): void {\n\t\t// Do nothing by default.\n\t}\n\n\tprotected onDetach(): void {\n\t\t// Do nothing by default.\n\t}\n\n\tpublic get properties(): Readonly

& Readonly {\n\t\treturn this._properties;\n\t}\n\n\tpublic get changedPropertyKeys(): string[] {\n\t\treturn [...this._changedPropertyKeys];\n\t}\n\n\tpublic __setCoreProperties__(coreProperties: CoreProperties): void {\n\t\tconst { baseRegistry } = coreProperties;\n\t\tconst instanceData = widgetInstanceMap.get(this)!;\n\n\t\tif (instanceData.coreProperties.baseRegistry !== baseRegistry) {\n\t\t\tif (this._registry === undefined) {\n\t\t\t\tthis._registry = new RegistryHandler();\n\t\t\t\tthis.own(this._registry);\n\t\t\t\tthis.own(this._registry.on('invalidate', this._boundInvalidate));\n\t\t\t}\n\t\t\tthis._registry.base = baseRegistry;\n\t\t\tthis.invalidate();\n\t\t}\n\t\tinstanceData.coreProperties = coreProperties;\n\t}\n\n\tpublic __setProperties__(originalProperties: this['properties']): void {\n\t\tconst instanceData = widgetInstanceMap.get(this)!;\n\t\tinstanceData.inputProperties = originalProperties;\n\t\tconst properties = this._runBeforeProperties(originalProperties);\n\t\tconst registeredDiffPropertyNames = this.getDecorator('registeredDiffProperty');\n\t\tconst changedPropertyKeys: string[] = [];\n\t\tconst propertyNames = Object.keys(properties);\n\n\t\tif (this._initialProperties === false || registeredDiffPropertyNames.length !== 0) {\n\t\t\tconst allProperties = [...propertyNames, ...Object.keys(this._properties)];\n\t\t\tconst checkedProperties: (string | number)[] = [];\n\t\t\tconst diffPropertyResults: any = {};\n\t\t\tlet runReactions = false;\n\n\t\t\tfor (let i = 0; i < allProperties.length; i++) {\n\t\t\t\tconst propertyName = allProperties[i];\n\t\t\t\tif (checkedProperties.indexOf(propertyName) !== -1) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tcheckedProperties.push(propertyName);\n\t\t\t\tconst previousProperty = this._properties[propertyName];\n\t\t\t\tconst newProperty = this._bindFunctionProperty(\n\t\t\t\t\tproperties[propertyName],\n\t\t\t\t\tinstanceData.coreProperties.bind\n\t\t\t\t);\n\t\t\t\tif (registeredDiffPropertyNames.indexOf(propertyName) !== -1) {\n\t\t\t\t\trunReactions = true;\n\t\t\t\t\tconst diffFunctions = this.getDecorator(`diffProperty:${propertyName}`);\n\t\t\t\t\tfor (let i = 0; i < diffFunctions.length; i++) {\n\t\t\t\t\t\tconst result = diffFunctions[i](previousProperty, newProperty);\n\t\t\t\t\t\tif (result.changed && changedPropertyKeys.indexOf(propertyName) === -1) {\n\t\t\t\t\t\t\tchangedPropertyKeys.push(propertyName);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (propertyName in properties) {\n\t\t\t\t\t\t\tdiffPropertyResults[propertyName] = result.value;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tconst result = boundAuto(previousProperty, newProperty);\n\t\t\t\t\tif (result.changed && changedPropertyKeys.indexOf(propertyName) === -1) {\n\t\t\t\t\t\tchangedPropertyKeys.push(propertyName);\n\t\t\t\t\t}\n\t\t\t\t\tif (propertyName in properties) {\n\t\t\t\t\t\tdiffPropertyResults[propertyName] = result.value;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (runReactions) {\n\t\t\t\tconst reactionFunctions: ReactionFunctionConfig[] = this.getDecorator('diffReaction');\n\t\t\t\tconst executedReactions: Function[] = [];\n\t\t\t\treactionFunctions.forEach(({ reaction, propertyName }) => {\n\t\t\t\t\tconst propertyChanged = changedPropertyKeys.indexOf(propertyName) !== -1;\n\t\t\t\t\tconst reactionRun = executedReactions.indexOf(reaction) !== -1;\n\t\t\t\t\tif (propertyChanged && !reactionRun) {\n\t\t\t\t\t\treaction.call(this, this._properties, diffPropertyResults);\n\t\t\t\t\t\texecutedReactions.push(reaction);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\t\t\tthis._properties = diffPropertyResults;\n\t\t\tthis._changedPropertyKeys = changedPropertyKeys;\n\t\t} else {\n\t\t\tthis._initialProperties = false;\n\t\t\tfor (let i = 0; i < propertyNames.length; i++) {\n\t\t\t\tconst propertyName = propertyNames[i];\n\t\t\t\tif (typeof properties[propertyName] === 'function') {\n\t\t\t\t\tproperties[propertyName] = this._bindFunctionProperty(\n\t\t\t\t\t\tproperties[propertyName],\n\t\t\t\t\t\tinstanceData.coreProperties.bind\n\t\t\t\t\t);\n\t\t\t\t} else {\n\t\t\t\t\tchangedPropertyKeys.push(propertyName);\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis._changedPropertyKeys = changedPropertyKeys;\n\t\t\tthis._properties = { ...properties };\n\t\t}\n\n\t\tif (this._changedPropertyKeys.length > 0) {\n\t\t\tthis.invalidate();\n\t\t}\n\t}\n\n\tpublic get children(): (C | null)[] {\n\t\treturn this._children;\n\t}\n\n\tpublic __setChildren__(children: (C | null)[]): void {\n\t\tif (this._children.length > 0 || children.length > 0) {\n\t\t\tthis._children = children;\n\t\t\tthis.invalidate();\n\t\t}\n\t}\n\n\tpublic __render__(): DNode | DNode[] {\n\t\tconst instanceData = widgetInstanceMap.get(this)!;\n\t\tinstanceData.dirty = false;\n\t\tconst render = this._runBeforeRenders();\n\t\tlet dNode = render();\n\t\tdNode = this.runAfterRenders(dNode);\n\t\tthis._nodeHandler.clear();\n\t\treturn dNode;\n\t}\n\n\tpublic invalidate(): void {\n\t\tconst instanceData = widgetInstanceMap.get(this)!;\n\t\tif (instanceData.invalidate) {\n\t\t\tinstanceData.invalidate();\n\t\t}\n\t}\n\n\tprotected render(): DNode | DNode[] {\n\t\treturn v('div', {}, this.children);\n\t}\n\n\t/**\n\t * Function to add decorators to WidgetBase\n\t *\n\t * @param decoratorKey The key of the decorator\n\t * @param value The value of the decorator\n\t */\n\tprotected addDecorator(decoratorKey: string, value: any): void {\n\t\tvalue = Array.isArray(value) ? value : [value];\n\t\tif (this.hasOwnProperty('constructor')) {\n\t\t\tlet decoratorList = decoratorMap.get(this.constructor);\n\t\t\tif (!decoratorList) {\n\t\t\t\tdecoratorList = new Map();\n\t\t\t\tdecoratorMap.set(this.constructor, decoratorList);\n\t\t\t}\n\n\t\t\tlet specificDecoratorList = decoratorList.get(decoratorKey);\n\t\t\tif (!specificDecoratorList) {\n\t\t\t\tspecificDecoratorList = [];\n\t\t\t\tdecoratorList.set(decoratorKey, specificDecoratorList);\n\t\t\t}\n\t\t\tspecificDecoratorList.push(...value);\n\t\t} else {\n\t\t\tconst decorators = this.getDecorator(decoratorKey);\n\t\t\tthis._decoratorCache.set(decoratorKey, [...decorators, ...value]);\n\t\t}\n\t}\n\n\t/**\n\t * Function to build the list of decorators from the global decorator map.\n\t *\n\t * @param decoratorKey The key of the decorator\n\t * @return An array of decorator values\n\t * @private\n\t */\n\tprivate _buildDecoratorList(decoratorKey: string): any[] {\n\t\tconst allDecorators = [];\n\n\t\tlet constructor = this.constructor;\n\n\t\twhile (constructor) {\n\t\t\tconst instanceMap = decoratorMap.get(constructor);\n\t\t\tif (instanceMap) {\n\t\t\t\tconst decorators = instanceMap.get(decoratorKey);\n\n\t\t\t\tif (decorators) {\n\t\t\t\t\tallDecorators.unshift(...decorators);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tconstructor = Object.getPrototypeOf(constructor);\n\t\t}\n\n\t\treturn allDecorators;\n\t}\n\n\t/**\n\t * Function to retrieve decorator values\n\t *\n\t * @param decoratorKey The key of the decorator\n\t * @returns An array of decorator values\n\t */\n\tprotected getDecorator(decoratorKey: string): any[] {\n\t\tlet allDecorators = this._decoratorCache.get(decoratorKey);\n\n\t\tif (allDecorators !== undefined) {\n\t\t\treturn allDecorators;\n\t\t}\n\n\t\tallDecorators = this._buildDecoratorList(decoratorKey);\n\n\t\tthis._decoratorCache.set(decoratorKey, allDecorators);\n\t\treturn allDecorators;\n\t}\n\n\t/**\n\t * Binds unbound property functions to the specified `bind` property\n\t *\n\t * @param properties properties to check for functions\n\t */\n\tprivate _bindFunctionProperty(property: any, bind: any): any {\n\t\tif (typeof property === 'function' && !property[noBind] && isWidgetBaseConstructor(property) === false) {\n\t\t\tif (this._bindFunctionPropertyMap === undefined) {\n\t\t\t\tthis._bindFunctionPropertyMap = new WeakMap<\n\t\t\t\t\t(...args: any[]) => any,\n\t\t\t\t\t{ boundFunc: (...args: any[]) => any; scope: any }\n\t\t\t\t>();\n\t\t\t}\n\t\t\tconst bindInfo: Partial = this._bindFunctionPropertyMap.get(property) || {};\n\t\t\tlet { boundFunc, scope } = bindInfo;\n\n\t\t\tif (boundFunc === undefined || scope !== bind) {\n\t\t\t\tboundFunc = property.bind(bind) as (...args: any[]) => any;\n\t\t\t\tthis._bindFunctionPropertyMap.set(property, { boundFunc, scope: bind });\n\t\t\t}\n\t\t\treturn boundFunc;\n\t\t}\n\t\treturn property;\n\t}\n\n\tpublic get registry(): RegistryHandler {\n\t\tif (this._registry === undefined) {\n\t\t\tthis._registry = new RegistryHandler();\n\t\t\tthis.own(this._registry);\n\t\t\tthis.own(this._registry.on('invalidate', this._boundInvalidate));\n\t\t}\n\t\treturn this._registry;\n\t}\n\n\tprivate _runBeforeProperties(properties: any) {\n\t\tconst beforeProperties: BeforeProperties[] = this.getDecorator('beforeProperties');\n\t\tif (beforeProperties.length > 0) {\n\t\t\treturn beforeProperties.reduce(\n\t\t\t\t(properties, beforePropertiesFunction) => {\n\t\t\t\t\treturn { ...properties, ...beforePropertiesFunction.call(this, properties) };\n\t\t\t\t},\n\t\t\t\t{ ...properties }\n\t\t\t);\n\t\t}\n\t\treturn properties;\n\t}\n\n\t/**\n\t * Run all registered before renders and return the updated render method\n\t */\n\tprivate _runBeforeRenders(): Render {\n\t\tconst beforeRenders = this.getDecorator('beforeRender');\n\n\t\tif (beforeRenders.length > 0) {\n\t\t\treturn beforeRenders.reduce((render: Render, beforeRenderFunction: BeforeRender) => {\n\t\t\t\tconst updatedRender = beforeRenderFunction.call(this, render, this._properties, this._children);\n\t\t\t\tif (!updatedRender) {\n\t\t\t\t\tconsole.warn('Render function not returned from beforeRender, using previous render');\n\t\t\t\t\treturn render;\n\t\t\t\t}\n\t\t\t\treturn updatedRender;\n\t\t\t}, this._boundRenderFunc);\n\t\t}\n\t\treturn this._boundRenderFunc;\n\t}\n\n\t/**\n\t * Run all registered after renders and return the decorated DNodes\n\t *\n\t * @param dNode The DNodes to run through the after renders\n\t */\n\tprotected runAfterRenders(dNode: DNode | DNode[]): DNode | DNode[] {\n\t\tconst afterRenders = this.getDecorator('afterRender');\n\n\t\tif (afterRenders.length > 0) {\n\t\t\tdNode = afterRenders.reduce((dNode: DNode | DNode[], afterRenderFunction: AfterRender) => {\n\t\t\t\treturn afterRenderFunction.call(this, dNode);\n\t\t\t}, dNode);\n\t\t}\n\n\t\tif (this._metaMap !== undefined) {\n\t\t\tthis._metaMap.forEach((meta) => {\n\t\t\t\tmeta.afterRender();\n\t\t\t});\n\t\t}\n\n\t\treturn dNode;\n\t}\n\n\tprivate _runAfterConstructors(): void {\n\t\tconst afterConstructors = this.getDecorator('afterConstructor');\n\n\t\tif (afterConstructors.length > 0) {\n\t\t\tafterConstructors.forEach((afterConstructor) => afterConstructor.call(this));\n\t\t}\n\t}\n\n\tprotected own(handle: Handle): void {\n\t\tthis._handles.push(handle);\n\t}\n\n\tprotected destroy() {\n\t\twhile (this._handles.length > 0) {\n\t\t\tconst handle = this._handles.pop();\n\t\t\tif (handle) {\n\t\t\t\thandle.destroy();\n\t\t\t}\n\t\t}\n\t}\n}\n\nexport default WidgetBase;\n"]} \ No newline at end of file diff --git a/deps/framework/widget-core/animations/cssTransitions.d.ts b/deps/framework/widget-core/animations/cssTransitions.d.ts deleted file mode 100644 index c03583dbd6..0000000000 --- a/deps/framework/widget-core/animations/cssTransitions.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { VNodeProperties } from './../interfaces'; -declare const _default: { - enter: (node: HTMLElement, properties: VNodeProperties, enterAnimation: string) => void; - exit: (node: HTMLElement, properties: VNodeProperties, exitAnimation: string, removeNode: () => void) => void; -}; -export default _default; diff --git a/deps/framework/widget-core/animations/cssTransitions.js b/deps/framework/widget-core/animations/cssTransitions.js deleted file mode 100644 index be73d923ff..0000000000 --- a/deps/framework/widget-core/animations/cssTransitions.js +++ /dev/null @@ -1,75 +0,0 @@ -(function (factory) { - if (typeof module === "object" && typeof module.exports === "object") { - var v = factory(require, exports); - if (v !== undefined) module.exports = v; - } - else if (typeof define === "function" && define.amd) { - define(["require", "exports"], factory); - } -})(function (require, exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - var browserSpecificTransitionEndEventName = ''; - var browserSpecificAnimationEndEventName = ''; - function determineBrowserStyleNames(element) { - if ('WebkitTransition' in element.style) { - browserSpecificTransitionEndEventName = 'webkitTransitionEnd'; - browserSpecificAnimationEndEventName = 'webkitAnimationEnd'; - } - else if ('transition' in element.style || 'MozTransition' in element.style) { - browserSpecificTransitionEndEventName = 'transitionend'; - browserSpecificAnimationEndEventName = 'animationend'; - } - else { - throw new Error('Your browser is not supported'); - } - } - function initialize(element) { - if (browserSpecificAnimationEndEventName === '') { - determineBrowserStyleNames(element); - } - } - function runAndCleanUp(element, startAnimation, finishAnimation) { - initialize(element); - var finished = false; - var transitionEnd = function () { - if (!finished) { - finished = true; - element.removeEventListener(browserSpecificTransitionEndEventName, transitionEnd); - element.removeEventListener(browserSpecificAnimationEndEventName, transitionEnd); - finishAnimation(); - } - }; - startAnimation(); - element.addEventListener(browserSpecificAnimationEndEventName, transitionEnd); - element.addEventListener(browserSpecificTransitionEndEventName, transitionEnd); - } - function exit(node, properties, exitAnimation, removeNode) { - var activeClass = properties.exitAnimationActive || exitAnimation + "-active"; - runAndCleanUp(node, function () { - node.classList.add(exitAnimation); - requestAnimationFrame(function () { - node.classList.add(activeClass); - }); - }, function () { - removeNode(); - }); - } - function enter(node, properties, enterAnimation) { - var activeClass = properties.enterAnimationActive || enterAnimation + "-active"; - runAndCleanUp(node, function () { - node.classList.add(enterAnimation); - requestAnimationFrame(function () { - node.classList.add(activeClass); - }); - }, function () { - node.classList.remove(enterAnimation); - node.classList.remove(activeClass); - }); - } - exports.default = { - enter: enter, - exit: exit - }; -}); -//# sourceMappingURL=cssTransitions.js.map \ No newline at end of file diff --git a/deps/framework/widget-core/animations/cssTransitions.js.map b/deps/framework/widget-core/animations/cssTransitions.js.map deleted file mode 100644 index 178ed01086..0000000000 --- a/deps/framework/widget-core/animations/cssTransitions.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"cssTransitions.js","sourceRoot":"","sources":["cssTransitions.ts"],"names":[],"mappings":";;;;;;;;;;;IAEA,IAAI,qCAAqC,GAAG,EAAE,CAAC;IAC/C,IAAI,oCAAoC,GAAG,EAAE,CAAC;IAE9C,oCAAoC,OAAoB;QACvD,EAAE,CAAC,CAAC,kBAAkB,IAAI,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC;YACzC,qCAAqC,GAAG,qBAAqB,CAAC;YAC9D,oCAAoC,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AAC,SAAS,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;YAElC,qBAAqB,CAAC;gBACrB,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;YACjC,CAAC,CAAC,CAAC;QACJ,CAAC,EACD;YACC,UAAU,EAAE,CAAC;QACd,CAAC,CACD,CAAC;IACH,CAAC;IAED,eAAe,IAAiB,EAAE,UAA2B,EAAE,cAAsB;QACpF,IAAM,WAAW,GAAG,UAAU,CAAC,oBAAoB,IAAO,cAAc,YAAS,CAAC;QAElF,aAAa,CACZ,IAAI,EACJ;YACC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;YAEnC,qBAAqB,CAAC;gBACrB,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;YACjC,CAAC,CAAC,CAAC;QACJ,CAAC,EACD;YACC,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC;YACtC,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC;QACpC,CAAC,CACD,CAAC;IACH,CAAC;IAED,kBAAe;QACd,KAAK,OAAA;QACL,IAAI,MAAA;KACJ,CAAC","sourcesContent":["import { VNodeProperties } from './../interfaces';\n\nlet browserSpecificTransitionEndEventName = '';\nlet browserSpecificAnimationEndEventName = '';\n\nfunction determineBrowserStyleNames(element: HTMLElement) {\n\tif ('WebkitTransition' in element.style) {\n\t\tbrowserSpecificTransitionEndEventName = 'webkitTransitionEnd';\n\t\tbrowserSpecificAnimationEndEventName = 'webkitAnimationEnd';\n\t} else if ('transition' in element.style || 'MozTransition' in element.style) {\n\t\tbrowserSpecificTransitionEndEventName = 'transitionend';\n\t\tbrowserSpecificAnimationEndEventName = 'animationend';\n\t} else {\n\t\tthrow new Error('Your browser is not supported');\n\t}\n}\n\nfunction initialize(element: HTMLElement) {\n\tif (browserSpecificAnimationEndEventName === '') {\n\t\tdetermineBrowserStyleNames(element);\n\t}\n}\n\nfunction runAndCleanUp(element: HTMLElement, startAnimation: () => void, finishAnimation: () => void) {\n\tinitialize(element);\n\n\tlet finished = false;\n\n\tlet transitionEnd = function() {\n\t\tif (!finished) {\n\t\t\tfinished = true;\n\t\t\telement.removeEventListener(browserSpecificTransitionEndEventName, transitionEnd);\n\t\t\telement.removeEventListener(browserSpecificAnimationEndEventName, transitionEnd);\n\n\t\t\tfinishAnimation();\n\t\t}\n\t};\n\n\tstartAnimation();\n\n\telement.addEventListener(browserSpecificAnimationEndEventName, transitionEnd);\n\telement.addEventListener(browserSpecificTransitionEndEventName, transitionEnd);\n}\n\nfunction exit(node: HTMLElement, properties: VNodeProperties, exitAnimation: string, removeNode: () => void) {\n\tconst activeClass = properties.exitAnimationActive || `${exitAnimation}-active`;\n\n\trunAndCleanUp(\n\t\tnode,\n\t\t() => {\n\t\t\tnode.classList.add(exitAnimation);\n\n\t\t\trequestAnimationFrame(function() {\n\t\t\t\tnode.classList.add(activeClass);\n\t\t\t});\n\t\t},\n\t\t() => {\n\t\t\tremoveNode();\n\t\t}\n\t);\n}\n\nfunction enter(node: HTMLElement, properties: VNodeProperties, enterAnimation: string) {\n\tconst activeClass = properties.enterAnimationActive || `${enterAnimation}-active`;\n\n\trunAndCleanUp(\n\t\tnode,\n\t\t() => {\n\t\t\tnode.classList.add(enterAnimation);\n\n\t\t\trequestAnimationFrame(function() {\n\t\t\t\tnode.classList.add(activeClass);\n\t\t\t});\n\t\t},\n\t\t() => {\n\t\t\tnode.classList.remove(enterAnimation);\n\t\t\tnode.classList.remove(activeClass);\n\t\t}\n\t);\n}\n\nexport default {\n\tenter,\n\texit\n};\n"]} \ No newline at end of file diff --git a/deps/framework/widget-core/animations/cssTransitions.mjs b/deps/framework/widget-core/animations/cssTransitions.mjs deleted file mode 100644 index ea248f8bd6..0000000000 --- a/deps/framework/widget-core/animations/cssTransitions.mjs +++ /dev/null @@ -1,63 +0,0 @@ -let browserSpecificTransitionEndEventName = ''; -let browserSpecificAnimationEndEventName = ''; -function determineBrowserStyleNames(element) { - if ('WebkitTransition' in element.style) { - browserSpecificTransitionEndEventName = 'webkitTransitionEnd'; - browserSpecificAnimationEndEventName = 'webkitAnimationEnd'; - } - else if ('transition' in element.style || 'MozTransition' in element.style) { - browserSpecificTransitionEndEventName = 'transitionend'; - browserSpecificAnimationEndEventName = 'animationend'; - } - else { - throw new Error('Your browser is not supported'); - } -} -function initialize(element) { - if (browserSpecificAnimationEndEventName === '') { - determineBrowserStyleNames(element); - } -} -function runAndCleanUp(element, startAnimation, finishAnimation) { - initialize(element); - let finished = false; - let transitionEnd = function () { - if (!finished) { - finished = true; - element.removeEventListener(browserSpecificTransitionEndEventName, transitionEnd); - element.removeEventListener(browserSpecificAnimationEndEventName, transitionEnd); - finishAnimation(); - } - }; - startAnimation(); - element.addEventListener(browserSpecificAnimationEndEventName, transitionEnd); - element.addEventListener(browserSpecificTransitionEndEventName, transitionEnd); -} -function exit(node, properties, exitAnimation, removeNode) { - const activeClass = properties.exitAnimationActive || `${exitAnimation}-active`; - runAndCleanUp(node, () => { - node.classList.add(exitAnimation); - requestAnimationFrame(function () { - node.classList.add(activeClass); - }); - }, () => { - removeNode(); - }); -} -function enter(node, properties, enterAnimation) { - const activeClass = properties.enterAnimationActive || `${enterAnimation}-active`; - runAndCleanUp(node, () => { - node.classList.add(enterAnimation); - requestAnimationFrame(function () { - node.classList.add(activeClass); - }); - }, () => { - node.classList.remove(enterAnimation); - node.classList.remove(activeClass); - }); -} -export default { - enter, - exit -}; -//# sourceMappingURL=cssTransitions.mjs.map \ No newline at end of file diff --git a/deps/framework/widget-core/animations/cssTransitions.mjs.map b/deps/framework/widget-core/animations/cssTransitions.mjs.map deleted file mode 100644 index 6d144190ed..0000000000 --- a/deps/framework/widget-core/animations/cssTransitions.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"cssTransitions.mjs","sourceRoot":"","sources":["cssTransitions.ts"],"names":[],"mappings":"AAEA,IAAI,q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,EAAE,aAAa,CAAC,CAAC;AAChF,CAAC;AAED,cAAc,IAAiB,EAAE,UAA2B,EAAE,aAAqB,EAAE,UAAsB;IAC1G,MAAM,WAAW,GAAG,UAAU,CAAC,mBAAmB,IAAI,GAAG,aAAa,SAAS,CAAC;IAEhF,aAAa,CACZ,IAAI,EACJ,GAAG,EAAE;QACJ,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;QAElC,qBAAqB,CAAC;YACrB,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;QACjC,CAAC,CAAC,CAAC;IACJ,CAAC,EACD,GAAG,EAAE;QACJ,UAAU,EAAE,CAAC;IACd,CAAC,CACD,CAAC;AACH,CAAC;AAED,eAAe,IAAiB,EAAE,UAA2B,EAAE,cAAsB;IACpF,MAAM,WAAW,GAAG,UAAU,CAAC,oBAAoB,IAAI,GAAG,cAAc,SAAS,CAAC;IAElF,aAAa,CACZ,IAAI,EACJ,GAAG,EAAE;QACJ,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;QAEnC,qBAAqB,CAAC;YACrB,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;QACjC,CAAC,CAAC,CAAC;IACJ,CAAC,EACD,GAAG,EAAE;QACJ,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC;QACtC,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC;IACpC,CAAC,CACD,CAAC;AACH,CAAC;AAED,eAAe;IACd,KAAK;IACL,IAAI;CACJ,CAAC","sourcesContent":["import { VNodeProperties } from './../interfaces';\n\nlet browserSpecificTransitionEndEventName = '';\nlet browserSpecificAnimationEndEventName = '';\n\nfunction determineBrowserStyleNames(element: HTMLElement) {\n\tif ('WebkitTransition' in element.style) {\n\t\tbrowserSpecificTransitionEndEventName = 'webkitTransitionEnd';\n\t\tbrowserSpecificAnimationEndEventName = 'webkitAnimationEnd';\n\t} else if ('transition' in element.style || 'MozTransition' in element.style) {\n\t\tbrowserSpecificTransitionEndEventName = 'transitionend';\n\t\tbrowserSpecificAnimationEndEventName = 'animationend';\n\t} else {\n\t\tthrow new Error('Your browser is not supported');\n\t}\n}\n\nfunction initialize(element: HTMLElement) {\n\tif (browserSpecificAnimationEndEventName === '') {\n\t\tdetermineBrowserStyleNames(element);\n\t}\n}\n\nfunction runAndCleanUp(element: HTMLElement, startAnimation: () => void, finishAnimation: () => void) {\n\tinitialize(element);\n\n\tlet finished = false;\n\n\tlet transitionEnd = function() {\n\t\tif (!finished) {\n\t\t\tfinished = true;\n\t\t\telement.removeEventListener(browserSpecificTransitionEndEventName, transitionEnd);\n\t\t\telement.removeEventListener(browserSpecificAnimationEndEventName, transitionEnd);\n\n\t\t\tfinishAnimation();\n\t\t}\n\t};\n\n\tstartAnimation();\n\n\telement.addEventListener(browserSpecificAnimationEndEventName, transitionEnd);\n\telement.addEventListener(browserSpecificTransitionEndEventName, transitionEnd);\n}\n\nfunction exit(node: HTMLElement, properties: VNodeProperties, exitAnimation: string, removeNode: () => void) {\n\tconst activeClass = properties.exitAnimationActive || `${exitAnimation}-active`;\n\n\trunAndCleanUp(\n\t\tnode,\n\t\t() => {\n\t\t\tnode.classList.add(exitAnimation);\n\n\t\t\trequestAnimationFrame(function() {\n\t\t\t\tnode.classList.add(activeClass);\n\t\t\t});\n\t\t},\n\t\t() => {\n\t\t\tremoveNode();\n\t\t}\n\t);\n}\n\nfunction enter(node: HTMLElement, properties: VNodeProperties, enterAnimation: string) {\n\tconst activeClass = properties.enterAnimationActive || `${enterAnimation}-active`;\n\n\trunAndCleanUp(\n\t\tnode,\n\t\t() => {\n\t\t\tnode.classList.add(enterAnimation);\n\n\t\t\trequestAnimationFrame(function() {\n\t\t\t\tnode.classList.add(activeClass);\n\t\t\t});\n\t\t},\n\t\t() => {\n\t\t\tnode.classList.remove(enterAnimation);\n\t\t\tnode.classList.remove(activeClass);\n\t\t}\n\t);\n}\n\nexport default {\n\tenter,\n\texit\n};\n"]} \ No newline at end of file diff --git a/deps/framework/widget-core/d.d.ts b/deps/framework/widget-core/d.d.ts deleted file mode 100644 index 5af01c0742..0000000000 --- a/deps/framework/widget-core/d.d.ts +++ /dev/null @@ -1,82 +0,0 @@ -import { Constructor, DefaultWidgetBaseInterface, DeferredVirtualProperties, DNode, VNode, RegistryLabel, VNodeProperties, WidgetBaseInterface, WNode, DomOptions } from './interfaces'; -import { RenderResult } from './vdom'; -/** - * The symbol identifier for a WNode type - */ -export declare const WNODE: symbol; -/** - * The symbol identifier for a VNode type - */ -export declare const VNODE: symbol; -/** - * The symbol identifier for a VNode type created using dom() - */ -export declare const DOMVNODE: symbol; -/** - * Helper function that returns true if the `DNode` is a `WNode` using the `type` property - */ -export declare function isWNode(child: DNode): child is WNode; -/** - * Helper function that returns true if the `DNode` is a `VNode` using the `type` property - */ -export declare function isVNode(child: DNode): child is VNode; -/** - * Helper function that returns true if the `DNode` is a `VNode` created with `dom()` using the `type` property - */ -export declare function isDomVNode(child: DNode): child is VNode; -export declare function isElementNode(value: any): value is Element; -/** - * Interface for the decorate modifier - */ -export interface Modifier { - (dNode: T, breaker: () => void): void; -} -/** - * The predicate function for decorate - */ -export interface Predicate { - (dNode: DNode): dNode is T; -} -/** - * Decorator options - */ -export interface DecorateOptions { - modifier: Modifier; - predicate?: Predicate; - shallow?: boolean; -} -/** - * Generic decorate function for DNodes. The nodes are modified in place based on the provided predicate - * and modifier functions. - * - * The children of each node are flattened and added to the array for decoration. - * - * If no predicate is supplied then the modifier will be executed on all nodes. A `breaker` function is passed to the - * modifier which will drain the nodes array and exit the decoration. - * - * When the `shallow` options is set to `true` the only the top node or nodes will be decorated (only supported using - * `DecorateOptions`). - */ -export declare function decorate(dNodes: DNode, options: DecorateOptions): DNode; -export declare function decorate(dNodes: DNode[], options: DecorateOptions): DNode[]; -export declare function decorate(dNodes: DNode | DNode[], options: DecorateOptions): DNode | DNode[]; -export declare function decorate(dNodes: DNode, modifier: Modifier, predicate: Predicate): DNode; -export declare function decorate(dNodes: DNode[], modifier: Modifier, predicate: Predicate): DNode[]; -export declare function decorate(dNodes: RenderResult, modifier: Modifier, predicate: Predicate): RenderResult; -export declare function decorate(dNodes: DNode, modifier: Modifier): DNode; -export declare function decorate(dNodes: DNode[], modifier: Modifier): DNode[]; -export declare function decorate(dNodes: RenderResult, modifier: Modifier): RenderResult; -/** - * Wrapper function for calls to create a widget. - */ -export declare function w(widgetConstructor: Constructor | RegistryLabel, properties: W['properties'], children?: W['children']): WNode; -/** - * Wrapper function for calls to create VNodes. - */ -export declare function v(tag: string, children: undefined | DNode[]): VNode; -export declare function v(tag: string, properties: DeferredVirtualProperties | VNodeProperties, children?: DNode[]): VNode; -export declare function v(tag: string): VNode; -/** - * Create a VNode for an existing DOM Node. - */ -export declare function dom({node, attrs, props, on, diffType}: DomOptions, children?: DNode[]): VNode; diff --git a/deps/framework/widget-core/d.js b/deps/framework/widget-core/d.js deleted file mode 100644 index 51403baaea..0000000000 --- a/deps/framework/widget-core/d.js +++ /dev/null @@ -1,134 +0,0 @@ -(function (factory) { - if (typeof module === "object" && typeof module.exports === "object") { - var v = factory(require, exports); - if (v !== undefined) module.exports = v; - } - else if (typeof define === "function" && define.amd) { - define(["require", "exports", "tslib", "../shim/Symbol"], factory); - } -})(function (require, exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - var tslib_1 = require("tslib"); - var Symbol_1 = require("../shim/Symbol"); - /** - * The symbol identifier for a WNode type - */ - exports.WNODE = Symbol_1.default('Identifier for a WNode.'); - /** - * The symbol identifier for a VNode type - */ - exports.VNODE = Symbol_1.default('Identifier for a VNode.'); - /** - * The symbol identifier for a VNode type created using dom() - */ - exports.DOMVNODE = Symbol_1.default('Identifier for a VNode created using existing dom.'); - /** - * Helper function that returns true if the `DNode` is a `WNode` using the `type` property - */ - function isWNode(child) { - return Boolean(child && typeof child !== 'string' && child.type === exports.WNODE); - } - exports.isWNode = isWNode; - /** - * Helper function that returns true if the `DNode` is a `VNode` using the `type` property - */ - function isVNode(child) { - return Boolean(child && typeof child !== 'string' && (child.type === exports.VNODE || child.type === exports.DOMVNODE)); - } - exports.isVNode = isVNode; - /** - * Helper function that returns true if the `DNode` is a `VNode` created with `dom()` using the `type` property - */ - function isDomVNode(child) { - return Boolean(child && typeof child !== 'string' && child.type === exports.DOMVNODE); - } - exports.isDomVNode = isDomVNode; - function isElementNode(value) { - return !!value.tagName; - } - exports.isElementNode = isElementNode; - function decorate(dNodes, optionsOrModifier, predicate) { - var shallow = false; - var modifier; - if (typeof optionsOrModifier === 'function') { - modifier = optionsOrModifier; - } - else { - modifier = optionsOrModifier.modifier; - predicate = optionsOrModifier.predicate; - shallow = optionsOrModifier.shallow || false; - } - var nodes = Array.isArray(dNodes) ? tslib_1.__spread(dNodes) : [dNodes]; - function breaker() { - nodes = []; - } - while (nodes.length) { - var node = nodes.shift(); - if (node) { - if (!shallow && (isWNode(node) || isVNode(node)) && node.children) { - nodes = tslib_1.__spread(nodes, node.children); - } - if (!predicate || predicate(node)) { - modifier(node, breaker); - } - } - } - return dNodes; - } - exports.decorate = decorate; - /** - * Wrapper function for calls to create a widget. - */ - function w(widgetConstructor, properties, children) { - if (children === void 0) { children = []; } - return { - children: children, - widgetConstructor: widgetConstructor, - properties: properties, - type: exports.WNODE - }; - } - exports.w = w; - function v(tag, propertiesOrChildren, children) { - if (propertiesOrChildren === void 0) { propertiesOrChildren = {}; } - if (children === void 0) { children = undefined; } - var properties = propertiesOrChildren; - var deferredPropertiesCallback; - if (Array.isArray(propertiesOrChildren)) { - children = propertiesOrChildren; - properties = {}; - } - if (typeof properties === 'function') { - deferredPropertiesCallback = properties; - properties = {}; - } - return { - tag: tag, - deferredPropertiesCallback: deferredPropertiesCallback, - children: children, - properties: properties, - type: exports.VNODE - }; - } - exports.v = v; - /** - * Create a VNode for an existing DOM Node. - */ - function dom(_a, children) { - var node = _a.node, _b = _a.attrs, attrs = _b === void 0 ? {} : _b, _c = _a.props, props = _c === void 0 ? {} : _c, _d = _a.on, on = _d === void 0 ? {} : _d, _e = _a.diffType, diffType = _e === void 0 ? 'none' : _e; - return { - tag: isElementNode(node) ? node.tagName.toLowerCase() : '', - properties: props, - attributes: attrs, - events: on, - children: children, - type: exports.DOMVNODE, - domNode: node, - text: isElementNode(node) ? undefined : node.data, - diffType: diffType - }; - } - exports.dom = dom; -}); -//# sourceMappingURL=d.js.map \ No newline at end of file diff --git a/deps/framework/widget-core/d.js.map b/deps/framework/widget-core/d.js.map deleted file mode 100644 index 636af32e83..0000000000 --- a/deps/framework/widget-core/d.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"d.js","sourceRoot":"","sources":["d.ts"],"names":[],"mappings":";;;;;;;;;;;;IAAA,yCAAoC;IAepC;;OAEG;IACU,QAAA,KAAK,GAAG,gBAAM,CAAC,yBAAyB,CAAC,CAAC;IAEvD;;OAEG;IACU,QAAA,KAAK,GAAG,gBAAM,CAAC,yBAAyB,CAAC,CAAC;IAEvD;;OAEG;IACU,QAAA,QAAQ,GAAG,gBAAM,CAAC,oDAAoD,CAAC,CAAC;IAErF;;OAEG;IACH,iBACC,KAAe;QAEf,MAAM,CAAC,OAAO,CAAC,KAAK,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,IAAI,KAAK,aAAK,CAAC,CAAC;IAC5E,CAAC;IAJD,0BAIC;IAED;;OAEG;IACH,iBAAwB,KAAY;QACnC,MAAM,CAAC,OAAO,CAAC,KAAK,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,CAAC,KAAK,CAAC,IAAI,KAAK,aAAK,IAAI,KAAK,CAAC,IAAI,KAAK,gBAAQ,CAAC,CAAC,CAAC;IACzG,CAAC;IAFD,0BAEC;IAED;;OAEG;IACH,oBAA2B,KAAY;QACtC,MAAM,CAAC,OAAO,CAAC,KAAK,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,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,CAAC,EAAE;YAC1D,UAAU,EAAE,KAAK;YACjB,UAAU,EAAE,KAAK;YACjB,MAAM,EAAE,EAAE;YACV,QAAQ,UAAA;YACR,IAAI,EAAE,gBAAQ;YACd,OAAO,EAAE,IAAI;YACb,IAAI,EAAE,aAAa,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI;YACjD,QAAQ,UAAA;SACS,CAAC;IACpB,CAAC;IAfD,kBAeC","sourcesContent":["import Symbol from '../shim/Symbol';\nimport {\n\tConstructor,\n\tDefaultWidgetBaseInterface,\n\tDeferredVirtualProperties,\n\tDNode,\n\tVNode,\n\tRegistryLabel,\n\tVNodeProperties,\n\tWidgetBaseInterface,\n\tWNode,\n\tDomOptions\n} from './interfaces';\nimport { InternalVNode, RenderResult } from './vdom';\n\n/**\n * The symbol identifier for a WNode type\n */\nexport const WNODE = Symbol('Identifier for a WNode.');\n\n/**\n * The symbol identifier for a VNode type\n */\nexport const VNODE = Symbol('Identifier for a VNode.');\n\n/**\n * The symbol identifier for a VNode type created using dom()\n */\nexport const DOMVNODE = Symbol('Identifier for a VNode created using existing dom.');\n\n/**\n * Helper function that returns true if the `DNode` is a `WNode` using the `type` property\n */\nexport function isWNode(\n\tchild: DNode\n): child is WNode {\n\treturn Boolean(child && typeof child !== 'string' && child.type === WNODE);\n}\n\n/**\n * Helper function that returns true if the `DNode` is a `VNode` using the `type` property\n */\nexport function isVNode(child: DNode): child is VNode {\n\treturn Boolean(child && typeof child !== 'string' && (child.type === VNODE || child.type === DOMVNODE));\n}\n\n/**\n * Helper function that returns true if the `DNode` is a `VNode` created with `dom()` using the `type` property\n */\nexport function isDomVNode(child: DNode): child is VNode {\n\treturn Boolean(child && typeof child !== 'string' && child.type === DOMVNODE);\n}\n\nexport function isElementNode(value: any): value is Element {\n\treturn !!value.tagName;\n}\n\n/**\n * Interface for the decorate modifier\n */\nexport interface Modifier {\n\t(dNode: T, breaker: () => void): void;\n}\n\n/**\n * The predicate function for decorate\n */\nexport interface Predicate {\n\t(dNode: DNode): dNode is T;\n}\n\n/**\n * Decorator options\n */\nexport interface DecorateOptions {\n\tmodifier: Modifier;\n\tpredicate?: Predicate;\n\tshallow?: boolean;\n}\n\n/**\n * Generic decorate function for DNodes. The nodes are modified in place based on the provided predicate\n * and modifier functions.\n *\n * The children of each node are flattened and added to the array for decoration.\n *\n * If no predicate is supplied then the modifier will be executed on all nodes. A `breaker` function is passed to the\n * modifier which will drain the nodes array and exit the decoration.\n *\n * When the `shallow` options is set to `true` the only the top node or nodes will be decorated (only supported using\n * `DecorateOptions`).\n */\nexport function decorate(dNodes: DNode, options: DecorateOptions): DNode;\nexport function decorate(dNodes: DNode[], options: DecorateOptions): DNode[];\nexport function decorate(dNodes: DNode | DNode[], options: DecorateOptions): DNode | DNode[];\nexport function decorate(dNodes: DNode, modifier: Modifier, predicate: Predicate): DNode;\nexport function decorate(dNodes: DNode[], modifier: Modifier, predicate: Predicate): DNode[];\nexport function decorate(\n\tdNodes: RenderResult,\n\tmodifier: Modifier,\n\tpredicate: Predicate\n): RenderResult;\nexport function decorate(dNodes: DNode, modifier: Modifier): DNode;\nexport function decorate(dNodes: DNode[], modifier: Modifier): DNode[];\nexport function decorate(dNodes: RenderResult, modifier: Modifier): RenderResult;\nexport function decorate(\n\tdNodes: DNode | DNode[],\n\toptionsOrModifier: Modifier | DecorateOptions,\n\tpredicate?: Predicate\n): DNode | DNode[] {\n\tlet shallow = false;\n\tlet modifier;\n\tif (typeof optionsOrModifier === 'function') {\n\t\tmodifier = optionsOrModifier;\n\t} else {\n\t\tmodifier = optionsOrModifier.modifier;\n\t\tpredicate = optionsOrModifier.predicate;\n\t\tshallow = optionsOrModifier.shallow || false;\n\t}\n\n\tlet nodes = Array.isArray(dNodes) ? [...dNodes] : [dNodes];\n\tfunction breaker() {\n\t\tnodes = [];\n\t}\n\twhile (nodes.length) {\n\t\tconst node = nodes.shift();\n\t\tif (node) {\n\t\t\tif (!shallow && (isWNode(node) || isVNode(node)) && node.children) {\n\t\t\t\tnodes = [...nodes, ...node.children];\n\t\t\t}\n\t\t\tif (!predicate || predicate(node)) {\n\t\t\t\tmodifier(node, breaker);\n\t\t\t}\n\t\t}\n\t}\n\treturn dNodes;\n}\n\n/**\n * Wrapper function for calls to create a widget.\n */\nexport function w(\n\twidgetConstructor: Constructor | RegistryLabel,\n\tproperties: W['properties'],\n\tchildren: W['children'] = []\n): WNode {\n\treturn {\n\t\tchildren,\n\t\twidgetConstructor,\n\t\tproperties,\n\t\ttype: WNODE\n\t};\n}\n\n/**\n * Wrapper function for calls to create VNodes.\n */\nexport function v(tag: string, children: undefined | DNode[]): VNode;\nexport function v(tag: string, properties: DeferredVirtualProperties | VNodeProperties, children?: DNode[]): VNode;\nexport function v(tag: string): VNode;\nexport function v(\n\ttag: string,\n\tpropertiesOrChildren: VNodeProperties | DeferredVirtualProperties | DNode[] = {},\n\tchildren: undefined | DNode[] = undefined\n): VNode {\n\tlet properties: VNodeProperties | DeferredVirtualProperties = propertiesOrChildren;\n\tlet deferredPropertiesCallback;\n\n\tif (Array.isArray(propertiesOrChildren)) {\n\t\tchildren = propertiesOrChildren;\n\t\tproperties = {};\n\t}\n\n\tif (typeof properties === 'function') {\n\t\tdeferredPropertiesCallback = properties;\n\t\tproperties = {};\n\t}\n\n\treturn {\n\t\ttag,\n\t\tdeferredPropertiesCallback,\n\t\tchildren,\n\t\tproperties,\n\t\ttype: VNODE\n\t};\n}\n\n/**\n * Create a VNode for an existing DOM Node.\n */\nexport function dom(\n\t{ node, attrs = {}, props = {}, on = {}, diffType = 'none' }: DomOptions,\n\tchildren?: DNode[]\n): VNode {\n\treturn {\n\t\ttag: isElementNode(node) ? node.tagName.toLowerCase() : '',\n\t\tproperties: props,\n\t\tattributes: attrs,\n\t\tevents: on,\n\t\tchildren,\n\t\ttype: DOMVNODE,\n\t\tdomNode: node,\n\t\ttext: isElementNode(node) ? undefined : node.data,\n\t\tdiffType\n\t} as InternalVNode;\n}\n"]} \ No newline at end of file diff --git a/deps/framework/widget-core/d.mjs b/deps/framework/widget-core/d.mjs deleted file mode 100644 index c5cd94cb36..0000000000 --- a/deps/framework/widget-core/d.mjs +++ /dev/null @@ -1,109 +0,0 @@ -import Symbol from '../shim/Symbol'; -/** - * The symbol identifier for a WNode type - */ -export const WNODE = Symbol('Identifier for a WNode.'); -/** - * The symbol identifier for a VNode type - */ -export const VNODE = Symbol('Identifier for a VNode.'); -/** - * The symbol identifier for a VNode type created using dom() - */ -export const DOMVNODE = Symbol('Identifier for a VNode created using existing dom.'); -/** - * Helper function that returns true if the `DNode` is a `WNode` using the `type` property - */ -export function isWNode(child) { - return Boolean(child && typeof child !== 'string' && child.type === WNODE); -} -/** - * Helper function that returns true if the `DNode` is a `VNode` using the `type` property - */ -export function isVNode(child) { - return Boolean(child && typeof child !== 'string' && (child.type === VNODE || child.type === DOMVNODE)); -} -/** - * Helper function that returns true if the `DNode` is a `VNode` created with `dom()` using the `type` property - */ -export function isDomVNode(child) { - return Boolean(child && typeof child !== 'string' && child.type === DOMVNODE); -} -export function isElementNode(value) { - return !!value.tagName; -} -export function decorate(dNodes, optionsOrModifier, predicate) { - let shallow = false; - let modifier; - if (typeof optionsOrModifier === 'function') { - modifier = optionsOrModifier; - } - else { - modifier = optionsOrModifier.modifier; - predicate = optionsOrModifier.predicate; - shallow = optionsOrModifier.shallow || false; - } - let nodes = Array.isArray(dNodes) ? [...dNodes] : [dNodes]; - function breaker() { - nodes = []; - } - while (nodes.length) { - const node = nodes.shift(); - if (node) { - if (!shallow && (isWNode(node) || isVNode(node)) && node.children) { - nodes = [...nodes, ...node.children]; - } - if (!predicate || predicate(node)) { - modifier(node, breaker); - } - } - } - return dNodes; -} -/** - * Wrapper function for calls to create a widget. - */ -export function w(widgetConstructor, properties, children = []) { - return { - children, - widgetConstructor, - properties, - type: WNODE - }; -} -export function v(tag, propertiesOrChildren = {}, children = undefined) { - let properties = propertiesOrChildren; - let deferredPropertiesCallback; - if (Array.isArray(propertiesOrChildren)) { - children = propertiesOrChildren; - properties = {}; - } - if (typeof properties === 'function') { - deferredPropertiesCallback = properties; - properties = {}; - } - return { - tag, - deferredPropertiesCallback, - children, - properties, - type: VNODE - }; -} -/** - * Create a VNode for an existing DOM Node. - */ -export function dom({ node, attrs = {}, props = {}, on = {}, diffType = 'none' }, children) { - return { - tag: isElementNode(node) ? node.tagName.toLowerCase() : '', - properties: props, - attributes: attrs, - events: on, - children, - type: DOMVNODE, - domNode: node, - text: isElementNode(node) ? undefined : node.data, - diffType - }; -} -//# sourceMappingURL=d.mjs.map \ No newline at end of file diff --git a/deps/framework/widget-core/d.mjs.map b/deps/framework/widget-core/d.mjs.map deleted file mode 100644 index 01b26a513d..0000000000 --- a/deps/framework/widget-core/d.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"d.mjs","sourceRoot":"","sources":["d.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,gBAAgB,CAAC;AAepC;;GAEG;AACH,MAAM,CAAC,MAAM,KAAK,GAAG,MAAM,CAAC,yBAAyB,CAAC,CAAC;AAEvD;;GAEG;AACH,MAAM,CAAC,MAAM,KAAK,GAAG,MAAM,CAAC,yBAAyB,CAAC,CAAC;AAEvD;;GAEG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAG,MAAM,CAAC,oDAAoD,CAAC,CAAC;AAErF;;GAEG;AACH,MAAM,kBACL,KAAe;IAEf,MAAM,CAAC,OAAO,CAAC,KAAK,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,IAAI,KAAK,KAAK,CAAC,CAAC;AAC5E,CAAC;AAED;;GAEG;AACH,MAAM,kBAAkB,KAAY;IACnC,MAAM,CAAC,OAAO,CAAC,KAAK,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,CAAC,KAAK,CAAC,IAAI,KAAK,KAAK,IAAI,KAAK,CAAC,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC;AAC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C,EAAE;QAC1D,UAAU,EAAE,KAAK;QACjB,UAAU,EAAE,KAAK;QACjB,MAAM,EAAE,EAAE;QACV,QAAQ;QACR,IAAI,EAAE,QAAQ;QACd,OAAO,EAAE,IAAI;QACb,IAAI,EAAE,aAAa,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI;QACjD,QAAQ;KACS,CAAC;AACpB,CAAC","sourcesContent":["import Symbol from '../shim/Symbol';\nimport {\n\tConstructor,\n\tDefaultWidgetBaseInterface,\n\tDeferredVirtualProperties,\n\tDNode,\n\tVNode,\n\tRegistryLabel,\n\tVNodeProperties,\n\tWidgetBaseInterface,\n\tWNode,\n\tDomOptions\n} from './interfaces';\nimport { InternalVNode, RenderResult } from './vdom';\n\n/**\n * The symbol identifier for a WNode type\n */\nexport const WNODE = Symbol('Identifier for a WNode.');\n\n/**\n * The symbol identifier for a VNode type\n */\nexport const VNODE = Symbol('Identifier for a VNode.');\n\n/**\n * The symbol identifier for a VNode type created using dom()\n */\nexport const DOMVNODE = Symbol('Identifier for a VNode created using existing dom.');\n\n/**\n * Helper function that returns true if the `DNode` is a `WNode` using the `type` property\n */\nexport function isWNode(\n\tchild: DNode\n): child is WNode {\n\treturn Boolean(child && typeof child !== 'string' && child.type === WNODE);\n}\n\n/**\n * Helper function that returns true if the `DNode` is a `VNode` using the `type` property\n */\nexport function isVNode(child: DNode): child is VNode {\n\treturn Boolean(child && typeof child !== 'string' && (child.type === VNODE || child.type === DOMVNODE));\n}\n\n/**\n * Helper function that returns true if the `DNode` is a `VNode` created with `dom()` using the `type` property\n */\nexport function isDomVNode(child: DNode): child is VNode {\n\treturn Boolean(child && typeof child !== 'string' && child.type === DOMVNODE);\n}\n\nexport function isElementNode(value: any): value is Element {\n\treturn !!value.tagName;\n}\n\n/**\n * Interface for the decorate modifier\n */\nexport interface Modifier {\n\t(dNode: T, breaker: () => void): void;\n}\n\n/**\n * The predicate function for decorate\n */\nexport interface Predicate {\n\t(dNode: DNode): dNode is T;\n}\n\n/**\n * Decorator options\n */\nexport interface DecorateOptions {\n\tmodifier: Modifier;\n\tpredicate?: Predicate;\n\tshallow?: boolean;\n}\n\n/**\n * Generic decorate function for DNodes. The nodes are modified in place based on the provided predicate\n * and modifier functions.\n *\n * The children of each node are flattened and added to the array for decoration.\n *\n * If no predicate is supplied then the modifier will be executed on all nodes. A `breaker` function is passed to the\n * modifier which will drain the nodes array and exit the decoration.\n *\n * When the `shallow` options is set to `true` the only the top node or nodes will be decorated (only supported using\n * `DecorateOptions`).\n */\nexport function decorate(dNodes: DNode, options: DecorateOptions): DNode;\nexport function decorate(dNodes: DNode[], options: DecorateOptions): DNode[];\nexport function decorate(dNodes: DNode | DNode[], options: DecorateOptions): DNode | DNode[];\nexport function decorate(dNodes: DNode, modifier: Modifier, predicate: Predicate): DNode;\nexport function decorate(dNodes: DNode[], modifier: Modifier, predicate: Predicate): DNode[];\nexport function decorate(\n\tdNodes: RenderResult,\n\tmodifier: Modifier,\n\tpredicate: Predicate\n): RenderResult;\nexport function decorate(dNodes: DNode, modifier: Modifier): DNode;\nexport function decorate(dNodes: DNode[], modifier: Modifier): DNode[];\nexport function decorate(dNodes: RenderResult, modifier: Modifier): RenderResult;\nexport function decorate(\n\tdNodes: DNode | DNode[],\n\toptionsOrModifier: Modifier | DecorateOptions,\n\tpredicate?: Predicate\n): DNode | DNode[] {\n\tlet shallow = false;\n\tlet modifier;\n\tif (typeof optionsOrModifier === 'function') {\n\t\tmodifier = optionsOrModifier;\n\t} else {\n\t\tmodifier = optionsOrModifier.modifier;\n\t\tpredicate = optionsOrModifier.predicate;\n\t\tshallow = optionsOrModifier.shallow || false;\n\t}\n\n\tlet nodes = Array.isArray(dNodes) ? [...dNodes] : [dNodes];\n\tfunction breaker() {\n\t\tnodes = [];\n\t}\n\twhile (nodes.length) {\n\t\tconst node = nodes.shift();\n\t\tif (node) {\n\t\t\tif (!shallow && (isWNode(node) || isVNode(node)) && node.children) {\n\t\t\t\tnodes = [...nodes, ...node.children];\n\t\t\t}\n\t\t\tif (!predicate || predicate(node)) {\n\t\t\t\tmodifier(node, breaker);\n\t\t\t}\n\t\t}\n\t}\n\treturn dNodes;\n}\n\n/**\n * Wrapper function for calls to create a widget.\n */\nexport function w(\n\twidgetConstructor: Constructor | RegistryLabel,\n\tproperties: W['properties'],\n\tchildren: W['children'] = []\n): WNode {\n\treturn {\n\t\tchildren,\n\t\twidgetConstructor,\n\t\tproperties,\n\t\ttype: WNODE\n\t};\n}\n\n/**\n * Wrapper function for calls to create VNodes.\n */\nexport function v(tag: string, children: undefined | DNode[]): VNode;\nexport function v(tag: string, properties: DeferredVirtualProperties | VNodeProperties, children?: DNode[]): VNode;\nexport function v(tag: string): VNode;\nexport function v(\n\ttag: string,\n\tpropertiesOrChildren: VNodeProperties | DeferredVirtualProperties | DNode[] = {},\n\tchildren: undefined | DNode[] = undefined\n): VNode {\n\tlet properties: VNodeProperties | DeferredVirtualProperties = propertiesOrChildren;\n\tlet deferredPropertiesCallback;\n\n\tif (Array.isArray(propertiesOrChildren)) {\n\t\tchildren = propertiesOrChildren;\n\t\tproperties = {};\n\t}\n\n\tif (typeof properties === 'function') {\n\t\tdeferredPropertiesCallback = properties;\n\t\tproperties = {};\n\t}\n\n\treturn {\n\t\ttag,\n\t\tdeferredPropertiesCallback,\n\t\tchildren,\n\t\tproperties,\n\t\ttype: VNODE\n\t};\n}\n\n/**\n * Create a VNode for an existing DOM Node.\n */\nexport function dom(\n\t{ node, attrs = {}, props = {}, on = {}, diffType = 'none' }: DomOptions,\n\tchildren?: DNode[]\n): VNode {\n\treturn {\n\t\ttag: isElementNode(node) ? node.tagName.toLowerCase() : '',\n\t\tproperties: props,\n\t\tattributes: attrs,\n\t\tevents: on,\n\t\tchildren,\n\t\ttype: DOMVNODE,\n\t\tdomNode: node,\n\t\ttext: isElementNode(node) ? undefined : node.data,\n\t\tdiffType\n\t} as InternalVNode;\n}\n"]} \ No newline at end of file diff --git a/deps/framework/widget-core/decorators/afterRender.d.ts b/deps/framework/widget-core/decorators/afterRender.d.ts deleted file mode 100644 index f31aca589f..0000000000 --- a/deps/framework/widget-core/decorators/afterRender.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -/** - * Decorator that can be used to register a function to run as an aspect to `render` - */ -export declare function afterRender(method: Function): (target: any) => void; -export declare function afterRender(): (target: any, propertyKey: string) => void; -export default afterRender; diff --git a/deps/framework/widget-core/decorators/afterRender.js b/deps/framework/widget-core/decorators/afterRender.js deleted file mode 100644 index ebe7f8fa1b..0000000000 --- a/deps/framework/widget-core/decorators/afterRender.js +++ /dev/null @@ -1,21 +0,0 @@ -(function (factory) { - if (typeof module === "object" && typeof module.exports === "object") { - var v = factory(require, exports); - if (v !== undefined) module.exports = v; - } - else if (typeof define === "function" && define.amd) { - define(["require", "exports", "./handleDecorator"], factory); - } -})(function (require, exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - var handleDecorator_1 = require("./handleDecorator"); - function afterRender(method) { - return handleDecorator_1.handleDecorator(function (target, propertyKey) { - target.addDecorator('afterRender', propertyKey ? target[propertyKey] : method); - }); - } - exports.afterRender = afterRender; - exports.default = afterRender; -}); -//# sourceMappingURL=afterRender.js.map \ No newline at end of file diff --git a/deps/framework/widget-core/decorators/afterRender.js.map b/deps/framework/widget-core/decorators/afterRender.js.map deleted file mode 100644 index 0498ee46e3..0000000000 --- a/deps/framework/widget-core/decorators/afterRender.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"afterRender.js","sourceRoot":"","sources":["afterRender.ts"],"names":[],"mappings":";;;;;;;;;;;IAAA,qDAAoD;IAOpD,qBAA4B,MAAiB;QAC5C,MAAM,CAAC,iCAAe,CAAC,UAAC,MAAM,EAAE,WAAW;YAC1C,MAAM,CAAC,YAAY,CAAC,aAAa,EAAE,WAAW,CAAC,CAAC,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC;QAChF,CAAC,CAAC,CAAC;IACJ,CAAC;IAJD,kCAIC;IAED,kBAAe,WAAW,CAAC","sourcesContent":["import { handleDecorator } from './handleDecorator';\n\n/**\n * Decorator that can be used to register a function to run as an aspect to `render`\n */\nexport function afterRender(method: Function): (target: any) => void;\nexport function afterRender(): (target: any, propertyKey: string) => void;\nexport function afterRender(method?: Function) {\n\treturn handleDecorator((target, propertyKey) => {\n\t\ttarget.addDecorator('afterRender', propertyKey ? target[propertyKey] : method);\n\t});\n}\n\nexport default afterRender;\n"]} \ No newline at end of file diff --git a/deps/framework/widget-core/decorators/afterRender.mjs b/deps/framework/widget-core/decorators/afterRender.mjs deleted file mode 100644 index 9abf28fbf0..0000000000 --- a/deps/framework/widget-core/decorators/afterRender.mjs +++ /dev/null @@ -1,8 +0,0 @@ -import { handleDecorator } from './handleDecorator'; -export function afterRender(method) { - return handleDecorator((target, propertyKey) => { - target.addDecorator('afterRender', propertyKey ? target[propertyKey] : method); - }); -} -export default afterRender; -//# sourceMappingURL=afterRender.mjs.map \ No newline at end of file diff --git a/deps/framework/widget-core/decorators/afterRender.mjs.map b/deps/framework/widget-core/decorators/afterRender.mjs.map deleted file mode 100644 index 004d0f1ae5..0000000000 --- a/deps/framework/widget-core/decorators/afterRender.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"afterRender.mjs","sourceRoot":"","sources":["afterRender.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAOpD,MAAM,sBAAsB,MAAiB;IAC5C,MAAM,CAAC,eAAe,CAAC,CAAC,MAAM,EAAE,WAAW,EAAE,EAAE;QAC9C,MAAM,CAAC,YAAY,CAAC,aAAa,EAAE,WAAW,CAAC,CAAC,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC;IAChF,CAAC,CAAC,CAAC;AACJ,CAAC;AAED,eAAe,WAAW,CAAC","sourcesContent":["import { handleDecorator } from './handleDecorator';\n\n/**\n * Decorator that can be used to register a function to run as an aspect to `render`\n */\nexport function afterRender(method: Function): (target: any) => void;\nexport function afterRender(): (target: any, propertyKey: string) => void;\nexport function afterRender(method?: Function) {\n\treturn handleDecorator((target, propertyKey) => {\n\t\ttarget.addDecorator('afterRender', propertyKey ? target[propertyKey] : method);\n\t});\n}\n\nexport default afterRender;\n"]} \ No newline at end of file diff --git a/deps/framework/widget-core/decorators/alwaysRender.d.ts b/deps/framework/widget-core/decorators/alwaysRender.d.ts deleted file mode 100644 index b6a92cfdb4..0000000000 --- a/deps/framework/widget-core/decorators/alwaysRender.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export declare function alwaysRender(): (target: any, propertyKey?: string | undefined, descriptor?: PropertyDescriptor | undefined) => void; -export default alwaysRender; diff --git a/deps/framework/widget-core/decorators/alwaysRender.js b/deps/framework/widget-core/decorators/alwaysRender.js deleted file mode 100644 index 4e5c8db638..0000000000 --- a/deps/framework/widget-core/decorators/alwaysRender.js +++ /dev/null @@ -1,24 +0,0 @@ -(function (factory) { - if (typeof module === "object" && typeof module.exports === "object") { - var v = factory(require, exports); - if (v !== undefined) module.exports = v; - } - else if (typeof define === "function" && define.amd) { - define(["require", "exports", "./handleDecorator", "./beforeProperties"], factory); - } -})(function (require, exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - var handleDecorator_1 = require("./handleDecorator"); - var beforeProperties_1 = require("./beforeProperties"); - function alwaysRender() { - return handleDecorator_1.handleDecorator(function (target, propertyKey) { - beforeProperties_1.beforeProperties(function () { - this.invalidate(); - })(target); - }); - } - exports.alwaysRender = alwaysRender; - exports.default = alwaysRender; -}); -//# sourceMappingURL=alwaysRender.js.map \ No newline at end of file diff --git a/deps/framework/widget-core/decorators/alwaysRender.js.map b/deps/framework/widget-core/decorators/alwaysRender.js.map deleted file mode 100644 index 27517a0522..0000000000 --- a/deps/framework/widget-core/decorators/alwaysRender.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"alwaysRender.js","sourceRoot":"","sources":["alwaysRender.ts"],"names":[],"mappings":";;;;;;;;;;;IACA,qDAAoD;IACpD,uDAAsD;IAEtD;QACC,MAAM,CAAC,iCAAe,CAAC,UAAC,MAAM,EAAE,WAAW;YAC1C,mCAAgB,CAAC;gBAChB,IAAI,CAAC,UAAU,EAAE,CAAC;YACnB,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC;QACZ,CAAC,CAAC,CAAC;IACJ,CAAC;IAND,oCAMC;IAED,kBAAe,YAAY,CAAC","sourcesContent":["import { WidgetBase } from './../WidgetBase';\nimport { handleDecorator } from './handleDecorator';\nimport { beforeProperties } from './beforeProperties';\n\nexport function alwaysRender() {\n\treturn handleDecorator((target, propertyKey) => {\n\t\tbeforeProperties(function(this: WidgetBase) {\n\t\t\tthis.invalidate();\n\t\t})(target);\n\t});\n}\n\nexport default alwaysRender;\n"]} \ No newline at end of file diff --git a/deps/framework/widget-core/decorators/alwaysRender.mjs b/deps/framework/widget-core/decorators/alwaysRender.mjs deleted file mode 100644 index 071ac54353..0000000000 --- a/deps/framework/widget-core/decorators/alwaysRender.mjs +++ /dev/null @@ -1,11 +0,0 @@ -import { handleDecorator } from './handleDecorator'; -import { beforeProperties } from './beforeProperties'; -export function alwaysRender() { - return handleDecorator((target, propertyKey) => { - beforeProperties(function () { - this.invalidate(); - })(target); - }); -} -export default alwaysRender; -//# sourceMappingURL=alwaysRender.mjs.map \ No newline at end of file diff --git a/deps/framework/widget-core/decorators/alwaysRender.mjs.map b/deps/framework/widget-core/decorators/alwaysRender.mjs.map deleted file mode 100644 index d8845ee006..0000000000 --- a/deps/framework/widget-core/decorators/alwaysRender.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"alwaysRender.mjs","sourceRoot":"","sources":["alwaysRender.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAEtD,MAAM;IACL,MAAM,CAAC,eAAe,CAAC,CAAC,MAAM,EAAE,WAAW,EAAE,EAAE;QAC9C,gBAAgB,CAAC;YAChB,IAAI,CAAC,UAAU,EAAE,CAAC;QACnB,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC;IACZ,CAAC,CAAC,CAAC;AACJ,CAAC;AAED,eAAe,YAAY,CAAC","sourcesContent":["import { WidgetBase } from './../WidgetBase';\nimport { handleDecorator } from './handleDecorator';\nimport { beforeProperties } from './beforeProperties';\n\nexport function alwaysRender() {\n\treturn handleDecorator((target, propertyKey) => {\n\t\tbeforeProperties(function(this: WidgetBase) {\n\t\t\tthis.invalidate();\n\t\t})(target);\n\t});\n}\n\nexport default alwaysRender;\n"]} \ No newline at end of file diff --git a/deps/framework/widget-core/decorators/beforeProperties.d.ts b/deps/framework/widget-core/decorators/beforeProperties.d.ts deleted file mode 100644 index c88ef6ed9f..0000000000 --- a/deps/framework/widget-core/decorators/beforeProperties.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { BeforeProperties } from './../interfaces'; -/** - * Decorator that adds the function passed of target method to be run - * in the `beforeProperties` lifecycle. - */ -export declare function beforeProperties(method: BeforeProperties): (target: any) => void; -export declare function beforeProperties(): (target: any, propertyKey: string) => void; -export default beforeProperties; diff --git a/deps/framework/widget-core/decorators/beforeProperties.js b/deps/framework/widget-core/decorators/beforeProperties.js deleted file mode 100644 index c884cc8c4a..0000000000 --- a/deps/framework/widget-core/decorators/beforeProperties.js +++ /dev/null @@ -1,21 +0,0 @@ -(function (factory) { - if (typeof module === "object" && typeof module.exports === "object") { - var v = factory(require, exports); - if (v !== undefined) module.exports = v; - } - else if (typeof define === "function" && define.amd) { - define(["require", "exports", "./handleDecorator"], factory); - } -})(function (require, exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - var handleDecorator_1 = require("./handleDecorator"); - function beforeProperties(method) { - return handleDecorator_1.handleDecorator(function (target, propertyKey) { - target.addDecorator('beforeProperties', propertyKey ? target[propertyKey] : method); - }); - } - exports.beforeProperties = beforeProperties; - exports.default = beforeProperties; -}); -//# sourceMappingURL=beforeProperties.js.map \ No newline at end of file diff --git a/deps/framework/widget-core/decorators/beforeProperties.js.map b/deps/framework/widget-core/decorators/beforeProperties.js.map deleted file mode 100644 index 50c45d1b02..0000000000 --- a/deps/framework/widget-core/decorators/beforeProperties.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"beforeProperties.js","sourceRoot":"","sources":["beforeProperties.ts"],"names":[],"mappings":";;;;;;;;;;;IAAA,qDAAoD;IASpD,0BAAiC,MAAyB;QACzD,MAAM,CAAC,iCAAe,CAAC,UAAC,MAAM,EAAE,WAAW;YAC1C,MAAM,CAAC,YAAY,CAAC,kBAAkB,EAAE,WAAW,CAAC,CAAC,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC;QACrF,CAAC,CAAC,CAAC;IACJ,CAAC;IAJD,4CAIC;IAED,kBAAe,gBAAgB,CAAC","sourcesContent":["import { handleDecorator } from './handleDecorator';\nimport { BeforeProperties } from './../interfaces';\n\n/**\n * Decorator that adds the function passed of target method to be run\n * in the `beforeProperties` lifecycle.\n */\nexport function beforeProperties(method: BeforeProperties): (target: any) => void;\nexport function beforeProperties(): (target: any, propertyKey: string) => void;\nexport function beforeProperties(method?: BeforeProperties) {\n\treturn handleDecorator((target, propertyKey) => {\n\t\ttarget.addDecorator('beforeProperties', propertyKey ? target[propertyKey] : method);\n\t});\n}\n\nexport default beforeProperties;\n"]} \ No newline at end of file diff --git a/deps/framework/widget-core/decorators/beforeProperties.mjs b/deps/framework/widget-core/decorators/beforeProperties.mjs deleted file mode 100644 index 5dd831f8dc..0000000000 --- a/deps/framework/widget-core/decorators/beforeProperties.mjs +++ /dev/null @@ -1,8 +0,0 @@ -import { handleDecorator } from './handleDecorator'; -export function beforeProperties(method) { - return handleDecorator((target, propertyKey) => { - target.addDecorator('beforeProperties', propertyKey ? target[propertyKey] : method); - }); -} -export default beforeProperties; -//# sourceMappingURL=beforeProperties.mjs.map \ No newline at end of file diff --git a/deps/framework/widget-core/decorators/beforeProperties.mjs.map b/deps/framework/widget-core/decorators/beforeProperties.mjs.map deleted file mode 100644 index 370fe0ed6d..0000000000 --- a/deps/framework/widget-core/decorators/beforeProperties.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"beforeProperties.mjs","sourceRoot":"","sources":["beforeProperties.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AASpD,MAAM,2BAA2B,MAAyB;IACzD,MAAM,CAAC,eAAe,CAAC,CAAC,MAAM,EAAE,WAAW,EAAE,EAAE;QAC9C,MAAM,CAAC,YAAY,CAAC,kBAAkB,EAAE,WAAW,CAAC,CAAC,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC;IACrF,CAAC,CAAC,CAAC;AACJ,CAAC;AAED,eAAe,gBAAgB,CAAC","sourcesContent":["import { handleDecorator } from './handleDecorator';\nimport { BeforeProperties } from './../interfaces';\n\n/**\n * Decorator that adds the function passed of target method to be run\n * in the `beforeProperties` lifecycle.\n */\nexport function beforeProperties(method: BeforeProperties): (target: any) => void;\nexport function beforeProperties(): (target: any, propertyKey: string) => void;\nexport function beforeProperties(method?: BeforeProperties) {\n\treturn handleDecorator((target, propertyKey) => {\n\t\ttarget.addDecorator('beforeProperties', propertyKey ? target[propertyKey] : method);\n\t});\n}\n\nexport default beforeProperties;\n"]} \ No newline at end of file diff --git a/deps/framework/widget-core/decorators/beforeRender.d.ts b/deps/framework/widget-core/decorators/beforeRender.d.ts deleted file mode 100644 index 09912304a8..0000000000 --- a/deps/framework/widget-core/decorators/beforeRender.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -/** - * Decorator that can be used to register a reducer function to run as an aspect before to `render` - */ -export declare function beforeRender(method: Function): (target: any) => void; -export declare function beforeRender(): (target: any, propertyKey: string) => void; -export default beforeRender; diff --git a/deps/framework/widget-core/decorators/beforeRender.js b/deps/framework/widget-core/decorators/beforeRender.js deleted file mode 100644 index 063b076856..0000000000 --- a/deps/framework/widget-core/decorators/beforeRender.js +++ /dev/null @@ -1,21 +0,0 @@ -(function (factory) { - if (typeof module === "object" && typeof module.exports === "object") { - var v = factory(require, exports); - if (v !== undefined) module.exports = v; - } - else if (typeof define === "function" && define.amd) { - define(["require", "exports", "./handleDecorator"], factory); - } -})(function (require, exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - var handleDecorator_1 = require("./handleDecorator"); - function beforeRender(method) { - return handleDecorator_1.handleDecorator(function (target, propertyKey) { - target.addDecorator('beforeRender', propertyKey ? target[propertyKey] : method); - }); - } - exports.beforeRender = beforeRender; - exports.default = beforeRender; -}); -//# sourceMappingURL=beforeRender.js.map \ No newline at end of file diff --git a/deps/framework/widget-core/decorators/beforeRender.js.map b/deps/framework/widget-core/decorators/beforeRender.js.map deleted file mode 100644 index c6e7af7d4b..0000000000 --- a/deps/framework/widget-core/decorators/beforeRender.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"beforeRender.js","sourceRoot":"","sources":["beforeRender.ts"],"names":[],"mappings":";;;;;;;;;;;IAAA,qDAAoD;IAOpD,sBAA6B,MAAiB;QAC7C,MAAM,CAAC,iCAAe,CAAC,UAAC,MAAM,EAAE,WAAW;YAC1C,MAAM,CAAC,YAAY,CAAC,cAAc,EAAE,WAAW,CAAC,CAAC,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC;QACjF,CAAC,CAAC,CAAC;IACJ,CAAC;IAJD,oCAIC;IAED,kBAAe,YAAY,CAAC","sourcesContent":["import { handleDecorator } from './handleDecorator';\n\n/**\n * Decorator that can be used to register a reducer function to run as an aspect before to `render`\n */\nexport function beforeRender(method: Function): (target: any) => void;\nexport function beforeRender(): (target: any, propertyKey: string) => void;\nexport function beforeRender(method?: Function) {\n\treturn handleDecorator((target, propertyKey) => {\n\t\ttarget.addDecorator('beforeRender', propertyKey ? target[propertyKey] : method);\n\t});\n}\n\nexport default beforeRender;\n"]} \ No newline at end of file diff --git a/deps/framework/widget-core/decorators/beforeRender.mjs b/deps/framework/widget-core/decorators/beforeRender.mjs deleted file mode 100644 index 03a4ef9137..0000000000 --- a/deps/framework/widget-core/decorators/beforeRender.mjs +++ /dev/null @@ -1,8 +0,0 @@ -import { handleDecorator } from './handleDecorator'; -export function beforeRender(method) { - return handleDecorator((target, propertyKey) => { - target.addDecorator('beforeRender', propertyKey ? target[propertyKey] : method); - }); -} -export default beforeRender; -//# sourceMappingURL=beforeRender.mjs.map \ No newline at end of file diff --git a/deps/framework/widget-core/decorators/beforeRender.mjs.map b/deps/framework/widget-core/decorators/beforeRender.mjs.map deleted file mode 100644 index 0ab231a102..0000000000 --- a/deps/framework/widget-core/decorators/beforeRender.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"beforeRender.mjs","sourceRoot":"","sources":["beforeRender.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAOpD,MAAM,uBAAuB,MAAiB;IAC7C,MAAM,CAAC,eAAe,CAAC,CAAC,MAAM,EAAE,WAAW,EAAE,EAAE;QAC9C,MAAM,CAAC,YAAY,CAAC,cAAc,EAAE,WAAW,CAAC,CAAC,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC;IACjF,CAAC,CAAC,CAAC;AACJ,CAAC;AAED,eAAe,YAAY,CAAC","sourcesContent":["import { handleDecorator } from './handleDecorator';\n\n/**\n * Decorator that can be used to register a reducer function to run as an aspect before to `render`\n */\nexport function beforeRender(method: Function): (target: any) => void;\nexport function beforeRender(): (target: any, propertyKey: string) => void;\nexport function beforeRender(method?: Function) {\n\treturn handleDecorator((target, propertyKey) => {\n\t\ttarget.addDecorator('beforeRender', propertyKey ? target[propertyKey] : method);\n\t});\n}\n\nexport default beforeRender;\n"]} \ No newline at end of file diff --git a/deps/framework/widget-core/decorators/customElement.d.ts b/deps/framework/widget-core/decorators/customElement.d.ts deleted file mode 100644 index 4f41a3fcc0..0000000000 --- a/deps/framework/widget-core/decorators/customElement.d.ts +++ /dev/null @@ -1,37 +0,0 @@ -import { Constructor, WidgetProperties } from '../interfaces'; -import { CustomElementChildType } from '../registerCustomElement'; -import Registry from '../Registry'; -export declare type CustomElementPropertyNames

= ((keyof P) | (keyof WidgetProperties))[]; -/** - * Defines the custom element configuration used by the customElement decorator - */ -export interface CustomElementConfig

{ - /** - * The tag of the custom element - */ - tag: string; - /** - * List of widget properties to expose as properties on the custom element - */ - properties?: CustomElementPropertyNames

; - /** - * List of attributes on the custom element to map to widget properties - */ - attributes?: CustomElementPropertyNames

; - /** - * List of events to expose - */ - events?: CustomElementPropertyNames

; - childType?: CustomElementChildType; - registryFactory?: () => Registry; -} -/** - * This Decorator is provided properties that define the behavior of a custom element, and - * registers that custom element. - */ -export declare function customElement

({tag, properties, attributes, events, childType, registryFactory}: CustomElementConfig

): >(target: T) => void; -export default customElement; diff --git a/deps/framework/widget-core/decorators/customElement.js b/deps/framework/widget-core/decorators/customElement.js deleted file mode 100644 index 10d06052a8..0000000000 --- a/deps/framework/widget-core/decorators/customElement.js +++ /dev/null @@ -1,34 +0,0 @@ -(function (factory) { - if (typeof module === "object" && typeof module.exports === "object") { - var v = factory(require, exports); - if (v !== undefined) module.exports = v; - } - else if (typeof define === "function" && define.amd) { - define(["require", "exports", "../registerCustomElement", "../Registry"], factory); - } -})(function (require, exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - var registerCustomElement_1 = require("../registerCustomElement"); - var Registry_1 = require("../Registry"); - /** - * This Decorator is provided properties that define the behavior of a custom element, and - * registers that custom element. - */ - function customElement(_a) { - var tag = _a.tag, _b = _a.properties, properties = _b === void 0 ? [] : _b, _c = _a.attributes, attributes = _c === void 0 ? [] : _c, _d = _a.events, events = _d === void 0 ? [] : _d, _e = _a.childType, childType = _e === void 0 ? registerCustomElement_1.CustomElementChildType.DOJO : _e, _f = _a.registryFactory, registryFactory = _f === void 0 ? function () { return new Registry_1.default(); } : _f; - return function (target) { - target.prototype.__customElementDescriptor = { - tagName: tag, - attributes: attributes, - properties: properties, - events: events, - childType: childType, - registryFactory: registryFactory - }; - }; - } - exports.customElement = customElement; - exports.default = customElement; -}); -//# sourceMappingURL=customElement.js.map \ No newline at end of file diff --git a/deps/framework/widget-core/decorators/customElement.js.map b/deps/framework/widget-core/decorators/customElement.js.map deleted file mode 100644 index d3a4825953..0000000000 --- a/deps/framework/widget-core/decorators/customElement.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"customElement.js","sourceRoot":"","sources":["customElement.ts"],"names":[],"mappings":";;;;;;;;;;;IACA,kEAAkE;IAClE,wCAAmC;IAiCnC;;;OAGG;IACH,uBAA2E,EAOlD;YANxB,YAAG,EACH,kBAAe,EAAf,oCAAe,EACf,kBAAe,EAAf,oCAAe,EACf,cAAW,EAAX,gCAAW,EACX,iBAAuC,EAAvC,oFAAuC,EACvC,uBAAsC,EAAtC,uFAAsC;QAEtC,MAAM,CAAC,UAAqC,MAAS;YACpD,MAAM,CAAC,SAAS,CAAC,yBAAyB,GAAG;gBAC5C,OAAO,EAAE,GAAG;gBACZ,UAAU,YAAA;gBACV,UAAU,YAAA;gBACV,MAAM,QAAA;gBACN,SAAS,WAAA;gBACT,eAAe,iBAAA;aACf,CAAC;QACH,CAAC,CAAC;IACH,CAAC;IAlBD,sCAkBC;IAED,kBAAe,aAAa,CAAC","sourcesContent":["import { Constructor, WidgetProperties } from '../interfaces';\nimport { CustomElementChildType } from '../registerCustomElement';\nimport Registry from '../Registry';\n\nexport type CustomElementPropertyNames

= ((keyof P) | (keyof WidgetProperties))[];\n\n/**\n * Defines the custom element configuration used by the customElement decorator\n */\nexport interface CustomElementConfig

{\n\t/**\n\t * The tag of the custom element\n\t */\n\ttag: string;\n\n\t/**\n\t * List of widget properties to expose as properties on the custom element\n\t */\n\tproperties?: CustomElementPropertyNames

;\n\n\t/**\n\t * List of attributes on the custom element to map to widget properties\n\t */\n\tattributes?: CustomElementPropertyNames

;\n\n\t/**\n\t * List of events to expose\n\t */\n\tevents?: CustomElementPropertyNames

;\n\n\tchildType?: CustomElementChildType;\n\n\tregistryFactory?: () => Registry;\n}\n\n/**\n * This Decorator is provided properties that define the behavior of a custom element, and\n * registers that custom element.\n */\nexport function customElement

({\n\ttag,\n\tproperties = [],\n\tattributes = [],\n\tevents = [],\n\tchildType = CustomElementChildType.DOJO,\n\tregistryFactory = () => new Registry()\n}: CustomElementConfig

) {\n\treturn function>(target: T) {\n\t\ttarget.prototype.__customElementDescriptor = {\n\t\t\ttagName: tag,\n\t\t\tattributes,\n\t\t\tproperties,\n\t\t\tevents,\n\t\t\tchildType,\n\t\t\tregistryFactory\n\t\t};\n\t};\n}\n\nexport default customElement;\n"]} \ No newline at end of file diff --git a/deps/framework/widget-core/decorators/customElement.mjs b/deps/framework/widget-core/decorators/customElement.mjs deleted file mode 100644 index b1869cbdc0..0000000000 --- a/deps/framework/widget-core/decorators/customElement.mjs +++ /dev/null @@ -1,20 +0,0 @@ -import { CustomElementChildType } from '../registerCustomElement'; -import Registry from '../Registry'; -/** - * This Decorator is provided properties that define the behavior of a custom element, and - * registers that custom element. - */ -export function customElement({ tag, properties = [], attributes = [], events = [], childType = CustomElementChildType.DOJO, registryFactory = () => new Registry() }) { - return function (target) { - target.prototype.__customElementDescriptor = { - tagName: tag, - attributes, - properties, - events, - childType, - registryFactory - }; - }; -} -export default customElement; -//# sourceMappingURL=customElement.mjs.map \ No newline at end of file diff --git a/deps/framework/widget-core/decorators/customElement.mjs.map b/deps/framework/widget-core/decorators/customElement.mjs.map deleted file mode 100644 index 252a26547f..0000000000 --- a/deps/framework/widget-core/decorators/customElement.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"customElement.mjs","sourceRoot":"","sources":["customElement.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,QAAQ,MAAM,aAAa,CAAC;AAiCnC;;;GAGG;AACH,MAAM,wBAAqE,EAC1E,GAAG,EACH,UAAU,GAAG,EAAE,EACf,UAAU,GAAG,EAAE,EACf,MAAM,GAAG,EAAE,EACX,SAAS,GAAG,sBAAsB,CAAC,IAAI,EACvC,eAAe,GAAG,GAAG,EAAE,CAAC,IAAI,QAAQ,EAAE,EACd;IACxB,MAAM,CAAC,UAAqC,MAAS;QACpD,MAAM,CAAC,SAAS,CAAC,yBAAyB,GAAG;YAC5C,OAAO,EAAE,GAAG;YACZ,UAAU;YACV,UAAU;YACV,MAAM;YACN,SAAS;YACT,eAAe;SACf,CAAC;IACH,CAAC,CAAC;AACH,CAAC;AAED,eAAe,aAAa,CAAC","sourcesContent":["import { Constructor, WidgetProperties } from '../interfaces';\nimport { CustomElementChildType } from '../registerCustomElement';\nimport Registry from '../Registry';\n\nexport type CustomElementPropertyNames

= ((keyof P) | (keyof WidgetProperties))[];\n\n/**\n * Defines the custom element configuration used by the customElement decorator\n */\nexport interface CustomElementConfig

{\n\t/**\n\t * The tag of the custom element\n\t */\n\ttag: string;\n\n\t/**\n\t * List of widget properties to expose as properties on the custom element\n\t */\n\tproperties?: CustomElementPropertyNames

;\n\n\t/**\n\t * List of attributes on the custom element to map to widget properties\n\t */\n\tattributes?: CustomElementPropertyNames

;\n\n\t/**\n\t * List of events to expose\n\t */\n\tevents?: CustomElementPropertyNames

;\n\n\tchildType?: CustomElementChildType;\n\n\tregistryFactory?: () => Registry;\n}\n\n/**\n * This Decorator is provided properties that define the behavior of a custom element, and\n * registers that custom element.\n */\nexport function customElement

({\n\ttag,\n\tproperties = [],\n\tattributes = [],\n\tevents = [],\n\tchildType = CustomElementChildType.DOJO,\n\tregistryFactory = () => new Registry()\n}: CustomElementConfig

) {\n\treturn function>(target: T) {\n\t\ttarget.prototype.__customElementDescriptor = {\n\t\t\ttagName: tag,\n\t\t\tattributes,\n\t\t\tproperties,\n\t\t\tevents,\n\t\t\tchildType,\n\t\t\tregistryFactory\n\t\t};\n\t};\n}\n\nexport default customElement;\n"]} \ No newline at end of file diff --git a/deps/framework/widget-core/decorators/diffProperty.d.ts b/deps/framework/widget-core/decorators/diffProperty.d.ts deleted file mode 100644 index 03dc64c815..0000000000 --- a/deps/framework/widget-core/decorators/diffProperty.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { DiffPropertyFunction } from './../interfaces'; -/** - * Decorator that can be used to register a function as a specific property diff - * - * @param propertyName The name of the property of which the diff function is applied - * @param diffType The diff type, default is DiffType.AUTO. - * @param diffFunction A diff function to run if diffType if DiffType.CUSTOM - */ -export declare function diffProperty(propertyName: string, diffFunction?: DiffPropertyFunction, reactionFunction?: Function): (target: any, propertyKey?: string | undefined, descriptor?: PropertyDescriptor | undefined) => void; -export default diffProperty; diff --git a/deps/framework/widget-core/decorators/diffProperty.js b/deps/framework/widget-core/decorators/diffProperty.js deleted file mode 100644 index d836335aad..0000000000 --- a/deps/framework/widget-core/decorators/diffProperty.js +++ /dev/null @@ -1,37 +0,0 @@ -(function (factory) { - if (typeof module === "object" && typeof module.exports === "object") { - var v = factory(require, exports); - if (v !== undefined) module.exports = v; - } - else if (typeof define === "function" && define.amd) { - define(["require", "exports", "./handleDecorator", "./../diff"], factory); - } -})(function (require, exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - var handleDecorator_1 = require("./handleDecorator"); - var diff_1 = require("./../diff"); - /** - * Decorator that can be used to register a function as a specific property diff - * - * @param propertyName The name of the property of which the diff function is applied - * @param diffType The diff type, default is DiffType.AUTO. - * @param diffFunction A diff function to run if diffType if DiffType.CUSTOM - */ - function diffProperty(propertyName, diffFunction, reactionFunction) { - if (diffFunction === void 0) { diffFunction = diff_1.auto; } - return handleDecorator_1.handleDecorator(function (target, propertyKey) { - target.addDecorator("diffProperty:" + propertyName, diffFunction.bind(null)); - target.addDecorator('registeredDiffProperty', propertyName); - if (reactionFunction || propertyKey) { - target.addDecorator('diffReaction', { - propertyName: propertyName, - reaction: propertyKey ? target[propertyKey] : reactionFunction - }); - } - }); - } - exports.diffProperty = diffProperty; - exports.default = diffProperty; -}); -//# sourceMappingURL=diffProperty.js.map \ No newline at end of file diff --git a/deps/framework/widget-core/decorators/diffProperty.js.map b/deps/framework/widget-core/decorators/diffProperty.js.map deleted file mode 100644 index 7ab7d833a2..0000000000 --- a/deps/framework/widget-core/decorators/diffProperty.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"diffProperty.js","sourceRoot":"","sources":["diffProperty.ts"],"names":[],"mappings":";;;;;;;;;;;IAAA,qDAAoD;IAEpD,kCAAiC;IAEjC;;;;;;OAMG;IACH,sBACC,YAAoB,EACpB,YAAyC,EACzC,gBAA2B;QAD3B,6BAAA,EAAA,eAAqC,WAAI;QAGzC,MAAM,CAAC,iCAAe,CAAC,UAAC,MAAM,EAAE,WAAW;YAC1C,MAAM,CAAC,YAAY,CAAC,kBAAgB,YAAc,EAAE,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;YAC7E,MAAM,CAAC,YAAY,CAAC,wBAAwB,EAAE,YAAY,CAAC,CAAC;YAC5D,EAAE,CAAC,CAAC,gBAAgB,IAAI,WAAW,CAAC,CAAC,CAAC;gBACrC,MAAM,CAAC,YAAY,CAAC,cAAc,EAAE;oBACnC,YAAY,cAAA;oBACZ,QAAQ,EAAE,WAAW,CAAC,CAAC,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,gBAAgB;iBAC9D,CAAC,CAAC;YACJ,CAAC;QACF,CAAC,CAAC,CAAC;IACJ,CAAC;IAfD,oCAeC;IAED,kBAAe,YAAY,CAAC","sourcesContent":["import { handleDecorator } from './handleDecorator';\nimport { DiffPropertyFunction } from './../interfaces';\nimport { auto } from './../diff';\n\n/**\n * Decorator that can be used to register a function as a specific property diff\n *\n * @param propertyName The name of the property of which the diff function is applied\n * @param diffType The diff type, default is DiffType.AUTO.\n * @param diffFunction A diff function to run if diffType if DiffType.CUSTOM\n */\nexport function diffProperty(\n\tpropertyName: string,\n\tdiffFunction: DiffPropertyFunction = auto,\n\treactionFunction?: Function\n) {\n\treturn handleDecorator((target, propertyKey) => {\n\t\ttarget.addDecorator(`diffProperty:${propertyName}`, diffFunction.bind(null));\n\t\ttarget.addDecorator('registeredDiffProperty', propertyName);\n\t\tif (reactionFunction || propertyKey) {\n\t\t\ttarget.addDecorator('diffReaction', {\n\t\t\t\tpropertyName,\n\t\t\t\treaction: propertyKey ? target[propertyKey] : reactionFunction\n\t\t\t});\n\t\t}\n\t});\n}\n\nexport default diffProperty;\n"]} \ No newline at end of file diff --git a/deps/framework/widget-core/decorators/diffProperty.mjs b/deps/framework/widget-core/decorators/diffProperty.mjs deleted file mode 100644 index a018266d3f..0000000000 --- a/deps/framework/widget-core/decorators/diffProperty.mjs +++ /dev/null @@ -1,23 +0,0 @@ -import { handleDecorator } from './handleDecorator'; -import { auto } from './../diff'; -/** - * Decorator that can be used to register a function as a specific property diff - * - * @param propertyName The name of the property of which the diff function is applied - * @param diffType The diff type, default is DiffType.AUTO. - * @param diffFunction A diff function to run if diffType if DiffType.CUSTOM - */ -export function diffProperty(propertyName, diffFunction = auto, reactionFunction) { - return handleDecorator((target, propertyKey) => { - target.addDecorator(`diffProperty:${propertyName}`, diffFunction.bind(null)); - target.addDecorator('registeredDiffProperty', propertyName); - if (reactionFunction || propertyKey) { - target.addDecorator('diffReaction', { - propertyName, - reaction: propertyKey ? target[propertyKey] : reactionFunction - }); - } - }); -} -export default diffProperty; -//# sourceMappingURL=diffProperty.mjs.map \ No newline at end of file diff --git a/deps/framework/widget-core/decorators/diffProperty.mjs.map b/deps/framework/widget-core/decorators/diffProperty.mjs.map deleted file mode 100644 index 0adecf6d17..0000000000 --- a/deps/framework/widget-core/decorators/diffProperty.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"diffProperty.mjs","sourceRoot":"","sources":["diffProperty.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEpD,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC;;;;;;GAMG;AACH,MAAM,uBACL,YAAoB,EACpB,eAAqC,IAAI,EACzC,gBAA2B;IAE3B,MAAM,CAAC,eAAe,CAAC,CAAC,MAAM,EAAE,WAAW,EAAE,EAAE;QAC9C,MAAM,CAAC,YAAY,CAAC,gBAAgB,YAAY,EAAE,EAAE,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;QAC7E,MAAM,CAAC,YAAY,CAAC,wBAAwB,EAAE,YAAY,CAAC,CAAC;QAC5D,EAAE,CAAC,CAAC,gBAAgB,IAAI,WAAW,CAAC,CAAC,CAAC;YACrC,MAAM,CAAC,YAAY,CAAC,cAAc,EAAE;gBACnC,YAAY;gBACZ,QAAQ,EAAE,WAAW,CAAC,CAAC,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,gBAAgB;aAC9D,CAAC,CAAC;QACJ,CAAC;IACF,CAAC,CAAC,CAAC;AACJ,CAAC;AAED,eAAe,YAAY,CAAC","sourcesContent":["import { handleDecorator } from './handleDecorator';\nimport { DiffPropertyFunction } from './../interfaces';\nimport { auto } from './../diff';\n\n/**\n * Decorator that can be used to register a function as a specific property diff\n *\n * @param propertyName The name of the property of which the diff function is applied\n * @param diffType The diff type, default is DiffType.AUTO.\n * @param diffFunction A diff function to run if diffType if DiffType.CUSTOM\n */\nexport function diffProperty(\n\tpropertyName: string,\n\tdiffFunction: DiffPropertyFunction = auto,\n\treactionFunction?: Function\n) {\n\treturn handleDecorator((target, propertyKey) => {\n\t\ttarget.addDecorator(`diffProperty:${propertyName}`, diffFunction.bind(null));\n\t\ttarget.addDecorator('registeredDiffProperty', propertyName);\n\t\tif (reactionFunction || propertyKey) {\n\t\t\ttarget.addDecorator('diffReaction', {\n\t\t\t\tpropertyName,\n\t\t\t\treaction: propertyKey ? target[propertyKey] : reactionFunction\n\t\t\t});\n\t\t}\n\t});\n}\n\nexport default diffProperty;\n"]} \ No newline at end of file diff --git a/deps/framework/widget-core/decorators/handleDecorator.d.ts b/deps/framework/widget-core/decorators/handleDecorator.d.ts deleted file mode 100644 index 7a063e55ac..0000000000 --- a/deps/framework/widget-core/decorators/handleDecorator.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -export declare type DecoratorHandler = (target: any, propertyKey?: string) => void; -/** - * Generic decorator handler to take care of whether or not the decorator was called at the class level - * or the method level. - * - * @param handler - */ -export declare function handleDecorator(handler: DecoratorHandler): (target: any, propertyKey?: string | undefined, descriptor?: PropertyDescriptor | undefined) => void; -export default handleDecorator; diff --git a/deps/framework/widget-core/decorators/handleDecorator.js b/deps/framework/widget-core/decorators/handleDecorator.js deleted file mode 100644 index 7171fac370..0000000000 --- a/deps/framework/widget-core/decorators/handleDecorator.js +++ /dev/null @@ -1,31 +0,0 @@ -(function (factory) { - if (typeof module === "object" && typeof module.exports === "object") { - var v = factory(require, exports); - if (v !== undefined) module.exports = v; - } - else if (typeof define === "function" && define.amd) { - define(["require", "exports"], factory); - } -})(function (require, exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - /** - * Generic decorator handler to take care of whether or not the decorator was called at the class level - * or the method level. - * - * @param handler - */ - function handleDecorator(handler) { - return function (target, propertyKey, descriptor) { - if (typeof target === 'function') { - handler(target.prototype, undefined); - } - else { - handler(target, propertyKey); - } - }; - } - exports.handleDecorator = handleDecorator; - exports.default = handleDecorator; -}); -//# sourceMappingURL=handleDecorator.js.map \ No newline at end of file diff --git a/deps/framework/widget-core/decorators/handleDecorator.js.map b/deps/framework/widget-core/decorators/handleDecorator.js.map deleted file mode 100644 index 7ab8a572ed..0000000000 --- a/deps/framework/widget-core/decorators/handleDecorator.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"handleDecorator.js","sourceRoot":"","sources":["handleDecorator.ts"],"names":[],"mappings":";;;;;;;;;;;IAEA;;;;;OAKG;IACH,yBAAgC,OAAyB;QACxD,MAAM,CAAC,UAAS,MAAW,EAAE,WAAoB,EAAE,UAA+B;YACjF,EAAE,CAAC,CAAC,OAAO,MAAM,KAAK,UAAU,CAAC,CAAC,CAAC;gBAClC,OAAO,CAAC,MAAM,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC;YACtC,CAAC;YAAC,IAAI,CAAC,CAAC;gBACP,OAAO,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC;YAC9B,CAAC;QACF,CAAC,CAAC;IACH,CAAC;IARD,0CAQC;IAED,kBAAe,eAAe,CAAC","sourcesContent":["export type DecoratorHandler = (target: any, propertyKey?: string) => void;\n\n/**\n * Generic decorator handler to take care of whether or not the decorator was called at the class level\n * or the method level.\n *\n * @param handler\n */\nexport function handleDecorator(handler: DecoratorHandler) {\n\treturn function(target: any, propertyKey?: string, descriptor?: PropertyDescriptor) {\n\t\tif (typeof target === 'function') {\n\t\t\thandler(target.prototype, undefined);\n\t\t} else {\n\t\t\thandler(target, propertyKey);\n\t\t}\n\t};\n}\n\nexport default handleDecorator;\n"]} \ No newline at end of file diff --git a/deps/framework/widget-core/decorators/handleDecorator.mjs b/deps/framework/widget-core/decorators/handleDecorator.mjs deleted file mode 100644 index be96323592..0000000000 --- a/deps/framework/widget-core/decorators/handleDecorator.mjs +++ /dev/null @@ -1,18 +0,0 @@ -/** - * Generic decorator handler to take care of whether or not the decorator was called at the class level - * or the method level. - * - * @param handler - */ -export function handleDecorator(handler) { - return function (target, propertyKey, descriptor) { - if (typeof target === 'function') { - handler(target.prototype, undefined); - } - else { - handler(target, propertyKey); - } - }; -} -export default handleDecorator; -//# sourceMappingURL=handleDecorator.mjs.map \ No newline at end of file diff --git a/deps/framework/widget-core/decorators/handleDecorator.mjs.map b/deps/framework/widget-core/decorators/handleDecorator.mjs.map deleted file mode 100644 index d15a13fcb1..0000000000 --- a/deps/framework/widget-core/decorators/handleDecorator.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"handleDecorator.mjs","sourceRoot":"","sources":["handleDecorator.ts"],"names":[],"mappings":"AAEA;;;;;GAKG;AACH,MAAM,0BAA0B,OAAyB;IACxD,MAAM,CAAC,UAAS,MAAW,EAAE,WAAoB,EAAE,UAA+B;QACjF,EAAE,CAAC,CAAC,OAAO,MAAM,KAAK,UAAU,CAAC,CAAC,CAAC;YAClC,OAAO,CAAC,MAAM,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC;QACtC,CAAC;QAAC,IAAI,CAAC,CAAC;YACP,OAAO,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC;QAC9B,CAAC;IACF,CAAC,CAAC;AACH,CAAC;AAED,eAAe,eAAe,CAAC","sourcesContent":["export type DecoratorHandler = (target: any, propertyKey?: string) => void;\n\n/**\n * Generic decorator handler to take care of whether or not the decorator was called at the class level\n * or the method level.\n *\n * @param handler\n */\nexport function handleDecorator(handler: DecoratorHandler) {\n\treturn function(target: any, propertyKey?: string, descriptor?: PropertyDescriptor) {\n\t\tif (typeof target === 'function') {\n\t\t\thandler(target.prototype, undefined);\n\t\t} else {\n\t\t\thandler(target, propertyKey);\n\t\t}\n\t};\n}\n\nexport default handleDecorator;\n"]} \ No newline at end of file diff --git a/deps/framework/widget-core/decorators/inject.d.ts b/deps/framework/widget-core/decorators/inject.d.ts deleted file mode 100644 index 984990d15e..0000000000 --- a/deps/framework/widget-core/decorators/inject.d.ts +++ /dev/null @@ -1,31 +0,0 @@ -import { RegistryLabel } from './../interfaces'; -/** - * Defines the contract requires for the get properties function - * used to map the injected properties. - */ -export interface GetProperties { - (payload: any, properties: T): T; -} -/** - * Defines the inject configuration required for use of the `inject` decorator - */ -export interface InjectConfig { - /** - * The label of the registry injector - */ - name: RegistryLabel; - /** - * Function that returns propertues to inject using the passed properties - * and the injected payload. - */ - getProperties: GetProperties; -} -/** - * Decorator retrieves an injector from an available registry using the name and - * calls the `getProperties` function with the payload from the injector - * and current properties with the the injected properties returned. - * - * @param InjectConfig the inject configuration - */ -export declare function inject({name, getProperties}: InjectConfig): (target: any, propertyKey?: string | undefined, descriptor?: PropertyDescriptor | undefined) => void; -export default inject; diff --git a/deps/framework/widget-core/decorators/inject.js b/deps/framework/widget-core/decorators/inject.js deleted file mode 100644 index 9e4359831a..0000000000 --- a/deps/framework/widget-core/decorators/inject.js +++ /dev/null @@ -1,52 +0,0 @@ -(function (factory) { - if (typeof module === "object" && typeof module.exports === "object") { - var v = factory(require, exports); - if (v !== undefined) module.exports = v; - } - else if (typeof define === "function" && define.amd) { - define(["require", "exports", "../../shim/WeakMap", "./handleDecorator", "./beforeProperties"], factory); - } -})(function (require, exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - var WeakMap_1 = require("../../shim/WeakMap"); - var handleDecorator_1 = require("./handleDecorator"); - var beforeProperties_1 = require("./beforeProperties"); - /** - * Map of instances against registered injectors. - */ - var registeredInjectorsMap = new WeakMap_1.default(); - /** - * Decorator retrieves an injector from an available registry using the name and - * calls the `getProperties` function with the payload from the injector - * and current properties with the the injected properties returned. - * - * @param InjectConfig the inject configuration - */ - function inject(_a) { - var name = _a.name, getProperties = _a.getProperties; - return handleDecorator_1.handleDecorator(function (target, propertyKey) { - beforeProperties_1.beforeProperties(function (properties) { - var _this = this; - var injectorItem = this.registry.getInjector(name); - if (injectorItem) { - var injector = injectorItem.injector, invalidator = injectorItem.invalidator; - var registeredInjectors = registeredInjectorsMap.get(this) || []; - if (registeredInjectors.length === 0) { - registeredInjectorsMap.set(this, registeredInjectors); - } - if (registeredInjectors.indexOf(injectorItem) === -1) { - this.own(invalidator.on('invalidate', function () { - _this.invalidate(); - })); - registeredInjectors.push(injectorItem); - } - return getProperties(injector(), properties); - } - })(target); - }); - } - exports.inject = inject; - exports.default = inject; -}); -//# sourceMappingURL=inject.js.map \ No newline at end of file diff --git a/deps/framework/widget-core/decorators/inject.js.map b/deps/framework/widget-core/decorators/inject.js.map deleted file mode 100644 index e770b8b6c3..0000000000 --- a/deps/framework/widget-core/decorators/inject.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"inject.js","sourceRoot":"","sources":["inject.ts"],"names":[],"mappings":";;;;;;;;;;;IAAA,8CAAyC;IAEzC,qDAAoD;IACpD,uDAAsD;IAGtD;;OAEG;IACH,IAAM,sBAAsB,GAAwC,IAAI,iBAAO,EAAE,CAAC;IA0BlF;;;;;;OAMG;IACH,gBAAuB,EAAqC;YAAnC,cAAI,EAAE,gCAAa;QAC3C,MAAM,CAAC,iCAAe,CAAC,UAAC,MAAM,EAAE,WAAW;YAC1C,mCAAgB,CAAC,UAA+C,UAAe;gBAA9D,iBAkBhB;gBAjBA,IAAM,YAAY,GAAG,IAAI,CAAC,QAAQ,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;gBACrD,EAAE,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC;oBACV,IAAA,gCAAQ,EAAE,sCAAW,CAAkB;oBAC/C,IAAM,mBAAmB,GAAG,sBAAsB,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC;oBACnE,EAAE,CAAC,CAAC,mBAAmB,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC;wBACtC,sBAAsB,CAAC,GAAG,CAAC,IAAI,EAAE,mBAAmB,CAAC,CAAC;oBACvD,CAAC;oBACD,EAAE,CAAC,CAAC,mBAAmB,CAAC,OAAO,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;wBACtD,IAAI,CAAC,GAAG,CACP,WAAW,CAAC,EAAE,CAAC,YAAY,EAAE;4BAC5B,KAAI,CAAC,UAAU,EAAE,CAAC;wBACnB,CAAC,CAAC,CACF,CAAC;wBACF,mBAAmB,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;oBACxC,CAAC;oBACD,MAAM,CAAC,aAAa,CAAC,QAAQ,EAAE,EAAE,UAAU,CAAC,CAAC;gBAC9C,CAAC;YACF,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC;QACZ,CAAC,CAAC,CAAC;IACJ,CAAC;IAtBD,wBAsBC;IAED,kBAAe,MAAM,CAAC","sourcesContent":["import WeakMap from '../../shim/WeakMap';\nimport { WidgetBase } from './../WidgetBase';\nimport { handleDecorator } from './handleDecorator';\nimport { beforeProperties } from './beforeProperties';\nimport { InjectorItem, RegistryLabel } from './../interfaces';\n\n/**\n * Map of instances against registered injectors.\n */\nconst registeredInjectorsMap: WeakMap = new WeakMap();\n\n/**\n * Defines the contract requires for the get properties function\n * used to map the injected properties.\n */\nexport interface GetProperties {\n\t(payload: any, properties: T): T;\n}\n\n/**\n * Defines the inject configuration required for use of the `inject` decorator\n */\nexport interface InjectConfig {\n\t/**\n\t * The label of the registry injector\n\t */\n\tname: RegistryLabel;\n\n\t/**\n\t * Function that returns propertues to inject using the passed properties\n\t * and the injected payload.\n\t */\n\tgetProperties: GetProperties;\n}\n\n/**\n * Decorator retrieves an injector from an available registry using the name and\n * calls the `getProperties` function with the payload from the injector\n * and current properties with the the injected properties returned.\n *\n * @param InjectConfig the inject configuration\n */\nexport function inject({ name, getProperties }: InjectConfig) {\n\treturn handleDecorator((target, propertyKey) => {\n\t\tbeforeProperties(function(this: WidgetBase & { own: Function }, properties: any) {\n\t\t\tconst injectorItem = this.registry.getInjector(name);\n\t\t\tif (injectorItem) {\n\t\t\t\tconst { injector, invalidator } = injectorItem;\n\t\t\t\tconst registeredInjectors = registeredInjectorsMap.get(this) || [];\n\t\t\t\tif (registeredInjectors.length === 0) {\n\t\t\t\t\tregisteredInjectorsMap.set(this, registeredInjectors);\n\t\t\t\t}\n\t\t\t\tif (registeredInjectors.indexOf(injectorItem) === -1) {\n\t\t\t\t\tthis.own(\n\t\t\t\t\t\tinvalidator.on('invalidate', () => {\n\t\t\t\t\t\t\tthis.invalidate();\n\t\t\t\t\t\t})\n\t\t\t\t\t);\n\t\t\t\t\tregisteredInjectors.push(injectorItem);\n\t\t\t\t}\n\t\t\t\treturn getProperties(injector(), properties);\n\t\t\t}\n\t\t})(target);\n\t});\n}\n\nexport default inject;\n"]} \ No newline at end of file diff --git a/deps/framework/widget-core/decorators/inject.mjs b/deps/framework/widget-core/decorators/inject.mjs deleted file mode 100644 index bb6b420a2c..0000000000 --- a/deps/framework/widget-core/decorators/inject.mjs +++ /dev/null @@ -1,37 +0,0 @@ -import WeakMap from '../../shim/WeakMap'; -import { handleDecorator } from './handleDecorator'; -import { beforeProperties } from './beforeProperties'; -/** - * Map of instances against registered injectors. - */ -const registeredInjectorsMap = new WeakMap(); -/** - * Decorator retrieves an injector from an available registry using the name and - * calls the `getProperties` function with the payload from the injector - * and current properties with the the injected properties returned. - * - * @param InjectConfig the inject configuration - */ -export function inject({ name, getProperties }) { - return handleDecorator((target, propertyKey) => { - beforeProperties(function (properties) { - const injectorItem = this.registry.getInjector(name); - if (injectorItem) { - const { injector, invalidator } = injectorItem; - const registeredInjectors = registeredInjectorsMap.get(this) || []; - if (registeredInjectors.length === 0) { - registeredInjectorsMap.set(this, registeredInjectors); - } - if (registeredInjectors.indexOf(injectorItem) === -1) { - this.own(invalidator.on('invalidate', () => { - this.invalidate(); - })); - registeredInjectors.push(injectorItem); - } - return getProperties(injector(), properties); - } - })(target); - }); -} -export default inject; -//# sourceMappingURL=inject.mjs.map \ No newline at end of file diff --git a/deps/framework/widget-core/decorators/inject.mjs.map b/deps/framework/widget-core/decorators/inject.mjs.map deleted file mode 100644 index a973272075..0000000000 --- a/deps/framework/widget-core/decorators/inject.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"inject.mjs","sourceRoot":"","sources":["inject.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,oBAAoB,CAAC;AAEzC,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC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} from './handleDecorator';\nimport { beforeProperties } from './beforeProperties';\nimport { InjectorItem, RegistryLabel } from './../interfaces';\n\n/**\n * Map of instances against registered injectors.\n */\nconst registeredInjectorsMap: WeakMap = new WeakMap();\n\n/**\n * Defines the contract requires for the get properties function\n * used to map the injected properties.\n */\nexport interface GetProperties {\n\t(payload: any, properties: T): T;\n}\n\n/**\n * Defines the inject configuration required for use of the `inject` decorator\n */\nexport interface InjectConfig {\n\t/**\n\t * The label of the registry injector\n\t */\n\tname: RegistryLabel;\n\n\t/**\n\t * Function that returns propertues to inject using the passed properties\n\t * and the injected payload.\n\t */\n\tgetProperties: GetProperties;\n}\n\n/**\n * Decorator retrieves an injector from an available registry using the name and\n * calls the `getProperties` function with the payload from the injector\n * and current properties with the the injected properties returned.\n *\n * @param InjectConfig the inject configuration\n */\nexport function inject({ name, getProperties }: InjectConfig) {\n\treturn handleDecorator((target, propertyKey) => {\n\t\tbeforeProperties(function(this: WidgetBase & { own: Function }, properties: any) {\n\t\t\tconst injectorItem = this.registry.getInjector(name);\n\t\t\tif (injectorItem) {\n\t\t\t\tconst { injector, invalidator } = injectorItem;\n\t\t\t\tconst registeredInjectors = registeredInjectorsMap.get(this) || [];\n\t\t\t\tif (registeredInjectors.length === 0) {\n\t\t\t\t\tregisteredInjectorsMap.set(this, registeredInjectors);\n\t\t\t\t}\n\t\t\t\tif (registeredInjectors.indexOf(injectorItem) === -1) {\n\t\t\t\t\tthis.own(\n\t\t\t\t\t\tinvalidator.on('invalidate', () => {\n\t\t\t\t\t\t\tthis.invalidate();\n\t\t\t\t\t\t})\n\t\t\t\t\t);\n\t\t\t\t\tregisteredInjectors.push(injectorItem);\n\t\t\t\t}\n\t\t\t\treturn getProperties(injector(), properties);\n\t\t\t}\n\t\t})(target);\n\t});\n}\n\nexport default inject;\n"]} \ No newline at end of file diff --git a/deps/framework/widget-core/decorators/registry.d.ts b/deps/framework/widget-core/decorators/registry.d.ts deleted file mode 100644 index 9b2265ff34..0000000000 --- a/deps/framework/widget-core/decorators/registry.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { DecoratorHandler } from './handleDecorator'; -import { RegistryItem } from '../Registry'; -export interface RegistryConfig { - [name: string]: RegistryItem; -} -/** - * Decorator that can be used to register a widget with the calling widgets local registry - */ -export declare function registry(nameOrConfig: string, loader: RegistryItem): DecoratorHandler; -export declare function registry(nameOrConfig: RegistryConfig): DecoratorHandler; -export default registry; diff --git a/deps/framework/widget-core/decorators/registry.js b/deps/framework/widget-core/decorators/registry.js deleted file mode 100644 index 7e969b4115..0000000000 --- a/deps/framework/widget-core/decorators/registry.js +++ /dev/null @@ -1,31 +0,0 @@ -(function (factory) { - if (typeof module === "object" && typeof module.exports === "object") { - var v = factory(require, exports); - if (v !== undefined) module.exports = v; - } - else if (typeof define === "function" && define.amd) { - define(["require", "exports", "./handleDecorator"], factory); - } -})(function (require, exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - var handleDecorator_1 = require("./handleDecorator"); - function registry(nameOrConfig, loader) { - return handleDecorator_1.handleDecorator(function (target, propertyKey) { - target.addDecorator('afterConstructor', function () { - var _this = this; - if (typeof nameOrConfig === 'string') { - this.registry.define(nameOrConfig, loader); - } - else { - Object.keys(nameOrConfig).forEach(function (name) { - _this.registry.define(name, nameOrConfig[name]); - }); - } - }); - }); - } - exports.registry = registry; - exports.default = registry; -}); -//# sourceMappingURL=registry.js.map \ No newline at end of file diff --git a/deps/framework/widget-core/decorators/registry.js.map b/deps/framework/widget-core/decorators/registry.js.map deleted file mode 100644 index 25e831c066..0000000000 --- a/deps/framework/widget-core/decorators/registry.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"registry.js","sourceRoot":"","sources":["registry.ts"],"names":[],"mappings":";;;;;;;;;;;IAAA,qDAAsE;IAYtE,kBAAyB,YAAqC,EAAE,MAAqB;QACpF,MAAM,CAAC,iCAAe,CAAC,UAAC,MAAM,EAAE,WAAW;YAC1C,MAAM,CAAC,YAAY,CAAC,kBAAkB,EAAE;gBAAA,iBAQvC;gBAPA,EAAE,CAAC,CAAC,OAAO,YAAY,KAAK,QAAQ,CAAC,CAAC,CAAC;oBACtC,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,YAAY,EAAE,MAAM,CAAC,CAAC;gBAC5C,CAAC;gBAAC,IAAI,CAAC,CAAC;oBACP,MAAM,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,OAAO,CAAC,UAAC,IAAI;wBACtC,KAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,EAAE,YAAY,CAAC,IAAI,CAAC,CAAC,CAAC;oBAChD,CAAC,CAAC,CAAC;gBACJ,CAAC;YACF,CAAC,CAAC,CAAC;QACJ,CAAC,CAAC,CAAC;IACJ,CAAC;IAZD,4BAYC;IAED,kBAAe,QAAQ,CAAC","sourcesContent":["import { handleDecorator, DecoratorHandler } from './handleDecorator';\nimport { RegistryItem } from '../Registry';\n\nexport interface RegistryConfig {\n\t[name: string]: RegistryItem;\n}\n\n/**\n * Decorator that can be used to register a widget with the calling widgets local registry\n */\nexport function registry(nameOrConfig: string, loader: RegistryItem): DecoratorHandler;\nexport function registry(nameOrConfig: RegistryConfig): DecoratorHandler;\nexport function registry(nameOrConfig: string | RegistryConfig, loader?: RegistryItem) {\n\treturn handleDecorator((target, propertyKey) => {\n\t\ttarget.addDecorator('afterConstructor', function(this: any) {\n\t\t\tif (typeof nameOrConfig === 'string') {\n\t\t\t\tthis.registry.define(nameOrConfig, loader);\n\t\t\t} else {\n\t\t\t\tObject.keys(nameOrConfig).forEach((name) => {\n\t\t\t\t\tthis.registry.define(name, nameOrConfig[name]);\n\t\t\t\t});\n\t\t\t}\n\t\t});\n\t});\n}\n\nexport default registry;\n"]} \ No newline at end of file diff --git a/deps/framework/widget-core/decorators/registry.mjs b/deps/framework/widget-core/decorators/registry.mjs deleted file mode 100644 index bf491af0f6..0000000000 --- a/deps/framework/widget-core/decorators/registry.mjs +++ /dev/null @@ -1,17 +0,0 @@ -import { handleDecorator } from './handleDecorator'; -export function registry(nameOrConfig, loader) { - return handleDecorator((target, propertyKey) => { - target.addDecorator('afterConstructor', function () { - if (typeof nameOrConfig === 'string') { - this.registry.define(nameOrConfig, loader); - } - else { - Object.keys(nameOrConfig).forEach((name) => { - this.registry.define(name, nameOrConfig[name]); - }); - } - }); - }); -} -export default registry; -//# sourceMappingURL=registry.mjs.map \ No newline at end of file diff --git a/deps/framework/widget-core/decorators/registry.mjs.map b/deps/framework/widget-core/decorators/registry.mjs.map deleted file mode 100644 index a6d3f298e7..0000000000 --- a/deps/framework/widget-core/decorators/registry.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"registry.mjs","sourceRoot":"","sources":["registry.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAoB,MAAM,mBAAmB,CAAC;AAYtE,MAAM,mBAAmB,YAAqC,EAAE,MAAqB;IACpF,MAAM,CAAC,eAAe,CAAC,CAAC,MAAM,EAAE,WAAW,EAAE,EAAE;QAC9C,MAAM,CAAC,YAAY,CAAC,kBAAkB,EAAE;YACvC,EAAE,CAAC,CAAC,OAAO,YAAY,KAAK,QAAQ,CAAC,CAAC,CAAC;gBACtC,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,YAAY,EAAE,MAAM,CAAC,CAAC;YAC5C,CAAC;YAAC,IAAI,CAAC,CAAC;gBACP,MAAM,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE;oBAC1C,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,EAAE,YAAY,CAAC,IAAI,CAAC,CAAC,CAAC;gBAChD,CAAC,CAAC,CAAC;YACJ,CAAC;QACF,CAAC,CAAC,CAAC;IACJ,CAAC,CAAC,CAAC;AACJ,CAAC;AAED,eAAe,QAAQ,CAAC","sourcesContent":["import { handleDecorator, DecoratorHandler } from './handleDecorator';\nimport { RegistryItem } from '../Registry';\n\nexport interface RegistryConfig {\n\t[name: string]: RegistryItem;\n}\n\n/**\n * Decorator that can be used to register a widget with the calling widgets local registry\n */\nexport function registry(nameOrConfig: string, loader: RegistryItem): DecoratorHandler;\nexport function registry(nameOrConfig: RegistryConfig): DecoratorHandler;\nexport function registry(nameOrConfig: string | RegistryConfig, loader?: RegistryItem) {\n\treturn handleDecorator((target, propertyKey) => {\n\t\ttarget.addDecorator('afterConstructor', function(this: any) {\n\t\t\tif (typeof nameOrConfig === 'string') {\n\t\t\t\tthis.registry.define(nameOrConfig, loader);\n\t\t\t} else {\n\t\t\t\tObject.keys(nameOrConfig).forEach((name) => {\n\t\t\t\t\tthis.registry.define(name, nameOrConfig[name]);\n\t\t\t\t});\n\t\t\t}\n\t\t});\n\t});\n}\n\nexport default registry;\n"]} \ No newline at end of file diff --git a/deps/framework/widget-core/diff.d.ts b/deps/framework/widget-core/diff.d.ts deleted file mode 100644 index ece0ad5187..0000000000 --- a/deps/framework/widget-core/diff.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { PropertyChangeRecord } from './interfaces'; -export declare function always(previousProperty: any, newProperty: any): PropertyChangeRecord; -export declare function ignore(previousProperty: any, newProperty: any): PropertyChangeRecord; -export declare function reference(previousProperty: any, newProperty: any): PropertyChangeRecord; -export declare function shallow(previousProperty: any, newProperty: any): PropertyChangeRecord; -export declare function auto(previousProperty: any, newProperty: any): PropertyChangeRecord; diff --git a/deps/framework/widget-core/diff.js b/deps/framework/widget-core/diff.js deleted file mode 100644 index 065ab6c3a5..0000000000 --- a/deps/framework/widget-core/diff.js +++ /dev/null @@ -1,83 +0,0 @@ -(function (factory) { - if (typeof module === "object" && typeof module.exports === "object") { - var v = factory(require, exports); - if (v !== undefined) module.exports = v; - } - else if (typeof define === "function" && define.amd) { - define(["require", "exports", "./Registry"], factory); - } -})(function (require, exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - var Registry_1 = require("./Registry"); - function isObjectOrArray(value) { - return Object.prototype.toString.call(value) === '[object Object]' || Array.isArray(value); - } - function always(previousProperty, newProperty) { - return { - changed: true, - value: newProperty - }; - } - exports.always = always; - function ignore(previousProperty, newProperty) { - return { - changed: false, - value: newProperty - }; - } - exports.ignore = ignore; - function reference(previousProperty, newProperty) { - return { - changed: previousProperty !== newProperty, - value: newProperty - }; - } - exports.reference = reference; - function shallow(previousProperty, newProperty) { - var changed = false; - var validOldProperty = previousProperty && isObjectOrArray(previousProperty); - var validNewProperty = newProperty && isObjectOrArray(newProperty); - if (!validOldProperty || !validNewProperty) { - return { - changed: true, - value: newProperty - }; - } - var previousKeys = Object.keys(previousProperty); - var newKeys = Object.keys(newProperty); - if (previousKeys.length !== newKeys.length) { - changed = true; - } - else { - changed = newKeys.some(function (key) { - return newProperty[key] !== previousProperty[key]; - }); - } - return { - changed: changed, - value: newProperty - }; - } - exports.shallow = shallow; - function auto(previousProperty, newProperty) { - var result; - if (typeof newProperty === 'function') { - if (newProperty._type === Registry_1.WIDGET_BASE_TYPE) { - result = reference(previousProperty, newProperty); - } - else { - result = ignore(previousProperty, newProperty); - } - } - else if (isObjectOrArray(newProperty)) { - result = shallow(previousProperty, newProperty); - } - else { - result = reference(previousProperty, newProperty); - } - return result; - } - exports.auto = auto; -}); -//# sourceMappingURL=diff.js.map \ No newline at end of file diff --git a/deps/framework/widget-core/diff.js.map b/deps/framework/widget-core/diff.js.map deleted file mode 100644 index 9e97e711c5..0000000000 --- a/deps/framework/widget-core/diff.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"diff.js","sourceRoot":"","sources":["diff.ts"],"names":[],"mappings":";;;;;;;;;;;IACA,uCAA8C;IAE9C,yBAAyB,KAAU;QAClC,MAAM,CAAC,MAAM,CAAC,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,iBAAiB,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;IAC5F,CAAC;IAED,gBAAuB,gBAAqB,EAAE,WAAgB;QAC7D,MAAM,CAA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AAO,SAAA;YACP,KAAK,EAAE,WAAW;SAClB,CAAC;IACH,CAAC;IA3BD,0BA2BC;IAED,cAAqB,gBAAqB,EAAE,WAAgB;QAC3D,IAAI,MAAM,CAAC;QACX,EAAE,CAAC,CAAC,OAAO,WAAW,KAAK,UAAU,CAAC,CAAC,CAAC;YACvC,EAAE,CAAC,CAAC,WAAW,CAAC,KAAK,KAAK,2BAAgB,CAAC,CAAC,CAAC;gBAC5C,MAAM,GAAG,SAAS,CAAC,gBAAgB,EAAE,WAAW,CAAC,CAAC;YACnD,CAAC;YAAC,IAAI,CAAC,CAAC;gBACP,MAAM,GAAG,MAAM,CAAC,gBAAgB,EAAE,WAAW,CAAC,CAAC;YAChD,CAAC;QACF,CAAC;QAAC,IAAI,CAAC,EAAE,CAAC,CAAC,eAAe,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC;YACzC,MAAM,GAAG,OAAO,CAAC,gBAAgB,EAAE,WAAW,CAAC,CAAC;QACjD,CAAC;QAAC,IAAI,CAAC,CAAC;YACP,MAAM,GAAG,SAAS,CAAC,gBAAgB,EAAE,WAAW,CAAC,CAAC;QACnD,CAAC;QACD,MAAM,CAAC,MAAM,CAAC;IACf,CAAC;IAdD,oBAcC","sourcesContent":["import { PropertyChangeRecord } from './interfaces';\nimport { WIDGET_BASE_TYPE } from './Registry';\n\nfunction isObjectOrArray(value: any): boolean {\n\treturn Object.prototype.toString.call(value) === '[object Object]' || Array.isArray(value);\n}\n\nexport function always(previousProperty: any, newProperty: any): PropertyChangeRecord {\n\treturn {\n\t\tchanged: true,\n\t\tvalue: newProperty\n\t};\n}\n\nexport function ignore(previousProperty: any, newProperty: any): PropertyChangeRecord {\n\treturn {\n\t\tchanged: false,\n\t\tvalue: newProperty\n\t};\n}\n\nexport function reference(previousProperty: any, newProperty: any): PropertyChangeRecord {\n\treturn {\n\t\tchanged: previousProperty !== newProperty,\n\t\tvalue: newProperty\n\t};\n}\n\nexport function shallow(previousProperty: any, newProperty: any): PropertyChangeRecord {\n\tlet changed = false;\n\n\tconst validOldProperty = previousProperty && isObjectOrArray(previousProperty);\n\tconst validNewProperty = newProperty && isObjectOrArray(newProperty);\n\n\tif (!validOldProperty || !validNewProperty) {\n\t\treturn {\n\t\t\tchanged: true,\n\t\t\tvalue: newProperty\n\t\t};\n\t}\n\n\tconst previousKeys = Object.keys(previousProperty);\n\tconst newKeys = Object.keys(newProperty);\n\n\tif (previousKeys.length !== newKeys.length) {\n\t\tchanged = true;\n\t} else {\n\t\tchanged = newKeys.some((key) => {\n\t\t\treturn newProperty[key] !== previousProperty[key];\n\t\t});\n\t}\n\treturn {\n\t\tchanged,\n\t\tvalue: newProperty\n\t};\n}\n\nexport function auto(previousProperty: any, newProperty: any): PropertyChangeRecord {\n\tlet result;\n\tif (typeof newProperty === 'function') {\n\t\tif (newProperty._type === WIDGET_BASE_TYPE) {\n\t\t\tresult = reference(previousProperty, newProperty);\n\t\t} else {\n\t\t\tresult = ignore(previousProperty, newProperty);\n\t\t}\n\t} else if (isObjectOrArray(newProperty)) {\n\t\tresult = shallow(previousProperty, newProperty);\n\t} else {\n\t\tresult = reference(previousProperty, newProperty);\n\t}\n\treturn result;\n}\n"]} \ No newline at end of file diff --git a/deps/framework/widget-core/diff.mjs b/deps/framework/widget-core/diff.mjs deleted file mode 100644 index 05cbdd2c35..0000000000 --- a/deps/framework/widget-core/diff.mjs +++ /dev/null @@ -1,66 +0,0 @@ -import { WIDGET_BASE_TYPE } from './Registry'; -function isObjectOrArray(value) { - return Object.prototype.toString.call(value) === '[object Object]' || Array.isArray(value); -} -export function always(previousProperty, newProperty) { - return { - changed: true, - value: newProperty - }; -} -export function ignore(previousProperty, newProperty) { - return { - changed: false, - value: newProperty - }; -} -export function reference(previousProperty, newProperty) { - return { - changed: previousProperty !== newProperty, - value: newProperty - }; -} -export function shallow(previousProperty, newProperty) { - let changed = false; - const validOldProperty = previousProperty && isObjectOrArray(previousProperty); - const validNewProperty = newProperty && isObjectOrArray(newProperty); - if (!validOldProperty || !validNewProperty) { - return { - changed: true, - value: newProperty - }; - } - const previousKeys = Object.keys(previousProperty); - const newKeys = Object.keys(newProperty); - if (previousKeys.length !== newKeys.length) { - changed = true; - } - else { - changed = newKeys.some((key) => { - return newProperty[key] !== previousProperty[key]; - }); - } - return { - changed, - value: newProperty - }; -} -export function auto(previousProperty, newProperty) { - let result; - if (typeof newProperty === 'function') { - if (newProperty._type === WIDGET_BASE_TYPE) { - result = reference(previousProperty, newProperty); - } - else { - result = ignore(previousProperty, newProperty); - } - } - else if (isObjectOrArray(newProperty)) { - result = shallow(previousProperty, newProperty); - } - else { - result = reference(previousProperty, newProperty); - } - return result; -} -//# sourceMappingURL=diff.mjs.map \ No newline at end of file diff --git a/deps/framework/widget-core/diff.mjs.map b/deps/framework/widget-core/diff.mjs.map deleted file mode 100644 index 6f5cb6dc5a..0000000000 --- a/deps/framework/widget-core/diff.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"diff.mjs","sourceRoot":"","sources":["diff.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAE9C,yBAAyB,KAAU;IAClC,MAAM,CAAC,MAAM,CAAC,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,iBAAiB,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;AAC5F,CAAC;AAED,MAAM,iBAAiB,gBAAqB,EAAE,WAAgB;IAC7D,MAAM,CAAC;QACN,OAAO,EAAE,IAAI;QACb,KAAK,EAAE,WAAW;KAClB,CAAC;AACH,CAAC;AAED,MAAM,iBAAiB,gBAAqB,EAAE,WAAgB;IAC7D,MAAM,CAAC;QACN,OAAO,EAAE,KAAK;QACd,KAAK,EAAE,WAAW;KAClB,CAAC;AACH,CAAC;AAED,MAAM,oBAAoB,gBAAqB,EAAE,WAAgB;IAChE,MAAM,CAAC;QACN,OAAO,EAAE,gBAAgB,KAAK,WAAW;QACzC,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CAAC;QACnD,CAAC;QAAC,IAAI,CAAC,CAAC;YACP,MAAM,GAAG,MAAM,CAAC,gBAAgB,EAAE,WAAW,CAAC,CAAC;QAChD,CAAC;IACF,CAAC;IAAC,IAAI,CAAC,EAAE,CAAC,CAAC,eAAe,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC;QACzC,MAAM,GAAG,OAAO,CAAC,gBAAgB,EAAE,WAAW,CAAC,CAAC;IACjD,CAAC;IAAC,IAAI,CAAC,CAAC;QACP,MAAM,GAAG,SAAS,CAAC,gBAAgB,EAAE,WAAW,CAAC,CAAC;IACnD,CAAC;IACD,MAAM,CAAC,MAAM,CAAC;AACf,CAAC","sourcesContent":["import { PropertyChangeRecord } from './interfaces';\nimport { WIDGET_BASE_TYPE } from './Registry';\n\nfunction isObjectOrArray(value: any): boolean {\n\treturn Object.prototype.toString.call(value) === '[object Object]' || Array.isArray(value);\n}\n\nexport function always(previousProperty: any, newProperty: any): PropertyChangeRecord {\n\treturn {\n\t\tchanged: true,\n\t\tvalue: newProperty\n\t};\n}\n\nexport function ignore(previousProperty: any, newProperty: any): PropertyChangeRecord {\n\treturn {\n\t\tchanged: false,\n\t\tvalue: newProperty\n\t};\n}\n\nexport function reference(previousProperty: any, newProperty: any): PropertyChangeRecord {\n\treturn {\n\t\tchanged: previousProperty !== newProperty,\n\t\tvalue: newProperty\n\t};\n}\n\nexport function shallow(previousProperty: any, newProperty: any): PropertyChangeRecord {\n\tlet changed = false;\n\n\tconst validOldProperty = previousProperty && isObjectOrArray(previousProperty);\n\tconst validNewProperty = newProperty && isObjectOrArray(newProperty);\n\n\tif (!validOldProperty || !validNewProperty) {\n\t\treturn {\n\t\t\tchanged: true,\n\t\t\tvalue: newProperty\n\t\t};\n\t}\n\n\tconst previousKeys = Object.keys(previousProperty);\n\tconst newKeys = Object.keys(newProperty);\n\n\tif (previousKeys.length !== newKeys.length) {\n\t\tchanged = true;\n\t} else {\n\t\tchanged = newKeys.some((key) => {\n\t\t\treturn newProperty[key] !== previousProperty[key];\n\t\t});\n\t}\n\treturn {\n\t\tchanged,\n\t\tvalue: newProperty\n\t};\n}\n\nexport function auto(previousProperty: any, newProperty: any): PropertyChangeRecord {\n\tlet result;\n\tif (typeof newProperty === 'function') {\n\t\tif (newProperty._type === WIDGET_BASE_TYPE) {\n\t\t\tresult = reference(previousProperty, newProperty);\n\t\t} else {\n\t\t\tresult = ignore(previousProperty, newProperty);\n\t\t}\n\t} else if (isObjectOrArray(newProperty)) {\n\t\tresult = shallow(previousProperty, newProperty);\n\t} else {\n\t\tresult = reference(previousProperty, newProperty);\n\t}\n\treturn result;\n}\n"]} \ No newline at end of file diff --git a/deps/framework/widget-core/interfaces.d.ts b/deps/framework/widget-core/interfaces.d.ts deleted file mode 100644 index 092cf4a4ff..0000000000 --- a/deps/framework/widget-core/interfaces.d.ts +++ /dev/null @@ -1,509 +0,0 @@ -import { Destroyable } from '../core/Destroyable'; -import { Evented } from '../core/Evented'; -import { EventObject, EventType } from '../core/interfaces'; -import Map from '../shim/Map'; -import WeakMap from '../shim/WeakMap'; - -/** - * Generic constructor type - */ -export type Constructor = new (...args: any[]) => T; - -/** - * Typed target event - */ -export interface TypedTargetEvent extends EventObject { - target: T; -} - -/* - These are the event handlers. - */ -export type EventHandlerResult = boolean | void; - -export interface EventHandler { - (event?: Event): EventHandlerResult; -} - -export interface FocusEventHandler { - (event?: FocusEvent): EventHandlerResult; -} - -export interface KeyboardEventHandler { - (event?: KeyboardEvent): EventHandlerResult; -} - -export interface MouseEventHandler { - (event?: MouseEvent): EventHandlerResult; -} - -export type BlurEventHandler = FocusEventHandler; -export type ChangeEventHandler = EventHandler; -export type ClickEventHandler = MouseEventHandler; -export type DoubleClickEventHandler = MouseEventHandler; -export type InputEventHandler = EventHandler; -export type KeyDownEventHandler = KeyboardEventHandler; -export type KeyPressEventHandler = KeyboardEventHandler; -export type KeyUpEventHandler = KeyboardEventHandler; -export type LoadEventHandler = EventHandler; -export type MouseDownEventHandler = MouseEventHandler; -export type MouseEnterEventHandler = MouseEventHandler; -export type MouseLeaveEventHandler = MouseEventHandler; -export type MouseMoveEventHandler = MouseEventHandler; -export type MouseOutEventHandler = MouseEventHandler; -export type MouseOverEventHandler = MouseEventHandler; -export type MouseUpEventHandler = MouseEventHandler; -export type MouseWheelEventHandler = (event?: MouseWheelEvent | WheelEvent) => EventHandlerResult; -export type ScrollEventHandler = (event?: UIEvent) => EventHandlerResult; -export type SubmitEventHandler = EventHandler; - -export interface TransitionStrategy { - enter(element: Element, properties: VNodeProperties, enterAnimation: string): void; - exit(element: Element, properties: VNodeProperties, exitAnimation: string, removeElement: () => void): void; -} - -export interface ProjectorOptions { - readonly transitions?: TransitionStrategy; - styleApplyer?(domNode: HTMLElement, styleName: string, value: string): void; -} - -export interface ProjectionOptions extends ProjectorOptions { - namespace?: string; - merge: boolean; - sync: boolean; - mergeElement?: Element; - rootNode: Element; - depth: number; - projectorInstance: DefaultWidgetBaseInterface; -} - -export interface Projection { - readonly domNode: Element; -} - -export type SupportedClassName = string | null | undefined; - -export type DeferredVirtualProperties = (inserted: boolean) => VNodeProperties; - -export type NodeOperationPredicate = () => boolean; - -export type DiffType = 'none' | 'dom' | 'vdom'; - -export interface On { - [index: string]: (event?: T) => void | undefined; -} - -export interface DomOptions { - node: Element | Text; - props?: VNodeProperties; - attrs?: { [index: string]: string | undefined }; - on?: On; - diffType?: DiffType; -} - -export interface VNodeProperties { - /** - * The animation to perform when this node is added to an already existing parent. - * When this value is a string, you must pass a `projectionOptions.transitions` object when creating the - * projector using [[createProjector]]. - * @param element - Element that was just added to the DOM. - * @param properties - The properties object that was supplied to the [[h]] method - */ - enterAnimation?: ((element: Element, properties?: VNodeProperties) => void) | string; - /** - * The animation to perform when this node is removed while its parent remains. - * When this value is a string, you must pass a `projectionOptions.transitions` object when creating the projector using [[createProjector]]. - * @param element - Element that ought to be removed from the DOM. - * @param removeElement - Function that removes the element from the DOM. - * This argument is provided purely for convenience. - * You may use this function to remove the element when the animation is done. - * @param properties - The properties object that was supplied to the [[v]] method that rendered this [[VNode]] the previous time. - */ - exitAnimation?: ((element: Element, removeElement: () => void, properties?: VNodeProperties) => void) | string; - /** - * The animation to perform when the properties of this node change. - * This also includes attributes, styles, css classes. This callback is also invoked when node contains only text and that text changes. - * @param element - Element that was modified in the DOM. - * @param properties - The last properties object that was supplied to the [[h]] method - * @param previousProperties - The previous properties object that was supplied to the [[h]] method - */ - updateAnimation?: (element: Element, properties?: VNodeProperties, previousProperties?: VNodeProperties) => void; - /** - * Bind should not be defined. - */ - readonly bind?: void; - /** - * Used to uniquely identify a DOM node among siblings. - * A key is required when there are more children with the same selector and these children are added or removed dynamically. - * NOTE: this does not have to be a string or number, a [[Component]] Object for instance is also possible. - */ - readonly key?: string | number; - /** - * An array of supported class names to be added to classList on a DOM node - */ - readonly classes?: SupportedClassName | SupportedClassName[]; - /** - * An object literal like `{height:'100px'}` which allows styles to be changed dynamically. All values must be strings. - */ - readonly styles?: Partial; - - // Pointer Events - onpointermove?(ev?: PointerEvent): boolean | void; - onpointerdown?(ev?: PointerEvent): boolean | void; - onpointerup?(ev?: PointerEvent): boolean | void; - onpointerover?(ev?: PointerEvent): boolean | void; - onpointerout?(ev?: PointerEvent): boolean | void; - onpointerenter?(ev?: PointerEvent): boolean | void; - onpointerleave?(ev?: PointerEvent): boolean | void; - onpointercancel?(ev?: PointerEvent): boolean | void; - // For Pointer Event Polyfill see: https://github.com/jquery/PEP - readonly 'touch-action'?: string; - // From Element - ontouchcancel?(ev?: TouchEvent): boolean | void; - ontouchend?(ev?: TouchEvent): boolean | void; - ontouchmove?(ev?: TouchEvent): boolean | void; - ontouchstart?(ev?: TouchEvent): boolean | void; - // From HTMLFormElement - readonly action?: string; - readonly encoding?: string; - readonly enctype?: string; - readonly method?: string; - readonly name?: string; - readonly target?: string; - // From HTMLElement - onblur?(ev?: FocusEvent): boolean | void; - onchange?(ev?: Event): boolean | void; - onclick?(ev?: MouseEvent): boolean | void; - ondblclick?(ev?: MouseEvent): boolean | void; - onfocus?(ev?: FocusEvent): boolean | void; - oninput?(ev?: Event): boolean | void; - onkeydown?(ev?: KeyboardEvent): boolean | void; - onkeypress?(ev?: KeyboardEvent): boolean | void; - onkeyup?(ev?: KeyboardEvent): boolean | void; - onload?(ev?: Event): boolean | void; - onmousedown?(ev?: MouseEvent): boolean | void; - onmouseenter?(ev?: MouseEvent): boolean | void; - onmouseleave?(ev?: MouseEvent): boolean | void; - onmousemove?(ev?: MouseEvent): boolean | void; - onmouseout?(ev?: MouseEvent): boolean | void; - onmouseover?(ev?: MouseEvent): boolean | void; - onmouseup?(ev?: MouseEvent): boolean | void; - onmousewheel?(ev?: WheelEvent | MouseWheelEvent): boolean | void; - onscroll?(ev?: UIEvent): boolean | void; - onsubmit?(ev?: Event): boolean | void; - readonly spellcheck?: boolean; - readonly tabIndex?: number; - readonly disabled?: boolean; - readonly title?: string; - readonly accessKey?: string; - readonly id?: string; - // From HTMLInputElement - readonly type?: string; - readonly autocomplete?: string; - readonly checked?: boolean; - readonly placeholder?: string; - readonly readOnly?: boolean; - readonly src?: string; - readonly value?: string; - // From HTMLImageElement - readonly alt?: string; - readonly srcset?: string; - /** - * Puts a non-interactive string of html inside the DOM node. - * - * Note: if you use innerHTML, cannot protect you from XSS vulnerabilities and you must make sure that the innerHTML value is safe. - */ - readonly innerHTML?: string; - - /** - * determines if the node should be focused - */ - readonly focus?: boolean | NodeOperationPredicate; - - /** - * determines is the element needs to be clicked - */ - readonly click?: boolean | NodeOperationPredicate; - - /** - * determines if the node should be scrolled to - */ - readonly scrollIntoView?: boolean | NodeOperationPredicate; - - /** - * determines if the node should be blurred - */ - readonly blur?: boolean | NodeOperationPredicate; - - /** - * Everything that is not explicitly listed (properties and attributes that are either uncommon or custom). - */ - readonly [index: string]: any; -} - -/** - * Type of the `WidgetRegistry` label - */ -export type RegistryLabel = string | symbol; - -export type InjectorPayload = () => any; - -/** - * Factory that returns an injector function - */ -export type InjectorFactory = (invalidator: () => void) => InjectorPayload; - -/** - * The injector item created for a registered Injector factory - */ -export interface InjectorItem { - injector: () => T; - invalidator: Evented; -} - -/** - * Base widget properties - */ -export interface WidgetProperties { - /** - * The key for a widget. Used to differentiate uniquely identify child widgets for - * rendering and instance management - */ - key?: string | number; -} - -/** - * Widget properties that require a key - */ -export interface KeyedWidgetProperties extends WidgetProperties { - /** - * The key for a widget. Used to differentiate uniquely identify child widgets for - * rendering and instance management - */ - key: string | number; -} - -/** - * - */ -interface CoreProperties { - /** - * The default registry for the projection - */ - baseRegistry: any; - - /** - * The scope used to bind functions - */ - bind: any; -} - -/** - * Wrapper for v - */ -export interface VNode { - /** - * Specified children - */ - children?: DNode[]; - - /** - * VNode properties - */ - properties: VNodeProperties; - - /** - * VNode attributes - */ - attributes?: { [index: string]: string }; - - /** - * VNode events - */ - events?: On; - - /** - * Deferred callback for VNode properties - */ - deferredPropertiesCallback?: DeferredVirtualProperties; - - /** - * The tag of the VNode - */ - tag: string; - - /** - * The type of node - */ - type: symbol; - - /** - * Text node string - */ - text?: string; - - /** - * Indicates the type of diff for the VNode - */ - diffType?: DiffType; -} - -/** - * Wrapper for `w` - */ -export interface WNode { - /** - * Constructor to create a widget or string constructor label - */ - widgetConstructor: Constructor | RegistryLabel; - - /** - * Properties to set against a widget instance - */ - properties: W['properties']; - - /** - * DNode children - */ - children: DNode[]; - - /** - * The type of node - */ - type: symbol; -} - -/** - * union type for all possible return types from render - */ -export type DNode = - | VNode - | WNode - | undefined - | null - | string; - -/** - * Property Change record for specific property diff functions - */ -export interface PropertyChangeRecord { - changed: boolean; - value: any; -} - -export interface DiffPropertyFunction { - (previousProperty: any, newProperty: any): PropertyChangeRecord; -} - -export interface DiffPropertyReaction { - (previousProperties: any, newProperties: any): void; -} - -/** - * WidgetBase constructor type - */ -export type WidgetBaseConstructor

= Constructor< - WidgetBaseInterface ->; - -export interface DefaultWidgetBaseInterface extends WidgetBaseInterface {} - -/** - * The interface for WidgetBase - */ -export interface WidgetBaseInterface

{ - /** - * Widget properties - */ - readonly properties: P & WidgetProperties; - - /** - * Returns the widget's children - */ - readonly children: (C | null)[]; - - /** - * Sets the properties for the widget. Responsible for calling the diffing functions for the properties against the - * previous properties. Runs though any registered specific property diff functions collecting the results and then - * runs the remainder through the catch all diff function. The aggregate of the two sets of the results is then - * set as the widget's properties - * - * @param properties The new widget properties - */ - __setProperties__(properties: P & { [index: string]: any }): void; - - /** - * Sets core properties on the widget. - * - * @param coreProperties The core properties - */ - __setCoreProperties__(coreProperties?: CoreProperties): any; - - /** - * Sets the widget's children - */ - __setChildren__(children: (C | null)[]): void; - - /** - * Main internal function for dealing with widget rendering - */ - __render__(): DNode | DNode[]; -} - -/** - * Meta Base type - */ -export interface WidgetMetaBase extends Destroyable { - has(key: string | number): boolean; - afterRender(): void; -} - -/** - * Meta Base constructor type - */ -export interface WidgetMetaConstructor { - new (properties: WidgetMetaProperties): T; -} - -export interface NodeHandlerInterface extends Evented { - get(key: string | number): Element | undefined; - has(key: string | number): boolean; - add(element: Element, key: string): void; - addRoot(element: Element, key: string): void; - addProjector(element: Element, properties: VNodeProperties): void; - clear(): void; -} - -/** - * Properties passed to meta Base constructors - */ -export interface WidgetMetaProperties { - invalidate: () => void; - nodeHandler: NodeHandlerInterface; - bind: WidgetBaseInterface; -} - -export interface Render { - (): DNode | DNode[]; -} - -/** - * Interface for beforeRender function - */ -export interface BeforeRender { - (renderFunc: Render, properties: WidgetProperties, children: DNode[]): Render | undefined; -} - -/** - * Interface for afterRender function - */ -export interface AfterRender { - (dNode: DNode | DNode[]): DNode | DNode[]; -} - -/** - * Interface for beforeProperties function - */ -export interface BeforeProperties

{ - (properties: P): P; -} diff --git a/deps/framework/widget-core/meta/Base.d.ts b/deps/framework/widget-core/meta/Base.d.ts deleted file mode 100644 index 13076ae8e4..0000000000 --- a/deps/framework/widget-core/meta/Base.d.ts +++ /dev/null @@ -1,14 +0,0 @@ -import { Destroyable } from '../../core/Destroyable'; -import { WidgetMetaBase, WidgetMetaProperties, NodeHandlerInterface, WidgetBaseInterface } from '../interfaces'; -export declare class Base extends Destroyable implements WidgetMetaBase { - private _invalidate; - protected nodeHandler: NodeHandlerInterface; - private _requestedNodeKeys; - protected _bind: WidgetBaseInterface | undefined; - constructor(properties: WidgetMetaProperties); - has(key: string | number): boolean; - protected getNode(key: string | number): Element | undefined; - protected invalidate(): void; - afterRender(): void; -} -export default Base; diff --git a/deps/framework/widget-core/meta/Base.js b/deps/framework/widget-core/meta/Base.js deleted file mode 100644 index a64482ca3a..0000000000 --- a/deps/framework/widget-core/meta/Base.js +++ /dev/null @@ -1,56 +0,0 @@ -(function (factory) { - if (typeof module === "object" && typeof module.exports === "object") { - var v = factory(require, exports); - if (v !== undefined) module.exports = v; - } - else if (typeof define === "function" && define.amd) { - define(["require", "exports", "tslib", "../../core/Destroyable", "../../shim/Set"], factory); - } -})(function (require, exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - var tslib_1 = require("tslib"); - var Destroyable_1 = require("../../core/Destroyable"); - var Set_1 = require("../../shim/Set"); - var Base = /** @class */ (function (_super) { - tslib_1.__extends(Base, _super); - function Base(properties) { - var _this = _super.call(this) || this; - _this._requestedNodeKeys = new Set_1.default(); - _this._invalidate = properties.invalidate; - _this.nodeHandler = properties.nodeHandler; - if (properties.bind) { - _this._bind = properties.bind; - } - return _this; - } - Base.prototype.has = function (key) { - return this.nodeHandler.has(key); - }; - Base.prototype.getNode = function (key) { - var _this = this; - var stringKey = "" + key; - var node = this.nodeHandler.get(stringKey); - if (!node && !this._requestedNodeKeys.has(stringKey)) { - var handle_1 = this.nodeHandler.on(stringKey, function () { - handle_1.destroy(); - _this._requestedNodeKeys.delete(stringKey); - _this.invalidate(); - }); - this.own(handle_1); - this._requestedNodeKeys.add(stringKey); - } - return node; - }; - Base.prototype.invalidate = function () { - this._invalidate(); - }; - Base.prototype.afterRender = function () { - // Do nothing by default. - }; - return Base; - }(Destroyable_1.Destroyable)); - exports.Base = Base; - exports.default = Base; -}); -//# sourceMappingURL=Base.js.map \ No newline at end of file diff --git a/deps/framework/widget-core/meta/Base.js.map b/deps/framework/widget-core/meta/Base.js.map deleted file mode 100644 index c4382acfc7..0000000000 --- a/deps/framework/widget-core/meta/Base.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"Base.js","sourceRoot":"","sources":["Base.ts"],"names":[],"mappings":";;;;;;;;;;;;IAAA,sDAAqD;IACrD,sCAAiC;IAGjC;QAA0B,gCAAW;QAQpC,cAAY,UAAgC;YAA5C,YACC,iBAAO,SAOP;YAZO,wBAAkB,GAAG,IAAI,aAAG,EAAmB,CAAC;YAOvD,KAAI,CAAC,WAAW,GAAG,UAAU,CAAC,UAAU,CAAC;YACzC,KAAI,CAAC,WAAW,GAAG,UAAU,CAAC,WAAW,CAAC;YAC1C,EAAE,CAAC,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC;gBACrB,KAAI,CAAC,KAAK,GAAG,UAAU,CAAC,IAAI,CAAC;YAC9B,CAAC;;QACF,CAAC;QAEM,kBAAG,GAAV,UAAW,GAAoB;YAC9B,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QAClC,CAAC;QAES,sBAAO,GAAjB,UAAkB,GAAoB;YAAtC,iBAgBC;YAfA,IAAM,SAAS,GAAG,KAAG,GAAK,CAAC;YAC3B,IAAM,IAAI,GAAG,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;YAE7C,EAAE,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,IAAI,CAAC,kBAAkB,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;gBACtD,IAAM,QAAM,GAAG,IAAI,CAAC,WAAW,CAAC,EAAE,CAAC,SAAS,EAAE;oBAC7C,QAAM,CAAC,OAAO,EAAE,CAAC;oBACjB,KAAI,CAAC,kBAAkB,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;oBAC1C,KAAI,CAAC,UAAU,EAAE,CAAC;gBACnB,CAAC,CAAC,CAAC;gBAEH,IAAI,CAAC,GAAG,CAAC,QAAM,CAAC,CAAC;gBACjB,IAAI,CAAC,kBAAkB,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;YACxC,CAAC;YAED,MAAM,CAAC,IAAI,CAAC;QACb,CAAC;QAES,yBAAU,GAApB;YACC,IAAI,CAAC,WAAW,EAAE,CAAC;QACpB,CAAC;QAEM,0BAAW,GAAlB;YACC,yBAAyB;QAC1B,CAAC;QACF,WAAC;IAAD,CAAC,AA/CD,CAA0B,yBAAW,GA+CpC;IA/CY,oBAAI;IAiDjB,kBAAe,IAAI,CAAC","sourcesContent":["import { Destroyable } from '../../core/Destroyable';\nimport Set from '../../shim/Set';\nimport { WidgetMetaBase, WidgetMetaProperties, NodeHandlerInterface, WidgetBaseInterface } from '../interfaces';\n\nexport class Base extends Destroyable implements WidgetMetaBase {\n\tprivate _invalidate: () => void;\n\tprotected nodeHandler: NodeHandlerInterface;\n\n\tprivate _requestedNodeKeys = new Set();\n\n\tprotected _bind: WidgetBaseInterface | undefined;\n\n\tconstructor(properties: WidgetMetaProperties) {\n\t\tsuper();\n\n\t\tthis._invalidate = properties.invalidate;\n\t\tthis.nodeHandler = properties.nodeHandler;\n\t\tif (properties.bind) {\n\t\t\tthis._bind = properties.bind;\n\t\t}\n\t}\n\n\tpublic has(key: string | number): boolean {\n\t\treturn this.nodeHandler.has(key);\n\t}\n\n\tprotected getNode(key: string | number): Element | undefined {\n\t\tconst stringKey = `${key}`;\n\t\tconst node = this.nodeHandler.get(stringKey);\n\n\t\tif (!node && !this._requestedNodeKeys.has(stringKey)) {\n\t\t\tconst handle = this.nodeHandler.on(stringKey, () => {\n\t\t\t\thandle.destroy();\n\t\t\t\tthis._requestedNodeKeys.delete(stringKey);\n\t\t\t\tthis.invalidate();\n\t\t\t});\n\n\t\t\tthis.own(handle);\n\t\t\tthis._requestedNodeKeys.add(stringKey);\n\t\t}\n\n\t\treturn node;\n\t}\n\n\tprotected invalidate(): void {\n\t\tthis._invalidate();\n\t}\n\n\tpublic afterRender(): void {\n\t\t// Do nothing by default.\n\t}\n}\n\nexport default Base;\n"]} \ No newline at end of file diff --git a/deps/framework/widget-core/meta/Base.mjs b/deps/framework/widget-core/meta/Base.mjs deleted file mode 100644 index 3a960f9b4f..0000000000 --- a/deps/framework/widget-core/meta/Base.mjs +++ /dev/null @@ -1,38 +0,0 @@ -import { Destroyable } from '../../core/Destroyable'; -import Set from '../../shim/Set'; -export class Base extends Destroyable { - constructor(properties) { - super(); - this._requestedNodeKeys = new Set(); - this._invalidate = properties.invalidate; - this.nodeHandler = properties.nodeHandler; - if (properties.bind) { - this._bind = properties.bind; - } - } - has(key) { - return this.nodeHandler.has(key); - } - getNode(key) { - const stringKey = `${key}`; - const node = this.nodeHandler.get(stringKey); - if (!node && !this._requestedNodeKeys.has(stringKey)) { - const handle = this.nodeHandler.on(stringKey, () => { - handle.destroy(); - this._requestedNodeKeys.delete(stringKey); - this.invalidate(); - }); - this.own(handle); - this._requestedNodeKeys.add(stringKey); - } - return node; - } - invalidate() { - this._invalidate(); - } - afterRender() { - // Do nothing by default. - } -} -export default Base; -//# sourceMappingURL=Base.mjs.map \ No newline at end of file diff --git a/deps/framework/widget-core/meta/Base.mjs.map b/deps/framework/widget-core/meta/Base.mjs.map deleted file mode 100644 index 8d20ee9b6f..0000000000 --- a/deps/framework/widget-core/meta/Base.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"Base.mjs","sourceRoot":"","sources":["Base.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,GAAG,MAAM,gBAAgB,CAAC;AAGjC,MAAM,WAAY,SAAQ,WAAW;IAQpC,YAAY,UAAgC;QAC3C,KAAK,EAAE,CAAC;QALD,uBAAkB,GAAG,IAAI,GAAG,EAAmB,CAAC;QAOvD,IAAI,CAAC,WAAW,GAAG,UAAU,CAAC,UAAU,CAAC;QACzC,IAAI,CAAC,WAAW,GAAG,UAAU,CAAC,WAAW,CAAC;QAC1C,EAAE,CAAC,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC;YACrB,IAAI,CAAC,KAAK,GAAG,UAAU,CAAC,IAAI,CAAC;QAC9B,CAAC;IACF,CAAC;IAEM,GAAG,CAAC,GAAoB;QAC9B,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IAClC,CAAC;IAES,OAAO,CAAC,GAAoB;QACrC,MAAM,SAAS,GAAG,GAAG,GAAG,EAAE,CAAC;QAC3B,MAAM,IAAI,GAAG,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;QAE7C,EAAE,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,IAAI,CAAC,kBAAkB,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;YACtD,MAAM,MAAM,GAAG,IAAI,CAAC,WAAW,CAAC,EAAE,CAAC,SAAS,EAAE,GAAG,EAAE;gBAClD,MAAM,CAAC,OAAO,EAAE,CAAC;gBACjB,IAAI,CAAC,kBAAkB,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;gBAC1C,IAAI,CAAC,UAAU,EAAE,CAAC;YACnB,CAAC,CAAC,CAAC;YAEH,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;YACjB,IAAI,CAAC,kBAAkB,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;QACxC,CAAC;QAED,MAAM,CAAC,IAAI,CAAC;IACb,CAAC;IAES,UAAU;QACnB,IAAI,CAAC,WAAW,EAAE,CAAC;IACpB,CAAC;IAEM,WAAW;QACjB,yBAAyB;IAC1B,CAAC;CACD;AAED,eAAe,IAAI,CAAC","sourcesContent":["import { Destroyable } from '../../core/Destroyable';\nimport Set from '../../shim/Set';\nimport { WidgetMetaBase, WidgetMetaProperties, NodeHandlerInterface, WidgetBaseInterface } from '../interfaces';\n\nexport class Base extends Destroyable implements WidgetMetaBase {\n\tprivate _invalidate: () => void;\n\tprotected nodeHandler: NodeHandlerInterface;\n\n\tprivate _requestedNodeKeys = new Set();\n\n\tprotected _bind: WidgetBaseInterface | undefined;\n\n\tconstructor(properties: WidgetMetaProperties) {\n\t\tsuper();\n\n\t\tthis._invalidate = properties.invalidate;\n\t\tthis.nodeHandler = properties.nodeHandler;\n\t\tif (properties.bind) {\n\t\t\tthis._bind = properties.bind;\n\t\t}\n\t}\n\n\tpublic has(key: string | number): boolean {\n\t\treturn this.nodeHandler.has(key);\n\t}\n\n\tprotected getNode(key: string | number): Element | undefined {\n\t\tconst stringKey = `${key}`;\n\t\tconst node = this.nodeHandler.get(stringKey);\n\n\t\tif (!node && !this._requestedNodeKeys.has(stringKey)) {\n\t\t\tconst handle = this.nodeHandler.on(stringKey, () => {\n\t\t\t\thandle.destroy();\n\t\t\t\tthis._requestedNodeKeys.delete(stringKey);\n\t\t\t\tthis.invalidate();\n\t\t\t});\n\n\t\t\tthis.own(handle);\n\t\t\tthis._requestedNodeKeys.add(stringKey);\n\t\t}\n\n\t\treturn node;\n\t}\n\n\tprotected invalidate(): void {\n\t\tthis._invalidate();\n\t}\n\n\tpublic afterRender(): void {\n\t\t// Do nothing by default.\n\t}\n}\n\nexport default Base;\n"]} \ No newline at end of file diff --git a/deps/framework/widget-core/meta/Dimensions.d.ts b/deps/framework/widget-core/meta/Dimensions.d.ts deleted file mode 100644 index 9571f5160c..0000000000 --- a/deps/framework/widget-core/meta/Dimensions.d.ts +++ /dev/null @@ -1,24 +0,0 @@ -import { Base } from './Base'; -export interface TopLeft { - left: number; - top: number; -} -export interface BottomRight { - bottom: number; - right: number; -} -export interface Size { - height: number; - width: number; -} -export interface DimensionResults { - position: TopLeft & BottomRight; - offset: TopLeft & Size; - size: Size; - scroll: TopLeft & Size; - client: TopLeft & Size; -} -export declare class Dimensions extends Base { - get(key: string | number): Readonly; -} -export default Dimensions; diff --git a/deps/framework/widget-core/meta/Dimensions.js b/deps/framework/widget-core/meta/Dimensions.js deleted file mode 100644 index 4a013bef1e..0000000000 --- a/deps/framework/widget-core/meta/Dimensions.js +++ /dev/null @@ -1,92 +0,0 @@ -(function (factory) { - if (typeof module === "object" && typeof module.exports === "object") { - var v = factory(require, exports); - if (v !== undefined) module.exports = v; - } - else if (typeof define === "function" && define.amd) { - define(["require", "exports", "tslib", "./Base", "../../core/lang"], factory); - } -})(function (require, exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - var tslib_1 = require("tslib"); - var Base_1 = require("./Base"); - var lang_1 = require("../../core/lang"); - var defaultDimensions = { - client: { - height: 0, - left: 0, - top: 0, - width: 0 - }, - offset: { - height: 0, - left: 0, - top: 0, - width: 0 - }, - position: { - bottom: 0, - left: 0, - right: 0, - top: 0 - }, - scroll: { - height: 0, - left: 0, - top: 0, - width: 0 - }, - size: { - width: 0, - height: 0 - } - }; - var Dimensions = /** @class */ (function (_super) { - tslib_1.__extends(Dimensions, _super); - function Dimensions() { - return _super !== null && _super.apply(this, arguments) || this; - } - Dimensions.prototype.get = function (key) { - var node = this.getNode(key); - if (!node) { - return lang_1.deepAssign({}, defaultDimensions); - } - var boundingDimensions = node.getBoundingClientRect(); - return { - client: { - height: node.clientHeight, - left: node.clientLeft, - top: node.clientTop, - width: node.clientWidth - }, - offset: { - height: node.offsetHeight, - left: node.offsetLeft, - top: node.offsetTop, - width: node.offsetWidth - }, - position: { - bottom: boundingDimensions.bottom, - left: boundingDimensions.left, - right: boundingDimensions.right, - top: boundingDimensions.top - }, - scroll: { - height: node.scrollHeight, - left: node.scrollLeft, - top: node.scrollTop, - width: node.scrollWidth - }, - size: { - width: boundingDimensions.width, - height: boundingDimensions.height - } - }; - }; - return Dimensions; - }(Base_1.Base)); - exports.Dimensions = Dimensions; - exports.default = Dimensions; -}); -//# sourceMappingURL=Dimensions.js.map \ No newline at end of file diff --git a/deps/framework/widget-core/meta/Dimensions.js.map b/deps/framework/widget-core/meta/Dimensions.js.map deleted file mode 100644 index aa88eb7256..0000000000 --- a/deps/framework/widget-core/meta/Dimensions.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"Dimensions.js","sourceRoot":"","sources":["Dimensions.ts"],"names":[],"mappings":";;;;;;;;;;;;IAAA,+BAA8B;IAC9B,wCAA6C;IAyB7C,IAAM,iBAAiB,GAAG;QACzB,MAAM,EAAE;YACP,MAAM,EAAE,CAAC;YACT,IAAI,EAAE,CAAC;YACP,GAAG,EAAE,CAAC;YACN,KAAK,EAAE,CAAC;SACR;QACD,MAAM,EAAE;YACP,MAAM,EAAE,CAAC;YACT,IAAI,EAAE,CAAC;YACP,GAAG,EAAE,CAAC;YACN,KAAK,EAAE,CAAC;SACR;QACD,QAAQ,EAAE;YACT,MAAM,EAAE,CAAC;YACT,IAAI,EAAE,CAAC;YACP,KAAK,EAAE,CAAC;YACR,GAAG,EAAE,CAAC;SACN;QACD,MAAM,EAAE;YACP,MAAM,EAAE,CAAC;YACT,IAAI,EAAE,CAAC;YACP,GAAG,EAAE,CAAC;YACN,KAAK,EAAE,CAAC;SACR;QACD,IAAI,EAAE;YACL,KAAK,EAAE,CAAC;YACR,MAAM,EAAE,CAAC;SACT;KACD,CAAC;IAEF;QAAgC,sCAAI;QAApC;;QAyCA,CAAC;QAxCO,wBAAG,GAAV,UAAW,GAAoB;YAC9B,IAAM,IAAI,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,CAAgB,CAAC;YAE9C,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC;gBACX,MAAM,CAAC,iBAAU,CAAC,EAAE,EAAE,iBAAiB,CAAC,CAAC;YAC1C,CAAC;YAED,IAAM,kBAAkB,GAAG,IAAI,CAAC,qBAAqB,EAAE,CAAC;YAExD,MAAM,CAAC;gBACN,MAAM,EAAE;oBACP,MAAM,EAAE,IAAI,CAAC,YAAY;oBACzB,IAAI,EAAE,IAAI,CAAC,UAAU;oBACrB,GAAG,EAAE,IAAI,CAAC,SAAS;oBACnB,KAAK,EAAE,IAAI,CAAC,WAAW;iBACvB;gBACD,MAAM,EAAE;oBACP,MAAM,EAAE,IAAI,CAAC,YAAY;oBACzB,IAAI,EAAE,IAAI,CAAC,UAAU;oBACrB,GAAG,EAAE,IAAI,CAAC,SAAS;oBACnB,KAAK,EAAE,IAAI,CAAC,WAAW;iBACvB;gBACD,QAAQ,EAAE;oBACT,MAAM,EAAE,kBAAkB,CAAC,MAAM;oBACjC,IAAI,EAAE,kBAAkB,CAAC,IAAI;oBAC7B,KAAK,EAAE,kBAAkB,CAAC,KAAK;oBAC/B,GAAG,EAAE,kBAAkB,CAAC,GAAG;iBAC3B;gBACD,MAAM,EAAE;oBACP,MAAM,EAAE,IAAI,CAAC,YAAY;oBACzB,IAAI,EAAE,IAAI,CAAC,UAAU;oBACrB,GAAG,EAAE,IAAI,CAAC,SAAS;oBACnB,KAAK,EAAE,IAAI,CAAC,WAAW;iBACvB;gBACD,IAAI,EAAE;oBACL,KAAK,EAAE,kBAAkB,CAAC,KAAK;oBAC/B,MAAM,EAAE,kBAAkB,CAAC,MAAM;iBACjC;aACD,CAAC;QACH,CAAC;QACF,iBAAC;IAAD,CAAC,AAzCD,CAAgC,WAAI,GAyCnC;IAzCY,gCAAU;IA2CvB,kBAAe,UAAU,CAAC","sourcesContent":["import { Base } from './Base';\nimport { deepAssign } from '../../core/lang';\n\nexport interface TopLeft {\n\tleft: number;\n\ttop: number;\n}\n\nexport interface BottomRight {\n\tbottom: number;\n\tright: number;\n}\n\nexport interface Size {\n\theight: number;\n\twidth: number;\n}\n\nexport interface DimensionResults {\n\tposition: TopLeft & BottomRight;\n\toffset: TopLeft & Size;\n\tsize: Size;\n\tscroll: TopLeft & Size;\n\tclient: TopLeft & Size;\n}\n\nconst defaultDimensions = {\n\tclient: {\n\t\theight: 0,\n\t\tleft: 0,\n\t\ttop: 0,\n\t\twidth: 0\n\t},\n\toffset: {\n\t\theight: 0,\n\t\tleft: 0,\n\t\ttop: 0,\n\t\twidth: 0\n\t},\n\tposition: {\n\t\tbottom: 0,\n\t\tleft: 0,\n\t\tright: 0,\n\t\ttop: 0\n\t},\n\tscroll: {\n\t\theight: 0,\n\t\tleft: 0,\n\t\ttop: 0,\n\t\twidth: 0\n\t},\n\tsize: {\n\t\twidth: 0,\n\t\theight: 0\n\t}\n};\n\nexport class Dimensions extends Base {\n\tpublic get(key: string | number): Readonly {\n\t\tconst node = this.getNode(key) as HTMLElement;\n\n\t\tif (!node) {\n\t\t\treturn deepAssign({}, defaultDimensions);\n\t\t}\n\n\t\tconst boundingDimensions = node.getBoundingClientRect();\n\n\t\treturn {\n\t\t\tclient: {\n\t\t\t\theight: node.clientHeight,\n\t\t\t\tleft: node.clientLeft,\n\t\t\t\ttop: node.clientTop,\n\t\t\t\twidth: node.clientWidth\n\t\t\t},\n\t\t\toffset: {\n\t\t\t\theight: node.offsetHeight,\n\t\t\t\tleft: node.offsetLeft,\n\t\t\t\ttop: node.offsetTop,\n\t\t\t\twidth: node.offsetWidth\n\t\t\t},\n\t\t\tposition: {\n\t\t\t\tbottom: boundingDimensions.bottom,\n\t\t\t\tleft: boundingDimensions.left,\n\t\t\t\tright: boundingDimensions.right,\n\t\t\t\ttop: boundingDimensions.top\n\t\t\t},\n\t\t\tscroll: {\n\t\t\t\theight: node.scrollHeight,\n\t\t\t\tleft: node.scrollLeft,\n\t\t\t\ttop: node.scrollTop,\n\t\t\t\twidth: node.scrollWidth\n\t\t\t},\n\t\t\tsize: {\n\t\t\t\twidth: boundingDimensions.width,\n\t\t\t\theight: boundingDimensions.height\n\t\t\t}\n\t\t};\n\t}\n}\n\nexport default Dimensions;\n"]} \ No newline at end of file diff --git a/deps/framework/widget-core/meta/Dimensions.mjs b/deps/framework/widget-core/meta/Dimensions.mjs deleted file mode 100644 index b354fcf329..0000000000 --- a/deps/framework/widget-core/meta/Dimensions.mjs +++ /dev/null @@ -1,73 +0,0 @@ -import { Base } from './Base'; -import { deepAssign } from '../../core/lang'; -const defaultDimensions = { - client: { - height: 0, - left: 0, - top: 0, - width: 0 - }, - offset: { - height: 0, - left: 0, - top: 0, - width: 0 - }, - position: { - bottom: 0, - left: 0, - right: 0, - top: 0 - }, - scroll: { - height: 0, - left: 0, - top: 0, - width: 0 - }, - size: { - width: 0, - height: 0 - } -}; -export class Dimensions extends Base { - get(key) { - const node = this.getNode(key); - if (!node) { - return deepAssign({}, defaultDimensions); - } - const boundingDimensions = node.getBoundingClientRect(); - return { - client: { - height: node.clientHeight, - left: node.clientLeft, - top: node.clientTop, - width: node.clientWidth - }, - offset: { - height: node.offsetHeight, - left: node.offsetLeft, - top: node.offsetTop, - width: node.offsetWidth - }, - position: { - bottom: boundingDimensions.bottom, - left: boundingDimensions.left, - right: boundingDimensions.right, - top: boundingDimensions.top - }, - scroll: { - height: node.scrollHeight, - left: node.scrollLeft, - top: node.scrollTop, - width: node.scrollWidth - }, - size: { - width: boundingDimensions.width, - height: boundingDimensions.height - } - }; - } -} -export default Dimensions; -//# sourceMappingURL=Dimensions.mjs.map \ No newline at end of file diff --git a/deps/framework/widget-core/meta/Dimensions.mjs.map b/deps/framework/widget-core/meta/Dimensions.mjs.map deleted file mode 100644 index b64445a25b..0000000000 --- a/deps/framework/widget-core/meta/Dimensions.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"Dimensions.mjs","sourceRoot":"","sources":["Dimensions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAC9B,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAyB7C,MAAM,iBAAiB,GAAG;IACzB,MAAM,EAAE;QACP,MAAM,EAAE,CAAC;QACT,IAAI,EAAE,CAAC;QACP,GAAG,EAAE,CAAC;QACN,KAAK,EAAE,CAAC;KACR;IACD,MAAM,EAAE;QACP,MAAM,EAAE,CAAC;QACT,IAAI,EAAE,CAAC;QACP,GAAG,EAAE,CAAC;QACN,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AAC,YAAY;gBACzB,IAAI,EAAE,IAAI,CAAC,UAAU;gBACrB,GAAG,EAAE,IAAI,CAAC,SAAS;gBACnB,KAAK,EAAE,IAAI,CAAC,WAAW;aACvB;YACD,IAAI,EAAE;gBACL,KAAK,EAAE,kBAAkB,CAAC,KAAK;gBAC/B,MAAM,EAAE,kBAAkB,CAAC,MAAM;aACjC;SACD,CAAC;IACH,CAAC;CACD;AAED,eAAe,UAAU,CAAC","sourcesContent":["import { Base } from './Base';\nimport { deepAssign } from '../../core/lang';\n\nexport interface TopLeft {\n\tleft: number;\n\ttop: number;\n}\n\nexport interface BottomRight {\n\tbottom: number;\n\tright: number;\n}\n\nexport interface Size {\n\theight: number;\n\twidth: number;\n}\n\nexport interface DimensionResults {\n\tposition: TopLeft & BottomRight;\n\toffset: TopLeft & Size;\n\tsize: Size;\n\tscroll: TopLeft & Size;\n\tclient: TopLeft & Size;\n}\n\nconst defaultDimensions = {\n\tclient: {\n\t\theight: 0,\n\t\tleft: 0,\n\t\ttop: 0,\n\t\twidth: 0\n\t},\n\toffset: {\n\t\theight: 0,\n\t\tleft: 0,\n\t\ttop: 0,\n\t\twidth: 0\n\t},\n\tposition: {\n\t\tbottom: 0,\n\t\tleft: 0,\n\t\tright: 0,\n\t\ttop: 0\n\t},\n\tscroll: {\n\t\theight: 0,\n\t\tleft: 0,\n\t\ttop: 0,\n\t\twidth: 0\n\t},\n\tsize: {\n\t\twidth: 0,\n\t\theight: 0\n\t}\n};\n\nexport class Dimensions extends Base {\n\tpublic get(key: string | number): Readonly {\n\t\tconst node = this.getNode(key) as HTMLElement;\n\n\t\tif (!node) {\n\t\t\treturn deepAssign({}, defaultDimensions);\n\t\t}\n\n\t\tconst boundingDimensions = node.getBoundingClientRect();\n\n\t\treturn {\n\t\t\tclient: {\n\t\t\t\theight: node.clientHeight,\n\t\t\t\tleft: node.clientLeft,\n\t\t\t\ttop: node.clientTop,\n\t\t\t\twidth: node.clientWidth\n\t\t\t},\n\t\t\toffset: {\n\t\t\t\theight: node.offsetHeight,\n\t\t\t\tleft: node.offsetLeft,\n\t\t\t\ttop: node.offsetTop,\n\t\t\t\twidth: node.offsetWidth\n\t\t\t},\n\t\t\tposition: {\n\t\t\t\tbottom: boundingDimensions.bottom,\n\t\t\t\tleft: boundingDimensions.left,\n\t\t\t\tright: boundingDimensions.right,\n\t\t\t\ttop: boundingDimensions.top\n\t\t\t},\n\t\t\tscroll: {\n\t\t\t\theight: node.scrollHeight,\n\t\t\t\tleft: node.scrollLeft,\n\t\t\t\ttop: node.scrollTop,\n\t\t\t\twidth: node.scrollWidth\n\t\t\t},\n\t\t\tsize: {\n\t\t\t\twidth: boundingDimensions.width,\n\t\t\t\theight: boundingDimensions.height\n\t\t\t}\n\t\t};\n\t}\n}\n\nexport default Dimensions;\n"]} \ No newline at end of file diff --git a/deps/framework/widget-core/meta/Drag.d.ts b/deps/framework/widget-core/meta/Drag.d.ts deleted file mode 100644 index 5538b88724..0000000000 --- a/deps/framework/widget-core/meta/Drag.d.ts +++ /dev/null @@ -1,48 +0,0 @@ -import { Base } from './Base'; -export interface DragResults { - /** - * The movement of pointer during the duration of the drag state - */ - delta: Position; - /** - * Is the DOM node currently in a drag state - */ - isDragging: boolean; - /** - * A matrix of posistions that represent the start position for the current drag interaction - */ - start?: PositionMatrix; -} -/** - * An x/y position structure - */ -export interface Position { - x: number; - y: number; -} -/** - * A matrix of x/y positions - */ -export interface PositionMatrix { - /** - * Client x/y position - */ - client: Position; - /** - * Offset x/y position - */ - offset: Position; - /** - * Page x/y position - */ - page: Position; - /** - * Screen x/y position - */ - screen: Position; -} -export declare class Drag extends Base { - private _boundInvalidate; - get(key: string | number): Readonly; -} -export default Drag; diff --git a/deps/framework/widget-core/meta/Drag.js b/deps/framework/widget-core/meta/Drag.js deleted file mode 100644 index fcd1c5a9fa..0000000000 --- a/deps/framework/widget-core/meta/Drag.js +++ /dev/null @@ -1,220 +0,0 @@ -(function (factory) { - if (typeof module === "object" && typeof module.exports === "object") { - var v = factory(require, exports); - if (v !== undefined) module.exports = v; - } - else if (typeof define === "function" && define.amd) { - define(["require", "exports", "tslib", "../../core/lang", "../../shim/global", "../../shim/object", "../../shim/WeakMap", "./Base"], factory); - } -})(function (require, exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - var tslib_1 = require("tslib"); - var lang_1 = require("../../core/lang"); - var global_1 = require("../../shim/global"); - var object_1 = require("../../shim/object"); - var WeakMap_1 = require("../../shim/WeakMap"); - var Base_1 = require("./Base"); - function createNodeData(invalidate) { - return { - dragResults: lang_1.deepAssign({}, emptyResults), - invalidate: invalidate, - last: createPositionMatrix(), - start: createPositionMatrix() - }; - } - /** - * Creates an empty position - */ - function createPosition() { - return { x: 0, y: 0 }; - } - /** - * Create an empty position matrix - */ - function createPositionMatrix() { - return { - client: { x: 0, y: 0 }, - offset: { x: 0, y: 0 }, - page: { x: 0, y: 0 }, - screen: { x: 0, y: 0 } - }; - } - /** - * A frozen empty result object, frozen to ensure that no one downstream modifies it - */ - var emptyResults = Object.freeze({ - delta: Object.freeze(createPosition()), - isDragging: false - }); - /** - * Return the x/y position matrix for an event - * @param event The pointer event - */ - function getPositionMatrix(event) { - return { - client: { - x: event.clientX, - y: event.clientY - }, - offset: { - x: event.offsetX, - y: event.offsetY - }, - page: { - x: event.pageX, - y: event.pageY - }, - screen: { - x: event.screenX, - y: event.screenY - } - }; - } - /** - * Return the delta position between two positions - * @param start The first position - * @param current The second position - */ - function getDelta(start, current) { - return { - x: current.client.x - start.client.x, - y: current.client.y - start.client.y - }; - } - /** - * Sets the `touch-action` on nodes so that PointerEvents are always emitted for the node - * @param node The node to init - */ - function initNode(node) { - // Ensure that the node has `touch-action` none - node.style.touchAction = 'none'; - // PEP requires an attribute of `touch-action` to be set on the element - node.setAttribute('touch-action', 'none'); - } - var DragController = /** @class */ (function () { - function DragController() { - var _this = this; - this._nodeMap = new WeakMap_1.default(); - this._dragging = undefined; - this._onDragStart = function (event) { - var _dragging = _this._dragging; - if (!event.isPrimary && _dragging) { - // we have a second touch going on here, while we are dragging, so we aren't really dragging, so we - // will close this down - var state = _this._nodeMap.get(_dragging); - state.dragResults.isDragging = false; - state.invalidate(); - _this._dragging = undefined; - return; - } - if (event.button !== 0) { - // it isn't the primary button that is being clicked, so we will ignore this - return; - } - var data = _this._getData(event.target); - if (data) { - var state = data.state, target = data.target; - _this._dragging = target; - state.last = state.start = getPositionMatrix(event); - state.dragResults.delta = createPosition(); - state.dragResults.start = lang_1.deepAssign({}, state.start); - state.dragResults.isDragging = true; - state.invalidate(); - event.preventDefault(); - event.stopPropagation(); - } // else, we are ignoring the event - }; - this._onDrag = function (event) { - var _dragging = _this._dragging; - if (!_dragging) { - return; - } - // state cannot be unset, using ! operator - var state = _this._nodeMap.get(_dragging); - state.last = getPositionMatrix(event); - state.dragResults.delta = getDelta(state.start, state.last); - if (!state.dragResults.start) { - state.dragResults.start = lang_1.deepAssign({}, state.start); - } - state.invalidate(); - event.preventDefault(); - event.stopPropagation(); - }; - this._onDragStop = function (event) { - var _dragging = _this._dragging; - if (!_dragging) { - return; - } - // state cannot be unset, using ! operator - var state = _this._nodeMap.get(_dragging); - state.last = getPositionMatrix(event); - state.dragResults.delta = getDelta(state.start, state.last); - if (!state.dragResults.start) { - state.dragResults.start = lang_1.deepAssign({}, state.start); - } - state.dragResults.isDragging = false; - state.invalidate(); - _this._dragging = undefined; - event.preventDefault(); - event.stopPropagation(); - }; - var win = global_1.default.window; - win.addEventListener('pointerdown', this._onDragStart); - // Use capture phase, to determine the right node target, as it will be top down versus bottom up - win.addEventListener('pointermove', this._onDrag, true); - win.addEventListener('pointerup', this._onDragStop, true); - } - DragController.prototype._getData = function (target) { - if (this._nodeMap.has(target)) { - return { state: this._nodeMap.get(target), target: target }; - } - if (target.parentElement) { - return this._getData(target.parentElement); - } - }; - DragController.prototype.get = function (node, invalidate) { - var _nodeMap = this._nodeMap; - // first time we see a node, we will initialize its state and properties - if (!_nodeMap.has(node)) { - _nodeMap.set(node, createNodeData(invalidate)); - initNode(node); - return emptyResults; - } - var state = _nodeMap.get(node); - // shallow "clone" the results, so no downstream manipulation can occur - var dragResults = object_1.assign({}, state.dragResults); - // we are offering up an accurate delta, so we need to take the last event position and move it to the start so - // that our deltas are calculated from the last time they are read - state.start = state.last; - // reset the delta after we have read, as any future reads should have an empty delta - state.dragResults.delta = createPosition(); - // clear the start state - delete state.dragResults.start; - return dragResults; - }; - return DragController; - }()); - var controller = new DragController(); - var Drag = /** @class */ (function (_super) { - tslib_1.__extends(Drag, _super); - function Drag() { - var _this = _super !== null && _super.apply(this, arguments) || this; - _this._boundInvalidate = _this.invalidate.bind(_this); - return _this; - } - Drag.prototype.get = function (key) { - var node = this.getNode(key); - // if we don't have a reference to the node yet, return an empty set of results - if (!node) { - return emptyResults; - } - // otherwise we will ask the controller for our results - return controller.get(node, this._boundInvalidate); - }; - return Drag; - }(Base_1.Base)); - exports.Drag = Drag; - exports.default = Drag; -}); -//# sourceMappingURL=Drag.js.map \ No newline at end of file diff --git a/deps/framework/widget-core/meta/Drag.js.map b/deps/framework/widget-core/meta/Drag.js.map deleted file mode 100644 index 9dfee105aa..0000000000 --- a/deps/framework/widget-core/meta/Drag.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"Drag.js","sourceRoot":"","sources":["Drag.ts"],"names":[],"mappings":";;;;;;;;;;;;IAAA,wCAA6C;IAC7C,4CAAuC;IACvC,4CAA2C;IAC3C,8CAAyC;IACzC,+BAA8B;IA2D9B,wBAAwB,UAAsB;QAC7C,MAAM,CAAC;YACN,WAAW,EAAE,iBAAU,CAAC,EAAE,EAAE,YAAY,CAAC;YACzC,UAAU,YAAA;YACV,IAAI,EAAE,oBAAoB,EAAE;YAC5B,KAAK,EAAE,oBAAoB,EAAE;SAC7B,CAAC;IACH,CAAC;IAED;;OAEG;IACH;QACC,MAAM,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC;IACvB,CAAC;I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,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC;gBACX,MAAM,CAAC,YAAY,CAAC;YACrB,CAAC;YAED,uDAAuD;YACvD,MAAM,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,EAAE,IAAI,CAAC,gBAAgB,CAAC,CAAC;QACpD,CAAC;QACF,WAAC;IAAD,CAAC,AAdD,CAA0B,WAAI,GAc7B;IAdY,oBAAI;IAgBjB,kBAAe,IAAI,CAAC","sourcesContent":["import { deepAssign } from '../../core/lang';\nimport global from '../../shim/global';\nimport { assign } from '../../shim/object';\nimport WeakMap from '../../shim/WeakMap';\nimport { Base } from './Base';\n\nexport interface DragResults {\n\t/**\n\t * The movement of pointer during the duration of the drag state\n\t */\n\tdelta: Position;\n\n\t/**\n\t * Is the DOM node currently in a drag state\n\t */\n\tisDragging: boolean;\n\n\t/**\n\t * A matrix of posistions that represent the start position for the current drag interaction\n\t */\n\tstart?: PositionMatrix;\n}\n\ninterface NodeData {\n\tdragResults: DragResults;\n\tinvalidate: () => void;\n\tlast: PositionMatrix;\n\tstart: PositionMatrix;\n}\n\n/**\n * An x/y position structure\n */\nexport interface Position {\n\tx: number;\n\ty: number;\n}\n\n/**\n * A matrix of x/y positions\n */\nexport interface PositionMatrix {\n\t/**\n\t * Client x/y position\n\t */\n\tclient: Position;\n\n\t/**\n\t * Offset x/y position\n\t */\n\toffset: Position;\n\n\t/**\n\t * Page x/y position\n\t */\n\tpage: Position;\n\n\t/**\n\t * Screen x/y position\n\t */\n\tscreen: Position;\n}\n\nfunction createNodeData(invalidate: () => void): NodeData {\n\treturn {\n\t\tdragResults: deepAssign({}, emptyResults),\n\t\tinvalidate,\n\t\tlast: createPositionMatrix(),\n\t\tstart: createPositionMatrix()\n\t};\n}\n\n/**\n * Creates an empty position\n */\nfunction createPosition(): Position {\n\treturn { x: 0, y: 0 };\n}\n\n/**\n * Create an empty position matrix\n */\nfunction createPositionMatrix(): PositionMatrix {\n\treturn {\n\t\tclient: { x: 0, y: 0 },\n\t\toffset: { x: 0, y: 0 },\n\t\tpage: { x: 0, y: 0 },\n\t\tscreen: { x: 0, y: 0 }\n\t};\n}\n\n/**\n * A frozen empty result object, frozen to ensure that no one downstream modifies it\n */\nconst emptyResults = Object.freeze({\n\tdelta: Object.freeze(createPosition()),\n\tisDragging: false\n});\n\n/**\n * Return the x/y position matrix for an event\n * @param event The pointer event\n */\nfunction getPositionMatrix(event: PointerEvent): PositionMatrix {\n\treturn {\n\t\tclient: {\n\t\t\tx: event.clientX,\n\t\t\ty: event.clientY\n\t\t},\n\t\toffset: {\n\t\t\tx: event.offsetX,\n\t\t\ty: event.offsetY\n\t\t},\n\t\tpage: {\n\t\t\tx: event.pageX,\n\t\t\ty: event.pageY\n\t\t},\n\t\tscreen: {\n\t\t\tx: event.screenX,\n\t\t\ty: event.screenY\n\t\t}\n\t};\n}\n\n/**\n * Return the delta position between two positions\n * @param start The first position\n * @param current The second position\n */\nfunction getDelta(start: PositionMatrix, current: PositionMatrix): Position {\n\treturn {\n\t\tx: current.client.x - start.client.x,\n\t\ty: current.client.y - start.client.y\n\t};\n}\n\n/**\n * Sets the `touch-action` on nodes so that PointerEvents are always emitted for the node\n * @param node The node to init\n */\nfunction initNode(node: HTMLElement): void {\n\t// Ensure that the node has `touch-action` none\n\tnode.style.touchAction = 'none';\n\t// PEP requires an attribute of `touch-action` to be set on the element\n\tnode.setAttribute('touch-action', 'none');\n}\n\nclass DragController {\n\tprivate _nodeMap = new WeakMap();\n\tprivate _dragging: HTMLElement | undefined = undefined;\n\n\tprivate _getData(target: HTMLElement): { state: NodeData; target: HTMLElement } | undefined {\n\t\tif (this._nodeMap.has(target)) {\n\t\t\treturn { state: this._nodeMap.get(target)!, target };\n\t\t}\n\t\tif (target.parentElement) {\n\t\t\treturn this._getData(target.parentElement);\n\t\t}\n\t}\n\n\tprivate _onDragStart = (event: PointerEvent) => {\n\t\tconst { _dragging } = this;\n\t\tif (!event.isPrimary && _dragging) {\n\t\t\t// we have a second touch going on here, while we are dragging, so we aren't really dragging, so we\n\t\t\t// will close this down\n\t\t\tconst state = this._nodeMap.get(_dragging)!;\n\t\t\tstate.dragResults.isDragging = false;\n\t\t\tstate.invalidate();\n\t\t\tthis._dragging = undefined;\n\t\t\treturn;\n\t\t}\n\t\tif (event.button !== 0) {\n\t\t\t// it isn't the primary button that is being clicked, so we will ignore this\n\t\t\treturn;\n\t\t}\n\t\tconst data = this._getData(event.target as HTMLElement);\n\t\tif (data) {\n\t\t\tconst { state, target } = data;\n\t\t\tthis._dragging = target;\n\t\t\tstate.last = state.start = getPositionMatrix(event);\n\t\t\tstate.dragResults.delta = createPosition();\n\t\t\tstate.dragResults.start = deepAssign({}, state.start);\n\t\t\tstate.dragResults.isDragging = true;\n\t\t\tstate.invalidate();\n\n\t\t\tevent.preventDefault();\n\t\t\tevent.stopPropagation();\n\t\t} // else, we are ignoring the event\n\t};\n\n\tprivate _onDrag = (event: PointerEvent) => {\n\t\tconst { _dragging } = this;\n\t\tif (!_dragging) {\n\t\t\treturn;\n\t\t}\n\t\t// state cannot be unset, using ! operator\n\t\tconst state = this._nodeMap.get(_dragging)!;\n\t\tstate.last = getPositionMatrix(event);\n\t\tstate.dragResults.delta = getDelta(state.start, state.last);\n\t\tif (!state.dragResults.start) {\n\t\t\tstate.dragResults.start = deepAssign({}, state.start);\n\t\t}\n\t\tstate.invalidate();\n\n\t\tevent.preventDefault();\n\t\tevent.stopPropagation();\n\t};\n\n\tprivate _onDragStop = (event: PointerEvent) => {\n\t\tconst { _dragging } = this;\n\t\tif (!_dragging) {\n\t\t\treturn;\n\t\t}\n\t\t// state cannot be unset, using ! operator\n\t\tconst state = this._nodeMap.get(_dragging)!;\n\t\tstate.last = getPositionMatrix(event);\n\t\tstate.dragResults.delta = getDelta(state.start, state.last);\n\t\tif (!state.dragResults.start) {\n\t\t\tstate.dragResults.start = deepAssign({}, state.start);\n\t\t}\n\t\tstate.dragResults.isDragging = false;\n\t\tstate.invalidate();\n\t\tthis._dragging = undefined;\n\n\t\tevent.preventDefault();\n\t\tevent.stopPropagation();\n\t};\n\n\tconstructor() {\n\t\tconst win: Window = global.window;\n\t\twin.addEventListener('pointerdown', this._onDragStart);\n\t\t// Use capture phase, to determine the right node target, as it will be top down versus bottom up\n\t\twin.addEventListener('pointermove', this._onDrag, true);\n\t\twin.addEventListener('pointerup', this._onDragStop, true);\n\t}\n\n\tpublic get(node: HTMLElement, invalidate: () => void): DragResults {\n\t\tconst { _nodeMap } = this;\n\t\t// first time we see a node, we will initialize its state and properties\n\t\tif (!_nodeMap.has(node)) {\n\t\t\t_nodeMap.set(node, createNodeData(invalidate));\n\t\t\tinitNode(node);\n\t\t\treturn emptyResults;\n\t\t}\n\n\t\tconst state = _nodeMap.get(node)!;\n\t\t// shallow \"clone\" the results, so no downstream manipulation can occur\n\t\tconst dragResults = assign({}, state.dragResults);\n\t\t// we are offering up an accurate delta, so we need to take the last event position and move it to the start so\n\t\t// that our deltas are calculated from the last time they are read\n\t\tstate.start = state.last;\n\t\t// reset the delta after we have read, as any future reads should have an empty delta\n\t\tstate.dragResults.delta = createPosition();\n\t\t// clear the start state\n\t\tdelete state.dragResults.start;\n\n\t\treturn dragResults;\n\t}\n}\n\nconst controller = new DragController();\n\nexport class Drag extends Base {\n\tprivate _boundInvalidate: () => void = this.invalidate.bind(this);\n\n\tpublic get(key: string | number): Readonly {\n\t\tconst node = this.getNode(key) as HTMLElement;\n\n\t\t// if we don't have a reference to the node yet, return an empty set of results\n\t\tif (!node) {\n\t\t\treturn emptyResults;\n\t\t}\n\n\t\t// otherwise we will ask the controller for our results\n\t\treturn controller.get(node, this._boundInvalidate);\n\t}\n}\n\nexport default Drag;\n"]} \ No newline at end of file diff --git a/deps/framework/widget-core/meta/Drag.mjs b/deps/framework/widget-core/meta/Drag.mjs deleted file mode 100644 index cd37dabc45..0000000000 --- a/deps/framework/widget-core/meta/Drag.mjs +++ /dev/null @@ -1,201 +0,0 @@ -import { deepAssign } from '../../core/lang'; -import global from '../../shim/global'; -import { assign } from '../../shim/object'; -import WeakMap from '../../shim/WeakMap'; -import { Base } from './Base'; -function createNodeData(invalidate) { - return { - dragResults: deepAssign({}, emptyResults), - invalidate, - last: createPositionMatrix(), - start: createPositionMatrix() - }; -} -/** - * Creates an empty position - */ -function createPosition() { - return { x: 0, y: 0 }; -} -/** - * Create an empty position matrix - */ -function createPositionMatrix() { - return { - client: { x: 0, y: 0 }, - offset: { x: 0, y: 0 }, - page: { x: 0, y: 0 }, - screen: { x: 0, y: 0 } - }; -} -/** - * A frozen empty result object, frozen to ensure that no one downstream modifies it - */ -const emptyResults = Object.freeze({ - delta: Object.freeze(createPosition()), - isDragging: false -}); -/** - * Return the x/y position matrix for an event - * @param event The pointer event - */ -function getPositionMatrix(event) { - return { - client: { - x: event.clientX, - y: event.clientY - }, - offset: { - x: event.offsetX, - y: event.offsetY - }, - page: { - x: event.pageX, - y: event.pageY - }, - screen: { - x: event.screenX, - y: event.screenY - } - }; -} -/** - * Return the delta position between two positions - * @param start The first position - * @param current The second position - */ -function getDelta(start, current) { - return { - x: current.client.x - start.client.x, - y: current.client.y - start.client.y - }; -} -/** - * Sets the `touch-action` on nodes so that PointerEvents are always emitted for the node - * @param node The node to init - */ -function initNode(node) { - // Ensure that the node has `touch-action` none - node.style.touchAction = 'none'; - // PEP requires an attribute of `touch-action` to be set on the element - node.setAttribute('touch-action', 'none'); -} -class DragController { - constructor() { - this._nodeMap = new WeakMap(); - this._dragging = undefined; - this._onDragStart = (event) => { - const { _dragging } = this; - if (!event.isPrimary && _dragging) { - // we have a second touch going on here, while we are dragging, so we aren't really dragging, so we - // will close this down - const state = this._nodeMap.get(_dragging); - state.dragResults.isDragging = false; - state.invalidate(); - this._dragging = undefined; - return; - } - if (event.button !== 0) { - // it isn't the primary button that is being clicked, so we will ignore this - return; - } - const data = this._getData(event.target); - if (data) { - const { state, target } = data; - this._dragging = target; - state.last = state.start = getPositionMatrix(event); - state.dragResults.delta = createPosition(); - state.dragResults.start = deepAssign({}, state.start); - state.dragResults.isDragging = true; - state.invalidate(); - event.preventDefault(); - event.stopPropagation(); - } // else, we are ignoring the event - }; - this._onDrag = (event) => { - const { _dragging } = this; - if (!_dragging) { - return; - } - // state cannot be unset, using ! operator - const state = this._nodeMap.get(_dragging); - state.last = getPositionMatrix(event); - state.dragResults.delta = getDelta(state.start, state.last); - if (!state.dragResults.start) { - state.dragResults.start = deepAssign({}, state.start); - } - state.invalidate(); - event.preventDefault(); - event.stopPropagation(); - }; - this._onDragStop = (event) => { - const { _dragging } = this; - if (!_dragging) { - return; - } - // state cannot be unset, using ! operator - const state = this._nodeMap.get(_dragging); - state.last = getPositionMatrix(event); - state.dragResults.delta = getDelta(state.start, state.last); - if (!state.dragResults.start) { - state.dragResults.start = deepAssign({}, state.start); - } - state.dragResults.isDragging = false; - state.invalidate(); - this._dragging = undefined; - event.preventDefault(); - event.stopPropagation(); - }; - const win = global.window; - win.addEventListener('pointerdown', this._onDragStart); - // Use capture phase, to determine the right node target, as it will be top down versus bottom up - win.addEventListener('pointermove', this._onDrag, true); - win.addEventListener('pointerup', this._onDragStop, true); - } - _getData(target) { - if (this._nodeMap.has(target)) { - return { state: this._nodeMap.get(target), target }; - } - if (target.parentElement) { - return this._getData(target.parentElement); - } - } - get(node, invalidate) { - const { _nodeMap } = this; - // first time we see a node, we will initialize its state and properties - if (!_nodeMap.has(node)) { - _nodeMap.set(node, createNodeData(invalidate)); - initNode(node); - return emptyResults; - } - const state = _nodeMap.get(node); - // shallow "clone" the results, so no downstream manipulation can occur - const dragResults = assign({}, state.dragResults); - // we are offering up an accurate delta, so we need to take the last event position and move it to the start so - // that our deltas are calculated from the last time they are read - state.start = state.last; - // reset the delta after we have read, as any future reads should have an empty delta - state.dragResults.delta = createPosition(); - // clear the start state - delete state.dragResults.start; - return dragResults; - } -} -const controller = new DragController(); -export class Drag extends Base { - constructor() { - super(...arguments); - this._boundInvalidate = this.invalidate.bind(this); - } - get(key) { - const node = this.getNode(key); - // if we don't have a reference to the node yet, return an empty set of results - if (!node) { - return emptyResults; - } - // otherwise we will ask the controller for our results - return controller.get(node, this._boundInvalidate); - } -} -export default Drag; -//# sourceMappingURL=Drag.mjs.map \ No newline at end of file diff --git a/deps/framework/widget-core/meta/Drag.mjs.map b/deps/framework/widget-core/meta/Drag.mjs.map deleted file mode 100644 index 49dac54abe..0000000000 --- a/deps/framework/widget-core/meta/Drag.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"Drag.mjs","sourceRoot":"","sources":["Drag.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,MAAM,MAAM,mBAAmB,CAAC;AACvC,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC3C,OAAO,OAAO,MAAM,oBAAoB,CAAC;AACzC,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AA2D9B,wBAAwB,UAAsB;IAC7C,MAAM,CAAC;QACN,WAAW,EAAE,UAAU,CAAC,EAAE,EAAE,YAAY,CAAC;QACzC,UAAU;QACV,IAAI,EAAE,oBAAoB,EAAE;QAC5B,KAAK,EAAE,oBAAoB,EAAE;KAC7B,CAAC;AACH,CAAC;AAED;;GAEG;AACH;IACC,MAAM,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC;AACvB,CAAC;AAED;;GAEG;AACH;IACC,MAAM,CAAC;QACN,MAAM,EAAE,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE;QACtB,MAAM,EAAE,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE;QACtB,IAAI,EAAE,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE;QACpB,MAAM,EAAE,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE;KACtB,CAAC;AACH,CAAC;AAED;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C,CAAC,CAAC;YACzB,QAAQ,CAAC,GAAG,CAAC,IAAI,EAAE,cAAc,CAAC,UAAU,CAAC,CAAC,CAAC;YAC/C,QAAQ,CAAC,IAAI,CAAC,CAAC;YACf,MAAM,CAAC,YAAY,CAAC;QACrB,CAAC;QAED,MAAM,KAAK,GAAG,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAE,CAAC;QAClC,uEAAuE;QACvE,MAAM,WAAW,GAAG,MAAM,CAAC,EAAE,EAAE,KAAK,CAAC,WAAW,CAAC,CAAC;QAClD,+GAA+G;QAC/G,kEAAkE;QAClE,KAAK,CAAC,KAAK,GAAG,KAAK,CAAC,IAAI,CAAC;QACzB,qFAAqF;QACrF,KAAK,CAAC,WAAW,CAAC,KAAK,GAAG,cAAc,EAAE,CAAC;QAC3C,wBAAwB;QACxB,OAAO,KAAK,CAAC,WAAW,CAAC,KAAK,CAAC;QAE/B,MAAM,CAAC,WAAW,CAAC;IACpB,CAAC;CACD;AAED,MAAM,UAAU,GAAG,IAAI,cAAc,EAAE,CAAC;AAExC,MAAM,WAAY,SAAQ,IAAI;IAA9B;;QACS,qBAAgB,GAAe,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAanE,CAAC;IAXO,GAAG,CAAC,GAAoB;QAC9B,MAAM,IAAI,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,CAAgB,CAAC;QAE9C,+EAA+E;QAC/E,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC;YACX,MAAM,CAAC,YAAY,CAAC;QACrB,CAAC;QAED,uDAAuD;QACvD,MAAM,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,EAAE,IAAI,CAAC,gBAAgB,CAAC,CAAC;IACpD,CAAC;CACD;AAED,eAAe,IAAI,CAAC","sourcesContent":["import { deepAssign } from '../../core/lang';\nimport global from '../../shim/global';\nimport { assign } from '../../shim/object';\nimport WeakMap from '../../shim/WeakMap';\nimport { Base } from './Base';\n\nexport interface DragResults {\n\t/**\n\t * The movement of pointer during the duration of the drag state\n\t */\n\tdelta: Position;\n\n\t/**\n\t * Is the DOM node currently in a drag state\n\t */\n\tisDragging: boolean;\n\n\t/**\n\t * A matrix of posistions that represent the start position for the current drag interaction\n\t */\n\tstart?: PositionMatrix;\n}\n\ninterface NodeData {\n\tdragResults: DragResults;\n\tinvalidate: () => void;\n\tlast: PositionMatrix;\n\tstart: PositionMatrix;\n}\n\n/**\n * An x/y position structure\n */\nexport interface Position {\n\tx: number;\n\ty: number;\n}\n\n/**\n * A matrix of x/y positions\n */\nexport interface PositionMatrix {\n\t/**\n\t * Client x/y position\n\t */\n\tclient: Position;\n\n\t/**\n\t * Offset x/y position\n\t */\n\toffset: Position;\n\n\t/**\n\t * Page x/y position\n\t */\n\tpage: Position;\n\n\t/**\n\t * Screen x/y position\n\t */\n\tscreen: Position;\n}\n\nfunction createNodeData(invalidate: () => void): NodeData {\n\treturn {\n\t\tdragResults: deepAssign({}, emptyResults),\n\t\tinvalidate,\n\t\tlast: createPositionMatrix(),\n\t\tstart: createPositionMatrix()\n\t};\n}\n\n/**\n * Creates an empty position\n */\nfunction createPosition(): Position {\n\treturn { x: 0, y: 0 };\n}\n\n/**\n * Create an empty position matrix\n */\nfunction createPositionMatrix(): PositionMatrix {\n\treturn {\n\t\tclient: { x: 0, y: 0 },\n\t\toffset: { x: 0, y: 0 },\n\t\tpage: { x: 0, y: 0 },\n\t\tscreen: { x: 0, y: 0 }\n\t};\n}\n\n/**\n * A frozen empty result object, frozen to ensure that no one downstream modifies it\n */\nconst emptyResults = Object.freeze({\n\tdelta: Object.freeze(createPosition()),\n\tisDragging: false\n});\n\n/**\n * Return the x/y position matrix for an event\n * @param event The pointer event\n */\nfunction getPositionMatrix(event: PointerEvent): PositionMatrix {\n\treturn {\n\t\tclient: {\n\t\t\tx: event.clientX,\n\t\t\ty: event.clientY\n\t\t},\n\t\toffset: {\n\t\t\tx: event.offsetX,\n\t\t\ty: event.offsetY\n\t\t},\n\t\tpage: {\n\t\t\tx: event.pageX,\n\t\t\ty: event.pageY\n\t\t},\n\t\tscreen: {\n\t\t\tx: event.screenX,\n\t\t\ty: event.screenY\n\t\t}\n\t};\n}\n\n/**\n * Return the delta position between two positions\n * @param start The first position\n * @param current The second position\n */\nfunction getDelta(start: PositionMatrix, current: PositionMatrix): Position {\n\treturn {\n\t\tx: current.client.x - start.client.x,\n\t\ty: current.client.y - start.client.y\n\t};\n}\n\n/**\n * Sets the `touch-action` on nodes so that PointerEvents are always emitted for the node\n * @param node The node to init\n */\nfunction initNode(node: HTMLElement): void {\n\t// Ensure that the node has `touch-action` none\n\tnode.style.touchAction = 'none';\n\t// PEP requires an attribute of `touch-action` to be set on the element\n\tnode.setAttribute('touch-action', 'none');\n}\n\nclass DragController {\n\tprivate _nodeMap = new WeakMap();\n\tprivate _dragging: HTMLElement | undefined = undefined;\n\n\tprivate _getData(target: HTMLElement): { state: NodeData; target: HTMLElement } | undefined {\n\t\tif (this._nodeMap.has(target)) {\n\t\t\treturn { state: this._nodeMap.get(target)!, target };\n\t\t}\n\t\tif (target.parentElement) {\n\t\t\treturn this._getData(target.parentElement);\n\t\t}\n\t}\n\n\tprivate _onDragStart = (event: PointerEvent) => {\n\t\tconst { _dragging } = this;\n\t\tif (!event.isPrimary && _dragging) {\n\t\t\t// we have a second touch going on here, while we are dragging, so we aren't really dragging, so we\n\t\t\t// will close this down\n\t\t\tconst state = this._nodeMap.get(_dragging)!;\n\t\t\tstate.dragResults.isDragging = false;\n\t\t\tstate.invalidate();\n\t\t\tthis._dragging = undefined;\n\t\t\treturn;\n\t\t}\n\t\tif (event.button !== 0) {\n\t\t\t// it isn't the primary button that is being clicked, so we will ignore this\n\t\t\treturn;\n\t\t}\n\t\tconst data = this._getData(event.target as HTMLElement);\n\t\tif (data) {\n\t\t\tconst { state, target } = data;\n\t\t\tthis._dragging = target;\n\t\t\tstate.last = state.start = getPositionMatrix(event);\n\t\t\tstate.dragResults.delta = createPosition();\n\t\t\tstate.dragResults.start = deepAssign({}, state.start);\n\t\t\tstate.dragResults.isDragging = true;\n\t\t\tstate.invalidate();\n\n\t\t\tevent.preventDefault();\n\t\t\tevent.stopPropagation();\n\t\t} // else, we are ignoring the event\n\t};\n\n\tprivate _onDrag = (event: PointerEvent) => {\n\t\tconst { _dragging } = this;\n\t\tif (!_dragging) {\n\t\t\treturn;\n\t\t}\n\t\t// state cannot be unset, using ! operator\n\t\tconst state = this._nodeMap.get(_dragging)!;\n\t\tstate.last = getPositionMatrix(event);\n\t\tstate.dragResults.delta = getDelta(state.start, state.last);\n\t\tif (!state.dragResults.start) {\n\t\t\tstate.dragResults.start = deepAssign({}, state.start);\n\t\t}\n\t\tstate.invalidate();\n\n\t\tevent.preventDefault();\n\t\tevent.stopPropagation();\n\t};\n\n\tprivate _onDragStop = (event: PointerEvent) => {\n\t\tconst { _dragging } = this;\n\t\tif (!_dragging) {\n\t\t\treturn;\n\t\t}\n\t\t// state cannot be unset, using ! operator\n\t\tconst state = this._nodeMap.get(_dragging)!;\n\t\tstate.last = getPositionMatrix(event);\n\t\tstate.dragResults.delta = getDelta(state.start, state.last);\n\t\tif (!state.dragResults.start) {\n\t\t\tstate.dragResults.start = deepAssign({}, state.start);\n\t\t}\n\t\tstate.dragResults.isDragging = false;\n\t\tstate.invalidate();\n\t\tthis._dragging = undefined;\n\n\t\tevent.preventDefault();\n\t\tevent.stopPropagation();\n\t};\n\n\tconstructor() {\n\t\tconst win: Window = global.window;\n\t\twin.addEventListener('pointerdown', this._onDragStart);\n\t\t// Use capture phase, to determine the right node target, as it will be top down versus bottom up\n\t\twin.addEventListener('pointermove', this._onDrag, true);\n\t\twin.addEventListener('pointerup', this._onDragStop, true);\n\t}\n\n\tpublic get(node: HTMLElement, invalidate: () => void): DragResults {\n\t\tconst { _nodeMap } = this;\n\t\t// first time we see a node, we will initialize its state and properties\n\t\tif (!_nodeMap.has(node)) {\n\t\t\t_nodeMap.set(node, createNodeData(invalidate));\n\t\t\tinitNode(node);\n\t\t\treturn emptyResults;\n\t\t}\n\n\t\tconst state = _nodeMap.get(node)!;\n\t\t// shallow \"clone\" the results, so no downstream manipulation can occur\n\t\tconst dragResults = assign({}, state.dragResults);\n\t\t// we are offering up an accurate delta, so we need to take the last event position and move it to the start so\n\t\t// that our deltas are calculated from the last time they are read\n\t\tstate.start = state.last;\n\t\t// reset the delta after we have read, as any future reads should have an empty delta\n\t\tstate.dragResults.delta = createPosition();\n\t\t// clear the start state\n\t\tdelete state.dragResults.start;\n\n\t\treturn dragResults;\n\t}\n}\n\nconst controller = new DragController();\n\nexport class Drag extends Base {\n\tprivate _boundInvalidate: () => void = this.invalidate.bind(this);\n\n\tpublic get(key: string | number): Readonly {\n\t\tconst node = this.getNode(key) as HTMLElement;\n\n\t\t// if we don't have a reference to the node yet, return an empty set of results\n\t\tif (!node) {\n\t\t\treturn emptyResults;\n\t\t}\n\n\t\t// otherwise we will ask the controller for our results\n\t\treturn controller.get(node, this._boundInvalidate);\n\t}\n}\n\nexport default Drag;\n"]} \ No newline at end of file diff --git a/deps/framework/widget-core/meta/Focus.d.ts b/deps/framework/widget-core/meta/Focus.d.ts deleted file mode 100644 index 8566bbe654..0000000000 --- a/deps/framework/widget-core/meta/Focus.d.ts +++ /dev/null @@ -1,14 +0,0 @@ -import { Base } from './Base'; -export interface FocusResults { - active: boolean; - containsFocus: boolean; -} -export declare class Focus extends Base { - private _activeElement; - get(key: string | number): FocusResults; - set(key: string | number): void; - private _onFocusChange; - private _createListener(); - private _removeListener(); -} -export default Focus; diff --git a/deps/framework/widget-core/meta/Focus.js b/deps/framework/widget-core/meta/Focus.js deleted file mode 100644 index f719b3947f..0000000000 --- a/deps/framework/widget-core/meta/Focus.js +++ /dev/null @@ -1,62 +0,0 @@ -(function (factory) { - if (typeof module === "object" && typeof module.exports === "object") { - var v = factory(require, exports); - if (v !== undefined) module.exports = v; - } - else if (typeof define === "function" && define.amd) { - define(["require", "exports", "tslib", "./Base", "../../core/lang", "../../shim/global"], factory); - } -})(function (require, exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - var tslib_1 = require("tslib"); - var Base_1 = require("./Base"); - var lang_1 = require("../../core/lang"); - var global_1 = require("../../shim/global"); - var defaultResults = { - active: false, - containsFocus: false - }; - var Focus = /** @class */ (function (_super) { - tslib_1.__extends(Focus, _super); - function Focus() { - var _this = _super !== null && _super.apply(this, arguments) || this; - _this._onFocusChange = function () { - _this._activeElement = global_1.default.document.activeElement; - _this.invalidate(); - }; - return _this; - } - Focus.prototype.get = function (key) { - var node = this.getNode(key); - if (!node) { - return tslib_1.__assign({}, defaultResults); - } - if (!this._activeElement) { - this._activeElement = global_1.default.document.activeElement; - this._createListener(); - } - return { - active: node === this._activeElement, - containsFocus: !!this._activeElement && node.contains(this._activeElement) - }; - }; - Focus.prototype.set = function (key) { - var node = this.getNode(key); - node && node.focus(); - }; - Focus.prototype._createListener = function () { - global_1.default.document.addEventListener('focusin', this._onFocusChange); - global_1.default.document.addEventListener('focusout', this._onFocusChange); - this.own(lang_1.createHandle(this._removeListener.bind(this))); - }; - Focus.prototype._removeListener = function () { - global_1.default.document.removeEventListener('focusin', this._onFocusChange); - global_1.default.document.removeEventListener('focusout', this._onFocusChange); - }; - return Focus; - }(Base_1.Base)); - exports.Focus = Focus; - exports.default = Focus; -}); -//# sourceMappingURL=Focus.js.map \ No newline at end of file diff --git a/deps/framework/widget-core/meta/Focus.js.map b/deps/framework/widget-core/meta/Focus.js.map deleted file mode 100644 index f90b4ecf62..0000000000 --- a/deps/framework/widget-core/meta/Focus.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"Focus.js","sourceRoot":"","sources":["Focus.ts"],"names":[],"mappings":";;;;;;;;;;;;IAAA,+BAA8B;IAC9B,wCAA+C;IAC/C,4CAAuC;IAOvC,IAAM,cAAc,GAAG;QACtB,MAAM,EAAE,KAAK;QACb,aAAa,EAAE,KAAK;KACpB,CAAC;IAEF;QAA2B,iCAAI;QAA/B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AC;QAEO,+BAAe,GAAvB;YACC,gBAAM,CAAC,QAAQ,CAAC,mBAAmB,CAAC,SAAS,EAAE,IAAI,CAAC,cAAc,CAAC,CAAC;YACpE,gBAAM,CAAC,QAAQ,CAAC,mBAAmB,CAAC,UAAU,EAAE,IAAI,CAAC,cAAc,CAAC,CAAC;QACtE,CAAC;QACF,YAAC;IAAD,CAAC,AAzCD,CAA2B,WAAI,GAyC9B;IAzCY,sBAAK;IA2ClB,kBAAe,KAAK,CAAC","sourcesContent":["import { Base } from './Base';\nimport { createHandle } from '../../core/lang';\nimport global from '../../shim/global';\n\nexport interface FocusResults {\n\tactive: boolean;\n\tcontainsFocus: boolean;\n}\n\nconst defaultResults = {\n\tactive: false,\n\tcontainsFocus: false\n};\n\nexport class Focus extends Base {\n\tprivate _activeElement: Element | undefined;\n\n\tpublic get(key: string | number): FocusResults {\n\t\tconst node = this.getNode(key);\n\n\t\tif (!node) {\n\t\t\treturn { ...defaultResults };\n\t\t}\n\n\t\tif (!this._activeElement) {\n\t\t\tthis._activeElement = global.document.activeElement;\n\t\t\tthis._createListener();\n\t\t}\n\n\t\treturn {\n\t\t\tactive: node === this._activeElement,\n\t\t\tcontainsFocus: !!this._activeElement && node.contains(this._activeElement)\n\t\t};\n\t}\n\n\tpublic set(key: string | number) {\n\t\tconst node = this.getNode(key);\n\t\tnode && (node as HTMLElement).focus();\n\t}\n\n\tprivate _onFocusChange = () => {\n\t\tthis._activeElement = global.document.activeElement;\n\t\tthis.invalidate();\n\t};\n\n\tprivate _createListener() {\n\t\tglobal.document.addEventListener('focusin', this._onFocusChange);\n\t\tglobal.document.addEventListener('focusout', this._onFocusChange);\n\t\tthis.own(createHandle(this._removeListener.bind(this)));\n\t}\n\n\tprivate _removeListener() {\n\t\tglobal.document.removeEventListener('focusin', this._onFocusChange);\n\t\tglobal.document.removeEventListener('focusout', this._onFocusChange);\n\t}\n}\n\nexport default Focus;\n"]} \ No newline at end of file diff --git a/deps/framework/widget-core/meta/Focus.mjs b/deps/framework/widget-core/meta/Focus.mjs deleted file mode 100644 index 0644c7c648..0000000000 --- a/deps/framework/widget-core/meta/Focus.mjs +++ /dev/null @@ -1,45 +0,0 @@ -import { Base } from './Base'; -import { createHandle } from '../../core/lang'; -import global from '../../shim/global'; -const defaultResults = { - active: false, - containsFocus: false -}; -export class Focus extends Base { - constructor() { - super(...arguments); - this._onFocusChange = () => { - this._activeElement = global.document.activeElement; - this.invalidate(); - }; - } - get(key) { - const node = this.getNode(key); - if (!node) { - return Object.assign({}, defaultResults); - } - if (!this._activeElement) { - this._activeElement = global.document.activeElement; - this._createListener(); - } - return { - active: node === this._activeElement, - containsFocus: !!this._activeElement && node.contains(this._activeElement) - }; - } - set(key) { - const node = this.getNode(key); - node && node.focus(); - } - _createListener() { - global.document.addEventListener('focusin', this._onFocusChange); - global.document.addEventListener('focusout', this._onFocusChange); - this.own(createHandle(this._removeListener.bind(this))); - } - _removeListener() { - global.document.removeEventListener('focusin', this._onFocusChange); - global.document.removeEventListener('focusout', this._onFocusChange); - } -} -export default Focus; -//# sourceMappingURL=Focus.mjs.map \ No newline at end of file diff --git a/deps/framework/widget-core/meta/Focus.mjs.map b/deps/framework/widget-core/meta/Focus.mjs.map deleted file mode 100644 index deb2c1addc..0000000000 --- a/deps/framework/widget-core/meta/Focus.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"Focus.mjs","sourceRoot":"","sources":["Focus.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAC9B,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,MAAM,MAAM,mBAAmB,CAAC;AAOvC,MAAM,cAAc,GAAG;IACtB,MAAM,EAAE,KAAK;IACb,aAAa,EAAE,KAAK;CACpB,CAAC;AAEF,MAAM,YAAa,SAAQ,IAAI;IAA/B;;QA0BS,mBAAc,GAAG,GAAG,EAAE;YAC7B,IAAI,CAAC,cAAc,GAAG,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QACpE,MAAM,CAAC,QAAQ,CAAC,mBAAmB,CAAC,UAAU,EAAE,IAAI,CAAC,cAAc,CAAC,CAAC;IACtE,CAAC;CACD;AAED,eAAe,KAAK,CAAC","sourcesContent":["import { Base } from './Base';\nimport { createHandle } from '../../core/lang';\nimport global from '../../shim/global';\n\nexport interface FocusResults {\n\tactive: boolean;\n\tcontainsFocus: boolean;\n}\n\nconst defaultResults = {\n\tactive: false,\n\tcontainsFocus: false\n};\n\nexport class Focus extends Base {\n\tprivate _activeElement: Element | undefined;\n\n\tpublic get(key: string | number): FocusResults {\n\t\tconst node = this.getNode(key);\n\n\t\tif (!node) {\n\t\t\treturn { ...defaultResults };\n\t\t}\n\n\t\tif (!this._activeElement) {\n\t\t\tthis._activeElement = global.document.activeElement;\n\t\t\tthis._createListener();\n\t\t}\n\n\t\treturn {\n\t\t\tactive: node === this._activeElement,\n\t\t\tcontainsFocus: !!this._activeElement && node.contains(this._activeElement)\n\t\t};\n\t}\n\n\tpublic set(key: string | number) {\n\t\tconst node = this.getNode(key);\n\t\tnode && (node as HTMLElement).focus();\n\t}\n\n\tprivate _onFocusChange = () => {\n\t\tthis._activeElement = global.document.activeElement;\n\t\tthis.invalidate();\n\t};\n\n\tprivate _createListener() {\n\t\tglobal.document.addEventListener('focusin', this._onFocusChange);\n\t\tglobal.document.addEventListener('focusout', this._onFocusChange);\n\t\tthis.own(createHandle(this._removeListener.bind(this)));\n\t}\n\n\tprivate _removeListener() {\n\t\tglobal.document.removeEventListener('focusin', this._onFocusChange);\n\t\tglobal.document.removeEventListener('focusout', this._onFocusChange);\n\t}\n}\n\nexport default Focus;\n"]} \ No newline at end of file diff --git a/deps/framework/widget-core/meta/Intersection.d.ts b/deps/framework/widget-core/meta/Intersection.d.ts deleted file mode 100644 index 5631a7c6b8..0000000000 --- a/deps/framework/widget-core/meta/Intersection.d.ts +++ /dev/null @@ -1,31 +0,0 @@ -import { Base } from './Base'; -export interface IntersectionGetOptions { - root?: string; - rootMargin?: string; - threshold?: number[]; -} -export interface IntersectionResult { - intersectionRatio: number; - isIntersecting: boolean; -} -export declare class Intersection extends Base { - private readonly _details; - /** - * Return an `InteractionResult` for the requested key and options. - * - * @param key The key to return the intersection meta for - * @param options The options for the request - */ - get(key: string | number, options?: IntersectionGetOptions): IntersectionResult; - /** - * Returns true if the node for the key has intersection details - * - * @param key The key to return the intersection meta for - * @param options The options for the request - */ - has(key: string | number, options?: IntersectionGetOptions): boolean; - private _createDetails(options, rootNode?); - private _getDetails(options?); - private _onIntersect; -} -export default Intersection; diff --git a/deps/framework/widget-core/meta/Intersection.js b/deps/framework/widget-core/meta/Intersection.js deleted file mode 100644 index 064305fb5f..0000000000 --- a/deps/framework/widget-core/meta/Intersection.js +++ /dev/null @@ -1,102 +0,0 @@ -(function (factory) { - if (typeof module === "object" && typeof module.exports === "object") { - var v = factory(require, exports); - if (v !== undefined) module.exports = v; - } - else if (typeof define === "function" && define.amd) { - define(["require", "exports", "tslib", "../../shim/global", "../../shim/WeakMap", "../../shim/Map", "../../core/lang", "./Base"], factory); - } -})(function (require, exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - var tslib_1 = require("tslib"); - var global_1 = require("../../shim/global"); - var WeakMap_1 = require("../../shim/WeakMap"); - var Map_1 = require("../../shim/Map"); - var lang_1 = require("../../core/lang"); - var Base_1 = require("./Base"); - var defaultIntersection = Object.freeze({ - intersectionRatio: 0, - isIntersecting: false - }); - var Intersection = /** @class */ (function (_super) { - tslib_1.__extends(Intersection, _super); - function Intersection() { - var _this = _super !== null && _super.apply(this, arguments) || this; - _this._details = new Map_1.default(); - _this._onIntersect = function (detailEntries) { - return function (entries) { - try { - for (var entries_1 = tslib_1.__values(entries), entries_1_1 = entries_1.next(); !entries_1_1.done; entries_1_1 = entries_1.next()) { - var _a = entries_1_1.value, intersectionRatio = _a.intersectionRatio, isIntersecting = _a.isIntersecting, target = _a.target; - detailEntries.set(target, { intersectionRatio: intersectionRatio, isIntersecting: isIntersecting }); - } - } - catch (e_1_1) { e_1 = { error: e_1_1 }; } - finally { - try { - if (entries_1_1 && !entries_1_1.done && (_b = entries_1.return)) _b.call(entries_1); - } - finally { if (e_1) throw e_1.error; } - } - _this.invalidate(); - var e_1, _b; - }; - }; - return _this; - } - /** - * Return an `InteractionResult` for the requested key and options. - * - * @param key The key to return the intersection meta for - * @param options The options for the request - */ - Intersection.prototype.get = function (key, options) { - if (options === void 0) { options = {}; } - var rootNode; - if (options.root) { - rootNode = this.getNode(options.root); - if (!rootNode) { - return defaultIntersection; - } - } - var node = this.getNode(key); - if (!node) { - return defaultIntersection; - } - var details = this._getDetails(options) || this._createDetails(options, rootNode); - if (!details.entries.get(node)) { - details.entries.set(node, defaultIntersection); - details.observer.observe(node); - } - return details.entries.get(node) || defaultIntersection; - }; - /** - * Returns true if the node for the key has intersection details - * - * @param key The key to return the intersection meta for - * @param options The options for the request - */ - Intersection.prototype.has = function (key, options) { - var node = this.getNode(key); - var details = this._getDetails(options); - return Boolean(details && node && details.entries.has(node)); - }; - Intersection.prototype._createDetails = function (options, rootNode) { - var entries = new WeakMap_1.default(); - var observer = new global_1.default.IntersectionObserver(this._onIntersect(entries), tslib_1.__assign({}, options, { root: rootNode })); - var details = tslib_1.__assign({ observer: observer, entries: entries }, options); - this._details.set(JSON.stringify(options), details); - this.own(lang_1.createHandle(function () { return observer.disconnect(); })); - return details; - }; - Intersection.prototype._getDetails = function (options) { - if (options === void 0) { options = {}; } - return this._details.get(JSON.stringify(options)); - }; - return Intersection; - }(Base_1.Base)); - exports.Intersection = Intersection; - exports.default = Intersection; -}); -//# sourceMappingURL=Intersection.js.map \ No newline at end of file diff --git a/deps/framework/widget-core/meta/Intersection.js.map b/deps/framework/widget-core/meta/Intersection.js.map deleted file mode 100644 index e5b0c5cde4..0000000000 --- a/deps/framework/widget-core/meta/Intersection.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"Intersection.js","sourceRoot":"","sources":["Intersection.ts"],"names":[],"mappings":";;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,CAAC,GAAG,CAAC,mBAAY,CAAC,cAAM,OAAA,QAAQ,CAAC,UAAU,EAAE,EAArB,CAAqB,CAAC,CAAC,CAAC;YACpD,MAAM,CAAC,OAAO,CAAC;QAChB,CAAC;QAEO,kCAAW,GAAnB,UAAoB,OAAoC;YAApC,wBAAA,EAAA,YAAoC;YACvD,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,CAAC;QACnD,CAAC;QAUF,mBAAC;IAAD,CAAC,AAjED,CAAkC,WAAI,GAiErC;IAjEY,oCAAY;IAmEzB,kBAAe,YAAY,CAAC","sourcesContent":["import global from '../../shim/global';\nimport WeakMap from '../../shim/WeakMap';\nimport Map from '../../shim/Map';\nimport { createHandle } from '../../core/lang';\nimport { Base } from './Base';\n\ninterface ExtendedIntersectionObserverEntry extends IntersectionObserverEntry {\n\treadonly isIntersecting: boolean;\n}\n\ninterface IntersectionDetail extends IntersectionGetOptions {\n\tentries: WeakMap;\n\tobserver: IntersectionObserver;\n}\n\nexport interface IntersectionGetOptions {\n\troot?: string;\n\trootMargin?: string;\n\tthreshold?: number[];\n}\n\nexport interface IntersectionResult {\n\tintersectionRatio: number;\n\tisIntersecting: boolean;\n}\n\nconst defaultIntersection: IntersectionResult = Object.freeze({\n\tintersectionRatio: 0,\n\tisIntersecting: false\n});\n\nexport class Intersection extends Base {\n\tprivate readonly _details = new Map();\n\n\t/**\n\t * Return an `InteractionResult` for the requested key and options.\n\t *\n\t * @param key The key to return the intersection meta for\n\t * @param options The options for the request\n\t */\n\tpublic get(key: string | number, options: IntersectionGetOptions = {}): IntersectionResult {\n\t\tlet rootNode: HTMLElement | undefined;\n\t\tif (options.root) {\n\t\t\trootNode = this.getNode(options.root) as HTMLElement;\n\t\t\tif (!rootNode) {\n\t\t\t\treturn defaultIntersection;\n\t\t\t}\n\t\t}\n\t\tconst node = this.getNode(key);\n\t\tif (!node) {\n\t\t\treturn defaultIntersection;\n\t\t}\n\n\t\tlet details = this._getDetails(options) || this._createDetails(options, rootNode);\n\t\tif (!details.entries.get(node)) {\n\t\t\tdetails.entries.set(node, defaultIntersection);\n\t\t\tdetails.observer.observe(node);\n\t\t}\n\n\t\treturn details.entries.get(node) || defaultIntersection;\n\t}\n\n\t/**\n\t * Returns true if the node for the key has intersection details\n\t *\n\t * @param key The key to return the intersection meta for\n\t * @param options The options for the request\n\t */\n\tpublic has(key: string | number, options?: IntersectionGetOptions): boolean {\n\t\tconst node = this.getNode(key);\n\t\tconst details = this._getDetails(options);\n\t\treturn Boolean(details && node && details.entries.has(node));\n\t}\n\n\tprivate _createDetails(options: IntersectionGetOptions, rootNode?: HTMLElement): IntersectionDetail {\n\t\tconst entries = new WeakMap();\n\t\tconst observer = new global.IntersectionObserver(this._onIntersect(entries), { ...options, root: rootNode });\n\t\tconst details = { observer, entries, ...options };\n\n\t\tthis._details.set(JSON.stringify(options), details);\n\t\tthis.own(createHandle(() => observer.disconnect()));\n\t\treturn details;\n\t}\n\n\tprivate _getDetails(options: IntersectionGetOptions = {}): IntersectionDetail | undefined {\n\t\treturn this._details.get(JSON.stringify(options));\n\t}\n\n\tprivate _onIntersect = (detailEntries: WeakMap) => {\n\t\treturn (entries: ExtendedIntersectionObserverEntry[]) => {\n\t\t\tfor (const { intersectionRatio, isIntersecting, target } of entries) {\n\t\t\t\tdetailEntries.set(target, { intersectionRatio, isIntersecting });\n\t\t\t}\n\t\t\tthis.invalidate();\n\t\t};\n\t};\n}\n\nexport default Intersection;\n"]} \ No newline at end of file diff --git a/deps/framework/widget-core/meta/Intersection.mjs b/deps/framework/widget-core/meta/Intersection.mjs deleted file mode 100644 index e845b72f8f..0000000000 --- a/deps/framework/widget-core/meta/Intersection.mjs +++ /dev/null @@ -1,72 +0,0 @@ -import global from '../../shim/global'; -import WeakMap from '../../shim/WeakMap'; -import Map from '../../shim/Map'; -import { createHandle } from '../../core/lang'; -import { Base } from './Base'; -const defaultIntersection = Object.freeze({ - intersectionRatio: 0, - isIntersecting: false -}); -export class Intersection extends Base { - constructor() { - super(...arguments); - this._details = new Map(); - this._onIntersect = (detailEntries) => { - return (entries) => { - for (const { intersectionRatio, isIntersecting, target } of entries) { - detailEntries.set(target, { intersectionRatio, isIntersecting }); - } - this.invalidate(); - }; - }; - } - /** - * Return an `InteractionResult` for the requested key and options. - * - * @param key The key to return the intersection meta for - * @param options The options for the request - */ - get(key, options = {}) { - let rootNode; - if (options.root) { - rootNode = this.getNode(options.root); - if (!rootNode) { - return defaultIntersection; - } - } - const node = this.getNode(key); - if (!node) { - return defaultIntersection; - } - let details = this._getDetails(options) || this._createDetails(options, rootNode); - if (!details.entries.get(node)) { - details.entries.set(node, defaultIntersection); - details.observer.observe(node); - } - return details.entries.get(node) || defaultIntersection; - } - /** - * Returns true if the node for the key has intersection details - * - * @param key The key to return the intersection meta for - * @param options The options for the request - */ - has(key, options) { - const node = this.getNode(key); - const details = this._getDetails(options); - return Boolean(details && node && details.entries.has(node)); - } - _createDetails(options, rootNode) { - const entries = new WeakMap(); - const observer = new global.IntersectionObserver(this._onIntersect(entries), Object.assign({}, options, { root: rootNode })); - const details = Object.assign({ observer, entries }, options); - this._details.set(JSON.stringify(options), details); - this.own(createHandle(() => observer.disconnect())); - return details; - } - _getDetails(options = {}) { - return this._details.get(JSON.stringify(options)); - } -} -export default Intersection; -//# sourceMappingURL=Intersection.mjs.map \ No newline at end of file diff --git a/deps/framework/widget-core/meta/Intersection.mjs.map b/deps/framework/widget-core/meta/Intersection.mjs.map deleted file mode 100644 index b200cbfb37..0000000000 --- a/deps/framework/widget-core/meta/Intersection.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"Intersection.mjs","sourceRoot":"","sources":["Intersection.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,mBAAmB,CAAC;AACvC,OAAO,OAAO,MAAM,oBAAoB,CAAC;AACzC,OAAO,GAAG,MAAM,gBAAgB,CAAC;AACjC,OAAO,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AC;QACpD,MAAM,CAAC,OAAO,CAAC;IAChB,CAAC;IAEO,WAAW,CAAC,UAAkC,EAAE;QACvD,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,CAAC;IACnD,CAAC;CAUD;AAED,eAAe,YAAY,CAAC","sourcesContent":["import global from '../../shim/global';\nimport WeakMap from '../../shim/WeakMap';\nimport Map from '../../shim/Map';\nimport { createHandle } from '../../core/lang';\nimport { Base } from './Base';\n\ninterface ExtendedIntersectionObserverEntry extends IntersectionObserverEntry {\n\treadonly isIntersecting: boolean;\n}\n\ninterface IntersectionDetail extends IntersectionGetOptions {\n\tentries: WeakMap;\n\tobserver: IntersectionObserver;\n}\n\nexport interface IntersectionGetOptions {\n\troot?: string;\n\trootMargin?: string;\n\tthreshold?: number[];\n}\n\nexport interface IntersectionResult {\n\tintersectionRatio: number;\n\tisIntersecting: boolean;\n}\n\nconst defaultIntersection: IntersectionResult = Object.freeze({\n\tintersectionRatio: 0,\n\tisIntersecting: false\n});\n\nexport class Intersection extends Base {\n\tprivate readonly _details = new Map();\n\n\t/**\n\t * Return an `InteractionResult` for the requested key and options.\n\t *\n\t * @param key The key to return the intersection meta for\n\t * @param options The options for the request\n\t */\n\tpublic get(key: string | number, options: IntersectionGetOptions = {}): IntersectionResult {\n\t\tlet rootNode: HTMLElement | undefined;\n\t\tif (options.root) {\n\t\t\trootNode = this.getNode(options.root) as HTMLElement;\n\t\t\tif (!rootNode) {\n\t\t\t\treturn defaultIntersection;\n\t\t\t}\n\t\t}\n\t\tconst node = this.getNode(key);\n\t\tif (!node) {\n\t\t\treturn defaultIntersection;\n\t\t}\n\n\t\tlet details = this._getDetails(options) || this._createDetails(options, rootNode);\n\t\tif (!details.entries.get(node)) {\n\t\t\tdetails.entries.set(node, defaultIntersection);\n\t\t\tdetails.observer.observe(node);\n\t\t}\n\n\t\treturn details.entries.get(node) || defaultIntersection;\n\t}\n\n\t/**\n\t * Returns true if the node for the key has intersection details\n\t *\n\t * @param key The key to return the intersection meta for\n\t * @param options The options for the request\n\t */\n\tpublic has(key: string | number, options?: IntersectionGetOptions): boolean {\n\t\tconst node = this.getNode(key);\n\t\tconst details = this._getDetails(options);\n\t\treturn Boolean(details && node && details.entries.has(node));\n\t}\n\n\tprivate _createDetails(options: IntersectionGetOptions, rootNode?: HTMLElement): IntersectionDetail {\n\t\tconst entries = new WeakMap();\n\t\tconst observer = new global.IntersectionObserver(this._onIntersect(entries), { ...options, root: rootNode });\n\t\tconst details = { observer, entries, ...options };\n\n\t\tthis._details.set(JSON.stringify(options), details);\n\t\tthis.own(createHandle(() => observer.disconnect()));\n\t\treturn details;\n\t}\n\n\tprivate _getDetails(options: IntersectionGetOptions = {}): IntersectionDetail | undefined {\n\t\treturn this._details.get(JSON.stringify(options));\n\t}\n\n\tprivate _onIntersect = (detailEntries: WeakMap) => {\n\t\treturn (entries: ExtendedIntersectionObserverEntry[]) => {\n\t\t\tfor (const { intersectionRatio, isIntersecting, target } of entries) {\n\t\t\t\tdetailEntries.set(target, { intersectionRatio, isIntersecting });\n\t\t\t}\n\t\t\tthis.invalidate();\n\t\t};\n\t};\n}\n\nexport default Intersection;\n"]} \ No newline at end of file diff --git a/deps/framework/widget-core/meta/Matches.d.ts b/deps/framework/widget-core/meta/Matches.d.ts deleted file mode 100644 index 60e5b914c3..0000000000 --- a/deps/framework/widget-core/meta/Matches.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { Base } from './Base'; -export default class Matches extends Base { - /** - * Determine if the target of a particular `Event` matches the virtual DOM key - * @param key The virtual DOM key - * @param event The event object - */ - get(key: string | number, event: Event): boolean; -} diff --git a/deps/framework/widget-core/meta/Matches.js b/deps/framework/widget-core/meta/Matches.js deleted file mode 100644 index f59b8a53ab..0000000000 --- a/deps/framework/widget-core/meta/Matches.js +++ /dev/null @@ -1,31 +0,0 @@ -(function (factory) { - if (typeof module === "object" && typeof module.exports === "object") { - var v = factory(require, exports); - if (v !== undefined) module.exports = v; - } - else if (typeof define === "function" && define.amd) { - define(["require", "exports", "tslib", "./Base"], factory); - } -})(function (require, exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - var tslib_1 = require("tslib"); - var Base_1 = require("./Base"); - var Matches = /** @class */ (function (_super) { - tslib_1.__extends(Matches, _super); - function Matches() { - return _super !== null && _super.apply(this, arguments) || this; - } - /** - * Determine if the target of a particular `Event` matches the virtual DOM key - * @param key The virtual DOM key - * @param event The event object - */ - Matches.prototype.get = function (key, event) { - return this.getNode(key) === event.target; - }; - return Matches; - }(Base_1.Base)); - exports.default = Matches; -}); -//# sourceMappingURL=Matches.js.map \ No newline at end of file diff --git a/deps/framework/widget-core/meta/Matches.js.map b/deps/framework/widget-core/meta/Matches.js.map deleted file mode 100644 index dfe53f4b91..0000000000 --- a/deps/framework/widget-core/meta/Matches.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"Matches.js","sourceRoot":"","sources":["Matches.ts"],"names":[],"mappings":";;;;;;;;;;;;IAAA,+BAA8B;IAE9B;QAAqC,mCAAI;QAAzC;;QASA,CAAC;QARA;;;;WAIG;QACI,qBAAG,GAAV,UAAW,GAAoB,EAAE,KAAY;YAC5C,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,KAAK,CAAC,MAAM,CAAC;QAC3C,CAAC;QACF,cAAC;IAAD,CAAC,AATD,CAAqC,WAAI,GASxC","sourcesContent":["import { Base } from './Base';\n\nexport default class Matches extends Base {\n\t/**\n\t * Determine if the target of a particular `Event` matches the virtual DOM key\n\t * @param key The virtual DOM key\n\t * @param event The event object\n\t */\n\tpublic get(key: string | number, event: Event): boolean {\n\t\treturn this.getNode(key) === event.target;\n\t}\n}\n"]} \ No newline at end of file diff --git a/deps/framework/widget-core/meta/Matches.mjs b/deps/framework/widget-core/meta/Matches.mjs deleted file mode 100644 index c81d039e4b..0000000000 --- a/deps/framework/widget-core/meta/Matches.mjs +++ /dev/null @@ -1,12 +0,0 @@ -import { Base } from './Base'; -export default class Matches extends Base { - /** - * Determine if the target of a particular `Event` matches the virtual DOM key - * @param key The virtual DOM key - * @param event The event object - */ - get(key, event) { - return this.getNode(key) === event.target; - } -} -//# sourceMappingURL=Matches.mjs.map \ No newline at end of file diff --git a/deps/framework/widget-core/meta/Matches.mjs.map b/deps/framework/widget-core/meta/Matches.mjs.map deleted file mode 100644 index bd5c2856b6..0000000000 --- a/deps/framework/widget-core/meta/Matches.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"Matches.mjs","sourceRoot":"","sources":["Matches.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAE9B,MAAM,CAAC,OAAO,cAAe,SAAQ,IAAI;IACxC;;;;OAIG;IACI,GAAG,CAAC,GAAoB,EAAE,KAAY;QAC5C,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,KAAK,CAAC,MAAM,CAAC;IAC3C,CAAC;CACD","sourcesContent":["import { Base } from './Base';\n\nexport default class Matches extends Base {\n\t/**\n\t * Determine if the target of a particular `Event` matches the virtual DOM key\n\t * @param key The virtual DOM key\n\t * @param event The event object\n\t */\n\tpublic get(key: string | number, event: Event): boolean {\n\t\treturn this.getNode(key) === event.target;\n\t}\n}\n"]} \ No newline at end of file diff --git a/deps/framework/widget-core/meta/Resize.d.ts b/deps/framework/widget-core/meta/Resize.d.ts deleted file mode 100644 index f2a27092db..0000000000 --- a/deps/framework/widget-core/meta/Resize.d.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { Base } from './Base'; -export interface ContentRect { - readonly bottom: number; - readonly height: number; - readonly left: number; - readonly right: number; - readonly top: number; - readonly width: number; - readonly x: number; - readonly y: number; -} -export interface PredicateFunction { - (contentRect: ContentRect): boolean; -} -export interface PredicateFunctions { - [id: string]: PredicateFunction; -} -export declare type PredicateResponses = { - [id in keyof T]: boolean; -}; -export declare class Resize extends Base { - private _details; - get(key: string | number, predicates?: PredicateFunctions): PredicateResponses; -} -export default Resize; diff --git a/deps/framework/widget-core/meta/Resize.js b/deps/framework/widget-core/meta/Resize.js deleted file mode 100644 index 0750dfa70b..0000000000 --- a/deps/framework/widget-core/meta/Resize.js +++ /dev/null @@ -1,65 +0,0 @@ -(function (factory) { - if (typeof module === "object" && typeof module.exports === "object") { - var v = factory(require, exports); - if (v !== undefined) module.exports = v; - } - else if (typeof define === "function" && define.amd) { - define(["require", "exports", "tslib", "./Base", "../../shim/Map"], factory); - } -})(function (require, exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - var tslib_1 = require("tslib"); - var Base_1 = require("./Base"); - var Map_1 = require("../../shim/Map"); - var Resize = /** @class */ (function (_super) { - tslib_1.__extends(Resize, _super); - function Resize() { - var _this = _super !== null && _super.apply(this, arguments) || this; - _this._details = new Map_1.default(); - return _this; - } - Resize.prototype.get = function (key, predicates) { - var _this = this; - if (predicates === void 0) { predicates = {}; } - var node = this.getNode(key); - if (!node) { - var defaultResponse = {}; - for (var predicateId in predicates) { - defaultResponse[predicateId] = false; - } - return defaultResponse; - } - if (!this._details.has(key)) { - this._details.set(key, {}); - var resizeObserver = new ResizeObserver(function (_a) { - var _b = tslib_1.__read(_a, 1), entry = _b[0]; - var predicateChanged = false; - if (Object.keys(predicates).length) { - var contentRect = entry.contentRect; - var previousDetails = _this._details.get(key); - var predicateResponses = {}; - for (var predicateId in predicates) { - var response = predicates[predicateId](contentRect); - predicateResponses[predicateId] = response; - if (!predicateChanged && response !== previousDetails[predicateId]) { - predicateChanged = true; - } - } - _this._details.set(key, predicateResponses); - } - else { - predicateChanged = true; - } - predicateChanged && _this.invalidate(); - }); - resizeObserver.observe(node); - } - return this._details.get(key); - }; - return Resize; - }(Base_1.Base)); - exports.Resize = Resize; - exports.default = Resize; -}); -//# sourceMappingURL=Resize.js.map \ No newline at end of file diff --git a/deps/framework/widget-core/meta/Resize.js.map b/deps/framework/widget-core/meta/Resize.js.map deleted file mode 100644 index de29449938..0000000000 --- a/deps/framework/widget-core/meta/Resize.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"Resize.js","sourceRoot":"","sources":["Resize.ts"],"names":[],"mappings":";;;;;;;;;;;;IAAA,+BAA8B;IAC9B,sCAAiC;IAoCjC;QAA4B,kCAAI;QAAhC;YAAA,qEA6CC;YA5CQ,cAAQ,GAAG,IAAI,aAAG,EAAuC,CAAC;;QA4CnE,CAAC;QA1CO,oBAAG,GAAV,UACC,GAAoB,EACpB,UAAqC;YAFtC,iBAyCC;YAvCA,2BAAA,EAAA,aAAa,EAAwB;YAErC,IAAM,IAAI,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;YAE/B,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC;gBACX,IAAM,eAAe,GAAuB,EAAE,CAAC;gBAC/C,GAAG,CAAC,CAAC,IAAI,WAAW,IAAI,UAAU,CAAC,CAAC,CAAC;oBACpC,eAAe,CAAC,WAAW,CAAC,GAAG,KAAK,CAAC;gBACtC,CAAC;gBACD,MAAM,CAAC,eAAwC,CAAC;YACjD,CAAC;YAED,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;gBAC7B,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;gBAC3B,IAAM,cAAc,GAAG,IAAI,cAAc,CAAC,UAAC,EAAO;wBAAP,0BAAO,EAAN,aAAK;oBAChD,IAAI,gBAAgB,GAAG,KAAK,CAAC;oBAC7B,EAAE,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC;wBAC5B,IAAA,+BAAW,CAAW;wBAC9B,IAAM,eAAe,GAAG,KAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;wBAC/C,IAAI,kBAAkB,GAAuB,EAAE,CAAC;wBAEhD,GAAG,CAAC,CAAC,IAAI,WAAW,IAAI,UAAU,CAAC,CAAC,CAAC;4BACpC,IAAM,QAAQ,GAAG,UAAU,CAAC,WAAW,CAAC,CAAC,WAAW,CAAC,CAAC;4BACtD,kBAAkB,CAAC,WAAW,CAAC,GAAG,QAAQ,CAAC;4BAC3C,EAAE,CAAC,CAAC,CAAC,gBAAgB,IAAI,QAAQ,KAAK,eAAgB,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC;gCACrE,gBAAgB,GAAG,IAAI,CAAC;4BACzB,CAAC;wBACF,CAAC;wBAED,KAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,GAAG,EAAE,kBAAkB,CAAC,CAAC;oBAC5C,CAAC;oBAAC,IAAI,CAAC,CAAC;wBACP,gBAAgB,GAAG,IAAI,CAAC;oBACzB,CAAC;oBACD,gBAAgB,IAAI,KAAI,CAAC,UAAU,EAAE,CAAC;gBACvC,CAAC,CAAC,CAAC;gBACH,cAAc,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;YAC9B,CAAC;YAED,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,GAAG,CAA0B,CAAC;QACxD,CAAC;QACF,aAAC;IAAD,CAAC,AA7CD,CAA4B,WAAI,GA6C/B;IA7CY,wBAAM;IA+CnB,kBAAe,MAAM,CAAC","sourcesContent":["import { Base } from './Base';\nimport Map from '../../shim/Map';\n\ninterface Observer {\n\tobserve(node: HTMLElement): void;\n}\n\ndeclare const ResizeObserver: {\n\tprototype: Observer;\n\tnew (callback: (entries: ResizeObserverEntry[]) => any): any;\n};\n\ninterface ResizeObserverEntry {\n\tcontentRect: ContentRect;\n}\n\nexport interface ContentRect {\n\treadonly bottom: number;\n\treadonly height: number;\n\treadonly left: number;\n\treadonly right: number;\n\treadonly top: number;\n\treadonly width: number;\n\treadonly x: number;\n\treadonly y: number;\n}\n\nexport interface PredicateFunction {\n\t(contentRect: ContentRect): boolean;\n}\n\nexport interface PredicateFunctions {\n\t[id: string]: PredicateFunction;\n}\n\nexport type PredicateResponses = { [id in keyof T]: boolean };\n\nexport class Resize extends Base {\n\tprivate _details = new Map();\n\n\tpublic get(\n\t\tkey: string | number,\n\t\tpredicates = {} as PredicateFunctions\n\t): PredicateResponses {\n\t\tconst node = this.getNode(key);\n\n\t\tif (!node) {\n\t\t\tconst defaultResponse: PredicateResponses = {};\n\t\t\tfor (let predicateId in predicates) {\n\t\t\t\tdefaultResponse[predicateId] = false;\n\t\t\t}\n\t\t\treturn defaultResponse as PredicateResponses;\n\t\t}\n\n\t\tif (!this._details.has(key)) {\n\t\t\tthis._details.set(key, {});\n\t\t\tconst resizeObserver = new ResizeObserver(([entry]) => {\n\t\t\t\tlet predicateChanged = false;\n\t\t\t\tif (Object.keys(predicates).length) {\n\t\t\t\t\tconst { contentRect } = entry;\n\t\t\t\t\tconst previousDetails = this._details.get(key);\n\t\t\t\t\tlet predicateResponses: PredicateResponses = {};\n\n\t\t\t\t\tfor (let predicateId in predicates) {\n\t\t\t\t\t\tconst response = predicates[predicateId](contentRect);\n\t\t\t\t\t\tpredicateResponses[predicateId] = response;\n\t\t\t\t\t\tif (!predicateChanged && response !== previousDetails![predicateId]) {\n\t\t\t\t\t\t\tpredicateChanged = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tthis._details.set(key, predicateResponses);\n\t\t\t\t} else {\n\t\t\t\t\tpredicateChanged = true;\n\t\t\t\t}\n\t\t\t\tpredicateChanged && this.invalidate();\n\t\t\t});\n\t\t\tresizeObserver.observe(node);\n\t\t}\n\n\t\treturn this._details.get(key) as PredicateResponses;\n\t}\n}\n\nexport default Resize;\n"]} \ No newline at end of file diff --git a/deps/framework/widget-core/meta/Resize.mjs b/deps/framework/widget-core/meta/Resize.mjs deleted file mode 100644 index 24e6227e98..0000000000 --- a/deps/framework/widget-core/meta/Resize.mjs +++ /dev/null @@ -1,45 +0,0 @@ -import { Base } from './Base'; -import Map from '../../shim/Map'; -export class Resize extends Base { - constructor() { - super(...arguments); - this._details = new Map(); - } - get(key, predicates = {}) { - const node = this.getNode(key); - if (!node) { - const defaultResponse = {}; - for (let predicateId in predicates) { - defaultResponse[predicateId] = false; - } - return defaultResponse; - } - if (!this._details.has(key)) { - this._details.set(key, {}); - const resizeObserver = new ResizeObserver(([entry]) => { - let predicateChanged = false; - if (Object.keys(predicates).length) { - const { contentRect } = entry; - const previousDetails = this._details.get(key); - let predicateResponses = {}; - for (let predicateId in predicates) { - const response = predicates[predicateId](contentRect); - predicateResponses[predicateId] = response; - if (!predicateChanged && response !== previousDetails[predicateId]) { - predicateChanged = true; - } - } - this._details.set(key, predicateResponses); - } - else { - predicateChanged = true; - } - predicateChanged && this.invalidate(); - }); - resizeObserver.observe(node); - } - return this._details.get(key); - } -} -export default Resize; -//# sourceMappingURL=Resize.mjs.map \ No newline at end of file diff --git a/deps/framework/widget-core/meta/Resize.mjs.map b/deps/framework/widget-core/meta/Resize.mjs.map deleted file mode 100644 index 9010562a67..0000000000 --- a/deps/framework/widget-core/meta/Resize.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"Resize.mjs","sourceRoot":"","sources":["Resize.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAC9B,OAAO,GAAG,MAAM,gBAAgB,CAAC;AAoCjC,MAAM,aAAc,SAAQ,IAAI;IAAhC;;QACS,aAAQ,GAAG,IAAI,GAAG,EAAuC,CAAC;IA4CnE,CAAC;IA1CO,GAAG,CACT,GAAoB,EACpB,UAAU,GAAG,EAAwB;QAErC,MAAM,IAAI,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;QAE/B,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC;YACX,MAAM,eAAe,GAAuB,EAAE,CAAC;YAC/C,GAAG,CAAC,CAAC,IAAI,WAAW,IAA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CAAC,UAAU,EAAE,CAAC;YACvC,CAAC,CAAC,CAAC;YACH,cAAc,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QAC9B,CAAC;QAED,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,GAAG,CAA0B,CAAC;IACxD,CAAC;CACD;AAED,eAAe,MAAM,CAAC","sourcesContent":["import { Base } from './Base';\nimport Map from '../../shim/Map';\n\ninterface Observer {\n\tobserve(node: HTMLElement): void;\n}\n\ndeclare const ResizeObserver: {\n\tprototype: Observer;\n\tnew (callback: (entries: ResizeObserverEntry[]) => any): any;\n};\n\ninterface ResizeObserverEntry {\n\tcontentRect: ContentRect;\n}\n\nexport interface ContentRect {\n\treadonly bottom: number;\n\treadonly height: number;\n\treadonly left: number;\n\treadonly right: number;\n\treadonly top: number;\n\treadonly width: number;\n\treadonly x: number;\n\treadonly y: number;\n}\n\nexport interface PredicateFunction {\n\t(contentRect: ContentRect): boolean;\n}\n\nexport interface PredicateFunctions {\n\t[id: string]: PredicateFunction;\n}\n\nexport type PredicateResponses = { [id in keyof T]: boolean };\n\nexport class Resize extends Base {\n\tprivate _details = new Map();\n\n\tpublic get(\n\t\tkey: string | number,\n\t\tpredicates = {} as PredicateFunctions\n\t): PredicateResponses {\n\t\tconst node = this.getNode(key);\n\n\t\tif (!node) {\n\t\t\tconst defaultResponse: PredicateResponses = {};\n\t\t\tfor (let predicateId in predicates) {\n\t\t\t\tdefaultResponse[predicateId] = false;\n\t\t\t}\n\t\t\treturn defaultResponse as PredicateResponses;\n\t\t}\n\n\t\tif (!this._details.has(key)) {\n\t\t\tthis._details.set(key, {});\n\t\t\tconst resizeObserver = new ResizeObserver(([entry]) => {\n\t\t\t\tlet predicateChanged = false;\n\t\t\t\tif (Object.keys(predicates).length) {\n\t\t\t\t\tconst { contentRect } = entry;\n\t\t\t\t\tconst previousDetails = this._details.get(key);\n\t\t\t\t\tlet predicateResponses: PredicateResponses = {};\n\n\t\t\t\t\tfor (let predicateId in predicates) {\n\t\t\t\t\t\tconst response = predicates[predicateId](contentRect);\n\t\t\t\t\t\tpredicateResponses[predicateId] = response;\n\t\t\t\t\t\tif (!predicateChanged && response !== previousDetails![predicateId]) {\n\t\t\t\t\t\t\tpredicateChanged = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tthis._details.set(key, predicateResponses);\n\t\t\t\t} else {\n\t\t\t\t\tpredicateChanged = true;\n\t\t\t\t}\n\t\t\t\tpredicateChanged && this.invalidate();\n\t\t\t});\n\t\t\tresizeObserver.observe(node);\n\t\t}\n\n\t\treturn this._details.get(key) as PredicateResponses;\n\t}\n}\n\nexport default Resize;\n"]} \ No newline at end of file diff --git a/deps/framework/widget-core/meta/WebAnimation.d.ts b/deps/framework/widget-core/meta/WebAnimation.d.ts deleted file mode 100644 index 2c0daa6a78..0000000000 --- a/deps/framework/widget-core/meta/WebAnimation.d.ts +++ /dev/null @@ -1,62 +0,0 @@ -/// -import { Base } from './Base'; -/** - * Animation controls are used to control the web animation that has been applied - * to a vdom node. - */ -export interface AnimationControls { - play?: boolean; - onFinish?: () => void; - onCancel?: () => void; - reverse?: boolean; - cancel?: boolean; - finish?: boolean; - playbackRate?: number; - startTime?: number; - currentTime?: number; -} -/** - * Animation timing properties passed to a new KeyframeEffect. - */ -export interface AnimationTimingProperties { - duration?: number; - delay?: number; - direction?: 'normal' | 'reverse' | 'alternate' | 'alternate-reverse'; - easing?: string; - endDelay?: number; - fill?: 'none' | 'forwards' | 'backwards' | 'both' | 'auto'; - iterations?: number; - iterationStart?: number; -} -/** - * Animation propertiues that can be passed as vdom property `animate` - */ -export interface AnimationProperties { - id: string; - effects: (() => AnimationKeyFrame | AnimationKeyFrame[]) | AnimationKeyFrame | AnimationKeyFrame[]; - controls?: AnimationControls; - timing?: AnimationTimingProperties; -} -export declare type AnimationPropertiesFunction = () => AnimationProperties; -/** - * Info returned by the `get` function on WebAnimation meta - */ -export interface AnimationInfo { - currentTime: number; - playState: 'idle' | 'pending' | 'running' | 'paused' | 'finished'; - playbackRate: number; - startTime: number; -} -export interface AnimationPlayer { - player: Animation; - used: boolean; -} -export declare class WebAnimations extends Base { - private _animationMap; - private _createPlayer(node, properties); - private _updatePlayer(player, controls); - animate(key: string, animateProperties: AnimationProperties | AnimationPropertiesFunction | (AnimationProperties | AnimationPropertiesFunction)[]): void; - get(id: string): Readonly | undefined; - afterRender(): void; -} -export default WebAnimations; diff --git a/deps/framework/widget-core/meta/WebAnimation.js b/deps/framework/widget-core/meta/WebAnimation.js deleted file mode 100644 index c31263e353..0000000000 --- a/deps/framework/widget-core/meta/WebAnimation.js +++ /dev/null @@ -1,119 +0,0 @@ -(function (factory) { - if (typeof module === "object" && typeof module.exports === "object") { - var v = factory(require, exports); - if (v !== undefined) module.exports = v; - } - else if (typeof define === "function" && define.amd) { - define(["require", "exports", "tslib", "./Base", "../../shim/Map", "../../shim/global"], factory); - } -})(function (require, exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - var tslib_1 = require("tslib"); - var Base_1 = require("./Base"); - var Map_1 = require("../../shim/Map"); - var global_1 = require("../../shim/global"); - var WebAnimations = /** @class */ (function (_super) { - tslib_1.__extends(WebAnimations, _super); - function WebAnimations() { - var _this = _super !== null && _super.apply(this, arguments) || this; - _this._animationMap = new Map_1.default(); - return _this; - } - WebAnimations.prototype._createPlayer = function (node, properties) { - var effects = properties.effects, _a = properties.timing, timing = _a === void 0 ? {} : _a; - var fx = typeof effects === 'function' ? effects() : effects; - var keyframeEffect = new KeyframeEffect(node, fx, timing); - return new Animation(keyframeEffect, global_1.default.document.timeline); - }; - WebAnimations.prototype._updatePlayer = function (player, controls) { - var play = controls.play, reverse = controls.reverse, cancel = controls.cancel, finish = controls.finish, onFinish = controls.onFinish, onCancel = controls.onCancel, playbackRate = controls.playbackRate, startTime = controls.startTime, currentTime = controls.currentTime; - if (playbackRate !== undefined) { - player.playbackRate = playbackRate; - } - if (reverse) { - player.reverse(); - } - if (cancel) { - player.cancel(); - } - if (finish) { - player.finish(); - } - if (startTime !== undefined) { - player.startTime = startTime; - } - if (currentTime !== undefined) { - player.currentTime = currentTime; - } - if (play) { - player.play(); - } - else { - player.pause(); - } - if (onFinish) { - player.onfinish = onFinish.bind(this._bind); - } - if (onCancel) { - player.oncancel = onCancel.bind(this._bind); - } - }; - WebAnimations.prototype.animate = function (key, animateProperties) { - var _this = this; - var node = this.getNode(key); - if (node) { - if (!Array.isArray(animateProperties)) { - animateProperties = [animateProperties]; - } - animateProperties.forEach(function (properties) { - properties = typeof properties === 'function' ? properties() : properties; - if (properties) { - var id = properties.id; - if (!_this._animationMap.has(id)) { - _this._animationMap.set(id, { - player: _this._createPlayer(node, properties), - used: true - }); - } - var animation = _this._animationMap.get(id); - var _a = properties.controls, controls = _a === void 0 ? {} : _a; - if (animation) { - _this._updatePlayer(animation.player, controls); - _this._animationMap.set(id, { - player: animation.player, - used: true - }); - } - } - }); - } - }; - WebAnimations.prototype.get = function (id) { - var animation = this._animationMap.get(id); - if (animation) { - var _a = animation.player, currentTime = _a.currentTime, playState = _a.playState, playbackRate = _a.playbackRate, startTime_1 = _a.startTime; - return { - currentTime: currentTime, - playState: playState, - playbackRate: playbackRate, - startTime: startTime_1 - }; - } - }; - WebAnimations.prototype.afterRender = function () { - var _this = this; - this._animationMap.forEach(function (animation, key) { - if (!animation.used) { - animation.player.cancel(); - _this._animationMap.delete(key); - } - animation.used = false; - }); - }; - return WebAnimations; - }(Base_1.Base)); - exports.WebAnimations = WebAnimations; - exports.default = WebAnimations; -}); -//# sourceMappingURL=WebAnimation.js.map \ No newline at end of file diff --git a/deps/framework/widget-core/meta/WebAnimation.js.map b/deps/framework/widget-core/meta/WebAnimation.js.map deleted file mode 100644 index 625ec8d882..0000000000 --- a/deps/framework/widget-core/meta/WebAnimation.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"WebAnimation.js","sourceRoot":"","sources":["WebAnimation.ts"],"names":[],"mappings":";;;;;;;;;;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EAAE,CAAC;oBAC1B,KAAI,CAAC,aAAa,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;gBAChC,CAAC;gBACD,SAAS,CAAC,IAAI,GAAG,KAAK,CAAC;YACxB,CAAC,CAAC,CAAC;QACJ,CAAC;QACF,oBAAC;IAAD,CAAC,AAvHD,CAAmC,WAAI,GAuHtC;IAvHY,sCAAa;IAyH1B,kBAAe,aAAa,CAAC","sourcesContent":["import { Base } from './Base';\nimport Map from '../../shim/Map';\nimport global from '../../shim/global';\n\n/**\n * Animation controls are used to control the web animation that has been applied\n * to a vdom node.\n */\nexport interface AnimationControls {\n\tplay?: boolean;\n\tonFinish?: () => void;\n\tonCancel?: () => void;\n\treverse?: boolean;\n\tcancel?: boolean;\n\tfinish?: boolean;\n\tplaybackRate?: number;\n\tstartTime?: number;\n\tcurrentTime?: number;\n}\n\n/**\n * Animation timing properties passed to a new KeyframeEffect.\n */\nexport interface AnimationTimingProperties {\n\tduration?: number;\n\tdelay?: number;\n\tdirection?: 'normal' | 'reverse' | 'alternate' | 'alternate-reverse';\n\teasing?: string;\n\tendDelay?: number;\n\tfill?: 'none' | 'forwards' | 'backwards' | 'both' | 'auto';\n\titerations?: number;\n\titerationStart?: number;\n}\n\n/**\n * Animation propertiues that can be passed as vdom property `animate`\n */\nexport interface AnimationProperties {\n\tid: string;\n\teffects: (() => AnimationKeyFrame | AnimationKeyFrame[]) | AnimationKeyFrame | AnimationKeyFrame[];\n\tcontrols?: AnimationControls;\n\ttiming?: AnimationTimingProperties;\n}\n\nexport type AnimationPropertiesFunction = () => AnimationProperties;\n\n/**\n * Info returned by the `get` function on WebAnimation meta\n */\nexport interface AnimationInfo {\n\tcurrentTime: number;\n\tplayState: 'idle' | 'pending' | 'running' | 'paused' | 'finished';\n\tplaybackRate: number;\n\tstartTime: number;\n}\n\nexport interface AnimationPlayer {\n\tplayer: Animation;\n\tused: boolean;\n}\n\nexport class WebAnimations extends Base {\n\tprivate _animationMap = new Map();\n\n\tprivate _createPlayer(node: HTMLElement, properties: AnimationProperties): Animation {\n\t\tconst { effects, timing = {} } = properties;\n\n\t\tconst fx = typeof effects === 'function' ? effects() : effects;\n\n\t\tconst keyframeEffect = new KeyframeEffect(node, fx, timing as AnimationEffectTiming);\n\n\t\treturn new Animation(keyframeEffect, global.document.timeline);\n\t}\n\n\tprivate _updatePlayer(player: Animation, controls: AnimationControls) {\n\t\tconst { play, reverse, cancel, finish, onFinish, onCancel, playbackRate, startTime, currentTime } = controls;\n\n\t\tif (playbackRate !== undefined) {\n\t\t\tplayer.playbackRate = playbackRate;\n\t\t}\n\n\t\tif (reverse) {\n\t\t\tplayer.reverse();\n\t\t}\n\n\t\tif (cancel) {\n\t\t\tplayer.cancel();\n\t\t}\n\n\t\tif (finish) {\n\t\t\tplayer.finish();\n\t\t}\n\n\t\tif (startTime !== undefined) {\n\t\t\tplayer.startTime = startTime;\n\t\t}\n\n\t\tif (currentTime !== undefined) {\n\t\t\tplayer.currentTime = currentTime;\n\t\t}\n\n\t\tif (play) {\n\t\t\tplayer.play();\n\t\t} else {\n\t\t\tplayer.pause();\n\t\t}\n\n\t\tif (onFinish) {\n\t\t\tplayer.onfinish = onFinish.bind(this._bind);\n\t\t}\n\n\t\tif (onCancel) {\n\t\t\tplayer.oncancel = onCancel.bind(this._bind);\n\t\t}\n\t}\n\n\tanimate(\n\t\tkey: string,\n\t\tanimateProperties:\n\t\t\t| AnimationProperties\n\t\t\t| AnimationPropertiesFunction\n\t\t\t| (AnimationProperties | AnimationPropertiesFunction)[]\n\t) {\n\t\tconst node = this.getNode(key) as HTMLElement;\n\n\t\tif (node) {\n\t\t\tif (!Array.isArray(animateProperties)) {\n\t\t\t\tanimateProperties = [animateProperties];\n\t\t\t}\n\t\t\tanimateProperties.forEach((properties) => {\n\t\t\t\tproperties = typeof properties === 'function' ? properties() : properties;\n\n\t\t\t\tif (properties) {\n\t\t\t\t\tconst { id } = properties;\n\t\t\t\t\tif (!this._animationMap.has(id)) {\n\t\t\t\t\t\tthis._animationMap.set(id, {\n\t\t\t\t\t\t\tplayer: this._createPlayer(node, properties),\n\t\t\t\t\t\t\tused: true\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\n\t\t\t\t\tconst animation = this._animationMap.get(id);\n\t\t\t\t\tconst { controls = {} } = properties;\n\n\t\t\t\t\tif (animation) {\n\t\t\t\t\t\tthis._updatePlayer(animation.player, controls);\n\n\t\t\t\t\t\tthis._animationMap.set(id, {\n\t\t\t\t\t\t\tplayer: animation.player,\n\t\t\t\t\t\t\tused: true\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t}\n\n\tget(id: string): Readonly | undefined {\n\t\tconst animation = this._animationMap.get(id);\n\t\tif (animation) {\n\t\t\tconst { currentTime, playState, playbackRate, startTime } = animation.player;\n\n\t\t\treturn {\n\t\t\t\tcurrentTime,\n\t\t\t\tplayState,\n\t\t\t\tplaybackRate,\n\t\t\t\tstartTime\n\t\t\t};\n\t\t}\n\t}\n\n\tafterRender() {\n\t\tthis._animationMap.forEach((animation, key) => {\n\t\t\tif (!animation.used) {\n\t\t\t\tanimation.player.cancel();\n\t\t\t\tthis._animationMap.delete(key);\n\t\t\t}\n\t\t\tanimation.used = false;\n\t\t});\n\t}\n}\n\nexport default WebAnimations;\n"]} \ No newline at end of file diff --git a/deps/framework/widget-core/meta/WebAnimation.mjs b/deps/framework/widget-core/meta/WebAnimation.mjs deleted file mode 100644 index bbd74b034a..0000000000 --- a/deps/framework/widget-core/meta/WebAnimation.mjs +++ /dev/null @@ -1,100 +0,0 @@ -import { Base } from './Base'; -import Map from '../../shim/Map'; -import global from '../../shim/global'; -export class WebAnimations extends Base { - constructor() { - super(...arguments); - this._animationMap = new Map(); - } - _createPlayer(node, properties) { - const { effects, timing = {} } = properties; - const fx = typeof effects === 'function' ? effects() : effects; - const keyframeEffect = new KeyframeEffect(node, fx, timing); - return new Animation(keyframeEffect, global.document.timeline); - } - _updatePlayer(player, controls) { - const { play, reverse, cancel, finish, onFinish, onCancel, playbackRate, startTime, currentTime } = controls; - if (playbackRate !== undefined) { - player.playbackRate = playbackRate; - } - if (reverse) { - player.reverse(); - } - if (cancel) { - player.cancel(); - } - if (finish) { - player.finish(); - } - if (startTime !== undefined) { - player.startTime = startTime; - } - if (currentTime !== undefined) { - player.currentTime = currentTime; - } - if (play) { - player.play(); - } - else { - player.pause(); - } - if (onFinish) { - player.onfinish = onFinish.bind(this._bind); - } - if (onCancel) { - player.oncancel = onCancel.bind(this._bind); - } - } - animate(key, animateProperties) { - const node = this.getNode(key); - if (node) { - if (!Array.isArray(animateProperties)) { - animateProperties = [animateProperties]; - } - animateProperties.forEach((properties) => { - properties = typeof properties === 'function' ? properties() : properties; - if (properties) { - const { id } = properties; - if (!this._animationMap.has(id)) { - this._animationMap.set(id, { - player: this._createPlayer(node, properties), - used: true - }); - } - const animation = this._animationMap.get(id); - const { controls = {} } = properties; - if (animation) { - this._updatePlayer(animation.player, controls); - this._animationMap.set(id, { - player: animation.player, - used: true - }); - } - } - }); - } - } - get(id) { - const animation = this._animationMap.get(id); - if (animation) { - const { currentTime, playState, playbackRate, startTime } = animation.player; - return { - currentTime, - playState, - playbackRate, - startTime - }; - } - } - afterRender() { - this._animationMap.forEach((animation, key) => { - if (!animation.used) { - animation.player.cancel(); - this._animationMap.delete(key); - } - animation.used = false; - }); - } -} -export default WebAnimations; -//# sourceMappingURL=WebAnimation.mjs.map \ No newline at end of file diff --git a/deps/framework/widget-core/meta/WebAnimation.mjs.map b/deps/framework/widget-core/meta/WebAnimation.mjs.map deleted file mode 100644 index 895b18dccf..0000000000 --- a/deps/framework/widget-core/meta/WebAnimation.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"WebAnimation.mjs","sourceRoot":"","sources":["WebAnimation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAC9B,OAAO,GAAG,MAAM,gBAAgB,CAAC;AAC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BAC1B,IAAI,CAAC,aAAa,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;YAChC,CAAC;YACD,SAAS,CAAC,IAAI,GAAG,KAAK,CAAC;QACxB,CAAC,CAAC,CAAC;IACJ,CAAC;CACD;AAED,eAAe,aAAa,CAAC","sourcesContent":["import { Base } from './Base';\nimport Map from '../../shim/Map';\nimport global from '../../shim/global';\n\n/**\n * Animation controls are used to control the web animation that has been applied\n * to a vdom node.\n */\nexport interface AnimationControls {\n\tplay?: boolean;\n\tonFinish?: () => void;\n\tonCancel?: () => void;\n\treverse?: boolean;\n\tcancel?: boolean;\n\tfinish?: boolean;\n\tplaybackRate?: number;\n\tstartTime?: number;\n\tcurrentTime?: number;\n}\n\n/**\n * Animation timing properties passed to a new KeyframeEffect.\n */\nexport interface AnimationTimingProperties {\n\tduration?: number;\n\tdelay?: number;\n\tdirection?: 'normal' | 'reverse' | 'alternate' | 'alternate-reverse';\n\teasing?: string;\n\tendDelay?: number;\n\tfill?: 'none' | 'forwards' | 'backwards' | 'both' | 'auto';\n\titerations?: number;\n\titerationStart?: number;\n}\n\n/**\n * Animation propertiues that can be passed as vdom property `animate`\n */\nexport interface AnimationProperties {\n\tid: string;\n\teffects: (() => AnimationKeyFrame | AnimationKeyFrame[]) | AnimationKeyFrame | AnimationKeyFrame[];\n\tcontrols?: AnimationControls;\n\ttiming?: AnimationTimingProperties;\n}\n\nexport type AnimationPropertiesFunction = () => AnimationProperties;\n\n/**\n * Info returned by the `get` function on WebAnimation meta\n */\nexport interface AnimationInfo {\n\tcurrentTime: number;\n\tplayState: 'idle' | 'pending' | 'running' | 'paused' | 'finished';\n\tplaybackRate: number;\n\tstartTime: number;\n}\n\nexport interface AnimationPlayer {\n\tplayer: Animation;\n\tused: boolean;\n}\n\nexport class WebAnimations extends Base {\n\tprivate _animationMap = new Map();\n\n\tprivate _createPlayer(node: HTMLElement, properties: AnimationProperties): Animation {\n\t\tconst { effects, timing = {} } = properties;\n\n\t\tconst fx = typeof effects === 'function' ? effects() : effects;\n\n\t\tconst keyframeEffect = new KeyframeEffect(node, fx, timing as AnimationEffectTiming);\n\n\t\treturn new Animation(keyframeEffect, global.document.timeline);\n\t}\n\n\tprivate _updatePlayer(player: Animation, controls: AnimationControls) {\n\t\tconst { play, reverse, cancel, finish, onFinish, onCancel, playbackRate, startTime, currentTime } = controls;\n\n\t\tif (playbackRate !== undefined) {\n\t\t\tplayer.playbackRate = playbackRate;\n\t\t}\n\n\t\tif (reverse) {\n\t\t\tplayer.reverse();\n\t\t}\n\n\t\tif (cancel) {\n\t\t\tplayer.cancel();\n\t\t}\n\n\t\tif (finish) {\n\t\t\tplayer.finish();\n\t\t}\n\n\t\tif (startTime !== undefined) {\n\t\t\tplayer.startTime = startTime;\n\t\t}\n\n\t\tif (currentTime !== undefined) {\n\t\t\tplayer.currentTime = currentTime;\n\t\t}\n\n\t\tif (play) {\n\t\t\tplayer.play();\n\t\t} else {\n\t\t\tplayer.pause();\n\t\t}\n\n\t\tif (onFinish) {\n\t\t\tplayer.onfinish = onFinish.bind(this._bind);\n\t\t}\n\n\t\tif (onCancel) {\n\t\t\tplayer.oncancel = onCancel.bind(this._bind);\n\t\t}\n\t}\n\n\tanimate(\n\t\tkey: string,\n\t\tanimateProperties:\n\t\t\t| AnimationProperties\n\t\t\t| AnimationPropertiesFunction\n\t\t\t| (AnimationProperties | AnimationPropertiesFunction)[]\n\t) {\n\t\tconst node = this.getNode(key) as HTMLElement;\n\n\t\tif (node) {\n\t\t\tif (!Array.isArray(animateProperties)) {\n\t\t\t\tanimateProperties = [animateProperties];\n\t\t\t}\n\t\t\tanimateProperties.forEach((properties) => {\n\t\t\t\tproperties = typeof properties === 'function' ? properties() : properties;\n\n\t\t\t\tif (properties) {\n\t\t\t\t\tconst { id } = properties;\n\t\t\t\t\tif (!this._animationMap.has(id)) {\n\t\t\t\t\t\tthis._animationMap.set(id, {\n\t\t\t\t\t\t\tplayer: this._createPlayer(node, properties),\n\t\t\t\t\t\t\tused: true\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\n\t\t\t\t\tconst animation = this._animationMap.get(id);\n\t\t\t\t\tconst { controls = {} } = properties;\n\n\t\t\t\t\tif (animation) {\n\t\t\t\t\t\tthis._updatePlayer(animation.player, controls);\n\n\t\t\t\t\t\tthis._animationMap.set(id, {\n\t\t\t\t\t\t\tplayer: animation.player,\n\t\t\t\t\t\t\tused: true\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t}\n\n\tget(id: string): Readonly | undefined {\n\t\tconst animation = this._animationMap.get(id);\n\t\tif (animation) {\n\t\t\tconst { currentTime, playState, playbackRate, startTime } = animation.player;\n\n\t\t\treturn {\n\t\t\t\tcurrentTime,\n\t\t\t\tplayState,\n\t\t\t\tplaybackRate,\n\t\t\t\tstartTime\n\t\t\t};\n\t\t}\n\t}\n\n\tafterRender() {\n\t\tthis._animationMap.forEach((animation, key) => {\n\t\t\tif (!animation.used) {\n\t\t\t\tanimation.player.cancel();\n\t\t\t\tthis._animationMap.delete(key);\n\t\t\t}\n\t\t\tanimation.used = false;\n\t\t});\n\t}\n}\n\nexport default WebAnimations;\n"]} \ No newline at end of file diff --git a/deps/framework/widget-core/mixins/Focus.d.ts b/deps/framework/widget-core/mixins/Focus.d.ts deleted file mode 100644 index ddd403b8ec..0000000000 --- a/deps/framework/widget-core/mixins/Focus.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { Constructor } from './../interfaces'; -import { WidgetBase } from './../WidgetBase'; -export interface FocusProperties { - focus?: (() => boolean); -} -export interface FocusMixin { - focus: () => void; - shouldFocus: () => boolean; - properties: FocusProperties; -} -export declare function FocusMixin>>(Base: T): T & Constructor; -export default FocusMixin; diff --git a/deps/framework/widget-core/mixins/Focus.js b/deps/framework/widget-core/mixins/Focus.js deleted file mode 100644 index 64aaef167c..0000000000 --- a/deps/framework/widget-core/mixins/Focus.js +++ /dev/null @@ -1,52 +0,0 @@ -(function (factory) { - if (typeof module === "object" && typeof module.exports === "object") { - var v = factory(require, exports); - if (v !== undefined) module.exports = v; - } - else if (typeof define === "function" && define.amd) { - define(["require", "exports", "tslib", "./../decorators/diffProperty"], factory); - } -})(function (require, exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - var tslib_1 = require("tslib"); - var diffProperty_1 = require("./../decorators/diffProperty"); - function diffFocus(previousProperty, newProperty) { - var result = newProperty && newProperty(); - return { - changed: result, - value: newProperty - }; - } - function FocusMixin(Base) { - var Focus = /** @class */ (function (_super) { - tslib_1.__extends(Focus, _super); - function Focus() { - var _this = _super !== null && _super.apply(this, arguments) || this; - _this._currentToken = 0; - _this._previousToken = 0; - _this.shouldFocus = function () { - var result = _this._currentToken !== _this._previousToken; - _this._previousToken = _this._currentToken; - return result; - }; - return _this; - } - Focus.prototype.isFocusedReaction = function () { - this._currentToken++; - }; - Focus.prototype.focus = function () { - this._currentToken++; - this.invalidate(); - }; - tslib_1.__decorate([ - diffProperty_1.diffProperty('focus', diffFocus) - ], Focus.prototype, "isFocusedReaction", null); - return Focus; - }(Base)); - return Focus; - } - exports.FocusMixin = FocusMixin; - exports.default = FocusMixin; -}); -//# sourceMappingURL=Focus.js.map \ No newline at end of file diff --git a/deps/framework/widget-core/mixins/Focus.js.map b/deps/framework/widget-core/mixins/Focus.js.map deleted file mode 100644 index d079db9c45..0000000000 --- a/deps/framework/widget-core/mixins/Focus.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"Focus.js","sourceRoot":"","sources":["Focus.ts"],"names":[],"mappings":";;;;;;;;;;;;IAEA,6DAA4D;IAY5D,mBAAmB,gBAA0B,EAAE,WAAqB;QACnE,IAAM,MAAM,GAAG,WAAW,IAAI,WAAW,EAAE,CAAC;QAC5C,MAAM,CAAC;YACN,OAAO,EAAE,MAAM;YACf,KAAK,EAAE,WAAW;SAClB,CAAC;IACH,CAAC;IAED,oBAA+E,IAAO;QACrF;YAA6B,iCAAI;YAAjC;gBAAA,qEAsBC;gBAnBQ,mBAAa,GAAG,CAAC,CAAC;gBAElB,oBAAc,GAAG,CAAC,CAAC;gBAOpB,iBAAW,GAAG;oBACpB,IAAM,MAAM,GAAG,KAAI,CAAC,aAAa,KAAK,KAAI,CAAC,cAAc,CAAC;oBAC1D,KAAI,CAAC,cAAc,GAAG,KAAI,CAAC,aAAa,CAAC;oBACzC,MAAM,CAAC,MAAM,CAAC;gBACf,CAAC,CAAC;;YAMH,CAAC;YAdU,iCAAiB,GAA3B;gBACC,IAAI,CAAC,aAAa,EAAE,CAAC;YACtB,CAAC;YAQM,qBAAK,GAAZ;gBACC,IAAI,CAAC,aAAa,EAAE,CAAC;gBACrB,IAAI,CAAC,UAAU,EAAE,CAAC;YACnB,CAAC;YAbD;gBADC,2BAAY,CAAC,OAAO,EAAE,SAAS,CAAC;0DAGhC;YAYF,YAAC;SAAA,AAtBD,CAA6B,IAAI,GAsBhC;QACD,MAAM,CAAC,KAAK,CAAC;IACd,CAAC;IAzBD,gCAyBC;IAED,kBAAe,UAAU,CAAC","sourcesContent":["import { Constructor } from './../interfaces';\nimport { WidgetBase } from './../WidgetBase';\nimport { diffProperty } from './../decorators/diffProperty';\n\nexport interface FocusProperties {\n\tfocus?: (() => boolean);\n}\n\nexport interface FocusMixin {\n\tfocus: () => void;\n\tshouldFocus: () => boolean;\n\tproperties: FocusProperties;\n}\n\nfunction diffFocus(previousProperty: Function, newProperty: Function) {\n\tconst result = newProperty && newProperty();\n\treturn {\n\t\tchanged: result,\n\t\tvalue: newProperty\n\t};\n}\n\nexport function FocusMixin>>(Base: T): T & Constructor {\n\tabstract class Focus extends Base {\n\t\tpublic abstract properties: FocusProperties;\n\n\t\tprivate _currentToken = 0;\n\n\t\tprivate _previousToken = 0;\n\n\t\t@diffProperty('focus', diffFocus)\n\t\tprotected isFocusedReaction() {\n\t\t\tthis._currentToken++;\n\t\t}\n\n\t\tpublic shouldFocus = () => {\n\t\t\tconst result = this._currentToken !== this._previousToken;\n\t\t\tthis._previousToken = this._currentToken;\n\t\t\treturn result;\n\t\t};\n\n\t\tpublic focus() {\n\t\t\tthis._currentToken++;\n\t\t\tthis.invalidate();\n\t\t}\n\t}\n\treturn Focus;\n}\n\nexport default FocusMixin;\n"]} \ No newline at end of file diff --git a/deps/framework/widget-core/mixins/Focus.mjs b/deps/framework/widget-core/mixins/Focus.mjs deleted file mode 100644 index 6176302d0c..0000000000 --- a/deps/framework/widget-core/mixins/Focus.mjs +++ /dev/null @@ -1,36 +0,0 @@ -import * as tslib_1 from "tslib"; -import { diffProperty } from './../decorators/diffProperty'; -function diffFocus(previousProperty, newProperty) { - const result = newProperty && newProperty(); - return { - changed: result, - value: newProperty - }; -} -export function FocusMixin(Base) { - class Focus extends Base { - constructor() { - super(...arguments); - this._currentToken = 0; - this._previousToken = 0; - this.shouldFocus = () => { - const result = this._currentToken !== this._previousToken; - this._previousToken = this._currentToken; - return result; - }; - } - isFocusedReaction() { - this._currentToken++; - } - focus() { - this._currentToken++; - this.invalidate(); - } - } - tslib_1.__decorate([ - diffProperty('focus', diffFocus) - ], Focus.prototype, "isFocusedReaction", null); - return Focus; -} -export default FocusMixin; -//# sourceMappingURL=Focus.mjs.map \ No newline at end of file diff --git a/deps/framework/widget-core/mixins/Focus.mjs.map b/deps/framework/widget-core/mixins/Focus.mjs.map deleted file mode 100644 index 3da222e1c1..0000000000 --- a/deps/framework/widget-core/mixins/Focus.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"Focus.mjs","sourceRoot":"","sources":["Focus.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAY5D,mBAAmB,gBAA0B,EAAE,WAAqB;IACnE,MAAM,MAAM,GAAG,WAAW,IAAI,WAAW,EAAE,CAAC;IAC5C,MAAM,CAAC;QACN,OAAO,EAAE,MAAM;QACf,KAAK,EAAE,WAAW;KAClB,CAAC;AACH,CAAC;AAED,MAAM,qBAAyE,IAAO;IACrF,WAAqB,SAAQ,IAAI;QAAjC;;YAGS,kBAAa,GAAG,CAAC,CAAC;YAElB,mBAAc,GAAG,CAAC,CAAC;YAOpB,gBAAW,GAAG,GAAG,EAAE;gBACzB,MAAM,MAAM,GAAG,IAAI,CAAC,aAAa,KAAK,IAAI,CAAC,cAAc,CAAC;gBAC1D,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,aAAa,CAAC;gBACzC,MAAM,CAAC,MAAM,CAAC;YACf,CAAC,CAAC;QAMH,CAAC;QAdU,iBAAiB;YAC1B,IAAI,CAAC,aAAa,EAAE,CAAC;QACtB,CAAC;QAQM,KAAK;YACX,IAAI,CAAC,aAAa,EAAE,CAAC;YACrB,IAAI,CAAC,UAAU,EAAE,CAAC;QACnB,CAAC;KACD;IAdA;QADC,YAAY,CAAC,OAAO,EAAE,SAAS,CAAC;kDAGhC;IAaF,MAAM,CAAC,KAAK,CAAC;AACd,CAAC;AAED,eAAe,UAAU,CAAC","sourcesContent":["import { Constructor } from './../interfaces';\nimport { WidgetBase } from './../WidgetBase';\nimport { diffProperty } from './../decorators/diffProperty';\n\nexport interface FocusProperties {\n\tfocus?: (() => boolean);\n}\n\nexport interface FocusMixin {\n\tfocus: () => void;\n\tshouldFocus: () => boolean;\n\tproperties: FocusProperties;\n}\n\nfunction diffFocus(previousProperty: Function, newProperty: Function) {\n\tconst result = newProperty && newProperty();\n\treturn {\n\t\tchanged: result,\n\t\tvalue: newProperty\n\t};\n}\n\nexport function FocusMixin>>(Base: T): T & Constructor {\n\tabstract class Focus extends Base {\n\t\tpublic abstract properties: FocusProperties;\n\n\t\tprivate _currentToken = 0;\n\n\t\tprivate _previousToken = 0;\n\n\t\t@diffProperty('focus', diffFocus)\n\t\tprotected isFocusedReaction() {\n\t\t\tthis._currentToken++;\n\t\t}\n\n\t\tpublic shouldFocus = () => {\n\t\t\tconst result = this._currentToken !== this._previousToken;\n\t\t\tthis._previousToken = this._currentToken;\n\t\t\treturn result;\n\t\t};\n\n\t\tpublic focus() {\n\t\t\tthis._currentToken++;\n\t\t\tthis.invalidate();\n\t\t}\n\t}\n\treturn Focus;\n}\n\nexport default FocusMixin;\n"]} \ No newline at end of file diff --git a/deps/framework/widget-core/mixins/I18n.d.ts b/deps/framework/widget-core/mixins/I18n.d.ts deleted file mode 100644 index e6c30cfd4c..0000000000 --- a/deps/framework/widget-core/mixins/I18n.d.ts +++ /dev/null @@ -1,75 +0,0 @@ -import { Bundle, Messages } from '../../i18n/i18n'; -import Map from '../../shim/Map'; -import { Constructor, WidgetProperties } from './../interfaces'; -import { Injector } from './../Injector'; -import { Registry } from './../Registry'; -import { WidgetBase } from './../WidgetBase'; -export declare const INJECTOR_KEY: symbol; -export interface LocaleData { - /** - * The locale for the widget. If not specified, then the root locale (as determined by `@dojo/i18n`) is assumed. - * If specified, the widget's node will have a `lang` property set to the locale. - */ - locale?: string; - /** - * An optional flag indicating the widget's text direction. If `true`, then the underlying node's `dir` - * property is set to "rtl". If it is `false`, then the `dir` property is set to "ltr". Otherwise, the property - * is not set. - */ - rtl?: boolean; -} -export interface I18nProperties extends LocaleData, WidgetProperties { - /** - * An optional override for the bundle passed to the `localizeBundle`. If the override contains a `messages` object, - * then it will completely replace the underlying bundle. Otherwise, a new bundle will be created with the additional - * locale loaders. - */ - i18nBundle?: Bundle | Map, Bundle>; -} -export declare type LocalizedMessages = { - /** - * Indicates whether the messages are placeholders while waiting for the actual localized messages to load. - * This is always `false` if the associated bundle does not list any supported locales. - */ - readonly isPlaceholder: boolean; - /** - * Formats an ICU-formatted message template for the represented bundle. - * - * @param key - * The message key. - * - * @param options - * The values to pass to the formatter. - * - * @return - * The formatted string. - */ - format(key: string, options?: any): string; - /** - * The localized messages if available, or either the default messages or a blank bundle depending on the - * call signature for `localizeBundle`. - */ - readonly messages: T; -}; -/** - * interface for I18n functionality - */ -export interface I18nMixin { - /** - * Return the cached messages for the specified bundle for the current locale, assuming they have already - * been loaded. If the locale-specific messages have not been loaded, they are fetched and the widget state - * is updated. - * - * @param bundle - * The required bundle object for which available locale messages should be loaded. - * - * @return - * An object containing the localized messages, along with a `format` method for formatting ICU-formatted - * templates and an `isPlaceholder` property indicating whether the returned messages are the defaults. - */ - localizeBundle(bundle: Bundle): LocalizedMessages; - properties: I18nProperties; -} -export declare function registerI18nInjector(localeData: LocaleData, registry: Registry): Injector; -export declare function I18nMixin>>(Base: T): T & Constructor; -export default I18nMixin; diff --git a/deps/framework/widget-core/mixins/I18n.js b/deps/framework/widget-core/mixins/I18n.js deleted file mode 100644 index 453f835302..0000000000 --- a/deps/framework/widget-core/mixins/I18n.js +++ /dev/null @@ -1,165 +0,0 @@ -(function (factory) { - if (typeof module === "object" && typeof module.exports === "object") { - var v = factory(require, exports); - if (v !== undefined) module.exports = v; - } - else if (typeof define === "function" && define.amd) { - define(["require", "exports", "tslib", "../../i18n/i18n", "../../shim/Map", "./../d", "./../decorators/afterRender", "./../decorators/inject", "./../Injector"], factory); - } -})(function (require, exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - var tslib_1 = require("tslib"); - /* tslint:disable:interface-name */ - var i18n_1 = require("../../i18n/i18n"); - var Map_1 = require("../../shim/Map"); - var d_1 = require("./../d"); - var afterRender_1 = require("./../decorators/afterRender"); - var inject_1 = require("./../decorators/inject"); - var Injector_1 = require("./../Injector"); - exports.INJECTOR_KEY = Symbol('i18n'); - function registerI18nInjector(localeData, registry) { - var injector = new Injector_1.Injector(localeData); - registry.defineInjector(exports.INJECTOR_KEY, function (invalidator) { - injector.setInvalidator(invalidator); - return function () { return injector.get(); }; - }); - return injector; - } - exports.registerI18nInjector = registerI18nInjector; - function I18nMixin(Base) { - var I18n = /** @class */ (function (_super) { - tslib_1.__extends(I18n, _super); - function I18n() { - return _super !== null && _super.apply(this, arguments) || this; - } - /** - * Return a localized messages object for the provided bundle, deferring to the `i18nBundle` property - * when present. If the localized messages have not yet been loaded, return either a blank bundle or the - * default messages. - * - * @param bundle - * The bundle to localize - * - * @param useDefaults - * If `true`, the default messages will be used when the localized messages have not yet been loaded. If `false` - * (the default), then a blank bundle will be returned (i.e., each key's value will be an empty string). - */ - I18n.prototype.localizeBundle = function (baseBundle, useDefaults) { - if (useDefaults === void 0) { useDefaults = false; } - var bundle = this._resolveBundle(baseBundle); - var messages = this._getLocaleMessages(bundle); - var isPlaceholder = !messages; - var locale = this.properties.locale; - var format = isPlaceholder && !useDefaults - ? function (key, options) { return ''; } - : function (key, options) { return i18n_1.formatMessage(bundle, key, options, locale); }; - return Object.create({ - format: format, - isPlaceholder: isPlaceholder, - messages: messages || (useDefaults ? bundle.messages : this._getBlankMessages(bundle)) - }); - }; - I18n.prototype.renderDecorator = function (result) { - var _this = this; - d_1.decorate(result, { - modifier: function (node, breaker) { - var _a = _this.properties, locale = _a.locale, rtl = _a.rtl; - var properties = {}; - if (typeof rtl === 'boolean') { - properties['dir'] = rtl ? 'rtl' : 'ltr'; - } - if (locale) { - properties['lang'] = locale; - } - node.properties = tslib_1.__assign({}, node.properties, properties); - breaker(); - }, - predicate: d_1.isVNode - }); - return result; - }; - /** - * @private - * Return a message bundle containing an empty string for each key in the provided bundle. - * - * @param bundle - * The message bundle - * - * @return - * The blank message bundle - */ - I18n.prototype._getBlankMessages = function (bundle) { - var blank = {}; - return Object.keys(bundle.messages).reduce(function (blank, key) { - blank[key] = ''; - return blank; - }, blank); - }; - /** - * @private - * Return the cached dictionary for the specified bundle and locale, if it exists. If the requested dictionary does not - * exist, then load it and update the instance's state with the appropriate messages. - * - * @param bundle - * The bundle for which to load a locale-specific dictionary. - * - * @return - * The locale-specific dictionary, if it has already been loaded and cached. - */ - I18n.prototype._getLocaleMessages = function (bundle) { - var _this = this; - var properties = this.properties; - var locale = properties.locale || i18n_1.default.locale; - var localeMessages = i18n_1.getCachedMessages(bundle, locale); - if (localeMessages) { - return localeMessages; - } - i18n_1.default(bundle, locale).then(function () { - _this.invalidate(); - }); - }; - /** - * @private - * Resolve the bundle to use for the widget's messages to either the provided bundle or to the - * `i18nBundle` property. - * - * @param bundle - * The base bundle - * - * @return - * Either override bundle or the original bundle. - */ - I18n.prototype._resolveBundle = function (bundle) { - var i18nBundle = this.properties.i18nBundle; - if (i18nBundle) { - if (i18nBundle instanceof Map_1.default) { - i18nBundle = i18nBundle.get(bundle); - if (!i18nBundle) { - return bundle; - } - } - return i18nBundle; - } - return bundle; - }; - tslib_1.__decorate([ - afterRender_1.afterRender() - ], I18n.prototype, "renderDecorator", null); - I18n = tslib_1.__decorate([ - inject_1.inject({ - name: exports.INJECTOR_KEY, - getProperties: function (localeData, properties) { - var _a = properties.locale, locale = _a === void 0 ? localeData.locale : _a, _b = properties.rtl, rtl = _b === void 0 ? localeData.rtl : _b; - return { locale: locale, rtl: rtl }; - } - }) - ], I18n); - return I18n; - }(Base)); - return I18n; - } - exports.I18nMixin = I18nMixin; - exports.default = I18nMixin; -}); -//# sourceMappingURL=I18n.js.map \ No newline at end of file diff --git a/deps/framework/widget-core/mixins/I18n.js.map b/deps/framework/widget-core/mixins/I18n.js.map deleted file mode 100644 index 3a4e546802..0000000000 --- a/deps/framework/widget-core/mixins/I18n.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"I18n.js","sourceRoot":"","sources":["I18n.ts"],"names":[],"mappings":";;;;;;;;;;;;IAAA,mCAAmC;IACnC,wCAA2F;IAC3F,sCAAiC;IACjC,4BAA2C;IAC3C,2DAA0D;IAC1D,iDAAgD;IAEhD,0CAAyC;IAI5B,QAAA,YAAY,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC;IAoF3C,8BAAqC,UAAsB,EAAE,QAAkB;QAC9E,IAAM,QAAQ,GAAG,IAAI,mBAAQ,CAAC,UAAU,CAAC,CAAC;QAC1C,QAAQ,CAAC,cAAc,CAAC,oBAAY,EAAE,UAAC,WAAW;YACjD,QAAQ,CAAC,cAAc,CAAC,WAAW,CAAC,CAAC;YACrC,MAAM,CAAC,cAAM,OAAA,QAAQ,CAAC,GAAG,EAAE,EAAd,CAAc,CAAC;QAC7B,CAAC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ACJ,CAAC;YAED;;;;;;;;;;eAUG;YACK,6BAAc,GAAtB,UAAuB,MAAwB;gBACxC,IAAA,uCAAU,CAAqB;gBACrC,EAAE,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC;oBAChB,EAAE,CAAC,CAAC,UAAU,YAAY,aAAG,CAAC,CAAC,CAAC;wBAC/B,UAAU,GAAG,UAAU,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;wBAEpC,EAAE,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC;4BACjB,MAAM,CAAC,MAAM,CAAC;wBACf,CAAC;oBACF,CAAC;oBAED,MAAM,CAAC,UAAU,CAAC;gBACnB,CAAC;gBACD,MAAM,CAAC,MAAM,CAAC;YACf,CAAC;YAvFD;gBADC,yBAAW,EAAE;uDAkBb;YArDa,IAAI;gBAPlB,eAAM,CAAC;oBACP,IAAI,EAAE,oBAAY;oBAClB,aAAa,EAAE,UAAC,UAAsB,EAAE,UAA0B;wBACzD,IAAA,sBAA0B,EAA1B,+CAA0B,EAAE,mBAAoB,EAApB,yCAAoB,CAAgB;wBACxE,MAAM,CAAC,EAAE,MAAM,QAAA,EAAE,GAAG,KAAA,EAAE,CAAC;oBACxB,CAAC;iBACD,CAAC;eACa,IAAI,CA4HlB;YAAD,WAAC;SAAA,AA5HD,CAA4B,IAAI,GA4H/B;QAED,MAAM,CAAC,IAAI,CAAC;IACb,CAAC;IAvID,8BAuIC;IAED,kBAAe,SAAS,CAAC","sourcesContent":["/* tslint:disable:interface-name */\nimport i18n, { Bundle, formatMessage, getCachedMessages, Messages } from '../../i18n/i18n';\nimport Map from '../../shim/Map';\nimport { isVNode, decorate } from './../d';\nimport { afterRender } from './../decorators/afterRender';\nimport { inject } from './../decorators/inject';\nimport { Constructor, DNode, WidgetProperties, VNodeProperties } from './../interfaces';\nimport { Injector } from './../Injector';\nimport { Registry } from './../Registry';\nimport { WidgetBase } from './../WidgetBase';\n\nexport const INJECTOR_KEY = Symbol('i18n');\n\nexport interface LocaleData {\n\t/**\n\t * The locale for the widget. If not specified, then the root locale (as determined by `@dojo/i18n`) is assumed.\n\t * If specified, the widget's node will have a `lang` property set to the locale.\n\t */\n\tlocale?: string;\n\n\t/**\n\t * An optional flag indicating the widget's text direction. If `true`, then the underlying node's `dir`\n\t * property is set to \"rtl\". If it is `false`, then the `dir` property is set to \"ltr\". Otherwise, the property\n\t * is not set.\n\t */\n\trtl?: boolean;\n}\n\nexport interface I18nProperties extends LocaleData, WidgetProperties {\n\t/**\n\t * An optional override for the bundle passed to the `localizeBundle`. If the override contains a `messages` object,\n\t * then it will completely replace the underlying bundle. Otherwise, a new bundle will be created with the additional\n\t * locale loaders.\n\t */\n\ti18nBundle?: Bundle | Map, Bundle>;\n}\n\n/**\n * @private\n * An internal helper interface for defining locale and text direction attributes on widget nodes.\n */\ninterface I18nVNodeProperties extends VNodeProperties {\n\tdir: string;\n\tlang: string;\n}\n\nexport type LocalizedMessages = {\n\t/**\n\t * Indicates whether the messages are placeholders while waiting for the actual localized messages to load.\n\t * This is always `false` if the associated bundle does not list any supported locales.\n\t */\n\treadonly isPlaceholder: boolean;\n\n\t/**\n\t * Formats an ICU-formatted message template for the represented bundle.\n\t *\n\t * @param key\n\t * The message key.\n\t *\n\t * @param options\n\t * The values to pass to the formatter.\n\t *\n\t * @return\n\t * The formatted string.\n\t */\n\tformat(key: string, options?: any): string;\n\n\t/**\n\t * The localized messages if available, or either the default messages or a blank bundle depending on the\n\t * call signature for `localizeBundle`.\n\t */\n\treadonly messages: T;\n};\n\n/**\n * interface for I18n functionality\n */\nexport interface I18nMixin {\n\t/**\n\t * Return the cached messages for the specified bundle for the current locale, assuming they have already\n\t * been loaded. If the locale-specific messages have not been loaded, they are fetched and the widget state\n\t * is updated.\n\t *\n\t * @param bundle\n\t * The required bundle object for which available locale messages should be loaded.\n\t *\n\t * @return\n\t * An object containing the localized messages, along with a `format` method for formatting ICU-formatted\n\t * templates and an `isPlaceholder` property indicating whether the returned messages are the defaults.\n\t */\n\tlocalizeBundle(bundle: Bundle): LocalizedMessages;\n\n\tproperties: I18nProperties;\n}\n\nexport function registerI18nInjector(localeData: LocaleData, registry: Registry): Injector {\n\tconst injector = new Injector(localeData);\n\tregistry.defineInjector(INJECTOR_KEY, (invalidator) => {\n\t\tinjector.setInvalidator(invalidator);\n\t\treturn () => injector.get();\n\t});\n\treturn injector;\n}\n\nexport function I18nMixin>>(Base: T): T & Constructor {\n\t@inject({\n\t\tname: INJECTOR_KEY,\n\t\tgetProperties: (localeData: LocaleData, properties: I18nProperties) => {\n\t\t\tconst { locale = localeData.locale, rtl = localeData.rtl } = properties;\n\t\t\treturn { locale, rtl };\n\t\t}\n\t})\n\tabstract class I18n extends Base {\n\t\tpublic abstract properties: I18nProperties;\n\n\t\t/**\n\t\t * Return a localized messages object for the provided bundle, deferring to the `i18nBundle` property\n\t\t * when present. If the localized messages have not yet been loaded, return either a blank bundle or the\n\t\t * default messages.\n\t\t *\n\t\t * @param bundle\n\t\t * The bundle to localize\n\t\t *\n\t\t * @param useDefaults\n\t\t * If `true`, the default messages will be used when the localized messages have not yet been loaded. If `false`\n\t\t * (the default), then a blank bundle will be returned (i.e., each key's value will be an empty string).\n\t\t */\n\t\tpublic localizeBundle(\n\t\t\tbaseBundle: Bundle,\n\t\t\tuseDefaults: boolean = false\n\t\t): LocalizedMessages {\n\t\t\tconst bundle = this._resolveBundle(baseBundle);\n\t\t\tconst messages = this._getLocaleMessages(bundle);\n\t\t\tconst isPlaceholder = !messages;\n\t\t\tconst { locale } = this.properties;\n\t\t\tconst format =\n\t\t\t\tisPlaceholder && !useDefaults\n\t\t\t\t\t? (key: string, options?: any) => ''\n\t\t\t\t\t: (key: string, options?: any) => formatMessage(bundle, key, options, locale);\n\n\t\t\treturn Object.create({\n\t\t\t\tformat,\n\t\t\t\tisPlaceholder,\n\t\t\t\tmessages: messages || (useDefaults ? bundle.messages : this._getBlankMessages(bundle))\n\t\t\t});\n\t\t}\n\n\t\t@afterRender()\n\t\tprotected renderDecorator(result: DNode | DNode[]): DNode | DNode[] {\n\t\t\tdecorate(result, {\n\t\t\t\tmodifier: (node, breaker) => {\n\t\t\t\t\tconst { locale, rtl } = this.properties;\n\t\t\t\t\tconst properties: Partial = {};\n\t\t\t\t\tif (typeof rtl === 'boolean') {\n\t\t\t\t\t\tproperties['dir'] = rtl ? 'rtl' : 'ltr';\n\t\t\t\t\t}\n\t\t\t\t\tif (locale) {\n\t\t\t\t\t\tproperties['lang'] = locale;\n\t\t\t\t\t}\n\t\t\t\t\tnode.properties = { ...node.properties, ...properties };\n\t\t\t\t\tbreaker();\n\t\t\t\t},\n\t\t\t\tpredicate: isVNode\n\t\t\t});\n\t\t\treturn result;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t * Return a message bundle containing an empty string for each key in the provided bundle.\n\t\t *\n\t\t * @param bundle\n\t\t * The message bundle\n\t\t *\n\t\t * @return\n\t\t * The blank message bundle\n\t\t */\n\t\tprivate _getBlankMessages(bundle: Bundle): Messages {\n\t\t\tconst blank = {} as Messages;\n\t\t\treturn Object.keys(bundle.messages).reduce((blank, key) => {\n\t\t\t\tblank[key] = '';\n\t\t\t\treturn blank;\n\t\t\t}, blank);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t * Return the cached dictionary for the specified bundle and locale, if it exists. If the requested dictionary does not\n\t\t * exist, then load it and update the instance's state with the appropriate messages.\n\t\t *\n\t\t * @param bundle\n\t\t * The bundle for which to load a locale-specific dictionary.\n\t\t *\n\t\t * @return\n\t\t * The locale-specific dictionary, if it has already been loaded and cached.\n\t\t */\n\t\tprivate _getLocaleMessages(bundle: Bundle): Messages | void {\n\t\t\tconst { properties } = this;\n\t\t\tconst locale = properties.locale || i18n.locale;\n\t\t\tconst localeMessages = getCachedMessages(bundle, locale);\n\n\t\t\tif (localeMessages) {\n\t\t\t\treturn localeMessages;\n\t\t\t}\n\n\t\t\ti18n(bundle, locale).then(() => {\n\t\t\t\tthis.invalidate();\n\t\t\t});\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t * Resolve the bundle to use for the widget's messages to either the provided bundle or to the\n\t\t * `i18nBundle` property.\n\t\t *\n\t\t * @param bundle\n\t\t * The base bundle\n\t\t *\n\t\t * @return\n\t\t * Either override bundle or the original bundle.\n\t\t */\n\t\tprivate _resolveBundle(bundle: Bundle): Bundle {\n\t\t\tlet { i18nBundle } = this.properties;\n\t\t\tif (i18nBundle) {\n\t\t\t\tif (i18nBundle instanceof Map) {\n\t\t\t\t\ti18nBundle = i18nBundle.get(bundle);\n\n\t\t\t\t\tif (!i18nBundle) {\n\t\t\t\t\t\treturn bundle;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\treturn i18nBundle;\n\t\t\t}\n\t\t\treturn bundle;\n\t\t}\n\t}\n\n\treturn I18n;\n}\n\nexport default I18nMixin;\n"]} \ No newline at end of file diff --git a/deps/framework/widget-core/mixins/I18n.mjs b/deps/framework/widget-core/mixins/I18n.mjs deleted file mode 100644 index 733cf9a28a..0000000000 --- a/deps/framework/widget-core/mixins/I18n.mjs +++ /dev/null @@ -1,143 +0,0 @@ -import * as tslib_1 from "tslib"; -/* tslint:disable:interface-name */ -import i18n, { formatMessage, getCachedMessages } from '../../i18n/i18n'; -import Map from '../../shim/Map'; -import { isVNode, decorate } from './../d'; -import { afterRender } from './../decorators/afterRender'; -import { inject } from './../decorators/inject'; -import { Injector } from './../Injector'; -export const INJECTOR_KEY = Symbol('i18n'); -export function registerI18nInjector(localeData, registry) { - const injector = new Injector(localeData); - registry.defineInjector(INJECTOR_KEY, (invalidator) => { - injector.setInvalidator(invalidator); - return () => injector.get(); - }); - return injector; -} -export function I18nMixin(Base) { - let I18n = class I18n extends Base { - /** - * Return a localized messages object for the provided bundle, deferring to the `i18nBundle` property - * when present. If the localized messages have not yet been loaded, return either a blank bundle or the - * default messages. - * - * @param bundle - * The bundle to localize - * - * @param useDefaults - * If `true`, the default messages will be used when the localized messages have not yet been loaded. If `false` - * (the default), then a blank bundle will be returned (i.e., each key's value will be an empty string). - */ - localizeBundle(baseBundle, useDefaults = false) { - const bundle = this._resolveBundle(baseBundle); - const messages = this._getLocaleMessages(bundle); - const isPlaceholder = !messages; - const { locale } = this.properties; - const format = isPlaceholder && !useDefaults - ? (key, options) => '' - : (key, options) => formatMessage(bundle, key, options, locale); - return Object.create({ - format, - isPlaceholder, - messages: messages || (useDefaults ? bundle.messages : this._getBlankMessages(bundle)) - }); - } - renderDecorator(result) { - decorate(result, { - modifier: (node, breaker) => { - const { locale, rtl } = this.properties; - const properties = {}; - if (typeof rtl === 'boolean') { - properties['dir'] = rtl ? 'rtl' : 'ltr'; - } - if (locale) { - properties['lang'] = locale; - } - node.properties = Object.assign({}, node.properties, properties); - breaker(); - }, - predicate: isVNode - }); - return result; - } - /** - * @private - * Return a message bundle containing an empty string for each key in the provided bundle. - * - * @param bundle - * The message bundle - * - * @return - * The blank message bundle - */ - _getBlankMessages(bundle) { - const blank = {}; - return Object.keys(bundle.messages).reduce((blank, key) => { - blank[key] = ''; - return blank; - }, blank); - } - /** - * @private - * Return the cached dictionary for the specified bundle and locale, if it exists. If the requested dictionary does not - * exist, then load it and update the instance's state with the appropriate messages. - * - * @param bundle - * The bundle for which to load a locale-specific dictionary. - * - * @return - * The locale-specific dictionary, if it has already been loaded and cached. - */ - _getLocaleMessages(bundle) { - const { properties } = this; - const locale = properties.locale || i18n.locale; - const localeMessages = getCachedMessages(bundle, locale); - if (localeMessages) { - return localeMessages; - } - i18n(bundle, locale).then(() => { - this.invalidate(); - }); - } - /** - * @private - * Resolve the bundle to use for the widget's messages to either the provided bundle or to the - * `i18nBundle` property. - * - * @param bundle - * The base bundle - * - * @return - * Either override bundle or the original bundle. - */ - _resolveBundle(bundle) { - let { i18nBundle } = this.properties; - if (i18nBundle) { - if (i18nBundle instanceof Map) { - i18nBundle = i18nBundle.get(bundle); - if (!i18nBundle) { - return bundle; - } - } - return i18nBundle; - } - return bundle; - } - }; - tslib_1.__decorate([ - afterRender() - ], I18n.prototype, "renderDecorator", null); - I18n = tslib_1.__decorate([ - inject({ - name: INJECTOR_KEY, - getProperties: (localeData, properties) => { - const { locale = localeData.locale, rtl = localeData.rtl } = properties; - return { locale, rtl }; - } - }) - ], I18n); - return I18n; -} -export default I18nMixin; -//# sourceMappingURL=I18n.mjs.map \ No newline at end of file diff --git a/deps/framework/widget-core/mixins/I18n.mjs.map b/deps/framework/widget-core/mixins/I18n.mjs.map deleted file mode 100644 index ad26f10c19..0000000000 --- a/deps/framework/widget-core/mixins/I18n.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"I18n.mjs","sourceRoot":"","sources":["I18n.ts"],"names":[],"mappings":";AAAA,mCAAmC;AACnC,OAAO,IAAI,EAAE,EAAU,aAAa,EAAE,iBAAiB,EAAY,MAAM,iBAAiB,CAAC;AAC3F,OAAO,GAAG,MAAM,gBAAgB,CAAC;AACjC,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAC3C,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAC1D,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAEhD,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAIzC,MAAM,CAAC,MAAM,YAAY,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC;AAoF3C,MAAM,+BAA+B,UAAsB,EAAE,QAAkB;IAC9E,MAAM,QAAQ,GAAG,IAAI,QAAQ,CAAC,UAAU,CAAC,CAAC;IAC1C,QAAQ,CAAC,cAAc,CAAC,YAAY,EAAE,CAAC,WAAW,EAAE,EAAE;QACrD,QAAQ,CAAC,cAAc,CAAC,WAAW,CAAC,CAAC;QACrC,MAAM,CAAC,GAAG,EAAE,CAAC,QAAQ,CAAC,GAAG,EAAE,CAAC;IAC7B,CAAC,CAAC,CAAC;IACH,MAAM,CAAC,QAAQ,CAAC;AACjB,CAAC;AAED,MAAM,oBAA4D,IAAO;IAQxE,I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C,EAAE,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC;gBAChB,EAAE,CAAC,CAAC,UAAU,YAAY,GAAG,CAAC,CAAC,CAAC;oBAC/B,UAAU,GAAG,UAAU,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;oBAEpC,EAAE,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC;wBACjB,MAAM,CAAC,MAAM,CAAC;oBACf,CAAC;gBACF,CAAC;gBAED,MAAM,CAAC,UAAU,CAAC;YACnB,CAAC;YACD,MAAM,CAAC,MAAM,CAAC;QACf,CAAC;KACD,CAAA;IAxFA;QADC,WAAW,EAAE;+CAkBb;IArDa,IAAI;QAPlB,MAAM,CAAC;YACP,IAAI,EAAE,YAAY;YAClB,aAAa,EAAE,CAAC,UAAsB,EAAE,UAA0B,EAAE,EAAE;gBACrE,MAAM,EAAE,MAAM,GAAG,UAAU,CAAC,MAAM,EAAE,GAAG,GAAG,UAAU,CAAC,GAAG,EAAE,GAAG,UAAU,CAAC;gBACxE,MAAM,CAAC,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC;YACxB,CAAC;SACD,CAAC;OACa,IAAI,CA4HlB;IAED,MAAM,CAAC,IAAI,CAAC;AACb,CAAC;AAED,eAAe,SAAS,CAAC","sourcesContent":["/* tslint:disable:interface-name */\nimport i18n, { Bundle, formatMessage, getCachedMessages, Messages } from '../../i18n/i18n';\nimport Map from '../../shim/Map';\nimport { isVNode, decorate } from './../d';\nimport { afterRender } from './../decorators/afterRender';\nimport { inject } from './../decorators/inject';\nimport { Constructor, DNode, WidgetProperties, VNodeProperties } from './../interfaces';\nimport { Injector } from './../Injector';\nimport { Registry } from './../Registry';\nimport { WidgetBase } from './../WidgetBase';\n\nexport const INJECTOR_KEY = Symbol('i18n');\n\nexport interface LocaleData {\n\t/**\n\t * The locale for the widget. If not specified, then the root locale (as determined by `@dojo/i18n`) is assumed.\n\t * If specified, the widget's node will have a `lang` property set to the locale.\n\t */\n\tlocale?: string;\n\n\t/**\n\t * An optional flag indicating the widget's text direction. If `true`, then the underlying node's `dir`\n\t * property is set to \"rtl\". If it is `false`, then the `dir` property is set to \"ltr\". Otherwise, the property\n\t * is not set.\n\t */\n\trtl?: boolean;\n}\n\nexport interface I18nProperties extends LocaleData, WidgetProperties {\n\t/**\n\t * An optional override for the bundle passed to the `localizeBundle`. If the override contains a `messages` object,\n\t * then it will completely replace the underlying bundle. Otherwise, a new bundle will be created with the additional\n\t * locale loaders.\n\t */\n\ti18nBundle?: Bundle | Map, Bundle>;\n}\n\n/**\n * @private\n * An internal helper interface for defining locale and text direction attributes on widget nodes.\n */\ninterface I18nVNodeProperties extends VNodeProperties {\n\tdir: string;\n\tlang: string;\n}\n\nexport type LocalizedMessages = {\n\t/**\n\t * Indicates whether the messages are placeholders while waiting for the actual localized messages to load.\n\t * This is always `false` if the associated bundle does not list any supported locales.\n\t */\n\treadonly isPlaceholder: boolean;\n\n\t/**\n\t * Formats an ICU-formatted message template for the represented bundle.\n\t *\n\t * @param key\n\t * The message key.\n\t *\n\t * @param options\n\t * The values to pass to the formatter.\n\t *\n\t * @return\n\t * The formatted string.\n\t */\n\tformat(key: string, options?: any): string;\n\n\t/**\n\t * The localized messages if available, or either the default messages or a blank bundle depending on the\n\t * call signature for `localizeBundle`.\n\t */\n\treadonly messages: T;\n};\n\n/**\n * interface for I18n functionality\n */\nexport interface I18nMixin {\n\t/**\n\t * Return the cached messages for the specified bundle for the current locale, assuming they have already\n\t * been loaded. If the locale-specific messages have not been loaded, they are fetched and the widget state\n\t * is updated.\n\t *\n\t * @param bundle\n\t * The required bundle object for which available locale messages should be loaded.\n\t *\n\t * @return\n\t * An object containing the localized messages, along with a `format` method for formatting ICU-formatted\n\t * templates and an `isPlaceholder` property indicating whether the returned messages are the defaults.\n\t */\n\tlocalizeBundle(bundle: Bundle): LocalizedMessages;\n\n\tproperties: I18nProperties;\n}\n\nexport function registerI18nInjector(localeData: LocaleData, registry: Registry): Injector {\n\tconst injector = new Injector(localeData);\n\tregistry.defineInjector(INJECTOR_KEY, (invalidator) => {\n\t\tinjector.setInvalidator(invalidator);\n\t\treturn () => injector.get();\n\t});\n\treturn injector;\n}\n\nexport function I18nMixin>>(Base: T): T & Constructor {\n\t@inject({\n\t\tname: INJECTOR_KEY,\n\t\tgetProperties: (localeData: LocaleData, properties: I18nProperties) => {\n\t\t\tconst { locale = localeData.locale, rtl = localeData.rtl } = properties;\n\t\t\treturn { locale, rtl };\n\t\t}\n\t})\n\tabstract class I18n extends Base {\n\t\tpublic abstract properties: I18nProperties;\n\n\t\t/**\n\t\t * Return a localized messages object for the provided bundle, deferring to the `i18nBundle` property\n\t\t * when present. If the localized messages have not yet been loaded, return either a blank bundle or the\n\t\t * default messages.\n\t\t *\n\t\t * @param bundle\n\t\t * The bundle to localize\n\t\t *\n\t\t * @param useDefaults\n\t\t * If `true`, the default messages will be used when the localized messages have not yet been loaded. If `false`\n\t\t * (the default), then a blank bundle will be returned (i.e., each key's value will be an empty string).\n\t\t */\n\t\tpublic localizeBundle(\n\t\t\tbaseBundle: Bundle,\n\t\t\tuseDefaults: boolean = false\n\t\t): LocalizedMessages {\n\t\t\tconst bundle = this._resolveBundle(baseBundle);\n\t\t\tconst messages = this._getLocaleMessages(bundle);\n\t\t\tconst isPlaceholder = !messages;\n\t\t\tconst { locale } = this.properties;\n\t\t\tconst format =\n\t\t\t\tisPlaceholder && !useDefaults\n\t\t\t\t\t? (key: string, options?: any) => ''\n\t\t\t\t\t: (key: string, options?: any) => formatMessage(bundle, key, options, locale);\n\n\t\t\treturn Object.create({\n\t\t\t\tformat,\n\t\t\t\tisPlaceholder,\n\t\t\t\tmessages: messages || (useDefaults ? bundle.messages : this._getBlankMessages(bundle))\n\t\t\t});\n\t\t}\n\n\t\t@afterRender()\n\t\tprotected renderDecorator(result: DNode | DNode[]): DNode | DNode[] {\n\t\t\tdecorate(result, {\n\t\t\t\tmodifier: (node, breaker) => {\n\t\t\t\t\tconst { locale, rtl } = this.properties;\n\t\t\t\t\tconst properties: Partial = {};\n\t\t\t\t\tif (typeof rtl === 'boolean') {\n\t\t\t\t\t\tproperties['dir'] = rtl ? 'rtl' : 'ltr';\n\t\t\t\t\t}\n\t\t\t\t\tif (locale) {\n\t\t\t\t\t\tproperties['lang'] = locale;\n\t\t\t\t\t}\n\t\t\t\t\tnode.properties = { ...node.properties, ...properties };\n\t\t\t\t\tbreaker();\n\t\t\t\t},\n\t\t\t\tpredicate: isVNode\n\t\t\t});\n\t\t\treturn result;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t * Return a message bundle containing an empty string for each key in the provided bundle.\n\t\t *\n\t\t * @param bundle\n\t\t * The message bundle\n\t\t *\n\t\t * @return\n\t\t * The blank message bundle\n\t\t */\n\t\tprivate _getBlankMessages(bundle: Bundle): Messages {\n\t\t\tconst blank = {} as Messages;\n\t\t\treturn Object.keys(bundle.messages).reduce((blank, key) => {\n\t\t\t\tblank[key] = '';\n\t\t\t\treturn blank;\n\t\t\t}, blank);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t * Return the cached dictionary for the specified bundle and locale, if it exists. If the requested dictionary does not\n\t\t * exist, then load it and update the instance's state with the appropriate messages.\n\t\t *\n\t\t * @param bundle\n\t\t * The bundle for which to load a locale-specific dictionary.\n\t\t *\n\t\t * @return\n\t\t * The locale-specific dictionary, if it has already been loaded and cached.\n\t\t */\n\t\tprivate _getLocaleMessages(bundle: Bundle): Messages | void {\n\t\t\tconst { properties } = this;\n\t\t\tconst locale = properties.locale || i18n.locale;\n\t\t\tconst localeMessages = getCachedMessages(bundle, locale);\n\n\t\t\tif (localeMessages) {\n\t\t\t\treturn localeMessages;\n\t\t\t}\n\n\t\t\ti18n(bundle, locale).then(() => {\n\t\t\t\tthis.invalidate();\n\t\t\t});\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t * Resolve the bundle to use for the widget's messages to either the provided bundle or to the\n\t\t * `i18nBundle` property.\n\t\t *\n\t\t * @param bundle\n\t\t * The base bundle\n\t\t *\n\t\t * @return\n\t\t * Either override bundle or the original bundle.\n\t\t */\n\t\tprivate _resolveBundle(bundle: Bundle): Bundle {\n\t\t\tlet { i18nBundle } = this.properties;\n\t\t\tif (i18nBundle) {\n\t\t\t\tif (i18nBundle instanceof Map) {\n\t\t\t\t\ti18nBundle = i18nBundle.get(bundle);\n\n\t\t\t\t\tif (!i18nBundle) {\n\t\t\t\t\t\treturn bundle;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\treturn i18nBundle;\n\t\t\t}\n\t\t\treturn bundle;\n\t\t}\n\t}\n\n\treturn I18n;\n}\n\nexport default I18nMixin;\n"]} \ No newline at end of file diff --git a/deps/framework/widget-core/mixins/Projector.d.ts b/deps/framework/widget-core/mixins/Projector.d.ts deleted file mode 100644 index 4087f95653..0000000000 --- a/deps/framework/widget-core/mixins/Projector.d.ts +++ /dev/null @@ -1,90 +0,0 @@ -import { Handle } from '../../core/interfaces'; -import { Constructor, DNode } from './../interfaces'; -import { WidgetBase } from './../WidgetBase'; -import { Registry } from './../Registry'; -/** - * Represents the attach state of the projector - */ -export declare enum ProjectorAttachState { - Attached = 1, - Detached = 2, -} -/** - * Attach type for the projector - */ -export declare enum AttachType { - Append = 1, - Merge = 2, -} -export interface AttachOptions { - /** - * If `'append'` it will appended to the root. If `'merge'` it will merged with the root. If `'replace'` it will - * replace the root. - */ - type: AttachType; - /** - * Element to attach the projector. - */ - root?: Element; -} -export interface ProjectorProperties { - registry?: Registry; -} -export interface ProjectorMixin

{ - readonly properties: Readonly

& Readonly; - /** - * Append the projector to the root. - */ - append(root?: Element): Handle; - /** - * Merge the projector onto the root. - * - * The `root` and any of its `children` will be re-used. Any excess DOM nodes will be ignored and any missing DOM nodes - * will be created. - * @param root The root element that the root virtual DOM node will be merged with. Defaults to `document.body`. - */ - merge(root?: Element): Handle; - /** - * Attach the project to a _sandboxed_ document fragment that is not part of the DOM. - * - * When sandboxed, the `Projector` will run in a sync manner, where renders are completed within the same turn. - * The `Projector` creates a `DocumentFragment` which replaces any other `root` that has been set. - * @param doc The `Document` to use, which defaults to the global `document`. - */ - sandbox(doc?: Document): void; - /** - * Sets the properties for the widget. Responsible for calling the diffing functions for the properties against the - * previous properties. Runs though any registered specific property diff functions collecting the results and then - * runs the remainder through the catch all diff function. The aggregate of the two sets of the results is then - * set as the widget's properties - * - * @param properties The new widget properties - */ - setProperties(properties: this['properties']): void; - /** - * Sets the widget's children - */ - setChildren(children: DNode[]): void; - /** - * Return a `string` that represents the HTML of the current projection. The projector needs to be attached. - */ - toHtml(): string; - /** - * Indicates if the projectors is in async mode, configured to `true` by defaults. - */ - async: boolean; - /** - * Root element to attach the projector - */ - root: Element; - /** - * The status of the projector - */ - readonly projectorState: ProjectorAttachState; - /** - * Runs registered destroy handles - */ - destroy(): void; -} -export declare function ProjectorMixin>>(Base: T): T & Constructor>; -export default ProjectorMixin; diff --git a/deps/framework/widget-core/mixins/Projector.js b/deps/framework/widget-core/mixins/Projector.js deleted file mode 100644 index 974cb0e3fa..0000000000 --- a/deps/framework/widget-core/mixins/Projector.js +++ /dev/null @@ -1,186 +0,0 @@ -(function (factory) { - if (typeof module === "object" && typeof module.exports === "object") { - var v = factory(require, exports); - if (v !== undefined) module.exports = v; - } - else if (typeof define === "function" && define.amd) { - define(["require", "exports", "tslib", "../../core/lang", "../animations/cssTransitions", "./../decorators/afterRender", "./../d", "./../vdom"], factory); - } -})(function (require, exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - var tslib_1 = require("tslib"); - var lang_1 = require("../../core/lang"); - var cssTransitions_1 = require("../animations/cssTransitions"); - var afterRender_1 = require("./../decorators/afterRender"); - var d_1 = require("./../d"); - var vdom_1 = require("./../vdom"); - /** - * Represents the attach state of the projector - */ - var ProjectorAttachState; - (function (ProjectorAttachState) { - ProjectorAttachState[ProjectorAttachState["Attached"] = 1] = "Attached"; - ProjectorAttachState[ProjectorAttachState["Detached"] = 2] = "Detached"; - })(ProjectorAttachState = exports.ProjectorAttachState || (exports.ProjectorAttachState = {})); - /** - * Attach type for the projector - */ - var AttachType; - (function (AttachType) { - AttachType[AttachType["Append"] = 1] = "Append"; - AttachType[AttachType["Merge"] = 2] = "Merge"; - })(AttachType = exports.AttachType || (exports.AttachType = {})); - function ProjectorMixin(Base) { - var Projector = /** @class */ (function (_super) { - tslib_1.__extends(Projector, _super); - function Projector() { - var args = []; - for (var _i = 0; _i < arguments.length; _i++) { - args[_i] = arguments[_i]; - } - var _this = _super.apply(this, tslib_1.__spread(args)) || this; - _this._root = document.body; - _this._async = true; - _this._projectorProperties = {}; - _this._projectionOptions = { - transitions: cssTransitions_1.default - }; - _this.root = document.body; - _this.projectorState = ProjectorAttachState.Detached; - return _this; - } - Projector.prototype.append = function (root) { - var options = { - type: AttachType.Append, - root: root - }; - return this._attach(options); - }; - Projector.prototype.merge = function (root) { - var options = { - type: AttachType.Merge, - root: root - }; - return this._attach(options); - }; - Object.defineProperty(Projector.prototype, "root", { - get: function () { - return this._root; - }, - set: function (root) { - if (this.projectorState === ProjectorAttachState.Attached) { - throw new Error('Projector already attached, cannot change root element'); - } - this._root = root; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(Projector.prototype, "async", { - get: function () { - return this._async; - }, - set: function (async) { - if (this.projectorState === ProjectorAttachState.Attached) { - throw new Error('Projector already attached, cannot change async mode'); - } - this._async = async; - }, - enumerable: true, - configurable: true - }); - Projector.prototype.sandbox = function (doc) { - var _this = this; - if (doc === void 0) { doc = document; } - if (this.projectorState === ProjectorAttachState.Attached) { - throw new Error('Projector already attached, cannot create sandbox'); - } - this._async = false; - var previousRoot = this.root; - /* free up the document fragment for GC */ - this.own({ - destroy: function () { - _this._root = previousRoot; - } - }); - this._attach({ - /* DocumentFragment is not assignable to Element, but provides everything needed to work */ - root: doc.createDocumentFragment(), - type: AttachType.Append - }); - }; - Projector.prototype.setChildren = function (children) { - this.__setChildren__(children); - }; - Projector.prototype.setProperties = function (properties) { - this.__setProperties__(properties); - }; - Projector.prototype.__setProperties__ = function (properties) { - if (this._projectorProperties && this._projectorProperties.registry !== properties.registry) { - if (this._projectorProperties.registry) { - this._projectorProperties.registry.destroy(); - } - } - this._projectorProperties = lang_1.assign({}, properties); - _super.prototype.__setCoreProperties__.call(this, { bind: this, baseRegistry: properties.registry }); - _super.prototype.__setProperties__.call(this, properties); - }; - Projector.prototype.toHtml = function () { - if (this.projectorState !== ProjectorAttachState.Attached || !this._projection) { - throw new Error('Projector is not attached, cannot return an HTML string of projection.'); - } - return this._projection.domNode.childNodes[0].outerHTML; - }; - Projector.prototype.afterRender = function (result) { - var node = result; - if (typeof result === 'string' || result === null || result === undefined) { - node = d_1.v('span', {}, [result]); - } - return node; - }; - Projector.prototype.destroy = function () { - _super.prototype.destroy.call(this); - }; - Projector.prototype._attach = function (_a) { - var _this = this; - var type = _a.type, root = _a.root; - if (root) { - this.root = root; - } - if (this._attachHandle) { - return this._attachHandle; - } - this.projectorState = ProjectorAttachState.Attached; - var handle = { - destroy: function () { - if (_this.projectorState === ProjectorAttachState.Attached) { - _this._projection = undefined; - _this.projectorState = ProjectorAttachState.Detached; - } - } - }; - this.own(handle); - this._attachHandle = handle; - this._projectionOptions = tslib_1.__assign({}, this._projectionOptions, { sync: !this._async }); - switch (type) { - case AttachType.Append: - this._projection = vdom_1.dom.append(this.root, this, this._projectionOptions); - break; - case AttachType.Merge: - this._projection = vdom_1.dom.merge(this.root, this, this._projectionOptions); - break; - } - return this._attachHandle; - }; - tslib_1.__decorate([ - afterRender_1.afterRender() - ], Projector.prototype, "afterRender", null); - return Projector; - }(Base)); - return Projector; - } - exports.ProjectorMixin = ProjectorMixin; - exports.default = ProjectorMixin; -}); -//# sourceMappingURL=Projector.js.map \ No newline at end of file diff --git a/deps/framework/widget-core/mixins/Projector.js.map b/deps/framework/widget-core/mixins/Projector.js.map deleted file mode 100644 index 9197625e4f..0000000000 --- a/deps/framework/widget-core/mixins/Projector.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"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I,CAAC,CAAC,CAAC;oBACd,KAAK,UAAU,CAAC,MAAM;wBACrB,IAAI,CAAC,WAAW,GAAG,UAAG,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,kBAAkB,CAAC,CAAC;wBACxE,KAAK,CAAC;oBACP,KAAK,UAAU,CAAC,KAAK;wBACpB,IAAI,CAAC,WAAW,GAAG,UAAG,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,kBAAkB,CAAC,CAAC;wBACvE,KAAK,CAAC;gBACR,CAAC;gBAED,MAAM,CAAC,IAAI,CAAC,aAAa,CAAC;YAC3B,CAAC;YAhDD;gBADC,yBAAW,EAAE;wDAQb;YA0CF,gBAAC;SAAA,AA/JD,CAAiC,IAAI,GA+JpC;QAED,MAAM,CAAC,SAAS,CAAC;IAClB,CAAC;IAnKD,wCAmKC;IAED,kBAAe,cAAc,CAAC","sourcesContent":["import { assign } from '../../core/lang';\nimport { Handle } from '../../core/interfaces';\nimport cssTransitions from '../animations/cssTransitions';\nimport { Constructor, DNode, Projection, ProjectionOptions } from './../interfaces';\nimport { WidgetBase } from './../WidgetBase';\nimport { afterRender } from './../decorators/afterRender';\nimport { v } from './../d';\nimport { Registry } from './../Registry';\nimport { dom } from './../vdom';\n\n/**\n * Represents the attach state of the projector\n */\nexport enum ProjectorAttachState {\n\tAttached = 1,\n\tDetached\n}\n\n/**\n * Attach type for the projector\n */\nexport enum AttachType {\n\tAppend = 1,\n\tMerge = 2\n}\n\nexport interface AttachOptions {\n\t/**\n\t * If `'append'` it will appended to the root. If `'merge'` it will merged with the root. If `'replace'` it will\n\t * replace the root.\n\t */\n\ttype: AttachType;\n\n\t/**\n\t * Element to attach the projector.\n\t */\n\troot?: Element;\n}\n\nexport interface ProjectorProperties {\n\tregistry?: Registry;\n}\n\nexport interface ProjectorMixin

{\n\treadonly properties: Readonly

& Readonly;\n\n\t/**\n\t * Append the projector to the root.\n\t */\n\tappend(root?: Element): Handle;\n\n\t/**\n\t * Merge the projector onto the root.\n\t *\n\t * The `root` and any of its `children` will be re-used. Any excess DOM nodes will be ignored and any missing DOM nodes\n\t * will be created.\n\t * @param root The root element that the root virtual DOM node will be merged with. Defaults to `document.body`.\n\t */\n\tmerge(root?: Element): Handle;\n\n\t/**\n\t * Attach the project to a _sandboxed_ document fragment that is not part of the DOM.\n\t *\n\t * When sandboxed, the `Projector` will run in a sync manner, where renders are completed within the same turn.\n\t * The `Projector` creates a `DocumentFragment` which replaces any other `root` that has been set.\n\t * @param doc The `Document` to use, which defaults to the global `document`.\n\t */\n\tsandbox(doc?: Document): void;\n\n\t/**\n\t * Sets the properties for the widget. Responsible for calling the diffing functions for the properties against the\n\t * previous properties. Runs though any registered specific property diff functions collecting the results and then\n\t * runs the remainder through the catch all diff function. The aggregate of the two sets of the results is then\n\t * set as the widget's properties\n\t *\n\t * @param properties The new widget properties\n\t */\n\tsetProperties(properties: this['properties']): void;\n\n\t/**\n\t * Sets the widget's children\n\t */\n\tsetChildren(children: DNode[]): void;\n\n\t/**\n\t * Return a `string` that represents the HTML of the current projection. The projector needs to be attached.\n\t */\n\ttoHtml(): string;\n\n\t/**\n\t * Indicates if the projectors is in async mode, configured to `true` by defaults.\n\t */\n\tasync: boolean;\n\n\t/**\n\t * Root element to attach the projector\n\t */\n\troot: Element;\n\n\t/**\n\t * The status of the projector\n\t */\n\treadonly projectorState: ProjectorAttachState;\n\n\t/**\n\t * Runs registered destroy handles\n\t */\n\tdestroy(): void;\n}\n\nexport function ProjectorMixin>>(Base: T): T & Constructor> {\n\tabstract class Projector extends Base {\n\t\tpublic projectorState: ProjectorAttachState;\n\n\t\tprivate _root: Element = document.body;\n\t\tprivate _async = true;\n\t\tprivate _attachHandle: Handle | undefined;\n\t\tprivate _projectionOptions: Partial;\n\t\tprivate _projection: Projection | undefined;\n\t\tprivate _projectorProperties: this['properties'] = {} as this['properties'];\n\t\tpublic abstract properties: Readonly

& Readonly;\n\n\t\tconstructor(...args: any[]) {\n\t\t\tsuper(...args);\n\n\t\t\tthis._projectionOptions = {\n\t\t\t\ttransitions: cssTransitions\n\t\t\t};\n\n\t\t\tthis.root = document.body;\n\t\t\tthis.projectorState = ProjectorAttachState.Detached;\n\t\t}\n\n\t\tpublic append(root?: Element): Handle {\n\t\t\tconst options = {\n\t\t\t\ttype: AttachType.Append,\n\t\t\t\troot\n\t\t\t};\n\n\t\t\treturn this._attach(options);\n\t\t}\n\n\t\tpublic merge(root?: Element): Handle {\n\t\t\tconst options = {\n\t\t\t\ttype: AttachType.Merge,\n\t\t\t\troot\n\t\t\t};\n\n\t\t\treturn this._attach(options);\n\t\t}\n\n\t\tpublic set root(root: Element) {\n\t\t\tif (this.projectorState === ProjectorAttachState.Attached) {\n\t\t\t\tthrow new Error('Projector already attached, cannot change root element');\n\t\t\t}\n\t\t\tthis._root = root;\n\t\t}\n\n\t\tpublic get root(): Element {\n\t\t\treturn this._root;\n\t\t}\n\n\t\tpublic get async(): boolean {\n\t\t\treturn this._async;\n\t\t}\n\n\t\tpublic set async(async: boolean) {\n\t\t\tif (this.projectorState === ProjectorAttachState.Attached) {\n\t\t\t\tthrow new Error('Projector already attached, cannot change async mode');\n\t\t\t}\n\t\t\tthis._async = async;\n\t\t}\n\n\t\tpublic sandbox(doc: Document = document): void {\n\t\t\tif (this.projectorState === ProjectorAttachState.Attached) {\n\t\t\t\tthrow new Error('Projector already attached, cannot create sandbox');\n\t\t\t}\n\t\t\tthis._async = false;\n\t\t\tconst previousRoot = this.root;\n\n\t\t\t/* free up the document fragment for GC */\n\t\t\tthis.own({\n\t\t\t\tdestroy: () => {\n\t\t\t\t\tthis._root = previousRoot;\n\t\t\t\t}\n\t\t\t});\n\n\t\t\tthis._attach({\n\t\t\t\t/* DocumentFragment is not assignable to Element, but provides everything needed to work */\n\t\t\t\troot: doc.createDocumentFragment() as any,\n\t\t\t\ttype: AttachType.Append\n\t\t\t});\n\t\t}\n\n\t\tpublic setChildren(children: DNode[]): void {\n\t\t\tthis.__setChildren__(children);\n\t\t}\n\n\t\tpublic setProperties(properties: this['properties']): void {\n\t\t\tthis.__setProperties__(properties);\n\t\t}\n\n\t\tpublic __setProperties__(properties: this['properties']): void {\n\t\t\tif (this._projectorProperties && this._projectorProperties.registry !== properties.registry) {\n\t\t\t\tif (this._projectorProperties.registry) {\n\t\t\t\t\tthis._projectorProperties.registry.destroy();\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis._projectorProperties = assign({}, properties);\n\t\t\tsuper.__setCoreProperties__({ bind: this, baseRegistry: properties.registry });\n\t\t\tsuper.__setProperties__(properties);\n\t\t}\n\n\t\tpublic toHtml(): string {\n\t\t\tif (this.projectorState !== ProjectorAttachState.Attached || !this._projection) {\n\t\t\t\tthrow new Error('Projector is not attached, cannot return an HTML string of projection.');\n\t\t\t}\n\t\t\treturn (this._projection.domNode.childNodes[0] as Element).outerHTML;\n\t\t}\n\n\t\t@afterRender()\n\t\tpublic afterRender(result: DNode) {\n\t\t\tlet node = result;\n\t\t\tif (typeof result === 'string' || result === null || result === undefined) {\n\t\t\t\tnode = v('span', {}, [result]);\n\t\t\t}\n\n\t\t\treturn node;\n\t\t}\n\n\t\tpublic destroy() {\n\t\t\tsuper.destroy();\n\t\t}\n\n\t\tprivate _attach({ type, root }: AttachOptions): Handle {\n\t\t\tif (root) {\n\t\t\t\tthis.root = root;\n\t\t\t}\n\n\t\t\tif (this._attachHandle) {\n\t\t\t\treturn this._attachHandle;\n\t\t\t}\n\n\t\t\tthis.projectorState = ProjectorAttachState.Attached;\n\n\t\t\tconst handle = {\n\t\t\t\tdestroy: () => {\n\t\t\t\t\tif (this.projectorState === ProjectorAttachState.Attached) {\n\t\t\t\t\t\tthis._projection = undefined;\n\t\t\t\t\t\tthis.projectorState = ProjectorAttachState.Detached;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t};\n\n\t\t\tthis.own(handle);\n\t\t\tthis._attachHandle = handle;\n\n\t\t\tthis._projectionOptions = { ...this._projectionOptions, ...{ sync: !this._async } };\n\n\t\t\tswitch (type) {\n\t\t\t\tcase AttachType.Append:\n\t\t\t\t\tthis._projection = dom.append(this.root, this, this._projectionOptions);\n\t\t\t\t\tbreak;\n\t\t\t\tcase AttachType.Merge:\n\t\t\t\t\tthis._projection = dom.merge(this.root, this, this._projectionOptions);\n\t\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\treturn this._attachHandle;\n\t\t}\n\t}\n\n\treturn Projector;\n}\n\nexport default ProjectorMixin;\n"]} \ No newline at end of file diff --git a/deps/framework/widget-core/mixins/Projector.mjs b/deps/framework/widget-core/mixins/Projector.mjs deleted file mode 100644 index 74878c28f1..0000000000 --- a/deps/framework/widget-core/mixins/Projector.mjs +++ /dev/null @@ -1,154 +0,0 @@ -import * as tslib_1 from "tslib"; -import { assign } from '../../core/lang'; -import cssTransitions from '../animations/cssTransitions'; -import { afterRender } from './../decorators/afterRender'; -import { v } from './../d'; -import { dom } from './../vdom'; -/** - * Represents the attach state of the projector - */ -export var ProjectorAttachState; -(function (ProjectorAttachState) { - ProjectorAttachState[ProjectorAttachState["Attached"] = 1] = "Attached"; - ProjectorAttachState[ProjectorAttachState["Detached"] = 2] = "Detached"; -})(ProjectorAttachState || (ProjectorAttachState = {})); -/** - * Attach type for the projector - */ -export var AttachType; -(function (AttachType) { - AttachType[AttachType["Append"] = 1] = "Append"; - AttachType[AttachType["Merge"] = 2] = "Merge"; -})(AttachType || (AttachType = {})); -export function ProjectorMixin(Base) { - class Projector extends Base { - constructor(...args) { - super(...args); - this._root = document.body; - this._async = true; - this._projectorProperties = {}; - this._projectionOptions = { - transitions: cssTransitions - }; - this.root = document.body; - this.projectorState = ProjectorAttachState.Detached; - } - append(root) { - const options = { - type: AttachType.Append, - root - }; - return this._attach(options); - } - merge(root) { - const options = { - type: AttachType.Merge, - root - }; - return this._attach(options); - } - set root(root) { - if (this.projectorState === ProjectorAttachState.Attached) { - throw new Error('Projector already attached, cannot change root element'); - } - this._root = root; - } - get root() { - return this._root; - } - get async() { - return this._async; - } - set async(async) { - if (this.projectorState === ProjectorAttachState.Attached) { - throw new Error('Projector already attached, cannot change async mode'); - } - this._async = async; - } - sandbox(doc = document) { - if (this.projectorState === ProjectorAttachState.Attached) { - throw new Error('Projector already attached, cannot create sandbox'); - } - this._async = false; - const previousRoot = this.root; - /* free up the document fragment for GC */ - this.own({ - destroy: () => { - this._root = previousRoot; - } - }); - this._attach({ - /* DocumentFragment is not assignable to Element, but provides everything needed to work */ - root: doc.createDocumentFragment(), - type: AttachType.Append - }); - } - setChildren(children) { - this.__setChildren__(children); - } - setProperties(properties) { - this.__setProperties__(properties); - } - __setProperties__(properties) { - if (this._projectorProperties && this._projectorProperties.registry !== properties.registry) { - if (this._projectorProperties.registry) { - this._projectorProperties.registry.destroy(); - } - } - this._projectorProperties = assign({}, properties); - super.__setCoreProperties__({ bind: this, baseRegistry: properties.registry }); - super.__setProperties__(properties); - } - toHtml() { - if (this.projectorState !== ProjectorAttachState.Attached || !this._projection) { - throw new Error('Projector is not attached, cannot return an HTML string of projection.'); - } - return this._projection.domNode.childNodes[0].outerHTML; - } - afterRender(result) { - let node = result; - if (typeof result === 'string' || result === null || result === undefined) { - node = v('span', {}, [result]); - } - return node; - } - destroy() { - super.destroy(); - } - _attach({ type, root }) { - if (root) { - this.root = root; - } - if (this._attachHandle) { - return this._attachHandle; - } - this.projectorState = ProjectorAttachState.Attached; - const handle = { - destroy: () => { - if (this.projectorState === ProjectorAttachState.Attached) { - this._projection = undefined; - this.projectorState = ProjectorAttachState.Detached; - } - } - }; - this.own(handle); - this._attachHandle = handle; - this._projectionOptions = Object.assign({}, this._projectionOptions, { sync: !this._async }); - switch (type) { - case AttachType.Append: - this._projection = dom.append(this.root, this, this._projectionOptions); - break; - case AttachType.Merge: - this._projection = dom.merge(this.root, this, this._projectionOptions); - break; - } - return this._attachHandle; - } - } - tslib_1.__decorate([ - afterRender() - ], Projector.prototype, "afterRender", null); - return Projector; -} -export default ProjectorMixin; -//# sourceMappingURL=Projector.mjs.map \ No newline at end of file diff --git a/deps/framework/widget-core/mixins/Projector.mjs.map b/deps/framework/widget-core/mixins/Projector.mjs.map deleted file mode 100644 index 1bc585b22a..0000000000 --- a/deps/framework/widget-core/mixins/Projector.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"Projector.mjs","sourceRoot":"","sources":["Projector.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAEzC,OAAO,cAAc,MAAM,8BAA8B,CAAC;AAG1D,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAC1D,OAAO,EAAE,CAAC,EAAE,MAAM,QAAQ,CAAC;AAE3B,OAAO,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AAEhC;;GAEG;AACH,MAAM,CAAN,IAAY,oBAGX;AAHD,WAAY,oBAAoB;IAC/B,uEAAY,CAAA;IACZ,uEAAQ,CAAA;AACT,CAAC,EAHW,oBAAoB,KAApB,oBAAoB,QAG/B;AAED;;GAEG;AACH,MAAM,CAAN,IAAY,UAGX;AAHD,WAAY,UAAU;IACrB,+CAAU,CAAA;IACV,6CAAS,CAAA;AACV,CAAC,EAHW,UAAU,KAAV,UAAU,QAGrB;AAsFD,MAAM,yBAAkE,IAAO;IAC9E,eAAyB,SAAQ,IAAI;QAWpC,YAAY,GAAG,IAAW;YACzB,KAAK,CAAC,GAAG,IAAI,CAAC,CAAC;YATR,UAAK,GAAY,QAAQ,CAAC,IAAI,CAAC;YAC/B,WAAM,GAAG,IAAI,CAAC;YAId,yBAAoB,GAAuB,EAAwB,CAAC;YAM3E,IAAI,CAAC,kBAAkB,GAAG;gBACzB,WAAW,EAAE,cAAc;aAC3B,CAAC;YAEF,IAAI,CAAC,IAAI,GAAG,QAAQ,CAAC,IAAI,CAAC;YAC1B,IAAI,CAAC,cAAc,GAAG,oBAAoB,CAAC,QAAQ,CAAC;QACrD,CAAC;Q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AI,CAAC,kBAAkB,qBAAQ,IAAI,CAAC,kBAAkB,EAAK,EAAE,IAAI,EAAE,CAAC,IAAI,CAAC,MAAM,EAAE,CAAE,CAAC;YAEpF,MAAM,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC;gBACd,KAAK,UAAU,CAAC,MAAM;oBACrB,IAAI,CAAC,WAAW,GAAG,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,kBAAkB,CAAC,CAAC;oBACxE,KAAK,CAAC;gBACP,KAAK,UAAU,CAAC,KAAK;oBACpB,IAAI,CAAC,WAAW,GAAG,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,kBAAkB,CAAC,CAAC;oBACvE,KAAK,CAAC;YACR,CAAC;YAED,MAAM,CAAC,IAAI,CAAC,aAAa,CAAC;QAC3B,CAAC;KACD;IAjDA;QADC,WAAW,EAAE;gDAQb;IA4CF,MAAM,CAAC,SAAS,CAAC;AAClB,CAAC;AAED,eAAe,cAAc,CAAC","sourcesContent":["import { assign } from '../../core/lang';\nimport { Handle } from '../../core/interfaces';\nimport cssTransitions from '../animations/cssTransitions';\nimport { Constructor, DNode, Projection, ProjectionOptions } from './../interfaces';\nimport { WidgetBase } from './../WidgetBase';\nimport { afterRender } from './../decorators/afterRender';\nimport { v } from './../d';\nimport { Registry } from './../Registry';\nimport { dom } from './../vdom';\n\n/**\n * Represents the attach state of the projector\n */\nexport enum ProjectorAttachState {\n\tAttached = 1,\n\tDetached\n}\n\n/**\n * Attach type for the projector\n */\nexport enum AttachType {\n\tAppend = 1,\n\tMerge = 2\n}\n\nexport interface AttachOptions {\n\t/**\n\t * If `'append'` it will appended to the root. If `'merge'` it will merged with the root. If `'replace'` it will\n\t * replace the root.\n\t */\n\ttype: AttachType;\n\n\t/**\n\t * Element to attach the projector.\n\t */\n\troot?: Element;\n}\n\nexport interface ProjectorProperties {\n\tregistry?: Registry;\n}\n\nexport interface ProjectorMixin

{\n\treadonly properties: Readonly

& Readonly;\n\n\t/**\n\t * Append the projector to the root.\n\t */\n\tappend(root?: Element): Handle;\n\n\t/**\n\t * Merge the projector onto the root.\n\t *\n\t * The `root` and any of its `children` will be re-used. Any excess DOM nodes will be ignored and any missing DOM nodes\n\t * will be created.\n\t * @param root The root element that the root virtual DOM node will be merged with. Defaults to `document.body`.\n\t */\n\tmerge(root?: Element): Handle;\n\n\t/**\n\t * Attach the project to a _sandboxed_ document fragment that is not part of the DOM.\n\t *\n\t * When sandboxed, the `Projector` will run in a sync manner, where renders are completed within the same turn.\n\t * The `Projector` creates a `DocumentFragment` which replaces any other `root` that has been set.\n\t * @param doc The `Document` to use, which defaults to the global `document`.\n\t */\n\tsandbox(doc?: Document): void;\n\n\t/**\n\t * Sets the properties for the widget. Responsible for calling the diffing functions for the properties against the\n\t * previous properties. Runs though any registered specific property diff functions collecting the results and then\n\t * runs the remainder through the catch all diff function. The aggregate of the two sets of the results is then\n\t * set as the widget's properties\n\t *\n\t * @param properties The new widget properties\n\t */\n\tsetProperties(properties: this['properties']): void;\n\n\t/**\n\t * Sets the widget's children\n\t */\n\tsetChildren(children: DNode[]): void;\n\n\t/**\n\t * Return a `string` that represents the HTML of the current projection. The projector needs to be attached.\n\t */\n\ttoHtml(): string;\n\n\t/**\n\t * Indicates if the projectors is in async mode, configured to `true` by defaults.\n\t */\n\tasync: boolean;\n\n\t/**\n\t * Root element to attach the projector\n\t */\n\troot: Element;\n\n\t/**\n\t * The status of the projector\n\t */\n\treadonly projectorState: ProjectorAttachState;\n\n\t/**\n\t * Runs registered destroy handles\n\t */\n\tdestroy(): void;\n}\n\nexport function ProjectorMixin>>(Base: T): T & Constructor> {\n\tabstract class Projector extends Base {\n\t\tpublic projectorState: ProjectorAttachState;\n\n\t\tprivate _root: Element = document.body;\n\t\tprivate _async = true;\n\t\tprivate _attachHandle: Handle | undefined;\n\t\tprivate _projectionOptions: Partial;\n\t\tprivate _projection: Projection | undefined;\n\t\tprivate _projectorProperties: this['properties'] = {} as this['properties'];\n\t\tpublic abstract properties: Readonly

& Readonly;\n\n\t\tconstructor(...args: any[]) {\n\t\t\tsuper(...args);\n\n\t\t\tthis._projectionOptions = {\n\t\t\t\ttransitions: cssTransitions\n\t\t\t};\n\n\t\t\tthis.root = document.body;\n\t\t\tthis.projectorState = ProjectorAttachState.Detached;\n\t\t}\n\n\t\tpublic append(root?: Element): Handle {\n\t\t\tconst options = {\n\t\t\t\ttype: AttachType.Append,\n\t\t\t\troot\n\t\t\t};\n\n\t\t\treturn this._attach(options);\n\t\t}\n\n\t\tpublic merge(root?: Element): Handle {\n\t\t\tconst options = {\n\t\t\t\ttype: AttachType.Merge,\n\t\t\t\troot\n\t\t\t};\n\n\t\t\treturn this._attach(options);\n\t\t}\n\n\t\tpublic set root(root: Element) {\n\t\t\tif (this.projectorState === ProjectorAttachState.Attached) {\n\t\t\t\tthrow new Error('Projector already attached, cannot change root element');\n\t\t\t}\n\t\t\tthis._root = root;\n\t\t}\n\n\t\tpublic get root(): Element {\n\t\t\treturn this._root;\n\t\t}\n\n\t\tpublic get async(): boolean {\n\t\t\treturn this._async;\n\t\t}\n\n\t\tpublic set async(async: boolean) {\n\t\t\tif (this.projectorState === ProjectorAttachState.Attached) {\n\t\t\t\tthrow new Error('Projector already attached, cannot change async mode');\n\t\t\t}\n\t\t\tthis._async = async;\n\t\t}\n\n\t\tpublic sandbox(doc: Document = document): void {\n\t\t\tif (this.projectorState === ProjectorAttachState.Attached) {\n\t\t\t\tthrow new Error('Projector already attached, cannot create sandbox');\n\t\t\t}\n\t\t\tthis._async = false;\n\t\t\tconst previousRoot = this.root;\n\n\t\t\t/* free up the document fragment for GC */\n\t\t\tthis.own({\n\t\t\t\tdestroy: () => {\n\t\t\t\t\tthis._root = previousRoot;\n\t\t\t\t}\n\t\t\t});\n\n\t\t\tthis._attach({\n\t\t\t\t/* DocumentFragment is not assignable to Element, but provides everything needed to work */\n\t\t\t\troot: doc.createDocumentFragment() as any,\n\t\t\t\ttype: AttachType.Append\n\t\t\t});\n\t\t}\n\n\t\tpublic setChildren(children: DNode[]): void {\n\t\t\tthis.__setChildren__(children);\n\t\t}\n\n\t\tpublic setProperties(properties: this['properties']): void {\n\t\t\tthis.__setProperties__(properties);\n\t\t}\n\n\t\tpublic __setProperties__(properties: this['properties']): void {\n\t\t\tif (this._projectorProperties && this._projectorProperties.registry !== properties.registry) {\n\t\t\t\tif (this._projectorProperties.registry) {\n\t\t\t\t\tthis._projectorProperties.registry.destroy();\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis._projectorProperties = assign({}, properties);\n\t\t\tsuper.__setCoreProperties__({ bind: this, baseRegistry: properties.registry });\n\t\t\tsuper.__setProperties__(properties);\n\t\t}\n\n\t\tpublic toHtml(): string {\n\t\t\tif (this.projectorState !== ProjectorAttachState.Attached || !this._projection) {\n\t\t\t\tthrow new Error('Projector is not attached, cannot return an HTML string of projection.');\n\t\t\t}\n\t\t\treturn (this._projection.domNode.childNodes[0] as Element).outerHTML;\n\t\t}\n\n\t\t@afterRender()\n\t\tpublic afterRender(result: DNode) {\n\t\t\tlet node = result;\n\t\t\tif (typeof result === 'string' || result === null || result === undefined) {\n\t\t\t\tnode = v('span', {}, [result]);\n\t\t\t}\n\n\t\t\treturn node;\n\t\t}\n\n\t\tpublic destroy() {\n\t\t\tsuper.destroy();\n\t\t}\n\n\t\tprivate _attach({ type, root }: AttachOptions): Handle {\n\t\t\tif (root) {\n\t\t\t\tthis.root = root;\n\t\t\t}\n\n\t\t\tif (this._attachHandle) {\n\t\t\t\treturn this._attachHandle;\n\t\t\t}\n\n\t\t\tthis.projectorState = ProjectorAttachState.Attached;\n\n\t\t\tconst handle = {\n\t\t\t\tdestroy: () => {\n\t\t\t\t\tif (this.projectorState === ProjectorAttachState.Attached) {\n\t\t\t\t\t\tthis._projection = undefined;\n\t\t\t\t\t\tthis.projectorState = ProjectorAttachState.Detached;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t};\n\n\t\t\tthis.own(handle);\n\t\t\tthis._attachHandle = handle;\n\n\t\t\tthis._projectionOptions = { ...this._projectionOptions, ...{ sync: !this._async } };\n\n\t\t\tswitch (type) {\n\t\t\t\tcase AttachType.Append:\n\t\t\t\t\tthis._projection = dom.append(this.root, this, this._projectionOptions);\n\t\t\t\t\tbreak;\n\t\t\t\tcase AttachType.Merge:\n\t\t\t\t\tthis._projection = dom.merge(this.root, this, this._projectionOptions);\n\t\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\treturn this._attachHandle;\n\t\t}\n\t}\n\n\treturn Projector;\n}\n\nexport default ProjectorMixin;\n"]} \ No newline at end of file diff --git a/deps/framework/widget-core/mixins/Themed.d.ts b/deps/framework/widget-core/mixins/Themed.d.ts deleted file mode 100644 index 987849d6d2..0000000000 --- a/deps/framework/widget-core/mixins/Themed.d.ts +++ /dev/null @@ -1,55 +0,0 @@ -import { Constructor, WidgetProperties, SupportedClassName } from './../interfaces'; -import { Registry } from './../Registry'; -import { Injector } from './../Injector'; -import { WidgetBase } from './../WidgetBase'; -/** - * A lookup object for available class names - */ -export declare type ClassNames = { - [key: string]: string; -}; -/** - * A lookup object for available widget classes names - */ -export interface Theme { - [key: string]: object; -} -/** - * Properties required for the Themed mixin - */ -export interface ThemedProperties extends WidgetProperties { - injectedTheme?: any; - theme?: Theme; - extraClasses?: { - [P in keyof T]?: string; - }; -} -export declare const INJECTED_THEME_KEY: symbol; -/** - * Interface for the ThemedMixin - */ -export interface ThemedMixin { - theme(classes: SupportedClassName): SupportedClassName; - theme(classes: SupportedClassName[]): SupportedClassName[]; - properties: ThemedProperties; -} -/** - * Decorator for base css classes - */ -export declare function theme(theme: {}): (target: any, propertyKey?: string | undefined, descriptor?: PropertyDescriptor | undefined) => void; -/** - * Convenience function that is given a theme and an optional registry, the theme - * injector is defined against the registry, returning the theme. - * - * @param theme the theme to set - * @param themeRegistry registry to define the theme injector against. Defaults - * to the global registry - * - * @returns the theme injector used to set the theme - */ -export declare function registerThemeInjector(theme: any, themeRegistry: Registry): Injector; -/** - * Function that returns a class decorated with with Themed functionality - */ -export declare function ThemedMixin>>>(Base: T): Constructor> & T; -export default ThemedMixin; diff --git a/deps/framework/widget-core/mixins/Themed.js b/deps/framework/widget-core/mixins/Themed.js deleted file mode 100644 index fd6a89904b..0000000000 --- a/deps/framework/widget-core/mixins/Themed.js +++ /dev/null @@ -1,161 +0,0 @@ -(function (factory) { - if (typeof module === "object" && typeof module.exports === "object") { - var v = factory(require, exports); - if (v !== undefined) module.exports = v; - } - else if (typeof define === "function" && define.amd) { - define(["require", "exports", "tslib", "./../Injector", "./../decorators/inject", "./../decorators/handleDecorator", "./../decorators/diffProperty", "./../diff"], factory); - } -})(function (require, exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - var tslib_1 = require("tslib"); - var Injector_1 = require("./../Injector"); - var inject_1 = require("./../decorators/inject"); - var handleDecorator_1 = require("./../decorators/handleDecorator"); - var diffProperty_1 = require("./../decorators/diffProperty"); - var diff_1 = require("./../diff"); - var THEME_KEY = ' _key'; - exports.INJECTED_THEME_KEY = Symbol('theme'); - /** - * Decorator for base css classes - */ - function theme(theme) { - return handleDecorator_1.handleDecorator(function (target) { - target.addDecorator('baseThemeClasses', theme); - }); - } - exports.theme = theme; - /** - * Creates a reverse lookup for the classes passed in via the `theme` function. - * - * @param classes The baseClasses object - * @requires - */ - function createThemeClassesLookup(classes) { - return classes.reduce(function (currentClassNames, baseClass) { - Object.keys(baseClass).forEach(function (key) { - currentClassNames[baseClass[key]] = key; - }); - return currentClassNames; - }, {}); - } - /** - * Convenience function that is given a theme and an optional registry, the theme - * injector is defined against the registry, returning the theme. - * - * @param theme the theme to set - * @param themeRegistry registry to define the theme injector against. Defaults - * to the global registry - * - * @returns the theme injector used to set the theme - */ - function registerThemeInjector(theme, themeRegistry) { - var themeInjector = new Injector_1.Injector(theme); - themeRegistry.defineInjector(exports.INJECTED_THEME_KEY, function (invalidator) { - themeInjector.setInvalidator(invalidator); - return function () { return themeInjector.get(); }; - }); - return themeInjector; - } - exports.registerThemeInjector = registerThemeInjector; - /** - * Function that returns a class decorated with with Themed functionality - */ - function ThemedMixin(Base) { - var Themed = /** @class */ (function (_super) { - tslib_1.__extends(Themed, _super); - function Themed() { - var _this = _super !== null && _super.apply(this, arguments) || this; - /** - * Registered base theme keys - */ - _this._registeredBaseThemeKeys = []; - /** - * Indicates if classes meta data need to be calculated. - */ - _this._recalculateClasses = true; - /** - * Loaded theme - */ - _this._theme = {}; - return _this; - } - Themed.prototype.theme = function (classes) { - var _this = this; - if (this._recalculateClasses) { - this._recalculateThemeClasses(); - } - if (Array.isArray(classes)) { - return classes.map(function (className) { return _this._getThemeClass(className); }); - } - return this._getThemeClass(classes); - }; - /** - * Function fired when `theme` or `extraClasses` are changed. - */ - Themed.prototype.onPropertiesChanged = function () { - this._recalculateClasses = true; - }; - Themed.prototype._getThemeClass = function (className) { - if (className === undefined || className === null) { - return className; - } - var extraClasses = this.properties.extraClasses || {}; - var themeClassName = this._baseThemeClassesReverseLookup[className]; - var resultClassNames = []; - if (!themeClassName) { - console.warn("Class name: '" + className + "' not found in theme"); - return null; - } - if (extraClasses[themeClassName]) { - resultClassNames.push(extraClasses[themeClassName]); - } - if (this._theme[themeClassName]) { - resultClassNames.push(this._theme[themeClassName]); - } - else { - resultClassNames.push(this._registeredBaseTheme[themeClassName]); - } - return resultClassNames.join(' '); - }; - Themed.prototype._recalculateThemeClasses = function () { - var _this = this; - var _a = this.properties.theme, theme = _a === void 0 ? {} : _a; - var baseThemes = this.getDecorator('baseThemeClasses'); - if (!this._registeredBaseTheme) { - this._registeredBaseTheme = baseThemes.reduce(function (finalBaseTheme, baseTheme) { - var _a = THEME_KEY, key = baseTheme[_a], classes = tslib_1.__rest(baseTheme, [typeof _a === "symbol" ? _a : _a + ""]); - _this._registeredBaseThemeKeys.push(key); - return tslib_1.__assign({}, finalBaseTheme, classes); - }, {}); - this._baseThemeClassesReverseLookup = createThemeClassesLookup(baseThemes); - } - this._theme = this._registeredBaseThemeKeys.reduce(function (baseTheme, themeKey) { - return tslib_1.__assign({}, baseTheme, theme[themeKey]); - }, {}); - this._recalculateClasses = false; - }; - tslib_1.__decorate([ - diffProperty_1.diffProperty('theme', diff_1.shallow), - diffProperty_1.diffProperty('extraClasses', diff_1.shallow) - ], Themed.prototype, "onPropertiesChanged", null); - Themed = tslib_1.__decorate([ - inject_1.inject({ - name: exports.INJECTED_THEME_KEY, - getProperties: function (theme, properties) { - if (!properties.theme) { - return { theme: theme }; - } - return {}; - } - }) - ], Themed); - return Themed; - }(Base)); - return Themed; - } - exports.ThemedMixin = ThemedMixin; - exports.default = ThemedMixin; -}); -//# sourceMappingURL=Themed.js.map \ No newline at end of file diff --git a/deps/framework/widget-core/mixins/Themed.js.map b/deps/framework/widget-core/mixins/Themed.js.map deleted file mode 100644 index 7fce0652fd..0000000000 --- a/deps/framework/widget-core/mixins/Themed.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"Themed.js","sourceRoot":"","sources":["Themed.ts"],"names":[],"mappings":";;;;;;;;;;;;IAEA,0CAAyC;IACzC,iDAAgD;IAEhD,mEAAkE;IAClE,6DAA4D;IAC5D,kCAAoC;IAyBpC,IAAM,SAAS,GAAG,OAAO,CAAC;IAEb,QAAA,kBAAkB,GAAG,MAAM,CAAC,OAAO,CAAC,CAAC;IAWlD;;OAEG;IACH,eAAsB,KAAS;QAC9B,MAAM,CAAC,iCAAe,CAAC,UAAC,MAAM;YAC7B,MAAM,CAAC,YAAY,CAAC,kBAAkB,EAAE,KAAK,CAAC,CAAC;QAChD,CAAC,CAAC,CAAC;IACJ,CAAC;IAJD,sBAIC;IAED;;;;;OAKG;IACH,kCAAkC,OAAqB;QACtD,MAAM,CAAC,OAAO,CAAC,MAAM,CACpB,UAAC,iBAAiB,EAAE,SAAS;YAC5B,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,OAAO,CAAC,UAAC,GA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ACf,CAAC;IA3GD,kCA2GC;IAED,kBAAe,WAAW,CAAC","sourcesContent":["import { Constructor, WidgetProperties, SupportedClassName } from './../interfaces';\nimport { Registry } from './../Registry';\nimport { Injector } from './../Injector';\nimport { inject } from './../decorators/inject';\nimport { WidgetBase } from './../WidgetBase';\nimport { handleDecorator } from './../decorators/handleDecorator';\nimport { diffProperty } from './../decorators/diffProperty';\nimport { shallow } from './../diff';\n\n/**\n * A lookup object for available class names\n */\nexport type ClassNames = {\n\t[key: string]: string;\n};\n\n/**\n * A lookup object for available widget classes names\n */\nexport interface Theme {\n\t[key: string]: object;\n}\n\n/**\n * Properties required for the Themed mixin\n */\nexport interface ThemedProperties extends WidgetProperties {\n\tinjectedTheme?: any;\n\ttheme?: Theme;\n\textraClasses?: { [P in keyof T]?: string };\n}\n\nconst THEME_KEY = ' _key';\n\nexport const INJECTED_THEME_KEY = Symbol('theme');\n\n/**\n * Interface for the ThemedMixin\n */\nexport interface ThemedMixin {\n\ttheme(classes: SupportedClassName): SupportedClassName;\n\ttheme(classes: SupportedClassName[]): SupportedClassName[];\n\tproperties: ThemedProperties;\n}\n\n/**\n * Decorator for base css classes\n */\nexport function theme(theme: {}) {\n\treturn handleDecorator((target) => {\n\t\ttarget.addDecorator('baseThemeClasses', theme);\n\t});\n}\n\n/**\n * Creates a reverse lookup for the classes passed in via the `theme` function.\n *\n * @param classes The baseClasses object\n * @requires\n */\nfunction createThemeClassesLookup(classes: ClassNames[]): ClassNames {\n\treturn classes.reduce(\n\t\t(currentClassNames, baseClass) => {\n\t\t\tObject.keys(baseClass).forEach((key: string) => {\n\t\t\t\tcurrentClassNames[baseClass[key]] = key;\n\t\t\t});\n\t\t\treturn currentClassNames;\n\t\t},\n\t\t{}\n\t);\n}\n\n/**\n * Convenience function that is given a theme and an optional registry, the theme\n * injector is defined against the registry, returning the theme.\n *\n * @param theme the theme to set\n * @param themeRegistry registry to define the theme injector against. Defaults\n * to the global registry\n *\n * @returns the theme injector used to set the theme\n */\nexport function registerThemeInjector(theme: any, themeRegistry: Registry): Injector {\n\tconst themeInjector = new Injector(theme);\n\tthemeRegistry.defineInjector(INJECTED_THEME_KEY, (invalidator) => {\n\t\tthemeInjector.setInvalidator(invalidator);\n\t\treturn () => themeInjector.get();\n\t});\n\treturn themeInjector;\n}\n\n/**\n * Function that returns a class decorated with with Themed functionality\n */\n\nexport function ThemedMixin>>>(\n\tBase: T\n): Constructor> & T {\n\t@inject({\n\t\tname: INJECTED_THEME_KEY,\n\t\tgetProperties: (theme: Theme, properties: ThemedProperties): ThemedProperties => {\n\t\t\tif (!properties.theme) {\n\t\t\t\treturn { theme };\n\t\t\t}\n\t\t\treturn {};\n\t\t}\n\t})\n\tabstract class Themed extends Base {\n\t\tpublic abstract properties: ThemedProperties;\n\n\t\t/**\n\t\t * The Themed baseClasses\n\t\t */\n\t\tprivate _registeredBaseTheme: ClassNames | undefined;\n\n\t\t/**\n\t\t * Registered base theme keys\n\t\t */\n\t\tprivate _registeredBaseThemeKeys: string[] = [];\n\n\t\t/**\n\t\t * Reverse lookup of the theme classes\n\t\t */\n\t\tprivate _baseThemeClassesReverseLookup: ClassNames | undefined;\n\n\t\t/**\n\t\t * Indicates if classes meta data need to be calculated.\n\t\t */\n\t\tprivate _recalculateClasses = true;\n\n\t\t/**\n\t\t * Loaded theme\n\t\t */\n\t\tprivate _theme: ClassNames = {};\n\n\t\tpublic theme(classes: SupportedClassName): SupportedClassName;\n\t\tpublic theme(classes: SupportedClassName[]): SupportedClassName[];\n\t\tpublic theme(classes: SupportedClassName | SupportedClassName[]): SupportedClassName | SupportedClassName[] {\n\t\t\tif (this._recalculateClasses) {\n\t\t\t\tthis._recalculateThemeClasses();\n\t\t\t}\n\t\t\tif (Array.isArray(classes)) {\n\t\t\t\treturn classes.map((className) => this._getThemeClass(className));\n\t\t\t}\n\t\t\treturn this._getThemeClass(classes);\n\t\t}\n\n\t\t/**\n\t\t * Function fired when `theme` or `extraClasses` are changed.\n\t\t */\n\t\t@diffProperty('theme', shallow)\n\t\t@diffProperty('extraClasses', shallow)\n\t\tprotected onPropertiesChanged() {\n\t\t\tthis._recalculateClasses = true;\n\t\t}\n\n\t\tprivate _getThemeClass(className: SupportedClassName): SupportedClassName {\n\t\t\tif (className === undefined || className === null) {\n\t\t\t\treturn className;\n\t\t\t}\n\n\t\t\tconst extraClasses = this.properties.extraClasses || ({} as any);\n\t\t\tconst themeClassName = this._baseThemeClassesReverseLookup![className];\n\t\t\tlet resultClassNames: string[] = [];\n\t\t\tif (!themeClassName) {\n\t\t\t\tconsole.warn(`Class name: '${className}' not found in theme`);\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tif (extraClasses[themeClassName]) {\n\t\t\t\tresultClassNames.push(extraClasses[themeClassName]);\n\t\t\t}\n\n\t\t\tif (this._theme[themeClassName]) {\n\t\t\t\tresultClassNames.push(this._theme[themeClassName]);\n\t\t\t} else {\n\t\t\t\tresultClassNames.push(this._registeredBaseTheme![themeClassName]);\n\t\t\t}\n\t\t\treturn resultClassNames.join(' ');\n\t\t}\n\n\t\tprivate _recalculateThemeClasses() {\n\t\t\tconst { theme = {} } = this.properties;\n\t\t\tconst baseThemes = this.getDecorator('baseThemeClasses');\n\t\t\tif (!this._registeredBaseTheme) {\n\t\t\t\tthis._registeredBaseTheme = baseThemes.reduce((finalBaseTheme, baseTheme) => {\n\t\t\t\t\tconst { [THEME_KEY]: key, ...classes } = baseTheme;\n\t\t\t\t\tthis._registeredBaseThemeKeys.push(key);\n\t\t\t\t\treturn { ...finalBaseTheme, ...classes };\n\t\t\t\t}, {});\n\t\t\t\tthis._baseThemeClassesReverseLookup = createThemeClassesLookup(baseThemes);\n\t\t\t}\n\n\t\t\tthis._theme = this._registeredBaseThemeKeys.reduce((baseTheme, themeKey) => {\n\t\t\t\treturn { ...baseTheme, ...theme[themeKey] };\n\t\t\t}, {});\n\n\t\t\tthis._recalculateClasses = false;\n\t\t}\n\t}\n\n\treturn Themed;\n}\n\nexport default ThemedMixin;\n"]} \ No newline at end of file diff --git a/deps/framework/widget-core/mixins/Themed.mjs b/deps/framework/widget-core/mixins/Themed.mjs deleted file mode 100644 index 9a3fac5818..0000000000 --- a/deps/framework/widget-core/mixins/Themed.mjs +++ /dev/null @@ -1,141 +0,0 @@ -import * as tslib_1 from "tslib"; -import { Injector } from './../Injector'; -import { inject } from './../decorators/inject'; -import { handleDecorator } from './../decorators/handleDecorator'; -import { diffProperty } from './../decorators/diffProperty'; -import { shallow } from './../diff'; -const THEME_KEY = ' _key'; -export const INJECTED_THEME_KEY = Symbol('theme'); -/** - * Decorator for base css classes - */ -export function theme(theme) { - return handleDecorator((target) => { - target.addDecorator('baseThemeClasses', theme); - }); -} -/** - * Creates a reverse lookup for the classes passed in via the `theme` function. - * - * @param classes The baseClasses object - * @requires - */ -function createThemeClassesLookup(classes) { - return classes.reduce((currentClassNames, baseClass) => { - Object.keys(baseClass).forEach((key) => { - currentClassNames[baseClass[key]] = key; - }); - return currentClassNames; - }, {}); -} -/** - * Convenience function that is given a theme and an optional registry, the theme - * injector is defined against the registry, returning the theme. - * - * @param theme the theme to set - * @param themeRegistry registry to define the theme injector against. Defaults - * to the global registry - * - * @returns the theme injector used to set the theme - */ -export function registerThemeInjector(theme, themeRegistry) { - const themeInjector = new Injector(theme); - themeRegistry.defineInjector(INJECTED_THEME_KEY, (invalidator) => { - themeInjector.setInvalidator(invalidator); - return () => themeInjector.get(); - }); - return themeInjector; -} -/** - * Function that returns a class decorated with with Themed functionality - */ -export function ThemedMixin(Base) { - let Themed = class Themed extends Base { - constructor() { - super(...arguments); - /** - * Registered base theme keys - */ - this._registeredBaseThemeKeys = []; - /** - * Indicates if classes meta data need to be calculated. - */ - this._recalculateClasses = true; - /** - * Loaded theme - */ - this._theme = {}; - } - theme(classes) { - if (this._recalculateClasses) { - this._recalculateThemeClasses(); - } - if (Array.isArray(classes)) { - return classes.map((className) => this._getThemeClass(className)); - } - return this._getThemeClass(classes); - } - /** - * Function fired when `theme` or `extraClasses` are changed. - */ - onPropertiesChanged() { - this._recalculateClasses = true; - } - _getThemeClass(className) { - if (className === undefined || className === null) { - return className; - } - const extraClasses = this.properties.extraClasses || {}; - const themeClassName = this._baseThemeClassesReverseLookup[className]; - let resultClassNames = []; - if (!themeClassName) { - console.warn(`Class name: '${className}' not found in theme`); - return null; - } - if (extraClasses[themeClassName]) { - resultClassNames.push(extraClasses[themeClassName]); - } - if (this._theme[themeClassName]) { - resultClassNames.push(this._theme[themeClassName]); - } - else { - resultClassNames.push(this._registeredBaseTheme[themeClassName]); - } - return resultClassNames.join(' '); - } - _recalculateThemeClasses() { - const { theme = {} } = this.properties; - const baseThemes = this.getDecorator('baseThemeClasses'); - if (!this._registeredBaseTheme) { - this._registeredBaseTheme = baseThemes.reduce((finalBaseTheme, baseTheme) => { - const _a = THEME_KEY, key = baseTheme[_a], classes = tslib_1.__rest(baseTheme, [typeof _a === "symbol" ? _a : _a + ""]); - this._registeredBaseThemeKeys.push(key); - return Object.assign({}, finalBaseTheme, classes); - }, {}); - this._baseThemeClassesReverseLookup = createThemeClassesLookup(baseThemes); - } - this._theme = this._registeredBaseThemeKeys.reduce((baseTheme, themeKey) => { - return Object.assign({}, baseTheme, theme[themeKey]); - }, {}); - this._recalculateClasses = false; - } - }; - tslib_1.__decorate([ - diffProperty('theme', shallow), - diffProperty('extraClasses', shallow) - ], Themed.prototype, "onPropertiesChanged", null); - Themed = tslib_1.__decorate([ - inject({ - name: INJECTED_THEME_KEY, - getProperties: (theme, properties) => { - if (!properties.theme) { - return { theme }; - } - return {}; - } - }) - ], Themed); - return Themed; -} -export default ThemedMixin; -//# sourceMappingURL=Themed.mjs.map \ No newline at end of file diff --git a/deps/framework/widget-core/mixins/Themed.mjs.map b/deps/framework/widget-core/mixins/Themed.mjs.map deleted file mode 100644 index 48b77e1eed..0000000000 --- a/deps/framework/widget-core/mixins/Themed.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"Themed.mjs","sourceRoot":"","sources":["Themed.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I,CAAC,wBAAwB,CAAC,MAAM,CAAC,CAAC,SAAS,EAAE,QAAQ,EAAE,EAAE;gBAC1E,MAAM,mBAAM,SAAS,EAAK,KAAK,CAAC,QAAQ,CAAC,EAAG;YAC7C,CAAC,EAAE,EAAE,CAAC,CAAC;YAEP,IAAI,CAAC,mBAAmB,GAAG,KAAK,CAAC;QAClC,CAAC;KACD,CAAA;IA/CA;QAFC,YAAY,CAAC,OAAO,EAAE,OAAO,CAAC;QAC9B,YAAY,CAAC,cAAc,EAAE,OAAO,CAAC;qDAGrC;IA/Ca,MAAM;QATpB,MAAM,CAAC;YACP,IAAI,EAAE,kBAAkB;YACxB,aAAa,EAAE,CAAC,KAAY,EAAE,UAA4B,EAAoB,EAAE;gBAC/E,EAAE,CAAC,CAAC,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC;oBACvB,MAAM,CAAC,EAAE,KAAK,EAAE,CAAC;gBAClB,CAAC;gBACD,MAAM,CAAC,EAAE,CAAC;YACX,CAAC;SACD,CAAC;OACa,MAAM,CA4FpB;IAED,MAAM,CAAC,MAAM,CAAC;AACf,CAAC;AAED,eAAe,WAAW,CAAC","sourcesContent":["import { Constructor, WidgetProperties, SupportedClassName } from './../interfaces';\nimport { Registry } from './../Registry';\nimport { Injector } from './../Injector';\nimport { inject } from './../decorators/inject';\nimport { WidgetBase } from './../WidgetBase';\nimport { handleDecorator } from './../decorators/handleDecorator';\nimport { diffProperty } from './../decorators/diffProperty';\nimport { shallow } from './../diff';\n\n/**\n * A lookup object for available class names\n */\nexport type ClassNames = {\n\t[key: string]: string;\n};\n\n/**\n * A lookup object for available widget classes names\n */\nexport interface Theme {\n\t[key: string]: object;\n}\n\n/**\n * Properties required for the Themed mixin\n */\nexport interface ThemedProperties extends WidgetProperties {\n\tinjectedTheme?: any;\n\ttheme?: Theme;\n\textraClasses?: { [P in keyof T]?: string };\n}\n\nconst THEME_KEY = ' _key';\n\nexport const INJECTED_THEME_KEY = Symbol('theme');\n\n/**\n * Interface for the ThemedMixin\n */\nexport interface ThemedMixin {\n\ttheme(classes: SupportedClassName): SupportedClassName;\n\ttheme(classes: SupportedClassName[]): SupportedClassName[];\n\tproperties: ThemedProperties;\n}\n\n/**\n * Decorator for base css classes\n */\nexport function theme(theme: {}) {\n\treturn handleDecorator((target) => {\n\t\ttarget.addDecorator('baseThemeClasses', theme);\n\t});\n}\n\n/**\n * Creates a reverse lookup for the classes passed in via the `theme` function.\n *\n * @param classes The baseClasses object\n * @requires\n */\nfunction createThemeClassesLookup(classes: ClassNames[]): ClassNames {\n\treturn classes.reduce(\n\t\t(currentClassNames, baseClass) => {\n\t\t\tObject.keys(baseClass).forEach((key: string) => {\n\t\t\t\tcurrentClassNames[baseClass[key]] = key;\n\t\t\t});\n\t\t\treturn currentClassNames;\n\t\t},\n\t\t{}\n\t);\n}\n\n/**\n * Convenience function that is given a theme and an optional registry, the theme\n * injector is defined against the registry, returning the theme.\n *\n * @param theme the theme to set\n * @param themeRegistry registry to define the theme injector against. Defaults\n * to the global registry\n *\n * @returns the theme injector used to set the theme\n */\nexport function registerThemeInjector(theme: any, themeRegistry: Registry): Injector {\n\tconst themeInjector = new Injector(theme);\n\tthemeRegistry.defineInjector(INJECTED_THEME_KEY, (invalidator) => {\n\t\tthemeInjector.setInvalidator(invalidator);\n\t\treturn () => themeInjector.get();\n\t});\n\treturn themeInjector;\n}\n\n/**\n * Function that returns a class decorated with with Themed functionality\n */\n\nexport function ThemedMixin>>>(\n\tBase: T\n): Constructor> & T {\n\t@inject({\n\t\tname: INJECTED_THEME_KEY,\n\t\tgetProperties: (theme: Theme, properties: ThemedProperties): ThemedProperties => {\n\t\t\tif (!properties.theme) {\n\t\t\t\treturn { theme };\n\t\t\t}\n\t\t\treturn {};\n\t\t}\n\t})\n\tabstract class Themed extends Base {\n\t\tpublic abstract properties: ThemedProperties;\n\n\t\t/**\n\t\t * The Themed baseClasses\n\t\t */\n\t\tprivate _registeredBaseTheme: ClassNames | undefined;\n\n\t\t/**\n\t\t * Registered base theme keys\n\t\t */\n\t\tprivate _registeredBaseThemeKeys: string[] = [];\n\n\t\t/**\n\t\t * Reverse lookup of the theme classes\n\t\t */\n\t\tprivate _baseThemeClassesReverseLookup: ClassNames | undefined;\n\n\t\t/**\n\t\t * Indicates if classes meta data need to be calculated.\n\t\t */\n\t\tprivate _recalculateClasses = true;\n\n\t\t/**\n\t\t * Loaded theme\n\t\t */\n\t\tprivate _theme: ClassNames = {};\n\n\t\tpublic theme(classes: SupportedClassName): SupportedClassName;\n\t\tpublic theme(classes: SupportedClassName[]): SupportedClassName[];\n\t\tpublic theme(classes: SupportedClassName | SupportedClassName[]): SupportedClassName | SupportedClassName[] {\n\t\t\tif (this._recalculateClasses) {\n\t\t\t\tthis._recalculateThemeClasses();\n\t\t\t}\n\t\t\tif (Array.isArray(classes)) {\n\t\t\t\treturn classes.map((className) => this._getThemeClass(className));\n\t\t\t}\n\t\t\treturn this._getThemeClass(classes);\n\t\t}\n\n\t\t/**\n\t\t * Function fired when `theme` or `extraClasses` are changed.\n\t\t */\n\t\t@diffProperty('theme', shallow)\n\t\t@diffProperty('extraClasses', shallow)\n\t\tprotected onPropertiesChanged() {\n\t\t\tthis._recalculateClasses = true;\n\t\t}\n\n\t\tprivate _getThemeClass(className: SupportedClassName): SupportedClassName {\n\t\t\tif (className === undefined || className === null) {\n\t\t\t\treturn className;\n\t\t\t}\n\n\t\t\tconst extraClasses = this.properties.extraClasses || ({} as any);\n\t\t\tconst themeClassName = this._baseThemeClassesReverseLookup![className];\n\t\t\tlet resultClassNames: string[] = [];\n\t\t\tif (!themeClassName) {\n\t\t\t\tconsole.warn(`Class name: '${className}' not found in theme`);\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tif (extraClasses[themeClassName]) {\n\t\t\t\tresultClassNames.push(extraClasses[themeClassName]);\n\t\t\t}\n\n\t\t\tif (this._theme[themeClassName]) {\n\t\t\t\tresultClassNames.push(this._theme[themeClassName]);\n\t\t\t} else {\n\t\t\t\tresultClassNames.push(this._registeredBaseTheme![themeClassName]);\n\t\t\t}\n\t\t\treturn resultClassNames.join(' ');\n\t\t}\n\n\t\tprivate _recalculateThemeClasses() {\n\t\t\tconst { theme = {} } = this.properties;\n\t\t\tconst baseThemes = this.getDecorator('baseThemeClasses');\n\t\t\tif (!this._registeredBaseTheme) {\n\t\t\t\tthis._registeredBaseTheme = baseThemes.reduce((finalBaseTheme, baseTheme) => {\n\t\t\t\t\tconst { [THEME_KEY]: key, ...classes } = baseTheme;\n\t\t\t\t\tthis._registeredBaseThemeKeys.push(key);\n\t\t\t\t\treturn { ...finalBaseTheme, ...classes };\n\t\t\t\t}, {});\n\t\t\t\tthis._baseThemeClassesReverseLookup = createThemeClassesLookup(baseThemes);\n\t\t\t}\n\n\t\t\tthis._theme = this._registeredBaseThemeKeys.reduce((baseTheme, themeKey) => {\n\t\t\t\treturn { ...baseTheme, ...theme[themeKey] };\n\t\t\t}, {});\n\n\t\t\tthis._recalculateClasses = false;\n\t\t}\n\t}\n\n\treturn Themed;\n}\n\nexport default ThemedMixin;\n"]} \ No newline at end of file diff --git a/deps/framework/widget-core/registerCustomElement.d.ts b/deps/framework/widget-core/registerCustomElement.d.ts deleted file mode 100644 index 2a159714eb..0000000000 --- a/deps/framework/widget-core/registerCustomElement.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -export declare enum CustomElementChildType { - DOJO = "DOJO", - NODE = "NODE", - TEXT = "TEXT", -} -export declare function DomToWidgetWrapper(domNode: HTMLElement): any; -export declare function create(descriptor: any, WidgetConstructor: any): any; -export declare function register(WidgetConstructor: any): void; -export default register; diff --git a/deps/framework/widget-core/registerCustomElement.js b/deps/framework/widget-core/registerCustomElement.js deleted file mode 100644 index ef4c7444ca..0000000000 --- a/deps/framework/widget-core/registerCustomElement.js +++ /dev/null @@ -1,261 +0,0 @@ -(function (factory) { - if (typeof module === "object" && typeof module.exports === "object") { - var v = factory(require, exports); - if (v !== undefined) module.exports = v; - } - else if (typeof define === "function" && define.amd) { - define(["require", "exports", "tslib", "./WidgetBase", "./mixins/Projector", "../shim/array", "./d", "../shim/global", "./mixins/Themed", "./decorators/alwaysRender"], factory); - } -})(function (require, exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - var tslib_1 = require("tslib"); - var WidgetBase_1 = require("./WidgetBase"); - var Projector_1 = require("./mixins/Projector"); - var array_1 = require("../shim/array"); - var d_1 = require("./d"); - var global_1 = require("../shim/global"); - var Themed_1 = require("./mixins/Themed"); - var alwaysRender_1 = require("./decorators/alwaysRender"); - var CustomElementChildType; - (function (CustomElementChildType) { - CustomElementChildType["DOJO"] = "DOJO"; - CustomElementChildType["NODE"] = "NODE"; - CustomElementChildType["TEXT"] = "TEXT"; - })(CustomElementChildType = exports.CustomElementChildType || (exports.CustomElementChildType = {})); - function DomToWidgetWrapper(domNode) { - var DomToWidgetWrapper = /** @class */ (function (_super) { - tslib_1.__extends(DomToWidgetWrapper, _super); - function DomToWidgetWrapper() { - return _super !== null && _super.apply(this, arguments) || this; - } - DomToWidgetWrapper.prototype.render = function () { - var _this = this; - var properties = Object.keys(this.properties).reduce(function (props, key) { - var value = _this.properties[key]; - if (key.indexOf('on') === 0) { - key = "__" + key; - } - props[key] = value; - return props; - }, {}); - return d_1.dom({ node: domNode, props: properties, diffType: 'dom' }); - }; - Object.defineProperty(DomToWidgetWrapper, "domNode", { - get: function () { - return domNode; - }, - enumerable: true, - configurable: true - }); - DomToWidgetWrapper = tslib_1.__decorate([ - alwaysRender_1.alwaysRender() - ], DomToWidgetWrapper); - return DomToWidgetWrapper; - }(WidgetBase_1.WidgetBase)); - return DomToWidgetWrapper; - } - exports.DomToWidgetWrapper = DomToWidgetWrapper; - function create(descriptor, WidgetConstructor) { - var attributes = descriptor.attributes, childType = descriptor.childType, registryFactory = descriptor.registryFactory; - var attributeMap = {}; - attributes.forEach(function (propertyName) { - var attributeName = propertyName.toLowerCase(); - attributeMap[attributeName] = propertyName; - }); - return /** @class */ (function (_super) { - tslib_1.__extends(class_1, _super); - function class_1() { - var _this = _super !== null && _super.apply(this, arguments) || this; - _this._properties = {}; - _this._children = []; - _this._eventProperties = {}; - _this._initialised = false; - return _this; - } - class_1.prototype.connectedCallback = function () { - var _this = this; - if (this._initialised) { - return; - } - var domProperties = {}; - var attributes = descriptor.attributes, properties = descriptor.properties, events = descriptor.events; - this._properties = tslib_1.__assign({}, this._properties, this._attributesToProperties(attributes)); - tslib_1.__spread(attributes, properties).forEach(function (propertyName) { - var value = _this[propertyName]; - var filteredPropertyName = propertyName.replace(/^on/, '__'); - if (value !== undefined) { - _this._properties[propertyName] = value; - } - if (filteredPropertyName !== propertyName) { - domProperties[filteredPropertyName] = { - get: function () { return _this._getProperty(propertyName); }, - set: function (value) { return _this._setProperty(propertyName, value); } - }; - } - domProperties[propertyName] = { - get: function () { return _this._getProperty(propertyName); }, - set: function (value) { return _this._setProperty(propertyName, value); } - }; - }); - events.forEach(function (propertyName) { - var eventName = propertyName.replace(/^on/, '').toLowerCase(); - var filteredPropertyName = propertyName.replace(/^on/, '__on'); - domProperties[filteredPropertyName] = { - get: function () { return _this._getEventProperty(propertyName); }, - set: function (value) { return _this._setEventProperty(propertyName, value); } - }; - _this._eventProperties[propertyName] = undefined; - _this._properties[propertyName] = function () { - var args = []; - for (var _i = 0; _i < arguments.length; _i++) { - args[_i] = arguments[_i]; - } - var eventCallback = _this._getEventProperty(propertyName); - if (typeof eventCallback === 'function') { - eventCallback.apply(void 0, tslib_1.__spread(args)); - } - _this.dispatchEvent(new CustomEvent(eventName, { - bubbles: false, - detail: args - })); - }; - }); - Object.defineProperties(this, domProperties); - var children = childType === CustomElementChildType.TEXT ? this.childNodes : this.children; - array_1.from(children).forEach(function (childNode) { - if (childType === CustomElementChildType.DOJO) { - childNode.addEventListener('dojo-ce-render', function () { return _this._render(); }); - childNode.addEventListener('dojo-ce-connected', function () { return _this._render(); }); - _this._children.push(DomToWidgetWrapper(childNode)); - } - else { - _this._children.push(d_1.dom({ node: childNode, diffType: 'dom' })); - } - }); - this.addEventListener('dojo-ce-connected', function (e) { return _this._childConnected(e); }); - var widgetProperties = this._properties; - var renderChildren = function () { return _this.__children__(); }; - var Wrapper = /** @class */ (function (_super) { - tslib_1.__extends(class_2, _super); - function class_2() { - return _super !== null && _super.apply(this, arguments) || this; - } - class_2.prototype.render = function () { - return d_1.w(WidgetConstructor, widgetProperties, renderChildren()); - }; - return class_2; - }(WidgetBase_1.WidgetBase)); - var registry = registryFactory(); - var themeContext = Themed_1.registerThemeInjector(this._getTheme(), registry); - global_1.default.addEventListener('dojo-theme-set', function () { return themeContext.set(_this._getTheme()); }); - var Projector = Projector_1.ProjectorMixin(Wrapper); - this._projector = new Projector(); - this._projector.setProperties({ registry: registry }); - this._projector.append(this); - this._initialised = true; - this.dispatchEvent(new CustomEvent('dojo-ce-connected', { - bubbles: true, - detail: this - })); - }; - class_1.prototype._getTheme = function () { - if (global_1.default && global_1.default.dojoce && global_1.default.dojoce.theme) { - return global_1.default.dojoce.themes[global_1.default.dojoce.theme]; - } - }; - class_1.prototype._childConnected = function (e) { - var _this = this; - var node = e.detail; - if (node.parentNode === this) { - var exists = this._children.some(function (child) { return child.domNode === node; }); - if (!exists) { - node.addEventListener('dojo-ce-render', function () { return _this._render(); }); - this._children.push(DomToWidgetWrapper(node)); - this._render(); - } - } - }; - class_1.prototype._render = function () { - if (this._projector) { - this._projector.invalidate(); - this.dispatchEvent(new CustomEvent('dojo-ce-render', { - bubbles: false, - detail: this - })); - } - }; - class_1.prototype.__properties__ = function () { - return tslib_1.__assign({}, this._properties, this._eventProperties); - }; - class_1.prototype.__children__ = function () { - if (childType === CustomElementChildType.DOJO) { - return this._children.filter(function (Child) { return Child.domNode.isWidget; }).map(function (Child) { - var domNode = Child.domNode; - return d_1.w(Child, tslib_1.__assign({}, domNode.__properties__()), tslib_1.__spread(domNode.__children__())); - }); - } - else { - return this._children; - } - }; - class_1.prototype.attributeChangedCallback = function (name, oldValue, value) { - var propertyName = attributeMap[name]; - this._setProperty(propertyName, value); - }; - class_1.prototype._setEventProperty = function (propertyName, value) { - this._eventProperties[propertyName] = value; - }; - class_1.prototype._getEventProperty = function (propertyName) { - return this._eventProperties[propertyName]; - }; - class_1.prototype._setProperty = function (propertyName, value) { - if (typeof value === 'function') { - value[WidgetBase_1.noBind] = true; - } - this._properties[propertyName] = value; - this._render(); - }; - class_1.prototype._getProperty = function (propertyName) { - return this._properties[propertyName]; - }; - class_1.prototype._attributesToProperties = function (attributes) { - var _this = this; - return attributes.reduce(function (properties, propertyName) { - var attributeName = propertyName.toLowerCase(); - var value = _this.getAttribute(attributeName); - if (value !== null) { - properties[propertyName] = value; - } - return properties; - }, {}); - }; - Object.defineProperty(class_1, "observedAttributes", { - get: function () { - return Object.keys(attributeMap); - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(class_1.prototype, "isWidget", { - get: function () { - return true; - }, - enumerable: true, - configurable: true - }); - return class_1; - }(HTMLElement)); - } - exports.create = create; - function register(WidgetConstructor) { - var descriptor = WidgetConstructor.prototype && WidgetConstructor.prototype.__customElementDescriptor; - if (!descriptor) { - throw new Error('Cannot get descriptor for Custom Element, have you added the @customElement decorator to your Widget?'); - } - global_1.default.customElements.define(descriptor.tagName, create(descriptor, WidgetConstructor)); - } - exports.register = register; - exports.default = register; -}); -//# sourceMappingURL=registerCustomElement.js.map \ No newline at end of file diff --git a/deps/framework/widget-core/registerCustomElement.js.map b/deps/framework/widget-core/registerCustomElement.js.map deleted file mode 100644 index 5b5ab915ef..0000000000 --- a/deps/framework/widget-core/registerCustomElement.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"registerCustomElement.js","sourceRoot":"","sources":["registerCustomElement.ts"],"names":[],"mappings":";;;;;;;;;;;;IAAA,2CAAkD;IAClD,gDAAoD;IACpD,uCAAqC;IACrC,yBAA6B;IAC7B,yCAAoC;IACpC,0CAAwD;IACxD,0DAAyD;IAEzD,IAAY,sBAIX;IAJD,WAAY,sBAAsB;QACjC,uCAA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oBAC9D,IAAM,aAAa,GAAG,YAAY,CAAC,WAAW,EAAE,CAAC;oBACjD,IAAM,KAAK,GAAG,KAAI,CAAC,YAAY,CAAC,aAAa,CAAC,CAAC;oBAC/C,EAAE,CAAC,CAAC,KAAK,KAAK,IAAI,CAAC,CAAC,CAAC;wBACpB,UAAU,CAAC,YAAY,CAAC,GAAG,KAAK,CAAC;oBAClC,CAAC;oBACD,MAAM,CAAC,UAAU,CAAC;gBACnB,CAAC,EAAE,EAAE,CAAC,CAAC;YACR,CAAC;YAED,sBAAW,6BAAkB;qBAA7B;oBACC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;gBAClC,CAAC;;;eAAA;YAED,sBAAW,6BAAQ;qBAAnB;oBACC,MAAM,CAAC,IAAI,CAAC;gBACb,CAAC;;;eAAA;YACF,cAAC;QAAD,CAAC,AA7LM,CAAc,WAAW,GA6L9B;IACH,CAAC;IAvMD,wBAuMC;IAED,kBAAyB,iBAAsB;QAC9C,IAAM,UAAU,GAAG,iBAAiB,CAAC,SAAS,IAAI,iBAAiB,CAAC,SAAS,CAAC,yBAAyB,CAAC;QAExG,EAAE,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC;YACjB,MAAM,IAAI,KAAK,CACd,uGAAuG,CACvG,CAAC;QACH,CAAC;QAED,gBAAM,CAAC,cAAc,CAAC,MAAM,CAAC,UAAU,CAAC,OAAO,EAAE,MAAM,CAAC,UAAU,EAAE,iBAAiB,CAAC,CAAC,CAAC;IACzF,CAAC;IAVD,4BAUC;IAED,kBAAe,QAAQ,CAAC","sourcesContent":["import { WidgetBase, noBind } from './WidgetBase';\nimport { ProjectorMixin } from './mixins/Projector';\nimport { from } from '../shim/array';\nimport { w, dom } from './d';\nimport global from '../shim/global';\nimport { registerThemeInjector } from './mixins/Themed';\nimport { alwaysRender } from './decorators/alwaysRender';\n\nexport enum CustomElementChildType {\n\tDOJO = 'DOJO',\n\tNODE = 'NODE',\n\tTEXT = 'TEXT'\n}\n\nexport function DomToWidgetWrapper(domNode: HTMLElement): any {\n\t@alwaysRender()\n\tclass DomToWidgetWrapper extends WidgetBase {\n\t\tprotected render() {\n\t\t\tconst properties = Object.keys(this.properties).reduce(\n\t\t\t\t(props, key: string) => {\n\t\t\t\t\tconst value = this.properties[key];\n\t\t\t\t\tif (key.indexOf('on') === 0) {\n\t\t\t\t\t\tkey = `__${key}`;\n\t\t\t\t\t}\n\t\t\t\t\tprops[key] = value;\n\t\t\t\t\treturn props;\n\t\t\t\t},\n\t\t\t\t{} as any\n\t\t\t);\n\t\t\treturn dom({ node: domNode, props: properties, diffType: 'dom' });\n\t\t}\n\n\t\tstatic get domNode() {\n\t\t\treturn domNode;\n\t\t}\n\t}\n\n\treturn DomToWidgetWrapper;\n}\n\nexport function create(descriptor: any, WidgetConstructor: any): any {\n\tconst { attributes, childType, registryFactory } = descriptor;\n\tconst attributeMap: any = {};\n\n\tattributes.forEach((propertyName: string) => {\n\t\tconst attributeName = propertyName.toLowerCase();\n\t\tattributeMap[attributeName] = propertyName;\n\t});\n\n\treturn class extends HTMLElement {\n\t\tprivate _projector: any;\n\t\tprivate _properties: any = {};\n\t\tprivate _children: any[] = [];\n\t\tprivate _eventProperties: any = {};\n\t\tprivate _initialised = false;\n\n\t\tpublic connectedCallback() {\n\t\t\tif (this._initialised) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst domProperties: any = {};\n\t\t\tconst { attributes, properties, events } = descriptor;\n\n\t\t\tthis._properties = { ...this._properties, ...this._attributesToProperties(attributes) };\n\n\t\t\t[...attributes, ...properties].forEach((propertyName: string) => {\n\t\t\t\tconst value = (this as any)[propertyName];\n\t\t\t\tconst filteredPropertyName = propertyName.replace(/^on/, '__');\n\t\t\t\tif (value !== undefined) {\n\t\t\t\t\tthis._properties[propertyName] = value;\n\t\t\t\t}\n\n\t\t\t\tif (filteredPropertyName !== propertyName) {\n\t\t\t\t\tdomProperties[filteredPropertyName] = {\n\t\t\t\t\t\tget: () => this._getProperty(propertyName),\n\t\t\t\t\t\tset: (value: any) => this._setProperty(propertyName, value)\n\t\t\t\t\t};\n\t\t\t\t}\n\n\t\t\t\tdomProperties[propertyName] = {\n\t\t\t\t\tget: () => this._getProperty(propertyName),\n\t\t\t\t\tset: (value: any) => this._setProperty(propertyName, value)\n\t\t\t\t};\n\t\t\t});\n\n\t\t\tevents.forEach((propertyName: string) => {\n\t\t\t\tconst eventName = propertyName.replace(/^on/, '').toLowerCase();\n\t\t\t\tconst filteredPropertyName = propertyName.replace(/^on/, '__on');\n\n\t\t\t\tdomProperties[filteredPropertyName] = {\n\t\t\t\t\tget: () => this._getEventProperty(propertyName),\n\t\t\t\t\tset: (value: any) => this._setEventProperty(propertyName, value)\n\t\t\t\t};\n\n\t\t\t\tthis._eventProperties[propertyName] = undefined;\n\t\t\t\tthis._properties[propertyName] = (...args: any[]) => {\n\t\t\t\t\tconst eventCallback = this._getEventProperty(propertyName);\n\t\t\t\t\tif (typeof eventCallback === 'function') {\n\t\t\t\t\t\teventCallback(...args);\n\t\t\t\t\t}\n\t\t\t\t\tthis.dispatchEvent(\n\t\t\t\t\t\tnew CustomEvent(eventName, {\n\t\t\t\t\t\t\tbubbles: false,\n\t\t\t\t\t\t\tdetail: args\n\t\t\t\t\t\t})\n\t\t\t\t\t);\n\t\t\t\t};\n\t\t\t});\n\n\t\t\tObject.defineProperties(this, domProperties);\n\n\t\t\tconst children = childType === CustomElementChildType.TEXT ? this.childNodes : this.children;\n\n\t\t\tfrom(children).forEach((childNode: Node) => {\n\t\t\t\tif (childType === CustomElementChildType.DOJO) {\n\t\t\t\t\tchildNode.addEventListener('dojo-ce-render', () => this._render());\n\t\t\t\t\tchildNode.addEventListener('dojo-ce-connected', () => this._render());\n\t\t\t\t\tthis._children.push(DomToWidgetWrapper(childNode as HTMLElement));\n\t\t\t\t} else {\n\t\t\t\t\tthis._children.push(dom({ node: childNode as HTMLElement, diffType: 'dom' }));\n\t\t\t\t}\n\t\t\t});\n\n\t\t\tthis.addEventListener('dojo-ce-connected', (e: any) => this._childConnected(e));\n\n\t\t\tconst widgetProperties = this._properties;\n\t\t\tconst renderChildren = () => this.__children__();\n\t\t\tconst Wrapper = class extends WidgetBase {\n\t\t\t\trender() {\n\t\t\t\t\treturn w(WidgetConstructor, widgetProperties, renderChildren());\n\t\t\t\t}\n\t\t\t};\n\t\t\tconst registry = registryFactory();\n\t\t\tconst themeContext = registerThemeInjector(this._getTheme(), registry);\n\t\t\tglobal.addEventListener('dojo-theme-set', () => themeContext.set(this._getTheme()));\n\t\t\tconst Projector = ProjectorMixin(Wrapper);\n\t\t\tthis._projector = new Projector();\n\t\t\tthis._projector.setProperties({ registry });\n\t\t\tthis._projector.append(this);\n\n\t\t\tthis._initialised = true;\n\t\t\tthis.dispatchEvent(\n\t\t\t\tnew CustomEvent('dojo-ce-connected', {\n\t\t\t\t\tbubbles: true,\n\t\t\t\t\tdetail: this\n\t\t\t\t})\n\t\t\t);\n\t\t}\n\n\t\tprivate _getTheme() {\n\t\t\tif (global && global.dojoce && global.dojoce.theme) {\n\t\t\t\treturn global.dojoce.themes[global.dojoce.theme];\n\t\t\t}\n\t\t}\n\n\t\tprivate _childConnected(e: any) {\n\t\t\tconst node = e.detail;\n\t\t\tif (node.parentNode === this) {\n\t\t\t\tconst exists = this._children.some((child) => child.domNode === node);\n\t\t\t\tif (!exists) {\n\t\t\t\t\tnode.addEventListener('dojo-ce-render', () => this._render());\n\t\t\t\t\tthis._children.push(DomToWidgetWrapper(node));\n\t\t\t\t\tthis._render();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tprivate _render() {\n\t\t\tif (this._projector) {\n\t\t\t\tthis._projector.invalidate();\n\t\t\t\tthis.dispatchEvent(\n\t\t\t\t\tnew CustomEvent('dojo-ce-render', {\n\t\t\t\t\t\tbubbles: false,\n\t\t\t\t\t\tdetail: this\n\t\t\t\t\t})\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\tpublic __properties__() {\n\t\t\treturn { ...this._properties, ...this._eventProperties };\n\t\t}\n\n\t\tpublic __children__() {\n\t\t\tif (childType === CustomElementChildType.DOJO) {\n\t\t\t\treturn this._children.filter((Child) => Child.domNode.isWidget).map((Child: any) => {\n\t\t\t\t\tconst { domNode } = Child;\n\t\t\t\t\treturn w(Child, { ...domNode.__properties__() }, [...domNode.__children__()]);\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\treturn this._children;\n\t\t\t}\n\t\t}\n\n\t\tpublic attributeChangedCallback(name: string, oldValue: string | null, value: string | null) {\n\t\t\tconst propertyName = attributeMap[name];\n\t\t\tthis._setProperty(propertyName, value);\n\t\t}\n\n\t\tprivate _setEventProperty(propertyName: string, value: any) {\n\t\t\tthis._eventProperties[propertyName] = value;\n\t\t}\n\n\t\tprivate _getEventProperty(propertyName: string) {\n\t\t\treturn this._eventProperties[propertyName];\n\t\t}\n\n\t\tprivate _setProperty(propertyName: string, value: any) {\n\t\t\tif (typeof value === 'function') {\n\t\t\t\tvalue[noBind] = true;\n\t\t\t}\n\t\t\tthis._properties[propertyName] = value;\n\t\t\tthis._render();\n\t\t}\n\n\t\tprivate _getProperty(propertyName: string) {\n\t\t\treturn this._properties[propertyName];\n\t\t}\n\n\t\tprivate _attributesToProperties(attributes: string[]) {\n\t\t\treturn attributes.reduce((properties: any, propertyName: string) => {\n\t\t\t\tconst attributeName = propertyName.toLowerCase();\n\t\t\t\tconst value = this.getAttribute(attributeName);\n\t\t\t\tif (value !== null) {\n\t\t\t\t\tproperties[propertyName] = value;\n\t\t\t\t}\n\t\t\t\treturn properties;\n\t\t\t}, {});\n\t\t}\n\n\t\tstatic get observedAttributes() {\n\t\t\treturn Object.keys(attributeMap);\n\t\t}\n\n\t\tpublic get isWidget() {\n\t\t\treturn true;\n\t\t}\n\t};\n}\n\nexport function register(WidgetConstructor: any): void {\n\tconst descriptor = WidgetConstructor.prototype && WidgetConstructor.prototype.__customElementDescriptor;\n\n\tif (!descriptor) {\n\t\tthrow new Error(\n\t\t\t'Cannot get descriptor for Custom Element, have you added the @customElement decorator to your Widget?'\n\t\t);\n\t}\n\n\tglobal.customElements.define(descriptor.tagName, create(descriptor, WidgetConstructor));\n}\n\nexport default register;\n"]} \ No newline at end of file diff --git a/deps/framework/widget-core/registerCustomElement.mjs b/deps/framework/widget-core/registerCustomElement.mjs deleted file mode 100644 index ecf928d6df..0000000000 --- a/deps/framework/widget-core/registerCustomElement.mjs +++ /dev/null @@ -1,213 +0,0 @@ -import * as tslib_1 from "tslib"; -import { WidgetBase, noBind } from './WidgetBase'; -import { ProjectorMixin } from './mixins/Projector'; -import { from } from '../shim/array'; -import { w, dom } from './d'; -import global from '../shim/global'; -import { registerThemeInjector } from './mixins/Themed'; -import { alwaysRender } from './decorators/alwaysRender'; -export var CustomElementChildType; -(function (CustomElementChildType) { - CustomElementChildType["DOJO"] = "DOJO"; - CustomElementChildType["NODE"] = "NODE"; - CustomElementChildType["TEXT"] = "TEXT"; -})(CustomElementChildType || (CustomElementChildType = {})); -export function DomToWidgetWrapper(domNode) { - let DomToWidgetWrapper = class DomToWidgetWrapper extends WidgetBase { - render() { - const properties = Object.keys(this.properties).reduce((props, key) => { - const value = this.properties[key]; - if (key.indexOf('on') === 0) { - key = `__${key}`; - } - props[key] = value; - return props; - }, {}); - return dom({ node: domNode, props: properties, diffType: 'dom' }); - } - static get domNode() { - return domNode; - } - }; - DomToWidgetWrapper = tslib_1.__decorate([ - alwaysRender() - ], DomToWidgetWrapper); - return DomToWidgetWrapper; -} -export function create(descriptor, WidgetConstructor) { - const { attributes, childType, registryFactory } = descriptor; - const attributeMap = {}; - attributes.forEach((propertyName) => { - const attributeName = propertyName.toLowerCase(); - attributeMap[attributeName] = propertyName; - }); - return class extends HTMLElement { - constructor() { - super(...arguments); - this._properties = {}; - this._children = []; - this._eventProperties = {}; - this._initialised = false; - } - connectedCallback() { - if (this._initialised) { - return; - } - const domProperties = {}; - const { attributes, properties, events } = descriptor; - this._properties = Object.assign({}, this._properties, this._attributesToProperties(attributes)); - [...attributes, ...properties].forEach((propertyName) => { - const value = this[propertyName]; - const filteredPropertyName = propertyName.replace(/^on/, '__'); - if (value !== undefined) { - this._properties[propertyName] = value; - } - if (filteredPropertyName !== propertyName) { - domProperties[filteredPropertyName] = { - get: () => this._getProperty(propertyName), - set: (value) => this._setProperty(propertyName, value) - }; - } - domProperties[propertyName] = { - get: () => this._getProperty(propertyName), - set: (value) => this._setProperty(propertyName, value) - }; - }); - events.forEach((propertyName) => { - const eventName = propertyName.replace(/^on/, '').toLowerCase(); - const filteredPropertyName = propertyName.replace(/^on/, '__on'); - domProperties[filteredPropertyName] = { - get: () => this._getEventProperty(propertyName), - set: (value) => this._setEventProperty(propertyName, value) - }; - this._eventProperties[propertyName] = undefined; - this._properties[propertyName] = (...args) => { - const eventCallback = this._getEventProperty(propertyName); - if (typeof eventCallback === 'function') { - eventCallback(...args); - } - this.dispatchEvent(new CustomEvent(eventName, { - bubbles: false, - detail: args - })); - }; - }); - Object.defineProperties(this, domProperties); - const children = childType === CustomElementChildType.TEXT ? this.childNodes : this.children; - from(children).forEach((childNode) => { - if (childType === CustomElementChildType.DOJO) { - childNode.addEventListener('dojo-ce-render', () => this._render()); - childNode.addEventListener('dojo-ce-connected', () => this._render()); - this._children.push(DomToWidgetWrapper(childNode)); - } - else { - this._children.push(dom({ node: childNode, diffType: 'dom' })); - } - }); - this.addEventListener('dojo-ce-connected', (e) => this._childConnected(e)); - const widgetProperties = this._properties; - const renderChildren = () => this.__children__(); - const Wrapper = class extends WidgetBase { - render() { - return w(WidgetConstructor, widgetProperties, renderChildren()); - } - }; - const registry = registryFactory(); - const themeContext = registerThemeInjector(this._getTheme(), registry); - global.addEventListener('dojo-theme-set', () => themeContext.set(this._getTheme())); - const Projector = ProjectorMixin(Wrapper); - this._projector = new Projector(); - this._projector.setProperties({ registry }); - this._projector.append(this); - this._initialised = true; - this.dispatchEvent(new CustomEvent('dojo-ce-connected', { - bubbles: true, - detail: this - })); - } - _getTheme() { - if (global && global.dojoce && global.dojoce.theme) { - return global.dojoce.themes[global.dojoce.theme]; - } - } - _childConnected(e) { - const node = e.detail; - if (node.parentNode === this) { - const exists = this._children.some((child) => child.domNode === node); - if (!exists) { - node.addEventListener('dojo-ce-render', () => this._render()); - this._children.push(DomToWidgetWrapper(node)); - this._render(); - } - } - } - _render() { - if (this._projector) { - this._projector.invalidate(); - this.dispatchEvent(new CustomEvent('dojo-ce-render', { - bubbles: false, - detail: this - })); - } - } - __properties__() { - return Object.assign({}, this._properties, this._eventProperties); - } - __children__() { - if (childType === CustomElementChildType.DOJO) { - return this._children.filter((Child) => Child.domNode.isWidget).map((Child) => { - const { domNode } = Child; - return w(Child, Object.assign({}, domNode.__properties__()), [...domNode.__children__()]); - }); - } - else { - return this._children; - } - } - attributeChangedCallback(name, oldValue, value) { - const propertyName = attributeMap[name]; - this._setProperty(propertyName, value); - } - _setEventProperty(propertyName, value) { - this._eventProperties[propertyName] = value; - } - _getEventProperty(propertyName) { - return this._eventProperties[propertyName]; - } - _setProperty(propertyName, value) { - if (typeof value === 'function') { - value[noBind] = true; - } - this._properties[propertyName] = value; - this._render(); - } - _getProperty(propertyName) { - return this._properties[propertyName]; - } - _attributesToProperties(attributes) { - return attributes.reduce((properties, propertyName) => { - const attributeName = propertyName.toLowerCase(); - const value = this.getAttribute(attributeName); - if (value !== null) { - properties[propertyName] = value; - } - return properties; - }, {}); - } - static get observedAttributes() { - return Object.keys(attributeMap); - } - get isWidget() { - return true; - } - }; -} -export function register(WidgetConstructor) { - const descriptor = WidgetConstructor.prototype && WidgetConstructor.prototype.__customElementDescriptor; - if (!descriptor) { - throw new Error('Cannot get descriptor for Custom Element, have you added the @customElement decorator to your Widget?'); - } - global.customElements.define(descriptor.tagName, create(descriptor, WidgetConstructor)); -} -export default register; -//# sourceMappingURL=registerCustomElement.mjs.map \ No newline at end of file diff --git a/deps/framework/widget-core/registerCustomElement.mjs.map b/deps/framework/widget-core/registerCustomElement.mjs.map deleted file mode 100644 index 46b7a6b791..0000000000 --- a/deps/framework/widget-core/registerCustomElement.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"registerCustomElement.mjs","sourceRoot":"","sources":["registerCustomElement.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAClD,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AACrC,OAAO,EAAE,CAAC,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAC7B,OAAO,MAAM,MAAM,gBAAgB,CAAC;AACpC,OAAO,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AACxD,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAEzD,MAAM,CAAN,IAAY,sBAIX;AAJD,WAAY,sBAAsB;IACjC,uCAAa,CAAA;IACb,uCAAa,CAAA;IACb,uCAAa,CAAA;AACd,CAAC,EAJW,sBAAsB,KAAtB,sBAAsB,QAIjC;AAED,MAAM,6BAA6B,OAAoB;IAEtD,IAAM,kBAAkB,GAAxB,wBAAyB,SAAQ,UAAe;QACrC,MAAM;YACf,MAAM,UAAU,GAAG,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,MAAM,CACrD,CAAC,KAAK,EAAE,GAAW,EAAE,EAAE;gBACtB,MAAM,KAAK,GAAG,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC;gBACnC,EAAE,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;oBAC7B,GAAG,GAAG,KAAK,GAAG,EAAE,CAAC;gBAClB,CAAC;gBACD,KAAK,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;gBACnB,MAAM,CAAC,KAAK,CAAC;YACd,CAAC,EACD,EAAS,CACT,CAAC;YACF,MAAM,CA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,IAAI,CAAC,OAAO,EAAE,CAAC;QAChB,CAAC;QAEO,YAAY,CAAC,YAAoB;YACxC,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC,YAAY,CAAC,CAAC;QACvC,CAAC;QAEO,uBAAuB,CAAC,UAAoB;YACnD,MAAM,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,UAAe,EAAE,YAAoB,EAAE,EAAE;gBAClE,MAAM,aAAa,GAAG,YAAY,CAAC,WAAW,EAAE,CAAC;gBACjD,MAAM,KAAK,GAAG,IAAI,CAAC,YAAY,CAAC,aAAa,CAAC,CAAC;gBAC/C,EAAE,CAAC,CAAC,KAAK,KAAK,IAAI,CAAC,CAAC,CAAC;oBACpB,UAAU,CAAC,YAAY,CAAC,GAAG,KAAK,CAAC;gBAClC,CAAC;gBACD,MAAM,CAAC,UAAU,CAAC;YACnB,CAAC,EAAE,EAAE,CAAC,CAAC;QACR,CAAC;QAED,MAAM,KAAK,kBAAkB;YAC5B,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;QAClC,CAAC;QAED,IAAW,QAAQ;YAClB,MAAM,CAAC,IAAI,CAAC;QACb,CAAC;KACD,CAAC;AACH,CAAC;AAED,MAAM,mBAAmB,iBAAsB;IAC9C,MAAM,UAAU,GAAG,iBAAiB,CAAC,SAAS,IAAI,iBAAiB,CAAC,SAAS,CAAC,yBAAyB,CAAC;IAExG,EAAE,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC;QACjB,MAAM,IAAI,KAAK,CACd,uGAAuG,CACvG,CAAC;IACH,CAAC;IAED,MAAM,CAAC,cAAc,CAAC,MAAM,CAAC,UAAU,CAAC,OAAO,EAAE,MAAM,CAAC,UAAU,EAAE,iBAAiB,CAAC,CAAC,CAAC;AACzF,CAAC;AAED,eAAe,QAAQ,CAAC","sourcesContent":["import { WidgetBase, noBind } from './WidgetBase';\nimport { ProjectorMixin } from './mixins/Projector';\nimport { from } from '../shim/array';\nimport { w, dom } from './d';\nimport global from '../shim/global';\nimport { registerThemeInjector } from './mixins/Themed';\nimport { alwaysRender } from './decorators/alwaysRender';\n\nexport enum CustomElementChildType {\n\tDOJO = 'DOJO',\n\tNODE = 'NODE',\n\tTEXT = 'TEXT'\n}\n\nexport function DomToWidgetWrapper(domNode: HTMLElement): any {\n\t@alwaysRender()\n\tclass DomToWidgetWrapper extends WidgetBase {\n\t\tprotected render() {\n\t\t\tconst properties = Object.keys(this.properties).reduce(\n\t\t\t\t(props, key: string) => {\n\t\t\t\t\tconst value = this.properties[key];\n\t\t\t\t\tif (key.indexOf('on') === 0) {\n\t\t\t\t\t\tkey = `__${key}`;\n\t\t\t\t\t}\n\t\t\t\t\tprops[key] = value;\n\t\t\t\t\treturn props;\n\t\t\t\t},\n\t\t\t\t{} as any\n\t\t\t);\n\t\t\treturn dom({ node: domNode, props: properties, diffType: 'dom' });\n\t\t}\n\n\t\tstatic get domNode() {\n\t\t\treturn domNode;\n\t\t}\n\t}\n\n\treturn DomToWidgetWrapper;\n}\n\nexport function create(descriptor: any, WidgetConstructor: any): any {\n\tconst { attributes, childType, registryFactory } = descriptor;\n\tconst attributeMap: any = {};\n\n\tattributes.forEach((propertyName: string) => {\n\t\tconst attributeName = propertyName.toLowerCase();\n\t\tattributeMap[attributeName] = propertyName;\n\t});\n\n\treturn class extends HTMLElement {\n\t\tprivate _projector: any;\n\t\tprivate _properties: any = {};\n\t\tprivate _children: any[] = [];\n\t\tprivate _eventProperties: any = {};\n\t\tprivate _initialised = false;\n\n\t\tpublic connectedCallback() {\n\t\t\tif (this._initialised) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst domProperties: any = {};\n\t\t\tconst { attributes, properties, events } = descriptor;\n\n\t\t\tthis._properties = { ...this._properties, ...this._attributesToProperties(attributes) };\n\n\t\t\t[...attributes, ...properties].forEach((propertyName: string) => {\n\t\t\t\tconst value = (this as any)[propertyName];\n\t\t\t\tconst filteredPropertyName = propertyName.replace(/^on/, '__');\n\t\t\t\tif (value !== undefined) {\n\t\t\t\t\tthis._properties[propertyName] = value;\n\t\t\t\t}\n\n\t\t\t\tif (filteredPropertyName !== propertyName) {\n\t\t\t\t\tdomProperties[filteredPropertyName] = {\n\t\t\t\t\t\tget: () => this._getProperty(propertyName),\n\t\t\t\t\t\tset: (value: any) => this._setProperty(propertyName, value)\n\t\t\t\t\t};\n\t\t\t\t}\n\n\t\t\t\tdomProperties[propertyName] = {\n\t\t\t\t\tget: () => this._getProperty(propertyName),\n\t\t\t\t\tset: (value: any) => this._setProperty(propertyName, value)\n\t\t\t\t};\n\t\t\t});\n\n\t\t\tevents.forEach((propertyName: string) => {\n\t\t\t\tconst eventName = propertyName.replace(/^on/, '').toLowerCase();\n\t\t\t\tconst filteredPropertyName = propertyName.replace(/^on/, '__on');\n\n\t\t\t\tdomProperties[filteredPropertyName] = {\n\t\t\t\t\tget: () => this._getEventProperty(propertyName),\n\t\t\t\t\tset: (value: any) => this._setEventProperty(propertyName, value)\n\t\t\t\t};\n\n\t\t\t\tthis._eventProperties[propertyName] = undefined;\n\t\t\t\tthis._properties[propertyName] = (...args: any[]) => {\n\t\t\t\t\tconst eventCallback = this._getEventProperty(propertyName);\n\t\t\t\t\tif (typeof eventCallback === 'function') {\n\t\t\t\t\t\teventCallback(...args);\n\t\t\t\t\t}\n\t\t\t\t\tthis.dispatchEvent(\n\t\t\t\t\t\tnew CustomEvent(eventName, {\n\t\t\t\t\t\t\tbubbles: false,\n\t\t\t\t\t\t\tdetail: args\n\t\t\t\t\t\t})\n\t\t\t\t\t);\n\t\t\t\t};\n\t\t\t});\n\n\t\t\tObject.defineProperties(this, domProperties);\n\n\t\t\tconst children = childType === CustomElementChildType.TEXT ? this.childNodes : this.children;\n\n\t\t\tfrom(children).forEach((childNode: Node) => {\n\t\t\t\tif (childType === CustomElementChildType.DOJO) {\n\t\t\t\t\tchildNode.addEventListener('dojo-ce-render', () => this._render());\n\t\t\t\t\tchildNode.addEventListener('dojo-ce-connected', () => this._render());\n\t\t\t\t\tthis._children.push(DomToWidgetWrapper(childNode as HTMLElement));\n\t\t\t\t} else {\n\t\t\t\t\tthis._children.push(dom({ node: childNode as HTMLElement, diffType: 'dom' }));\n\t\t\t\t}\n\t\t\t});\n\n\t\t\tthis.addEventListener('dojo-ce-connected', (e: any) => this._childConnected(e));\n\n\t\t\tconst widgetProperties = this._properties;\n\t\t\tconst renderChildren = () => this.__children__();\n\t\t\tconst Wrapper = class extends WidgetBase {\n\t\t\t\trender() {\n\t\t\t\t\treturn w(WidgetConstructor, widgetProperties, renderChildren());\n\t\t\t\t}\n\t\t\t};\n\t\t\tconst registry = registryFactory();\n\t\t\tconst themeContext = registerThemeInjector(this._getTheme(), registry);\n\t\t\tglobal.addEventListener('dojo-theme-set', () => themeContext.set(this._getTheme()));\n\t\t\tconst Projector = ProjectorMixin(Wrapper);\n\t\t\tthis._projector = new Projector();\n\t\t\tthis._projector.setProperties({ registry });\n\t\t\tthis._projector.append(this);\n\n\t\t\tthis._initialised = true;\n\t\t\tthis.dispatchEvent(\n\t\t\t\tnew CustomEvent('dojo-ce-connected', {\n\t\t\t\t\tbubbles: true,\n\t\t\t\t\tdetail: this\n\t\t\t\t})\n\t\t\t);\n\t\t}\n\n\t\tprivate _getTheme() {\n\t\t\tif (global && global.dojoce && global.dojoce.theme) {\n\t\t\t\treturn global.dojoce.themes[global.dojoce.theme];\n\t\t\t}\n\t\t}\n\n\t\tprivate _childConnected(e: any) {\n\t\t\tconst node = e.detail;\n\t\t\tif (node.parentNode === this) {\n\t\t\t\tconst exists = this._children.some((child) => child.domNode === node);\n\t\t\t\tif (!exists) {\n\t\t\t\t\tnode.addEventListener('dojo-ce-render', () => this._render());\n\t\t\t\t\tthis._children.push(DomToWidgetWrapper(node));\n\t\t\t\t\tthis._render();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tprivate _render() {\n\t\t\tif (this._projector) {\n\t\t\t\tthis._projector.invalidate();\n\t\t\t\tthis.dispatchEvent(\n\t\t\t\t\tnew CustomEvent('dojo-ce-render', {\n\t\t\t\t\t\tbubbles: false,\n\t\t\t\t\t\tdetail: this\n\t\t\t\t\t})\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\tpublic __properties__() {\n\t\t\treturn { ...this._properties, ...this._eventProperties };\n\t\t}\n\n\t\tpublic __children__() {\n\t\t\tif (childType === CustomElementChildType.DOJO) {\n\t\t\t\treturn this._children.filter((Child) => Child.domNode.isWidget).map((Child: any) => {\n\t\t\t\t\tconst { domNode } = Child;\n\t\t\t\t\treturn w(Child, { ...domNode.__properties__() }, [...domNode.__children__()]);\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\treturn this._children;\n\t\t\t}\n\t\t}\n\n\t\tpublic attributeChangedCallback(name: string, oldValue: string | null, value: string | null) {\n\t\t\tconst propertyName = attributeMap[name];\n\t\t\tthis._setProperty(propertyName, value);\n\t\t}\n\n\t\tprivate _setEventProperty(propertyName: string, value: any) {\n\t\t\tthis._eventProperties[propertyName] = value;\n\t\t}\n\n\t\tprivate _getEventProperty(propertyName: string) {\n\t\t\treturn this._eventProperties[propertyName];\n\t\t}\n\n\t\tprivate _setProperty(propertyName: string, value: any) {\n\t\t\tif (typeof value === 'function') {\n\t\t\t\tvalue[noBind] = true;\n\t\t\t}\n\t\t\tthis._properties[propertyName] = value;\n\t\t\tthis._render();\n\t\t}\n\n\t\tprivate _getProperty(propertyName: string) {\n\t\t\treturn this._properties[propertyName];\n\t\t}\n\n\t\tprivate _attributesToProperties(attributes: string[]) {\n\t\t\treturn attributes.reduce((properties: any, propertyName: string) => {\n\t\t\t\tconst attributeName = propertyName.toLowerCase();\n\t\t\t\tconst value = this.getAttribute(attributeName);\n\t\t\t\tif (value !== null) {\n\t\t\t\t\tproperties[propertyName] = value;\n\t\t\t\t}\n\t\t\t\treturn properties;\n\t\t\t}, {});\n\t\t}\n\n\t\tstatic get observedAttributes() {\n\t\t\treturn Object.keys(attributeMap);\n\t\t}\n\n\t\tpublic get isWidget() {\n\t\t\treturn true;\n\t\t}\n\t};\n}\n\nexport function register(WidgetConstructor: any): void {\n\tconst descriptor = WidgetConstructor.prototype && WidgetConstructor.prototype.__customElementDescriptor;\n\n\tif (!descriptor) {\n\t\tthrow new Error(\n\t\t\t'Cannot get descriptor for Custom Element, have you added the @customElement decorator to your Widget?'\n\t\t);\n\t}\n\n\tglobal.customElements.define(descriptor.tagName, create(descriptor, WidgetConstructor));\n}\n\nexport default register;\n"]} \ No newline at end of file diff --git a/deps/framework/widget-core/tsx.d.ts b/deps/framework/widget-core/tsx.d.ts deleted file mode 100644 index efe18bb5c5..0000000000 --- a/deps/framework/widget-core/tsx.d.ts +++ /dev/null @@ -1,21 +0,0 @@ -import { Constructor, DNode } from './interfaces'; -import { WNode, VNodeProperties } from './interfaces'; -declare global { - namespace JSX { - type Element = WNode; - interface ElementAttributesProperty { - properties: {}; - } - interface IntrinsicElements { - [key: string]: VNodeProperties; - } - } -} -export declare const REGISTRY_ITEM: symbol; -export declare class FromRegistry

{ - static type: symbol; - properties: P; - name: string | undefined; -} -export declare function fromRegistry

(tag: string): Constructor>; -export declare function tsx(tag: any, properties?: {}, ...children: any[]): DNode; diff --git a/deps/framework/widget-core/tsx.js b/deps/framework/widget-core/tsx.js deleted file mode 100644 index 45ce7e4704..0000000000 --- a/deps/framework/widget-core/tsx.js +++ /dev/null @@ -1,68 +0,0 @@ -(function (factory) { - if (typeof module === "object" && typeof module.exports === "object") { - var v = factory(require, exports); - if (v !== undefined) module.exports = v; - } - else if (typeof define === "function" && define.amd) { - define(["require", "exports", "tslib", "./d"], factory); - } -})(function (require, exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - var tslib_1 = require("tslib"); - var d_1 = require("./d"); - exports.REGISTRY_ITEM = Symbol('Identifier for an item from the Widget Registry.'); - var FromRegistry = /** @class */ (function () { - function FromRegistry() { - this.properties = {}; - } - FromRegistry.type = exports.REGISTRY_ITEM; - return FromRegistry; - }()); - exports.FromRegistry = FromRegistry; - function fromRegistry(tag) { - return _a = /** @class */ (function (_super) { - tslib_1.__extends(class_1, _super); - function class_1() { - var _this = _super !== null && _super.apply(this, arguments) || this; - _this.properties = {}; - _this.name = tag; - return _this; - } - return class_1; - }(FromRegistry)), - _a.type = exports.REGISTRY_ITEM, - _a; - var _a; - } - exports.fromRegistry = fromRegistry; - function spreadChildren(children, child) { - if (Array.isArray(child)) { - return child.reduce(spreadChildren, children); - } - else { - return tslib_1.__spread(children, [child]); - } - } - function tsx(tag, properties) { - if (properties === void 0) { properties = {}; } - var children = []; - for (var _i = 2; _i < arguments.length; _i++) { - children[_i - 2] = arguments[_i]; - } - children = children.reduce(spreadChildren, []); - properties = properties === null ? {} : properties; - if (typeof tag === 'string') { - return d_1.v(tag, properties, children); - } - else if (tag.type === exports.REGISTRY_ITEM) { - var registryItem = new tag(); - return d_1.w(registryItem.name, properties, children); - } - else { - return d_1.w(tag, properties, children); - } - } - exports.tsx = tsx; -}); -//# sourceMappingURL=tsx.js.map \ No newline at end of file diff --git a/deps/framework/widget-core/tsx.js.map b/deps/framework/widget-core/tsx.js.map deleted file mode 100644 index 9a8914422f..0000000000 --- a/deps/framework/widget-core/tsx.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"tsx.js","sourceRoot":"","sources":["tsx.ts"],"names":[],"mappings":";;;;;;;;;;;;IAAA,yBAA2B;IAgBd,QAAA,aAAa,GAAG,MAAM,CAAC,kDAAkD,CAAC,CAAC;IAExF;QAAA;YAEC,eAAU,GAAM,EAAO,CAAC;QAEzB,CAAC;QAHO,iBAAI,GAAG,qBAAa,CAAC;QAG7B,mBAAC;KAAA,AAJD,IAIC;IAJY,oCAAY;IAMzB,sBAAgC,GAAW;QAC1C,MAAM;gBAAe,mCAAe;gBAA7B;oBAAA,qEAIN;oBAHA,gBAAU,GAAM,EAAO,CAAC;oBAExB,UAAI,GAAG,GAAG,CAAC;;gBACZ,CAAC;gBAAD,cAAC;YAAD,CAAC,AAJM,CAAc,Y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perties } from './interfaces';\n\ndeclare global {\n\tnamespace JSX {\n\t\ttype Element = WNode;\n\t\tinterface ElementAttributesProperty {\n\t\t\tproperties: {};\n\t\t}\n\t\tinterface IntrinsicElements {\n\t\t\t[key: string]: VNodeProperties;\n\t\t}\n\t}\n}\n\nexport const REGISTRY_ITEM = Symbol('Identifier for an item from the Widget Registry.');\n\nexport class FromRegistry

{\n\tstatic type = REGISTRY_ITEM;\n\tproperties: P = {} as P;\n\tname: string | undefined;\n}\n\nexport function fromRegistry

(tag: string): Constructor> {\n\treturn class extends FromRegistry

{\n\t\tproperties: P = {} as P;\n\t\tstatic type = REGISTRY_ITEM;\n\t\tname = tag;\n\t};\n}\n\nfunction spreadChildren(children: any[], child: any): any[] {\n\tif (Array.isArray(child)) {\n\t\treturn child.reduce(spreadChildren, children);\n\t} else {\n\t\treturn [...children, child];\n\t}\n}\n\nexport function tsx(tag: any, properties = {}, ...children: any[]): DNode {\n\tchildren = children.reduce(spreadChildren, []);\n\tproperties = properties === null ? {} : properties;\n\tif (typeof tag === 'string') {\n\t\treturn v(tag, properties, children);\n\t} else if (tag.type === REGISTRY_ITEM) {\n\t\tconst registryItem = new tag();\n\t\treturn w(registryItem.name, properties, children);\n\t} else {\n\t\treturn w(tag, properties, children);\n\t}\n}\n"]} \ No newline at end of file diff --git a/deps/framework/widget-core/tsx.mjs b/deps/framework/widget-core/tsx.mjs deleted file mode 100644 index df84e26f6a..0000000000 --- a/deps/framework/widget-core/tsx.mjs +++ /dev/null @@ -1,43 +0,0 @@ -import { v, w } from './d'; -export const REGISTRY_ITEM = Symbol('Identifier for an item from the Widget Registry.'); -export class FromRegistry { - constructor() { - this.properties = {}; - } -} -FromRegistry.type = REGISTRY_ITEM; -export function fromRegistry(tag) { - return _a = class extends FromRegistry { - constructor() { - super(...arguments); - this.properties = {}; - this.name = tag; - } - }, - _a.type = REGISTRY_ITEM, - _a; - var _a; -} -function spreadChildren(children, child) { - if (Array.isArray(child)) { - return child.reduce(spreadChildren, children); - } - else { - return [...children, child]; - } -} -export function tsx(tag, properties = {}, ...children) { - children = children.reduce(spreadChildren, []); - properties = properties === null ? {} : properties; - if (typeof tag === 'string') { - return v(tag, properties, children); - } - else if (tag.type === REGISTRY_ITEM) { - const registryItem = new tag(); - return w(registryItem.name, properties, children); - } - else { - return w(tag, properties, children); - } -} -//# sourceMappingURL=tsx.mjs.map \ No newline at end of file diff --git a/deps/framework/widget-core/tsx.mjs.map b/deps/framework/widget-core/tsx.mjs.map deleted file mode 100644 index d38bcd2097..0000000000 --- a/deps/framework/widget-core/tsx.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"tsx.mjs","sourceRoot":"","sources":["tsx.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAgB3B,MAAM,CAAC,MAAM,aAAa,GAAG,MAAM,CAAC,kDAAkD,CAAC,CAAC;AAExF,MAAM;IAAN;QAEC,eAAU,GAAM,EAAO,CAAC;IAEzB,CAAC;;AAHO,iBAAI,GAAG,aAAa,CAAC;AAK7B,MAAM,uBAA0B,GAAW;IAC1C,MAAM,MAAC,KAAM,SAAQ,YAAe;YAA7B;;gBACN,eAAU,GAAM,EAAO,CAAC;gBAExB,SAAI,GAAG,GAAG,CAAC;YACZ,CAAC;SAAA;QAFO,OAAI,GAAG,aAAc;WAE3B;;AACH,CAAC;AAED,wBAAwB,QAAe,EAAE,KAAU;IAClD,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;QAC1B,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,cAAc,EAAE,QAAQ,CAAC,CAAC;IAC/C,CAAC;IAAC,IAAI,CAAC,CAAC;QACP,MAAM,CAAC,CAAC,GAAG,QAAQ,EAAE,KAAK,CAAC,CAAC;IAC7B,CAAC;AACF,CAAC;AAED,MAAM,cAAc,GAAQ,EAAE,UAAU,GAAG,EAAE,EAAE,GAAG,QAAe;IAChE,QAAQ,GAAG,QAAQ,CAAC,MAAM,CAAC,cAAc,EAAE,EAAE,CAAC,CAAC;IAC/C,UAAU,GAAG,UAAU,KAAK,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,UAAU,CAAC;IACnD,EAAE,CAAC,CAAC,OAAO,GAAG,KAAK,QAAQ,CAAC,CAAC,CAAC;QAC7B,MAAM,CAAC,CAAC,CAAC,GAAG,EAAE,UAAU,EAAE,QAAQ,CAAC,CAAC;IACrC,CAAC;IAAC,IAAI,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC,IAAI,KAAK,aAAa,CAAC,CAAC,CAAC;QACvC,MAAM,YAAY,GAAG,IAAI,GAAG,EAAE,CAAC;QAC/B,MAAM,CAAC,CAAC,CAAC,YAAY,CAAC,IAAI,EAAE,UAAU,EAAE,QAAQ,CAAC,CAAC;IACnD,CAAC;IAAC,IAAI,CAAC,CAAC;QACP,MAAM,CAAC,CAAC,CAAC,GAAG,EAAE,UAAU,EAAE,QAAQ,CAAC,CAAC;IACrC,CAAC;AACF,CAAC","sourcesContent":["import { v, w } from './d';\nimport { Constructor, DNode } from './interfaces';\nimport { WNode, VNodeProperties } from './interfaces';\n\ndeclare global {\n\tnamespace JSX {\n\t\ttype Element = WNode;\n\t\tinterface ElementAttributesProperty {\n\t\t\tproperties: {};\n\t\t}\n\t\tinterface IntrinsicElements {\n\t\t\t[key: string]: VNodeProperties;\n\t\t}\n\t}\n}\n\nexport const REGISTRY_ITEM = Symbol('Identifier for an item from the Widget Registry.');\n\nexport class FromRegistry

{\n\tstatic type = REGISTRY_ITEM;\n\tproperties: P = {} as P;\n\tname: string | undefined;\n}\n\nexport function fromRegistry

(tag: string): Constructor> {\n\treturn class extends FromRegistry

{\n\t\tproperties: P = {} as P;\n\t\tstatic type = REGISTRY_ITEM;\n\t\tname = tag;\n\t};\n}\n\nfunction spreadChildren(children: any[], child: any): any[] {\n\tif (Array.isArray(child)) {\n\t\treturn child.reduce(spreadChildren, children);\n\t} else {\n\t\treturn [...children, child];\n\t}\n}\n\nexport function tsx(tag: any, properties = {}, ...children: any[]): DNode {\n\tchildren = children.reduce(spreadChildren, []);\n\tproperties = properties === null ? {} : properties;\n\tif (typeof tag === 'string') {\n\t\treturn v(tag, properties, children);\n\t} else if (tag.type === REGISTRY_ITEM) {\n\t\tconst registryItem = new tag();\n\t\treturn w(registryItem.name, properties, children);\n\t} else {\n\t\treturn w(tag, properties, children);\n\t}\n}\n"]} \ No newline at end of file diff --git a/deps/framework/widget-core/vdom.d.ts b/deps/framework/widget-core/vdom.d.ts deleted file mode 100644 index 6edef3215a..0000000000 --- a/deps/framework/widget-core/vdom.d.ts +++ /dev/null @@ -1,63 +0,0 @@ -import { CoreProperties, DefaultWidgetBaseInterface, DNode, VNode, WNode, ProjectionOptions, Projection, VNodeProperties } from './interfaces'; -import WeakMap from '../shim/WeakMap'; -import NodeHandler from './NodeHandler'; -import RegistryHandler from './RegistryHandler'; -export declare type RenderResult = DNode | DNode[]; -export interface InternalWNode extends WNode { - /** - * The instance of the widget - */ - instance: DefaultWidgetBaseInterface; - /** - * The rendered DNodes from the instance - */ - rendered: InternalDNode[]; - /** - * Core properties that are used by the widget core system - */ - coreProperties: CoreProperties; - /** - * Children for the WNode - */ - children: InternalDNode[]; -} -export interface InternalVNode extends VNode { - /** - * Children for the VNode - */ - children?: InternalDNode[]; - inserted?: boolean; - /** - * Bag used to still decorate properties on a deferred properties callback - */ - decoratedDeferredProperties?: VNodeProperties; - /** - * DOM element - */ - domNode?: Element | Text; -} -export declare type InternalDNode = InternalVNode | InternalWNode; -export interface RenderQueue { - instance: DefaultWidgetBaseInterface; - depth: number; -} -export interface WidgetData { - onDetach: () => void; - onAttach: () => void; - dirty: boolean; - registry: () => RegistryHandler; - nodeHandler: NodeHandler; - coreProperties: CoreProperties; - invalidate?: Function; - rendering: boolean; - inputProperties: any; -} -export declare const widgetInstanceMap: WeakMap; -export declare function toParentVNode(domNode: Element): InternalVNode; -export declare function toTextVNode(data: any): InternalVNode; -export declare function filterAndDecorateChildren(children: undefined | DNode | DNode[], instance: DefaultWidgetBaseInterface): InternalDNode[]; -export declare const dom: { - append: (parentNode: Element, instance: DefaultWidgetBaseInterface, projectionOptions?: Partial) => Projection; - create: (instance: DefaultWidgetBaseInterface, projectionOptions?: Partial | undefined) => Projection; - merge: (element: Element, instance: DefaultWidgetBaseInterface, projectionOptions?: Partial) => Projection; -}; diff --git a/deps/framework/widget-core/vdom.js b/deps/framework/widget-core/vdom.js deleted file mode 100644 index 54a8d77ef5..0000000000 --- a/deps/framework/widget-core/vdom.js +++ /dev/null @@ -1,966 +0,0 @@ -(function (factory) { - if (typeof module === "object" && typeof module.exports === "object") { - var v = factory(require, exports); - if (v !== undefined) module.exports = v; - } - else if (typeof define === "function" && define.amd) { - define(["require", "exports", "tslib", "../shim/global", "../shim/array", "./d", "./Registry", "../shim/WeakMap"], factory); - } -})(function (require, exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - var tslib_1 = require("tslib"); - var global_1 = require("../shim/global"); - var array_1 = require("../shim/array"); - var d_1 = require("./d"); - var Registry_1 = require("./Registry"); - var WeakMap_1 = require("../shim/WeakMap"); - var NAMESPACE_W3 = 'http://www.w3.org/'; - var NAMESPACE_SVG = NAMESPACE_W3 + '2000/svg'; - var NAMESPACE_XLINK = NAMESPACE_W3 + '1999/xlink'; - var emptyArray = []; - var nodeOperations = ['focus', 'blur', 'scrollIntoView', 'click']; - exports.widgetInstanceMap = new WeakMap_1.default(); - var instanceMap = new WeakMap_1.default(); - var nextSiblingMap = new WeakMap_1.default(); - var projectorStateMap = new WeakMap_1.default(); - function same(dnode1, dnode2) { - if (d_1.isVNode(dnode1) && d_1.isVNode(dnode2)) { - if (d_1.isDomVNode(dnode1) || d_1.isDomVNode(dnode2)) { - if (dnode1.domNode !== dnode2.domNode) { - return false; - } - } - if (dnode1.tag !== dnode2.tag) { - return false; - } - if (dnode1.properties.key !== dnode2.properties.key) { - return false; - } - return true; - } - else if (d_1.isWNode(dnode1) && d_1.isWNode(dnode2)) { - if (dnode1.instance === undefined && typeof dnode2.widgetConstructor === 'string') { - return false; - } - if (dnode1.widgetConstructor !== dnode2.widgetConstructor) { - return false; - } - if (dnode1.properties.key !== dnode2.properties.key) { - return false; - } - return true; - } - return false; - } - var missingTransition = function () { - throw new Error('Provide a transitions object to the projectionOptions to do animations'); - }; - function getProjectionOptions(projectorOptions, projectorInstance) { - var defaults = { - namespace: undefined, - styleApplyer: function (domNode, styleName, value) { - domNode.style[styleName] = value; - }, - transitions: { - enter: missingTransition, - exit: missingTransition - }, - depth: 0, - merge: false, - sync: false, - projectorInstance: projectorInstance - }; - return tslib_1.__assign({}, defaults, projectorOptions); - } - function checkStyleValue(styleValue) { - if (typeof styleValue !== 'string') { - throw new Error('Style values must be strings'); - } - } - function updateEvent(domNode, eventName, currentValue, projectionOptions, bind, previousValue) { - var projectorState = projectorStateMap.get(projectionOptions.projectorInstance); - var eventMap = projectorState.nodeMap.get(domNode) || new WeakMap_1.default(); - if (previousValue) { - var previousEvent = eventMap.get(previousValue); - domNode.removeEventListener(eventName, previousEvent); - } - var callback = currentValue.bind(bind); - if (eventName === 'input') { - callback = function (evt) { - currentValue.call(this, evt); - evt.target['oninput-value'] = evt.target.value; - }.bind(bind); - } - domNode.addEventListener(eventName, callback); - eventMap.set(currentValue, callback); - projectorState.nodeMap.set(domNode, eventMap); - } - function addClasses(domNode, classes) { - if (classes) { - var classNames = classes.split(' '); - for (var i = 0; i < classNames.length; i++) { - domNode.classList.add(classNames[i]); - } - } - } - function removeClasses(domNode, classes) { - if (classes) { - var classNames = classes.split(' '); - for (var i = 0; i < classNames.length; i++) { - domNode.classList.remove(classNames[i]); - } - } - } - function buildPreviousProperties(domNode, previous, current) { - var diffType = current.diffType, properties = current.properties, attributes = current.attributes; - if (!diffType || diffType === 'vdom') { - return { properties: previous.properties, attributes: previous.attributes, events: previous.events }; - } - else if (diffType === 'none') { - return { properties: {}, attributes: previous.attributes ? {} : undefined, events: previous.events }; - } - var newProperties = { - properties: {} - }; - if (attributes) { - newProperties.attributes = {}; - newProperties.events = previous.events; - Object.keys(properties).forEach(function (propName) { - newProperties.properties[propName] = domNode[propName]; - }); - Object.keys(attributes).forEach(function (attrName) { - newProperties.attributes[attrName] = domNode.getAttribute(attrName); - }); - return newProperties; - } - newProperties.properties = Object.keys(properties).reduce(function (props, property) { - props[property] = domNode.getAttribute(property) || domNode[property]; - return props; - }, {}); - return newProperties; - } - function nodeOperation(propName, propValue, previousValue, domNode, projectionOptions) { - var result; - if (typeof propValue === 'function') { - result = propValue(); - } - else { - result = propValue && !previousValue; - } - if (result === true) { - var projectorState = projectorStateMap.get(projectionOptions.projectorInstance); - projectorState.deferredRenderCallbacks.push(function () { - domNode[propName](); - }); - } - } - function removeOrphanedEvents(domNode, previousProperties, properties, projectionOptions, onlyEvents) { - if (onlyEvents === void 0) { onlyEvents = false; } - var projectorState = projectorStateMap.get(projectionOptions.projectorInstance); - var eventMap = projectorState.nodeMap.get(domNode); - if (eventMap) { - Object.keys(previousProperties).forEach(function (propName) { - var isEvent = propName.substr(0, 2) === 'on' || onlyEvents; - var eventName = onlyEvents ? propName : propName.substr(2); - if (isEvent && !properties[propName]) { - var eventCallback = eventMap.get(previousProperties[propName]); - if (eventCallback) { - domNode.removeEventListener(eventName, eventCallback); - } - } - }); - } - } - function updateAttribute(domNode, attrName, attrValue, projectionOptions) { - if (projectionOptions.namespace === NAMESPACE_SVG && attrName === 'href') { - domNode.setAttributeNS(NAMESPACE_XLINK, attrName, attrValue); - } - else if ((attrName === 'role' && attrValue === '') || attrValue === undefined) { - domNode.removeAttribute(attrName); - } - else { - domNode.setAttribute(attrName, attrValue); - } - } - function updateAttributes(domNode, previousAttributes, attributes, projectionOptions) { - var attrNames = Object.keys(attributes); - var attrCount = attrNames.length; - for (var i = 0; i < attrCount; i++) { - var attrName = attrNames[i]; - var attrValue = attributes[attrName]; - var previousAttrValue = previousAttributes[attrName]; - if (attrValue !== previousAttrValue) { - updateAttribute(domNode, attrName, attrValue, projectionOptions); - } - } - } - function updateProperties(domNode, previousProperties, properties, projectionOptions, includesEventsAndAttributes) { - if (includesEventsAndAttributes === void 0) { includesEventsAndAttributes = true; } - var propertiesUpdated = false; - var propNames = Object.keys(properties); - var propCount = propNames.length; - if (propNames.indexOf('classes') === -1 && previousProperties.classes) { - if (Array.isArray(previousProperties.classes)) { - for (var i = 0; i < previousProperties.classes.length; i++) { - removeClasses(domNode, previousProperties.classes[i]); - } - } - else { - removeClasses(domNode, previousProperties.classes); - } - } - includesEventsAndAttributes && removeOrphanedEvents(domNode, previousProperties, properties, projectionOptions); - for (var i = 0; i < propCount; i++) { - var propName = propNames[i]; - var propValue = properties[propName]; - var previousValue = previousProperties[propName]; - if (propName === 'classes') { - var previousClasses = Array.isArray(previousValue) ? previousValue : [previousValue]; - var currentClasses = Array.isArray(propValue) ? propValue : [propValue]; - if (previousClasses && previousClasses.length > 0) { - if (!propValue || propValue.length === 0) { - for (var i_1 = 0; i_1 < previousClasses.length; i_1++) { - removeClasses(domNode, previousClasses[i_1]); - } - } - else { - var newClasses = tslib_1.__spread(currentClasses); - for (var i_2 = 0; i_2 < previousClasses.length; i_2++) { - var previousClassName = previousClasses[i_2]; - if (previousClassName) { - var classIndex = newClasses.indexOf(previousClassName); - if (classIndex === -1) { - removeClasses(domNode, previousClassName); - } - else { - newClasses.splice(classIndex, 1); - } - } - } - for (var i_3 = 0; i_3 < newClasses.length; i_3++) { - addClasses(domNode, newClasses[i_3]); - } - } - } - else { - for (var i_4 = 0; i_4 < currentClasses.length; i_4++) { - addClasses(domNode, currentClasses[i_4]); - } - } - } - else if (nodeOperations.indexOf(propName) !== -1) { - nodeOperation(propName, propValue, previousValue, domNode, projectionOptions); - } - else if (propName === 'styles') { - var styleNames = Object.keys(propValue); - var styleCount = styleNames.length; - for (var j = 0; j < styleCount; j++) { - var styleName = styleNames[j]; - var newStyleValue = propValue[styleName]; - var oldStyleValue = previousValue && previousValue[styleName]; - if (newStyleValue === oldStyleValue) { - continue; - } - propertiesUpdated = true; - if (newStyleValue) { - checkStyleValue(newStyleValue); - projectionOptions.styleApplyer(domNode, styleName, newStyleValue); - } - else { - projectionOptions.styleApplyer(domNode, styleName, ''); - } - } - } - else { - if (!propValue && typeof previousValue === 'string') { - propValue = ''; - } - if (propName === 'value') { - var domValue = domNode[propName]; - if (domValue !== propValue && - (domNode['oninput-value'] - ? domValue === domNode['oninput-value'] - : propValue !== previousValue)) { - domNode[propName] = propValue; - domNode['oninput-value'] = undefined; - } - if (propValue !== previousValue) { - propertiesUpdated = true; - } - } - else if (propName !== 'key' && propValue !== previousValue) { - var type = typeof propValue; - if (type === 'function' && propName.lastIndexOf('on', 0) === 0 && includesEventsAndAttributes) { - updateEvent(domNode, propName.substr(2), propValue, projectionOptions, properties.bind, previousValue); - } - else if (type === 'string' && propName !== 'innerHTML' && includesEventsAndAttributes) { - updateAttribute(domNode, propName, propValue, projectionOptions); - } - else if (propName === 'scrollLeft' || propName === 'scrollTop') { - if (domNode[propName] !== propValue) { - domNode[propName] = propValue; - } - } - else { - domNode[propName] = propValue; - } - propertiesUpdated = true; - } - } - } - return propertiesUpdated; - } - function findIndexOfChild(children, sameAs, start) { - for (var i = start; i < children.length; i++) { - if (same(children[i], sameAs)) { - return i; - } - } - return -1; - } - function toParentVNode(domNode) { - return { - tag: '', - properties: {}, - children: undefined, - domNode: domNode, - type: d_1.VNODE - }; - } - exports.toParentVNode = toParentVNode; - function toTextVNode(data) { - return { - tag: '', - properties: {}, - children: undefined, - text: "" + data, - domNode: undefined, - type: d_1.VNODE - }; - } - exports.toTextVNode = toTextVNode; - function toInternalWNode(instance, instanceData) { - return { - instance: instance, - rendered: [], - coreProperties: instanceData.coreProperties, - children: instance.children, - widgetConstructor: instance.constructor, - properties: instanceData.inputProperties, - type: d_1.WNODE - }; - } - function filterAndDecorateChildren(children, instance) { - if (children === undefined) { - return emptyArray; - } - children = Array.isArray(children) ? children : [children]; - for (var i = 0; i < children.length;) { - var child = children[i]; - if (child === undefined || child === null) { - children.splice(i, 1); - continue; - } - else if (typeof child === 'string') { - children[i] = toTextVNode(child); - } - else { - if (d_1.isVNode(child)) { - if (child.properties.bind === undefined) { - child.properties.bind = instance; - if (child.children && child.children.length > 0) { - filterAndDecorateChildren(child.children, instance); - } - } - } - else { - if (!child.coreProperties) { - var instanceData = exports.widgetInstanceMap.get(instance); - child.coreProperties = { - bind: instance, - baseRegistry: instanceData.coreProperties.baseRegistry - }; - } - if (child.children && child.children.length > 0) { - filterAndDecorateChildren(child.children, instance); - } - } - } - i++; - } - return children; - } - exports.filterAndDecorateChildren = filterAndDecorateChildren; - function nodeAdded(dnode, transitions) { - if (d_1.isVNode(dnode) && dnode.properties) { - var enterAnimation = dnode.properties.enterAnimation; - if (enterAnimation) { - if (typeof enterAnimation === 'function') { - enterAnimation(dnode.domNode, dnode.properties); - } - else { - transitions.enter(dnode.domNode, dnode.properties, enterAnimation); - } - } - } - } - function nodeToRemove(dnode, transitions, projectionOptions) { - if (d_1.isWNode(dnode)) { - var item = instanceMap.get(dnode.instance); - var rendered = (item ? item.dnode.rendered : dnode.rendered) || emptyArray; - if (dnode.instance) { - var instanceData = exports.widgetInstanceMap.get(dnode.instance); - instanceData.onDetach(); - instanceMap.delete(dnode.instance); - } - for (var i = 0; i < rendered.length; i++) { - nodeToRemove(rendered[i], transitions, projectionOptions); - } - } - else { - var domNode_1 = dnode.domNode; - var properties = dnode.properties; - if (dnode.children && dnode.children.length > 0) { - for (var i = 0; i < dnode.children.length; i++) { - nodeToRemove(dnode.children[i], transitions, projectionOptions); - } - } - var exitAnimation = properties.exitAnimation; - if (properties && exitAnimation) { - domNode_1.style.pointerEvents = 'none'; - var removeDomNode = function () { - domNode_1 && domNode_1.parentNode && domNode_1.parentNode.removeChild(domNode_1); - dnode.domNode = undefined; - }; - if (typeof exitAnimation === 'function') { - exitAnimation(domNode_1, removeDomNode, properties); - return; - } - else { - transitions.exit(dnode.domNode, properties, exitAnimation, removeDomNode); - return; - } - } - domNode_1 && domNode_1.parentNode && domNode_1.parentNode.removeChild(domNode_1); - dnode.domNode = undefined; - } - } - function checkDistinguishable(childNodes, indexToCheck, parentInstance) { - var childNode = childNodes[indexToCheck]; - if (d_1.isVNode(childNode) && !childNode.tag) { - return; // Text nodes need not be distinguishable - } - var key = childNode.properties.key; - if (key === undefined || key === null) { - for (var i = 0; i < childNodes.length; i++) { - if (i !== indexToCheck) { - var node = childNodes[i]; - if (same(node, childNode)) { - var nodeIdentifier = void 0; - var parentName = parentInstance.constructor.name || 'unknown'; - if (d_1.isWNode(childNode)) { - nodeIdentifier = childNode.widgetConstructor.name || 'unknown'; - } - else { - nodeIdentifier = childNode.tag; - } - console.warn("A widget (" + parentName + ") has had a child addded or removed, but they were not able to uniquely identified. It is recommended to provide a unique 'key' property when using the same widget or element (" + nodeIdentifier + ") multiple times as siblings"); - break; - } - } - } - } - } - function updateChildren(parentVNode, siblings, oldChildren, newChildren, parentInstance, projectionOptions) { - oldChildren = oldChildren || emptyArray; - newChildren = newChildren; - var oldChildrenLength = oldChildren.length; - var newChildrenLength = newChildren.length; - var transitions = projectionOptions.transitions; - var projectorState = projectorStateMap.get(projectionOptions.projectorInstance); - projectionOptions = tslib_1.__assign({}, projectionOptions, { depth: projectionOptions.depth + 1 }); - var oldIndex = 0; - var newIndex = 0; - var i; - var textUpdated = false; - var _loop_1 = function () { - var oldChild = oldIndex < oldChildrenLength ? oldChildren[oldIndex] : undefined; - var newChild = newChildren[newIndex]; - if (d_1.isVNode(newChild) && typeof newChild.deferredPropertiesCallback === 'function') { - newChild.inserted = d_1.isVNode(oldChild) && oldChild.inserted; - addDeferredProperties(newChild, projectionOptions); - } - if (oldChild !== undefined && same(oldChild, newChild)) { - oldIndex++; - newIndex++; - textUpdated = - updateDom(oldChild, newChild, projectionOptions, parentVNode, parentInstance, oldChildren.slice(oldIndex), newChildren.slice(newIndex)) || textUpdated; - return "continue"; - } - var findOldIndex = findIndexOfChild(oldChildren, newChild, oldIndex + 1); - var addChild = function () { - var insertBeforeDomNode = undefined; - var childrenArray = oldChildren; - var nextIndex = oldIndex + 1; - var child = oldChildren[oldIndex]; - if (!child) { - child = siblings[0]; - nextIndex = 1; - childrenArray = siblings; - } - if (child) { - var insertBeforeChildren = [child]; - while (insertBeforeChildren.length) { - var insertBefore = insertBeforeChildren.shift(); - if (d_1.isWNode(insertBefore)) { - var item = instanceMap.get(insertBefore.instance); - if (item && item.dnode.rendered) { - insertBeforeChildren.push.apply(insertBeforeChildren, tslib_1.__spread(item.dnode.rendered)); - } - } - else { - if (insertBefore.domNode) { - if (insertBefore.domNode.parentElement !== parentVNode.domNode) { - break; - } - insertBeforeDomNode = insertBefore.domNode; - break; - } - } - if (insertBeforeChildren.length === 0 && childrenArray[nextIndex]) { - insertBeforeChildren.push(childrenArray[nextIndex]); - nextIndex++; - } - } - } - createDom(newChild, parentVNode, newChildren.slice(newIndex + 1), insertBeforeDomNode, projectionOptions, parentInstance); - nodeAdded(newChild, transitions); - var indexToCheck = newIndex; - projectorState.afterRenderCallbacks.push(function () { - checkDistinguishable(newChildren, indexToCheck, parentInstance); - }); - }; - if (!oldChild || findOldIndex === -1) { - addChild(); - newIndex++; - return "continue"; - } - var removeChild = function () { - var indexToCheck = oldIndex; - projectorState.afterRenderCallbacks.push(function () { - checkDistinguishable(oldChildren, indexToCheck, parentInstance); - }); - if (d_1.isWNode(oldChild)) { - var item = instanceMap.get(oldChild.instance); - if (item) { - oldChild = item.dnode; - } - } - nodeToRemove(oldChild, transitions, projectionOptions); - }; - var findNewIndex = findIndexOfChild(newChildren, oldChild, newIndex + 1); - if (findNewIndex === -1) { - removeChild(); - oldIndex++; - return "continue"; - } - addChild(); - removeChild(); - oldIndex++; - newIndex++; - }; - while (newIndex < newChildrenLength) { - _loop_1(); - } - if (oldChildrenLength > oldIndex) { - var _loop_2 = function () { - var indexToCheck = i; - projectorState.afterRenderCallbacks.push(function () { - checkDistinguishable(oldChildren, indexToCheck, parentInstance); - }); - var childToRemove = oldChildren[i]; - if (d_1.isWNode(childToRemove)) { - var item = instanceMap.get(childToRemove.instance); - if (item) { - childToRemove = item.dnode; - } - } - nodeToRemove(childToRemove, transitions, projectionOptions); - }; - // Remove child fragments - for (i = oldIndex; i < oldChildrenLength; i++) { - _loop_2(); - } - } - return textUpdated; - } - function addChildren(parentVNode, children, projectionOptions, parentInstance, insertBefore, childNodes) { - if (insertBefore === void 0) { insertBefore = undefined; } - if (children === undefined) { - return; - } - var projectorState = projectorStateMap.get(projectionOptions.projectorInstance); - if (projectorState.merge && childNodes === undefined) { - childNodes = array_1.from(parentVNode.domNode.childNodes); - } - var transitions = projectionOptions.transitions; - projectionOptions = tslib_1.__assign({}, projectionOptions, { depth: projectionOptions.depth + 1 }); - for (var i = 0; i < children.length; i++) { - var child = children[i]; - var nextSiblings = children.slice(i + 1); - if (d_1.isVNode(child)) { - if (projectorState.merge && childNodes) { - var domElement = undefined; - while (child.domNode === undefined && childNodes.length > 0) { - domElement = childNodes.shift(); - if (domElement && domElement.tagName === (child.tag.toUpperCase() || undefined)) { - child.domNode = domElement; - } - } - } - createDom(child, parentVNode, nextSiblings, insertBefore, projectionOptions, parentInstance); - } - else { - createDom(child, parentVNode, nextSiblings, insertBefore, projectionOptions, parentInstance, childNodes); - } - nodeAdded(child, transitions); - } - } - function initPropertiesAndChildren(domNode, dnode, parentInstance, projectionOptions) { - addChildren(dnode, dnode.children, projectionOptions, parentInstance, undefined); - if (typeof dnode.deferredPropertiesCallback === 'function' && dnode.inserted === undefined) { - addDeferredProperties(dnode, projectionOptions); - } - if (dnode.attributes && dnode.events) { - updateAttributes(domNode, {}, dnode.attributes, projectionOptions); - updateProperties(domNode, {}, dnode.properties, projectionOptions, false); - removeOrphanedEvents(domNode, {}, dnode.events, projectionOptions, true); - var events_1 = dnode.events; - Object.keys(events_1).forEach(function (event) { - updateEvent(domNode, event, events_1[event], projectionOptions, dnode.properties.bind); - }); - } - else { - updateProperties(domNode, {}, dnode.properties, projectionOptions); - } - if (dnode.properties.key !== null && dnode.properties.key !== undefined) { - var instanceData = exports.widgetInstanceMap.get(parentInstance); - instanceData.nodeHandler.add(domNode, "" + dnode.properties.key); - } - dnode.inserted = true; - } - function createDom(dnode, parentVNode, nextSiblings, insertBefore, projectionOptions, parentInstance, childNodes) { - var domNode; - var projectorState = projectorStateMap.get(projectionOptions.projectorInstance); - if (d_1.isWNode(dnode)) { - var widgetConstructor = dnode.widgetConstructor; - var parentInstanceData = exports.widgetInstanceMap.get(parentInstance); - if (!Registry_1.isWidgetBaseConstructor(widgetConstructor)) { - var item = parentInstanceData.registry().get(widgetConstructor); - if (item === null) { - return; - } - widgetConstructor = item; - } - var instance_1 = new widgetConstructor(); - dnode.instance = instance_1; - nextSiblingMap.set(instance_1, nextSiblings); - var instanceData_1 = exports.widgetInstanceMap.get(instance_1); - instanceData_1.invalidate = function () { - instanceData_1.dirty = true; - if (instanceData_1.rendering === false) { - projectorState.renderQueue.push({ instance: instance_1, depth: projectionOptions.depth }); - scheduleRender(projectionOptions); - } - }; - instanceData_1.rendering = true; - instance_1.__setCoreProperties__(dnode.coreProperties); - instance_1.__setChildren__(dnode.children); - instance_1.__setProperties__(dnode.properties); - var rendered = instance_1.__render__(); - instanceData_1.rendering = false; - if (rendered) { - var filteredRendered = filterAndDecorateChildren(rendered, instance_1); - dnode.rendered = filteredRendered; - addChildren(parentVNode, filteredRendered, projectionOptions, instance_1, insertBefore, childNodes); - } - instanceMap.set(instance_1, { dnode: dnode, parentVNode: parentVNode }); - instanceData_1.nodeHandler.addRoot(); - projectorState.afterRenderCallbacks.push(function () { - instanceData_1.onAttach(); - }); - } - else { - if (projectorState.merge && projectorState.mergeElement !== undefined) { - domNode = dnode.domNode = projectionOptions.mergeElement; - projectorState.mergeElement = undefined; - initPropertiesAndChildren(domNode, dnode, parentInstance, projectionOptions); - return; - } - var doc = parentVNode.domNode.ownerDocument; - if (!dnode.tag && typeof dnode.text === 'string') { - if (dnode.domNode !== undefined && parentVNode.domNode) { - var newDomNode = dnode.domNode.ownerDocument.createTextNode(dnode.text); - if (parentVNode.domNode === dnode.domNode.parentNode) { - parentVNode.domNode.replaceChild(newDomNode, dnode.domNode); - } - else { - parentVNode.domNode.appendChild(newDomNode); - dnode.domNode.parentNode && dnode.domNode.parentNode.removeChild(dnode.domNode); - } - dnode.domNode = newDomNode; - } - else { - domNode = dnode.domNode = doc.createTextNode(dnode.text); - if (insertBefore !== undefined) { - parentVNode.domNode.insertBefore(domNode, insertBefore); - } - else { - parentVNode.domNode.appendChild(domNode); - } - } - } - else { - if (dnode.domNode === undefined) { - if (dnode.tag === 'svg') { - projectionOptions = tslib_1.__assign({}, projectionOptions, { namespace: NAMESPACE_SVG }); - } - if (projectionOptions.namespace !== undefined) { - domNode = dnode.domNode = doc.createElementNS(projectionOptions.namespace, dnode.tag); - } - else { - domNode = dnode.domNode = dnode.domNode || doc.createElement(dnode.tag); - } - } - else { - domNode = dnode.domNode; - } - initPropertiesAndChildren(domNode, dnode, parentInstance, projectionOptions); - if (insertBefore !== undefined) { - parentVNode.domNode.insertBefore(domNode, insertBefore); - } - else if (domNode.parentNode !== parentVNode.domNode) { - parentVNode.domNode.appendChild(domNode); - } - } - } - } - function updateDom(previous, dnode, projectionOptions, parentVNode, parentInstance, oldNextSiblings, nextSiblings) { - if (d_1.isWNode(dnode)) { - var instance = previous.instance; - var _a = instanceMap.get(instance), parentVNode_1 = _a.parentVNode, node = _a.dnode; - var previousRendered = node ? node.rendered : previous.rendered; - var instanceData = exports.widgetInstanceMap.get(instance); - instanceData.rendering = true; - instance.__setCoreProperties__(dnode.coreProperties); - instance.__setChildren__(dnode.children); - instance.__setProperties__(dnode.properties); - nextSiblingMap.set(instance, nextSiblings); - dnode.instance = instance; - if (instanceData.dirty === true) { - var rendered = instance.__render__(); - instanceData.rendering = false; - dnode.rendered = filterAndDecorateChildren(rendered, instance); - updateChildren(parentVNode_1, oldNextSiblings, previousRendered, dnode.rendered, instance, projectionOptions); - } - else { - instanceData.rendering = false; - dnode.rendered = previousRendered; - } - instanceMap.set(instance, { dnode: dnode, parentVNode: parentVNode_1 }); - instanceData.nodeHandler.addRoot(); - } - else { - if (previous === dnode) { - return false; - } - var domNode_2 = (dnode.domNode = previous.domNode); - var textUpdated = false; - var updated = false; - if (!dnode.tag && typeof dnode.text === 'string') { - if (dnode.text !== previous.text) { - var newDomNode = domNode_2.ownerDocument.createTextNode(dnode.text); - domNode_2.parentNode.replaceChild(newDomNode, domNode_2); - dnode.domNode = newDomNode; - textUpdated = true; - return textUpdated; - } - } - else { - if (dnode.tag && dnode.tag.lastIndexOf('svg', 0) === 0) { - projectionOptions = tslib_1.__assign({}, projectionOptions, { namespace: NAMESPACE_SVG }); - } - if (previous.children !== dnode.children) { - var children = filterAndDecorateChildren(dnode.children, parentInstance); - dnode.children = children; - updated = - updateChildren(dnode, oldNextSiblings, previous.children, children, parentInstance, projectionOptions) || updated; - } - var previousProperties_1 = buildPreviousProperties(domNode_2, previous, dnode); - if (dnode.attributes && dnode.events) { - updateAttributes(domNode_2, previousProperties_1.attributes, dnode.attributes, projectionOptions); - updated = - updateProperties(domNode_2, previousProperties_1.properties, dnode.properties, projectionOptions, false) || updated; - removeOrphanedEvents(domNode_2, previousProperties_1.events, dnode.events, projectionOptions, true); - var events_2 = dnode.events; - Object.keys(events_2).forEach(function (event) { - updateEvent(domNode_2, event, events_2[event], projectionOptions, dnode.properties.bind, previousProperties_1.events[event]); - }); - } - else { - updated = - updateProperties(domNode_2, previousProperties_1.properties, dnode.properties, projectionOptions) || - updated; - } - if (dnode.properties.key !== null && dnode.properties.key !== undefined) { - var instanceData = exports.widgetInstanceMap.get(parentInstance); - instanceData.nodeHandler.add(domNode_2, "" + dnode.properties.key); - } - } - if (updated && dnode.properties && dnode.properties.updateAnimation) { - dnode.properties.updateAnimation(domNode_2, dnode.properties, previous.properties); - } - } - } - function addDeferredProperties(vnode, projectionOptions) { - // transfer any properties that have been passed - as these must be decorated properties - vnode.decoratedDeferredProperties = vnode.properties; - var properties = vnode.deferredPropertiesCallback(!!vnode.inserted); - var projectorState = projectorStateMap.get(projectionOptions.projectorInstance); - vnode.properties = tslib_1.__assign({}, properties, vnode.decoratedDeferredProperties); - projectorState.deferredRenderCallbacks.push(function () { - var properties = tslib_1.__assign({}, vnode.deferredPropertiesCallback(!!vnode.inserted), vnode.decoratedDeferredProperties); - updateProperties(vnode.domNode, vnode.properties, properties, projectionOptions); - vnode.properties = properties; - }); - } - function runDeferredRenderCallbacks(projectionOptions) { - var projectorState = projectorStateMap.get(projectionOptions.projectorInstance); - if (projectorState.deferredRenderCallbacks.length) { - if (projectionOptions.sync) { - while (projectorState.deferredRenderCallbacks.length) { - var callback = projectorState.deferredRenderCallbacks.shift(); - callback && callback(); - } - } - else { - global_1.default.requestAnimationFrame(function () { - while (projectorState.deferredRenderCallbacks.length) { - var callback = projectorState.deferredRenderCallbacks.shift(); - callback && callback(); - } - }); - } - } - } - function runAfterRenderCallbacks(projectionOptions) { - var projectorState = projectorStateMap.get(projectionOptions.projectorInstance); - if (projectionOptions.sync) { - while (projectorState.afterRenderCallbacks.length) { - var callback = projectorState.afterRenderCallbacks.shift(); - callback && callback(); - } - } - else { - if (global_1.default.requestIdleCallback) { - global_1.default.requestIdleCallback(function () { - while (projectorState.afterRenderCallbacks.length) { - var callback = projectorState.afterRenderCallbacks.shift(); - callback && callback(); - } - }); - } - else { - setTimeout(function () { - while (projectorState.afterRenderCallbacks.length) { - var callback = projectorState.afterRenderCallbacks.shift(); - callback && callback(); - } - }); - } - } - } - function scheduleRender(projectionOptions) { - var projectorState = projectorStateMap.get(projectionOptions.projectorInstance); - if (projectionOptions.sync) { - render(projectionOptions); - } - else if (projectorState.renderScheduled === undefined) { - projectorState.renderScheduled = global_1.default.requestAnimationFrame(function () { - render(projectionOptions); - }); - } - } - function render(projectionOptions) { - var projectorState = projectorStateMap.get(projectionOptions.projectorInstance); - projectorState.renderScheduled = undefined; - var renderQueue = projectorState.renderQueue; - var renders = tslib_1.__spread(renderQueue); - projectorState.renderQueue = []; - renders.sort(function (a, b) { return a.depth - b.depth; }); - var previouslyRendered = []; - while (renders.length) { - var instance = renders.shift().instance; - if (instanceMap.has(instance) && previouslyRendered.indexOf(instance) === -1) { - previouslyRendered.push(instance); - var _a = instanceMap.get(instance), parentVNode = _a.parentVNode, dnode = _a.dnode; - var instanceData = exports.widgetInstanceMap.get(instance); - var nextSiblings = nextSiblingMap.get(instance); - updateDom(dnode, toInternalWNode(instance, instanceData), projectionOptions, parentVNode, instance, nextSiblings, nextSiblings); - } - } - runAfterRenderCallbacks(projectionOptions); - runDeferredRenderCallbacks(projectionOptions); - } - exports.dom = { - append: function (parentNode, instance, projectionOptions) { - if (projectionOptions === void 0) { projectionOptions = {}; } - var instanceData = exports.widgetInstanceMap.get(instance); - var finalProjectorOptions = getProjectionOptions(projectionOptions, instance); - var projectorState = { - afterRenderCallbacks: [], - deferredRenderCallbacks: [], - nodeMap: new WeakMap_1.default(), - renderScheduled: undefined, - renderQueue: [], - merge: projectionOptions.merge || false, - mergeElement: projectionOptions.mergeElement - }; - projectorStateMap.set(instance, projectorState); - finalProjectorOptions.rootNode = parentNode; - var parentVNode = toParentVNode(finalProjectorOptions.rootNode); - var node = toInternalWNode(instance, instanceData); - instanceMap.set(instance, { dnode: node, parentVNode: parentVNode }); - instanceData.invalidate = function () { - instanceData.dirty = true; - if (instanceData.rendering === false) { - projectorState.renderQueue.push({ instance: instance, depth: finalProjectorOptions.depth }); - scheduleRender(finalProjectorOptions); - } - }; - updateDom(node, node, finalProjectorOptions, parentVNode, instance, [], []); - projectorState.afterRenderCallbacks.push(function () { - instanceData.onAttach(); - }); - runDeferredRenderCallbacks(finalProjectorOptions); - runAfterRenderCallbacks(finalProjectorOptions); - return { - domNode: finalProjectorOptions.rootNode - }; - }, - create: function (instance, projectionOptions) { - return this.append(document.createElement('div'), instance, projectionOptions); - }, - merge: function (element, instance, projectionOptions) { - if (projectionOptions === void 0) { projectionOptions = {}; } - projectionOptions.merge = true; - projectionOptions.mergeElement = element; - var projection = this.append(element.parentNode, instance, projectionOptions); - var projectorState = projectorStateMap.get(instance); - projectorState.merge = false; - return projection; - } - }; -}); -//# sourceMappingURL=vdom.js.map \ No newline at end of file diff --git a/deps/framework/widget-core/vdom.js.map b/deps/framework/widget-core/vdom.js.map deleted file mode 100644 index 9583b7f5b8..0000000000 --- a/deps/framework/widget-core/vdom.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"vdom.js","sourceRoot":"","sources":["vdom.ts"],"names":[],"mappings":";;;;;;;;;;;;IAAA,yCAAoC;IAapC,uCAAkD;IAClD,yBAAiE;IACjE,uCAAqD;IACrD,2CAAsC;IAItC,IAAM,YAAY,GAAG,oBAAoB,CAAC;IAC1C,IAAM,aAAa,GAAG,YAAY,GAAG,UAAU,CAAC;IAChD,IAAM,eAAe,GAAG,YAAY,GAAG,YAAY,CAAC;IAEpD,IAAM,UAAU,GAAsC,EAAE,CAAC;IAEzD,IAAM,cAAc,GAAG,CAAC,OAAO,EAAE,MAAM,EAAE,gBAAgB,EAAE,OAAO,CAAC,CAAC;IA+EvD,QAAA,iBAAiB,GAAG,IAAI,iBAAO,EAAmB,CAAC;IAEhE,IAAM,WAAW,GAAG,IAAI,iBAAO,EAA+C,CAAC;IAC/E,IAAM,cAAc,GAAG,IAAI,iBAAO,EAA+C,CAAC;IAClF,IAAM,iBAAiB,GAAG,IAAI,iBAAO,EAA8C,CAAC;IAEpF,cAAc,MAAqB,EAAE,MAAqB;QACzD,EAAE,CAAC,CAAC,WAAO,CAAC,MAAM,CAAC,IAAI,WAAO,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;YACxC,EAAE,CAAC,CAAC,cAAU,CAAC,MAAM,CAAC,IAAI,cAAU,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;gBAC9C,EAAE,CAAC,CAAC,MAAM,CAAC,OAAO,KAAK,MAAM,CAAC,OAA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C;YACzC,IAAM,UAAU,GAAG,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,UAAqB,EAAE,QAAQ,EAAE,iBAAiB,CAAC,CAAC;YAC3F,IAAM,cAAc,GAAG,iBAAiB,CAAC,GAAG,CAAC,QAAQ,CAAE,CAAC;YACxD,cAAc,CAAC,KAAK,GAAG,KAAK,CAAC;YAC7B,MAAM,CAAC,UAAU,CAAC;QACnB,CAAC;KACD,CAAC","sourcesContent":["import global from '../shim/global';\nimport {\n\tCoreProperties,\n\tDefaultWidgetBaseInterface,\n\tDNode,\n\tVNode,\n\tWNode,\n\tProjectionOptions,\n\tProjection,\n\tSupportedClassName,\n\tTransitionStrategy,\n\tVNodeProperties\n} from './interfaces';\nimport { from as arrayFrom } from '../shim/array';\nimport { isWNode, isVNode, isDomVNode, VNODE, WNODE } from './d';\nimport { isWidgetBaseConstructor } from './Registry';\nimport WeakMap from '../shim/WeakMap';\nimport NodeHandler from './NodeHandler';\nimport RegistryHandler from './RegistryHandler';\n\nconst NAMESPACE_W3 = 'http://www.w3.org/';\nconst NAMESPACE_SVG = NAMESPACE_W3 + '2000/svg';\nconst NAMESPACE_XLINK = NAMESPACE_W3 + '1999/xlink';\n\nconst emptyArray: (InternalWNode | InternalVNode)[] = [];\n\nconst nodeOperations = ['focus', 'blur', 'scrollIntoView', 'click'];\n\nexport type RenderResult = DNode | DNode[];\n\ninterface InstanceMapData {\n\tparentVNode: InternalVNode;\n\tdnode: InternalWNode;\n}\n\nexport interface InternalWNode extends WNode {\n\t/**\n\t * The instance of the widget\n\t */\n\tinstance: DefaultWidgetBaseInterface;\n\n\t/**\n\t * The rendered DNodes from the instance\n\t */\n\trendered: InternalDNode[];\n\n\t/**\n\t * Core properties that are used by the widget core system\n\t */\n\tcoreProperties: CoreProperties;\n\n\t/**\n\t * Children for the WNode\n\t */\n\tchildren: InternalDNode[];\n}\n\nexport interface InternalVNode extends VNode {\n\t/**\n\t * Children for the VNode\n\t */\n\tchildren?: InternalDNode[];\n\n\tinserted?: boolean;\n\n\t/**\n\t * Bag used to still decorate properties on a deferred properties callback\n\t */\n\tdecoratedDeferredProperties?: VNodeProperties;\n\n\t/**\n\t * DOM element\n\t */\n\tdomNode?: Element | Text;\n}\n\nexport type InternalDNode = InternalVNode | InternalWNode;\n\nexport interface RenderQueue {\n\tinstance: DefaultWidgetBaseInterface;\n\tdepth: number;\n}\n\nexport interface WidgetData {\n\tonDetach: () => void;\n\tonAttach: () => void;\n\tdirty: boolean;\n\tregistry: () => RegistryHandler;\n\tnodeHandler: NodeHandler;\n\tcoreProperties: CoreProperties;\n\tinvalidate?: Function;\n\trendering: boolean;\n\tinputProperties: any;\n}\n\ninterface ProjectorState {\n\tdeferredRenderCallbacks: Function[];\n\tafterRenderCallbacks: Function[];\n\tnodeMap: WeakMap>;\n\trenderScheduled?: number;\n\trenderQueue: RenderQueue[];\n\tmerge: boolean;\n\tmergeElement?: Node;\n}\n\nexport const widgetInstanceMap = new WeakMap();\n\nconst instanceMap = new WeakMap();\nconst nextSiblingMap = new WeakMap();\nconst projectorStateMap = new WeakMap();\n\nfunction same(dnode1: InternalDNode, dnode2: InternalDNode) {\n\tif (isVNode(dnode1) && isVNode(dnode2)) {\n\t\tif (isDomVNode(dnode1) || isDomVNode(dnode2)) {\n\t\t\tif (dnode1.domNode !== dnode2.domNode) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\tif (dnode1.tag !== dnode2.tag) {\n\t\t\treturn false;\n\t\t}\n\t\tif (dnode1.properties.key !== dnode2.properties.key) {\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t} else if (isWNode(dnode1) && isWNode(dnode2)) {\n\t\tif (dnode1.instance === undefined && typeof dnode2.widgetConstructor === 'string') {\n\t\t\treturn false;\n\t\t}\n\t\tif (dnode1.widgetConstructor !== dnode2.widgetConstructor) {\n\t\t\treturn false;\n\t\t}\n\t\tif (dnode1.properties.key !== dnode2.properties.key) {\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}\n\treturn false;\n}\n\nconst missingTransition = function() {\n\tthrow new Error('Provide a transitions object to the projectionOptions to do animations');\n};\n\nfunction getProjectionOptions(\n\tprojectorOptions: Partial,\n\tprojectorInstance: DefaultWidgetBaseInterface\n): ProjectionOptions {\n\tconst defaults: Partial = {\n\t\tnamespace: undefined,\n\t\tstyleApplyer: function(domNode: HTMLElement, styleName: string, value: string) {\n\t\t\t(domNode.style as any)[styleName] = value;\n\t\t},\n\t\ttransitions: {\n\t\t\tenter: missingTransition,\n\t\t\texit: missingTransition\n\t\t},\n\t\tdepth: 0,\n\t\tmerge: false,\n\t\tsync: false,\n\t\tprojectorInstance\n\t};\n\treturn { ...defaults, ...projectorOptions } as ProjectionOptions;\n}\n\nfunction checkStyleValue(styleValue: Object) {\n\tif (typeof styleValue !== 'string') {\n\t\tthrow new Error('Style values must be strings');\n\t}\n}\n\nfunction updateEvent(\n\tdomNode: Node,\n\teventName: string,\n\tcurrentValue: Function,\n\tprojectionOptions: ProjectionOptions,\n\tbind: any,\n\tpreviousValue?: Function\n) {\n\tconst projectorState = projectorStateMap.get(projectionOptions.projectorInstance)!;\n\tconst eventMap = projectorState.nodeMap.get(domNode) || new WeakMap();\n\n\tif (previousValue) {\n\t\tconst previousEvent = eventMap.get(previousValue);\n\t\tdomNode.removeEventListener(eventName, previousEvent);\n\t}\n\n\tlet callback = currentValue.bind(bind);\n\n\tif (eventName === 'input') {\n\t\tcallback = function(this: any, evt: Event) {\n\t\t\tcurrentValue.call(this, evt);\n\t\t\t(evt.target as any)['oninput-value'] = (evt.target as HTMLInputElement).value;\n\t\t}.bind(bind);\n\t}\n\n\tdomNode.addEventListener(eventName, callback);\n\teventMap.set(currentValue, callback);\n\tprojectorState.nodeMap.set(domNode, eventMap);\n}\n\nfunction addClasses(domNode: Element, classes: SupportedClassName) {\n\tif (classes) {\n\t\tconst classNames = classes.split(' ');\n\t\tfor (let i = 0; i < classNames.length; i++) {\n\t\t\tdomNode.classList.add(classNames[i]);\n\t\t}\n\t}\n}\n\nfunction removeClasses(domNode: Element, classes: SupportedClassName) {\n\tif (classes) {\n\t\tconst classNames = classes.split(' ');\n\t\tfor (let i = 0; i < classNames.length; i++) {\n\t\t\tdomNode.classList.remove(classNames[i]);\n\t\t}\n\t}\n}\n\nfunction buildPreviousProperties(domNode: any, previous: InternalVNode, current: InternalVNode) {\n\tconst { diffType, properties, attributes } = current;\n\tif (!diffType || diffType === 'vdom') {\n\t\treturn { properties: previous.properties, attributes: previous.attributes, events: previous.events };\n\t} else if (diffType === 'none') {\n\t\treturn { properties: {}, attributes: previous.attributes ? {} : undefined, events: previous.events };\n\t}\n\tlet newProperties: any = {\n\t\tproperties: {}\n\t};\n\tif (attributes) {\n\t\tnewProperties.attributes = {};\n\t\tnewProperties.events = previous.events;\n\t\tObject.keys(properties).forEach((propName) => {\n\t\t\tnewProperties.properties[propName] = domNode[propName];\n\t\t});\n\t\tObject.keys(attributes).forEach((attrName) => {\n\t\t\tnewProperties.attributes[attrName] = domNode.getAttribute(attrName);\n\t\t});\n\t\treturn newProperties;\n\t}\n\tnewProperties.properties = Object.keys(properties).reduce(\n\t\t(props, property) => {\n\t\t\tprops[property] = domNode.getAttribute(property) || domNode[property];\n\t\t\treturn props;\n\t\t},\n\t\t{} as any\n\t);\n\treturn newProperties;\n}\n\nfunction nodeOperation(\n\tpropName: string,\n\tpropValue: any,\n\tpreviousValue: any,\n\tdomNode: Element,\n\tprojectionOptions: ProjectionOptions\n): void {\n\tlet result;\n\tif (typeof propValue === 'function') {\n\t\tresult = propValue();\n\t} else {\n\t\tresult = propValue && !previousValue;\n\t}\n\tif (result === true) {\n\t\tconst projectorState = projectorStateMap.get(projectionOptions.projectorInstance)!;\n\t\tprojectorState.deferredRenderCallbacks.push(() => {\n\t\t\t(domNode as any)[propName]();\n\t\t});\n\t}\n}\n\nfunction removeOrphanedEvents(\n\tdomNode: Element,\n\tpreviousProperties: VNodeProperties,\n\tproperties: VNodeProperties,\n\tprojectionOptions: ProjectionOptions,\n\tonlyEvents: boolean = false\n) {\n\tconst projectorState = projectorStateMap.get(projectionOptions.projectorInstance)!;\n\tconst eventMap = projectorState.nodeMap.get(domNode);\n\tif (eventMap) {\n\t\tObject.keys(previousProperties).forEach((propName) => {\n\t\t\tconst isEvent = propName.substr(0, 2) === 'on' || onlyEvents;\n\t\t\tconst eventName = onlyEvents ? propName : propName.substr(2);\n\t\t\tif (isEvent && !properties[propName]) {\n\t\t\t\tconst eventCallback = eventMap.get(previousProperties[propName]);\n\t\t\t\tif (eventCallback) {\n\t\t\t\t\tdomNode.removeEventListener(eventName, eventCallback);\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t}\n}\n\nfunction updateAttribute(domNode: Element, attrName: string, attrValue: string, projectionOptions: ProjectionOptions) {\n\tif (projectionOptions.namespace === NAMESPACE_SVG && attrName === 'href') {\n\t\tdomNode.setAttributeNS(NAMESPACE_XLINK, attrName, attrValue);\n\t} else if ((attrName === 'role' && attrValue === '') || attrValue === undefined) {\n\t\tdomNode.removeAttribute(attrName);\n\t} else {\n\t\tdomNode.setAttribute(attrName, attrValue);\n\t}\n}\n\nfunction updateAttributes(\n\tdomNode: Element,\n\tpreviousAttributes: { [index: string]: string },\n\tattributes: { [index: string]: string },\n\tprojectionOptions: ProjectionOptions\n) {\n\tconst attrNames = Object.keys(attributes);\n\tconst attrCount = attrNames.length;\n\tfor (let i = 0; i < attrCount; i++) {\n\t\tconst attrName = attrNames[i];\n\t\tconst attrValue = attributes[attrName];\n\t\tconst previousAttrValue = previousAttributes[attrName];\n\t\tif (attrValue !== previousAttrValue) {\n\t\t\tupdateAttribute(domNode, attrName, attrValue, projectionOptions);\n\t\t}\n\t}\n}\n\nfunction updateProperties(\n\tdomNode: Element,\n\tpreviousProperties: VNodeProperties,\n\tproperties: VNodeProperties,\n\tprojectionOptions: ProjectionOptions,\n\tincludesEventsAndAttributes = true\n) {\n\tlet propertiesUpdated = false;\n\tconst propNames = Object.keys(properties);\n\tconst propCount = propNames.length;\n\tif (propNames.indexOf('classes') === -1 && previousProperties.classes) {\n\t\tif (Array.isArray(previousProperties.classes)) {\n\t\t\tfor (let i = 0; i < previousProperties.classes.length; i++) {\n\t\t\t\tremoveClasses(domNode, previousProperties.classes[i]);\n\t\t\t}\n\t\t} else {\n\t\t\tremoveClasses(domNode, previousProperties.classes);\n\t\t}\n\t}\n\n\tincludesEventsAndAttributes && removeOrphanedEvents(domNode, previousProperties, properties, projectionOptions);\n\n\tfor (let i = 0; i < propCount; i++) {\n\t\tconst propName = propNames[i];\n\t\tlet propValue = properties[propName];\n\t\tconst previousValue = previousProperties![propName];\n\t\tif (propName === 'classes') {\n\t\t\tconst previousClasses = Array.isArray(previousValue) ? previousValue : [previousValue];\n\t\t\tconst currentClasses = Array.isArray(propValue) ? propValue : [propValue];\n\t\t\tif (previousClasses && previousClasses.length > 0) {\n\t\t\t\tif (!propValue || propValue.length === 0) {\n\t\t\t\t\tfor (let i = 0; i < previousClasses.length; i++) {\n\t\t\t\t\t\tremoveClasses(domNode, previousClasses[i]);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tconst newClasses: (null | undefined | string)[] = [...currentClasses];\n\t\t\t\t\tfor (let i = 0; i < previousClasses.length; i++) {\n\t\t\t\t\t\tconst previousClassName = previousClasses[i];\n\t\t\t\t\t\tif (previousClassName) {\n\t\t\t\t\t\t\tconst classIndex = newClasses.indexOf(previousClassName);\n\t\t\t\t\t\t\tif (classIndex === -1) {\n\t\t\t\t\t\t\t\tremoveClasses(domNode, previousClassName);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tnewClasses.splice(classIndex, 1);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tfor (let i = 0; i < newClasses.length; i++) {\n\t\t\t\t\t\taddClasses(domNode, newClasses[i]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tfor (let i = 0; i < currentClasses.length; i++) {\n\t\t\t\t\taddClasses(domNode, currentClasses[i]);\n\t\t\t\t}\n\t\t\t}\n\t\t} else if (nodeOperations.indexOf(propName) !== -1) {\n\t\t\tnodeOperation(propName, propValue, previousValue, domNode, projectionOptions);\n\t\t} else if (propName === 'styles') {\n\t\t\tconst styleNames = Object.keys(propValue);\n\t\t\tconst styleCount = styleNames.length;\n\t\t\tfor (let j = 0; j < styleCount; j++) {\n\t\t\t\tconst styleName = styleNames[j];\n\t\t\t\tconst newStyleValue = propValue[styleName];\n\t\t\t\tconst oldStyleValue = previousValue && previousValue[styleName];\n\t\t\t\tif (newStyleValue === oldStyleValue) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tpropertiesUpdated = true;\n\t\t\t\tif (newStyleValue) {\n\t\t\t\t\tcheckStyleValue(newStyleValue);\n\t\t\t\t\tprojectionOptions.styleApplyer!(domNode as HTMLElement, styleName, newStyleValue);\n\t\t\t\t} else {\n\t\t\t\t\tprojectionOptions.styleApplyer!(domNode as HTMLElement, styleName, '');\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tif (!propValue && typeof previousValue === 'string') {\n\t\t\t\tpropValue = '';\n\t\t\t}\n\t\t\tif (propName === 'value') {\n\t\t\t\tconst domValue = (domNode as any)[propName];\n\t\t\t\tif (\n\t\t\t\t\tdomValue !== propValue &&\n\t\t\t\t\t((domNode as any)['oninput-value']\n\t\t\t\t\t\t? domValue === (domNode as any)['oninput-value']\n\t\t\t\t\t\t: propValue !== previousValue)\n\t\t\t\t) {\n\t\t\t\t\t(domNode as any)[propName] = propValue;\n\t\t\t\t\t(domNode as any)['oninput-value'] = undefined;\n\t\t\t\t}\n\t\t\t\tif (propValue !== previousValue) {\n\t\t\t\t\tpropertiesUpdated = true;\n\t\t\t\t}\n\t\t\t} else if (propName !== 'key' && propValue !== previousValue) {\n\t\t\t\tconst type = typeof propValue;\n\t\t\t\tif (type === 'function' && propName.lastIndexOf('on', 0) === 0 && includesEventsAndAttributes) {\n\t\t\t\t\tupdateEvent(\n\t\t\t\t\t\tdomNode,\n\t\t\t\t\t\tpropName.substr(2),\n\t\t\t\t\t\tpropValue,\n\t\t\t\t\t\tprojectionOptions,\n\t\t\t\t\t\tproperties.bind,\n\t\t\t\t\t\tpreviousValue\n\t\t\t\t\t);\n\t\t\t\t} else if (type === 'string' && propName !== 'innerHTML' && includesEventsAndAttributes) {\n\t\t\t\t\tupdateAttribute(domNode, propName, propValue, projectionOptions);\n\t\t\t\t} else if (propName === 'scrollLeft' || propName === 'scrollTop') {\n\t\t\t\t\tif ((domNode as any)[propName] !== propValue) {\n\t\t\t\t\t\t(domNode as any)[propName] = propValue;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t(domNode as any)[propName] = propValue;\n\t\t\t\t}\n\t\t\t\tpropertiesUpdated = true;\n\t\t\t}\n\t\t}\n\t}\n\treturn propertiesUpdated;\n}\n\nfunction findIndexOfChild(children: InternalDNode[], sameAs: InternalDNode, start: number) {\n\tfor (let i = start; i < children.length; i++) {\n\t\tif (same(children[i], sameAs)) {\n\t\t\treturn i;\n\t\t}\n\t}\n\treturn -1;\n}\n\nexport function toParentVNode(domNode: Element): InternalVNode {\n\treturn {\n\t\ttag: '',\n\t\tproperties: {},\n\t\tchildren: undefined,\n\t\tdomNode,\n\t\ttype: VNODE\n\t};\n}\n\nexport function toTextVNode(data: any): InternalVNode {\n\treturn {\n\t\ttag: '',\n\t\tproperties: {},\n\t\tchildren: undefined,\n\t\ttext: `${data}`,\n\t\tdomNode: undefined,\n\t\ttype: VNODE\n\t};\n}\n\nfunction toInternalWNode(instance: DefaultWidgetBaseInterface, instanceData: WidgetData): InternalWNode {\n\treturn {\n\t\tinstance,\n\t\trendered: [],\n\t\tcoreProperties: instanceData.coreProperties,\n\t\tchildren: instance.children as any,\n\t\twidgetConstructor: instance.constructor as any,\n\t\tproperties: instanceData.inputProperties,\n\t\ttype: WNODE\n\t};\n}\n\nexport function filterAndDecorateChildren(\n\tchildren: undefined | DNode | DNode[],\n\tinstance: DefaultWidgetBaseInterface\n): InternalDNode[] {\n\tif (children === undefined) {\n\t\treturn emptyArray;\n\t}\n\tchildren = Array.isArray(children) ? children : [children];\n\n\tfor (let i = 0; i < children.length; ) {\n\t\tconst child = children[i] as InternalDNode;\n\t\tif (child === undefined || child === null) {\n\t\t\tchildren.splice(i, 1);\n\t\t\tcontinue;\n\t\t} else if (typeof child === 'string') {\n\t\t\tchildren[i] = toTextVNode(child);\n\t\t} else {\n\t\t\tif (isVNode(child)) {\n\t\t\t\tif (child.properties.bind === undefined) {\n\t\t\t\t\t(child.properties as any).bind = instance;\n\t\t\t\t\tif (child.children && child.children.length > 0) {\n\t\t\t\t\t\tfilterAndDecorateChildren(child.children, instance);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (!child.coreProperties) {\n\t\t\t\t\tconst instanceData = widgetInstanceMap.get(instance)!;\n\t\t\t\t\tchild.coreProperties = {\n\t\t\t\t\t\tbind: instance,\n\t\t\t\t\t\tbaseRegistry: instanceData.coreProperties.baseRegistry\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t\tif (child.children && child.children.length > 0) {\n\t\t\t\t\tfilterAndDecorateChildren(child.children, instance);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\ti++;\n\t}\n\treturn children as InternalDNode[];\n}\n\nfunction nodeAdded(dnode: InternalDNode, transitions: TransitionStrategy) {\n\tif (isVNode(dnode) && dnode.properties) {\n\t\tconst enterAnimation = dnode.properties.enterAnimation;\n\t\tif (enterAnimation) {\n\t\t\tif (typeof enterAnimation === 'function') {\n\t\t\t\tenterAnimation(dnode.domNode as Element, dnode.properties);\n\t\t\t} else {\n\t\t\t\ttransitions.enter(dnode.domNode as Element, dnode.properties, enterAnimation as string);\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunction nodeToRemove(dnode: InternalDNode, transitions: TransitionStrategy, projectionOptions: ProjectionOptions) {\n\tif (isWNode(dnode)) {\n\t\tconst item = instanceMap.get(dnode.instance);\n\t\tconst rendered = (item ? item.dnode.rendered : dnode.rendered) || emptyArray;\n\t\tif (dnode.instance) {\n\t\t\tconst instanceData = widgetInstanceMap.get(dnode.instance)!;\n\t\t\tinstanceData.onDetach();\n\t\t\tinstanceMap.delete(dnode.instance);\n\t\t}\n\t\tfor (let i = 0; i < rendered.length; i++) {\n\t\t\tnodeToRemove(rendered[i], transitions, projectionOptions);\n\t\t}\n\t} else {\n\t\tconst domNode = dnode.domNode;\n\t\tconst properties = dnode.properties;\n\t\tif (dnode.children && dnode.children.length > 0) {\n\t\t\tfor (let i = 0; i < dnode.children.length; i++) {\n\t\t\t\tnodeToRemove(dnode.children[i], transitions, projectionOptions);\n\t\t\t}\n\t\t}\n\t\tconst exitAnimation = properties.exitAnimation;\n\t\tif (properties && exitAnimation) {\n\t\t\t(domNode as HTMLElement).style.pointerEvents = 'none';\n\t\t\tconst removeDomNode = function() {\n\t\t\t\tdomNode && domNode.parentNode && domNode.parentNode.removeChild(domNode);\n\t\t\t\tdnode.domNode = undefined;\n\t\t\t};\n\t\t\tif (typeof exitAnimation === 'function') {\n\t\t\t\texitAnimation(domNode as Element, removeDomNode, properties);\n\t\t\t\treturn;\n\t\t\t} else {\n\t\t\t\ttransitions.exit(dnode.domNode as Element, properties, exitAnimation as string, removeDomNode);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\tdomNode && domNode.parentNode && domNode.parentNode.removeChild(domNode);\n\t\tdnode.domNode = undefined;\n\t}\n}\n\nfunction checkDistinguishable(\n\tchildNodes: InternalDNode[],\n\tindexToCheck: number,\n\tparentInstance: DefaultWidgetBaseInterface\n) {\n\tconst childNode = childNodes[indexToCheck];\n\tif (isVNode(childNode) && !childNode.tag) {\n\t\treturn; // Text nodes need not be distinguishable\n\t}\n\tconst { key } = childNode.properties;\n\n\tif (key === undefined || key === null) {\n\t\tfor (let i = 0; i < childNodes.length; i++) {\n\t\t\tif (i !== indexToCheck) {\n\t\t\t\tconst node = childNodes[i];\n\t\t\t\tif (same(node, childNode)) {\n\t\t\t\t\tlet nodeIdentifier: string;\n\t\t\t\t\tconst parentName = (parentInstance as any).constructor.name || 'unknown';\n\t\t\t\t\tif (isWNode(childNode)) {\n\t\t\t\t\t\tnodeIdentifier = (childNode.widgetConstructor as any).name || 'unknown';\n\t\t\t\t\t} else {\n\t\t\t\t\t\tnodeIdentifier = childNode.tag;\n\t\t\t\t\t}\n\n\t\t\t\t\tconsole.warn(\n\t\t\t\t\t\t`A widget (${parentName}) has had a child addded or removed, but they were not able to uniquely identified. It is recommended to provide a unique 'key' property when using the same widget or element (${nodeIdentifier}) multiple times as siblings`\n\t\t\t\t\t);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunction updateChildren(\n\tparentVNode: InternalVNode,\n\tsiblings: InternalDNode[],\n\toldChildren: InternalDNode[],\n\tnewChildren: InternalDNode[],\n\tparentInstance: DefaultWidgetBaseInterface,\n\tprojectionOptions: ProjectionOptions\n) {\n\toldChildren = oldChildren || emptyArray;\n\tnewChildren = newChildren;\n\tconst oldChildrenLength = oldChildren.length;\n\tconst newChildrenLength = newChildren.length;\n\tconst transitions = projectionOptions.transitions!;\n\tconst projectorState = projectorStateMap.get(projectionOptions.projectorInstance)!;\n\tprojectionOptions = { ...projectionOptions, depth: projectionOptions.depth + 1 };\n\tlet oldIndex = 0;\n\tlet newIndex = 0;\n\tlet i: number;\n\tlet textUpdated = false;\n\twhile (newIndex < newChildrenLength) {\n\t\tlet oldChild = oldIndex < oldChildrenLength ? oldChildren[oldIndex] : undefined;\n\t\tconst newChild = newChildren[newIndex];\n\t\tif (isVNode(newChild) && typeof newChild.deferredPropertiesCallback === 'function') {\n\t\t\tnewChild.inserted = isVNode(oldChild) && oldChild.inserted;\n\t\t\taddDeferredProperties(newChild, projectionOptions);\n\t\t}\n\t\tif (oldChild !== undefined && same(oldChild, newChild)) {\n\t\t\toldIndex++;\n\t\t\tnewIndex++;\n\t\t\ttextUpdated =\n\t\t\t\tupdateDom(\n\t\t\t\t\toldChild,\n\t\t\t\t\tnewChild,\n\t\t\t\t\tprojectionOptions,\n\t\t\t\t\tparentVNode,\n\t\t\t\t\tparentInstance,\n\t\t\t\t\toldChildren.slice(oldIndex),\n\t\t\t\t\tnewChildren.slice(newIndex)\n\t\t\t\t) || textUpdated;\n\t\t\tcontinue;\n\t\t}\n\n\t\tconst findOldIndex = findIndexOfChild(oldChildren, newChild, oldIndex + 1);\n\t\tconst addChild = () => {\n\t\t\tlet insertBeforeDomNode: Node | undefined = undefined;\n\t\t\tlet childrenArray = oldChildren;\n\t\t\tlet nextIndex = oldIndex + 1;\n\t\t\tlet child: InternalDNode = oldChildren[oldIndex];\n\t\t\tif (!child) {\n\t\t\t\tchild = siblings[0];\n\t\t\t\tnextIndex = 1;\n\t\t\t\tchildrenArray = siblings;\n\t\t\t}\n\t\t\tif (child) {\n\t\t\t\tlet insertBeforeChildren = [child];\n\t\t\t\twhile (insertBeforeChildren.length) {\n\t\t\t\t\tconst insertBefore = insertBeforeChildren.shift()!;\n\t\t\t\t\tif (isWNode(insertBefore)) {\n\t\t\t\t\t\tconst item = instanceMap.get(insertBefore.instance);\n\t\t\t\t\t\tif (item && item.dnode.rendered) {\n\t\t\t\t\t\t\tinsertBeforeChildren.push(...item.dnode.rendered);\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (insertBefore.domNode) {\n\t\t\t\t\t\t\tif (insertBefore.domNode.parentElement !== parentVNode.domNode) {\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tinsertBeforeDomNode = insertBefore.domNode;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (insertBeforeChildren.length === 0 && childrenArray[nextIndex]) {\n\t\t\t\t\t\tinsertBeforeChildren.push(childrenArray[nextIndex]);\n\t\t\t\t\t\tnextIndex++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tcreateDom(\n\t\t\t\tnewChild,\n\t\t\t\tparentVNode,\n\t\t\t\tnewChildren.slice(newIndex + 1),\n\t\t\t\tinsertBeforeDomNode,\n\t\t\t\tprojectionOptions,\n\t\t\t\tparentInstance\n\t\t\t);\n\t\t\tnodeAdded(newChild, transitions);\n\t\t\tconst indexToCheck = newIndex;\n\t\t\tprojectorState.afterRenderCallbacks.push(() => {\n\t\t\t\tcheckDistinguishable(newChildren, indexToCheck, parentInstance);\n\t\t\t});\n\t\t};\n\n\t\tif (!oldChild || findOldIndex === -1) {\n\t\t\taddChild();\n\t\t\tnewIndex++;\n\t\t\tcontinue;\n\t\t}\n\n\t\tconst removeChild = () => {\n\t\t\tconst indexToCheck = oldIndex;\n\t\t\tprojectorState.afterRenderCallbacks.push(() => {\n\t\t\t\tcheckDistinguishable(oldChildren, indexToCheck, parentInstance);\n\t\t\t});\n\t\t\tif (isWNode(oldChild)) {\n\t\t\t\tconst item = instanceMap.get(oldChild.instance);\n\t\t\t\tif (item) {\n\t\t\t\t\toldChild = item.dnode;\n\t\t\t\t}\n\t\t\t}\n\t\t\tnodeToRemove(oldChild!, transitions, projectionOptions);\n\t\t};\n\t\tconst findNewIndex = findIndexOfChild(newChildren, oldChild, newIndex + 1);\n\n\t\tif (findNewIndex === -1) {\n\t\t\tremoveChild();\n\t\t\toldIndex++;\n\t\t\tcontinue;\n\t\t}\n\n\t\taddChild();\n\t\tremoveChild();\n\t\toldIndex++;\n\t\tnewIndex++;\n\t}\n\tif (oldChildrenLength > oldIndex) {\n\t\t// Remove child fragments\n\t\tfor (i = oldIndex; i < oldChildrenLength; i++) {\n\t\t\tconst indexToCheck = i;\n\t\t\tprojectorState.afterRenderCallbacks.push(() => {\n\t\t\t\tcheckDistinguishable(oldChildren, indexToCheck, parentInstance);\n\t\t\t});\n\t\t\tlet childToRemove = oldChildren[i];\n\t\t\tif (isWNode(childToRemove)) {\n\t\t\t\tconst item = instanceMap.get(childToRemove.instance);\n\t\t\t\tif (item) {\n\t\t\t\t\tchildToRemove = item.dnode;\n\t\t\t\t}\n\t\t\t}\n\t\t\tnodeToRemove(childToRemove, transitions, projectionOptions);\n\t\t}\n\t}\n\treturn textUpdated;\n}\n\nfunction addChildren(\n\tparentVNode: InternalVNode,\n\tchildren: InternalDNode[] | undefined,\n\tprojectionOptions: ProjectionOptions,\n\tparentInstance: DefaultWidgetBaseInterface,\n\tinsertBefore: Node | undefined = undefined,\n\tchildNodes?: (Element | Text)[]\n) {\n\tif (children === undefined) {\n\t\treturn;\n\t}\n\n\tconst projectorState = projectorStateMap.get(projectionOptions.projectorInstance)!;\n\tif (projectorState.merge && childNodes === undefined) {\n\t\tchildNodes = arrayFrom(parentVNode.domNode!.childNodes) as (Element | Text)[];\n\t}\n\tconst transitions = projectionOptions.transitions!;\n\tprojectionOptions = { ...projectionOptions, depth: projectionOptions.depth + 1 };\n\n\tfor (let i = 0; i < children.length; i++) {\n\t\tconst child = children[i];\n\t\tconst nextSiblings = children.slice(i + 1);\n\n\t\tif (isVNode(child)) {\n\t\t\tif (projectorState.merge && childNodes) {\n\t\t\t\tlet domElement: Element | undefined = undefined;\n\t\t\t\twhile (child.domNode === undefined && childNodes.length > 0) {\n\t\t\t\t\tdomElement = childNodes.shift() as Element;\n\t\t\t\t\tif (domElement && domElement.tagName === (child.tag.toUpperCase() || undefined)) {\n\t\t\t\t\t\tchild.domNode = domElement;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tcreateDom(child, parentVNode, nextSiblings, insertBefore, projectionOptions, parentInstance);\n\t\t} else {\n\t\t\tcreateDom(child, parentVNode, nextSiblings, insertBefore, projectionOptions, parentInstance, childNodes);\n\t\t}\n\t\tnodeAdded(child, transitions);\n\t}\n}\n\nfunction initPropertiesAndChildren(\n\tdomNode: Element,\n\tdnode: InternalVNode,\n\tparentInstance: DefaultWidgetBaseInterface,\n\tprojectionOptions: ProjectionOptions\n) {\n\taddChildren(dnode, dnode.children, projectionOptions, parentInstance, undefined);\n\tif (typeof dnode.deferredPropertiesCallback === 'function' && dnode.inserted === undefined) {\n\t\taddDeferredProperties(dnode, projectionOptions);\n\t}\n\n\tif (dnode.attributes && dnode.events) {\n\t\tupdateAttributes(domNode, {}, dnode.attributes, projectionOptions);\n\t\tupdateProperties(domNode, {}, dnode.properties, projectionOptions, false);\n\t\tremoveOrphanedEvents(domNode, {}, dnode.events, projectionOptions, true);\n\t\tconst events = dnode.events;\n\t\tObject.keys(events).forEach((event) => {\n\t\t\tupdateEvent(domNode, event, events[event], projectionOptions, dnode.properties.bind);\n\t\t});\n\t} else {\n\t\tupdateProperties(domNode, {}, dnode.properties, projectionOptions);\n\t}\n\tif (dnode.properties.key !== null && dnode.properties.key !== undefined) {\n\t\tconst instanceData = widgetInstanceMap.get(parentInstance)!;\n\t\tinstanceData.nodeHandler.add(domNode as HTMLElement, `${dnode.properties.key}`);\n\t}\n\tdnode.inserted = true;\n}\n\nfunction createDom(\n\tdnode: InternalDNode,\n\tparentVNode: InternalVNode,\n\tnextSiblings: InternalDNode[],\n\tinsertBefore: Node | undefined,\n\tprojectionOptions: ProjectionOptions,\n\tparentInstance: DefaultWidgetBaseInterface,\n\tchildNodes?: (Element | Text)[]\n) {\n\tlet domNode: Element | Text | undefined;\n\tconst projectorState = projectorStateMap.get(projectionOptions.projectorInstance)!;\n\tif (isWNode(dnode)) {\n\t\tlet { widgetConstructor } = dnode;\n\t\tconst parentInstanceData = widgetInstanceMap.get(parentInstance)!;\n\t\tif (!isWidgetBaseConstructor(widgetConstructor)) {\n\t\t\tconst item = parentInstanceData.registry().get(widgetConstructor);\n\t\t\tif (item === null) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\twidgetConstructor = item;\n\t\t}\n\t\tconst instance = new widgetConstructor();\n\t\tdnode.instance = instance;\n\t\tnextSiblingMap.set(instance, nextSiblings);\n\t\tconst instanceData = widgetInstanceMap.get(instance)!;\n\t\tinstanceData.invalidate = () => {\n\t\t\tinstanceData.dirty = true;\n\t\t\tif (instanceData.rendering === false) {\n\t\t\t\tprojectorState.renderQueue.push({ instance, depth: projectionOptions.depth });\n\t\t\t\tscheduleRender(projectionOptions);\n\t\t\t}\n\t\t};\n\t\tinstanceData.rendering = true;\n\t\tinstance.__setCoreProperties__(dnode.coreProperties);\n\t\tinstance.__setChildren__(dnode.children);\n\t\tinstance.__setProperties__(dnode.properties);\n\t\tconst rendered = instance.__render__();\n\t\tinstanceData.rendering = false;\n\t\tif (rendered) {\n\t\t\tconst filteredRendered = filterAndDecorateChildren(rendered, instance);\n\t\t\tdnode.rendered = filteredRendered;\n\t\t\taddChildren(parentVNode, filteredRendered, projectionOptions, instance, insertBefore, childNodes);\n\t\t}\n\t\tinstanceMap.set(instance, { dnode, parentVNode });\n\t\tinstanceData.nodeHandler.addRoot();\n\t\tprojectorState.afterRenderCallbacks.push(() => {\n\t\t\tinstanceData.onAttach();\n\t\t});\n\t} else {\n\t\tif (projectorState.merge && projectorState.mergeElement !== undefined) {\n\t\t\tdomNode = dnode.domNode = projectionOptions.mergeElement;\n\t\t\tprojectorState.mergeElement = undefined;\n\t\t\tinitPropertiesAndChildren(domNode!, dnode, parentInstance, projectionOptions);\n\t\t\treturn;\n\t\t}\n\t\tconst doc = parentVNode.domNode!.ownerDocument;\n\t\tif (!dnode.tag && typeof dnode.text === 'string') {\n\t\t\tif (dnode.domNode !== undefined && parentVNode.domNode) {\n\t\t\t\tconst newDomNode = dnode.domNode.ownerDocument.createTextNode(dnode.text!);\n\t\t\t\tif (parentVNode.domNode === dnode.domNode.parentNode) {\n\t\t\t\t\tparentVNode.domNode.replaceChild(newDomNode, dnode.domNode);\n\t\t\t\t} else {\n\t\t\t\t\tparentVNode.domNode.appendChild(newDomNode);\n\t\t\t\t\tdnode.domNode.parentNode && dnode.domNode.parentNode.removeChild(dnode.domNode);\n\t\t\t\t}\n\t\t\t\tdnode.domNode = newDomNode;\n\t\t\t} else {\n\t\t\t\tdomNode = dnode.domNode = doc.createTextNode(dnode.text!);\n\t\t\t\tif (insertBefore !== undefined) {\n\t\t\t\t\tparentVNode.domNode!.insertBefore(domNode, insertBefore);\n\t\t\t\t} else {\n\t\t\t\t\tparentVNode.domNode!.appendChild(domNode);\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tif (dnode.domNode === undefined) {\n\t\t\t\tif (dnode.tag === 'svg') {\n\t\t\t\t\tprojectionOptions = { ...projectionOptions, ...{ namespace: NAMESPACE_SVG } };\n\t\t\t\t}\n\t\t\t\tif (projectionOptions.namespace !== undefined) {\n\t\t\t\t\tdomNode = dnode.domNode = doc.createElementNS(projectionOptions.namespace, dnode.tag);\n\t\t\t\t} else {\n\t\t\t\t\tdomNode = dnode.domNode = dnode.domNode || doc.createElement(dnode.tag);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tdomNode = dnode.domNode;\n\t\t\t}\n\t\t\tinitPropertiesAndChildren(domNode! as Element, dnode, parentInstance, projectionOptions);\n\t\t\tif (insertBefore !== undefined) {\n\t\t\t\tparentVNode.domNode!.insertBefore(domNode, insertBefore);\n\t\t\t} else if (domNode!.parentNode !== parentVNode.domNode!) {\n\t\t\t\tparentVNode.domNode!.appendChild(domNode);\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunction updateDom(\n\tprevious: any,\n\tdnode: InternalDNode,\n\tprojectionOptions: ProjectionOptions,\n\tparentVNode: InternalVNode,\n\tparentInstance: DefaultWidgetBaseInterface,\n\toldNextSiblings: InternalDNode[],\n\tnextSiblings: InternalDNode[]\n) {\n\tif (isWNode(dnode)) {\n\t\tconst { instance } = previous;\n\t\tconst { parentVNode, dnode: node } = instanceMap.get(instance)!;\n\t\tconst previousRendered = node ? node.rendered : previous.rendered;\n\t\tconst instanceData = widgetInstanceMap.get(instance)!;\n\t\tinstanceData.rendering = true;\n\t\tinstance.__setCoreProperties__(dnode.coreProperties);\n\t\tinstance.__setChildren__(dnode.children);\n\t\tinstance.__setProperties__(dnode.properties);\n\t\tnextSiblingMap.set(instance, nextSiblings);\n\t\tdnode.instance = instance;\n\t\tif (instanceData.dirty === true) {\n\t\t\tconst rendered = instance.__render__();\n\t\t\tinstanceData.rendering = false;\n\t\t\tdnode.rendered = filterAndDecorateChildren(rendered, instance);\n\t\t\tupdateChildren(parentVNode, oldNextSiblings, previousRendered, dnode.rendered, instance, projectionOptions);\n\t\t} else {\n\t\t\tinstanceData.rendering = false;\n\t\t\tdnode.rendered = previousRendered;\n\t\t}\n\t\tinstanceMap.set(instance, { dnode, parentVNode });\n\t\tinstanceData.nodeHandler.addRoot();\n\t} else {\n\t\tif (previous === dnode) {\n\t\t\treturn false;\n\t\t}\n\t\tconst domNode = (dnode.domNode = previous.domNode);\n\t\tlet textUpdated = false;\n\t\tlet updated = false;\n\t\tif (!dnode.tag && typeof dnode.text === 'string') {\n\t\t\tif (dnode.text !== previous.text) {\n\t\t\t\tconst newDomNode = domNode.ownerDocument.createTextNode(dnode.text!);\n\t\t\t\tdomNode.parentNode!.replaceChild(newDomNode, domNode);\n\t\t\t\tdnode.domNode = newDomNode;\n\t\t\t\ttextUpdated = true;\n\t\t\t\treturn textUpdated;\n\t\t\t}\n\t\t} else {\n\t\t\tif (dnode.tag && dnode.tag.lastIndexOf('svg', 0) === 0) {\n\t\t\t\tprojectionOptions = { ...projectionOptions, ...{ namespace: NAMESPACE_SVG } };\n\t\t\t}\n\t\t\tif (previous.children !== dnode.children) {\n\t\t\t\tconst children = filterAndDecorateChildren(dnode.children, parentInstance);\n\t\t\t\tdnode.children = children;\n\t\t\t\tupdated =\n\t\t\t\t\tupdateChildren(\n\t\t\t\t\t\tdnode,\n\t\t\t\t\t\toldNextSiblings,\n\t\t\t\t\t\tprevious.children,\n\t\t\t\t\t\tchildren,\n\t\t\t\t\t\tparentInstance,\n\t\t\t\t\t\tprojectionOptions\n\t\t\t\t\t) || updated;\n\t\t\t}\n\n\t\t\tconst previousProperties = buildPreviousProperties(domNode, previous, dnode);\n\t\t\tif (dnode.attributes && dnode.events) {\n\t\t\t\tupdateAttributes(domNode, previousProperties.attributes, dnode.attributes, projectionOptions);\n\t\t\t\tupdated =\n\t\t\t\t\tupdateProperties(\n\t\t\t\t\t\tdomNode,\n\t\t\t\t\t\tpreviousProperties.properties,\n\t\t\t\t\t\tdnode.properties,\n\t\t\t\t\t\tprojectionOptions,\n\t\t\t\t\t\tfalse\n\t\t\t\t\t) || updated;\n\t\t\t\tremoveOrphanedEvents(domNode, previousProperties.events, dnode.events, projectionOptions, true);\n\t\t\t\tconst events = dnode.events;\n\t\t\t\tObject.keys(events).forEach((event) => {\n\t\t\t\t\tupdateEvent(\n\t\t\t\t\t\tdomNode,\n\t\t\t\t\t\tevent,\n\t\t\t\t\t\tevents[event],\n\t\t\t\t\t\tprojectionOptions,\n\t\t\t\t\t\tdnode.properties.bind,\n\t\t\t\t\t\tpreviousProperties.events[event]\n\t\t\t\t\t);\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\tupdated =\n\t\t\t\t\tupdateProperties(domNode, previousProperties.properties, dnode.properties, projectionOptions) ||\n\t\t\t\t\tupdated;\n\t\t\t}\n\n\t\t\tif (dnode.properties.key !== null && dnode.properties.key !== undefined) {\n\t\t\t\tconst instanceData = widgetInstanceMap.get(parentInstance)!;\n\t\t\t\tinstanceData.nodeHandler.add(domNode, `${dnode.properties.key}`);\n\t\t\t}\n\t\t}\n\t\tif (updated && dnode.properties && dnode.properties.updateAnimation) {\n\t\t\tdnode.properties.updateAnimation(domNode as Element, dnode.properties, previous.properties);\n\t\t}\n\t}\n}\n\nfunction addDeferredProperties(vnode: InternalVNode, projectionOptions: ProjectionOptions) {\n\t// transfer any properties that have been passed - as these must be decorated properties\n\tvnode.decoratedDeferredProperties = vnode.properties;\n\tconst properties = vnode.deferredPropertiesCallback!(!!vnode.inserted);\n\tconst projectorState = projectorStateMap.get(projectionOptions.projectorInstance)!;\n\tvnode.properties = { ...properties, ...vnode.decoratedDeferredProperties };\n\tprojectorState.deferredRenderCallbacks.push(() => {\n\t\tconst properties = {\n\t\t\t...vnode.deferredPropertiesCallback!(!!vnode.inserted),\n\t\t\t...vnode.decoratedDeferredProperties\n\t\t};\n\t\tupdateProperties(vnode.domNode! as Element, vnode.properties, properties, projectionOptions);\n\t\tvnode.properties = properties;\n\t});\n}\n\nfunction runDeferredRenderCallbacks(projectionOptions: ProjectionOptions) {\n\tconst projectorState = projectorStateMap.get(projectionOptions.projectorInstance)!;\n\tif (projectorState.deferredRenderCallbacks.length) {\n\t\tif (projectionOptions.sync) {\n\t\t\twhile (projectorState.deferredRenderCallbacks.length) {\n\t\t\t\tconst callback = projectorState.deferredRenderCallbacks.shift();\n\t\t\t\tcallback && callback();\n\t\t\t}\n\t\t} else {\n\t\t\tglobal.requestAnimationFrame(() => {\n\t\t\t\twhile (projectorState.deferredRenderCallbacks.length) {\n\t\t\t\t\tconst callback = projectorState.deferredRenderCallbacks.shift();\n\t\t\t\t\tcallback && callback();\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t}\n}\n\nfunction runAfterRenderCallbacks(projectionOptions: ProjectionOptions) {\n\tconst projectorState = projectorStateMap.get(projectionOptions.projectorInstance)!;\n\tif (projectionOptions.sync) {\n\t\twhile (projectorState.afterRenderCallbacks.length) {\n\t\t\tconst callback = projectorState.afterRenderCallbacks.shift();\n\t\t\tcallback && callback();\n\t\t}\n\t} else {\n\t\tif (global.requestIdleCallback) {\n\t\t\tglobal.requestIdleCallback(() => {\n\t\t\t\twhile (projectorState.afterRenderCallbacks.length) {\n\t\t\t\t\tconst callback = projectorState.afterRenderCallbacks.shift();\n\t\t\t\t\tcallback && callback();\n\t\t\t\t}\n\t\t\t});\n\t\t} else {\n\t\t\tsetTimeout(() => {\n\t\t\t\twhile (projectorState.afterRenderCallbacks.length) {\n\t\t\t\t\tconst callback = projectorState.afterRenderCallbacks.shift();\n\t\t\t\t\tcallback && callback();\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t}\n}\n\nfunction scheduleRender(projectionOptions: ProjectionOptions) {\n\tconst projectorState = projectorStateMap.get(projectionOptions.projectorInstance)!;\n\tif (projectionOptions.sync) {\n\t\trender(projectionOptions);\n\t} else if (projectorState.renderScheduled === undefined) {\n\t\tprojectorState.renderScheduled = global.requestAnimationFrame(() => {\n\t\t\trender(projectionOptions);\n\t\t});\n\t}\n}\n\nfunction render(projectionOptions: ProjectionOptions) {\n\tconst projectorState = projectorStateMap.get(projectionOptions.projectorInstance)!;\n\tprojectorState.renderScheduled = undefined;\n\tconst renderQueue = projectorState.renderQueue;\n\tconst renders = [...renderQueue];\n\tprojectorState.renderQueue = [];\n\trenders.sort((a, b) => a.depth - b.depth);\n\tconst previouslyRendered = [];\n\twhile (renders.length) {\n\t\tconst { instance } = renders.shift()!;\n\t\tif (instanceMap.has(instance) && previouslyRendered.indexOf(instance) === -1) {\n\t\t\tpreviouslyRendered.push(instance);\n\t\t\tconst { parentVNode, dnode } = instanceMap.get(instance)!;\n\t\t\tconst instanceData = widgetInstanceMap.get(instance)!;\n\t\t\tconst nextSiblings = nextSiblingMap.get(instance)!;\n\t\t\tupdateDom(\n\t\t\t\tdnode,\n\t\t\t\ttoInternalWNode(instance, instanceData),\n\t\t\t\tprojectionOptions,\n\t\t\t\tparentVNode,\n\t\t\t\tinstance,\n\t\t\t\tnextSiblings,\n\t\t\t\tnextSiblings\n\t\t\t);\n\t\t}\n\t}\n\trunAfterRenderCallbacks(projectionOptions);\n\trunDeferredRenderCallbacks(projectionOptions);\n}\n\nexport const dom = {\n\tappend: function(\n\t\tparentNode: Element,\n\t\tinstance: DefaultWidgetBaseInterface,\n\t\tprojectionOptions: Partial = {}\n\t): Projection {\n\t\tconst instanceData = widgetInstanceMap.get(instance)!;\n\t\tconst finalProjectorOptions = getProjectionOptions(projectionOptions, instance);\n\t\tconst projectorState: ProjectorState = {\n\t\t\tafterRenderCallbacks: [],\n\t\t\tdeferredRenderCallbacks: [],\n\t\t\tnodeMap: new WeakMap(),\n\t\t\trenderScheduled: undefined,\n\t\t\trenderQueue: [],\n\t\t\tmerge: projectionOptions.merge || false,\n\t\t\tmergeElement: projectionOptions.mergeElement\n\t\t};\n\t\tprojectorStateMap.set(instance, projectorState);\n\n\t\tfinalProjectorOptions.rootNode = parentNode;\n\t\tconst parentVNode = toParentVNode(finalProjectorOptions.rootNode);\n\t\tconst node = toInternalWNode(instance, instanceData);\n\t\tinstanceMap.set(instance, { dnode: node, parentVNode });\n\t\tinstanceData.invalidate = () => {\n\t\t\tinstanceData.dirty = true;\n\t\t\tif (instanceData.rendering === false) {\n\t\t\t\tprojectorState.renderQueue.push({ instance, depth: finalProjectorOptions.depth });\n\t\t\t\tscheduleRender(finalProjectorOptions);\n\t\t\t}\n\t\t};\n\t\tupdateDom(node, node, finalProjectorOptions, parentVNode, instance, [], []);\n\t\tprojectorState.afterRenderCallbacks.push(() => {\n\t\t\tinstanceData.onAttach();\n\t\t});\n\t\trunDeferredRenderCallbacks(finalProjectorOptions);\n\t\trunAfterRenderCallbacks(finalProjectorOptions);\n\t\treturn {\n\t\t\tdomNode: finalProjectorOptions.rootNode\n\t\t};\n\t},\n\tcreate: function(instance: DefaultWidgetBaseInterface, projectionOptions?: Partial): Projection {\n\t\treturn this.append(document.createElement('div'), instance, projectionOptions);\n\t},\n\tmerge: function(\n\t\telement: Element,\n\t\tinstance: DefaultWidgetBaseInterface,\n\t\tprojectionOptions: Partial = {}\n\t): Projection {\n\t\tprojectionOptions.merge = true;\n\t\tprojectionOptions.mergeElement = element;\n\t\tconst projection = this.append(element.parentNode as Element, instance, projectionOptions);\n\t\tconst projectorState = projectorStateMap.get(instance)!;\n\t\tprojectorState.merge = false;\n\t\treturn projection;\n\t}\n};\n"]} \ No newline at end of file diff --git a/deps/framework/widget-core/vdom.mjs b/deps/framework/widget-core/vdom.mjs deleted file mode 100644 index 8793e0d8c5..0000000000 --- a/deps/framework/widget-core/vdom.mjs +++ /dev/null @@ -1,939 +0,0 @@ -import global from '../shim/global'; -import { from as arrayFrom } from '../shim/array'; -import { isWNode, isVNode, isDomVNode, VNODE, WNODE } from './d'; -import { isWidgetBaseConstructor } from './Registry'; -import WeakMap from '../shim/WeakMap'; -const NAMESPACE_W3 = 'http://www.w3.org/'; -const NAMESPACE_SVG = NAMESPACE_W3 + '2000/svg'; -const NAMESPACE_XLINK = NAMESPACE_W3 + '1999/xlink'; -const emptyArray = []; -const nodeOperations = ['focus', 'blur', 'scrollIntoView', 'click']; -export const widgetInstanceMap = new WeakMap(); -const instanceMap = new WeakMap(); -const nextSiblingMap = new WeakMap(); -const projectorStateMap = new WeakMap(); -function same(dnode1, dnode2) { - if (isVNode(dnode1) && isVNode(dnode2)) { - if (isDomVNode(dnode1) || isDomVNode(dnode2)) { - if (dnode1.domNode !== dnode2.domNode) { - return false; - } - } - if (dnode1.tag !== dnode2.tag) { - return false; - } - if (dnode1.properties.key !== dnode2.properties.key) { - return false; - } - return true; - } - else if (isWNode(dnode1) && isWNode(dnode2)) { - if (dnode1.instance === undefined && typeof dnode2.widgetConstructor === 'string') { - return false; - } - if (dnode1.widgetConstructor !== dnode2.widgetConstructor) { - return false; - } - if (dnode1.properties.key !== dnode2.properties.key) { - return false; - } - return true; - } - return false; -} -const missingTransition = function () { - throw new Error('Provide a transitions object to the projectionOptions to do animations'); -}; -function getProjectionOptions(projectorOptions, projectorInstance) { - const defaults = { - namespace: undefined, - styleApplyer: function (domNode, styleName, value) { - domNode.style[styleName] = value; - }, - transitions: { - enter: missingTransition, - exit: missingTransition - }, - depth: 0, - merge: false, - sync: false, - projectorInstance - }; - return Object.assign({}, defaults, projectorOptions); -} -function checkStyleValue(styleValue) { - if (typeof styleValue !== 'string') { - throw new Error('Style values must be strings'); - } -} -function updateEvent(domNode, eventName, currentValue, projectionOptions, bind, previousValue) { - const projectorState = projectorStateMap.get(projectionOptions.projectorInstance); - const eventMap = projectorState.nodeMap.get(domNode) || new WeakMap(); - if (previousValue) { - const previousEvent = eventMap.get(previousValue); - domNode.removeEventListener(eventName, previousEvent); - } - let callback = currentValue.bind(bind); - if (eventName === 'input') { - callback = function (evt) { - currentValue.call(this, evt); - evt.target['oninput-value'] = evt.target.value; - }.bind(bind); - } - domNode.addEventListener(eventName, callback); - eventMap.set(currentValue, callback); - projectorState.nodeMap.set(domNode, eventMap); -} -function addClasses(domNode, classes) { - if (classes) { - const classNames = classes.split(' '); - for (let i = 0; i < classNames.length; i++) { - domNode.classList.add(classNames[i]); - } - } -} -function removeClasses(domNode, classes) { - if (classes) { - const classNames = classes.split(' '); - for (let i = 0; i < classNames.length; i++) { - domNode.classList.remove(classNames[i]); - } - } -} -function buildPreviousProperties(domNode, previous, current) { - const { diffType, properties, attributes } = current; - if (!diffType || diffType === 'vdom') { - return { properties: previous.properties, attributes: previous.attributes, events: previous.events }; - } - else if (diffType === 'none') { - return { properties: {}, attributes: previous.attributes ? {} : undefined, events: previous.events }; - } - let newProperties = { - properties: {} - }; - if (attributes) { - newProperties.attributes = {}; - newProperties.events = previous.events; - Object.keys(properties).forEach((propName) => { - newProperties.properties[propName] = domNode[propName]; - }); - Object.keys(attributes).forEach((attrName) => { - newProperties.attributes[attrName] = domNode.getAttribute(attrName); - }); - return newProperties; - } - newProperties.properties = Object.keys(properties).reduce((props, property) => { - props[property] = domNode.getAttribute(property) || domNode[property]; - return props; - }, {}); - return newProperties; -} -function nodeOperation(propName, propValue, previousValue, domNode, projectionOptions) { - let result; - if (typeof propValue === 'function') { - result = propValue(); - } - else { - result = propValue && !previousValue; - } - if (result === true) { - const projectorState = projectorStateMap.get(projectionOptions.projectorInstance); - projectorState.deferredRenderCallbacks.push(() => { - domNode[propName](); - }); - } -} -function removeOrphanedEvents(domNode, previousProperties, properties, projectionOptions, onlyEvents = false) { - const projectorState = projectorStateMap.get(projectionOptions.projectorInstance); - const eventMap = projectorState.nodeMap.get(domNode); - if (eventMap) { - Object.keys(previousProperties).forEach((propName) => { - const isEvent = propName.substr(0, 2) === 'on' || onlyEvents; - const eventName = onlyEvents ? propName : propName.substr(2); - if (isEvent && !properties[propName]) { - const eventCallback = eventMap.get(previousProperties[propName]); - if (eventCallback) { - domNode.removeEventListener(eventName, eventCallback); - } - } - }); - } -} -function updateAttribute(domNode, attrName, attrValue, projectionOptions) { - if (projectionOptions.namespace === NAMESPACE_SVG && attrName === 'href') { - domNode.setAttributeNS(NAMESPACE_XLINK, attrName, attrValue); - } - else if ((attrName === 'role' && attrValue === '') || attrValue === undefined) { - domNode.removeAttribute(attrName); - } - else { - domNode.setAttribute(attrName, attrValue); - } -} -function updateAttributes(domNode, previousAttributes, attributes, projectionOptions) { - const attrNames = Object.keys(attributes); - const attrCount = attrNames.length; - for (let i = 0; i < attrCount; i++) { - const attrName = attrNames[i]; - const attrValue = attributes[attrName]; - const previousAttrValue = previousAttributes[attrName]; - if (attrValue !== previousAttrValue) { - updateAttribute(domNode, attrName, attrValue, projectionOptions); - } - } -} -function updateProperties(domNode, previousProperties, properties, projectionOptions, includesEventsAndAttributes = true) { - let propertiesUpdated = false; - const propNames = Object.keys(properties); - const propCount = propNames.length; - if (propNames.indexOf('classes') === -1 && previousProperties.classes) { - if (Array.isArray(previousProperties.classes)) { - for (let i = 0; i < previousProperties.classes.length; i++) { - removeClasses(domNode, previousProperties.classes[i]); - } - } - else { - removeClasses(domNode, previousProperties.classes); - } - } - includesEventsAndAttributes && removeOrphanedEvents(domNode, previousProperties, properties, projectionOptions); - for (let i = 0; i < propCount; i++) { - const propName = propNames[i]; - let propValue = properties[propName]; - const previousValue = previousProperties[propName]; - if (propName === 'classes') { - const previousClasses = Array.isArray(previousValue) ? previousValue : [previousValue]; - const currentClasses = Array.isArray(propValue) ? propValue : [propValue]; - if (previousClasses && previousClasses.length > 0) { - if (!propValue || propValue.length === 0) { - for (let i = 0; i < previousClasses.length; i++) { - removeClasses(domNode, previousClasses[i]); - } - } - else { - const newClasses = [...currentClasses]; - for (let i = 0; i < previousClasses.length; i++) { - const previousClassName = previousClasses[i]; - if (previousClassName) { - const classIndex = newClasses.indexOf(previousClassName); - if (classIndex === -1) { - removeClasses(domNode, previousClassName); - } - else { - newClasses.splice(classIndex, 1); - } - } - } - for (let i = 0; i < newClasses.length; i++) { - addClasses(domNode, newClasses[i]); - } - } - } - else { - for (let i = 0; i < currentClasses.length; i++) { - addClasses(domNode, currentClasses[i]); - } - } - } - else if (nodeOperations.indexOf(propName) !== -1) { - nodeOperation(propName, propValue, previousValue, domNode, projectionOptions); - } - else if (propName === 'styles') { - const styleNames = Object.keys(propValue); - const styleCount = styleNames.length; - for (let j = 0; j < styleCount; j++) { - const styleName = styleNames[j]; - const newStyleValue = propValue[styleName]; - const oldStyleValue = previousValue && previousValue[styleName]; - if (newStyleValue === oldStyleValue) { - continue; - } - propertiesUpdated = true; - if (newStyleValue) { - checkStyleValue(newStyleValue); - projectionOptions.styleApplyer(domNode, styleName, newStyleValue); - } - else { - projectionOptions.styleApplyer(domNode, styleName, ''); - } - } - } - else { - if (!propValue && typeof previousValue === 'string') { - propValue = ''; - } - if (propName === 'value') { - const domValue = domNode[propName]; - if (domValue !== propValue && - (domNode['oninput-value'] - ? domValue === domNode['oninput-value'] - : propValue !== previousValue)) { - domNode[propName] = propValue; - domNode['oninput-value'] = undefined; - } - if (propValue !== previousValue) { - propertiesUpdated = true; - } - } - else if (propName !== 'key' && propValue !== previousValue) { - const type = typeof propValue; - if (type === 'function' && propName.lastIndexOf('on', 0) === 0 && includesEventsAndAttributes) { - updateEvent(domNode, propName.substr(2), propValue, projectionOptions, properties.bind, previousValue); - } - else if (type === 'string' && propName !== 'innerHTML' && includesEventsAndAttributes) { - updateAttribute(domNode, propName, propValue, projectionOptions); - } - else if (propName === 'scrollLeft' || propName === 'scrollTop') { - if (domNode[propName] !== propValue) { - domNode[propName] = propValue; - } - } - else { - domNode[propName] = propValue; - } - propertiesUpdated = true; - } - } - } - return propertiesUpdated; -} -function findIndexOfChild(children, sameAs, start) { - for (let i = start; i < children.length; i++) { - if (same(children[i], sameAs)) { - return i; - } - } - return -1; -} -export function toParentVNode(domNode) { - return { - tag: '', - properties: {}, - children: undefined, - domNode, - type: VNODE - }; -} -export function toTextVNode(data) { - return { - tag: '', - properties: {}, - children: undefined, - text: `${data}`, - domNode: undefined, - type: VNODE - }; -} -function toInternalWNode(instance, instanceData) { - return { - instance, - rendered: [], - coreProperties: instanceData.coreProperties, - children: instance.children, - widgetConstructor: instance.constructor, - properties: instanceData.inputProperties, - type: WNODE - }; -} -export function filterAndDecorateChildren(children, instance) { - if (children === undefined) { - return emptyArray; - } - children = Array.isArray(children) ? children : [children]; - for (let i = 0; i < children.length;) { - const child = children[i]; - if (child === undefined || child === null) { - children.splice(i, 1); - continue; - } - else if (typeof child === 'string') { - children[i] = toTextVNode(child); - } - else { - if (isVNode(child)) { - if (child.properties.bind === undefined) { - child.properties.bind = instance; - if (child.children && child.children.length > 0) { - filterAndDecorateChildren(child.children, instance); - } - } - } - else { - if (!child.coreProperties) { - const instanceData = widgetInstanceMap.get(instance); - child.coreProperties = { - bind: instance, - baseRegistry: instanceData.coreProperties.baseRegistry - }; - } - if (child.children && child.children.length > 0) { - filterAndDecorateChildren(child.children, instance); - } - } - } - i++; - } - return children; -} -function nodeAdded(dnode, transitions) { - if (isVNode(dnode) && dnode.properties) { - const enterAnimation = dnode.properties.enterAnimation; - if (enterAnimation) { - if (typeof enterAnimation === 'function') { - enterAnimation(dnode.domNode, dnode.properties); - } - else { - transitions.enter(dnode.domNode, dnode.properties, enterAnimation); - } - } - } -} -function nodeToRemove(dnode, transitions, projectionOptions) { - if (isWNode(dnode)) { - const item = instanceMap.get(dnode.instance); - const rendered = (item ? item.dnode.rendered : dnode.rendered) || emptyArray; - if (dnode.instance) { - const instanceData = widgetInstanceMap.get(dnode.instance); - instanceData.onDetach(); - instanceMap.delete(dnode.instance); - } - for (let i = 0; i < rendered.length; i++) { - nodeToRemove(rendered[i], transitions, projectionOptions); - } - } - else { - const domNode = dnode.domNode; - const properties = dnode.properties; - if (dnode.children && dnode.children.length > 0) { - for (let i = 0; i < dnode.children.length; i++) { - nodeToRemove(dnode.children[i], transitions, projectionOptions); - } - } - const exitAnimation = properties.exitAnimation; - if (properties && exitAnimation) { - domNode.style.pointerEvents = 'none'; - const removeDomNode = function () { - domNode && domNode.parentNode && domNode.parentNode.removeChild(domNode); - dnode.domNode = undefined; - }; - if (typeof exitAnimation === 'function') { - exitAnimation(domNode, removeDomNode, properties); - return; - } - else { - transitions.exit(dnode.domNode, properties, exitAnimation, removeDomNode); - return; - } - } - domNode && domNode.parentNode && domNode.parentNode.removeChild(domNode); - dnode.domNode = undefined; - } -} -function checkDistinguishable(childNodes, indexToCheck, parentInstance) { - const childNode = childNodes[indexToCheck]; - if (isVNode(childNode) && !childNode.tag) { - return; // Text nodes need not be distinguishable - } - const { key } = childNode.properties; - if (key === undefined || key === null) { - for (let i = 0; i < childNodes.length; i++) { - if (i !== indexToCheck) { - const node = childNodes[i]; - if (same(node, childNode)) { - let nodeIdentifier; - const parentName = parentInstance.constructor.name || 'unknown'; - if (isWNode(childNode)) { - nodeIdentifier = childNode.widgetConstructor.name || 'unknown'; - } - else { - nodeIdentifier = childNode.tag; - } - console.warn(`A widget (${parentName}) has had a child addded or removed, but they were not able to uniquely identified. It is recommended to provide a unique 'key' property when using the same widget or element (${nodeIdentifier}) multiple times as siblings`); - break; - } - } - } - } -} -function updateChildren(parentVNode, siblings, oldChildren, newChildren, parentInstance, projectionOptions) { - oldChildren = oldChildren || emptyArray; - newChildren = newChildren; - const oldChildrenLength = oldChildren.length; - const newChildrenLength = newChildren.length; - const transitions = projectionOptions.transitions; - const projectorState = projectorStateMap.get(projectionOptions.projectorInstance); - projectionOptions = Object.assign({}, projectionOptions, { depth: projectionOptions.depth + 1 }); - let oldIndex = 0; - let newIndex = 0; - let i; - let textUpdated = false; - while (newIndex < newChildrenLength) { - let oldChild = oldIndex < oldChildrenLength ? oldChildren[oldIndex] : undefined; - const newChild = newChildren[newIndex]; - if (isVNode(newChild) && typeof newChild.deferredPropertiesCallback === 'function') { - newChild.inserted = isVNode(oldChild) && oldChild.inserted; - addDeferredProperties(newChild, projectionOptions); - } - if (oldChild !== undefined && same(oldChild, newChild)) { - oldIndex++; - newIndex++; - textUpdated = - updateDom(oldChild, newChild, projectionOptions, parentVNode, parentInstance, oldChildren.slice(oldIndex), newChildren.slice(newIndex)) || textUpdated; - continue; - } - const findOldIndex = findIndexOfChild(oldChildren, newChild, oldIndex + 1); - const addChild = () => { - let insertBeforeDomNode = undefined; - let childrenArray = oldChildren; - let nextIndex = oldIndex + 1; - let child = oldChildren[oldIndex]; - if (!child) { - child = siblings[0]; - nextIndex = 1; - childrenArray = siblings; - } - if (child) { - let insertBeforeChildren = [child]; - while (insertBeforeChildren.length) { - const insertBefore = insertBeforeChildren.shift(); - if (isWNode(insertBefore)) { - const item = instanceMap.get(insertBefore.instance); - if (item && item.dnode.rendered) { - insertBeforeChildren.push(...item.dnode.rendered); - } - } - else { - if (insertBefore.domNode) { - if (insertBefore.domNode.parentElement !== parentVNode.domNode) { - break; - } - insertBeforeDomNode = insertBefore.domNode; - break; - } - } - if (insertBeforeChildren.length === 0 && childrenArray[nextIndex]) { - insertBeforeChildren.push(childrenArray[nextIndex]); - nextIndex++; - } - } - } - createDom(newChild, parentVNode, newChildren.slice(newIndex + 1), insertBeforeDomNode, projectionOptions, parentInstance); - nodeAdded(newChild, transitions); - const indexToCheck = newIndex; - projectorState.afterRenderCallbacks.push(() => { - checkDistinguishable(newChildren, indexToCheck, parentInstance); - }); - }; - if (!oldChild || findOldIndex === -1) { - addChild(); - newIndex++; - continue; - } - const removeChild = () => { - const indexToCheck = oldIndex; - projectorState.afterRenderCallbacks.push(() => { - checkDistinguishable(oldChildren, indexToCheck, parentInstance); - }); - if (isWNode(oldChild)) { - const item = instanceMap.get(oldChild.instance); - if (item) { - oldChild = item.dnode; - } - } - nodeToRemove(oldChild, transitions, projectionOptions); - }; - const findNewIndex = findIndexOfChild(newChildren, oldChild, newIndex + 1); - if (findNewIndex === -1) { - removeChild(); - oldIndex++; - continue; - } - addChild(); - removeChild(); - oldIndex++; - newIndex++; - } - if (oldChildrenLength > oldIndex) { - // Remove child fragments - for (i = oldIndex; i < oldChildrenLength; i++) { - const indexToCheck = i; - projectorState.afterRenderCallbacks.push(() => { - checkDistinguishable(oldChildren, indexToCheck, parentInstance); - }); - let childToRemove = oldChildren[i]; - if (isWNode(childToRemove)) { - const item = instanceMap.get(childToRemove.instance); - if (item) { - childToRemove = item.dnode; - } - } - nodeToRemove(childToRemove, transitions, projectionOptions); - } - } - return textUpdated; -} -function addChildren(parentVNode, children, projectionOptions, parentInstance, insertBefore = undefined, childNodes) { - if (children === undefined) { - return; - } - const projectorState = projectorStateMap.get(projectionOptions.projectorInstance); - if (projectorState.merge && childNodes === undefined) { - childNodes = arrayFrom(parentVNode.domNode.childNodes); - } - const transitions = projectionOptions.transitions; - projectionOptions = Object.assign({}, projectionOptions, { depth: projectionOptions.depth + 1 }); - for (let i = 0; i < children.length; i++) { - const child = children[i]; - const nextSiblings = children.slice(i + 1); - if (isVNode(child)) { - if (projectorState.merge && childNodes) { - let domElement = undefined; - while (child.domNode === undefined && childNodes.length > 0) { - domElement = childNodes.shift(); - if (domElement && domElement.tagName === (child.tag.toUpperCase() || undefined)) { - child.domNode = domElement; - } - } - } - createDom(child, parentVNode, nextSiblings, insertBefore, projectionOptions, parentInstance); - } - else { - createDom(child, parentVNode, nextSiblings, insertBefore, projectionOptions, parentInstance, childNodes); - } - nodeAdded(child, transitions); - } -} -function initPropertiesAndChildren(domNode, dnode, parentInstance, projectionOptions) { - addChildren(dnode, dnode.children, projectionOptions, parentInstance, undefined); - if (typeof dnode.deferredPropertiesCallback === 'function' && dnode.inserted === undefined) { - addDeferredProperties(dnode, projectionOptions); - } - if (dnode.attributes && dnode.events) { - updateAttributes(domNode, {}, dnode.attributes, projectionOptions); - updateProperties(domNode, {}, dnode.properties, projectionOptions, false); - removeOrphanedEvents(domNode, {}, dnode.events, projectionOptions, true); - const events = dnode.events; - Object.keys(events).forEach((event) => { - updateEvent(domNode, event, events[event], projectionOptions, dnode.properties.bind); - }); - } - else { - updateProperties(domNode, {}, dnode.properties, projectionOptions); - } - if (dnode.properties.key !== null && dnode.properties.key !== undefined) { - const instanceData = widgetInstanceMap.get(parentInstance); - instanceData.nodeHandler.add(domNode, `${dnode.properties.key}`); - } - dnode.inserted = true; -} -function createDom(dnode, parentVNode, nextSiblings, insertBefore, projectionOptions, parentInstance, childNodes) { - let domNode; - const projectorState = projectorStateMap.get(projectionOptions.projectorInstance); - if (isWNode(dnode)) { - let { widgetConstructor } = dnode; - const parentInstanceData = widgetInstanceMap.get(parentInstance); - if (!isWidgetBaseConstructor(widgetConstructor)) { - const item = parentInstanceData.registry().get(widgetConstructor); - if (item === null) { - return; - } - widgetConstructor = item; - } - const instance = new widgetConstructor(); - dnode.instance = instance; - nextSiblingMap.set(instance, nextSiblings); - const instanceData = widgetInstanceMap.get(instance); - instanceData.invalidate = () => { - instanceData.dirty = true; - if (instanceData.rendering === false) { - projectorState.renderQueue.push({ instance, depth: projectionOptions.depth }); - scheduleRender(projectionOptions); - } - }; - instanceData.rendering = true; - instance.__setCoreProperties__(dnode.coreProperties); - instance.__setChildren__(dnode.children); - instance.__setProperties__(dnode.properties); - const rendered = instance.__render__(); - instanceData.rendering = false; - if (rendered) { - const filteredRendered = filterAndDecorateChildren(rendered, instance); - dnode.rendered = filteredRendered; - addChildren(parentVNode, filteredRendered, projectionOptions, instance, insertBefore, childNodes); - } - instanceMap.set(instance, { dnode, parentVNode }); - instanceData.nodeHandler.addRoot(); - projectorState.afterRenderCallbacks.push(() => { - instanceData.onAttach(); - }); - } - else { - if (projectorState.merge && projectorState.mergeElement !== undefined) { - domNode = dnode.domNode = projectionOptions.mergeElement; - projectorState.mergeElement = undefined; - initPropertiesAndChildren(domNode, dnode, parentInstance, projectionOptions); - return; - } - const doc = parentVNode.domNode.ownerDocument; - if (!dnode.tag && typeof dnode.text === 'string') { - if (dnode.domNode !== undefined && parentVNode.domNode) { - const newDomNode = dnode.domNode.ownerDocument.createTextNode(dnode.text); - if (parentVNode.domNode === dnode.domNode.parentNode) { - parentVNode.domNode.replaceChild(newDomNode, dnode.domNode); - } - else { - parentVNode.domNode.appendChild(newDomNode); - dnode.domNode.parentNode && dnode.domNode.parentNode.removeChild(dnode.domNode); - } - dnode.domNode = newDomNode; - } - else { - domNode = dnode.domNode = doc.createTextNode(dnode.text); - if (insertBefore !== undefined) { - parentVNode.domNode.insertBefore(domNode, insertBefore); - } - else { - parentVNode.domNode.appendChild(domNode); - } - } - } - else { - if (dnode.domNode === undefined) { - if (dnode.tag === 'svg') { - projectionOptions = Object.assign({}, projectionOptions, { namespace: NAMESPACE_SVG }); - } - if (projectionOptions.namespace !== undefined) { - domNode = dnode.domNode = doc.createElementNS(projectionOptions.namespace, dnode.tag); - } - else { - domNode = dnode.domNode = dnode.domNode || doc.createElement(dnode.tag); - } - } - else { - domNode = dnode.domNode; - } - initPropertiesAndChildren(domNode, dnode, parentInstance, projectionOptions); - if (insertBefore !== undefined) { - parentVNode.domNode.insertBefore(domNode, insertBefore); - } - else if (domNode.parentNode !== parentVNode.domNode) { - parentVNode.domNode.appendChild(domNode); - } - } - } -} -function updateDom(previous, dnode, projectionOptions, parentVNode, parentInstance, oldNextSiblings, nextSiblings) { - if (isWNode(dnode)) { - const { instance } = previous; - const { parentVNode, dnode: node } = instanceMap.get(instance); - const previousRendered = node ? node.rendered : previous.rendered; - const instanceData = widgetInstanceMap.get(instance); - instanceData.rendering = true; - instance.__setCoreProperties__(dnode.coreProperties); - instance.__setChildren__(dnode.children); - instance.__setProperties__(dnode.properties); - nextSiblingMap.set(instance, nextSiblings); - dnode.instance = instance; - if (instanceData.dirty === true) { - const rendered = instance.__render__(); - instanceData.rendering = false; - dnode.rendered = filterAndDecorateChildren(rendered, instance); - updateChildren(parentVNode, oldNextSiblings, previousRendered, dnode.rendered, instance, projectionOptions); - } - else { - instanceData.rendering = false; - dnode.rendered = previousRendered; - } - instanceMap.set(instance, { dnode, parentVNode }); - instanceData.nodeHandler.addRoot(); - } - else { - if (previous === dnode) { - return false; - } - const domNode = (dnode.domNode = previous.domNode); - let textUpdated = false; - let updated = false; - if (!dnode.tag && typeof dnode.text === 'string') { - if (dnode.text !== previous.text) { - const newDomNode = domNode.ownerDocument.createTextNode(dnode.text); - domNode.parentNode.replaceChild(newDomNode, domNode); - dnode.domNode = newDomNode; - textUpdated = true; - return textUpdated; - } - } - else { - if (dnode.tag && dnode.tag.lastIndexOf('svg', 0) === 0) { - projectionOptions = Object.assign({}, projectionOptions, { namespace: NAMESPACE_SVG }); - } - if (previous.children !== dnode.children) { - const children = filterAndDecorateChildren(dnode.children, parentInstance); - dnode.children = children; - updated = - updateChildren(dnode, oldNextSiblings, previous.children, children, parentInstance, projectionOptions) || updated; - } - const previousProperties = buildPreviousProperties(domNode, previous, dnode); - if (dnode.attributes && dnode.events) { - updateAttributes(domNode, previousProperties.attributes, dnode.attributes, projectionOptions); - updated = - updateProperties(domNode, previousProperties.properties, dnode.properties, projectionOptions, false) || updated; - removeOrphanedEvents(domNode, previousProperties.events, dnode.events, projectionOptions, true); - const events = dnode.events; - Object.keys(events).forEach((event) => { - updateEvent(domNode, event, events[event], projectionOptions, dnode.properties.bind, previousProperties.events[event]); - }); - } - else { - updated = - updateProperties(domNode, previousProperties.properties, dnode.properties, projectionOptions) || - updated; - } - if (dnode.properties.key !== null && dnode.properties.key !== undefined) { - const instanceData = widgetInstanceMap.get(parentInstance); - instanceData.nodeHandler.add(domNode, `${dnode.properties.key}`); - } - } - if (updated && dnode.properties && dnode.properties.updateAnimation) { - dnode.properties.updateAnimation(domNode, dnode.properties, previous.properties); - } - } -} -function addDeferredProperties(vnode, projectionOptions) { - // transfer any properties that have been passed - as these must be decorated properties - vnode.decoratedDeferredProperties = vnode.properties; - const properties = vnode.deferredPropertiesCallback(!!vnode.inserted); - const projectorState = projectorStateMap.get(projectionOptions.projectorInstance); - vnode.properties = Object.assign({}, properties, vnode.decoratedDeferredProperties); - projectorState.deferredRenderCallbacks.push(() => { - const properties = Object.assign({}, vnode.deferredPropertiesCallback(!!vnode.inserted), vnode.decoratedDeferredProperties); - updateProperties(vnode.domNode, vnode.properties, properties, projectionOptions); - vnode.properties = properties; - }); -} -function runDeferredRenderCallbacks(projectionOptions) { - const projectorState = projectorStateMap.get(projectionOptions.projectorInstance); - if (projectorState.deferredRenderCallbacks.length) { - if (projectionOptions.sync) { - while (projectorState.deferredRenderCallbacks.length) { - const callback = projectorState.deferredRenderCallbacks.shift(); - callback && callback(); - } - } - else { - global.requestAnimationFrame(() => { - while (projectorState.deferredRenderCallbacks.length) { - const callback = projectorState.deferredRenderCallbacks.shift(); - callback && callback(); - } - }); - } - } -} -function runAfterRenderCallbacks(projectionOptions) { - const projectorState = projectorStateMap.get(projectionOptions.projectorInstance); - if (projectionOptions.sync) { - while (projectorState.afterRenderCallbacks.length) { - const callback = projectorState.afterRenderCallbacks.shift(); - callback && callback(); - } - } - else { - if (global.requestIdleCallback) { - global.requestIdleCallback(() => { - while (projectorState.afterRenderCallbacks.length) { - const callback = projectorState.afterRenderCallbacks.shift(); - callback && callback(); - } - }); - } - else { - setTimeout(() => { - while (projectorState.afterRenderCallbacks.length) { - const callback = projectorState.afterRenderCallbacks.shift(); - callback && callback(); - } - }); - } - } -} -function scheduleRender(projectionOptions) { - const projectorState = projectorStateMap.get(projectionOptions.projectorInstance); - if (projectionOptions.sync) { - render(projectionOptions); - } - else if (projectorState.renderScheduled === undefined) { - projectorState.renderScheduled = global.requestAnimationFrame(() => { - render(projectionOptions); - }); - } -} -function render(projectionOptions) { - const projectorState = projectorStateMap.get(projectionOptions.projectorInstance); - projectorState.renderScheduled = undefined; - const renderQueue = projectorState.renderQueue; - const renders = [...renderQueue]; - projectorState.renderQueue = []; - renders.sort((a, b) => a.depth - b.depth); - const previouslyRendered = []; - while (renders.length) { - const { instance } = renders.shift(); - if (instanceMap.has(instance) && previouslyRendered.indexOf(instance) === -1) { - previouslyRendered.push(instance); - const { parentVNode, dnode } = instanceMap.get(instance); - const instanceData = widgetInstanceMap.get(instance); - const nextSiblings = nextSiblingMap.get(instance); - updateDom(dnode, toInternalWNode(instance, instanceData), projectionOptions, parentVNode, instance, nextSiblings, nextSiblings); - } - } - runAfterRenderCallbacks(projectionOptions); - runDeferredRenderCallbacks(projectionOptions); -} -export const dom = { - append: function (parentNode, instance, projectionOptions = {}) { - const instanceData = widgetInstanceMap.get(instance); - const finalProjectorOptions = getProjectionOptions(projectionOptions, instance); - const projectorState = { - afterRenderCallbacks: [], - deferredRenderCallbacks: [], - nodeMap: new WeakMap(), - renderScheduled: undefined, - renderQueue: [], - merge: projectionOptions.merge || false, - mergeElement: projectionOptions.mergeElement - }; - projectorStateMap.set(instance, projectorState); - finalProjectorOptions.rootNode = parentNode; - const parentVNode = toParentVNode(finalProjectorOptions.rootNode); - const node = toInternalWNode(instance, instanceData); - instanceMap.set(instance, { dnode: node, parentVNode }); - instanceData.invalidate = () => { - instanceData.dirty = true; - if (instanceData.rendering === false) { - projectorState.renderQueue.push({ instance, depth: finalProjectorOptions.depth }); - scheduleRender(finalProjectorOptions); - } - }; - updateDom(node, node, finalProjectorOptions, parentVNode, instance, [], []); - projectorState.afterRenderCallbacks.push(() => { - instanceData.onAttach(); - }); - runDeferredRenderCallbacks(finalProjectorOptions); - runAfterRenderCallbacks(finalProjectorOptions); - return { - domNode: finalProjectorOptions.rootNode - }; - }, - create: function (instance, projectionOptions) { - return this.append(document.createElement('div'), instance, projectionOptions); - }, - merge: function (element, instance, projectionOptions = {}) { - projectionOptions.merge = true; - projectionOptions.mergeElement = element; - const projection = this.append(element.parentNode, instance, projectionOptions); - const projectorState = projectorStateMap.get(instance); - projectorState.merge = false; - return projection; - } -}; -//# sourceMappingURL=vdom.mjs.map \ No newline at end of file diff --git a/deps/framework/widget-core/vdom.mjs.map b/deps/framework/widget-core/vdom.mjs.map deleted file mode 100644 index 203da987b0..0000000000 --- a/deps/framework/widget-core/vdom.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KAAK,GAAG,IAAI,CAAC;QAC/B,iBAAiB,CAAC,YAAY,GAAG,OAAO,CAAC;QACzC,MAAM,UAAU,GAAG,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,UAAqB,EAAE,QAAQ,EAAE,iBAAiB,CAAC,CAAC;QAC3F,MAAM,cAAc,GAAG,iBAAiB,CAAC,GAAG,CAAC,QAAQ,CAAE,CAAC;QACxD,cAAc,CAAC,KAAK,GAAG,KAAK,CAAC;QAC7B,MAAM,CAAC,UAAU,CAAC;IACnB,CAAC;CACD,CAAC","sourcesContent":["import global from '../shim/global';\nimport {\n\tCoreProperties,\n\tDefaultWidgetBaseInterface,\n\tDNode,\n\tVNode,\n\tWNode,\n\tProjectionOptions,\n\tProjection,\n\tSupportedClassName,\n\tTransitionStrategy,\n\tVNodeProperties\n} from './interfaces';\nimport { from as arrayFrom } from '../shim/array';\nimport { isWNode, isVNode, isDomVNode, VNODE, WNODE } from './d';\nimport { isWidgetBaseConstructor } from './Registry';\nimport WeakMap from '../shim/WeakMap';\nimport NodeHandler from './NodeHandler';\nimport RegistryHandler from './RegistryHandler';\n\nconst NAMESPACE_W3 = 'http://www.w3.org/';\nconst NAMESPACE_SVG = NAMESPACE_W3 + '2000/svg';\nconst NAMESPACE_XLINK = NAMESPACE_W3 + '1999/xlink';\n\nconst emptyArray: (InternalWNode | InternalVNode)[] = [];\n\nconst nodeOperations = ['focus', 'blur', 'scrollIntoView', 'click'];\n\nexport type RenderResult = DNode | DNode[];\n\ninterface InstanceMapData {\n\tparentVNode: InternalVNode;\n\tdnode: InternalWNode;\n}\n\nexport interface InternalWNode extends WNode {\n\t/**\n\t * The instance of the widget\n\t */\n\tinstance: DefaultWidgetBaseInterface;\n\n\t/**\n\t * The rendered DNodes from the instance\n\t */\n\trendered: InternalDNode[];\n\n\t/**\n\t * Core properties that are used by the widget core system\n\t */\n\tcoreProperties: CoreProperties;\n\n\t/**\n\t * Children for the WNode\n\t */\n\tchildren: InternalDNode[];\n}\n\nexport interface InternalVNode extends VNode {\n\t/**\n\t * Children for the VNode\n\t */\n\tchildren?: InternalDNode[];\n\n\tinserted?: boolean;\n\n\t/**\n\t * Bag used to still decorate properties on a deferred properties callback\n\t */\n\tdecoratedDeferredProperties?: VNodeProperties;\n\n\t/**\n\t * DOM element\n\t */\n\tdomNode?: Element | Text;\n}\n\nexport type InternalDNode = InternalVNode | InternalWNode;\n\nexport interface RenderQueue {\n\tinstance: DefaultWidgetBaseInterface;\n\tdepth: number;\n}\n\nexport interface WidgetData {\n\tonDetach: () => void;\n\tonAttach: () => void;\n\tdirty: boolean;\n\tregistry: () => RegistryHandler;\n\tnodeHandler: NodeHandler;\n\tcoreProperties: CoreProperties;\n\tinvalidate?: Function;\n\trendering: boolean;\n\tinputProperties: any;\n}\n\ninterface ProjectorState {\n\tdeferredRenderCallbacks: Function[];\n\tafterRenderCallbacks: Function[];\n\tnodeMap: WeakMap>;\n\trenderScheduled?: number;\n\trenderQueue: RenderQueue[];\n\tmerge: boolean;\n\tmergeElement?: Node;\n}\n\nexport const widgetInstanceMap = new WeakMap();\n\nconst instanceMap = new WeakMap();\nconst nextSiblingMap = new WeakMap();\nconst projectorStateMap = new WeakMap();\n\nfunction same(dnode1: InternalDNode, dnode2: InternalDNode) {\n\tif (isVNode(dnode1) && isVNode(dnode2)) {\n\t\tif (isDomVNode(dnode1) || isDomVNode(dnode2)) {\n\t\t\tif (dnode1.domNode !== dnode2.domNode) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\tif (dnode1.tag !== dnode2.tag) {\n\t\t\treturn false;\n\t\t}\n\t\tif (dnode1.properties.key !== dnode2.properties.key) {\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t} else if (isWNode(dnode1) && isWNode(dnode2)) {\n\t\tif (dnode1.instance === undefined && typeof dnode2.widgetConstructor === 'string') {\n\t\t\treturn false;\n\t\t}\n\t\tif (dnode1.widgetConstructor !== dnode2.widgetConstructor) {\n\t\t\treturn false;\n\t\t}\n\t\tif (dnode1.properties.key !== dnode2.properties.key) {\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}\n\treturn false;\n}\n\nconst missingTransition = function() {\n\tthrow new Error('Provide a transitions object to the projectionOptions to do animations');\n};\n\nfunction getProjectionOptions(\n\tprojectorOptions: Partial,\n\tprojectorInstance: DefaultWidgetBaseInterface\n): ProjectionOptions {\n\tconst defaults: Partial = {\n\t\tnamespace: undefined,\n\t\tstyleApplyer: function(domNode: HTMLElement, styleName: string, value: string) {\n\t\t\t(domNode.style as any)[styleName] = value;\n\t\t},\n\t\ttransitions: {\n\t\t\tenter: missingTransition,\n\t\t\texit: missingTransition\n\t\t},\n\t\tdepth: 0,\n\t\tmerge: false,\n\t\tsync: false,\n\t\tprojectorInstance\n\t};\n\treturn { ...defaults, ...projectorOptions } as ProjectionOptions;\n}\n\nfunction checkStyleValue(styleValue: Object) {\n\tif (typeof styleValue !== 'string') {\n\t\tthrow new Error('Style values must be strings');\n\t}\n}\n\nfunction updateEvent(\n\tdomNode: Node,\n\teventName: string,\n\tcurrentValue: Function,\n\tprojectionOptions: ProjectionOptions,\n\tbind: any,\n\tpreviousValue?: Function\n) {\n\tconst projectorState = projectorStateMap.get(projectionOptions.projectorInstance)!;\n\tconst eventMap = projectorState.nodeMap.get(domNode) || new WeakMap();\n\n\tif (previousValue) {\n\t\tconst previousEvent = eventMap.get(previousValue);\n\t\tdomNode.removeEventListener(eventName, previousEvent);\n\t}\n\n\tlet callback = currentValue.bind(bind);\n\n\tif (eventName === 'input') {\n\t\tcallback = function(this: any, evt: Event) {\n\t\t\tcurrentValue.call(this, evt);\n\t\t\t(evt.target as any)['oninput-value'] = (evt.target as HTMLInputElement).value;\n\t\t}.bind(bind);\n\t}\n\n\tdomNode.addEventListener(eventName, callback);\n\teventMap.set(currentValue, callback);\n\tprojectorState.nodeMap.set(domNode, eventMap);\n}\n\nfunction addClasses(domNode: Element, classes: SupportedClassName) {\n\tif (classes) {\n\t\tconst classNames = classes.split(' ');\n\t\tfor (let i = 0; i < classNames.length; i++) {\n\t\t\tdomNode.classList.add(classNames[i]);\n\t\t}\n\t}\n}\n\nfunction removeClasses(domNode: Element, classes: SupportedClassName) {\n\tif (classes) {\n\t\tconst classNames = classes.split(' ');\n\t\tfor (let i = 0; i < classNames.length; i++) {\n\t\t\tdomNode.classList.remove(classNames[i]);\n\t\t}\n\t}\n}\n\nfunction buildPreviousProperties(domNode: any, previous: InternalVNode, current: InternalVNode) {\n\tconst { diffType, properties, attributes } = current;\n\tif (!diffType || diffType === 'vdom') {\n\t\treturn { properties: previous.properties, attributes: previous.attributes, events: previous.events };\n\t} else if (diffType === 'none') {\n\t\treturn { properties: {}, attributes: previous.attributes ? {} : undefined, events: previous.events };\n\t}\n\tlet newProperties: any = {\n\t\tproperties: {}\n\t};\n\tif (attributes) {\n\t\tnewProperties.attributes = {};\n\t\tnewProperties.events = previous.events;\n\t\tObject.keys(properties).forEach((propName) => {\n\t\t\tnewProperties.properties[propName] = domNode[propName];\n\t\t});\n\t\tObject.keys(attributes).forEach((attrName) => {\n\t\t\tnewProperties.attributes[attrName] = domNode.getAttribute(attrName);\n\t\t});\n\t\treturn newProperties;\n\t}\n\tnewProperties.properties = Object.keys(properties).reduce(\n\t\t(props, property) => {\n\t\t\tprops[property] = domNode.getAttribute(property) || domNode[property];\n\t\t\treturn props;\n\t\t},\n\t\t{} as any\n\t);\n\treturn newProperties;\n}\n\nfunction nodeOperation(\n\tpropName: string,\n\tpropValue: any,\n\tpreviousValue: any,\n\tdomNode: Element,\n\tprojectionOptions: ProjectionOptions\n): void {\n\tlet result;\n\tif (typeof propValue === 'function') {\n\t\tresult = propValue();\n\t} else {\n\t\tresult = propValue && !previousValue;\n\t}\n\tif (result === true) {\n\t\tconst projectorState = projectorStateMap.get(projectionOptions.projectorInstance)!;\n\t\tprojectorState.deferredRenderCallbacks.push(() => {\n\t\t\t(domNode as any)[propName]();\n\t\t});\n\t}\n}\n\nfunction removeOrphanedEvents(\n\tdomNode: Element,\n\tpreviousProperties: VNodeProperties,\n\tproperties: VNodeProperties,\n\tprojectionOptions: ProjectionOptions,\n\tonlyEvents: boolean = false\n) {\n\tconst projectorState = projectorStateMap.get(projectionOptions.projectorInstance)!;\n\tconst eventMap = projectorState.nodeMap.get(domNode);\n\tif (eventMap) {\n\t\tObject.keys(previousProperties).forEach((propName) => {\n\t\t\tconst isEvent = propName.substr(0, 2) === 'on' || onlyEvents;\n\t\t\tconst eventName = onlyEvents ? propName : propName.substr(2);\n\t\t\tif (isEvent && !properties[propName]) {\n\t\t\t\tconst eventCallback = eventMap.get(previousProperties[propName]);\n\t\t\t\tif (eventCallback) {\n\t\t\t\t\tdomNode.removeEventListener(eventName, eventCallback);\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t}\n}\n\nfunction updateAttribute(domNode: Element, attrName: string, attrValue: string, projectionOptions: ProjectionOptions) {\n\tif (projectionOptions.namespace === NAMESPACE_SVG && attrName === 'href') {\n\t\tdomNode.setAttributeNS(NAMESPACE_XLINK, attrName, attrValue);\n\t} else if ((attrName === 'role' && attrValue === '') || attrValue === undefined) {\n\t\tdomNode.removeAttribute(attrName);\n\t} else {\n\t\tdomNode.setAttribute(attrName, attrValue);\n\t}\n}\n\nfunction updateAttributes(\n\tdomNode: Element,\n\tpreviousAttributes: { [index: string]: string },\n\tattributes: { [index: string]: string },\n\tprojectionOptions: ProjectionOptions\n) {\n\tconst attrNames = Object.keys(attributes);\n\tconst attrCount = attrNames.length;\n\tfor (let i = 0; i < attrCount; i++) {\n\t\tconst attrName = attrNames[i];\n\t\tconst attrValue = attributes[attrName];\n\t\tconst previousAttrValue = previousAttributes[attrName];\n\t\tif (attrValue !== previousAttrValue) {\n\t\t\tupdateAttribute(domNode, attrName, attrValue, projectionOptions);\n\t\t}\n\t}\n}\n\nfunction updateProperties(\n\tdomNode: Element,\n\tpreviousProperties: VNodeProperties,\n\tproperties: VNodeProperties,\n\tprojectionOptions: ProjectionOptions,\n\tincludesEventsAndAttributes = true\n) {\n\tlet propertiesUpdated = false;\n\tconst propNames = Object.keys(properties);\n\tconst propCount = propNames.length;\n\tif (propNames.indexOf('classes') === -1 && previousProperties.classes) {\n\t\tif (Array.isArray(previousProperties.classes)) {\n\t\t\tfor (let i = 0; i < previousProperties.classes.length; i++) {\n\t\t\t\tremoveClasses(domNode, previousProperties.classes[i]);\n\t\t\t}\n\t\t} else {\n\t\t\tremoveClasses(domNode, previousProperties.classes);\n\t\t}\n\t}\n\n\tincludesEventsAndAttributes && removeOrphanedEvents(domNode, previousProperties, properties, projectionOptions);\n\n\tfor (let i = 0; i < propCount; i++) {\n\t\tconst propName = propNames[i];\n\t\tlet propValue = properties[propName];\n\t\tconst previousValue = previousProperties![propName];\n\t\tif (propName === 'classes') {\n\t\t\tconst previousClasses = Array.isArray(previousValue) ? previousValue : [previousValue];\n\t\t\tconst currentClasses = Array.isArray(propValue) ? propValue : [propValue];\n\t\t\tif (previousClasses && previousClasses.length > 0) {\n\t\t\t\tif (!propValue || propValue.length === 0) {\n\t\t\t\t\tfor (let i = 0; i < previousClasses.length; i++) {\n\t\t\t\t\t\tremoveClasses(domNode, previousClasses[i]);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tconst newClasses: (null | undefined | string)[] = [...currentClasses];\n\t\t\t\t\tfor (let i = 0; i < previousClasses.length; i++) {\n\t\t\t\t\t\tconst previousClassName = previousClasses[i];\n\t\t\t\t\t\tif (previousClassName) {\n\t\t\t\t\t\t\tconst classIndex = newClasses.indexOf(previousClassName);\n\t\t\t\t\t\t\tif (classIndex === -1) {\n\t\t\t\t\t\t\t\tremoveClasses(domNode, previousClassName);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tnewClasses.splice(classIndex, 1);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tfor (let i = 0; i < newClasses.length; i++) {\n\t\t\t\t\t\taddClasses(domNode, newClasses[i]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tfor (let i = 0; i < currentClasses.length; i++) {\n\t\t\t\t\taddClasses(domNode, currentClasses[i]);\n\t\t\t\t}\n\t\t\t}\n\t\t} else if (nodeOperations.indexOf(propName) !== -1) {\n\t\t\tnodeOperation(propName, propValue, previousValue, domNode, projectionOptions);\n\t\t} else if (propName === 'styles') {\n\t\t\tconst styleNames = Object.keys(propValue);\n\t\t\tconst styleCount = styleNames.length;\n\t\t\tfor (let j = 0; j < styleCount; j++) {\n\t\t\t\tconst styleName = styleNames[j];\n\t\t\t\tconst newStyleValue = propValue[styleName];\n\t\t\t\tconst oldStyleValue = previousValue && previousValue[styleName];\n\t\t\t\tif (newStyleValue === oldStyleValue) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tpropertiesUpdated = true;\n\t\t\t\tif (newStyleValue) {\n\t\t\t\t\tcheckStyleValue(newStyleValue);\n\t\t\t\t\tprojectionOptions.styleApplyer!(domNode as HTMLElement, styleName, newStyleValue);\n\t\t\t\t} else {\n\t\t\t\t\tprojectionOptions.styleApplyer!(domNode as HTMLElement, styleName, '');\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tif (!propValue && typeof previousValue === 'string') {\n\t\t\t\tpropValue = '';\n\t\t\t}\n\t\t\tif (propName === 'value') {\n\t\t\t\tconst domValue = (domNode as any)[propName];\n\t\t\t\tif (\n\t\t\t\t\tdomValue !== propValue &&\n\t\t\t\t\t((domNode as any)['oninput-value']\n\t\t\t\t\t\t? domValue === (domNode as any)['oninput-value']\n\t\t\t\t\t\t: propValue !== previousValue)\n\t\t\t\t) {\n\t\t\t\t\t(domNode as any)[propName] = propValue;\n\t\t\t\t\t(domNode as any)['oninput-value'] = undefined;\n\t\t\t\t}\n\t\t\t\tif (propValue !== previousValue) {\n\t\t\t\t\tpropertiesUpdated = true;\n\t\t\t\t}\n\t\t\t} else if (propName !== 'key' && propValue !== previousValue) {\n\t\t\t\tconst type = typeof propValue;\n\t\t\t\tif (type === 'function' && propName.lastIndexOf('on', 0) === 0 && includesEventsAndAttributes) {\n\t\t\t\t\tupdateEvent(\n\t\t\t\t\t\tdomNode,\n\t\t\t\t\t\tpropName.substr(2),\n\t\t\t\t\t\tpropValue,\n\t\t\t\t\t\tprojectionOptions,\n\t\t\t\t\t\tproperties.bind,\n\t\t\t\t\t\tpreviousValue\n\t\t\t\t\t);\n\t\t\t\t} else if (type === 'string' && propName !== 'innerHTML' && includesEventsAndAttributes) {\n\t\t\t\t\tupdateAttribute(domNode, propName, propValue, projectionOptions);\n\t\t\t\t} else if (propName === 'scrollLeft' || propName === 'scrollTop') {\n\t\t\t\t\tif ((domNode as any)[propName] !== propValue) {\n\t\t\t\t\t\t(domNode as any)[propName] = propValue;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t(domNode as any)[propName] = propValue;\n\t\t\t\t}\n\t\t\t\tpropertiesUpdated = true;\n\t\t\t}\n\t\t}\n\t}\n\treturn propertiesUpdated;\n}\n\nfunction findIndexOfChild(children: InternalDNode[], sameAs: InternalDNode, start: number) {\n\tfor (let i = start; i < children.length; i++) {\n\t\tif (same(children[i], sameAs)) {\n\t\t\treturn i;\n\t\t}\n\t}\n\treturn -1;\n}\n\nexport function toParentVNode(domNode: Element): InternalVNode {\n\treturn {\n\t\ttag: '',\n\t\tproperties: {},\n\t\tchildren: undefined,\n\t\tdomNode,\n\t\ttype: VNODE\n\t};\n}\n\nexport function toTextVNode(data: any): InternalVNode {\n\treturn {\n\t\ttag: '',\n\t\tproperties: {},\n\t\tchildren: undefined,\n\t\ttext: `${data}`,\n\t\tdomNode: undefined,\n\t\ttype: VNODE\n\t};\n}\n\nfunction toInternalWNode(instance: DefaultWidgetBaseInterface, instanceData: WidgetData): InternalWNode {\n\treturn {\n\t\tinstance,\n\t\trendered: [],\n\t\tcoreProperties: instanceData.coreProperties,\n\t\tchildren: instance.children as any,\n\t\twidgetConstructor: instance.constructor as any,\n\t\tproperties: instanceData.inputProperties,\n\t\ttype: WNODE\n\t};\n}\n\nexport function filterAndDecorateChildren(\n\tchildren: undefined | DNode | DNode[],\n\tinstance: DefaultWidgetBaseInterface\n): InternalDNode[] {\n\tif (children === undefined) {\n\t\treturn emptyArray;\n\t}\n\tchildren = Array.isArray(children) ? children : [children];\n\n\tfor (let i = 0; i < children.length; ) {\n\t\tconst child = children[i] as InternalDNode;\n\t\tif (child === undefined || child === null) {\n\t\t\tchildren.splice(i, 1);\n\t\t\tcontinue;\n\t\t} else if (typeof child === 'string') {\n\t\t\tchildren[i] = toTextVNode(child);\n\t\t} else {\n\t\t\tif (isVNode(child)) {\n\t\t\t\tif (child.properties.bind === undefined) {\n\t\t\t\t\t(child.properties as any).bind = instance;\n\t\t\t\t\tif (child.children && child.children.length > 0) {\n\t\t\t\t\t\tfilterAndDecorateChildren(child.children, instance);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (!child.coreProperties) {\n\t\t\t\t\tconst instanceData = widgetInstanceMap.get(instance)!;\n\t\t\t\t\tchild.coreProperties = {\n\t\t\t\t\t\tbind: instance,\n\t\t\t\t\t\tbaseRegistry: instanceData.coreProperties.baseRegistry\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t\tif (child.children && child.children.length > 0) {\n\t\t\t\t\tfilterAndDecorateChildren(child.children, instance);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\ti++;\n\t}\n\treturn children as InternalDNode[];\n}\n\nfunction nodeAdded(dnode: InternalDNode, transitions: TransitionStrategy) {\n\tif (isVNode(dnode) && dnode.properties) {\n\t\tconst enterAnimation = dnode.properties.enterAnimation;\n\t\tif (enterAnimation) {\n\t\t\tif (typeof enterAnimation === 'function') {\n\t\t\t\tenterAnimation(dnode.domNode as Element, dnode.properties);\n\t\t\t} else {\n\t\t\t\ttransitions.enter(dnode.domNode as Element, dnode.properties, enterAnimation as string);\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunction nodeToRemove(dnode: InternalDNode, transitions: TransitionStrategy, projectionOptions: ProjectionOptions) {\n\tif (isWNode(dnode)) {\n\t\tconst item = instanceMap.get(dnode.instance);\n\t\tconst rendered = (item ? item.dnode.rendered : dnode.rendered) || emptyArray;\n\t\tif (dnode.instance) {\n\t\t\tconst instanceData = widgetInstanceMap.get(dnode.instance)!;\n\t\t\tinstanceData.onDetach();\n\t\t\tinstanceMap.delete(dnode.instance);\n\t\t}\n\t\tfor (let i = 0; i < rendered.length; i++) {\n\t\t\tnodeToRemove(rendered[i], transitions, projectionOptions);\n\t\t}\n\t} else {\n\t\tconst domNode = dnode.domNode;\n\t\tconst properties = dnode.properties;\n\t\tif (dnode.children && dnode.children.length > 0) {\n\t\t\tfor (let i = 0; i < dnode.children.length; i++) {\n\t\t\t\tnodeToRemove(dnode.children[i], transitions, projectionOptions);\n\t\t\t}\n\t\t}\n\t\tconst exitAnimation = properties.exitAnimation;\n\t\tif (properties && exitAnimation) {\n\t\t\t(domNode as HTMLElement).style.pointerEvents = 'none';\n\t\t\tconst removeDomNode = function() {\n\t\t\t\tdomNode && domNode.parentNode && domNode.parentNode.removeChild(domNode);\n\t\t\t\tdnode.domNode = undefined;\n\t\t\t};\n\t\t\tif (typeof exitAnimation === 'function') {\n\t\t\t\texitAnimation(domNode as Element, removeDomNode, properties);\n\t\t\t\treturn;\n\t\t\t} else {\n\t\t\t\ttransitions.exit(dnode.domNode as Element, properties, exitAnimation as string, removeDomNode);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\tdomNode && domNode.parentNode && domNode.parentNode.removeChild(domNode);\n\t\tdnode.domNode = undefined;\n\t}\n}\n\nfunction checkDistinguishable(\n\tchildNodes: InternalDNode[],\n\tindexToCheck: number,\n\tparentInstance: DefaultWidgetBaseInterface\n) {\n\tconst childNode = childNodes[indexToCheck];\n\tif (isVNode(childNode) && !childNode.tag) {\n\t\treturn; // Text nodes need not be distinguishable\n\t}\n\tconst { key } = childNode.properties;\n\n\tif (key === undefined || key === null) {\n\t\tfor (let i = 0; i < childNodes.length; i++) {\n\t\t\tif (i !== indexToCheck) {\n\t\t\t\tconst node = childNodes[i];\n\t\t\t\tif (same(node, childNode)) {\n\t\t\t\t\tlet nodeIdentifier: string;\n\t\t\t\t\tconst parentName = (parentInstance as any).constructor.name || 'unknown';\n\t\t\t\t\tif (isWNode(childNode)) {\n\t\t\t\t\t\tnodeIdentifier = (childNode.widgetConstructor as any).name || 'unknown';\n\t\t\t\t\t} else {\n\t\t\t\t\t\tnodeIdentifier = childNode.tag;\n\t\t\t\t\t}\n\n\t\t\t\t\tconsole.warn(\n\t\t\t\t\t\t`A widget (${parentName}) has had a child addded or removed, but they were not able to uniquely identified. It is recommended to provide a unique 'key' property when using the same widget or element (${nodeIdentifier}) multiple times as siblings`\n\t\t\t\t\t);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunction updateChildren(\n\tparentVNode: InternalVNode,\n\tsiblings: InternalDNode[],\n\toldChildren: InternalDNode[],\n\tnewChildren: InternalDNode[],\n\tparentInstance: DefaultWidgetBaseInterface,\n\tprojectionOptions: ProjectionOptions\n) {\n\toldChildren = oldChildren || emptyArray;\n\tnewChildren = newChildren;\n\tconst oldChildrenLength = oldChildren.length;\n\tconst newChildrenLength = newChildren.length;\n\tconst transitions = projectionOptions.transitions!;\n\tconst projectorState = projectorStateMap.get(projectionOptions.projectorInstance)!;\n\tprojectionOptions = { ...projectionOptions, depth: projectionOptions.depth + 1 };\n\tlet oldIndex = 0;\n\tlet newIndex = 0;\n\tlet i: number;\n\tlet textUpdated = false;\n\twhile (newIndex < newChildrenLength) {\n\t\tlet oldChild = oldIndex < oldChildrenLength ? oldChildren[oldIndex] : undefined;\n\t\tconst newChild = newChildren[newIndex];\n\t\tif (isVNode(newChild) && typeof newChild.deferredPropertiesCallback === 'function') {\n\t\t\tnewChild.inserted = isVNode(oldChild) && oldChild.inserted;\n\t\t\taddDeferredProperties(newChild, projectionOptions);\n\t\t}\n\t\tif (oldChild !== undefined && same(oldChild, newChild)) {\n\t\t\toldIndex++;\n\t\t\tnewIndex++;\n\t\t\ttextUpdated =\n\t\t\t\tupdateDom(\n\t\t\t\t\toldChild,\n\t\t\t\t\tnewChild,\n\t\t\t\t\tprojectionOptions,\n\t\t\t\t\tparentVNode,\n\t\t\t\t\tparentInstance,\n\t\t\t\t\toldChildren.slice(oldIndex),\n\t\t\t\t\tnewChildren.slice(newIndex)\n\t\t\t\t) || textUpdated;\n\t\t\tcontinue;\n\t\t}\n\n\t\tconst findOldIndex = findIndexOfChild(oldChildren, newChild, oldIndex + 1);\n\t\tconst addChild = () => {\n\t\t\tlet insertBeforeDomNode: Node | undefined = undefined;\n\t\t\tlet childrenArray = oldChildren;\n\t\t\tlet nextIndex = oldIndex + 1;\n\t\t\tlet child: InternalDNode = oldChildren[oldIndex];\n\t\t\tif (!child) {\n\t\t\t\tchild = siblings[0];\n\t\t\t\tnextIndex = 1;\n\t\t\t\tchildrenArray = siblings;\n\t\t\t}\n\t\t\tif (child) {\n\t\t\t\tlet insertBeforeChildren = [child];\n\t\t\t\twhile (insertBeforeChildren.length) {\n\t\t\t\t\tconst insertBefore = insertBeforeChildren.shift()!;\n\t\t\t\t\tif (isWNode(insertBefore)) {\n\t\t\t\t\t\tconst item = instanceMap.get(insertBefore.instance);\n\t\t\t\t\t\tif (item && item.dnode.rendered) {\n\t\t\t\t\t\t\tinsertBeforeChildren.push(...item.dnode.rendered);\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (insertBefore.domNode) {\n\t\t\t\t\t\t\tif (insertBefore.domNode.parentElement !== parentVNode.domNode) {\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tinsertBeforeDomNode = insertBefore.domNode;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (insertBeforeChildren.length === 0 && childrenArray[nextIndex]) {\n\t\t\t\t\t\tinsertBeforeChildren.push(childrenArray[nextIndex]);\n\t\t\t\t\t\tnextIndex++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tcreateDom(\n\t\t\t\tnewChild,\n\t\t\t\tparentVNode,\n\t\t\t\tnewChildren.slice(newIndex + 1),\n\t\t\t\tinsertBeforeDomNode,\n\t\t\t\tprojectionOptions,\n\t\t\t\tparentInstance\n\t\t\t);\n\t\t\tnodeAdded(newChild, transitions);\n\t\t\tconst indexToCheck = newIndex;\n\t\t\tprojectorState.afterRenderCallbacks.push(() => {\n\t\t\t\tcheckDistinguishable(newChildren, indexToCheck, parentInstance);\n\t\t\t});\n\t\t};\n\n\t\tif (!oldChild || findOldIndex === -1) {\n\t\t\taddChild();\n\t\t\tnewIndex++;\n\t\t\tcontinue;\n\t\t}\n\n\t\tconst removeChild = () => {\n\t\t\tconst indexToCheck = oldIndex;\n\t\t\tprojectorState.afterRenderCallbacks.push(() => {\n\t\t\t\tcheckDistinguishable(oldChildren, indexToCheck, parentInstance);\n\t\t\t});\n\t\t\tif (isWNode(oldChild)) {\n\t\t\t\tconst item = instanceMap.get(oldChild.instance);\n\t\t\t\tif (item) {\n\t\t\t\t\toldChild = item.dnode;\n\t\t\t\t}\n\t\t\t}\n\t\t\tnodeToRemove(oldChild!, transitions, projectionOptions);\n\t\t};\n\t\tconst findNewIndex = findIndexOfChild(newChildren, oldChild, newIndex + 1);\n\n\t\tif (findNewIndex === -1) {\n\t\t\tremoveChild();\n\t\t\toldIndex++;\n\t\t\tcontinue;\n\t\t}\n\n\t\taddChild();\n\t\tremoveChild();\n\t\toldIndex++;\n\t\tnewIndex++;\n\t}\n\tif (oldChildrenLength > oldIndex) {\n\t\t// Remove child fragments\n\t\tfor (i = oldIndex; i < oldChildrenLength; i++) {\n\t\t\tconst indexToCheck = i;\n\t\t\tprojectorState.afterRenderCallbacks.push(() => {\n\t\t\t\tcheckDistinguishable(oldChildren, indexToCheck, parentInstance);\n\t\t\t});\n\t\t\tlet childToRemove = oldChildren[i];\n\t\t\tif (isWNode(childToRemove)) {\n\t\t\t\tconst item = instanceMap.get(childToRemove.instance);\n\t\t\t\tif (item) {\n\t\t\t\t\tchildToRemove = item.dnode;\n\t\t\t\t}\n\t\t\t}\n\t\t\tnodeToRemove(childToRemove, transitions, projectionOptions);\n\t\t}\n\t}\n\treturn textUpdated;\n}\n\nfunction addChildren(\n\tparentVNode: InternalVNode,\n\tchildren: InternalDNode[] | undefined,\n\tprojectionOptions: ProjectionOptions,\n\tparentInstance: DefaultWidgetBaseInterface,\n\tinsertBefore: Node | undefined = undefined,\n\tchildNodes?: (Element | Text)[]\n) {\n\tif (children === undefined) {\n\t\treturn;\n\t}\n\n\tconst projectorState = projectorStateMap.get(projectionOptions.projectorInstance)!;\n\tif (projectorState.merge && childNodes === undefined) {\n\t\tchildNodes = arrayFrom(parentVNode.domNode!.childNodes) as (Element | Text)[];\n\t}\n\tconst transitions = projectionOptions.transitions!;\n\tprojectionOptions = { ...projectionOptions, depth: projectionOptions.depth + 1 };\n\n\tfor (let i = 0; i < children.length; i++) {\n\t\tconst child = children[i];\n\t\tconst nextSiblings = children.slice(i + 1);\n\n\t\tif (isVNode(child)) {\n\t\t\tif (projectorState.merge && childNodes) {\n\t\t\t\tlet domElement: Element | undefined = undefined;\n\t\t\t\twhile (child.domNode === undefined && childNodes.length > 0) {\n\t\t\t\t\tdomElement = childNodes.shift() as Element;\n\t\t\t\t\tif (domElement && domElement.tagName === (child.tag.toUpperCase() || undefined)) {\n\t\t\t\t\t\tchild.domNode = domElement;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tcreateDom(child, parentVNode, nextSiblings, insertBefore, projectionOptions, parentInstance);\n\t\t} else {\n\t\t\tcreateDom(child, parentVNode, nextSiblings, insertBefore, projectionOptions, parentInstance, childNodes);\n\t\t}\n\t\tnodeAdded(child, transitions);\n\t}\n}\n\nfunction initPropertiesAndChildren(\n\tdomNode: Element,\n\tdnode: InternalVNode,\n\tparentInstance: DefaultWidgetBaseInterface,\n\tprojectionOptions: ProjectionOptions\n) {\n\taddChildren(dnode, dnode.children, projectionOptions, parentInstance, undefined);\n\tif (typeof dnode.deferredPropertiesCallback === 'function' && dnode.inserted === undefined) {\n\t\taddDeferredProperties(dnode, projectionOptions);\n\t}\n\n\tif (dnode.attributes && dnode.events) {\n\t\tupdateAttributes(domNode, {}, dnode.attributes, projectionOptions);\n\t\tupdateProperties(domNode, {}, dnode.properties, projectionOptions, false);\n\t\tremoveOrphanedEvents(domNode, {}, dnode.events, projectionOptions, true);\n\t\tconst events = dnode.events;\n\t\tObject.keys(events).forEach((event) => {\n\t\t\tupdateEvent(domNode, event, events[event], projectionOptions, dnode.properties.bind);\n\t\t});\n\t} else {\n\t\tupdateProperties(domNode, {}, dnode.properties, projectionOptions);\n\t}\n\tif (dnode.properties.key !== null && dnode.properties.key !== undefined) {\n\t\tconst instanceData = widgetInstanceMap.get(parentInstance)!;\n\t\tinstanceData.nodeHandler.add(domNode as HTMLElement, `${dnode.properties.key}`);\n\t}\n\tdnode.inserted = true;\n}\n\nfunction createDom(\n\tdnode: InternalDNode,\n\tparentVNode: InternalVNode,\n\tnextSiblings: InternalDNode[],\n\tinsertBefore: Node | undefined,\n\tprojectionOptions: ProjectionOptions,\n\tparentInstance: DefaultWidgetBaseInterface,\n\tchildNodes?: (Element | Text)[]\n) {\n\tlet domNode: Element | Text | undefined;\n\tconst projectorState = projectorStateMap.get(projectionOptions.projectorInstance)!;\n\tif (isWNode(dnode)) {\n\t\tlet { widgetConstructor } = dnode;\n\t\tconst parentInstanceData = widgetInstanceMap.get(parentInstance)!;\n\t\tif (!isWidgetBaseConstructor(widgetConstructor)) {\n\t\t\tconst item = parentInstanceData.registry().get(widgetConstructor);\n\t\t\tif (item === null) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\twidgetConstructor = item;\n\t\t}\n\t\tconst instance = new widgetConstructor();\n\t\tdnode.instance = instance;\n\t\tnextSiblingMap.set(instance, nextSiblings);\n\t\tconst instanceData = widgetInstanceMap.get(instance)!;\n\t\tinstanceData.invalidate = () => {\n\t\t\tinstanceData.dirty = true;\n\t\t\tif (instanceData.rendering === false) {\n\t\t\t\tprojectorState.renderQueue.push({ instance, depth: projectionOptions.depth });\n\t\t\t\tscheduleRender(projectionOptions);\n\t\t\t}\n\t\t};\n\t\tinstanceData.rendering = true;\n\t\tinstance.__setCoreProperties__(dnode.coreProperties);\n\t\tinstance.__setChildren__(dnode.children);\n\t\tinstance.__setProperties__(dnode.properties);\n\t\tconst rendered = instance.__render__();\n\t\tinstanceData.rendering = false;\n\t\tif (rendered) {\n\t\t\tconst filteredRendered = filterAndDecorateChildren(rendered, instance);\n\t\t\tdnode.rendered = filteredRendered;\n\t\t\taddChildren(parentVNode, filteredRendered, projectionOptions, instance, insertBefore, childNodes);\n\t\t}\n\t\tinstanceMap.set(instance, { dnode, parentVNode });\n\t\tinstanceData.nodeHandler.addRoot();\n\t\tprojectorState.afterRenderCallbacks.push(() => {\n\t\t\tinstanceData.onAttach();\n\t\t});\n\t} else {\n\t\tif (projectorState.merge && projectorState.mergeElement !== undefined) {\n\t\t\tdomNode = dnode.domNode = projectionOptions.mergeElement;\n\t\t\tprojectorState.mergeElement = undefined;\n\t\t\tinitPropertiesAndChildren(domNode!, dnode, parentInstance, projectionOptions);\n\t\t\treturn;\n\t\t}\n\t\tconst doc = parentVNode.domNode!.ownerDocument;\n\t\tif (!dnode.tag && typeof dnode.text === 'string') {\n\t\t\tif (dnode.domNode !== undefined && parentVNode.domNode) {\n\t\t\t\tconst newDomNode = dnode.domNode.ownerDocument.createTextNode(dnode.text!);\n\t\t\t\tif (parentVNode.domNode === dnode.domNode.parentNode) {\n\t\t\t\t\tparentVNode.domNode.replaceChild(newDomNode, dnode.domNode);\n\t\t\t\t} else {\n\t\t\t\t\tparentVNode.domNode.appendChild(newDomNode);\n\t\t\t\t\tdnode.domNode.parentNode && dnode.domNode.parentNode.removeChild(dnode.domNode);\n\t\t\t\t}\n\t\t\t\tdnode.domNode = newDomNode;\n\t\t\t} else {\n\t\t\t\tdomNode = dnode.domNode = doc.createTextNode(dnode.text!);\n\t\t\t\tif (insertBefore !== undefined) {\n\t\t\t\t\tparentVNode.domNode!.insertBefore(domNode, insertBefore);\n\t\t\t\t} else {\n\t\t\t\t\tparentVNode.domNode!.appendChild(domNode);\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tif (dnode.domNode === undefined) {\n\t\t\t\tif (dnode.tag === 'svg') {\n\t\t\t\t\tprojectionOptions = { ...projectionOptions, ...{ namespace: NAMESPACE_SVG } };\n\t\t\t\t}\n\t\t\t\tif (projectionOptions.namespace !== undefined) {\n\t\t\t\t\tdomNode = dnode.domNode = doc.createElementNS(projectionOptions.namespace, dnode.tag);\n\t\t\t\t} else {\n\t\t\t\t\tdomNode = dnode.domNode = dnode.domNode || doc.createElement(dnode.tag);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tdomNode = dnode.domNode;\n\t\t\t}\n\t\t\tinitPropertiesAndChildren(domNode! as Element, dnode, parentInstance, projectionOptions);\n\t\t\tif (insertBefore !== undefined) {\n\t\t\t\tparentVNode.domNode!.insertBefore(domNode, insertBefore);\n\t\t\t} else if (domNode!.parentNode !== parentVNode.domNode!) {\n\t\t\t\tparentVNode.domNode!.appendChild(domNode);\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunction updateDom(\n\tprevious: any,\n\tdnode: InternalDNode,\n\tprojectionOptions: ProjectionOptions,\n\tparentVNode: InternalVNode,\n\tparentInstance: DefaultWidgetBaseInterface,\n\toldNextSiblings: InternalDNode[],\n\tnextSiblings: InternalDNode[]\n) {\n\tif (isWNode(dnode)) {\n\t\tconst { instance } = previous;\n\t\tconst { parentVNode, dnode: node } = instanceMap.get(instance)!;\n\t\tconst previousRendered = node ? node.rendered : previous.rendered;\n\t\tconst instanceData = widgetInstanceMap.get(instance)!;\n\t\tinstanceData.rendering = true;\n\t\tinstance.__setCoreProperties__(dnode.coreProperties);\n\t\tinstance.__setChildren__(dnode.children);\n\t\tinstance.__setProperties__(dnode.properties);\n\t\tnextSiblingMap.set(instance, nextSiblings);\n\t\tdnode.instance = instance;\n\t\tif (instanceData.dirty === true) {\n\t\t\tconst rendered = instance.__render__();\n\t\t\tinstanceData.rendering = false;\n\t\t\tdnode.rendered = filterAndDecorateChildren(rendered, instance);\n\t\t\tupdateChildren(parentVNode, oldNextSiblings, previousRendered, dnode.rendered, instance, projectionOptions);\n\t\t} else {\n\t\t\tinstanceData.rendering = false;\n\t\t\tdnode.rendered = previousRendered;\n\t\t}\n\t\tinstanceMap.set(instance, { dnode, parentVNode });\n\t\tinstanceData.nodeHandler.addRoot();\n\t} else {\n\t\tif (previous === dnode) {\n\t\t\treturn false;\n\t\t}\n\t\tconst domNode = (dnode.domNode = previous.domNode);\n\t\tlet textUpdated = false;\n\t\tlet updated = false;\n\t\tif (!dnode.tag && typeof dnode.text === 'string') {\n\t\t\tif (dnode.text !== previous.text) {\n\t\t\t\tconst newDomNode = domNode.ownerDocument.createTextNode(dnode.text!);\n\t\t\t\tdomNode.parentNode!.replaceChild(newDomNode, domNode);\n\t\t\t\tdnode.domNode = newDomNode;\n\t\t\t\ttextUpdated = true;\n\t\t\t\treturn textUpdated;\n\t\t\t}\n\t\t} else {\n\t\t\tif (dnode.tag && dnode.tag.lastIndexOf('svg', 0) === 0) {\n\t\t\t\tprojectionOptions = { ...projectionOptions, ...{ namespace: NAMESPACE_SVG } };\n\t\t\t}\n\t\t\tif (previous.children !== dnode.children) {\n\t\t\t\tconst children = filterAndDecorateChildren(dnode.children, parentInstance);\n\t\t\t\tdnode.children = children;\n\t\t\t\tupdated =\n\t\t\t\t\tupdateChildren(\n\t\t\t\t\t\tdnode,\n\t\t\t\t\t\toldNextSiblings,\n\t\t\t\t\t\tprevious.children,\n\t\t\t\t\t\tchildren,\n\t\t\t\t\t\tparentInstance,\n\t\t\t\t\t\tprojectionOptions\n\t\t\t\t\t) || updated;\n\t\t\t}\n\n\t\t\tconst previousProperties = buildPreviousProperties(domNode, previous, dnode);\n\t\t\tif (dnode.attributes && dnode.events) {\n\t\t\t\tupdateAttributes(domNode, previousProperties.attributes, dnode.attributes, projectionOptions);\n\t\t\t\tupdated =\n\t\t\t\t\tupdateProperties(\n\t\t\t\t\t\tdomNode,\n\t\t\t\t\t\tpreviousProperties.properties,\n\t\t\t\t\t\tdnode.properties,\n\t\t\t\t\t\tprojectionOptions,\n\t\t\t\t\t\tfalse\n\t\t\t\t\t) || updated;\n\t\t\t\tremoveOrphanedEvents(domNode, previousProperties.events, dnode.events, projectionOptions, true);\n\t\t\t\tconst events = dnode.events;\n\t\t\t\tObject.keys(events).forEach((event) => {\n\t\t\t\t\tupdateEvent(\n\t\t\t\t\t\tdomNode,\n\t\t\t\t\t\tevent,\n\t\t\t\t\t\tevents[event],\n\t\t\t\t\t\tprojectionOptions,\n\t\t\t\t\t\tdnode.properties.bind,\n\t\t\t\t\t\tpreviousProperties.events[event]\n\t\t\t\t\t);\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\tupdated =\n\t\t\t\t\tupdateProperties(domNode, previousProperties.properties, dnode.properties, projectionOptions) ||\n\t\t\t\t\tupdated;\n\t\t\t}\n\n\t\t\tif (dnode.properties.key !== null && dnode.properties.key !== undefined) {\n\t\t\t\tconst instanceData = widgetInstanceMap.get(parentInstance)!;\n\t\t\t\tinstanceData.nodeHandler.add(domNode, `${dnode.properties.key}`);\n\t\t\t}\n\t\t}\n\t\tif (updated && dnode.properties && dnode.properties.updateAnimation) {\n\t\t\tdnode.properties.updateAnimation(domNode as Element, dnode.properties, previous.properties);\n\t\t}\n\t}\n}\n\nfunction addDeferredProperties(vnode: InternalVNode, projectionOptions: ProjectionOptions) {\n\t// transfer any properties that have been passed - as these must be decorated properties\n\tvnode.decoratedDeferredProperties = vnode.properties;\n\tconst properties = vnode.deferredPropertiesCallback!(!!vnode.inserted);\n\tconst projectorState = projectorStateMap.get(projectionOptions.projectorInstance)!;\n\tvnode.properties = { ...properties, ...vnode.decoratedDeferredProperties };\n\tprojectorState.deferredRenderCallbacks.push(() => {\n\t\tconst properties = {\n\t\t\t...vnode.deferredPropertiesCallback!(!!vnode.inserted),\n\t\t\t...vnode.decoratedDeferredProperties\n\t\t};\n\t\tupdateProperties(vnode.domNode! as Element, vnode.properties, properties, projectionOptions);\n\t\tvnode.properties = properties;\n\t});\n}\n\nfunction runDeferredRenderCallbacks(projectionOptions: ProjectionOptions) {\n\tconst projectorState = projectorStateMap.get(projectionOptions.projectorInstance)!;\n\tif (projectorState.deferredRenderCallbacks.length) {\n\t\tif (projectionOptions.sync) {\n\t\t\twhile (projectorState.deferredRenderCallbacks.length) {\n\t\t\t\tconst callback = projectorState.deferredRenderCallbacks.shift();\n\t\t\t\tcallback && callback();\n\t\t\t}\n\t\t} else {\n\t\t\tglobal.requestAnimationFrame(() => {\n\t\t\t\twhile (projectorState.deferredRenderCallbacks.length) {\n\t\t\t\t\tconst callback = projectorState.deferredRenderCallbacks.shift();\n\t\t\t\t\tcallback && callback();\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t}\n}\n\nfunction runAfterRenderCallbacks(projectionOptions: ProjectionOptions) {\n\tconst projectorState = projectorStateMap.get(projectionOptions.projectorInstance)!;\n\tif (projectionOptions.sync) {\n\t\twhile (projectorState.afterRenderCallbacks.length) {\n\t\t\tconst callback = projectorState.afterRenderCallbacks.shift();\n\t\t\tcallback && callback();\n\t\t}\n\t} else {\n\t\tif (global.requestIdleCallback) {\n\t\t\tglobal.requestIdleCallback(() => {\n\t\t\t\twhile (projectorState.afterRenderCallbacks.length) {\n\t\t\t\t\tconst callback = projectorState.afterRenderCallbacks.shift();\n\t\t\t\t\tcallback && callback();\n\t\t\t\t}\n\t\t\t});\n\t\t} else {\n\t\t\tsetTimeout(() => {\n\t\t\t\twhile (projectorState.afterRenderCallbacks.length) {\n\t\t\t\t\tconst callback = projectorState.afterRenderCallbacks.shift();\n\t\t\t\t\tcallback && callback();\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t}\n}\n\nfunction scheduleRender(projectionOptions: ProjectionOptions) {\n\tconst projectorState = projectorStateMap.get(projectionOptions.projectorInstance)!;\n\tif (projectionOptions.sync) {\n\t\trender(projectionOptions);\n\t} else if (projectorState.renderScheduled === undefined) {\n\t\tprojectorState.renderScheduled = global.requestAnimationFrame(() => {\n\t\t\trender(projectionOptions);\n\t\t});\n\t}\n}\n\nfunction render(projectionOptions: ProjectionOptions) {\n\tconst projectorState = projectorStateMap.get(projectionOptions.projectorInstance)!;\n\tprojectorState.renderScheduled = undefined;\n\tconst renderQueue = projectorState.renderQueue;\n\tconst renders = [...renderQueue];\n\tprojectorState.renderQueue = [];\n\trenders.sort((a, b) => a.depth - b.depth);\n\tconst previouslyRendered = [];\n\twhile (renders.length) {\n\t\tconst { instance } = renders.shift()!;\n\t\tif (instanceMap.has(instance) && previouslyRendered.indexOf(instance) === -1) {\n\t\t\tpreviouslyRendered.push(instance);\n\t\t\tconst { parentVNode, dnode } = instanceMap.get(instance)!;\n\t\t\tconst instanceData = widgetInstanceMap.get(instance)!;\n\t\t\tconst nextSiblings = nextSiblingMap.get(instance)!;\n\t\t\tupdateDom(\n\t\t\t\tdnode,\n\t\t\t\ttoInternalWNode(instance, instanceData),\n\t\t\t\tprojectionOptions,\n\t\t\t\tparentVNode,\n\t\t\t\tinstance,\n\t\t\t\tnextSiblings,\n\t\t\t\tnextSiblings\n\t\t\t);\n\t\t}\n\t}\n\trunAfterRenderCallbacks(projectionOptions);\n\trunDeferredRenderCallbacks(projectionOptions);\n}\n\nexport const dom = {\n\tappend: function(\n\t\tparentNode: Element,\n\t\tinstance: DefaultWidgetBaseInterface,\n\t\tprojectionOptions: Partial = {}\n\t): Projection {\n\t\tconst instanceData = widgetInstanceMap.get(instance)!;\n\t\tconst finalProjectorOptions = getProjectionOptions(projectionOptions, instance);\n\t\tconst projectorState: ProjectorState = {\n\t\t\tafterRenderCallbacks: [],\n\t\t\tdeferredRenderCallbacks: [],\n\t\t\tnodeMap: new WeakMap(),\n\t\t\trenderScheduled: undefined,\n\t\t\trenderQueue: [],\n\t\t\tmerge: projectionOptions.merge || false,\n\t\t\tmergeElement: projectionOptions.mergeElement\n\t\t};\n\t\tprojectorStateMap.set(instance, projectorState);\n\n\t\tfinalProjectorOptions.rootNode = parentNode;\n\t\tconst parentVNode = toParentVNode(finalProjectorOptions.rootNode);\n\t\tconst node = toInternalWNode(instance, instanceData);\n\t\tinstanceMap.set(instance, { dnode: node, parentVNode });\n\t\tinstanceData.invalidate = () => {\n\t\t\tinstanceData.dirty = true;\n\t\t\tif (instanceData.rendering === false) {\n\t\t\t\tprojectorState.renderQueue.push({ instance, depth: finalProjectorOptions.depth });\n\t\t\t\tscheduleRender(finalProjectorOptions);\n\t\t\t}\n\t\t};\n\t\tupdateDom(node, node, finalProjectorOptions, parentVNode, instance, [], []);\n\t\tprojectorState.afterRenderCallbacks.push(() => {\n\t\t\tinstanceData.onAttach();\n\t\t});\n\t\trunDeferredRenderCallbacks(finalProjectorOptions);\n\t\trunAfterRenderCallbacks(finalProjectorOptions);\n\t\treturn {\n\t\t\tdomNode: finalProjectorOptions.rootNode\n\t\t};\n\t},\n\tcreate: function(instance: DefaultWidgetBaseInterface, projectionOptions?: Partial): Projection {\n\t\treturn this.append(document.createElement('div'), instance, projectionOptions);\n\t},\n\tmerge: function(\n\t\telement: Element,\n\t\tinstance: DefaultWidgetBaseInterface,\n\t\tprojectionOptions: Partial = {}\n\t): Projection {\n\t\tprojectionOptions.merge = true;\n\t\tprojectionOptions.mergeElement = element;\n\t\tconst projection = this.append(element.parentNode as Element, instance, projectionOptions);\n\t\tconst projectorState = projectorStateMap.get(instance)!;\n\t\tprojectorState.merge = false;\n\t\treturn projection;\n\t}\n};\n"]} \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 38a523fa57..284be75843 100644 --- a/package-lock.json +++ b/package-lock.json @@ -650,7 +650,7 @@ "integrity": "sha1-63d99gEXI6OxTopywIBcjoZ0a9I=", "dev": true, "requires": { - "mime-types": "2.1.18", + "mime-types": "2.1.19", "negotiator": "0.6.1" } }, @@ -692,7 +692,7 @@ "integrity": "sha1-1t4Q1a9hMtW9aSQn1G/FOFOQlMc=", "dev": true, "requires": { - "extend": "3.0.1", + "extend": "3.0.2", "semver": "5.0.3" } }, @@ -1040,7 +1040,7 @@ "dev": true, "requires": { "browserslist": "1.7.7", - "caniuse-db": "1.0.30000867", + "caniuse-db": "1.0.30000869", "normalize-range": "0.1.2", "num2fraction": "1.2.2", "postcss": "5.2.18", @@ -1093,7 +1093,7 @@ "dev": true, "requires": { "chalk": "1.1.3", - "js-base64": "2.4.6", + "js-base64": "2.4.8", "source-map": "0.5.7", "supports-color": "3.2.3" } @@ -1661,7 +1661,7 @@ "integrity": "sha1-C9dnBCWL6CmyOYu1Dkti0aFmsLk=", "dev": true, "requires": { - "caniuse-db": "1.0.30000867", + "caniuse-db": "1.0.30000869", "electron-to-chromium": "1.3.52" } }, @@ -1827,15 +1827,15 @@ "dev": true, "requires": { "browserslist": "1.7.7", - "caniuse-db": "1.0.30000867", + "caniuse-db": "1.0.30000869", "lodash.memoize": "4.1.2", "lodash.uniq": "4.5.0" } }, "caniuse-db": { - "version": "1.0.30000867", - "resolved": "https://registry.npmjs.org/caniuse-db/-/caniuse-db-1.0.30000867.tgz", - "integrity": "sha1-tVpuz6wxB5iJQMnH3+GGYxUxLJc=", + "version": "1.0.30000869", + "resolved": "https://registry.npmjs.org/caniuse-db/-/caniuse-db-1.0.30000869.tgz", + "integrity": "sha1-w9pZ+o2UVt+Iokuyku3g43mHmMs=", "dev": true }, "caniuse-lite": { @@ -2860,7 +2860,7 @@ "dev": true, "requires": { "chalk": "1.1.3", - "js-base64": "2.4.6", + "js-base64": "2.4.8", "source-map": "0.5.7", "supports-color": "3.2.3" } @@ -3032,7 +3032,7 @@ "dev": true, "requires": { "chalk": "1.1.3", - "js-base64": "2.4.6", + "js-base64": "2.4.8", "source-map": "0.5.7", "supports-color": "3.2.3" } @@ -4010,9 +4010,9 @@ } }, "extend": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.1.tgz", - "integrity": "sha1-p1Xqe8Gt/MWjHOfnYtuq3F5jZEQ=", + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", + "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==", "dev": true }, "extend-shallow": { @@ -4546,7 +4546,7 @@ "requires": { "asynckit": "0.4.0", "combined-stream": "1.0.6", - "mime-types": "2.1.18" + "mime-types": "2.1.19" } }, "formatio": { @@ -5753,7 +5753,7 @@ "dev": true, "requires": { "chalk": "1.1.3", - "js-base64": "2.4.6", + "js-base64": "2.4.8", "source-map": "0.5.7", "supports-color": "3.2.3" }, @@ -6256,7 +6256,7 @@ "dev": true, "requires": { "chalk": "1.1.3", - "js-base64": "2.4.6", + "js-base64": "2.4.8", "source-map": "0.5.7", "supports-color": "3.2.3" }, @@ -6944,7 +6944,7 @@ "he": "1.1.1", "param-case": "2.1.1", "relateurl": "0.2.7", - "uglify-js": "3.4.4" + "uglify-js": "3.4.5" } }, "html-webpack-include-assets-plugin": { @@ -7073,7 +7073,7 @@ "requires": { "agent-base": "2.1.1", "debug": "2.6.9", - "extend": "3.0.1" + "extend": "3.0.2" } }, "http-signature": { @@ -7101,7 +7101,7 @@ "requires": { "agent-base": "2.1.1", "debug": "2.6.9", - "extend": "3.0.1" + "extend": "3.0.2" } }, "iconv-lite": { @@ -7294,7 +7294,7 @@ "istanbul-lib-source-maps": "1.2.3", "istanbul-reports": "1.1.4", "lodash": "4.17.10", - "mime-types": "2.1.18", + "mime-types": "2.1.19", "minimatch": "3.0.4", "platform": "1.3.5", "resolve": "1.4.0", @@ -8162,9 +8162,9 @@ } }, "js-base64": { - "version": "2.4.6", - "resolved": "https://registry.npmjs.org/js-base64/-/js-base64-2.4.6.tgz", - "integrity": "sha512-O9SR2NVICx6rCqh1qsU91QZ5IoNa+2T1ROJ0OQlfvATKGmnjsAvg3r0E5ufPZ4a95jdKTPXhFWiE/sOZ7a5Rtg==", + "version": "2.4.8", + "resolved": "https://registry.npmjs.org/js-base64/-/js-base64-2.4.8.tgz", + "integrity": "sha512-hm2nYpDrwoO/OzBhdcqs/XGT6XjSuSSCVEpia+Kl2J6x4CYt5hISlVL/AYU1khoDXv0AQVgxtdJySb9gjAn56Q==", "dev": true }, "js-tokens": { @@ -8885,18 +8885,18 @@ "dev": true }, "mime-db": { - "version": "1.33.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.33.0.tgz", - "integrity": "sha512-BHJ/EKruNIqJf/QahvxwQZXKygOQ256myeN/Ew+THcAa5q+PjyTTMMeNQC4DZw5AwfvelsUrA6B67NKMqXDbzQ==", + "version": "1.35.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.35.0.tgz", + "integrity": "sha512-JWT/IcCTsB0Io3AhWUMjRqucrHSPsSf2xKLaRldJVULioggvkJvggZ3VXNNSRkCddE6D+BUI4HEIZIA2OjwIvg==", "dev": true }, "mime-types": { - "version": "2.1.18", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.18.tgz", - "integrity": "sha512-lc/aahn+t4/SWV/qcmumYjymLsWfN3ELhpmVuUFjgsORruuZPVSwAQryq+HHGvO/SI2KVX26bx+En+zhM8g8hQ==", + "version": "2.1.19", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.19.tgz", + "integrity": "sha512-P1tKYHVSZ6uFo26mtnve4HQFE3koh1UWVkp8YUC+ESBHe945xWSoXuHHiGarDqcEZ+whpCDnlNw5LON0kLo+sw==", "dev": true, "requires": { - "mime-db": "1.33.0" + "mime-db": "1.35.0" } }, "mimic-fn": { @@ -10160,7 +10160,7 @@ "dev": true, "requires": { "chalk": "1.1.3", - "js-base64": "2.4.6", + "js-base64": "2.4.8", "source-map": "0.5.7", "supports-color": "3.2.3" } @@ -10440,7 +10440,7 @@ "dev": true, "requires": { "chalk": "1.1.3", - "js-base64": "2.4.6", + "js-base64": "2.4.8", "source-map": "0.5.7", "supports-color": "3.2.3" } @@ -10527,7 +10527,7 @@ "dev": true, "requires": { "chalk": "1.1.3", - "js-base64": "2.4.6", + "js-base64": "2.4.8", "source-map": "0.5.7", "supports-color": "3.2.3" } @@ -10765,7 +10765,7 @@ "dev": true, "requires": { "chalk": "1.1.3", - "js-base64": "2.4.6", + "js-base64": "2.4.8", "source-map": "0.5.7", "supports-color": "3.2.3" } @@ -10851,7 +10851,7 @@ "dev": true, "requires": { "chalk": "1.1.3", - "js-base64": "2.4.6", + "js-base64": "2.4.8", "source-map": "0.5.7", "supports-color": "3.2.3" } @@ -10937,7 +10937,7 @@ "dev": true, "requires": { "chalk": "1.1.3", - "js-base64": "2.4.6", + "js-base64": "2.4.8", "source-map": "0.5.7", "supports-color": "3.2.3" } @@ -11023,7 +11023,7 @@ "dev": true, "requires": { "chalk": "1.1.3", - "js-base64": "2.4.6", + "js-base64": "2.4.8", "source-map": "0.5.7", "supports-color": "3.2.3" } @@ -11110,7 +11110,7 @@ "dev": true, "requires": { "chalk": "1.1.3", - "js-base64": "2.4.6", + "js-base64": "2.4.8", "source-map": "0.5.7", "supports-color": "3.2.3" } @@ -11196,7 +11196,7 @@ "dev": true, "requires": { "chalk": "1.1.3", - "js-base64": "2.4.6", + "js-base64": "2.4.8", "source-map": "0.5.7", "supports-color": "3.2.3" } @@ -11393,7 +11393,7 @@ "dev": true, "requires": { "chalk": "1.1.3", - "js-base64": "2.4.6", + "js-base64": "2.4.8", "source-map": "0.5.7", "supports-color": "3.2.3" } @@ -11479,7 +11479,7 @@ "dev": true, "requires": { "chalk": "1.1.3", - "js-base64": "2.4.6", + "js-base64": "2.4.8", "source-map": "0.5.7", "supports-color": "3.2.3" } @@ -11569,7 +11569,7 @@ "dev": true, "requires": { "chalk": "1.1.3", - "js-base64": "2.4.6", + "js-base64": "2.4.8", "source-map": "0.5.7", "supports-color": "3.2.3" } @@ -11663,7 +11663,7 @@ "dev": true, "requires": { "chalk": "1.1.3", - "js-base64": "2.4.6", + "js-base64": "2.4.8", "source-map": "0.5.7", "supports-color": "3.2.3" } @@ -11750,7 +11750,7 @@ "dev": true, "requires": { "chalk": "1.1.3", - "js-base64": "2.4.6", + "js-base64": "2.4.8", "source-map": "0.5.7", "supports-color": "3.2.3" } @@ -11839,7 +11839,7 @@ "dev": true, "requires": { "chalk": "1.1.3", - "js-base64": "2.4.6", + "js-base64": "2.4.8", "source-map": "0.5.7", "supports-color": "3.2.3" } @@ -11928,7 +11928,7 @@ "dev": true, "requires": { "chalk": "1.1.3", - "js-base64": "2.4.6", + "js-base64": "2.4.8", "source-map": "0.5.7", "supports-color": "3.2.3" } @@ -12017,7 +12017,7 @@ "dev": true, "requires": { "chalk": "1.1.3", - "js-base64": "2.4.6", + "js-base64": "2.4.8", "source-map": "0.5.7", "supports-color": "3.2.3" } @@ -12164,7 +12164,7 @@ "dev": true, "requires": { "chalk": "1.1.3", - "js-base64": "2.4.6", + "js-base64": "2.4.8", "source-map": "0.5.7", "supports-color": "3.2.3" } @@ -12253,7 +12253,7 @@ "dev": true, "requires": { "chalk": "1.1.3", - "js-base64": "2.4.6", + "js-base64": "2.4.8", "source-map": "0.5.7", "supports-color": "3.2.3" } @@ -12340,7 +12340,7 @@ "dev": true, "requires": { "chalk": "1.1.3", - "js-base64": "2.4.6", + "js-base64": "2.4.8", "source-map": "0.5.7", "supports-color": "3.2.3" } @@ -12446,7 +12446,7 @@ "dev": true, "requires": { "chalk": "1.1.3", - "js-base64": "2.4.6", + "js-base64": "2.4.8", "source-map": "0.5.7", "supports-color": "3.2.3" } @@ -12532,7 +12532,7 @@ "dev": true, "requires": { "chalk": "1.1.3", - "js-base64": "2.4.6", + "js-base64": "2.4.8", "source-map": "0.5.7", "supports-color": "3.2.3" } @@ -12620,7 +12620,7 @@ "dev": true, "requires": { "chalk": "1.1.3", - "js-base64": "2.4.6", + "js-base64": "2.4.8", "source-map": "0.5.7", "supports-color": "3.2.3" } @@ -12765,7 +12765,7 @@ "dev": true, "requires": { "chalk": "1.1.3", - "js-base64": "2.4.6", + "js-base64": "2.4.8", "source-map": "0.5.7", "supports-color": "3.2.3" } @@ -12853,7 +12853,7 @@ "dev": true, "requires": { "chalk": "1.1.3", - "js-base64": "2.4.6", + "js-base64": "2.4.8", "source-map": "0.5.7", "supports-color": "3.2.3" } @@ -12958,7 +12958,7 @@ "dev": true, "requires": { "chalk": "1.1.3", - "js-base64": "2.4.6", + "js-base64": "2.4.8", "source-map": "0.5.7", "supports-color": "3.2.3" } @@ -13665,7 +13665,7 @@ "aws4": "1.7.0", "caseless": "0.12.0", "combined-stream": "1.0.6", - "extend": "3.0.1", + "extend": "3.0.2", "forever-agent": "0.6.1", "form-data": "2.3.2", "har-validator": "5.0.3", @@ -13673,7 +13673,7 @@ "is-typedarray": "1.0.0", "isstream": "0.1.2", "json-stringify-safe": "5.0.1", - "mime-types": "2.1.18", + "mime-types": "2.1.19", "oauth-sign": "0.8.2", "performance-now": "2.1.0", "qs": "6.5.2", @@ -15028,7 +15028,7 @@ "resolve": "1.8.1", "semver": "5.5.0", "tslib": "1.8.1", - "tsutils": "2.27.2" + "tsutils": "2.28.0" }, "dependencies": { "semver": { @@ -15061,9 +15061,9 @@ } }, "tsutils": { - "version": "2.27.2", - "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-2.27.2.tgz", - "integrity": "sha512-qf6rmT84TFMuxAKez2pIfR8UCai49iQsfB7YWVjV1bKpy/d0PWT5rEOSM6La9PiHZ0k1RRZQiwVdVJfQ3BPHgg==", + "version": "2.28.0", + "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-2.28.0.tgz", + "integrity": "sha512-bh5nAtW0tuhvOJnx1GLRn5ScraRLICGyJV5wJhtRWOLsxW70Kk5tZtpK3O/hW6LDnqKS9mlUMPZj9fEMJ0gxqA==", "dev": true, "requires": { "tslib": "1.8.1" @@ -15113,7 +15113,7 @@ "dev": true, "requires": { "media-typer": "0.3.0", - "mime-types": "2.1.18" + "mime-types": "2.1.19" } }, "typed-css-modules": { @@ -15464,9 +15464,9 @@ } }, "uglify-js": { - "version": "3.4.4", - "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.4.4.tgz", - "integrity": "sha512-RiB1kNcC9RMyqwRrjXC+EjgLoXULoDnCaOnEDzUCHkBN0bHwmtF5rzDMiDWU29gu0kXCRRWwtcTAVFWRECmU2Q==", + "version": "3.4.5", + "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.4.5.tgz", + "integrity": "sha512-Fm52gLqJqFBnT+Sn411NPDnsgaWiYeRLw42x7Va/mS8TKgaepwoGY7JLXHSEef3d3PmdFXSz1Zx7KMLL89E2QA==", "dev": true, "requires": { "commander": "2.16.0", diff --git a/package.json b/package.json index bdf2b8319c..a9d7f7315e 100644 --- a/package.json +++ b/package.json @@ -23,7 +23,7 @@ "dist-custom-elements": "npm run build-custom-elements && shx rm -rf dist/all/dist && shx cp -r output/dist dist/all/" }, "peerDependencies": { - "@dojo/framework": "file:./deps/framework" + "@dojo/framework": "3.0.0-alpha.1" }, "devDependencies": { "@dojo/cli": "^2.0.0",