svelte 3.59.0 → 3.59.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,342 +0,0 @@
1
- import { custom_event, append, append_hydration, insert, insert_hydration, detach, listen, attr, contenteditable_truthy_values, SvelteComponent } from './Component-1eb450cb.mjs';
2
-
3
- /** regex of all html void element names */
4
- const void_element_names = /^(?:area|base|br|col|command|embed|hr|img|input|keygen|link|meta|param|source|track|wbr)$/;
5
-
6
- function is_void(name) {
7
- return void_element_names.test(name) || name.toLowerCase() === '!doctype';
8
- }
9
-
10
- function dispatch_dev(type, detail) {
11
- document.dispatchEvent(custom_event(type, { version: '3.58.0', ...detail }, { bubbles: true }));
12
- }
13
-
14
- function append_dev(target, node) {
15
- dispatch_dev('SvelteDOMInsert', { target, node });
16
- append(target, node);
17
- }
18
-
19
- function append_hydration_dev(target, node) {
20
- dispatch_dev('SvelteDOMInsert', { target, node });
21
- append_hydration(target, node);
22
- }
23
-
24
- function insert_dev(target, node, anchor) {
25
- dispatch_dev('SvelteDOMInsert', { target, node, anchor });
26
- insert(target, node, anchor);
27
- }
28
-
29
- function insert_hydration_dev(target, node, anchor) {
30
- dispatch_dev('SvelteDOMInsert', { target, node, anchor });
31
- insert_hydration(target, node, anchor);
32
- }
33
-
34
- function detach_dev(node) {
35
- dispatch_dev('SvelteDOMRemove', { node });
36
- detach(node);
37
- }
38
-
39
- function detach_between_dev(before, after) {
40
- while (before.nextSibling && before.nextSibling !== after) {
41
- detach_dev(before.nextSibling);
42
- }
43
- }
44
-
45
- function detach_before_dev(after) {
46
- while (after.previousSibling) {
47
- detach_dev(after.previousSibling);
48
- }
49
- }
50
-
51
- function detach_after_dev(before) {
52
- while (before.nextSibling) {
53
- detach_dev(before.nextSibling);
54
- }
55
- }
56
-
57
- function listen_dev(node, event, handler, options, has_prevent_default, has_stop_propagation, has_stop_immediate_propagation) {
58
- const modifiers = options === true ? [ 'capture' ] : options ? Array.from(Object.keys(options)) : [];
59
- if (has_prevent_default) modifiers.push('preventDefault');
60
- if (has_stop_propagation) modifiers.push('stopPropagation');
61
- if (has_stop_immediate_propagation) modifiers.push('stopImmediatePropagation');
62
-
63
- dispatch_dev('SvelteDOMAddEventListener', { node, event, handler, modifiers });
64
-
65
- const dispose = listen(node, event, handler, options);
66
- return () => {
67
- dispatch_dev('SvelteDOMRemoveEventListener', { node, event, handler, modifiers });
68
- dispose();
69
- };
70
- }
71
-
72
- function attr_dev(node, attribute, value) {
73
- attr(node, attribute, value);
74
-
75
- if (value == null) dispatch_dev('SvelteDOMRemoveAttribute', { node, attribute });
76
- else dispatch_dev('SvelteDOMSetAttribute', { node, attribute, value });
77
- }
78
-
79
- function prop_dev(node, property, value) {
80
- node[property] = value;
81
-
82
- dispatch_dev('SvelteDOMSetProperty', { node, property, value });
83
- }
84
-
85
- function dataset_dev(node, property, value) {
86
- node.dataset[property] = value;
87
-
88
- dispatch_dev('SvelteDOMSetDataset', { node, property, value });
89
- }
90
-
91
- function set_data_dev(text, data) {
92
- data = '' + data;
93
- if (text.data === data) return;
94
- dispatch_dev('SvelteDOMSetData', { node: text, data });
95
- text.data = (data );
96
- }
97
-
98
- function set_data_contenteditable_dev(text, data) {
99
- data = '' + data;
100
- if (text.wholeText === data) return;
101
- dispatch_dev('SvelteDOMSetData', { node: text, data });
102
- text.data = (data );
103
- }
104
-
105
- function set_data_maybe_contenteditable_dev(text, data, attr_value) {
106
- if (~contenteditable_truthy_values.indexOf(attr_value)) {
107
- set_data_contenteditable_dev(text, data);
108
- } else {
109
- set_data_dev(text, data);
110
- }
111
- }
112
-
113
- function validate_each_argument(arg) {
114
- if (typeof arg !== 'string' && !(arg && typeof arg === 'object' && 'length' in arg)) {
115
- let msg = '{#each} only iterates over array-like objects.';
116
- if (typeof Symbol === 'function' && arg && Symbol.iterator in arg) {
117
- msg += ' You can use a spread to convert this iterable into an array.';
118
- }
119
- throw new Error(msg);
120
- }
121
- }
122
-
123
- function validate_slots(name, slot, keys) {
124
- for (const slot_key of Object.keys(slot)) {
125
- if (!~keys.indexOf(slot_key)) {
126
- console.warn(`<${name}> received an unexpected slot "${slot_key}".`);
127
- }
128
- }
129
- }
130
-
131
- function validate_dynamic_element(tag) {
132
- const is_string = typeof tag === 'string';
133
- if (tag && !is_string) {
134
- throw new Error('<svelte:element> expects "this" attribute to be a string.');
135
- }
136
- }
137
-
138
- function validate_void_dynamic_element(tag) {
139
- if (tag && is_void(tag)) {
140
- console.warn(
141
- `<svelte:element this="${tag}"> is self-closing and cannot have content.`
142
- );
143
- }
144
- }
145
-
146
- function construct_svelte_component_dev(component, props) {
147
- const error_message = 'this={...} of <svelte:component> should specify a Svelte component.';
148
- try {
149
- const instance = new component(props);
150
- if (!instance.$$ || !instance.$set || !instance.$on || !instance.$destroy) {
151
- throw new Error(error_message);
152
- }
153
- return instance;
154
- } catch (err) {
155
- const { message } = err;
156
- if (typeof message === 'string' && message.indexOf('is not a constructor') !== -1) {
157
- throw new Error(error_message);
158
- } else {
159
- throw err;
160
- }
161
- }
162
- }
163
-
164
-
165
-
166
-
167
-
168
-
169
-
170
-
171
-
172
-
173
-
174
-
175
-
176
-
177
-
178
-
179
-
180
-
181
-
182
-
183
-
184
-
185
- /**
186
- * Base class for Svelte components with some minor dev-enhancements. Used when dev=true.
187
- *
188
- * Can be used to create strongly typed Svelte components.
189
- *
190
- * ### Example:
191
- *
192
- * You have component library on npm called `component-library`, from which
193
- * you export a component called `MyComponent`. For Svelte+TypeScript users,
194
- * you want to provide typings. Therefore you create a `index.d.ts`:
195
- * ```ts
196
- * import { SvelteComponent } from "svelte";
197
- * export class MyComponent extends SvelteComponent<{foo: string}> {}
198
- * ```
199
- * Typing this makes it possible for IDEs like VS Code with the Svelte extension
200
- * to provide intellisense and to use the component like this in a Svelte file
201
- * with TypeScript:
202
- * ```svelte
203
- * <script lang="ts">
204
- * import { MyComponent } from "component-library";
205
- * </script>
206
- * <MyComponent foo={'bar'} />
207
- * ```
208
- */
209
- class SvelteComponentDev
210
-
211
-
212
-
213
- extends SvelteComponent {
214
- /**
215
- * @private
216
- * For type checking capabilities only.
217
- * Does not exist at runtime.
218
- * ### DO NOT USE!
219
- */
220
-
221
- /**
222
- * @private
223
- * For type checking capabilities only.
224
- * Does not exist at runtime.
225
- * ### DO NOT USE!
226
- */
227
-
228
- /**
229
- * @private
230
- * For type checking capabilities only.
231
- * Does not exist at runtime.
232
- * ### DO NOT USE!
233
- */
234
-
235
-
236
- constructor(options) {
237
- if (!options || (!options.target && !options.$$inline)) {
238
- throw new Error("'target' is a required option");
239
- }
240
-
241
- super();
242
- }
243
-
244
- $destroy() {
245
- super.$destroy();
246
- this.$destroy = () => {
247
- console.warn('Component was already destroyed'); // eslint-disable-line no-console
248
- };
249
- }
250
-
251
- $capture_state() {}
252
-
253
- $inject_state() {}
254
- }
255
-
256
- // eslint-disable-next-line @typescript-eslint/no-empty-interface
257
-
258
-
259
-
260
-
261
-
262
-
263
- /**
264
- * @deprecated Use `SvelteComponent` instead. See PR for more information: https://github.com/sveltejs/svelte/pull/8512
265
- */
266
- class SvelteComponentTyped
267
-
268
-
269
-
270
- extends SvelteComponentDev {}
271
-
272
- /**
273
- * Convenience type to get the type of a Svelte component. Useful for example in combination with
274
- * dynamic components using `<svelte:component>`.
275
- *
276
- * Example:
277
- * ```html
278
- * <script lang="ts">
279
- * import type { ComponentType, SvelteComponent } from 'svelte';
280
- * import Component1 from './Component1.svelte';
281
- * import Component2 from './Component2.svelte';
282
- *
283
- * const component: ComponentType = someLogic() ? Component1 : Component2;
284
- * const componentOfCertainSubType: ComponentType<SvelteComponent<{ needsThisProp: string }>> = someLogic() ? Component1 : Component2;
285
- * </script>
286
- *
287
- * <svelte:component this={component} />
288
- * <svelte:component this={componentOfCertainSubType} needsThisProp="hello" />
289
- * ```
290
- */
291
-
292
-
293
-
294
-
295
-
296
-
297
-
298
-
299
-
300
-
301
-
302
-
303
-
304
-
305
-
306
-
307
-
308
-
309
-
310
-
311
-
312
-
313
-
314
-
315
-
316
-
317
-
318
-
319
-
320
-
321
-
322
-
323
-
324
-
325
-
326
-
327
-
328
-
329
-
330
-
331
-
332
-
333
- function loop_guard(timeout) {
334
- const start = Date.now();
335
- return () => {
336
- if (Date.now() - start > timeout) {
337
- throw new Error('Infinite loop detected');
338
- }
339
- };
340
- }
341
-
342
- export { SvelteComponentDev, SvelteComponentTyped, append_dev, append_hydration_dev, attr_dev, construct_svelte_component_dev, dataset_dev, detach_after_dev, detach_before_dev, detach_between_dev, detach_dev, dispatch_dev, insert_dev, insert_hydration_dev, is_void, listen_dev, loop_guard, prop_dev, set_data_contenteditable_dev, set_data_dev, set_data_maybe_contenteditable_dev, validate_dynamic_element, validate_each_argument, validate_slots, validate_void_dynamic_element };
@@ -1,199 +0,0 @@
1
- import { custom_event, append, append_hydration, insert, insert_hydration, detach, listen, attr, contenteditable_truthy_values, SvelteComponent } from './Component-889ad17e.mjs';
2
-
3
- /** regex of all html void element names */
4
- const void_element_names = /^(?:area|base|br|col|command|embed|hr|img|input|keygen|link|meta|param|source|track|wbr)$/;
5
- function is_void(name) {
6
- return void_element_names.test(name) || name.toLowerCase() === '!doctype';
7
- }
8
-
9
- function dispatch_dev(type, detail) {
10
- document.dispatchEvent(custom_event(type, Object.assign({ version: '3.58.0' }, detail), { bubbles: true }));
11
- }
12
- function append_dev(target, node) {
13
- dispatch_dev('SvelteDOMInsert', { target, node });
14
- append(target, node);
15
- }
16
- function append_hydration_dev(target, node) {
17
- dispatch_dev('SvelteDOMInsert', { target, node });
18
- append_hydration(target, node);
19
- }
20
- function insert_dev(target, node, anchor) {
21
- dispatch_dev('SvelteDOMInsert', { target, node, anchor });
22
- insert(target, node, anchor);
23
- }
24
- function insert_hydration_dev(target, node, anchor) {
25
- dispatch_dev('SvelteDOMInsert', { target, node, anchor });
26
- insert_hydration(target, node, anchor);
27
- }
28
- function detach_dev(node) {
29
- dispatch_dev('SvelteDOMRemove', { node });
30
- detach(node);
31
- }
32
- function detach_between_dev(before, after) {
33
- while (before.nextSibling && before.nextSibling !== after) {
34
- detach_dev(before.nextSibling);
35
- }
36
- }
37
- function detach_before_dev(after) {
38
- while (after.previousSibling) {
39
- detach_dev(after.previousSibling);
40
- }
41
- }
42
- function detach_after_dev(before) {
43
- while (before.nextSibling) {
44
- detach_dev(before.nextSibling);
45
- }
46
- }
47
- function listen_dev(node, event, handler, options, has_prevent_default, has_stop_propagation, has_stop_immediate_propagation) {
48
- const modifiers = options === true ? ['capture'] : options ? Array.from(Object.keys(options)) : [];
49
- if (has_prevent_default)
50
- modifiers.push('preventDefault');
51
- if (has_stop_propagation)
52
- modifiers.push('stopPropagation');
53
- if (has_stop_immediate_propagation)
54
- modifiers.push('stopImmediatePropagation');
55
- dispatch_dev('SvelteDOMAddEventListener', { node, event, handler, modifiers });
56
- const dispose = listen(node, event, handler, options);
57
- return () => {
58
- dispatch_dev('SvelteDOMRemoveEventListener', { node, event, handler, modifiers });
59
- dispose();
60
- };
61
- }
62
- function attr_dev(node, attribute, value) {
63
- attr(node, attribute, value);
64
- if (value == null)
65
- dispatch_dev('SvelteDOMRemoveAttribute', { node, attribute });
66
- else
67
- dispatch_dev('SvelteDOMSetAttribute', { node, attribute, value });
68
- }
69
- function prop_dev(node, property, value) {
70
- node[property] = value;
71
- dispatch_dev('SvelteDOMSetProperty', { node, property, value });
72
- }
73
- function dataset_dev(node, property, value) {
74
- node.dataset[property] = value;
75
- dispatch_dev('SvelteDOMSetDataset', { node, property, value });
76
- }
77
- function set_data_dev(text, data) {
78
- data = '' + data;
79
- if (text.data === data)
80
- return;
81
- dispatch_dev('SvelteDOMSetData', { node: text, data });
82
- text.data = data;
83
- }
84
- function set_data_contenteditable_dev(text, data) {
85
- data = '' + data;
86
- if (text.wholeText === data)
87
- return;
88
- dispatch_dev('SvelteDOMSetData', { node: text, data });
89
- text.data = data;
90
- }
91
- function set_data_maybe_contenteditable_dev(text, data, attr_value) {
92
- if (~contenteditable_truthy_values.indexOf(attr_value)) {
93
- set_data_contenteditable_dev(text, data);
94
- }
95
- else {
96
- set_data_dev(text, data);
97
- }
98
- }
99
- function validate_each_argument(arg) {
100
- if (typeof arg !== 'string' && !(arg && typeof arg === 'object' && 'length' in arg)) {
101
- let msg = '{#each} only iterates over array-like objects.';
102
- if (typeof Symbol === 'function' && arg && Symbol.iterator in arg) {
103
- msg += ' You can use a spread to convert this iterable into an array.';
104
- }
105
- throw new Error(msg);
106
- }
107
- }
108
- function validate_slots(name, slot, keys) {
109
- for (const slot_key of Object.keys(slot)) {
110
- if (!~keys.indexOf(slot_key)) {
111
- console.warn(`<${name}> received an unexpected slot "${slot_key}".`);
112
- }
113
- }
114
- }
115
- function validate_dynamic_element(tag) {
116
- const is_string = typeof tag === 'string';
117
- if (tag && !is_string) {
118
- throw new Error('<svelte:element> expects "this" attribute to be a string.');
119
- }
120
- }
121
- function validate_void_dynamic_element(tag) {
122
- if (tag && is_void(tag)) {
123
- console.warn(`<svelte:element this="${tag}"> is self-closing and cannot have content.`);
124
- }
125
- }
126
- function construct_svelte_component_dev(component, props) {
127
- const error_message = 'this={...} of <svelte:component> should specify a Svelte component.';
128
- try {
129
- const instance = new component(props);
130
- if (!instance.$$ || !instance.$set || !instance.$on || !instance.$destroy) {
131
- throw new Error(error_message);
132
- }
133
- return instance;
134
- }
135
- catch (err) {
136
- const { message } = err;
137
- if (typeof message === 'string' && message.indexOf('is not a constructor') !== -1) {
138
- throw new Error(error_message);
139
- }
140
- else {
141
- throw err;
142
- }
143
- }
144
- }
145
- /**
146
- * Base class for Svelte components with some minor dev-enhancements. Used when dev=true.
147
- *
148
- * Can be used to create strongly typed Svelte components.
149
- *
150
- * ### Example:
151
- *
152
- * You have component library on npm called `component-library`, from which
153
- * you export a component called `MyComponent`. For Svelte+TypeScript users,
154
- * you want to provide typings. Therefore you create a `index.d.ts`:
155
- * ```ts
156
- * import { SvelteComponent } from "svelte";
157
- * export class MyComponent extends SvelteComponent<{foo: string}> {}
158
- * ```
159
- * Typing this makes it possible for IDEs like VS Code with the Svelte extension
160
- * to provide intellisense and to use the component like this in a Svelte file
161
- * with TypeScript:
162
- * ```svelte
163
- * <script lang="ts">
164
- * import { MyComponent } from "component-library";
165
- * </script>
166
- * <MyComponent foo={'bar'} />
167
- * ```
168
- */
169
- class SvelteComponentDev extends SvelteComponent {
170
- constructor(options) {
171
- if (!options || (!options.target && !options.$$inline)) {
172
- throw new Error("'target' is a required option");
173
- }
174
- super();
175
- }
176
- $destroy() {
177
- super.$destroy();
178
- this.$destroy = () => {
179
- console.warn('Component was already destroyed'); // eslint-disable-line no-console
180
- };
181
- }
182
- $capture_state() { }
183
- $inject_state() { }
184
- }
185
- /**
186
- * @deprecated Use `SvelteComponent` instead. See PR for more information: https://github.com/sveltejs/svelte/pull/8512
187
- */
188
- class SvelteComponentTyped extends SvelteComponentDev {
189
- }
190
- function loop_guard(timeout) {
191
- const start = Date.now();
192
- return () => {
193
- if (Date.now() - start > timeout) {
194
- throw new Error('Infinite loop detected');
195
- }
196
- };
197
- }
198
-
199
- export { SvelteComponentDev, SvelteComponentTyped, append_dev, append_hydration_dev, attr_dev, construct_svelte_component_dev, dataset_dev, detach_after_dev, detach_before_dev, detach_between_dev, detach_dev, dispatch_dev, insert_dev, insert_hydration_dev, is_void, listen_dev, loop_guard, prop_dev, set_data_contenteditable_dev, set_data_dev, set_data_maybe_contenteditable_dev, validate_dynamic_element, validate_each_argument, validate_slots, validate_void_dynamic_element };