@pixui-dev/pxw 0.1.16
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/bin/pxw.js +217 -0
- package/bin/wpbuild.js +10 -0
- package/config/default.conf +21 -0
- package/config/devops.js +358 -0
- package/config/h5es.js +10 -0
- package/config/index.html +181 -0
- package/config/pfbs.js +207 -0
- package/config/testhelp.js +0 -0
- package/config/util.js +140 -0
- package/config/webpack.js +291 -0
- package/lib/assets/border.png +0 -0
- package/lib/assets/check.html +62 -0
- package/lib/assets/pixui.png +0 -0
- package/lib/assets/preact.js +4354 -0
- package/lib/assets/preact.png +0 -0
- package/lib/check/main.less +63 -0
- package/lib/check/main.tsx +41 -0
- package/lib/check/tool.js +3 -0
- package/lib/check/util.tsx +110 -0
- package/lib/grpc-web/dist/ChunkParser.js +117 -0
- package/lib/grpc-web/dist/ChunkParser.js.map +1 -0
- package/lib/grpc-web/dist/Code.js +58 -0
- package/lib/grpc-web/dist/Code.js.map +1 -0
- package/lib/grpc-web/dist/client.js +299 -0
- package/lib/grpc-web/dist/client.js.map +1 -0
- package/lib/grpc-web/dist/debug.js +16 -0
- package/lib/grpc-web/dist/debug.js.map +1 -0
- package/lib/grpc-web/dist/detach.js +7 -0
- package/lib/grpc-web/dist/detach.js.map +1 -0
- package/lib/grpc-web/dist/index.js +29 -0
- package/lib/grpc-web/dist/index.js.map +1 -0
- package/lib/grpc-web/dist/invoke.js +32 -0
- package/lib/grpc-web/dist/invoke.js.map +1 -0
- package/lib/grpc-web/dist/message.js +3 -0
- package/lib/grpc-web/dist/message.js.map +1 -0
- package/lib/grpc-web/dist/metadata.js +5 -0
- package/lib/grpc-web/dist/metadata.js.map +1 -0
- package/lib/grpc-web/dist/service.js +3 -0
- package/lib/grpc-web/dist/service.js.map +1 -0
- package/lib/grpc-web/dist/transports/Transport.js +15 -0
- package/lib/grpc-web/dist/transports/Transport.js.map +1 -0
- package/lib/grpc-web/dist/transports/http/fetch.js +117 -0
- package/lib/grpc-web/dist/transports/http/fetch.js.map +1 -0
- package/lib/grpc-web/dist/transports/http/http.js +15 -0
- package/lib/grpc-web/dist/transports/http/http.js.map +1 -0
- package/lib/grpc-web/dist/transports/http/xhr.js +136 -0
- package/lib/grpc-web/dist/transports/http/xhr.js.map +1 -0
- package/lib/grpc-web/dist/transports/http/xhrUtil.js +36 -0
- package/lib/grpc-web/dist/transports/http/xhrUtil.js.map +1 -0
- package/lib/grpc-web/dist/transports/websocket/websocket.js +95 -0
- package/lib/grpc-web/dist/transports/websocket/websocket.js.map +1 -0
- package/lib/grpc-web/dist/typings/ChunkParser.d.ts +17 -0
- package/lib/grpc-web/dist/typings/Code.d.ts +20 -0
- package/lib/grpc-web/dist/typings/client.d.ts +25 -0
- package/lib/grpc-web/dist/typings/debug.d.ts +1 -0
- package/lib/grpc-web/dist/typings/detach.d.ts +1 -0
- package/lib/grpc-web/dist/typings/index.d.ts +45 -0
- package/lib/grpc-web/dist/typings/invoke.d.ts +20 -0
- package/lib/grpc-web/dist/typings/message.d.ts +8 -0
- package/lib/grpc-web/dist/typings/metadata.d.ts +2 -0
- package/lib/grpc-web/dist/typings/service.d.ts +16 -0
- package/lib/grpc-web/dist/typings/transports/Transport.d.ts +22 -0
- package/lib/grpc-web/dist/typings/transports/http/fetch.d.ts +6 -0
- package/lib/grpc-web/dist/typings/transports/http/http.d.ts +5 -0
- package/lib/grpc-web/dist/typings/transports/http/xhr.d.ts +27 -0
- package/lib/grpc-web/dist/typings/transports/http/xhrUtil.d.ts +3 -0
- package/lib/grpc-web/dist/typings/transports/websocket/websocket.d.ts +2 -0
- package/lib/grpc-web/dist/typings/unary.d.ts +23 -0
- package/lib/grpc-web/dist/typings/util.d.ts +2 -0
- package/lib/grpc-web/dist/unary.js +44 -0
- package/lib/grpc-web/dist/unary.js.map +1 -0
- package/lib/grpc-web/dist/util.js +11 -0
- package/lib/grpc-web/dist/util.js.map +1 -0
- package/lib/grpcTransport/PixHttp2Transport.ts +107 -0
- package/lib/grpcTransport/PixLuaTransport.ts +82 -0
- package/lib/h5es-types/v1.9.2/h5es.d.ts +1698 -0
- package/lib/h5es-types/v3.5.0/h5es.d.ts +1788 -0
- package/lib/pi_component/tinyList/tinyList.js +483 -0
- package/lib/pi_component/tinyList/tinyList.tsx +517 -0
- package/lib/pika-svelte/compiler.js +29829 -0
- package/lib/pika-svelte/easing/index.js +158 -0
- package/lib/pika-svelte/index.js +72 -0
- package/lib/pika-svelte/internal/index.js +1926 -0
- package/lib/pika-svelte/motion/index.js +210 -0
- package/lib/pika-svelte/package.json +145 -0
- package/lib/pika-svelte/register.js +57 -0
- package/lib/pika-svelte/rollup.config.js +126 -0
- package/lib/pika-svelte/store/index.js +123 -0
- package/lib/pika-svelte/transition/index.js +185 -0
- package/lib/preact-router.js +395 -0
- package/lib/preact.js +4355 -0
- package/lib/preact.tq.js +4385 -0
- package/lib/react-window/src/FixedSizeGrid.js +172 -0
- package/lib/react-window/src/FixedSizeList.js +91 -0
- package/lib/react-window/src/VariableSizeGrid.js +329 -0
- package/lib/react-window/src/VariableSizeList.js +231 -0
- package/lib/react-window/src/__tests__/FixedSizeGrid.js +942 -0
- package/lib/react-window/src/__tests__/FixedSizeList.js +749 -0
- package/lib/react-window/src/__tests__/VariableSizeGrid.js +598 -0
- package/lib/react-window/src/__tests__/VariableSizeList.js +345 -0
- package/lib/react-window/src/__tests__/__snapshots__/FixedSizeGrid.js.snap +912 -0
- package/lib/react-window/src/__tests__/__snapshots__/FixedSizeList.js.snap +568 -0
- package/lib/react-window/src/__tests__/__snapshots__/VariableSizeGrid.js.snap +542 -0
- package/lib/react-window/src/__tests__/__snapshots__/VariableSizeList.js.snap +331 -0
- package/lib/react-window/src/__tests__/areEqual.js +28 -0
- package/lib/react-window/src/__tests__/shouldComponentUpdate.js +32 -0
- package/lib/react-window/src/areEqual.js +13 -0
- package/lib/react-window/src/createGridComponent.js +657 -0
- package/lib/react-window/src/createListComponent.js +574 -0
- package/lib/react-window/src/domHelpers.js +69 -0
- package/lib/react-window/src/index.js +9 -0
- package/lib/react-window/src/shallowDiffers.js +17 -0
- package/lib/react-window/src/shouldComponentUpdate.js +11 -0
- package/lib/react-window/src/test.js.flow +382 -0
- package/lib/react-window/src/timer.js +36 -0
- package/lib/svelte-tab/Tab.svelte +31 -0
- package/lib/svelte-tab/TabList.svelte +10 -0
- package/lib/svelte-tab/TabPanel.svelte +13 -0
- package/lib/svelte-tab/Tabs.svelte +68 -0
- package/lib/svelte-tab/tabs.js +4 -0
- package/lib/types/css.d.ts +7476 -0
- package/lib/types/dom.ts +17 -0
- package/lib/types/ext.d.ts +81 -0
- package/lib/types/internal.d.ts +94 -0
- package/lib/types/jsx.d.ts +309 -0
- package/lib/types/preact.d.ts +340 -0
- package/package.json +111 -0
- package/tsconfig.json +30 -0
|
@@ -0,0 +1,1926 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var _a;
|
|
6
|
+
function noop() {}
|
|
7
|
+
const identity = (x) => x;
|
|
8
|
+
function assign(tar, src) {
|
|
9
|
+
// @ts-ignore
|
|
10
|
+
for (const k in src) tar[k] = src[k];
|
|
11
|
+
return tar;
|
|
12
|
+
}
|
|
13
|
+
function is_promise(value) {
|
|
14
|
+
return value && typeof value === 'object' && typeof value.then === 'function';
|
|
15
|
+
}
|
|
16
|
+
function add_location(element, file, line, column, char) {
|
|
17
|
+
element.__svelte_meta = {
|
|
18
|
+
loc: { file, line, column, char },
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
function run(fn) {
|
|
22
|
+
return fn();
|
|
23
|
+
}
|
|
24
|
+
function blank_object() {
|
|
25
|
+
return Object.create(null);
|
|
26
|
+
}
|
|
27
|
+
function run_all(fns) {
|
|
28
|
+
fns.forEach(run);
|
|
29
|
+
}
|
|
30
|
+
function is_function(thing) {
|
|
31
|
+
return typeof thing === 'function';
|
|
32
|
+
}
|
|
33
|
+
function safe_not_equal(a, b) {
|
|
34
|
+
return a != a ? b == b : a !== b || (a && typeof a === 'object') || typeof a === 'function';
|
|
35
|
+
}
|
|
36
|
+
function not_equal(a, b) {
|
|
37
|
+
return a != a ? b == b : a !== b;
|
|
38
|
+
}
|
|
39
|
+
function is_empty(obj) {
|
|
40
|
+
return Object.keys(obj).length === 0;
|
|
41
|
+
}
|
|
42
|
+
function validate_store(store, name) {
|
|
43
|
+
if (store != null && typeof store.subscribe !== 'function') {
|
|
44
|
+
throw new Error(`'${name}' is not a store with a 'subscribe' method`);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
function subscribe(store, ...callbacks) {
|
|
48
|
+
if (store == null) {
|
|
49
|
+
return noop;
|
|
50
|
+
}
|
|
51
|
+
const unsub = store.subscribe(...callbacks);
|
|
52
|
+
return unsub.unsubscribe ? () => unsub.unsubscribe() : unsub;
|
|
53
|
+
}
|
|
54
|
+
function get_store_value(store) {
|
|
55
|
+
let value;
|
|
56
|
+
subscribe(store, (_) => (value = _))();
|
|
57
|
+
return value;
|
|
58
|
+
}
|
|
59
|
+
function component_subscribe(component, store, callback) {
|
|
60
|
+
component.$$.on_destroy.push(subscribe(store, callback));
|
|
61
|
+
}
|
|
62
|
+
function create_slot(definition, ctx, $$scope, fn) {
|
|
63
|
+
if (definition) {
|
|
64
|
+
const slot_ctx = get_slot_context(definition, ctx, $$scope, fn);
|
|
65
|
+
return definition[0](slot_ctx);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
function get_slot_context(definition, ctx, $$scope, fn) {
|
|
69
|
+
return definition[1] && fn ? assign($$scope.ctx.slice(), definition[1](fn(ctx))) : $$scope.ctx;
|
|
70
|
+
}
|
|
71
|
+
function get_slot_changes(definition, $$scope, dirty, fn) {
|
|
72
|
+
if (definition[2] && fn) {
|
|
73
|
+
const lets = definition[2](fn(dirty));
|
|
74
|
+
if ($$scope.dirty === undefined) {
|
|
75
|
+
return lets;
|
|
76
|
+
}
|
|
77
|
+
if (typeof lets === 'object') {
|
|
78
|
+
const merged = [];
|
|
79
|
+
const len = Math.max($$scope.dirty.length, lets.length);
|
|
80
|
+
for (let i = 0; i < len; i += 1) {
|
|
81
|
+
merged[i] = $$scope.dirty[i] | lets[i];
|
|
82
|
+
}
|
|
83
|
+
return merged;
|
|
84
|
+
}
|
|
85
|
+
return $$scope.dirty | lets;
|
|
86
|
+
}
|
|
87
|
+
return $$scope.dirty;
|
|
88
|
+
}
|
|
89
|
+
function update_slot(slot, slot_definition, ctx, $$scope, dirty, get_slot_changes_fn, get_slot_context_fn) {
|
|
90
|
+
const slot_changes = get_slot_changes(slot_definition, $$scope, dirty, get_slot_changes_fn);
|
|
91
|
+
if (slot_changes) {
|
|
92
|
+
const slot_context = get_slot_context(slot_definition, ctx, $$scope, get_slot_context_fn);
|
|
93
|
+
slot.p(slot_context, slot_changes);
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
function update_slot_spread(slot, slot_definition, ctx, $$scope, dirty, get_slot_changes_fn, get_slot_spread_changes_fn, get_slot_context_fn) {
|
|
97
|
+
const slot_changes = get_slot_spread_changes_fn(dirty) | get_slot_changes(slot_definition, $$scope, dirty, get_slot_changes_fn);
|
|
98
|
+
if (slot_changes) {
|
|
99
|
+
const slot_context = get_slot_context(slot_definition, ctx, $$scope, get_slot_context_fn);
|
|
100
|
+
slot.p(slot_context, slot_changes);
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
function exclude_internal_props(props) {
|
|
104
|
+
const result = {};
|
|
105
|
+
for (const k in props) if (k[0] !== '$') result[k] = props[k];
|
|
106
|
+
return result;
|
|
107
|
+
}
|
|
108
|
+
function compute_rest_props(props, keys) {
|
|
109
|
+
const rest = {};
|
|
110
|
+
keys = new Set(keys);
|
|
111
|
+
for (const k in props) if (!keys.has(k) && k[0] !== '$') rest[k] = props[k];
|
|
112
|
+
return rest;
|
|
113
|
+
}
|
|
114
|
+
function compute_slots(slots) {
|
|
115
|
+
const result = {};
|
|
116
|
+
for (const key in slots) {
|
|
117
|
+
result[key] = true;
|
|
118
|
+
}
|
|
119
|
+
return result;
|
|
120
|
+
}
|
|
121
|
+
function once(fn) {
|
|
122
|
+
let ran = false;
|
|
123
|
+
return function (...args) {
|
|
124
|
+
if (ran) return;
|
|
125
|
+
ran = true;
|
|
126
|
+
fn.call(this, ...args);
|
|
127
|
+
};
|
|
128
|
+
}
|
|
129
|
+
function null_to_empty(value) {
|
|
130
|
+
return value == null ? '' : value;
|
|
131
|
+
}
|
|
132
|
+
function set_store_value(store, ret, value = ret) {
|
|
133
|
+
store.set(value);
|
|
134
|
+
return ret;
|
|
135
|
+
}
|
|
136
|
+
const has_prop = (obj, prop) => Object.prototype.hasOwnProperty.call(obj, prop);
|
|
137
|
+
function action_destroyer(action_result) {
|
|
138
|
+
return action_result && is_function(action_result.destroy) ? action_result.destroy : noop;
|
|
139
|
+
}
|
|
140
|
+
// PIKA: 支持空节点
|
|
141
|
+
const pixuiVersion = (_a = navigator.userAgent.match(/PixUI\/(\d\.\d)/)) === null || _a === void 0 ? void 0 : _a[1];
|
|
142
|
+
const isSupportEmptyText = !pixuiVersion || parseInt(pixuiVersion, 10) >= 0.4;
|
|
143
|
+
|
|
144
|
+
const is_client = typeof window !== 'undefined';
|
|
145
|
+
exports.now = is_client ? () => window.performance.now() : () => Date.now();
|
|
146
|
+
exports.raf = is_client ? (cb) => requestAnimationFrame(cb) : noop;
|
|
147
|
+
// used internally for testing
|
|
148
|
+
function set_now(fn) {
|
|
149
|
+
exports.now = fn;
|
|
150
|
+
}
|
|
151
|
+
function set_raf(fn) {
|
|
152
|
+
exports.raf = fn;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
const tasks = new Set();
|
|
156
|
+
function run_tasks(now) {
|
|
157
|
+
tasks.forEach((task) => {
|
|
158
|
+
if (!task.c(now)) {
|
|
159
|
+
tasks.delete(task);
|
|
160
|
+
task.f();
|
|
161
|
+
}
|
|
162
|
+
});
|
|
163
|
+
// requestAnimationFrame
|
|
164
|
+
if (tasks.size !== 0) exports.raf(run_tasks);
|
|
165
|
+
}
|
|
166
|
+
/**
|
|
167
|
+
* For testing purposes only!
|
|
168
|
+
*/
|
|
169
|
+
function clear_loops() {
|
|
170
|
+
tasks.clear();
|
|
171
|
+
}
|
|
172
|
+
/**
|
|
173
|
+
* Creates a new task that runs on each raf frame
|
|
174
|
+
* until it returns a falsy value or is aborted
|
|
175
|
+
*/
|
|
176
|
+
function loop(callback) {
|
|
177
|
+
let task;
|
|
178
|
+
if (tasks.size === 0) exports.raf(run_tasks);
|
|
179
|
+
return {
|
|
180
|
+
promise: new Promise((fulfill) => {
|
|
181
|
+
tasks.add((task = { c: callback, f: fulfill }));
|
|
182
|
+
}),
|
|
183
|
+
abort() {
|
|
184
|
+
tasks.delete(task);
|
|
185
|
+
},
|
|
186
|
+
};
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
function append(target, node) {
|
|
190
|
+
// PIKA: svelte 懒操作 DOM
|
|
191
|
+
//@ts-ignore
|
|
192
|
+
if (Array.from(target.childNodes).indexOf(node) === -1) {
|
|
193
|
+
// console.log('append', target, node);
|
|
194
|
+
target.appendChild(node);
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
function insert(target, node, anchor) {
|
|
198
|
+
// PIKA: 兼容 PixUI insertBefore 与标准不对齐的问题
|
|
199
|
+
if (anchor) {
|
|
200
|
+
// console.log('insert', target, node, anchor);
|
|
201
|
+
target.insertBefore(node, anchor || null);
|
|
202
|
+
}
|
|
203
|
+
else {
|
|
204
|
+
append(target, node);
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
function detach(node) {
|
|
208
|
+
// console.log('detach', node);
|
|
209
|
+
node.parentNode.removeChild(node);
|
|
210
|
+
}
|
|
211
|
+
function destroy_each(iterations, detaching) {
|
|
212
|
+
for (let i = 0; i < iterations.length; i += 1) {
|
|
213
|
+
if (iterations[i]) iterations[i].d(detaching);
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
function element(name) {
|
|
217
|
+
return document.createElement(name);
|
|
218
|
+
}
|
|
219
|
+
function element_is(name, is) {
|
|
220
|
+
return document.createElement(name, { is });
|
|
221
|
+
}
|
|
222
|
+
function object_without_properties(obj, exclude) {
|
|
223
|
+
const target = {};
|
|
224
|
+
for (const k in obj) {
|
|
225
|
+
if (
|
|
226
|
+
has_prop(obj, k) &&
|
|
227
|
+
// @ts-ignore
|
|
228
|
+
exclude.indexOf(k) === -1
|
|
229
|
+
) {
|
|
230
|
+
// @ts-ignore
|
|
231
|
+
target[k] = obj[k];
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
return target;
|
|
235
|
+
}
|
|
236
|
+
function svg_element(name) {
|
|
237
|
+
return document.createElementNS('http://www.w3.org/2000/svg', name);
|
|
238
|
+
}
|
|
239
|
+
function text(data) {
|
|
240
|
+
return document.createTextNode(data);
|
|
241
|
+
}
|
|
242
|
+
// PIKA: 支持空节点
|
|
243
|
+
function space() {
|
|
244
|
+
// @ts-ignore
|
|
245
|
+
// return element('pika-empty');
|
|
246
|
+
// return text(' ');
|
|
247
|
+
return isSupportEmptyText ? text(' ') : element('pika-empty');
|
|
248
|
+
}
|
|
249
|
+
// PIKA: 支持空节点
|
|
250
|
+
function empty() {
|
|
251
|
+
// PIKA: 兼容 PixUI 空文本会占用行高的问题
|
|
252
|
+
// @ts-ignore
|
|
253
|
+
return isSupportEmptyText ? text('') : element('pika-empty');
|
|
254
|
+
// return text('');
|
|
255
|
+
}
|
|
256
|
+
function listen(node, event, handler, options) {
|
|
257
|
+
node.addEventListener(event, handler, options);
|
|
258
|
+
return () => node.removeEventListener(event, handler, options);
|
|
259
|
+
}
|
|
260
|
+
function prevent_default(fn) {
|
|
261
|
+
return function (event) {
|
|
262
|
+
event.preventDefault();
|
|
263
|
+
// @ts-ignore
|
|
264
|
+
return fn.call(this, event);
|
|
265
|
+
};
|
|
266
|
+
}
|
|
267
|
+
function stop_propagation(fn) {
|
|
268
|
+
return function (event) {
|
|
269
|
+
event.stopPropagation();
|
|
270
|
+
// @ts-ignore
|
|
271
|
+
return fn.call(this, event);
|
|
272
|
+
};
|
|
273
|
+
}
|
|
274
|
+
function self(fn) {
|
|
275
|
+
return function (event) {
|
|
276
|
+
// @ts-ignore
|
|
277
|
+
if (event.target === this) fn.call(this, event);
|
|
278
|
+
};
|
|
279
|
+
}
|
|
280
|
+
const compatAttrMap = {
|
|
281
|
+
draggable: true,
|
|
282
|
+
src: true,
|
|
283
|
+
width: true,
|
|
284
|
+
height: true,
|
|
285
|
+
value: true,
|
|
286
|
+
placeholder: true,
|
|
287
|
+
noclip: true,
|
|
288
|
+
};
|
|
289
|
+
function attr(node, attribute, value) {
|
|
290
|
+
// PIKA: 兼容 draggable 等属性设置方式问题
|
|
291
|
+
if (has_prop(compatAttrMap, attribute)) {
|
|
292
|
+
node[attribute] = value;
|
|
293
|
+
// return;
|
|
294
|
+
}
|
|
295
|
+
if (value == null) node.removeAttribute(attribute);
|
|
296
|
+
else if (node.getAttribute(attribute) !== value) node.setAttribute(attribute, value);
|
|
297
|
+
}
|
|
298
|
+
function show(node) {
|
|
299
|
+
toggle_class(node, 'pika_lazy_block', false);
|
|
300
|
+
}
|
|
301
|
+
function hide(node) {
|
|
302
|
+
toggle_class(node, 'pika_lazy_block', true);
|
|
303
|
+
}
|
|
304
|
+
let hasInitLazyClass = false;
|
|
305
|
+
function initLazyClass(_node) {
|
|
306
|
+
if (!hasInitLazyClass) {
|
|
307
|
+
hasInitLazyClass = true;
|
|
308
|
+
const style = document.createElement('style');
|
|
309
|
+
document.head.appendChild(style);
|
|
310
|
+
style.type = 'text/css';
|
|
311
|
+
style.appendChild(
|
|
312
|
+
document.createTextNode(`
|
|
313
|
+
.pika_lazy_block {
|
|
314
|
+
position: absolute!important;
|
|
315
|
+
left: -10000px!important;
|
|
316
|
+
}
|
|
317
|
+
`),
|
|
318
|
+
);
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
function set_attributes(node, attributes) {
|
|
322
|
+
// @ts-ignore
|
|
323
|
+
const descriptors = Object.getOwnPropertyDescriptors(node.__proto__);
|
|
324
|
+
for (const key in attributes) {
|
|
325
|
+
if (attributes[key] == null) {
|
|
326
|
+
node.removeAttribute(key);
|
|
327
|
+
}
|
|
328
|
+
else if (key === 'style') {
|
|
329
|
+
node.style.cssText = attributes[key];
|
|
330
|
+
}
|
|
331
|
+
else if (key === '__value') {
|
|
332
|
+
node.value = node[key] = attributes[key];
|
|
333
|
+
}
|
|
334
|
+
else if (descriptors[key] && descriptors[key].set) {
|
|
335
|
+
node[key] = attributes[key];
|
|
336
|
+
}
|
|
337
|
+
else {
|
|
338
|
+
attr(node, key, attributes[key]);
|
|
339
|
+
}
|
|
340
|
+
}
|
|
341
|
+
}
|
|
342
|
+
function set_svg_attributes(node, attributes) {
|
|
343
|
+
for (const key in attributes) {
|
|
344
|
+
attr(node, key, attributes[key]);
|
|
345
|
+
}
|
|
346
|
+
}
|
|
347
|
+
function set_custom_element_data(node, prop, value) {
|
|
348
|
+
if (prop in node) {
|
|
349
|
+
node[prop] = value;
|
|
350
|
+
}
|
|
351
|
+
else {
|
|
352
|
+
attr(node, prop, value);
|
|
353
|
+
}
|
|
354
|
+
}
|
|
355
|
+
function xlink_attr(node, attribute, value) {
|
|
356
|
+
node.setAttributeNS('http://www.w3.org/1999/xlink', attribute, value);
|
|
357
|
+
}
|
|
358
|
+
function get_binding_group_value(group, __value, checked) {
|
|
359
|
+
const value = new Set();
|
|
360
|
+
for (let i = 0; i < group.length; i += 1) {
|
|
361
|
+
if (group[i].checked) value.add(group[i].__value);
|
|
362
|
+
}
|
|
363
|
+
if (!checked) {
|
|
364
|
+
value.delete(__value);
|
|
365
|
+
}
|
|
366
|
+
return Array.from(value);
|
|
367
|
+
}
|
|
368
|
+
function to_number(value) {
|
|
369
|
+
return value === '' ? null : +value;
|
|
370
|
+
}
|
|
371
|
+
function time_ranges_to_array(ranges) {
|
|
372
|
+
const array = [];
|
|
373
|
+
for (let i = 0; i < ranges.length; i += 1) {
|
|
374
|
+
array.push({ start: ranges.start(i), end: ranges.end(i) });
|
|
375
|
+
}
|
|
376
|
+
return array;
|
|
377
|
+
}
|
|
378
|
+
function children(element) {
|
|
379
|
+
return Array.from(element.childNodes);
|
|
380
|
+
}
|
|
381
|
+
function claim_element(nodes, name, attributes, svg) {
|
|
382
|
+
for (let i = 0; i < nodes.length; i += 1) {
|
|
383
|
+
const node = nodes[i];
|
|
384
|
+
if (node.nodeName === name) {
|
|
385
|
+
let j = 0;
|
|
386
|
+
const remove = [];
|
|
387
|
+
while (j < node.attributes.length) {
|
|
388
|
+
const attribute = node.attributes[j++];
|
|
389
|
+
if (!attributes[attribute.name]) {
|
|
390
|
+
remove.push(attribute.name);
|
|
391
|
+
}
|
|
392
|
+
}
|
|
393
|
+
for (let k = 0; k < remove.length; k++) {
|
|
394
|
+
node.removeAttribute(remove[k]);
|
|
395
|
+
}
|
|
396
|
+
return nodes.splice(i, 1)[0];
|
|
397
|
+
}
|
|
398
|
+
}
|
|
399
|
+
return svg ? svg_element(name) : element(name);
|
|
400
|
+
}
|
|
401
|
+
function claim_text(nodes, data) {
|
|
402
|
+
for (let i = 0; i < nodes.length; i += 1) {
|
|
403
|
+
const node = nodes[i];
|
|
404
|
+
if (node.nodeType === 3) {
|
|
405
|
+
node.data = '' + data;
|
|
406
|
+
return nodes.splice(i, 1)[0];
|
|
407
|
+
}
|
|
408
|
+
}
|
|
409
|
+
return text(data);
|
|
410
|
+
}
|
|
411
|
+
function claim_space(nodes) {
|
|
412
|
+
return claim_text(nodes, ' ');
|
|
413
|
+
}
|
|
414
|
+
function set_data(text, data) {
|
|
415
|
+
data = '' + data;
|
|
416
|
+
// PIKA: 兼容 wholeText
|
|
417
|
+
if (text.data !== data) text.data = data;
|
|
418
|
+
}
|
|
419
|
+
function set_input_value(input, value) {
|
|
420
|
+
input.value = value == null ? '' : value;
|
|
421
|
+
}
|
|
422
|
+
function set_input_type(input, type) {
|
|
423
|
+
try {
|
|
424
|
+
input.type = type;
|
|
425
|
+
}
|
|
426
|
+
catch (e) {
|
|
427
|
+
// do nothing
|
|
428
|
+
}
|
|
429
|
+
}
|
|
430
|
+
function set_style(node, key, value, _important) {
|
|
431
|
+
// PIKA: style key 全部转为驼峰
|
|
432
|
+
const camelKey = key.replace(/-(\w)/g, (_match, $1) => $1.toUpperCase());
|
|
433
|
+
// PIKA: 懒更新,PixUI v0.4- 会触发 style parse
|
|
434
|
+
if (node.style[camelKey] !== value) {
|
|
435
|
+
node.style[camelKey] = value;
|
|
436
|
+
}
|
|
437
|
+
// node.style.setProperty(key, value, important ? 'important' : '');
|
|
438
|
+
}
|
|
439
|
+
function select_option(select, value) {
|
|
440
|
+
for (let i = 0; i < select.options.length; i += 1) {
|
|
441
|
+
const option = select.options[i];
|
|
442
|
+
if (option.__value === value) {
|
|
443
|
+
option.selected = true;
|
|
444
|
+
return;
|
|
445
|
+
}
|
|
446
|
+
}
|
|
447
|
+
}
|
|
448
|
+
function select_options(select, value) {
|
|
449
|
+
for (let i = 0; i < select.options.length; i += 1) {
|
|
450
|
+
const option = select.options[i];
|
|
451
|
+
option.selected = ~value.indexOf(option.__value);
|
|
452
|
+
}
|
|
453
|
+
}
|
|
454
|
+
function select_value(select) {
|
|
455
|
+
const selected_option = select.querySelector(':checked') || select.options[0];
|
|
456
|
+
return selected_option && selected_option.__value;
|
|
457
|
+
}
|
|
458
|
+
function select_multiple_value(select) {
|
|
459
|
+
return [].map.call(select.querySelectorAll(':checked'), (option) => option.__value);
|
|
460
|
+
}
|
|
461
|
+
// unfortunately this can't be a constant as that wouldn't be tree-shakeable
|
|
462
|
+
// so we cache the result instead
|
|
463
|
+
let crossorigin;
|
|
464
|
+
function is_crossorigin() {
|
|
465
|
+
if (crossorigin === undefined) {
|
|
466
|
+
crossorigin = false;
|
|
467
|
+
try {
|
|
468
|
+
if (typeof window !== 'undefined' && window.parent) {
|
|
469
|
+
void window.parent.document;
|
|
470
|
+
}
|
|
471
|
+
}
|
|
472
|
+
catch (error) {
|
|
473
|
+
crossorigin = true;
|
|
474
|
+
}
|
|
475
|
+
}
|
|
476
|
+
return crossorigin;
|
|
477
|
+
}
|
|
478
|
+
function add_resize_listener(node, fn) {
|
|
479
|
+
const computed_style = getComputedStyle(node);
|
|
480
|
+
if (computed_style.position === 'static') {
|
|
481
|
+
node.style.position = 'relative';
|
|
482
|
+
}
|
|
483
|
+
const iframe = element('iframe');
|
|
484
|
+
iframe.setAttribute('style', 'display: block; position: absolute; top: 0; left: 0; width: 100%; height: 100%; ' + 'overflow: hidden; border: 0; opacity: 0; pointer-events: none; z-index: -1;');
|
|
485
|
+
iframe.setAttribute('aria-hidden', 'true');
|
|
486
|
+
iframe.tabIndex = -1;
|
|
487
|
+
const crossorigin = is_crossorigin();
|
|
488
|
+
let unsubscribe;
|
|
489
|
+
if (crossorigin) {
|
|
490
|
+
iframe.src = 'data:text/html,<script>onresize=function(){parent.postMessage(0,\'*\')}</script>';
|
|
491
|
+
unsubscribe = listen(window, 'message', (event) => {
|
|
492
|
+
if (event.source === iframe.contentWindow) fn();
|
|
493
|
+
});
|
|
494
|
+
}
|
|
495
|
+
else {
|
|
496
|
+
iframe.src = 'about:blank';
|
|
497
|
+
iframe.onload = () => {
|
|
498
|
+
unsubscribe = listen(iframe.contentWindow, 'resize', fn);
|
|
499
|
+
};
|
|
500
|
+
}
|
|
501
|
+
append(node, iframe);
|
|
502
|
+
return () => {
|
|
503
|
+
if (crossorigin) {
|
|
504
|
+
unsubscribe();
|
|
505
|
+
}
|
|
506
|
+
else if (unsubscribe && iframe.contentWindow) {
|
|
507
|
+
unsubscribe();
|
|
508
|
+
}
|
|
509
|
+
detach(iframe);
|
|
510
|
+
};
|
|
511
|
+
}
|
|
512
|
+
function toggle_class(element, name, toggle) {
|
|
513
|
+
// PIKA: 兼容 classList
|
|
514
|
+
const clasNameStr = element.className;
|
|
515
|
+
const classNameArr = clasNameStr.split(' ');
|
|
516
|
+
const idx = classNameArr.indexOf(name);
|
|
517
|
+
if (toggle) {
|
|
518
|
+
if (idx === -1) {
|
|
519
|
+
element.className = `${clasNameStr} ${name}`;
|
|
520
|
+
}
|
|
521
|
+
}
|
|
522
|
+
else {
|
|
523
|
+
if (idx !== -1) {
|
|
524
|
+
classNameArr.splice(idx, 1);
|
|
525
|
+
element.className = classNameArr.join(' ');
|
|
526
|
+
}
|
|
527
|
+
}
|
|
528
|
+
// element.classList[toggle ? 'add' : 'remove'](name);
|
|
529
|
+
}
|
|
530
|
+
function custom_event(type, detail) {
|
|
531
|
+
// PIKA: 支持自定义事件
|
|
532
|
+
const e = { type, detail };
|
|
533
|
+
// const e: CustomEvent<T> = document.createEvent('CustomEvent');
|
|
534
|
+
// e.initCustomEvent(type, false, false, detail);
|
|
535
|
+
return e;
|
|
536
|
+
}
|
|
537
|
+
function query_selector_all(selector, parent = document.body) {
|
|
538
|
+
return Array.from(parent.querySelectorAll(selector));
|
|
539
|
+
}
|
|
540
|
+
class HtmlTag {
|
|
541
|
+
constructor(anchor = null) {
|
|
542
|
+
this.a = anchor;
|
|
543
|
+
this.e = this.n = null;
|
|
544
|
+
}
|
|
545
|
+
// insert childNodes into parent
|
|
546
|
+
m(html, target, anchor = null) {
|
|
547
|
+
if (!this.e) {
|
|
548
|
+
this.e = element(target.nodeName);
|
|
549
|
+
this.t = target;
|
|
550
|
+
this.h(html);
|
|
551
|
+
}
|
|
552
|
+
this.i(anchor);
|
|
553
|
+
}
|
|
554
|
+
// innerHtml render
|
|
555
|
+
h(html) {
|
|
556
|
+
this.e.innerHTML = html;
|
|
557
|
+
this.n = Array.from(this.e.childNodes);
|
|
558
|
+
}
|
|
559
|
+
// insert childNodes into parent
|
|
560
|
+
i(anchor) {
|
|
561
|
+
for (let i = 0; i < this.n.length; i += 1) {
|
|
562
|
+
insert(this.t, this.n[i], anchor);
|
|
563
|
+
}
|
|
564
|
+
}
|
|
565
|
+
// update childNodes
|
|
566
|
+
p(html) {
|
|
567
|
+
this.d();
|
|
568
|
+
this.h(html);
|
|
569
|
+
this.i(this.a);
|
|
570
|
+
}
|
|
571
|
+
// delete
|
|
572
|
+
d() {
|
|
573
|
+
this.n.forEach(detach);
|
|
574
|
+
}
|
|
575
|
+
}
|
|
576
|
+
function attribute_to_object(attributes) {
|
|
577
|
+
const result = {};
|
|
578
|
+
for (const attribute of attributes) {
|
|
579
|
+
result[attribute.name] = attribute.value;
|
|
580
|
+
}
|
|
581
|
+
return result;
|
|
582
|
+
}
|
|
583
|
+
function get_custom_elements_slots(element) {
|
|
584
|
+
const result = {};
|
|
585
|
+
element.childNodes.forEach((node) => {
|
|
586
|
+
result[node.slot || 'default'] = true;
|
|
587
|
+
});
|
|
588
|
+
return result;
|
|
589
|
+
}
|
|
590
|
+
|
|
591
|
+
const active_docs = new Set();
|
|
592
|
+
let active = 0;
|
|
593
|
+
// https://github.com/darkskyapp/string-hash/blob/master/index.js
|
|
594
|
+
function hash(str) {
|
|
595
|
+
let hash = 5381;
|
|
596
|
+
let i = str.length;
|
|
597
|
+
while (i--) hash = ((hash << 5) - hash) ^ str.charCodeAt(i);
|
|
598
|
+
return hash >>> 0;
|
|
599
|
+
}
|
|
600
|
+
function create_rule(node, a, b, duration, delay, ease, fn, uid = 0) {
|
|
601
|
+
const step = 16.666 / duration;
|
|
602
|
+
let keyframes = '{\n';
|
|
603
|
+
for (let p = 0; p <= 1; p += step) {
|
|
604
|
+
const t = a + (b - a) * ease(p);
|
|
605
|
+
keyframes += p * 100 + `%{${fn(t, 1 - t)}}\n`;
|
|
606
|
+
}
|
|
607
|
+
const rule = keyframes + `100% {${fn(b, 1 - b)}}\n}`;
|
|
608
|
+
const name = `__svelte_${hash(rule)}_${uid}`;
|
|
609
|
+
const doc = node.ownerDocument;
|
|
610
|
+
active_docs.add(doc);
|
|
611
|
+
const stylesheet = doc.__svelte_stylesheet || (doc.__svelte_stylesheet = doc.head.appendChild(element('style')).sheet);
|
|
612
|
+
const current_rules = doc.__svelte_rules || (doc.__svelte_rules = {});
|
|
613
|
+
if (!current_rules[name]) {
|
|
614
|
+
current_rules[name] = true;
|
|
615
|
+
stylesheet.insertRule(`@keyframes ${name} ${rule}`, stylesheet.cssRules.length);
|
|
616
|
+
}
|
|
617
|
+
const animation = node.style.animation || '';
|
|
618
|
+
node.style.animation = `${animation ? `${animation}, ` : ''}${name} ${duration}ms linear ${delay}ms 1 both`;
|
|
619
|
+
active += 1;
|
|
620
|
+
return name;
|
|
621
|
+
}
|
|
622
|
+
function delete_rule(node, name) {
|
|
623
|
+
const previous = (node.style.animation || '').split(', ');
|
|
624
|
+
const next = previous.filter(
|
|
625
|
+
name
|
|
626
|
+
? (anim) => anim.indexOf(name) < 0 // remove specific animation
|
|
627
|
+
: (anim) => anim.indexOf('__svelte') === -1, // remove all Svelte animations
|
|
628
|
+
);
|
|
629
|
+
const deleted = previous.length - next.length;
|
|
630
|
+
if (deleted) {
|
|
631
|
+
node.style.animation = next.join(', ');
|
|
632
|
+
active -= deleted;
|
|
633
|
+
if (!active) clear_rules();
|
|
634
|
+
}
|
|
635
|
+
}
|
|
636
|
+
function clear_rules() {
|
|
637
|
+
exports.raf(() => {
|
|
638
|
+
if (active) return;
|
|
639
|
+
active_docs.forEach((doc) => {
|
|
640
|
+
const stylesheet = doc.__svelte_stylesheet;
|
|
641
|
+
let i = stylesheet.cssRules.length;
|
|
642
|
+
while (i--) stylesheet.deleteRule(i);
|
|
643
|
+
doc.__svelte_rules = {};
|
|
644
|
+
});
|
|
645
|
+
active_docs.clear();
|
|
646
|
+
});
|
|
647
|
+
}
|
|
648
|
+
|
|
649
|
+
function create_animation(node, from, fn, params) {
|
|
650
|
+
if (!from) return noop;
|
|
651
|
+
const to = node.getBoundingClientRect();
|
|
652
|
+
if (from.left === to.left && from.right === to.right && from.top === to.top && from.bottom === to.bottom) return noop;
|
|
653
|
+
const {
|
|
654
|
+
delay = 0,
|
|
655
|
+
duration = 300,
|
|
656
|
+
easing = identity,
|
|
657
|
+
// @ts-ignore todo: should this be separated from destructuring? Or start/end added to public api and documentation?
|
|
658
|
+
start: start_time = exports.now() + delay,
|
|
659
|
+
// @ts-ignore todo:
|
|
660
|
+
end = start_time + duration,
|
|
661
|
+
tick = noop,
|
|
662
|
+
css,
|
|
663
|
+
} = fn(node, { from, to }, params);
|
|
664
|
+
let running = true;
|
|
665
|
+
let started = false;
|
|
666
|
+
let name;
|
|
667
|
+
function start() {
|
|
668
|
+
if (css) {
|
|
669
|
+
name = create_rule(node, 0, 1, duration, delay, easing, css);
|
|
670
|
+
}
|
|
671
|
+
if (!delay) {
|
|
672
|
+
started = true;
|
|
673
|
+
}
|
|
674
|
+
}
|
|
675
|
+
function stop() {
|
|
676
|
+
if (css) delete_rule(node, name);
|
|
677
|
+
running = false;
|
|
678
|
+
}
|
|
679
|
+
loop((now) => {
|
|
680
|
+
if (!started && now >= start_time) {
|
|
681
|
+
started = true;
|
|
682
|
+
}
|
|
683
|
+
if (started && now >= end) {
|
|
684
|
+
tick(1, 0);
|
|
685
|
+
stop();
|
|
686
|
+
}
|
|
687
|
+
if (!running) {
|
|
688
|
+
return false;
|
|
689
|
+
}
|
|
690
|
+
if (started) {
|
|
691
|
+
const p = now - start_time;
|
|
692
|
+
const t = 0 + 1 * easing(p / duration);
|
|
693
|
+
tick(t, 1 - t);
|
|
694
|
+
}
|
|
695
|
+
return true;
|
|
696
|
+
});
|
|
697
|
+
start();
|
|
698
|
+
tick(0, 1);
|
|
699
|
+
return stop;
|
|
700
|
+
}
|
|
701
|
+
function fix_position(node) {
|
|
702
|
+
const style = getComputedStyle(node);
|
|
703
|
+
if (style.position !== 'absolute' && style.position !== 'fixed') {
|
|
704
|
+
const { width, height } = style;
|
|
705
|
+
const a = node.getBoundingClientRect();
|
|
706
|
+
node.style.position = 'absolute';
|
|
707
|
+
node.style.width = width;
|
|
708
|
+
node.style.height = height;
|
|
709
|
+
add_transform(node, a);
|
|
710
|
+
}
|
|
711
|
+
}
|
|
712
|
+
function add_transform(node, a) {
|
|
713
|
+
const b = node.getBoundingClientRect();
|
|
714
|
+
if (a.left !== b.left || a.top !== b.top) {
|
|
715
|
+
const style = getComputedStyle(node);
|
|
716
|
+
const transform = style.transform === 'none' ? '' : style.transform;
|
|
717
|
+
node.style.transform = `${transform} translate(${a.left - b.left}px, ${a.top - b.top}px)`;
|
|
718
|
+
}
|
|
719
|
+
}
|
|
720
|
+
|
|
721
|
+
function set_current_component(component) {
|
|
722
|
+
exports.current_component = component;
|
|
723
|
+
}
|
|
724
|
+
function get_current_component() {
|
|
725
|
+
if (!exports.current_component) throw new Error('Function called outside component initialization');
|
|
726
|
+
return exports.current_component;
|
|
727
|
+
}
|
|
728
|
+
function beforeUpdate(fn) {
|
|
729
|
+
get_current_component().$$.before_update.push(fn);
|
|
730
|
+
}
|
|
731
|
+
function onMount(fn) {
|
|
732
|
+
get_current_component().$$.on_mount.push(fn);
|
|
733
|
+
}
|
|
734
|
+
function afterUpdate(fn) {
|
|
735
|
+
get_current_component().$$.after_update.push(fn);
|
|
736
|
+
}
|
|
737
|
+
function onDestroy(fn) {
|
|
738
|
+
get_current_component().$$.on_destroy.push(fn);
|
|
739
|
+
}
|
|
740
|
+
function createEventDispatcher() {
|
|
741
|
+
const component = get_current_component();
|
|
742
|
+
return (type, detail) => {
|
|
743
|
+
const callbacks = component.$$.callbacks[type];
|
|
744
|
+
if (callbacks) {
|
|
745
|
+
// TODO are there situations where events could be dispatched
|
|
746
|
+
// in a server (non-DOM) environment?
|
|
747
|
+
const event = custom_event(type, detail);
|
|
748
|
+
callbacks.slice().forEach((fn) => {
|
|
749
|
+
fn.call(component, event);
|
|
750
|
+
});
|
|
751
|
+
}
|
|
752
|
+
};
|
|
753
|
+
}
|
|
754
|
+
function setContext(key, context) {
|
|
755
|
+
get_current_component().$$.context.set(key, context);
|
|
756
|
+
}
|
|
757
|
+
function getContext(key) {
|
|
758
|
+
return get_current_component().$$.context.get(key);
|
|
759
|
+
}
|
|
760
|
+
function hasContext(key) {
|
|
761
|
+
return get_current_component().$$.context.has(key);
|
|
762
|
+
}
|
|
763
|
+
// TODO figure out if we still want to support
|
|
764
|
+
// shorthand events, or if we want to implement
|
|
765
|
+
// a real bubbling mechanism
|
|
766
|
+
function bubble(component, event) {
|
|
767
|
+
const callbacks = component.$$.callbacks[event.type];
|
|
768
|
+
if (callbacks) {
|
|
769
|
+
callbacks.slice().forEach((fn) => fn(event));
|
|
770
|
+
}
|
|
771
|
+
}
|
|
772
|
+
|
|
773
|
+
const dirty_components = [];
|
|
774
|
+
const intros = { enabled: false };
|
|
775
|
+
const binding_callbacks = [];
|
|
776
|
+
const render_callbacks = [];
|
|
777
|
+
const flush_callbacks = [];
|
|
778
|
+
const resolved_promise = Promise.resolve();
|
|
779
|
+
let update_scheduled = false;
|
|
780
|
+
function schedule_update() {
|
|
781
|
+
if (!update_scheduled) {
|
|
782
|
+
update_scheduled = true;
|
|
783
|
+
resolved_promise.then(flush);
|
|
784
|
+
}
|
|
785
|
+
}
|
|
786
|
+
function tick() {
|
|
787
|
+
schedule_update();
|
|
788
|
+
return resolved_promise;
|
|
789
|
+
}
|
|
790
|
+
function add_render_callback(fn) {
|
|
791
|
+
render_callbacks.push(fn);
|
|
792
|
+
}
|
|
793
|
+
function add_flush_callback(fn) {
|
|
794
|
+
flush_callbacks.push(fn);
|
|
795
|
+
}
|
|
796
|
+
let flushing = false;
|
|
797
|
+
const seen_callbacks = new Set();
|
|
798
|
+
function flush() {
|
|
799
|
+
if (flushing) return;
|
|
800
|
+
flushing = true;
|
|
801
|
+
do {
|
|
802
|
+
// first, call beforeUpdate functions
|
|
803
|
+
// and update components
|
|
804
|
+
for (let i = 0; i < dirty_components.length; i += 1) {
|
|
805
|
+
const component = dirty_components[i];
|
|
806
|
+
set_current_component(component);
|
|
807
|
+
update(component.$$);
|
|
808
|
+
}
|
|
809
|
+
set_current_component(null);
|
|
810
|
+
dirty_components.length = 0;
|
|
811
|
+
while (binding_callbacks.length) binding_callbacks.pop()();
|
|
812
|
+
// then, once components are updated, call
|
|
813
|
+
// afterUpdate functions. This may cause
|
|
814
|
+
// subsequent updates...
|
|
815
|
+
for (let i = 0; i < render_callbacks.length; i += 1) {
|
|
816
|
+
const callback = render_callbacks[i];
|
|
817
|
+
if (!seen_callbacks.has(callback)) {
|
|
818
|
+
// ...so guard against infinite loops
|
|
819
|
+
seen_callbacks.add(callback);
|
|
820
|
+
callback();
|
|
821
|
+
}
|
|
822
|
+
}
|
|
823
|
+
render_callbacks.length = 0;
|
|
824
|
+
} while (dirty_components.length);
|
|
825
|
+
while (flush_callbacks.length) {
|
|
826
|
+
flush_callbacks.pop()();
|
|
827
|
+
}
|
|
828
|
+
update_scheduled = false;
|
|
829
|
+
flushing = false;
|
|
830
|
+
seen_callbacks.clear();
|
|
831
|
+
}
|
|
832
|
+
function update($$) {
|
|
833
|
+
if ($$.fragment !== null) {
|
|
834
|
+
$$.update();
|
|
835
|
+
run_all($$.before_update);
|
|
836
|
+
const dirty = $$.dirty;
|
|
837
|
+
$$.dirty = [-1];
|
|
838
|
+
$$.fragment && $$.fragment.p($$.ctx, dirty);
|
|
839
|
+
$$.after_update.forEach(add_render_callback);
|
|
840
|
+
}
|
|
841
|
+
}
|
|
842
|
+
|
|
843
|
+
let promise;
|
|
844
|
+
function wait() {
|
|
845
|
+
if (!promise) {
|
|
846
|
+
promise = Promise.resolve();
|
|
847
|
+
promise.then(() => {
|
|
848
|
+
promise = null;
|
|
849
|
+
});
|
|
850
|
+
}
|
|
851
|
+
return promise;
|
|
852
|
+
}
|
|
853
|
+
function dispatch(node, direction, kind) {
|
|
854
|
+
// @ts-ignore
|
|
855
|
+
node.dispatchEvent(custom_event(`${direction ? 'intro' : 'outro'}${kind}`));
|
|
856
|
+
}
|
|
857
|
+
const outroing = new Set();
|
|
858
|
+
let outros;
|
|
859
|
+
function group_outros() {
|
|
860
|
+
outros = {
|
|
861
|
+
r: 0,
|
|
862
|
+
c: [],
|
|
863
|
+
p: outros, // parent group
|
|
864
|
+
};
|
|
865
|
+
}
|
|
866
|
+
function check_outros() {
|
|
867
|
+
if (!outros.r) {
|
|
868
|
+
run_all(outros.c);
|
|
869
|
+
}
|
|
870
|
+
outros = outros.p;
|
|
871
|
+
}
|
|
872
|
+
function transition_in(block, local) {
|
|
873
|
+
if (block && block.i) {
|
|
874
|
+
outroing.delete(block);
|
|
875
|
+
block.i(local);
|
|
876
|
+
}
|
|
877
|
+
}
|
|
878
|
+
function transition_out(block, local, detach, callback) {
|
|
879
|
+
if (block && block.o) {
|
|
880
|
+
if (outroing.has(block)) return;
|
|
881
|
+
outroing.add(block);
|
|
882
|
+
outros.c.push(() => {
|
|
883
|
+
outroing.delete(block);
|
|
884
|
+
if (callback) {
|
|
885
|
+
if (detach) block.d(1);
|
|
886
|
+
callback();
|
|
887
|
+
}
|
|
888
|
+
});
|
|
889
|
+
block.o(local);
|
|
890
|
+
}
|
|
891
|
+
}
|
|
892
|
+
const null_transition = { duration: 0 };
|
|
893
|
+
function create_in_transition(node, fn, params) {
|
|
894
|
+
let config = fn(node, params);
|
|
895
|
+
let running = false;
|
|
896
|
+
let animation_name;
|
|
897
|
+
let task;
|
|
898
|
+
let uid = 0;
|
|
899
|
+
function cleanup() {
|
|
900
|
+
if (animation_name) delete_rule(node, animation_name);
|
|
901
|
+
}
|
|
902
|
+
function go() {
|
|
903
|
+
const { delay = 0, duration = 300, easing = identity, tick = noop, css } = config || null_transition;
|
|
904
|
+
if (css) animation_name = create_rule(node, 0, 1, duration, delay, easing, css, uid++);
|
|
905
|
+
tick(0, 1);
|
|
906
|
+
const start_time = exports.now() + delay;
|
|
907
|
+
const end_time = start_time + duration;
|
|
908
|
+
if (task) task.abort();
|
|
909
|
+
running = true;
|
|
910
|
+
add_render_callback(() => dispatch(node, true, 'start'));
|
|
911
|
+
task = loop((now) => {
|
|
912
|
+
if (running) {
|
|
913
|
+
if (now >= end_time) {
|
|
914
|
+
tick(1, 0);
|
|
915
|
+
dispatch(node, true, 'end');
|
|
916
|
+
cleanup();
|
|
917
|
+
return (running = false);
|
|
918
|
+
}
|
|
919
|
+
if (now >= start_time) {
|
|
920
|
+
const t = easing((now - start_time) / duration);
|
|
921
|
+
tick(t, 1 - t);
|
|
922
|
+
}
|
|
923
|
+
}
|
|
924
|
+
return running;
|
|
925
|
+
});
|
|
926
|
+
}
|
|
927
|
+
let started = false;
|
|
928
|
+
return {
|
|
929
|
+
start() {
|
|
930
|
+
if (started) return;
|
|
931
|
+
delete_rule(node);
|
|
932
|
+
if (is_function(config)) {
|
|
933
|
+
config = config();
|
|
934
|
+
wait().then(go);
|
|
935
|
+
}
|
|
936
|
+
else {
|
|
937
|
+
go();
|
|
938
|
+
}
|
|
939
|
+
},
|
|
940
|
+
invalidate() {
|
|
941
|
+
started = false;
|
|
942
|
+
},
|
|
943
|
+
end() {
|
|
944
|
+
if (running) {
|
|
945
|
+
cleanup();
|
|
946
|
+
running = false;
|
|
947
|
+
}
|
|
948
|
+
},
|
|
949
|
+
};
|
|
950
|
+
}
|
|
951
|
+
function create_out_transition(node, fn, params) {
|
|
952
|
+
let config = fn(node, params);
|
|
953
|
+
let running = true;
|
|
954
|
+
let animation_name;
|
|
955
|
+
const group = outros;
|
|
956
|
+
group.r += 1;
|
|
957
|
+
function go() {
|
|
958
|
+
const { delay = 0, duration = 300, easing = identity, tick = noop, css } = config || null_transition;
|
|
959
|
+
if (css) animation_name = create_rule(node, 1, 0, duration, delay, easing, css);
|
|
960
|
+
const start_time = exports.now() + delay;
|
|
961
|
+
const end_time = start_time + duration;
|
|
962
|
+
add_render_callback(() => dispatch(node, false, 'start'));
|
|
963
|
+
loop((now) => {
|
|
964
|
+
if (running) {
|
|
965
|
+
if (now >= end_time) {
|
|
966
|
+
tick(0, 1);
|
|
967
|
+
dispatch(node, false, 'end');
|
|
968
|
+
if (!--group.r) {
|
|
969
|
+
// this will result in `end()` being called,
|
|
970
|
+
// so we don't need to clean up here
|
|
971
|
+
run_all(group.c);
|
|
972
|
+
}
|
|
973
|
+
return false;
|
|
974
|
+
}
|
|
975
|
+
if (now >= start_time) {
|
|
976
|
+
const t = easing((now - start_time) / duration);
|
|
977
|
+
tick(1 - t, t);
|
|
978
|
+
}
|
|
979
|
+
}
|
|
980
|
+
return running;
|
|
981
|
+
});
|
|
982
|
+
}
|
|
983
|
+
if (is_function(config)) {
|
|
984
|
+
wait().then(() => {
|
|
985
|
+
// @ts-ignore
|
|
986
|
+
config = config();
|
|
987
|
+
go();
|
|
988
|
+
});
|
|
989
|
+
}
|
|
990
|
+
else {
|
|
991
|
+
go();
|
|
992
|
+
}
|
|
993
|
+
return {
|
|
994
|
+
end(reset) {
|
|
995
|
+
if (reset && config.tick) {
|
|
996
|
+
config.tick(1, 0);
|
|
997
|
+
}
|
|
998
|
+
if (running) {
|
|
999
|
+
if (animation_name) delete_rule(node, animation_name);
|
|
1000
|
+
running = false;
|
|
1001
|
+
}
|
|
1002
|
+
},
|
|
1003
|
+
};
|
|
1004
|
+
}
|
|
1005
|
+
function create_bidirectional_transition(node, fn, params, intro) {
|
|
1006
|
+
let config = fn(node, params);
|
|
1007
|
+
let t = intro ? 0 : 1;
|
|
1008
|
+
let running_program = null;
|
|
1009
|
+
let pending_program = null;
|
|
1010
|
+
let animation_name = null;
|
|
1011
|
+
function clear_animation() {
|
|
1012
|
+
if (animation_name) delete_rule(node, animation_name);
|
|
1013
|
+
}
|
|
1014
|
+
function init(program, duration) {
|
|
1015
|
+
const d = program.b - t;
|
|
1016
|
+
duration *= Math.abs(d);
|
|
1017
|
+
return {
|
|
1018
|
+
a: t,
|
|
1019
|
+
b: program.b,
|
|
1020
|
+
d,
|
|
1021
|
+
duration,
|
|
1022
|
+
start: program.start,
|
|
1023
|
+
end: program.start + duration,
|
|
1024
|
+
group: program.group,
|
|
1025
|
+
};
|
|
1026
|
+
}
|
|
1027
|
+
function go(b) {
|
|
1028
|
+
const { delay = 0, duration = 300, easing = identity, tick = noop, css } = config || null_transition;
|
|
1029
|
+
const program = {
|
|
1030
|
+
start: exports.now() + delay,
|
|
1031
|
+
b,
|
|
1032
|
+
};
|
|
1033
|
+
if (!b) {
|
|
1034
|
+
// @ts-ignore todo: improve typings
|
|
1035
|
+
program.group = outros;
|
|
1036
|
+
outros.r += 1;
|
|
1037
|
+
}
|
|
1038
|
+
if (running_program || pending_program) {
|
|
1039
|
+
pending_program = program;
|
|
1040
|
+
}
|
|
1041
|
+
else {
|
|
1042
|
+
// if this is an intro, and there's a delay, we need to do
|
|
1043
|
+
// an initial tick and/or apply CSS animation immediately
|
|
1044
|
+
if (css) {
|
|
1045
|
+
clear_animation();
|
|
1046
|
+
animation_name = create_rule(node, t, b, duration, delay, easing, css);
|
|
1047
|
+
}
|
|
1048
|
+
if (b) tick(0, 1);
|
|
1049
|
+
running_program = init(program, duration);
|
|
1050
|
+
add_render_callback(() => dispatch(node, b, 'start'));
|
|
1051
|
+
loop((now) => {
|
|
1052
|
+
if (pending_program && now > pending_program.start) {
|
|
1053
|
+
running_program = init(pending_program, duration);
|
|
1054
|
+
pending_program = null;
|
|
1055
|
+
dispatch(node, running_program.b, 'start');
|
|
1056
|
+
if (css) {
|
|
1057
|
+
clear_animation();
|
|
1058
|
+
animation_name = create_rule(node, t, running_program.b, running_program.duration, 0, easing, config.css);
|
|
1059
|
+
}
|
|
1060
|
+
}
|
|
1061
|
+
if (running_program) {
|
|
1062
|
+
if (now >= running_program.end) {
|
|
1063
|
+
tick((t = running_program.b), 1 - t);
|
|
1064
|
+
dispatch(node, running_program.b, 'end');
|
|
1065
|
+
if (!pending_program) {
|
|
1066
|
+
// we're done
|
|
1067
|
+
if (running_program.b) {
|
|
1068
|
+
// intro — we can tidy up immediately
|
|
1069
|
+
clear_animation();
|
|
1070
|
+
}
|
|
1071
|
+
else {
|
|
1072
|
+
// outro — needs to be coordinated
|
|
1073
|
+
if (!--running_program.group.r) run_all(running_program.group.c);
|
|
1074
|
+
}
|
|
1075
|
+
}
|
|
1076
|
+
running_program = null;
|
|
1077
|
+
}
|
|
1078
|
+
else if (now >= running_program.start) {
|
|
1079
|
+
const p = now - running_program.start;
|
|
1080
|
+
t = running_program.a + running_program.d * easing(p / running_program.duration);
|
|
1081
|
+
tick(t, 1 - t);
|
|
1082
|
+
}
|
|
1083
|
+
}
|
|
1084
|
+
return !!(running_program || pending_program);
|
|
1085
|
+
});
|
|
1086
|
+
}
|
|
1087
|
+
}
|
|
1088
|
+
return {
|
|
1089
|
+
run(b) {
|
|
1090
|
+
if (is_function(config)) {
|
|
1091
|
+
wait().then(() => {
|
|
1092
|
+
// @ts-ignore
|
|
1093
|
+
config = config();
|
|
1094
|
+
go(b);
|
|
1095
|
+
});
|
|
1096
|
+
}
|
|
1097
|
+
else {
|
|
1098
|
+
go(b);
|
|
1099
|
+
}
|
|
1100
|
+
},
|
|
1101
|
+
end() {
|
|
1102
|
+
clear_animation();
|
|
1103
|
+
running_program = pending_program = null;
|
|
1104
|
+
},
|
|
1105
|
+
};
|
|
1106
|
+
}
|
|
1107
|
+
|
|
1108
|
+
function handle_promise(promise, info) {
|
|
1109
|
+
const token = (info.token = {});
|
|
1110
|
+
function update(type, index, key, value) {
|
|
1111
|
+
if (info.token !== token) return;
|
|
1112
|
+
info.resolved = value;
|
|
1113
|
+
let child_ctx = info.ctx;
|
|
1114
|
+
if (key !== undefined) {
|
|
1115
|
+
child_ctx = child_ctx.slice();
|
|
1116
|
+
child_ctx[key] = value;
|
|
1117
|
+
}
|
|
1118
|
+
const block = type && (info.current = type)(child_ctx);
|
|
1119
|
+
let needs_flush = false;
|
|
1120
|
+
if (info.block) {
|
|
1121
|
+
if (info.blocks) {
|
|
1122
|
+
info.blocks.forEach((block, i) => {
|
|
1123
|
+
if (i !== index && block) {
|
|
1124
|
+
group_outros();
|
|
1125
|
+
transition_out(block, 1, 1, () => {
|
|
1126
|
+
if (info.blocks[i] === block) {
|
|
1127
|
+
info.blocks[i] = null;
|
|
1128
|
+
}
|
|
1129
|
+
});
|
|
1130
|
+
check_outros();
|
|
1131
|
+
}
|
|
1132
|
+
});
|
|
1133
|
+
}
|
|
1134
|
+
else {
|
|
1135
|
+
info.block.d(1);
|
|
1136
|
+
}
|
|
1137
|
+
block.c();
|
|
1138
|
+
transition_in(block, 1);
|
|
1139
|
+
block.m(info.mount(), info.anchor);
|
|
1140
|
+
needs_flush = true;
|
|
1141
|
+
}
|
|
1142
|
+
info.block = block;
|
|
1143
|
+
if (info.blocks) info.blocks[index] = block;
|
|
1144
|
+
if (needs_flush) {
|
|
1145
|
+
flush();
|
|
1146
|
+
}
|
|
1147
|
+
}
|
|
1148
|
+
if (is_promise(promise)) {
|
|
1149
|
+
const current_component = get_current_component();
|
|
1150
|
+
promise.then(
|
|
1151
|
+
(value) => {
|
|
1152
|
+
set_current_component(current_component);
|
|
1153
|
+
update(info.then, 1, info.value, value);
|
|
1154
|
+
set_current_component(null);
|
|
1155
|
+
},
|
|
1156
|
+
(error) => {
|
|
1157
|
+
set_current_component(current_component);
|
|
1158
|
+
update(info.catch, 2, info.error, error);
|
|
1159
|
+
set_current_component(null);
|
|
1160
|
+
if (!info.hasCatch) {
|
|
1161
|
+
throw error;
|
|
1162
|
+
}
|
|
1163
|
+
},
|
|
1164
|
+
);
|
|
1165
|
+
// if we previously had a then/catch block, destroy it
|
|
1166
|
+
if (info.current !== info.pending) {
|
|
1167
|
+
update(info.pending, 0);
|
|
1168
|
+
return true;
|
|
1169
|
+
}
|
|
1170
|
+
}
|
|
1171
|
+
else {
|
|
1172
|
+
if (info.current !== info.then) {
|
|
1173
|
+
update(info.then, 1, info.value, promise);
|
|
1174
|
+
return true;
|
|
1175
|
+
}
|
|
1176
|
+
info.resolved = promise;
|
|
1177
|
+
}
|
|
1178
|
+
}
|
|
1179
|
+
|
|
1180
|
+
const globals = typeof window !== 'undefined' ? window : typeof globalThis !== 'undefined' ? globalThis : global;
|
|
1181
|
+
|
|
1182
|
+
function destroy_block(block, lookup) {
|
|
1183
|
+
block.d(1);
|
|
1184
|
+
lookup.delete(block.key);
|
|
1185
|
+
}
|
|
1186
|
+
function outro_and_destroy_block(block, lookup) {
|
|
1187
|
+
transition_out(block, 1, 1, () => {
|
|
1188
|
+
lookup.delete(block.key);
|
|
1189
|
+
});
|
|
1190
|
+
}
|
|
1191
|
+
function fix_and_destroy_block(block, lookup) {
|
|
1192
|
+
block.f();
|
|
1193
|
+
destroy_block(block, lookup);
|
|
1194
|
+
}
|
|
1195
|
+
function fix_and_outro_and_destroy_block(block, lookup) {
|
|
1196
|
+
block.f();
|
|
1197
|
+
outro_and_destroy_block(block, lookup);
|
|
1198
|
+
}
|
|
1199
|
+
function update_keyed_each(old_blocks, dirty, get_key, dynamic, ctx, list, lookup, node, destroy, create_each_block, next, get_context) {
|
|
1200
|
+
let o = old_blocks.length;
|
|
1201
|
+
let n = list.length;
|
|
1202
|
+
let i = o;
|
|
1203
|
+
const old_indexes = {};
|
|
1204
|
+
while (i--) old_indexes[old_blocks[i].key] = i;
|
|
1205
|
+
const new_blocks = [];
|
|
1206
|
+
const new_lookup = new Map();
|
|
1207
|
+
const deltas = new Map();
|
|
1208
|
+
i = n;
|
|
1209
|
+
while (i--) {
|
|
1210
|
+
const child_ctx = get_context(ctx, list, i);
|
|
1211
|
+
const key = get_key(child_ctx);
|
|
1212
|
+
let block = lookup.get(key);
|
|
1213
|
+
if (!block) {
|
|
1214
|
+
block = create_each_block(key, child_ctx);
|
|
1215
|
+
block.c();
|
|
1216
|
+
}
|
|
1217
|
+
else if (dynamic) {
|
|
1218
|
+
block.p(child_ctx, dirty);
|
|
1219
|
+
}
|
|
1220
|
+
new_lookup.set(key, (new_blocks[i] = block));
|
|
1221
|
+
if (key in old_indexes) deltas.set(key, Math.abs(i - old_indexes[key]));
|
|
1222
|
+
}
|
|
1223
|
+
const will_move = new Set();
|
|
1224
|
+
const did_move = new Set();
|
|
1225
|
+
function insert(block) {
|
|
1226
|
+
transition_in(block, 1);
|
|
1227
|
+
block.m(node, next);
|
|
1228
|
+
lookup.set(block.key, block);
|
|
1229
|
+
next = block.first;
|
|
1230
|
+
n--;
|
|
1231
|
+
}
|
|
1232
|
+
while (o && n) {
|
|
1233
|
+
const new_block = new_blocks[n - 1];
|
|
1234
|
+
const old_block = old_blocks[o - 1];
|
|
1235
|
+
const new_key = new_block.key;
|
|
1236
|
+
const old_key = old_block.key;
|
|
1237
|
+
if (new_block === old_block) {
|
|
1238
|
+
// do nothing
|
|
1239
|
+
next = new_block.first;
|
|
1240
|
+
o--;
|
|
1241
|
+
n--;
|
|
1242
|
+
}
|
|
1243
|
+
else if (!new_lookup.has(old_key)) {
|
|
1244
|
+
// remove old block
|
|
1245
|
+
destroy(old_block, lookup);
|
|
1246
|
+
o--;
|
|
1247
|
+
}
|
|
1248
|
+
else if (!lookup.has(new_key) || will_move.has(new_key)) {
|
|
1249
|
+
insert(new_block);
|
|
1250
|
+
}
|
|
1251
|
+
else if (did_move.has(old_key)) {
|
|
1252
|
+
o--;
|
|
1253
|
+
}
|
|
1254
|
+
else if (deltas.get(new_key) > deltas.get(old_key)) {
|
|
1255
|
+
did_move.add(new_key);
|
|
1256
|
+
insert(new_block);
|
|
1257
|
+
}
|
|
1258
|
+
else {
|
|
1259
|
+
will_move.add(old_key);
|
|
1260
|
+
o--;
|
|
1261
|
+
}
|
|
1262
|
+
}
|
|
1263
|
+
while (o--) {
|
|
1264
|
+
const old_block = old_blocks[o];
|
|
1265
|
+
if (!new_lookup.has(old_block.key)) destroy(old_block, lookup);
|
|
1266
|
+
}
|
|
1267
|
+
while (n) insert(new_blocks[n - 1]);
|
|
1268
|
+
return new_blocks;
|
|
1269
|
+
}
|
|
1270
|
+
function validate_each_keys(ctx, list, get_context, get_key) {
|
|
1271
|
+
const keys = new Set();
|
|
1272
|
+
for (let i = 0; i < list.length; i++) {
|
|
1273
|
+
const key = get_key(get_context(ctx, list, i));
|
|
1274
|
+
if (keys.has(key)) {
|
|
1275
|
+
throw new Error('Cannot have duplicate keys in a keyed each');
|
|
1276
|
+
}
|
|
1277
|
+
keys.add(key);
|
|
1278
|
+
}
|
|
1279
|
+
}
|
|
1280
|
+
|
|
1281
|
+
function get_spread_update(levels, updates) {
|
|
1282
|
+
const update = {};
|
|
1283
|
+
const to_null_out = {};
|
|
1284
|
+
const accounted_for = { $$scope: 1 };
|
|
1285
|
+
let i = levels.length;
|
|
1286
|
+
while (i--) {
|
|
1287
|
+
const o = levels[i];
|
|
1288
|
+
const n = updates[i];
|
|
1289
|
+
if (n) {
|
|
1290
|
+
for (const key in o) {
|
|
1291
|
+
// 收集已存在,但本次未触发更新的属性
|
|
1292
|
+
if (!(key in n)) to_null_out[key] = 1;
|
|
1293
|
+
}
|
|
1294
|
+
for (const key in n) {
|
|
1295
|
+
// 收集触发更新且尚未记录更新的属性
|
|
1296
|
+
if (!accounted_for[key]) {
|
|
1297
|
+
update[key] = n[key];
|
|
1298
|
+
accounted_for[key] = 1;
|
|
1299
|
+
}
|
|
1300
|
+
}
|
|
1301
|
+
// 将更新记录
|
|
1302
|
+
levels[i] = n;
|
|
1303
|
+
}
|
|
1304
|
+
else {
|
|
1305
|
+
for (const key in o) {
|
|
1306
|
+
accounted_for[key] = 1;
|
|
1307
|
+
}
|
|
1308
|
+
}
|
|
1309
|
+
}
|
|
1310
|
+
for (const key in to_null_out) {
|
|
1311
|
+
// 未触发更新的属性,update 置空
|
|
1312
|
+
if (!(key in update)) update[key] = undefined;
|
|
1313
|
+
}
|
|
1314
|
+
return update;
|
|
1315
|
+
}
|
|
1316
|
+
function get_spread_object(spread_props) {
|
|
1317
|
+
return typeof spread_props === 'object' && spread_props !== null ? spread_props : {};
|
|
1318
|
+
}
|
|
1319
|
+
|
|
1320
|
+
// source: https://html.spec.whatwg.org/multipage/indices.html
|
|
1321
|
+
const boolean_attributes = new Set([
|
|
1322
|
+
'allowfullscreen',
|
|
1323
|
+
'allowpaymentrequest',
|
|
1324
|
+
'async',
|
|
1325
|
+
'autofocus',
|
|
1326
|
+
'autoplay',
|
|
1327
|
+
'checked',
|
|
1328
|
+
'controls',
|
|
1329
|
+
'default',
|
|
1330
|
+
'defer',
|
|
1331
|
+
'disabled',
|
|
1332
|
+
'formnovalidate',
|
|
1333
|
+
'hidden',
|
|
1334
|
+
'ismap',
|
|
1335
|
+
'loop',
|
|
1336
|
+
'multiple',
|
|
1337
|
+
'muted',
|
|
1338
|
+
'nomodule',
|
|
1339
|
+
'novalidate',
|
|
1340
|
+
'open',
|
|
1341
|
+
'playsinline',
|
|
1342
|
+
'readonly',
|
|
1343
|
+
'required',
|
|
1344
|
+
'reversed',
|
|
1345
|
+
'selected',
|
|
1346
|
+
]);
|
|
1347
|
+
|
|
1348
|
+
const invalid_attribute_name_character =
|
|
1349
|
+
/[\s'">/=\u{FDD0}-\u{FDEF}\u{FFFE}\u{FFFF}\u{1FFFE}\u{1FFFF}\u{2FFFE}\u{2FFFF}\u{3FFFE}\u{3FFFF}\u{4FFFE}\u{4FFFF}\u{5FFFE}\u{5FFFF}\u{6FFFE}\u{6FFFF}\u{7FFFE}\u{7FFFF}\u{8FFFE}\u{8FFFF}\u{9FFFE}\u{9FFFF}\u{AFFFE}\u{AFFFF}\u{BFFFE}\u{BFFFF}\u{CFFFE}\u{CFFFF}\u{DFFFE}\u{DFFFF}\u{EFFFE}\u{EFFFF}\u{FFFFE}\u{FFFFF}\u{10FFFE}\u{10FFFF}]/u;
|
|
1350
|
+
// https://html.spec.whatwg.org/multipage/syntax.html#attributes-2
|
|
1351
|
+
// https://infra.spec.whatwg.org/#noncharacter
|
|
1352
|
+
// 将 attributes obj 序列化为 string
|
|
1353
|
+
function spread(args, classes_to_add) {
|
|
1354
|
+
const attributes = Object.assign({}, ...args);
|
|
1355
|
+
if (classes_to_add) {
|
|
1356
|
+
if (attributes.class == null) {
|
|
1357
|
+
attributes.class = classes_to_add;
|
|
1358
|
+
}
|
|
1359
|
+
else {
|
|
1360
|
+
attributes.class += ' ' + classes_to_add;
|
|
1361
|
+
}
|
|
1362
|
+
}
|
|
1363
|
+
let str = '';
|
|
1364
|
+
Object.keys(attributes).forEach((name) => {
|
|
1365
|
+
if (invalid_attribute_name_character.test(name)) return;
|
|
1366
|
+
const value = attributes[name];
|
|
1367
|
+
if (value === true) str += ' ' + name;
|
|
1368
|
+
else if (boolean_attributes.has(name.toLowerCase())) {
|
|
1369
|
+
if (value) str += ' ' + name;
|
|
1370
|
+
}
|
|
1371
|
+
else if (value != null) {
|
|
1372
|
+
str += ` ${name}="${String(value).replace(/"/g, '"').replace(/'/g, ''')}"`;
|
|
1373
|
+
}
|
|
1374
|
+
});
|
|
1375
|
+
return str;
|
|
1376
|
+
}
|
|
1377
|
+
// escaped map
|
|
1378
|
+
const escaped = {
|
|
1379
|
+
'"': '"',
|
|
1380
|
+
'\'': ''',
|
|
1381
|
+
'&': '&',
|
|
1382
|
+
'<': '<',
|
|
1383
|
+
'>': '>',
|
|
1384
|
+
};
|
|
1385
|
+
// escaped helper function
|
|
1386
|
+
function escape(html) {
|
|
1387
|
+
return String(html).replace(/["'&<>]/g, (match) => escaped[match]);
|
|
1388
|
+
}
|
|
1389
|
+
// run each item by helper fn
|
|
1390
|
+
function each(items, fn) {
|
|
1391
|
+
let str = '';
|
|
1392
|
+
for (let i = 0; i < items.length; i += 1) {
|
|
1393
|
+
str += fn(items[i], i);
|
|
1394
|
+
}
|
|
1395
|
+
return str;
|
|
1396
|
+
}
|
|
1397
|
+
// empty component render function
|
|
1398
|
+
const missing_component = {
|
|
1399
|
+
$$render: () => '',
|
|
1400
|
+
};
|
|
1401
|
+
function validate_component(component, name) {
|
|
1402
|
+
if (!component || !component.$$render) {
|
|
1403
|
+
if (name === 'svelte:component') name += ' this={...}';
|
|
1404
|
+
throw new Error(`<${name}> is not a valid SSR component. You may need to review your build config to ensure that dependencies are compiled, rather than imported as pre-compiled modules`);
|
|
1405
|
+
}
|
|
1406
|
+
return component;
|
|
1407
|
+
}
|
|
1408
|
+
// debug console
|
|
1409
|
+
function debug(file, line, column, values) {
|
|
1410
|
+
console.log(`{@debug} ${file ? file + ' ' : ''}(${line}:${column})`); // eslint-disable-line no-console
|
|
1411
|
+
console.log(values); // eslint-disable-line no-console
|
|
1412
|
+
return '';
|
|
1413
|
+
}
|
|
1414
|
+
let on_destroy;
|
|
1415
|
+
// 生成 ssr component 生成器
|
|
1416
|
+
function create_ssr_component(fn) {
|
|
1417
|
+
function $$render(result, props, bindings, slots) {
|
|
1418
|
+
const parent_component = exports.current_component;
|
|
1419
|
+
const $$ = {
|
|
1420
|
+
on_destroy,
|
|
1421
|
+
context: new Map(parent_component ? parent_component.$$.context : []),
|
|
1422
|
+
// these will be immediately discarded
|
|
1423
|
+
on_mount: [],
|
|
1424
|
+
before_update: [],
|
|
1425
|
+
after_update: [],
|
|
1426
|
+
callbacks: blank_object(),
|
|
1427
|
+
};
|
|
1428
|
+
set_current_component({ $$ });
|
|
1429
|
+
const html = fn(result, props, bindings, slots);
|
|
1430
|
+
set_current_component(parent_component);
|
|
1431
|
+
return html;
|
|
1432
|
+
}
|
|
1433
|
+
return {
|
|
1434
|
+
render: (props = {}, options = {}) => {
|
|
1435
|
+
on_destroy = [];
|
|
1436
|
+
const result = { title: '', head: '', css: new Set() };
|
|
1437
|
+
const html = $$render(result, props, {}, options);
|
|
1438
|
+
run_all(on_destroy);
|
|
1439
|
+
return {
|
|
1440
|
+
html,
|
|
1441
|
+
css: {
|
|
1442
|
+
code: Array.from(result.css)
|
|
1443
|
+
.map((css) => css.code)
|
|
1444
|
+
.join('\n'),
|
|
1445
|
+
map: null, // TODO
|
|
1446
|
+
},
|
|
1447
|
+
head: result.title + result.head,
|
|
1448
|
+
};
|
|
1449
|
+
},
|
|
1450
|
+
$$render,
|
|
1451
|
+
};
|
|
1452
|
+
}
|
|
1453
|
+
function add_attribute(name, value, boolean) {
|
|
1454
|
+
if (value == null || (boolean && !value)) return '';
|
|
1455
|
+
return ` ${name}${value === true ? '' : `=${typeof value === 'string' ? JSON.stringify(escape(value)) : `"${value}"`}`}`;
|
|
1456
|
+
}
|
|
1457
|
+
function add_classes(classes) {
|
|
1458
|
+
return classes ? ` class="${classes}"` : '';
|
|
1459
|
+
}
|
|
1460
|
+
|
|
1461
|
+
function bind(component, name, callback) {
|
|
1462
|
+
const index = component.$$.props[name];
|
|
1463
|
+
if (index !== undefined) {
|
|
1464
|
+
component.$$.bound[index] = callback;
|
|
1465
|
+
callback(component.$$.ctx[index]);
|
|
1466
|
+
}
|
|
1467
|
+
}
|
|
1468
|
+
function create_component(block) {
|
|
1469
|
+
block && block.c();
|
|
1470
|
+
}
|
|
1471
|
+
function claim_component(block, parent_nodes) {
|
|
1472
|
+
block && block.l(parent_nodes);
|
|
1473
|
+
}
|
|
1474
|
+
function mount_component(component, target, anchor) {
|
|
1475
|
+
const { fragment, on_mount, on_destroy, after_update } = component.$$;
|
|
1476
|
+
fragment && fragment.m(target, anchor);
|
|
1477
|
+
// onMount happens before the initial afterUpdate
|
|
1478
|
+
add_render_callback(() => {
|
|
1479
|
+
const new_on_destroy = on_mount.map(run).filter(is_function);
|
|
1480
|
+
if (on_destroy) {
|
|
1481
|
+
on_destroy.push(...new_on_destroy);
|
|
1482
|
+
}
|
|
1483
|
+
else {
|
|
1484
|
+
// Edge case - component was destroyed immediately,
|
|
1485
|
+
// most likely as a result of a binding initialising
|
|
1486
|
+
run_all(new_on_destroy);
|
|
1487
|
+
}
|
|
1488
|
+
component.$$.on_mount = [];
|
|
1489
|
+
});
|
|
1490
|
+
after_update.forEach(add_render_callback);
|
|
1491
|
+
}
|
|
1492
|
+
function destroy_component(component, detaching) {
|
|
1493
|
+
const $$ = component.$$;
|
|
1494
|
+
if ($$.fragment !== null) {
|
|
1495
|
+
run_all($$.on_destroy);
|
|
1496
|
+
$$.fragment && $$.fragment.d(detaching);
|
|
1497
|
+
// TODO null out other refs, including component.$$ (but need to
|
|
1498
|
+
// preserve final state?)
|
|
1499
|
+
$$.on_destroy = $$.fragment = null;
|
|
1500
|
+
$$.ctx = [];
|
|
1501
|
+
}
|
|
1502
|
+
}
|
|
1503
|
+
function make_dirty(component, i) {
|
|
1504
|
+
if (component.$$.dirty[0] === -1) {
|
|
1505
|
+
dirty_components.push(component);
|
|
1506
|
+
schedule_update();
|
|
1507
|
+
component.$$.dirty.fill(0);
|
|
1508
|
+
}
|
|
1509
|
+
component.$$.dirty[(i / 31) | 0] |= 1 << i % 31;
|
|
1510
|
+
}
|
|
1511
|
+
function init(component, options, instance, create_fragment, not_equal, props, dirty = [-1]) {
|
|
1512
|
+
const parent_component = exports.current_component;
|
|
1513
|
+
set_current_component(component);
|
|
1514
|
+
const $$ = (component.$$ = {
|
|
1515
|
+
fragment: null,
|
|
1516
|
+
ctx: null,
|
|
1517
|
+
// state
|
|
1518
|
+
props,
|
|
1519
|
+
update: noop,
|
|
1520
|
+
not_equal,
|
|
1521
|
+
bound: blank_object(),
|
|
1522
|
+
// lifecycle
|
|
1523
|
+
on_mount: [],
|
|
1524
|
+
on_destroy: [],
|
|
1525
|
+
before_update: [],
|
|
1526
|
+
after_update: [],
|
|
1527
|
+
context: new Map(parent_component ? parent_component.$$.context : []),
|
|
1528
|
+
// everything else
|
|
1529
|
+
callbacks: blank_object(),
|
|
1530
|
+
dirty,
|
|
1531
|
+
skip_bound: false,
|
|
1532
|
+
});
|
|
1533
|
+
let ready = false;
|
|
1534
|
+
$$.ctx = instance
|
|
1535
|
+
? instance(component, options.props || {}, (i, ret, ...rest) => {
|
|
1536
|
+
const value = rest.length ? rest[0] : ret;
|
|
1537
|
+
if ($$.ctx && not_equal($$.ctx[i], ($$.ctx[i] = value))) {
|
|
1538
|
+
if (!$$.skip_bound && $$.bound[i]) $$.bound[i](value);
|
|
1539
|
+
if (ready) make_dirty(component, i);
|
|
1540
|
+
}
|
|
1541
|
+
return ret;
|
|
1542
|
+
})
|
|
1543
|
+
: [];
|
|
1544
|
+
$$.update();
|
|
1545
|
+
ready = true;
|
|
1546
|
+
run_all($$.before_update);
|
|
1547
|
+
// `false` as a special case of no DOM component
|
|
1548
|
+
$$.fragment = create_fragment ? create_fragment($$.ctx) : false;
|
|
1549
|
+
if (options.target) {
|
|
1550
|
+
if (options.hydrate) {
|
|
1551
|
+
const nodes = children(options.target);
|
|
1552
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
1553
|
+
$$.fragment && $$.fragment.l(nodes);
|
|
1554
|
+
nodes.forEach(detach);
|
|
1555
|
+
}
|
|
1556
|
+
else {
|
|
1557
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
1558
|
+
$$.fragment && $$.fragment.c();
|
|
1559
|
+
}
|
|
1560
|
+
if (options.intro) transition_in(component.$$.fragment);
|
|
1561
|
+
mount_component(component, options.target, options.anchor);
|
|
1562
|
+
flush();
|
|
1563
|
+
}
|
|
1564
|
+
set_current_component(parent_component);
|
|
1565
|
+
}
|
|
1566
|
+
if (typeof HTMLElement === 'function') {
|
|
1567
|
+
exports.SvelteElement = class extends HTMLElement {
|
|
1568
|
+
constructor() {
|
|
1569
|
+
super();
|
|
1570
|
+
this.attachShadow({ mode: 'open' });
|
|
1571
|
+
}
|
|
1572
|
+
connectedCallback() {
|
|
1573
|
+
// @ts-ignore todo: improve typings
|
|
1574
|
+
for (const key in this.$$.slotted) {
|
|
1575
|
+
// @ts-ignore todo: improve typings
|
|
1576
|
+
this.appendChild(this.$$.slotted[key]);
|
|
1577
|
+
}
|
|
1578
|
+
}
|
|
1579
|
+
attributeChangedCallback(attr, _oldValue, newValue) {
|
|
1580
|
+
this[attr] = newValue;
|
|
1581
|
+
}
|
|
1582
|
+
$destroy() {
|
|
1583
|
+
destroy_component(this, 1);
|
|
1584
|
+
this.$destroy = noop;
|
|
1585
|
+
}
|
|
1586
|
+
$on(type, callback) {
|
|
1587
|
+
// TODO should this delegate to addEventListener?
|
|
1588
|
+
const callbacks = this.$$.callbacks[type] || (this.$$.callbacks[type] = []);
|
|
1589
|
+
callbacks.push(callback);
|
|
1590
|
+
return () => {
|
|
1591
|
+
const index = callbacks.indexOf(callback);
|
|
1592
|
+
if (index !== -1) callbacks.splice(index, 1);
|
|
1593
|
+
};
|
|
1594
|
+
}
|
|
1595
|
+
$set($$props) {
|
|
1596
|
+
if (this.$$set && !is_empty($$props)) {
|
|
1597
|
+
this.$$.skip_bound = true;
|
|
1598
|
+
this.$$set($$props);
|
|
1599
|
+
this.$$.skip_bound = false;
|
|
1600
|
+
}
|
|
1601
|
+
}
|
|
1602
|
+
};
|
|
1603
|
+
}
|
|
1604
|
+
/**
|
|
1605
|
+
* Base class for Svelte components. Used when dev=false.
|
|
1606
|
+
*/
|
|
1607
|
+
class SvelteComponent {
|
|
1608
|
+
$destroy() {
|
|
1609
|
+
destroy_component(this, 1);
|
|
1610
|
+
this.$destroy = noop;
|
|
1611
|
+
}
|
|
1612
|
+
$on(type, callback) {
|
|
1613
|
+
const callbacks = this.$$.callbacks[type] || (this.$$.callbacks[type] = []);
|
|
1614
|
+
callbacks.push(callback);
|
|
1615
|
+
return () => {
|
|
1616
|
+
const index = callbacks.indexOf(callback);
|
|
1617
|
+
if (index !== -1) callbacks.splice(index, 1);
|
|
1618
|
+
};
|
|
1619
|
+
}
|
|
1620
|
+
$set($$props) {
|
|
1621
|
+
if (this.$$set && !is_empty($$props)) {
|
|
1622
|
+
this.$$.skip_bound = true;
|
|
1623
|
+
this.$$set($$props);
|
|
1624
|
+
this.$$.skip_bound = false;
|
|
1625
|
+
}
|
|
1626
|
+
}
|
|
1627
|
+
}
|
|
1628
|
+
|
|
1629
|
+
function dispatch_dev(_type, _detail) {
|
|
1630
|
+
// PIKA: PixUI document 不支持 dispatch 自定义事件
|
|
1631
|
+
// document.dispatchEvent(custom_event(type, { version: '1.0.7', ...detail }));
|
|
1632
|
+
}
|
|
1633
|
+
function append_dev(target, node) {
|
|
1634
|
+
append(target, node);
|
|
1635
|
+
}
|
|
1636
|
+
function insert_dev(target, node, anchor) {
|
|
1637
|
+
insert(target, node, anchor);
|
|
1638
|
+
}
|
|
1639
|
+
function detach_dev(node) {
|
|
1640
|
+
detach(node);
|
|
1641
|
+
}
|
|
1642
|
+
function detach_between_dev(before, after) {
|
|
1643
|
+
while (before.nextSibling && before.nextSibling !== after) {
|
|
1644
|
+
detach_dev(before.nextSibling);
|
|
1645
|
+
}
|
|
1646
|
+
}
|
|
1647
|
+
function detach_before_dev(after) {
|
|
1648
|
+
while (after.previousSibling) {
|
|
1649
|
+
detach_dev(after.previousSibling);
|
|
1650
|
+
}
|
|
1651
|
+
}
|
|
1652
|
+
function detach_after_dev(before) {
|
|
1653
|
+
while (before.nextSibling) {
|
|
1654
|
+
detach_dev(before.nextSibling);
|
|
1655
|
+
}
|
|
1656
|
+
}
|
|
1657
|
+
function listen_dev(node, event, handler, options, has_prevent_default, has_stop_propagation) {
|
|
1658
|
+
const modifiers = options === true ? ['capture'] : options ? Array.from(Object.keys(options)) : [];
|
|
1659
|
+
if (has_prevent_default) modifiers.push('preventDefault');
|
|
1660
|
+
if (has_stop_propagation) modifiers.push('stopPropagation');
|
|
1661
|
+
const dispose = listen(node, event, handler, options);
|
|
1662
|
+
return () => {
|
|
1663
|
+
dispose();
|
|
1664
|
+
};
|
|
1665
|
+
}
|
|
1666
|
+
function attr_dev(node, attribute, value) {
|
|
1667
|
+
attr(node, attribute, value);
|
|
1668
|
+
}
|
|
1669
|
+
function show_dev(node) {
|
|
1670
|
+
show(node);
|
|
1671
|
+
}
|
|
1672
|
+
function hide_dev(node) {
|
|
1673
|
+
hide(node);
|
|
1674
|
+
}
|
|
1675
|
+
function initLazyClass_dev(node) {
|
|
1676
|
+
initLazyClass();
|
|
1677
|
+
}
|
|
1678
|
+
function prop_dev(node, property, value) {
|
|
1679
|
+
node[property] = value;
|
|
1680
|
+
}
|
|
1681
|
+
function dataset_dev(node, property, value) {
|
|
1682
|
+
node.dataset[property] = value;
|
|
1683
|
+
}
|
|
1684
|
+
function set_data_dev(text, data) {
|
|
1685
|
+
data = '' + data;
|
|
1686
|
+
if (text.data === data) return;
|
|
1687
|
+
text.data = data;
|
|
1688
|
+
}
|
|
1689
|
+
function validate_each_argument(arg) {
|
|
1690
|
+
if (typeof arg !== 'string' && !(arg && typeof arg === 'object' && 'length' in arg)) {
|
|
1691
|
+
let msg = '{#each} only iterates over array-like objects.';
|
|
1692
|
+
if (typeof Symbol === 'function' && arg && Symbol.iterator in arg) {
|
|
1693
|
+
msg += ' You can use a spread to convert this iterable into an array.';
|
|
1694
|
+
}
|
|
1695
|
+
throw new Error(msg);
|
|
1696
|
+
}
|
|
1697
|
+
}
|
|
1698
|
+
function validate_slots(name, slot, keys) {
|
|
1699
|
+
for (const slot_key of Object.keys(slot)) {
|
|
1700
|
+
if (!~keys.indexOf(slot_key)) {
|
|
1701
|
+
console.warn(`<${name}> received an unexpected slot "${slot_key}".`);
|
|
1702
|
+
}
|
|
1703
|
+
}
|
|
1704
|
+
}
|
|
1705
|
+
/**
|
|
1706
|
+
* Base class for Svelte components with some minor dev-enhancements. Used when dev=true.
|
|
1707
|
+
*/
|
|
1708
|
+
class SvelteComponentDev extends SvelteComponent {
|
|
1709
|
+
constructor(options) {
|
|
1710
|
+
if (!options || (!options.target && !options.$$inline)) {
|
|
1711
|
+
throw new Error('\'target\' is a required option');
|
|
1712
|
+
}
|
|
1713
|
+
super();
|
|
1714
|
+
}
|
|
1715
|
+
$destroy() {
|
|
1716
|
+
super.$destroy();
|
|
1717
|
+
this.$destroy = () => {
|
|
1718
|
+
console.warn('Component was already destroyed'); // eslint-disable-line no-console
|
|
1719
|
+
};
|
|
1720
|
+
}
|
|
1721
|
+
$capture_state() {}
|
|
1722
|
+
$inject_state() {}
|
|
1723
|
+
}
|
|
1724
|
+
/**
|
|
1725
|
+
* Base class to create strongly typed Svelte components.
|
|
1726
|
+
* This only exists for typing purposes and should be used in `.d.ts` files.
|
|
1727
|
+
*
|
|
1728
|
+
* ### Example:
|
|
1729
|
+
*
|
|
1730
|
+
* You have component library on npm called `component-library`, from which
|
|
1731
|
+
* you export a component called `MyComponent`. For Svelte+TypeScript users,
|
|
1732
|
+
* you want to provide typings. Therefore you create a `index.d.ts`:
|
|
1733
|
+
* ```ts
|
|
1734
|
+
* import { SvelteComponentTyped } from "svelte";
|
|
1735
|
+
* export class MyComponent extends SvelteComponentTyped<{foo: string}> {}
|
|
1736
|
+
* ```
|
|
1737
|
+
* Typing this makes it possible for IDEs like VS Code with the Svelte extension
|
|
1738
|
+
* to provide intellisense and to use the component like this in a Svelte file
|
|
1739
|
+
* with TypeScript:
|
|
1740
|
+
* ```svelte
|
|
1741
|
+
* <script lang="ts">
|
|
1742
|
+
* import { MyComponent } from "component-library";
|
|
1743
|
+
* </script>
|
|
1744
|
+
* <MyComponent foo={'bar'} />
|
|
1745
|
+
* ```
|
|
1746
|
+
*
|
|
1747
|
+
* #### Why not make this part of `SvelteComponent(Dev)`?
|
|
1748
|
+
* Because
|
|
1749
|
+
* ```ts
|
|
1750
|
+
* class ASubclassOfSvelteComponent extends SvelteComponent<{foo: string}> {}
|
|
1751
|
+
* const component: typeof SvelteComponent = ASubclassOfSvelteComponent;
|
|
1752
|
+
* ```
|
|
1753
|
+
* will throw a type error, so we need to seperate the more strictly typed class.
|
|
1754
|
+
*/
|
|
1755
|
+
class SvelteComponentTyped extends SvelteComponentDev {
|
|
1756
|
+
constructor(options) {
|
|
1757
|
+
super(options);
|
|
1758
|
+
}
|
|
1759
|
+
}
|
|
1760
|
+
function loop_guard(timeout) {
|
|
1761
|
+
const start = Date.now();
|
|
1762
|
+
return () => {
|
|
1763
|
+
if (Date.now() - start > timeout) {
|
|
1764
|
+
throw new Error('Infinite loop detected');
|
|
1765
|
+
}
|
|
1766
|
+
};
|
|
1767
|
+
}
|
|
1768
|
+
|
|
1769
|
+
exports.HtmlTag = HtmlTag;
|
|
1770
|
+
exports.SvelteComponent = SvelteComponent;
|
|
1771
|
+
exports.SvelteComponentDev = SvelteComponentDev;
|
|
1772
|
+
exports.SvelteComponentTyped = SvelteComponentTyped;
|
|
1773
|
+
exports.action_destroyer = action_destroyer;
|
|
1774
|
+
exports.add_attribute = add_attribute;
|
|
1775
|
+
exports.add_classes = add_classes;
|
|
1776
|
+
exports.add_flush_callback = add_flush_callback;
|
|
1777
|
+
exports.add_location = add_location;
|
|
1778
|
+
exports.add_render_callback = add_render_callback;
|
|
1779
|
+
exports.add_resize_listener = add_resize_listener;
|
|
1780
|
+
exports.add_transform = add_transform;
|
|
1781
|
+
exports.afterUpdate = afterUpdate;
|
|
1782
|
+
exports.append = append;
|
|
1783
|
+
exports.append_dev = append_dev;
|
|
1784
|
+
exports.assign = assign;
|
|
1785
|
+
exports.attr = attr;
|
|
1786
|
+
exports.attr_dev = attr_dev;
|
|
1787
|
+
exports.attribute_to_object = attribute_to_object;
|
|
1788
|
+
exports.beforeUpdate = beforeUpdate;
|
|
1789
|
+
exports.bind = bind;
|
|
1790
|
+
exports.binding_callbacks = binding_callbacks;
|
|
1791
|
+
exports.blank_object = blank_object;
|
|
1792
|
+
exports.bubble = bubble;
|
|
1793
|
+
exports.check_outros = check_outros;
|
|
1794
|
+
exports.children = children;
|
|
1795
|
+
exports.claim_component = claim_component;
|
|
1796
|
+
exports.claim_element = claim_element;
|
|
1797
|
+
exports.claim_space = claim_space;
|
|
1798
|
+
exports.claim_text = claim_text;
|
|
1799
|
+
exports.clear_loops = clear_loops;
|
|
1800
|
+
exports.component_subscribe = component_subscribe;
|
|
1801
|
+
exports.compute_rest_props = compute_rest_props;
|
|
1802
|
+
exports.compute_slots = compute_slots;
|
|
1803
|
+
exports.createEventDispatcher = createEventDispatcher;
|
|
1804
|
+
exports.create_animation = create_animation;
|
|
1805
|
+
exports.create_bidirectional_transition = create_bidirectional_transition;
|
|
1806
|
+
exports.create_component = create_component;
|
|
1807
|
+
exports.create_in_transition = create_in_transition;
|
|
1808
|
+
exports.create_out_transition = create_out_transition;
|
|
1809
|
+
exports.create_slot = create_slot;
|
|
1810
|
+
exports.create_ssr_component = create_ssr_component;
|
|
1811
|
+
exports.custom_event = custom_event;
|
|
1812
|
+
exports.dataset_dev = dataset_dev;
|
|
1813
|
+
exports.debug = debug;
|
|
1814
|
+
exports.destroy_block = destroy_block;
|
|
1815
|
+
exports.destroy_component = destroy_component;
|
|
1816
|
+
exports.destroy_each = destroy_each;
|
|
1817
|
+
exports.detach = detach;
|
|
1818
|
+
exports.detach_after_dev = detach_after_dev;
|
|
1819
|
+
exports.detach_before_dev = detach_before_dev;
|
|
1820
|
+
exports.detach_between_dev = detach_between_dev;
|
|
1821
|
+
exports.detach_dev = detach_dev;
|
|
1822
|
+
exports.dirty_components = dirty_components;
|
|
1823
|
+
exports.dispatch_dev = dispatch_dev;
|
|
1824
|
+
exports.each = each;
|
|
1825
|
+
exports.element = element;
|
|
1826
|
+
exports.element_is = element_is;
|
|
1827
|
+
exports.empty = empty;
|
|
1828
|
+
exports.escape = escape;
|
|
1829
|
+
exports.escaped = escaped;
|
|
1830
|
+
exports.exclude_internal_props = exclude_internal_props;
|
|
1831
|
+
exports.fix_and_destroy_block = fix_and_destroy_block;
|
|
1832
|
+
exports.fix_and_outro_and_destroy_block = fix_and_outro_and_destroy_block;
|
|
1833
|
+
exports.fix_position = fix_position;
|
|
1834
|
+
exports.flush = flush;
|
|
1835
|
+
exports.getContext = getContext;
|
|
1836
|
+
exports.get_binding_group_value = get_binding_group_value;
|
|
1837
|
+
exports.get_current_component = get_current_component;
|
|
1838
|
+
exports.get_custom_elements_slots = get_custom_elements_slots;
|
|
1839
|
+
exports.get_slot_changes = get_slot_changes;
|
|
1840
|
+
exports.get_slot_context = get_slot_context;
|
|
1841
|
+
exports.get_spread_object = get_spread_object;
|
|
1842
|
+
exports.get_spread_update = get_spread_update;
|
|
1843
|
+
exports.get_store_value = get_store_value;
|
|
1844
|
+
exports.globals = globals;
|
|
1845
|
+
exports.group_outros = group_outros;
|
|
1846
|
+
exports.handle_promise = handle_promise;
|
|
1847
|
+
exports.hasContext = hasContext;
|
|
1848
|
+
exports.has_prop = has_prop;
|
|
1849
|
+
exports.hide = hide;
|
|
1850
|
+
exports.hide_dev = hide_dev;
|
|
1851
|
+
exports.identity = identity;
|
|
1852
|
+
exports.init = init;
|
|
1853
|
+
exports.initLazyClass = initLazyClass;
|
|
1854
|
+
exports.initLazyClass_dev = initLazyClass_dev;
|
|
1855
|
+
exports.insert = insert;
|
|
1856
|
+
exports.insert_dev = insert_dev;
|
|
1857
|
+
exports.intros = intros;
|
|
1858
|
+
exports.invalid_attribute_name_character = invalid_attribute_name_character;
|
|
1859
|
+
exports.isSupportEmptyText = isSupportEmptyText;
|
|
1860
|
+
exports.is_client = is_client;
|
|
1861
|
+
exports.is_crossorigin = is_crossorigin;
|
|
1862
|
+
exports.is_empty = is_empty;
|
|
1863
|
+
exports.is_function = is_function;
|
|
1864
|
+
exports.is_promise = is_promise;
|
|
1865
|
+
exports.listen = listen;
|
|
1866
|
+
exports.listen_dev = listen_dev;
|
|
1867
|
+
exports.loop = loop;
|
|
1868
|
+
exports.loop_guard = loop_guard;
|
|
1869
|
+
exports.missing_component = missing_component;
|
|
1870
|
+
exports.mount_component = mount_component;
|
|
1871
|
+
exports.noop = noop;
|
|
1872
|
+
exports.not_equal = not_equal;
|
|
1873
|
+
exports.null_to_empty = null_to_empty;
|
|
1874
|
+
exports.object_without_properties = object_without_properties;
|
|
1875
|
+
exports.onDestroy = onDestroy;
|
|
1876
|
+
exports.onMount = onMount;
|
|
1877
|
+
exports.once = once;
|
|
1878
|
+
exports.outro_and_destroy_block = outro_and_destroy_block;
|
|
1879
|
+
exports.prevent_default = prevent_default;
|
|
1880
|
+
exports.prop_dev = prop_dev;
|
|
1881
|
+
exports.query_selector_all = query_selector_all;
|
|
1882
|
+
exports.run = run;
|
|
1883
|
+
exports.run_all = run_all;
|
|
1884
|
+
exports.safe_not_equal = safe_not_equal;
|
|
1885
|
+
exports.schedule_update = schedule_update;
|
|
1886
|
+
exports.select_multiple_value = select_multiple_value;
|
|
1887
|
+
exports.select_option = select_option;
|
|
1888
|
+
exports.select_options = select_options;
|
|
1889
|
+
exports.select_value = select_value;
|
|
1890
|
+
exports.self = self;
|
|
1891
|
+
exports.setContext = setContext;
|
|
1892
|
+
exports.set_attributes = set_attributes;
|
|
1893
|
+
exports.set_current_component = set_current_component;
|
|
1894
|
+
exports.set_custom_element_data = set_custom_element_data;
|
|
1895
|
+
exports.set_data = set_data;
|
|
1896
|
+
exports.set_data_dev = set_data_dev;
|
|
1897
|
+
exports.set_input_type = set_input_type;
|
|
1898
|
+
exports.set_input_value = set_input_value;
|
|
1899
|
+
exports.set_now = set_now;
|
|
1900
|
+
exports.set_raf = set_raf;
|
|
1901
|
+
exports.set_store_value = set_store_value;
|
|
1902
|
+
exports.set_style = set_style;
|
|
1903
|
+
exports.set_svg_attributes = set_svg_attributes;
|
|
1904
|
+
exports.show = show;
|
|
1905
|
+
exports.show_dev = show_dev;
|
|
1906
|
+
exports.space = space;
|
|
1907
|
+
exports.spread = spread;
|
|
1908
|
+
exports.stop_propagation = stop_propagation;
|
|
1909
|
+
exports.subscribe = subscribe;
|
|
1910
|
+
exports.svg_element = svg_element;
|
|
1911
|
+
exports.text = text;
|
|
1912
|
+
exports.tick = tick;
|
|
1913
|
+
exports.time_ranges_to_array = time_ranges_to_array;
|
|
1914
|
+
exports.to_number = to_number;
|
|
1915
|
+
exports.toggle_class = toggle_class;
|
|
1916
|
+
exports.transition_in = transition_in;
|
|
1917
|
+
exports.transition_out = transition_out;
|
|
1918
|
+
exports.update_keyed_each = update_keyed_each;
|
|
1919
|
+
exports.update_slot = update_slot;
|
|
1920
|
+
exports.update_slot_spread = update_slot_spread;
|
|
1921
|
+
exports.validate_component = validate_component;
|
|
1922
|
+
exports.validate_each_argument = validate_each_argument;
|
|
1923
|
+
exports.validate_each_keys = validate_each_keys;
|
|
1924
|
+
exports.validate_slots = validate_slots;
|
|
1925
|
+
exports.validate_store = validate_store;
|
|
1926
|
+
exports.xlink_attr = xlink_attr;
|