@textbus/adapter-viewfly 5.2.3 → 5.2.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.esm.js +457 -163
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +459 -160
- package/dist/index.js.map +1 -1
- package/package.json +6 -6
package/dist/index.esm.js
CHANGED
|
@@ -1,171 +1,465 @@
|
|
|
1
|
-
import { makeError, VElement, VTextNode,
|
|
2
|
-
import {
|
|
3
|
-
import { DomAdapter } from
|
|
4
|
-
import { NodeViewAdapter } from
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
1
|
+
import { makeError, merge, VElement, VTextNode, Adapter } from '@textbus/core';
|
|
2
|
+
import { getCurrentInstance, onUnmounted, onUpdated, jsx, createDynamicRef, ReflectiveInjector } from '@viewfly/core';
|
|
3
|
+
import { DomAdapter } from '@textbus/platform-browser';
|
|
4
|
+
import { NodeViewAdapter } from '@textbus/platform-node';
|
|
5
|
+
|
|
6
|
+
function _array_like_to_array(arr, len) {
|
|
7
|
+
if (len == null || len > arr.length) len = arr.length;
|
|
8
|
+
for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
|
|
9
|
+
return arr2;
|
|
10
|
+
}
|
|
11
|
+
function _array_with_holes(arr) {
|
|
12
|
+
if (Array.isArray(arr)) return arr;
|
|
13
|
+
}
|
|
14
|
+
function _assert_this_initialized$1(self) {
|
|
15
|
+
if (self === void 0) {
|
|
16
|
+
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
17
|
+
}
|
|
18
|
+
return self;
|
|
19
|
+
}
|
|
20
|
+
function _call_super$1(_this, derived, args) {
|
|
21
|
+
derived = _get_prototype_of$1(derived);
|
|
22
|
+
return _possible_constructor_return$1(_this, _is_native_reflect_construct$1() ? Reflect.construct(derived, args || [], _get_prototype_of$1(_this).constructor) : derived.apply(_this, args));
|
|
23
|
+
}
|
|
24
|
+
function _class_call_check$1(instance, Constructor) {
|
|
25
|
+
if (!(instance instanceof Constructor)) {
|
|
26
|
+
throw new TypeError("Cannot call a class as a function");
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
function _defineProperties$1(target, props) {
|
|
30
|
+
for(var i = 0; i < props.length; i++){
|
|
31
|
+
var descriptor = props[i];
|
|
32
|
+
descriptor.enumerable = descriptor.enumerable || false;
|
|
33
|
+
descriptor.configurable = true;
|
|
34
|
+
if ("value" in descriptor) descriptor.writable = true;
|
|
35
|
+
Object.defineProperty(target, descriptor.key, descriptor);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
function _create_class$1(Constructor, protoProps, staticProps) {
|
|
39
|
+
if (protoProps) _defineProperties$1(Constructor.prototype, protoProps);
|
|
40
|
+
return Constructor;
|
|
41
|
+
}
|
|
42
|
+
function _define_property(obj, key, value) {
|
|
43
|
+
if (key in obj) {
|
|
44
|
+
Object.defineProperty(obj, key, {
|
|
45
|
+
value: value,
|
|
46
|
+
enumerable: true,
|
|
47
|
+
configurable: true,
|
|
48
|
+
writable: true
|
|
46
49
|
});
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
return a;
|
|
84
|
-
}
|
|
85
|
-
a[propName] = b[1];
|
|
86
|
-
return a;
|
|
87
|
-
}, {});
|
|
88
|
-
if (vNode.classes.size) {
|
|
89
|
-
props.class = Array.from(vNode.classes).join(" ");
|
|
50
|
+
} else {
|
|
51
|
+
obj[key] = value;
|
|
52
|
+
}
|
|
53
|
+
return obj;
|
|
54
|
+
}
|
|
55
|
+
function _get$1(target, property, receiver) {
|
|
56
|
+
if (typeof Reflect !== "undefined" && Reflect.get) {
|
|
57
|
+
_get$1 = Reflect.get;
|
|
58
|
+
} else {
|
|
59
|
+
_get$1 = function get(target, property, receiver) {
|
|
60
|
+
var base = _super_prop_base$1(target, property);
|
|
61
|
+
if (!base) return;
|
|
62
|
+
var desc = Object.getOwnPropertyDescriptor(base, property);
|
|
63
|
+
if (desc.get) {
|
|
64
|
+
return desc.get.call(receiver || target);
|
|
65
|
+
}
|
|
66
|
+
return desc.value;
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
return _get$1(target, property, receiver || target);
|
|
70
|
+
}
|
|
71
|
+
function _get_prototype_of$1(o) {
|
|
72
|
+
_get_prototype_of$1 = Object.setPrototypeOf ? Object.getPrototypeOf : function getPrototypeOf(o) {
|
|
73
|
+
return o.__proto__ || Object.getPrototypeOf(o);
|
|
74
|
+
};
|
|
75
|
+
return _get_prototype_of$1(o);
|
|
76
|
+
}
|
|
77
|
+
function _inherits$1(subClass, superClass) {
|
|
78
|
+
if (typeof superClass !== "function" && superClass !== null) {
|
|
79
|
+
throw new TypeError("Super expression must either be null or a function");
|
|
80
|
+
}
|
|
81
|
+
subClass.prototype = Object.create(superClass && superClass.prototype, {
|
|
82
|
+
constructor: {
|
|
83
|
+
value: subClass,
|
|
84
|
+
writable: true,
|
|
85
|
+
configurable: true
|
|
90
86
|
}
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
87
|
+
});
|
|
88
|
+
if (superClass) _set_prototype_of$1(subClass, superClass);
|
|
89
|
+
}
|
|
90
|
+
function _instanceof(left, right) {
|
|
91
|
+
"@swc/helpers - instanceof";
|
|
92
|
+
if (right != null && typeof Symbol !== "undefined" && right[Symbol.hasInstance]) {
|
|
93
|
+
return !!right[Symbol.hasInstance](left);
|
|
94
|
+
} else {
|
|
95
|
+
return left instanceof right;
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
function _iterable_to_array_limit(arr, i) {
|
|
99
|
+
var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
|
|
100
|
+
if (_i == null) return;
|
|
101
|
+
var _arr = [];
|
|
102
|
+
var _n = true;
|
|
103
|
+
var _d = false;
|
|
104
|
+
var _s, _e;
|
|
105
|
+
try {
|
|
106
|
+
for(_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true){
|
|
107
|
+
_arr.push(_s.value);
|
|
108
|
+
if (i && _arr.length === i) break;
|
|
96
109
|
}
|
|
97
|
-
|
|
98
|
-
|
|
110
|
+
} catch (err) {
|
|
111
|
+
_d = true;
|
|
112
|
+
_e = err;
|
|
113
|
+
} finally{
|
|
114
|
+
try {
|
|
115
|
+
if (!_n && _i["return"] != null) _i["return"]();
|
|
116
|
+
} finally{
|
|
117
|
+
if (_d) throw _e;
|
|
99
118
|
}
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
119
|
+
}
|
|
120
|
+
return _arr;
|
|
121
|
+
}
|
|
122
|
+
function _non_iterable_rest() {
|
|
123
|
+
throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
124
|
+
}
|
|
125
|
+
function _possible_constructor_return$1(self, call) {
|
|
126
|
+
if (call && (_type_of$1(call) === "object" || typeof call === "function")) {
|
|
127
|
+
return call;
|
|
128
|
+
}
|
|
129
|
+
return _assert_this_initialized$1(self);
|
|
130
|
+
}
|
|
131
|
+
function _set_prototype_of$1(o, p) {
|
|
132
|
+
_set_prototype_of$1 = Object.setPrototypeOf || function setPrototypeOf(o, p) {
|
|
133
|
+
o.__proto__ = p;
|
|
134
|
+
return o;
|
|
135
|
+
};
|
|
136
|
+
return _set_prototype_of$1(o, p);
|
|
137
|
+
}
|
|
138
|
+
function _sliced_to_array(arr, i) {
|
|
139
|
+
return _array_with_holes(arr) || _iterable_to_array_limit(arr, i) || _unsupported_iterable_to_array(arr, i) || _non_iterable_rest();
|
|
140
|
+
}
|
|
141
|
+
function _super_prop_base$1(object, property) {
|
|
142
|
+
while(!Object.prototype.hasOwnProperty.call(object, property)){
|
|
143
|
+
object = _get_prototype_of$1(object);
|
|
144
|
+
if (object === null) break;
|
|
145
|
+
}
|
|
146
|
+
return object;
|
|
147
|
+
}
|
|
148
|
+
function _type_of$1(obj) {
|
|
149
|
+
"@swc/helpers - typeof";
|
|
150
|
+
return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
|
|
151
|
+
}
|
|
152
|
+
function _unsupported_iterable_to_array(o, minLen) {
|
|
153
|
+
if (!o) return;
|
|
154
|
+
if (typeof o === "string") return _array_like_to_array(o, minLen);
|
|
155
|
+
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
156
|
+
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
157
|
+
if (n === "Map" || n === "Set") return Array.from(n);
|
|
158
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
|
|
159
|
+
}
|
|
160
|
+
function _is_native_reflect_construct$1() {
|
|
161
|
+
try {
|
|
162
|
+
var result = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
|
|
163
|
+
} catch (_) {}
|
|
164
|
+
return (_is_native_reflect_construct$1 = function() {
|
|
165
|
+
return !!result;
|
|
166
|
+
})();
|
|
167
|
+
}
|
|
168
|
+
var adapterError = makeError('ViewflyDOMRenderer');
|
|
169
|
+
var ViewflyAdapter = /*#__PURE__*/ function(DomAdapter1) {
|
|
170
|
+
_inherits$1(ViewflyAdapter, DomAdapter1);
|
|
171
|
+
function ViewflyAdapter(components, mount) {
|
|
172
|
+
_class_call_check$1(this, ViewflyAdapter);
|
|
173
|
+
var _this;
|
|
174
|
+
_this = _call_super$1(this, ViewflyAdapter, [
|
|
175
|
+
{
|
|
176
|
+
createCompositionNode: function createCompositionNode(compositionState, updateNativeCompositionNode) {
|
|
177
|
+
var ref = createDynamicRef(function(node) {
|
|
178
|
+
updateNativeCompositionNode(node);
|
|
179
|
+
return function() {
|
|
180
|
+
updateNativeCompositionNode(null);
|
|
181
|
+
};
|
|
182
|
+
});
|
|
183
|
+
return new VElement('span', {
|
|
184
|
+
style: {
|
|
185
|
+
textDecoration: 'underline'
|
|
186
|
+
},
|
|
187
|
+
ref: ref
|
|
188
|
+
}, [
|
|
189
|
+
new VTextNode(compositionState.text)
|
|
190
|
+
]);
|
|
191
|
+
},
|
|
192
|
+
getParentNode: function getParentNode(node) {
|
|
193
|
+
return node.parentNode;
|
|
194
|
+
},
|
|
195
|
+
getChildNodes: function getChildNodes(parentElement) {
|
|
196
|
+
return Array.from(parentElement.childNodes);
|
|
197
|
+
},
|
|
198
|
+
isNativeElementNode: function isNativeElementNode(node) {
|
|
199
|
+
return _instanceof(node, Element);
|
|
200
|
+
},
|
|
201
|
+
getChildByIndex: function getChildByIndex(parentElement, index) {
|
|
202
|
+
return parentElement.childNodes[index];
|
|
203
|
+
},
|
|
204
|
+
getAndUpdateSlotRootNativeElement: function getAndUpdateSlotRootNativeElement(vEle, update) {
|
|
205
|
+
var currentRef = vEle.attrs.get('ref');
|
|
206
|
+
var ref = createDynamicRef(function(nativeNode) {
|
|
207
|
+
update(nativeNode);
|
|
208
|
+
return function() {
|
|
209
|
+
update(null);
|
|
210
|
+
};
|
|
211
|
+
});
|
|
212
|
+
if (Array.isArray(currentRef)) {
|
|
213
|
+
currentRef.push(ref);
|
|
214
|
+
} else if (typeof currentRef === 'function' || (typeof currentRef === "undefined" ? "undefined" : _type_of$1(currentRef)) === 'object') {
|
|
215
|
+
// 两个判断用于兼容 viewfly 2/3
|
|
216
|
+
vEle.attrs.set('ref', [
|
|
217
|
+
currentRef,
|
|
218
|
+
ref
|
|
219
|
+
]);
|
|
220
|
+
} else {
|
|
221
|
+
vEle.attrs.set('ref', ref);
|
|
222
|
+
}
|
|
223
|
+
},
|
|
224
|
+
componentRender: function componentRender(component) {
|
|
225
|
+
var comp = _assert_this_initialized$1(_this).components[component.name] || _assert_this_initialized$1(_this).components['*'];
|
|
226
|
+
if (comp) {
|
|
227
|
+
var ref = _assert_this_initialized$1(_this).componentRefs.get(component);
|
|
228
|
+
if (!ref) {
|
|
229
|
+
ref = createDynamicRef(function(rootNode) {
|
|
230
|
+
_assert_this_initialized$1(_this).componentRootElementCaches.set(component, rootNode);
|
|
231
|
+
return function() {
|
|
232
|
+
// 当组件移动层级位置到原位置之前并重新渲染后,由于时序的原因,再删除缓存会导致组件找不到对应视图节点
|
|
233
|
+
if (_assert_this_initialized$1(_this).componentRootElementCaches.get(component) === rootNode) {
|
|
234
|
+
_assert_this_initialized$1(_this).componentRootElementCaches.remove(component);
|
|
235
|
+
}
|
|
236
|
+
};
|
|
237
|
+
});
|
|
238
|
+
_assert_this_initialized$1(_this).componentRefs.set(component, ref);
|
|
239
|
+
}
|
|
240
|
+
return jsx(comp, {
|
|
241
|
+
component: component,
|
|
242
|
+
rootRef: ref
|
|
243
|
+
}, component.id);
|
|
244
|
+
}
|
|
245
|
+
throw adapterError("cannot found view component `".concat(component.name, "`!"));
|
|
246
|
+
},
|
|
247
|
+
vElementToViewElement: function vElementToViewElement(vNode, children) {
|
|
248
|
+
var key;
|
|
249
|
+
var props = Array.from(vNode.attrs).reduce(function(a, b) {
|
|
250
|
+
var propName = b[0];
|
|
251
|
+
if (propName === 'key') {
|
|
252
|
+
key = b[1];
|
|
253
|
+
return a;
|
|
254
|
+
}
|
|
255
|
+
a[propName] = b[1];
|
|
256
|
+
return a;
|
|
257
|
+
}, {});
|
|
258
|
+
if (vNode.classes.size) {
|
|
259
|
+
props.class = Array.from(vNode.classes).join(' ');
|
|
260
|
+
}
|
|
261
|
+
if (vNode.styles) {
|
|
262
|
+
props.style = Array.from(vNode.styles).reduce(function(a, b) {
|
|
263
|
+
a[b[0]] = b[1];
|
|
264
|
+
return a;
|
|
265
|
+
}, {});
|
|
266
|
+
}
|
|
267
|
+
if (children.length) {
|
|
268
|
+
props.children = children;
|
|
269
|
+
}
|
|
270
|
+
return jsx(vNode.tagName, props, key);
|
|
271
|
+
}
|
|
272
|
+
},
|
|
273
|
+
mount
|
|
274
|
+
]), _define_property(_this, "components", {}), _define_property(_this, "componentRefs", new WeakMap());
|
|
275
|
+
var isRoot = true;
|
|
276
|
+
Object.entries(components).forEach(function(param) {
|
|
277
|
+
var _param = _sliced_to_array(param, 2), key = _param[0], viewFlyComponent = _param[1];
|
|
278
|
+
_this.components[key] = function(props) {
|
|
279
|
+
var comp = getCurrentInstance();
|
|
280
|
+
var textbusComponent = props.component;
|
|
281
|
+
var subscription = merge(textbusComponent.changeMarker.onChange, textbusComponent.changeMarker.onForceChange).subscribe(function() {
|
|
282
|
+
if (textbusComponent.changeMarker.dirty) {
|
|
283
|
+
comp.markAsDirtied();
|
|
284
|
+
}
|
|
285
|
+
});
|
|
286
|
+
onUnmounted(function() {
|
|
287
|
+
subscription.unsubscribe();
|
|
288
|
+
});
|
|
289
|
+
if (isRoot) {
|
|
290
|
+
onUpdated(function() {
|
|
291
|
+
_this.onViewUpdated.next();
|
|
292
|
+
});
|
|
293
|
+
isRoot = false;
|
|
294
|
+
}
|
|
295
|
+
onUpdated(function() {
|
|
296
|
+
textbusComponent.changeMarker.rendered();
|
|
297
|
+
if (!_this.componentRootElementCaches.get(textbusComponent)) {
|
|
298
|
+
// eslint-disable-next-line max-len
|
|
299
|
+
throw adapterError("Component `".concat(textbusComponent.name, "` is not bound to rootRef, you must bind rootRef to the root element node of the component view."));
|
|
300
|
+
}
|
|
301
|
+
});
|
|
302
|
+
return viewFlyComponent(props);
|
|
303
|
+
};
|
|
118
304
|
});
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
305
|
+
return _this;
|
|
306
|
+
}
|
|
307
|
+
_create_class$1(ViewflyAdapter, [
|
|
308
|
+
{
|
|
309
|
+
key: "render",
|
|
310
|
+
value: function render(rootComponent, injector) {
|
|
311
|
+
var childInjector = new ReflectiveInjector(injector, [
|
|
312
|
+
{
|
|
313
|
+
provide: Adapter,
|
|
314
|
+
useValue: this
|
|
315
|
+
},
|
|
316
|
+
{
|
|
317
|
+
provide: DomAdapter,
|
|
318
|
+
useValue: this
|
|
319
|
+
},
|
|
320
|
+
{
|
|
321
|
+
provide: ViewflyAdapter,
|
|
322
|
+
useValue: this
|
|
323
|
+
}
|
|
324
|
+
]);
|
|
325
|
+
return _get$1(_get_prototype_of$1(ViewflyAdapter.prototype), "render", this).call(this, rootComponent, childInjector);
|
|
326
|
+
}
|
|
327
|
+
},
|
|
328
|
+
{
|
|
329
|
+
key: "copy",
|
|
330
|
+
value: function copy() {
|
|
331
|
+
document.execCommand('copy');
|
|
332
|
+
}
|
|
333
|
+
}
|
|
334
|
+
]);
|
|
335
|
+
return ViewflyAdapter;
|
|
336
|
+
}(DomAdapter);
|
|
337
|
+
|
|
338
|
+
function _assert_this_initialized(self) {
|
|
339
|
+
if (self === void 0) {
|
|
340
|
+
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
341
|
+
}
|
|
342
|
+
return self;
|
|
343
|
+
}
|
|
344
|
+
function _call_super(_this, derived, args) {
|
|
345
|
+
derived = _get_prototype_of(derived);
|
|
346
|
+
return _possible_constructor_return(_this, _is_native_reflect_construct() ? Reflect.construct(derived, args || [], _get_prototype_of(_this).constructor) : derived.apply(_this, args));
|
|
347
|
+
}
|
|
348
|
+
function _class_call_check(instance, Constructor) {
|
|
349
|
+
if (!(instance instanceof Constructor)) {
|
|
350
|
+
throw new TypeError("Cannot call a class as a function");
|
|
351
|
+
}
|
|
352
|
+
}
|
|
353
|
+
function _defineProperties(target, props) {
|
|
354
|
+
for(var i = 0; i < props.length; i++){
|
|
355
|
+
var descriptor = props[i];
|
|
356
|
+
descriptor.enumerable = descriptor.enumerable || false;
|
|
357
|
+
descriptor.configurable = true;
|
|
358
|
+
if ("value" in descriptor) descriptor.writable = true;
|
|
359
|
+
Object.defineProperty(target, descriptor.key, descriptor);
|
|
360
|
+
}
|
|
361
|
+
}
|
|
362
|
+
function _create_class(Constructor, protoProps, staticProps) {
|
|
363
|
+
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
|
364
|
+
return Constructor;
|
|
365
|
+
}
|
|
366
|
+
function _get(target, property, receiver) {
|
|
367
|
+
if (typeof Reflect !== "undefined" && Reflect.get) {
|
|
368
|
+
_get = Reflect.get;
|
|
369
|
+
} else {
|
|
370
|
+
_get = function get(target, property, receiver) {
|
|
371
|
+
var base = _super_prop_base(target, property);
|
|
372
|
+
if (!base) return;
|
|
373
|
+
var desc = Object.getOwnPropertyDescriptor(base, property);
|
|
374
|
+
if (desc.get) {
|
|
375
|
+
return desc.get.call(receiver || target);
|
|
376
|
+
}
|
|
377
|
+
return desc.value;
|
|
378
|
+
};
|
|
379
|
+
}
|
|
380
|
+
return _get(target, property, receiver || target);
|
|
381
|
+
}
|
|
382
|
+
function _get_prototype_of(o) {
|
|
383
|
+
_get_prototype_of = Object.setPrototypeOf ? Object.getPrototypeOf : function getPrototypeOf(o) {
|
|
384
|
+
return o.__proto__ || Object.getPrototypeOf(o);
|
|
385
|
+
};
|
|
386
|
+
return _get_prototype_of(o);
|
|
387
|
+
}
|
|
388
|
+
function _inherits(subClass, superClass) {
|
|
389
|
+
if (typeof superClass !== "function" && superClass !== null) {
|
|
390
|
+
throw new TypeError("Super expression must either be null or a function");
|
|
391
|
+
}
|
|
392
|
+
subClass.prototype = Object.create(superClass && superClass.prototype, {
|
|
393
|
+
constructor: {
|
|
394
|
+
value: subClass,
|
|
395
|
+
writable: true,
|
|
396
|
+
configurable: true
|
|
124
397
|
}
|
|
125
|
-
onUpdated(() => {
|
|
126
|
-
textbusComponent.changeMarker.rendered();
|
|
127
|
-
if (!this.componentRootElementCaches.get(textbusComponent)) {
|
|
128
|
-
throw adapterError(`Component \`${textbusComponent.name}\` is not bound to rootRef, you must bind rootRef to the root element node of the component view.`);
|
|
129
|
-
}
|
|
130
|
-
});
|
|
131
|
-
return viewFlyComponent(props);
|
|
132
|
-
};
|
|
133
398
|
});
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
}
|
|
164
|
-
return
|
|
165
|
-
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
399
|
+
if (superClass) _set_prototype_of(subClass, superClass);
|
|
400
|
+
}
|
|
401
|
+
function _possible_constructor_return(self, call) {
|
|
402
|
+
if (call && (_type_of(call) === "object" || typeof call === "function")) {
|
|
403
|
+
return call;
|
|
404
|
+
}
|
|
405
|
+
return _assert_this_initialized(self);
|
|
406
|
+
}
|
|
407
|
+
function _set_prototype_of(o, p) {
|
|
408
|
+
_set_prototype_of = Object.setPrototypeOf || function setPrototypeOf(o, p) {
|
|
409
|
+
o.__proto__ = p;
|
|
410
|
+
return o;
|
|
411
|
+
};
|
|
412
|
+
return _set_prototype_of(o, p);
|
|
413
|
+
}
|
|
414
|
+
function _super_prop_base(object, property) {
|
|
415
|
+
while(!Object.prototype.hasOwnProperty.call(object, property)){
|
|
416
|
+
object = _get_prototype_of(object);
|
|
417
|
+
if (object === null) break;
|
|
418
|
+
}
|
|
419
|
+
return object;
|
|
420
|
+
}
|
|
421
|
+
function _type_of(obj) {
|
|
422
|
+
"@swc/helpers - typeof";
|
|
423
|
+
return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
|
|
424
|
+
}
|
|
425
|
+
function _is_native_reflect_construct() {
|
|
426
|
+
try {
|
|
427
|
+
var result = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
|
|
428
|
+
} catch (_) {}
|
|
429
|
+
return (_is_native_reflect_construct = function() {
|
|
430
|
+
return !!result;
|
|
431
|
+
})();
|
|
432
|
+
}
|
|
433
|
+
var ViewflyVDomAdapter = /*#__PURE__*/ function(NodeViewAdapter) {
|
|
434
|
+
_inherits(ViewflyVDomAdapter, NodeViewAdapter);
|
|
435
|
+
function ViewflyVDomAdapter() {
|
|
436
|
+
_class_call_check(this, ViewflyVDomAdapter);
|
|
437
|
+
return _call_super(this, ViewflyVDomAdapter, arguments);
|
|
438
|
+
}
|
|
439
|
+
_create_class(ViewflyVDomAdapter, [
|
|
440
|
+
{
|
|
441
|
+
key: "render",
|
|
442
|
+
value: function render(rootComponent, injector) {
|
|
443
|
+
var childInjector = new ReflectiveInjector(injector, [
|
|
444
|
+
{
|
|
445
|
+
provide: Adapter,
|
|
446
|
+
useValue: this
|
|
447
|
+
},
|
|
448
|
+
{
|
|
449
|
+
provide: DomAdapter,
|
|
450
|
+
useValue: this
|
|
451
|
+
},
|
|
452
|
+
{
|
|
453
|
+
provide: ViewflyAdapter,
|
|
454
|
+
useValue: this
|
|
455
|
+
}
|
|
456
|
+
]);
|
|
457
|
+
return _get(_get_prototype_of(ViewflyVDomAdapter.prototype), "render", this).call(this, rootComponent, childInjector);
|
|
458
|
+
}
|
|
459
|
+
}
|
|
460
|
+
]);
|
|
461
|
+
return ViewflyVDomAdapter;
|
|
462
|
+
}(NodeViewAdapter);
|
|
463
|
+
|
|
464
|
+
export { ViewflyAdapter, ViewflyVDomAdapter };
|
|
171
465
|
//# sourceMappingURL=index.esm.js.map
|