ember-source 7.2.0-beta.1 → 7.3.0-alpha.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build-metadata.json +3 -3
- package/dist/dev/packages/@ember/-internals/deprecations/index.js +10 -0
- package/dist/dev/packages/@ember/-internals/glimmer/index.js +7 -7
- package/dist/dev/packages/@ember/-internals/metal/index.js +8 -8
- package/dist/dev/packages/@ember/-internals/routing/index.js +1 -1
- package/dist/dev/packages/@ember/-internals/runtime/lib/mixins/-proxy.js +3 -3
- package/dist/dev/packages/@ember/-internals/runtime/lib/mixins/comparable.js +5 -0
- package/dist/dev/packages/@ember/-internals/runtime/lib/mixins/target_action_support.js +1 -1
- package/dist/dev/packages/@ember/-internals/views/lib/system/event_dispatcher.js +1 -1
- package/dist/dev/packages/@ember/-internals/views/lib/views/core_view.js +1 -1
- package/dist/dev/packages/@ember/application/index.js +2 -2
- package/dist/dev/packages/@ember/application/instance.js +22 -2
- package/dist/dev/packages/@ember/array/index.js +3 -3
- package/dist/dev/packages/@ember/array/proxy.js +3 -3
- package/dist/dev/packages/@ember/component/helper.js +321 -1
- package/dist/dev/packages/@ember/component/index.js +3 -3
- package/dist/dev/packages/@ember/controller/index.js +2 -2
- package/dist/dev/packages/@ember/engine/index.js +3 -3
- package/dist/dev/packages/@ember/object/computed.js +2 -2
- package/dist/dev/packages/@ember/object/core.js +2 -2
- package/dist/dev/packages/@ember/object/index.js +4 -4
- package/dist/dev/packages/@ember/object/lib/computed/computed_macros.js +3 -3
- package/dist/dev/packages/@ember/object/lib/computed/reduce_computed_macros.js +1 -1
- package/dist/dev/packages/@ember/object/mixin.js +1 -1
- package/dist/dev/packages/@ember/object/observable.js +3 -3
- package/dist/dev/packages/@ember/object/promise-proxy-mixin.js +2 -2
- package/dist/dev/packages/@ember/renderer/index.js +1 -1
- package/dist/dev/packages/@ember/routing/-internals.js +1 -1
- package/dist/dev/packages/@ember/routing/lib/routing-service.js +0 -1
- package/dist/dev/packages/@ember/routing/lib/utils.js +1 -1
- package/dist/dev/packages/@ember/routing/route.js +4 -4
- package/dist/dev/packages/@ember/routing/router-service.js +0 -1
- package/dist/dev/packages/@ember/routing/router.js +3 -3
- package/dist/dev/packages/@ember/service/index.js +1 -1
- package/dist/dev/packages/@ember/utils/lib/compare.js +5 -2
- package/dist/dev/packages/@glimmer/node/index.js +2 -2
- package/dist/dev/packages/@glimmer/runtime/index.js +3 -3
- package/dist/dev/packages/@glimmer/tracking/index.js +1 -1
- package/dist/dev/packages/@glimmer/validator/index.js +1 -1
- package/dist/dev/packages/ember/version.js +1 -1
- package/dist/dev/packages/router_js/index.js +2 -2
- package/dist/dev/packages/shared-chunks/{alias-DpqL1qx6.js → alias-CT_thCad.js} +2 -2
- package/dist/dev/packages/shared-chunks/{api-C0PAtEgQ.js → api-Dz70AUL_.js} +6 -4
- package/dist/dev/packages/shared-chunks/{array-CVEnNWng.js → array-DvaweI_T.js} +1 -1
- package/dist/dev/packages/shared-chunks/{computed-BPCtuOxQ.js → computed-DGxbeUbf.js} +1 -6
- package/dist/dev/packages/shared-chunks/{curly-Ei5G8jhk.js → curly-DGUCLOud.js} +4 -5
- package/dist/dev/packages/shared-chunks/curly-brand-B_F79Dep.js +12 -0
- package/dist/dev/packages/shared-chunks/helper-brand-C9_8vvOf.js +12 -0
- package/dist/dev/packages/shared-chunks/{index-B3pPx1fL.js → index-D1AjYv31.js} +618 -1575
- package/dist/dev/packages/shared-chunks/{injected_property-CbBLr5jt.js → injected_property-DbXd6Gax.js} +1 -1
- package/dist/dev/packages/shared-chunks/outlet-CHFL7tun.js +135 -0
- package/dist/dev/packages/shared-chunks/{property_set-qCUylPEK.js → property_set-CVlVgdor.js} +1 -1
- package/dist/dev/packages/shared-chunks/{rehydrate-builder-C6k1XhET.js → rehydrate-builder-CsnkZkur.js} +1 -1
- package/dist/dev/packages/shared-chunks/{render-87_sKZ_k.js → render-CtH73XOv.js} +10 -5
- package/dist/dev/packages/shared-chunks/{serialize-builder-BlxBjwO-.js → serialize-builder-D1oAeiyl.js} +1 -1
- package/dist/dev/packages/shared-chunks/{set_properties-C4TSebH6.js → set_properties-CEUT_EJn.js} +2 -2
- package/dist/dev/packages/shared-chunks/setup-registry-DQ3c4Juo.js +951 -0
- package/dist/dev/packages/shared-chunks/{textarea-C4lYkaHj.js → textarea-DEvw4ezm.js} +1 -1
- package/dist/dev/packages/shared-chunks/tracked-57EW14Ny.js +253 -0
- package/dist/dev/packages/shared-chunks/tracked-value-DhyJmrhG.js +115 -0
- package/dist/dev/packages/shared-chunks/{unrecognized-url-error-BJHjL30Q.js → unrecognized-url-error-B8loxkay.js} +1 -1
- package/dist/prod/packages/@ember/-internals/deprecations/index.js +10 -0
- package/dist/prod/packages/@ember/-internals/glimmer/index.js +7 -7
- package/dist/prod/packages/@ember/-internals/metal/index.js +8 -8
- package/dist/prod/packages/@ember/-internals/routing/index.js +1 -1
- package/dist/prod/packages/@ember/-internals/runtime/lib/mixins/-proxy.js +3 -3
- package/dist/prod/packages/@ember/-internals/runtime/lib/mixins/comparable.js +5 -0
- package/dist/prod/packages/@ember/-internals/runtime/lib/mixins/target_action_support.js +1 -1
- package/dist/prod/packages/@ember/-internals/views/lib/system/event_dispatcher.js +1 -1
- package/dist/prod/packages/@ember/-internals/views/lib/views/core_view.js +1 -1
- package/dist/prod/packages/@ember/application/index.js +2 -2
- package/dist/prod/packages/@ember/application/instance.js +18 -3
- package/dist/prod/packages/@ember/array/index.js +3 -3
- package/dist/prod/packages/@ember/array/proxy.js +3 -3
- package/dist/prod/packages/@ember/component/helper.js +305 -1
- package/dist/prod/packages/@ember/component/index.js +3 -3
- package/dist/prod/packages/@ember/controller/index.js +2 -2
- package/dist/prod/packages/@ember/engine/index.js +3 -3
- package/dist/prod/packages/@ember/object/computed.js +2 -2
- package/dist/prod/packages/@ember/object/index.js +4 -4
- package/dist/prod/packages/@ember/object/lib/computed/computed_macros.js +3 -3
- package/dist/prod/packages/@ember/object/lib/computed/reduce_computed_macros.js +1 -1
- package/dist/prod/packages/@ember/object/mixin.js +1 -1
- package/dist/prod/packages/@ember/object/observable.js +3 -3
- package/dist/prod/packages/@ember/object/promise-proxy-mixin.js +2 -2
- package/dist/prod/packages/@ember/renderer/index.js +1 -1
- package/dist/prod/packages/@ember/routing/lib/routing-service.js +0 -1
- package/dist/prod/packages/@ember/routing/lib/utils.js +1 -1
- package/dist/prod/packages/@ember/routing/route.js +4 -4
- package/dist/prod/packages/@ember/routing/router-service.js +0 -1
- package/dist/prod/packages/@ember/routing/router.js +3 -3
- package/dist/prod/packages/@ember/service/index.js +1 -1
- package/dist/prod/packages/@ember/utils/lib/compare.js +5 -2
- package/dist/prod/packages/@glimmer/node/index.js +2 -2
- package/dist/prod/packages/@glimmer/runtime/index.js +3 -3
- package/dist/prod/packages/@glimmer/tracking/index.js +1 -1
- package/dist/prod/packages/@glimmer/validator/index.js +1 -1
- package/dist/prod/packages/ember/version.js +1 -1
- package/dist/prod/packages/router_js/index.js +2 -2
- package/dist/prod/packages/shared-chunks/{alias-Bod6qdNp.js → alias-CHHuE0LE.js} +2 -2
- package/dist/prod/packages/shared-chunks/{api-CQexacBn.js → api-DzOa0Acr.js} +6 -4
- package/dist/prod/packages/shared-chunks/{array-BzReKMeW.js → array-CnXdmzOG.js} +1 -1
- package/dist/prod/packages/shared-chunks/{computed-DtIStxvq.js → computed-BNdMwGhH.js} +1 -6
- package/dist/prod/packages/shared-chunks/{curly-IY06zACp.js → curly-a6DP7r87.js} +4 -5
- package/dist/prod/packages/shared-chunks/curly-brand-B_F79Dep.js +12 -0
- package/dist/prod/packages/shared-chunks/helper-brand-C9_8vvOf.js +12 -0
- package/dist/prod/packages/shared-chunks/{index-CslMfEpb.js → index-CvQQ6l11.js} +548 -1451
- package/dist/prod/packages/shared-chunks/{injected_property-Y-FadDej.js → injected_property-DqQ0XV7k.js} +1 -1
- package/dist/prod/packages/shared-chunks/outlet--lIm3q7t.js +132 -0
- package/dist/prod/packages/shared-chunks/{property_set-BaQJdVfS.js → property_set-CkLe4ht8.js} +1 -1
- package/dist/prod/packages/shared-chunks/{rehydrate-builder-Blt1x9MP.js → rehydrate-builder-n_8RCUj9.js} +1 -1
- package/dist/prod/packages/shared-chunks/{render-Dx7lr1hR.js → render-Bf7GviCY.js} +10 -5
- package/dist/prod/packages/shared-chunks/{serialize-builder-BvAXYHTr.js → serialize-builder-CsG9WHVw.js} +1 -1
- package/dist/prod/packages/shared-chunks/{set_properties-Qxhw4qzw.js → set_properties-Cs3rVemD.js} +2 -2
- package/dist/prod/packages/shared-chunks/setup-registry-kOGgOucf.js +886 -0
- package/dist/prod/packages/shared-chunks/{textarea-DOmZ1x0E.js → textarea-DMmdvgk2.js} +1 -1
- package/dist/prod/packages/shared-chunks/tracked-DvOpYI0o.js +235 -0
- package/dist/prod/packages/shared-chunks/tracked-value-CR6kx-73.js +115 -0
- package/dist/prod/packages/shared-chunks/{unrecognized-url-error-EgNrnFu_.js → unrecognized-url-error-jjQ-FqKB.js} +1 -1
- package/docs/data.json +426 -222
- package/package.json +6 -6
- package/types/stable/@ember/-internals/deprecations/index.d.ts +6 -0
- package/types/stable/@ember/-internals/glimmer/lib/base-renderer.d.ts +150 -0
- package/types/stable/@ember/-internals/glimmer/lib/component-managers/curly-brand.d.ts +10 -0
- package/types/stable/@ember/-internals/glimmer/lib/component-managers/curly.d.ts +3 -2
- package/types/stable/@ember/-internals/glimmer/lib/glimmer-tracking-docs.d.ts +68 -0
- package/types/stable/@ember/-internals/glimmer/lib/helper-brand.d.ts +10 -0
- package/types/stable/@ember/-internals/glimmer/lib/helper.d.ts +4 -6
- package/types/stable/@ember/-internals/glimmer/lib/renderer.d.ts +7 -154
- package/types/stable/@ember/-internals/glimmer/lib/router-resolver.d.ts +17 -0
- package/types/stable/@ember/-internals/metal/lib/tracked.d.ts +53 -6
- package/types/stable/@ember/renderer/index.d.ts +2 -2
- package/types/stable/@glimmer/tracking/index.d.ts +70 -1
- package/types/stable/@glimmer/validator/index.d.ts +1 -0
- package/types/stable/@glimmer/validator/lib/tracked-value.d.ts +58 -0
- package/types/stable/index.d.ts +591 -586
- package/dist/dev/packages/shared-chunks/helper-DIj85_-f.js +0 -326
- package/dist/dev/packages/shared-chunks/setup-registry-9DCmHTFF.js +0 -77
- package/dist/dev/packages/shared-chunks/tracked-DEyf0T_X.js +0 -148
- package/dist/dev/packages/shared-chunks/tracked-data-DgqqRdYO.js +0 -31
- package/dist/prod/packages/shared-chunks/helper-DkXiTBjc.js +0 -310
- package/dist/prod/packages/shared-chunks/setup-registry-U-6VaNQG.js +0 -74
- package/dist/prod/packages/shared-chunks/tracked-B9380JtC.js +0 -132
- package/dist/prod/packages/shared-chunks/tracked-data-CHq42QHb.js +0 -31
|
@@ -1 +1,305 @@
|
|
|
1
|
-
|
|
1
|
+
import { setOwner } from '../-internals/owner/index.js';
|
|
2
|
+
import { FrameworkObject } from '../object/-internals.js';
|
|
3
|
+
import { g as getDebugName } from '../../shared-chunks/get-debug-name-BDxIL2Y1.js';
|
|
4
|
+
import { join } from '../runloop/index.js';
|
|
5
|
+
import { i as helperCapabilities } from '../../shared-chunks/api-DlJKfm_f.js';
|
|
6
|
+
import { b as setHelperManager } from '../../shared-chunks/api-B_poQGXS.js';
|
|
7
|
+
import { r as createTag, D as DIRTY_TAG, c as consumeTag } from '../../shared-chunks/cache-CofLhaS4.js';
|
|
8
|
+
import { I as IS_CLASSIC_HELPER } from '../../shared-chunks/helper-brand-C9_8vvOf.js';
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
@module @ember/component
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
const RECOMPUTE_TAG = Symbol('RECOMPUTE_TAG');
|
|
15
|
+
|
|
16
|
+
// Signature type utilities
|
|
17
|
+
|
|
18
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
|
19
|
+
|
|
20
|
+
// Implements Ember's `Factory` interface and tags it for narrowing/checking.
|
|
21
|
+
|
|
22
|
+
// A zero-runtime-overhead private symbol to use in branding the component to
|
|
23
|
+
// preserve its type parameter.
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
Ember Helpers are functions that can compute values, and are used in templates.
|
|
27
|
+
For example, this code calls a helper named `format-currency`:
|
|
28
|
+
|
|
29
|
+
```app/templates/application.gjs
|
|
30
|
+
import Cost from '../components/cost';
|
|
31
|
+
|
|
32
|
+
<template>
|
|
33
|
+
<Cost @cents={{230}} />
|
|
34
|
+
</template>
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
```app/components/cost.gjs
|
|
38
|
+
import formatCurrency from '../helpers/format-currency';
|
|
39
|
+
|
|
40
|
+
<template>
|
|
41
|
+
<div>{{formatCurrency @cents currency="$"}}</div>
|
|
42
|
+
</template>
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
Additionally a helper can be called as a nested helper.
|
|
46
|
+
In this example, we show the formatted currency value if the `showMoney`
|
|
47
|
+
named argument is truthy.
|
|
48
|
+
|
|
49
|
+
```gjs
|
|
50
|
+
import formatCurrency from '../helpers/format-currency';
|
|
51
|
+
|
|
52
|
+
<template>
|
|
53
|
+
{{if @showMoney (formatCurrency @cents currency="$")}}
|
|
54
|
+
</template>
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
Helpers defined using a class must provide a `compute` function. For example:
|
|
58
|
+
|
|
59
|
+
```app/helpers/format-currency.js
|
|
60
|
+
import Helper from '@ember/component/helper';
|
|
61
|
+
|
|
62
|
+
export default class extends Helper {
|
|
63
|
+
compute([cents], { currency }) {
|
|
64
|
+
return `${currency}${cents * 0.01}`;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
Each time the input to a helper changes, the `compute` function will be
|
|
70
|
+
called again.
|
|
71
|
+
|
|
72
|
+
As instances, these helpers also have access to the container and will accept
|
|
73
|
+
injected dependencies.
|
|
74
|
+
|
|
75
|
+
Additionally, class helpers can call `recompute` to force a new computation.
|
|
76
|
+
|
|
77
|
+
@class Helper
|
|
78
|
+
@extends CoreObject
|
|
79
|
+
@public
|
|
80
|
+
@since 1.13.0
|
|
81
|
+
*/
|
|
82
|
+
// ESLint doesn't understand declaration merging.
|
|
83
|
+
/* eslint-disable import/export */
|
|
84
|
+
|
|
85
|
+
class Helper extends FrameworkObject {
|
|
86
|
+
static isHelperFactory = true;
|
|
87
|
+
static [IS_CLASSIC_HELPER] = true;
|
|
88
|
+
|
|
89
|
+
// `packages/ember/index.js` was setting `Helper.helper`. This seems like
|
|
90
|
+
// a bad idea and probably not something we want. We've moved that definition
|
|
91
|
+
// here, but it should definitely be reviewed and probably removed.
|
|
92
|
+
/** @deprecated */
|
|
93
|
+
static helper = helper;
|
|
94
|
+
|
|
95
|
+
// SAFETY: this is initialized in `init`, rather than `constructor`. It is
|
|
96
|
+
// safe to `declare` like this *if and only if* nothing uses the constructor
|
|
97
|
+
// directly in this class, since nothing else can run before `init`.
|
|
98
|
+
|
|
99
|
+
// SAFETY: this has no runtime existence whatsoever; it is a "phantom type"
|
|
100
|
+
// here to preserve the type param.
|
|
101
|
+
|
|
102
|
+
init(properties) {
|
|
103
|
+
super.init(properties);
|
|
104
|
+
this[RECOMPUTE_TAG] = createTag();
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
/**
|
|
108
|
+
On a class-based helper, it may be useful to force a recomputation of that
|
|
109
|
+
helpers value. This is akin to `rerender` on a component.
|
|
110
|
+
In most cases, `recompute` is not needed because accessing tracked
|
|
111
|
+
properties in `compute` will automatically re-run the helper when
|
|
112
|
+
those properties change. Use `recompute` only when you need to
|
|
113
|
+
trigger a recomputation imperatively, for example in response to an
|
|
114
|
+
external event:
|
|
115
|
+
```app/helpers/current-time.js
|
|
116
|
+
import Helper from '@ember/component/helper';
|
|
117
|
+
export default class CurrentTimeHelper extends Helper {
|
|
118
|
+
interval = null;
|
|
119
|
+
compute() {
|
|
120
|
+
return new Date().toLocaleTimeString();
|
|
121
|
+
}
|
|
122
|
+
constructor() {
|
|
123
|
+
super(...arguments);
|
|
124
|
+
this.interval = setInterval(() => this.recompute(), 1000);
|
|
125
|
+
}
|
|
126
|
+
willDestroy() {
|
|
127
|
+
super.willDestroy();
|
|
128
|
+
clearInterval(this.interval);
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
```
|
|
132
|
+
@method recompute
|
|
133
|
+
@public
|
|
134
|
+
@since 1.13.0
|
|
135
|
+
*/
|
|
136
|
+
recompute() {
|
|
137
|
+
join(() => DIRTY_TAG(this[RECOMPUTE_TAG]));
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
/* eslint-enable import/export */
|
|
141
|
+
|
|
142
|
+
class ClassicHelperManager {
|
|
143
|
+
capabilities = helperCapabilities('3.23', {
|
|
144
|
+
hasValue: true,
|
|
145
|
+
hasDestroyable: true
|
|
146
|
+
});
|
|
147
|
+
ownerInjection;
|
|
148
|
+
constructor(owner) {
|
|
149
|
+
let ownerInjection = {};
|
|
150
|
+
setOwner(ownerInjection, owner);
|
|
151
|
+
this.ownerInjection = ownerInjection;
|
|
152
|
+
}
|
|
153
|
+
createHelper(definition, args) {
|
|
154
|
+
let instance = isFactoryManager(definition) ? definition.create() : definition.create(this.ownerInjection);
|
|
155
|
+
return {
|
|
156
|
+
instance,
|
|
157
|
+
args
|
|
158
|
+
};
|
|
159
|
+
}
|
|
160
|
+
getDestroyable({
|
|
161
|
+
instance
|
|
162
|
+
}) {
|
|
163
|
+
return instance;
|
|
164
|
+
}
|
|
165
|
+
getValue({
|
|
166
|
+
instance,
|
|
167
|
+
args
|
|
168
|
+
}) {
|
|
169
|
+
let {
|
|
170
|
+
positional,
|
|
171
|
+
named
|
|
172
|
+
} = args;
|
|
173
|
+
let ret = instance.compute(positional, named);
|
|
174
|
+
consumeTag(instance[RECOMPUTE_TAG]);
|
|
175
|
+
return ret;
|
|
176
|
+
}
|
|
177
|
+
getDebugName(definition) {
|
|
178
|
+
return getDebugName((definition.class || definition)['prototype']);
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
function isFactoryManager(obj) {
|
|
182
|
+
return obj != null && 'class' in obj;
|
|
183
|
+
}
|
|
184
|
+
setHelperManager(owner => {
|
|
185
|
+
return new ClassicHelperManager(owner);
|
|
186
|
+
}, Helper);
|
|
187
|
+
|
|
188
|
+
///////////
|
|
189
|
+
|
|
190
|
+
class Wrapper {
|
|
191
|
+
isHelperFactory = true;
|
|
192
|
+
constructor(compute) {
|
|
193
|
+
this.compute = compute;
|
|
194
|
+
}
|
|
195
|
+
create() {
|
|
196
|
+
// needs new instance or will leak containers
|
|
197
|
+
return {
|
|
198
|
+
compute: this.compute
|
|
199
|
+
};
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
class SimpleClassicHelperManager {
|
|
203
|
+
capabilities = helperCapabilities('3.23', {
|
|
204
|
+
hasValue: true
|
|
205
|
+
});
|
|
206
|
+
createHelper(definition, args) {
|
|
207
|
+
return () => definition.compute.call(null, args.positional, args.named);
|
|
208
|
+
}
|
|
209
|
+
getValue(fn) {
|
|
210
|
+
return fn();
|
|
211
|
+
}
|
|
212
|
+
getDebugName(definition) {
|
|
213
|
+
return getDebugName(definition.compute);
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
const SIMPLE_CLASSIC_HELPER_MANAGER = new SimpleClassicHelperManager();
|
|
217
|
+
setHelperManager(() => SIMPLE_CLASSIC_HELPER_MANAGER, Wrapper.prototype);
|
|
218
|
+
|
|
219
|
+
/*
|
|
220
|
+
Function-based helpers need to present with a constructor signature so that
|
|
221
|
+
type parameters can be preserved when `helper()` is passed a generic function
|
|
222
|
+
(this is particularly key for checking helper invocations with Glint).
|
|
223
|
+
Accordingly, we define an abstract class and declaration merge it with the
|
|
224
|
+
interface; this inherently provides an `abstract` constructor. Since it is
|
|
225
|
+
`abstract`, it is not callable, which is important since end users should not
|
|
226
|
+
be able to do `let myHelper = helper(someFn); new myHelper()`.
|
|
227
|
+
*/
|
|
228
|
+
|
|
229
|
+
/**
|
|
230
|
+
* The type of a function-based helper.
|
|
231
|
+
*
|
|
232
|
+
* @note This is *not* user-constructible: it is exported only so that the type
|
|
233
|
+
* returned by the `helper` function can be named (and indeed can be exported
|
|
234
|
+
* like `export default helper(...)` safely).
|
|
235
|
+
*/
|
|
236
|
+
// Making `FunctionBasedHelper` an alias this way allows callers to name it in
|
|
237
|
+
// terms meaningful to *them*, while preserving the type behavior described on
|
|
238
|
+
// the `abstract class FunctionBasedHelperInstance` below.
|
|
239
|
+
|
|
240
|
+
// This abstract class -- specifically, its `protected abstract __concrete__`
|
|
241
|
+
// member -- prevents subclasses from doing `class X extends helper(..)`, since
|
|
242
|
+
// that is an error at runtime. While it is rare that people would type that, it
|
|
243
|
+
// is not impossible and we use this to give them early signal via the types for
|
|
244
|
+
// a behavior which will break (and in a somewhat inscrutable way!) at runtime.
|
|
245
|
+
//
|
|
246
|
+
// This is needful because we lie about what this actually is for Glint's sake:
|
|
247
|
+
// a function-based helper returns a `Factory<SimpleHelper>`, which is designed
|
|
248
|
+
// to be "opaque" from a consumer's POV, i.e. not user-callable or constructible
|
|
249
|
+
// but only useable in a template (or via `invokeHelper()` which also treats it
|
|
250
|
+
// as a fully opaque `object` from a type POV). But Glint needs a `Helper<S>` to
|
|
251
|
+
// make it work the same way as class-based helpers. (Note that this does not
|
|
252
|
+
// hold for plain functions as helpers, which it can handle distinctly.) This
|
|
253
|
+
// signature thus makes it so that the item is usable *as* a `Helper` in Glint,
|
|
254
|
+
// but without letting end users treat it as a helper class instance.
|
|
255
|
+
|
|
256
|
+
/**
|
|
257
|
+
In many cases it is not necessary to use the full `Helper` class.
|
|
258
|
+
The `helper` method create pure-function helpers without instances.
|
|
259
|
+
For example:
|
|
260
|
+
|
|
261
|
+
```app/helpers/format-currency.js
|
|
262
|
+
import { helper } from '@ember/component/helper';
|
|
263
|
+
|
|
264
|
+
export default helper(function([cents], {currency}) {
|
|
265
|
+
return `${currency}${cents * 0.01}`;
|
|
266
|
+
});
|
|
267
|
+
```
|
|
268
|
+
|
|
269
|
+
@static
|
|
270
|
+
@param {Function} helper The helper function
|
|
271
|
+
@method helper
|
|
272
|
+
@for @ember/component/helper
|
|
273
|
+
@public
|
|
274
|
+
@since 1.13.0
|
|
275
|
+
*/
|
|
276
|
+
// This overload allows users to write types directly on the callback passed to
|
|
277
|
+
// the `helper` function and infer the resulting type correctly.
|
|
278
|
+
|
|
279
|
+
// This overload allows users to provide a `Signature` type explicitly at the
|
|
280
|
+
// helper definition site, e.g. `helper<Sig>((pos, named) => {...})`. **Note:**
|
|
281
|
+
// this overload must appear second, since TS' inference engine will not
|
|
282
|
+
// correctly infer the type of `S` here from the types on the supplied callback.
|
|
283
|
+
|
|
284
|
+
function helper(helperFn) {
|
|
285
|
+
// SAFETY: this is completely lies, in two ways:
|
|
286
|
+
//
|
|
287
|
+
// 1. `Wrapper` is a `Factory<SimpleHelper<S>>`, but from the perspective of
|
|
288
|
+
// any external callers (i.e. Ember *users*), it is quite important that
|
|
289
|
+
// the `Factory` relationship be hidden, because it is not public API for
|
|
290
|
+
// an end user to call `.create()` on a helper created this way. Instead,
|
|
291
|
+
// we provide them an `abstract new` signature (which means it cannot be
|
|
292
|
+
// directly constructed by calling `new` on it) and which does not have the
|
|
293
|
+
// `.create()` signature on it anymore.
|
|
294
|
+
//
|
|
295
|
+
// 2. The produced type here ends up being a subtype of `Helper`, which is not
|
|
296
|
+
// strictly true. This is necessary for the sake of Glint, which provides
|
|
297
|
+
// its information by way of a "declaration merge" with `Helper<S>` in the
|
|
298
|
+
// case of items produced by `helper()`.
|
|
299
|
+
//
|
|
300
|
+
// Long-term, this entire construct can go away in favor of deprecating the
|
|
301
|
+
// `helper()` invocation in favor of using plain functions.
|
|
302
|
+
return new Wrapper(helperFn);
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
export { Helper as default, helper };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export { g as getComponentTemplate, s as setComponentTemplate } from '../../shared-chunks/template-Dc_cBOoX.js';
|
|
2
2
|
import { n as nativeDescDecorator } from '../../shared-chunks/decorator-9ikVwsjY.js';
|
|
3
3
|
import { g as get } from '../../shared-chunks/property_get-DAKgbeJX.js';
|
|
4
|
-
import { P as PROPERTY_DID_CHANGE } from '../../shared-chunks/computed-
|
|
4
|
+
import { P as PROPERTY_DID_CHANGE } from '../../shared-chunks/computed-BNdMwGhH.js';
|
|
5
5
|
import { getOwner } from '../-internals/owner/index.js';
|
|
6
6
|
import TargetActionSupport from '../-internals/runtime/lib/mixins/target_action_support.js';
|
|
7
7
|
import ActionSupport from '../-internals/views/lib/mixins/action_support.js';
|
|
@@ -13,10 +13,10 @@ import { s as setInternalComponentManager } from '../../shared-chunks/api-DlJKfm
|
|
|
13
13
|
import { b as isUpdatableRef, u as updateRef } from '../../shared-chunks/reference-CG0yPgLy.js';
|
|
14
14
|
import { n as normalizeProperty } from '../../shared-chunks/props-fiqxqhAH.js';
|
|
15
15
|
import { r as createTag, D as DIRTY_TAG$1 } from '../../shared-chunks/cache-CofLhaS4.js';
|
|
16
|
-
import { I as IS_DISPATCHING_ATTRS, D as DIRTY_TAG, B as BOUNDS, g as getComponentCapturedArgs,
|
|
16
|
+
import { I as IS_DISPATCHING_ATTRS, D as DIRTY_TAG, B as BOUNDS, g as getComponentCapturedArgs, b as CURLY_COMPONENT_MANAGER } from '../../shared-chunks/curly-a6DP7r87.js';
|
|
17
17
|
import { h as hasDOM } from '../../shared-chunks/has-dom-DdQORPzI.js';
|
|
18
18
|
import { a as decorateMethodV2 } from '../../shared-chunks/runtime-CYyqkz5q-BOdRhmsS.js';
|
|
19
|
-
export { I as Input, T as Textarea } from '../../shared-chunks/textarea-
|
|
19
|
+
export { I as Input, T as Textarea } from '../../shared-chunks/textarea-DMmdvgk2.js';
|
|
20
20
|
import { s as setComponentManager$1 } from '../../shared-chunks/api-B_poQGXS.js';
|
|
21
21
|
export { c as capabilities } from '../../shared-chunks/api-B_poQGXS.js';
|
|
22
22
|
import '../../shared-chunks/capabilities-BuVYh-vx.js';
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { getOwner } from '../-internals/owner/index.js';
|
|
2
|
-
import { c as computed } from '../../shared-chunks/computed-
|
|
2
|
+
import { c as computed } from '../../shared-chunks/computed-BNdMwGhH.js';
|
|
3
3
|
import { g as get } from '../../shared-chunks/property_get-DAKgbeJX.js';
|
|
4
4
|
import { FrameworkObject } from '../object/-internals.js';
|
|
5
|
-
import { i as inject$1 } from '../../shared-chunks/injected_property-
|
|
5
|
+
import { i as inject$1 } from '../../shared-chunks/injected_property-DqQ0XV7k.js';
|
|
6
6
|
import Mixin from '../object/mixin.js';
|
|
7
7
|
import ActionHandler from '../-internals/runtime/lib/mixins/action_handler.js';
|
|
8
8
|
|
|
@@ -5,13 +5,13 @@ import { Registry } from '../-internals/container/index.js';
|
|
|
5
5
|
import DAG from '../../dag-map/index.js';
|
|
6
6
|
import ContainerDebugAdapter from '../debug/container-debug-adapter.js';
|
|
7
7
|
import { g as get } from '../../shared-chunks/property_get-DAKgbeJX.js';
|
|
8
|
-
import { s as set } from '../../shared-chunks/property_set-
|
|
8
|
+
import { s as set } from '../../shared-chunks/property_set-CkLe4ht8.js';
|
|
9
9
|
import EngineInstance from './instance.js';
|
|
10
10
|
import '../../route-recognizer/index.js';
|
|
11
11
|
import '../../shared-chunks/rsvp.es-DR7yS7qg.js';
|
|
12
|
-
import '../../shared-chunks/unrecognized-url-error-
|
|
12
|
+
import '../../shared-chunks/unrecognized-url-error-jjQ-FqKB.js';
|
|
13
13
|
import RoutingService from '../routing/lib/routing-service.js';
|
|
14
|
-
import {
|
|
14
|
+
import { b as setupEngineRegistry } from '../../shared-chunks/setup-registry-kOGgOucf.js';
|
|
15
15
|
import RegistryProxyMixin from '../-internals/runtime/lib/mixins/registry_proxy.js';
|
|
16
16
|
import { StrictResolver } from './lib/strict-resolver.js';
|
|
17
17
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { C as default, e as expandProperties } from '../../shared-chunks/computed-
|
|
2
|
-
export { a as alias } from '../../shared-chunks/alias-
|
|
1
|
+
export { C as default, e as expandProperties } from '../../shared-chunks/computed-BNdMwGhH.js';
|
|
2
|
+
export { a as alias } from '../../shared-chunks/alias-CHHuE0LE.js';
|
|
3
3
|
export { and, bool, deprecatingAlias, empty, equal, gt, gte, lt, lte, match, none, not, notEmpty, oneWay, or, readOnly, oneWay as reads } from './lib/computed/computed_macros.js';
|
|
4
4
|
export { collect, filter, filterBy, intersect, map, mapBy, max, min, setDiff, sort, sum, union, uniq, uniqBy } from './lib/computed/reduce_computed_macros.js';
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { E as ENV } from '../../shared-chunks/env-DXxsTFkM.js';
|
|
2
2
|
import { s as setClassicDecorator, i as isElementDescriptor } from '../../shared-chunks/decorator-9ikVwsjY.js';
|
|
3
|
-
import { e as expandProperties } from '../../shared-chunks/computed-
|
|
4
|
-
export { c as computed, d as defineProperty, n as notifyPropertyChange } from '../../shared-chunks/computed-
|
|
3
|
+
import { e as expandProperties } from '../../shared-chunks/computed-BNdMwGhH.js';
|
|
4
|
+
export { c as computed, d as defineProperty, n as notifyPropertyChange } from '../../shared-chunks/computed-BNdMwGhH.js';
|
|
5
5
|
import { g as getFactoryFor } from '../../shared-chunks/container-BYOnjnwz.js';
|
|
6
6
|
import { s as setObservers } from '../../shared-chunks/super-BBBjgF69.js';
|
|
7
7
|
import CoreObject from './core.js';
|
|
8
8
|
import Observable from './observable.js';
|
|
9
9
|
export { g as get } from '../../shared-chunks/property_get-DAKgbeJX.js';
|
|
10
|
-
export { s as set, t as trySet } from '../../shared-chunks/property_set-
|
|
10
|
+
export { s as set, t as trySet } from '../../shared-chunks/property_set-CkLe4ht8.js';
|
|
11
11
|
export { g as getProperties } from '../../shared-chunks/get_properties-Dg3xFpiS.js';
|
|
12
|
-
export { s as setProperties } from '../../shared-chunks/set_properties-
|
|
12
|
+
export { s as setProperties } from '../../shared-chunks/set_properties-Cs3rVemD.js';
|
|
13
13
|
|
|
14
14
|
/**
|
|
15
15
|
@module @ember/object
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { c as computed, e as expandProperties } from '../../../../shared-chunks/computed-
|
|
2
|
-
import { a as alias } from '../../../../shared-chunks/alias-
|
|
1
|
+
import { c as computed, e as expandProperties } from '../../../../shared-chunks/computed-BNdMwGhH.js';
|
|
2
|
+
import { a as alias } from '../../../../shared-chunks/alias-CHHuE0LE.js';
|
|
3
3
|
import { g as get } from '../../../../shared-chunks/property_get-DAKgbeJX.js';
|
|
4
|
-
import { s as set } from '../../../../shared-chunks/property_set-
|
|
4
|
+
import { s as set } from '../../../../shared-chunks/property_set-CkLe4ht8.js';
|
|
5
5
|
import isEmpty from '../../../utils/lib/is_empty.js';
|
|
6
6
|
import isNone from '../../../utils/lib/is_none.js';
|
|
7
7
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { c as computed, i as autoComputed } from '../../../../shared-chunks/computed-
|
|
1
|
+
import { c as computed, i as autoComputed } from '../../../../shared-chunks/computed-BNdMwGhH.js';
|
|
2
2
|
import { g as get } from '../../../../shared-chunks/property_get-DAKgbeJX.js';
|
|
3
3
|
import compare from '../../../utils/lib/compare.js';
|
|
4
4
|
import EmberArray, { A, uniqBy as uniqBy$1 } from '../../../array/index.js';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { peekMeta, meta } from '../-internals/meta/lib/meta.js';
|
|
2
2
|
import { R as ROOT, o as observerListenerMetaFor, w as wrap } from '../../shared-chunks/super-BBBjgF69.js';
|
|
3
3
|
import { n as nativeDescDecorator, a as isClassicDecorator, b as descriptorForDecorator, m as makeComputedDecorator } from '../../shared-chunks/decorator-9ikVwsjY.js';
|
|
4
|
-
import { g as defineValue, h as defineDecorator, C as ComputedProperty } from '../../shared-chunks/computed-
|
|
4
|
+
import { g as defineValue, h as defineDecorator, C as ComputedProperty } from '../../shared-chunks/computed-BNdMwGhH.js';
|
|
5
5
|
import { s as setUnprocessedMixins } from '../../shared-chunks/namespace_search-BfvzEQzN.js';
|
|
6
6
|
import { c as revalidateObservers, b as addObserver, r as removeObserver } from '../../shared-chunks/observers-BmobpXAF.js';
|
|
7
7
|
import { a as addListener, r as removeListener } from '../../shared-chunks/events-DYrYz3V8.js';
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { peekMeta } from '../-internals/meta/lib/meta.js';
|
|
2
2
|
import { h as hasListeners } from '../../shared-chunks/events-DYrYz3V8.js';
|
|
3
|
-
import { n as notifyPropertyChange, a as endPropertyChanges, b as beginPropertyChanges } from '../../shared-chunks/computed-
|
|
3
|
+
import { n as notifyPropertyChange, a as endPropertyChanges, b as beginPropertyChanges } from '../../shared-chunks/computed-BNdMwGhH.js';
|
|
4
4
|
import { r as removeObserver, b as addObserver } from '../../shared-chunks/observers-BmobpXAF.js';
|
|
5
5
|
import { g as get } from '../../shared-chunks/property_get-DAKgbeJX.js';
|
|
6
|
-
import { s as set } from '../../shared-chunks/property_set-
|
|
6
|
+
import { s as set } from '../../shared-chunks/property_set-CkLe4ht8.js';
|
|
7
7
|
import { g as getProperties } from '../../shared-chunks/get_properties-Dg3xFpiS.js';
|
|
8
|
-
import { s as setProperties } from '../../shared-chunks/set_properties-
|
|
8
|
+
import { s as setProperties } from '../../shared-chunks/set_properties-Cs3rVemD.js';
|
|
9
9
|
import Mixin from './mixin.js';
|
|
10
10
|
|
|
11
11
|
/**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { g as get } from '../../shared-chunks/property_get-DAKgbeJX.js';
|
|
2
|
-
import { s as setProperties } from '../../shared-chunks/set_properties-
|
|
3
|
-
import { c as computed } from '../../shared-chunks/computed-
|
|
2
|
+
import { s as setProperties } from '../../shared-chunks/set_properties-Cs3rVemD.js';
|
|
3
|
+
import { c as computed } from '../../shared-chunks/computed-BNdMwGhH.js';
|
|
4
4
|
import Mixin from './mixin.js';
|
|
5
5
|
|
|
6
6
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { r as renderComponent, a as renderSettled } from '../../shared-chunks/index-
|
|
1
|
+
export { r as renderComponent, a as renderSettled } from '../../shared-chunks/index-CvQQ6l11.js';
|
|
@@ -5,7 +5,6 @@ import '../../../shared-chunks/observers-BmobpXAF.js';
|
|
|
5
5
|
import '../../../shared-chunks/property_get-DAKgbeJX.js';
|
|
6
6
|
import { readOnly } from '../../object/lib/computed/computed_macros.js';
|
|
7
7
|
import '../../object/core.js';
|
|
8
|
-
import '../../-internals/runtime/lib/mixins/comparable.js';
|
|
9
8
|
import '../../array/index.js';
|
|
10
9
|
import Service from '../../service/index.js';
|
|
11
10
|
import '../router.js';
|
|
@@ -3,7 +3,7 @@ import { getOwner } from '../../-internals/owner/index.js';
|
|
|
3
3
|
import '../../engine/instance.js';
|
|
4
4
|
import '../../../route-recognizer/index.js';
|
|
5
5
|
import '../../../shared-chunks/rsvp.es-DR7yS7qg.js';
|
|
6
|
-
import { S as STATE_SYMBOL } from '../../../shared-chunks/unrecognized-url-error-
|
|
6
|
+
import { S as STATE_SYMBOL } from '../../../shared-chunks/unrecognized-url-error-jjQ-FqKB.js';
|
|
7
7
|
|
|
8
8
|
const ALL_PERIODS_REGEX = /\./g;
|
|
9
9
|
function extractRouteArgs(args) {
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { privatize } from '../-internals/container/index.js';
|
|
2
2
|
import { f as flushAsyncObservers, b as addObserver } from '../../shared-chunks/observers-BmobpXAF.js';
|
|
3
|
-
import { c as computed, d as defineProperty } from '../../shared-chunks/computed-
|
|
3
|
+
import { c as computed, d as defineProperty } from '../../shared-chunks/computed-BNdMwGhH.js';
|
|
4
4
|
import { d as descriptorForProperty } from '../../shared-chunks/decorator-9ikVwsjY.js';
|
|
5
5
|
import { getOwner } from '../-internals/owner/index.js';
|
|
6
6
|
import { g as get } from '../../shared-chunks/property_get-DAKgbeJX.js';
|
|
7
|
-
import { s as set } from '../../shared-chunks/property_set-
|
|
7
|
+
import { s as set } from '../../shared-chunks/property_set-CkLe4ht8.js';
|
|
8
8
|
import { g as getProperties } from '../../shared-chunks/get_properties-Dg3xFpiS.js';
|
|
9
|
-
import { s as setProperties } from '../../shared-chunks/set_properties-
|
|
9
|
+
import { s as setProperties } from '../../shared-chunks/set_properties-Cs3rVemD.js';
|
|
10
10
|
import EmberObject from '../object/index.js';
|
|
11
11
|
import Evented from '../object/evented.js';
|
|
12
12
|
import { A } from '../array/index.js';
|
|
@@ -22,7 +22,7 @@ import { once } from '../runloop/index.js';
|
|
|
22
22
|
import { c as hasInternalComponentManager } from '../../shared-chunks/api-DlJKfm_f.js';
|
|
23
23
|
import '../../route-recognizer/index.js';
|
|
24
24
|
import '../../shared-chunks/rsvp.es-DR7yS7qg.js';
|
|
25
|
-
import { S as STATE_SYMBOL, P as PARAMS_SYMBOL } from '../../shared-chunks/unrecognized-url-error-
|
|
25
|
+
import { S as STATE_SYMBOL, P as PARAMS_SYMBOL } from '../../shared-chunks/unrecognized-url-error-jjQ-FqKB.js';
|
|
26
26
|
import generateController from './lib/generate_controller.js';
|
|
27
27
|
import { prefixRouteNameArg, stashParamNames, calculateCacheKey, normalizeControllerQueryParams } from './lib/utils.js';
|
|
28
28
|
import { a as decorateMethodV2 } from '../../shared-chunks/runtime-CYyqkz5q-BOdRhmsS.js';
|
|
@@ -7,7 +7,6 @@ import '../../shared-chunks/observers-BmobpXAF.js';
|
|
|
7
7
|
import '../../shared-chunks/property_get-DAKgbeJX.js';
|
|
8
8
|
import { readOnly } from '../object/lib/computed/computed_macros.js';
|
|
9
9
|
import '../object/core.js';
|
|
10
|
-
import '../-internals/runtime/lib/mixins/comparable.js';
|
|
11
10
|
import '../array/index.js';
|
|
12
11
|
import Service from '../service/index.js';
|
|
13
12
|
import './router.js';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { privatize } from '../-internals/container/index.js';
|
|
2
|
-
import { c as computed } from '../../shared-chunks/computed-
|
|
2
|
+
import { c as computed } from '../../shared-chunks/computed-BNdMwGhH.js';
|
|
3
3
|
import { g as get } from '../../shared-chunks/property_get-DAKgbeJX.js';
|
|
4
|
-
import { s as set } from '../../shared-chunks/property_set-
|
|
4
|
+
import { s as set } from '../../shared-chunks/property_set-CkLe4ht8.js';
|
|
5
5
|
import { getOwner } from '../owner/index.js';
|
|
6
6
|
import DSLImpl from './lib/dsl.js';
|
|
7
7
|
import RouterState from './lib/router_state.js';
|
|
@@ -13,7 +13,7 @@ import Evented from '../object/evented.js';
|
|
|
13
13
|
import { run, once, scheduleOnce, cancel } from '../runloop/index.js';
|
|
14
14
|
import { getRenderState, getFullQueryParams, hasDefaultSerialize, defaultSerialize } from './route.js';
|
|
15
15
|
import Router from '../../router_js/index.js';
|
|
16
|
-
import { S as STATE_SYMBOL, l as logAbort } from '../../shared-chunks/unrecognized-url-error-
|
|
16
|
+
import { S as STATE_SYMBOL, l as logAbort } from '../../shared-chunks/unrecognized-url-error-jjQ-FqKB.js';
|
|
17
17
|
import '../../shared-chunks/rsvp.es-DR7yS7qg.js';
|
|
18
18
|
import '../engine/instance.js';
|
|
19
19
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { FrameworkObject } from '../object/-internals.js';
|
|
2
2
|
import { deprecateUntil, DEPRECATIONS } from '../-internals/deprecations/index.js';
|
|
3
|
-
import { i as inject$1 } from '../../shared-chunks/injected_property-
|
|
3
|
+
import { i as inject$1 } from '../../shared-chunks/injected_property-DqQ0XV7k.js';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
@module @ember/service
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import typeOf from './type-of.js';
|
|
2
|
-
import Comparable from '../../-internals/runtime/lib/mixins/comparable.js';
|
|
3
2
|
|
|
4
3
|
const TYPE_ORDER = {
|
|
5
4
|
undefined: 0,
|
|
@@ -145,7 +144,11 @@ function compare(v, w) {
|
|
|
145
144
|
}
|
|
146
145
|
}
|
|
147
146
|
function isComparable(value) {
|
|
148
|
-
|
|
147
|
+
if (typeof value !== 'object' || value === null) {
|
|
148
|
+
return false;
|
|
149
|
+
}
|
|
150
|
+
let maybeComparable = value;
|
|
151
|
+
return typeof maybeComparable.constructor?.compare === 'function' || typeof maybeComparable.compare === 'function';
|
|
149
152
|
}
|
|
150
153
|
|
|
151
154
|
export { compare as default };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { C as ConcreteBounds } from '../../shared-chunks/normalize-C_IStty9.js';
|
|
2
|
-
import { D as DOMTreeConstruction } from '../../shared-chunks/api-
|
|
2
|
+
import { D as DOMTreeConstruction } from '../../shared-chunks/api-DzOa0Acr.js';
|
|
3
3
|
import createHTMLDocument from '../../@simple-dom/document/index.js';
|
|
4
|
-
export { s as serializeBuilder } from '../../shared-chunks/serialize-builder-
|
|
4
|
+
export { s as serializeBuilder } from '../../shared-chunks/serialize-builder-CsG9WHVw.js';
|
|
5
5
|
|
|
6
6
|
class NodeDOMTreeConstruction extends DOMTreeConstruction {
|
|
7
7
|
// Hides property on base class
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { C as ConcreteBounds, a as CursorImpl, c as clear } from '../../shared-chunks/normalize-C_IStty9.js';
|
|
2
|
-
export { D as DOMChanges, a as DynamicScopeImpl, E as EnvironmentImpl, b as IDOMChanges, L as LowLevelVM, S as ScopeImpl, U as UpdatingVM, i as inTransaction, c as isWhitespace, r as renderComponent, d as renderMain, e as renderSync, f as resetDebuggerCallback, g as runtimeOptions, s as setDebuggerCallback } from '../../shared-chunks/render-
|
|
2
|
+
export { D as DOMChanges, a as DynamicScopeImpl, E as EnvironmentImpl, b as IDOMChanges, L as LowLevelVM, S as ScopeImpl, U as UpdatingVM, i as inTransaction, c as isWhitespace, r as renderComponent, d as renderMain, e as renderSync, f as resetDebuggerCallback, g as runtimeOptions, s as setDebuggerCallback } from '../../shared-chunks/render-Bf7GviCY.js';
|
|
3
3
|
export { T as TEMPLATE_ONLY_COMPONENT_MANAGER, a as TemplateOnlyComponent, b as TemplateOnlyComponentManager, t as templateOnlyComponent } from '../../shared-chunks/template-only-DKNcKM5b.js';
|
|
4
4
|
export { C as CurriedValue, E as EMPTY_ARGS, a as EMPTY_NAMED, b as EMPTY_POSITIONAL, c as createCapturedArgs, d as curry, r as reifyArgs, e as reifyNamed, f as reifyPositional } from '../../shared-chunks/arguments-BzAkZVBa.js';
|
|
5
5
|
export { n as normalizeProperty } from '../../shared-chunks/props-fiqxqhAH.js';
|
|
@@ -11,5 +11,5 @@ export { o as on } from '../../shared-chunks/on-BZHAxzdq.js';
|
|
|
11
11
|
export { destroy, isDestroyed, isDestroying, registerDestructor } from '../destroyable/index.js';
|
|
12
12
|
import '../../shared-chunks/cache-CofLhaS4.js';
|
|
13
13
|
import '../../shared-chunks/reference-CG0yPgLy.js';
|
|
14
|
-
export { D as DOMTreeConstruction, a as DynamicAttribute, N as NewTreeBuilder, R as RemoteBlock, b as ResettableBlockImpl, S as SimpleDynamicAttribute, c as clientBuilder, d as dynamicAttribute } from '../../shared-chunks/api-
|
|
15
|
-
export { R as RehydrateTree, S as SERIALIZATION_FIRST_NODE_STRING, i as isSerializationFirstNode, r as rehydrationBuilder } from '../../shared-chunks/rehydrate-builder-
|
|
14
|
+
export { D as DOMTreeConstruction, a as DynamicAttribute, N as NewTreeBuilder, R as RemoteBlock, b as ResettableBlockImpl, S as SimpleDynamicAttribute, c as clientBuilder, d as dynamicAttribute } from '../../shared-chunks/api-DzOa0Acr.js';
|
|
15
|
+
export { R as RehydrateTree, S as SERIALIZATION_FIRST_NODE_STRING, i as isSerializationFirstNode, r as rehydrationBuilder } from '../../shared-chunks/rehydrate-builder-n_8RCUj9.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { t as tracked } from '../../shared-chunks/tracked-
|
|
1
|
+
export { t as tracked } from '../../shared-chunks/tracked-DvOpYI0o.js';
|
|
2
2
|
import { e as createCache, g as getValue } from '../../shared-chunks/cache-CofLhaS4.js';
|
|
3
3
|
|
|
4
4
|
// NOTE: copied from: https://github.com/glimmerjs/glimmer.js/pull/358
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { trackedArray, trackedMap, trackedObject, trackedSet, trackedWeakMap, trackedWeakSet } from '../../@ember/reactive/collections.js';
|
|
2
2
|
export { d as dirtyTagFor, t as tagFor, a as tagMetaFor } from '../../shared-chunks/meta-BJtIZDir.js';
|
|
3
|
-
export {
|
|
3
|
+
export { T as TrackedValue, a as trackedData, t as trackedValue } from '../../shared-chunks/tracked-value-CR6kx-73.js';
|
|
4
4
|
export { A as ALLOW_CYCLES, h as COMPUTE, j as CONSTANT, C as CONSTANT_TAG, k as CURRENT_TAG, l as CurrentTag, I as INITIAL, V as VOLATILE, m as VOLATILE_TAG, n as VolatileTag, o as beginTrackFrame, p as beginUntrackFrame, q as bump, d as combine, c as consumeTag, e as createCache, r as createTag, b as createUpdatableTag, D as dirtyTag, s as endTrackFrame, w as endUntrackFrame, g as getValue, i as isConst, x as isConstTag, f as isTracking, y as resetTracking, t as track, u as untrack, U as updateTag, v as validateTag, a as valueForTag } from '../../shared-chunks/cache-CofLhaS4.js';
|
|
5
5
|
|
|
6
6
|
/* eslint-disable @typescript-eslint/no-non-null-assertion -- @fixme */
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import RouteRecognizer from '../route-recognizer/index.js';
|
|
2
2
|
import { P as Promise$1 } from '../shared-chunks/rsvp.es-DR7yS7qg.js';
|
|
3
|
-
import { Q as QUERY_PARAMS_SYMBOL, m as merge, i as isTransition, a as isParam, t as throwIfAborted, P as PARAMS_SYMBOL, p as prepareResult, b as isPromise, f as forEach, c as promiseLabel, U as UnrecognizedURLError, T as Transition, S as STATE_SYMBOL, g as getChangelist, d as log, l as logAbort, e as isTransitionAborted, h as extractQueryParams } from '../shared-chunks/unrecognized-url-error-
|
|
3
|
+
import { Q as QUERY_PARAMS_SYMBOL, m as merge, i as isTransition, a as isParam, t as throwIfAborted, P as PARAMS_SYMBOL, p as prepareResult, b as isPromise, f as forEach, c as promiseLabel, U as UnrecognizedURLError, T as Transition, S as STATE_SYMBOL, g as getChangelist, d as log, l as logAbort, e as isTransitionAborted, h as extractQueryParams } from '../shared-chunks/unrecognized-url-error-jjQ-FqKB.js';
|
|
4
4
|
|
|
5
5
|
/* eslint-disable no-prototype-builtins */
|
|
6
6
|
let ROUTE_INFOS = new WeakMap();
|
|
@@ -253,7 +253,7 @@ class InternalRouteInfo {
|
|
|
253
253
|
// Ignore the fulfilled value returned from afterModel.
|
|
254
254
|
// Return the value stashed in resolvedModels, which
|
|
255
255
|
// might have been swapped out in afterModel.
|
|
256
|
-
//
|
|
256
|
+
// SAFETY: We expect this to be of type T, though typing it as such is challenging.
|
|
257
257
|
return transition.resolvedModels[name];
|
|
258
258
|
});
|
|
259
259
|
}
|